Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
Display3D.h
1
15
16#pragma once
17
28
29#include <vector>
30#include <map>
31
32#include "DGtal/dec/DiscreteExteriorCalculus.h"
33
34#include "Eigen/Geometry"
35
36#include "DGtal/helpers/StdDefs.h"
37
38#include "DGtal/io/Color.h"
39#include "DGtal/kernel/CanonicEmbedder.h"
40
41#include "DGtal/topology/KhalimskySpaceND.h"
42#include "DGtal/topology/CanonicCellEmbedder.h"
43#include "DGtal/topology/CanonicSCellEmbedder.h"
44
45// Objects to draw
46#include "DGtal/base/ConstRangeAdapter.h"
47
48#include "DGtal/shapes/Mesh.h"
49
50#include "DGtal/dec/DiscreteExteriorCalculus.h"
51
52#include "DGtal/topology/Object.h"
53
54#include "DGtal/images/ImageAdapter.h"
55#include "DGtal/images/ConstImageAdapter.h"
56#include "DGtal/images/ImageContainerBySTLVector.h"
57
58#include "DGtal/geometry/tools/SphericalAccumulator.h"
59#include "DGtal/geometry/curves/StandardDSS6Computer.h"
60#include "DGtal/geometry/curves/Naive3DDSSComputer.h"
61#include "DGtal/geometry/curves/GridCurve.h"
62
63namespace DGtal {
64 namespace drawutils { // Namespace for some utilities
71 template<size_t I>
72 std::vector<std::array<size_t, I>> makeIndices(size_t N);
73
83 template<typename T>
84 std::array<T, 8> getCubeVertices(T center, double size);
85
98 template<typename T, typename U>
99 void insertCubeVertices(U& dest, T center, double scale);
100
112 template <typename T>
113 std::array<T, 4> getAASquareVertices(T center, int orientation, double size);
114
128 template<typename U, typename T>
129 void insertAASquare(U& dest, T center, int orientation, double size);
130
147 template<typename T>
148 std::array<T, 8> getPrism(
149 T center, int orientation,
150 double size1, double size2, double shift1, double shift2
151 );
152
169 template<typename T, typename U>
170 void insertPrism(U& dest, T center, int orientation,
171 double size1, double size2, double shift1, double shift2);
172 } // drawutils
173
178 // Color of an object
179 Color color = Color(200, 200, 200, 255);
180 // When set, color is ignored and the viewer is free to choose
181 bool useDefaultColors = true;
182 // Maintains uniform scale of the object independently for easy access
183 double width = 1.0;
184
192 enum DrawMode : size_t {
193 DEFAULT = (1 << 0), //< Default mode
194 PAVING = (1 << 1), //< For voxels, render them as cubes
195 BALLS = (1 << 2), //< For voxels, render them as balls
196 ADJACENCIES = (1 << 3), //< For objects, draws adjacencies
197 GRID = (1 << 4), //< For domains, draws a grid
198 SIMPLIFIED = (1 << 5) //< For KCell, draws quads instead of prisms
199 };
200
201 size_t mode = static_cast<size_t>(DrawMode::DEFAULT);
202 };
203
207 enum class QuantityScale {
208 VERTEX = 0,
209 EDGE = 1,
210 FACE = 2,
211 CELL = 3,
212 UNKNOWN = 4 // Also used as a default to decide later
213 };
214
222 template<typename T>
223 struct Quantity {
224 using QType = std::map<std::string, std::vector<T>>;
225
226 QType& operator[](int idx) { return data[idx]; }
227
228 const QType& operator[](int idx) const { return data[idx]; }
229
231 return data[static_cast<size_t>(scale)];
232 };
233
234 const QType& operator[](const QuantityScale& scale) const {
235 return data[static_cast<size_t>(scale)];
236 };
237
238 std::array<QType, static_cast<size_t>(QuantityScale::UNKNOWN)> data;
239 };
240
246 template<typename RealPoint>
247 struct DisplayData {
258 std::size_t elementSize;
259
260 // Return the default quantity level associated with
261 // a given element size.
262 static constexpr auto getDefaultQuantityLevel = [](size_t eSize) {
263 switch(eSize) {
264 case 1: return QuantityScale::VERTEX;
265 case 2: return QuantityScale::EDGE;
266 case 0: // Polygonal meshes
267 case 3: // Triangle meshes
268 case 4: // Quad meshes
269 return QuantityScale::FACE;
270 case 8: return QuantityScale::CELL;
271 default:
273 };
274 };
275
276 // Indices for elements when elementSize is 0
277 std::vector<std::vector<uint32_t>> indices;
278
279 // List of vertices
280 std::vector<RealPoint> vertices;
281
282 // Transform of the object
283 Eigen::Affine3d transform = Eigen::Affine3d::Identity();
284
285 // Draw style of the object (color, scale)
287
288 // Color to apply to each element
290 // Vector to attach to each element
292 // Values to attach to each element (may serve for coloring)
294 };
295
300 double a, b, c; //< Normal components
301 double d; //< Offset
302
303 // Some style for rendering (colors)
305 };
306
326 template<typename T, typename Type>
328 WithQuantity(const T& object, const std::string& name, const Type& value, QuantityScale s = QuantityScale::UNKNOWN) :
329 scale(s), object(object), name(name)
330 {
331 values.push_back(value);
332 }
333
334 WithQuantity(const T& object, const std::string& name, const std::vector<Type>& values, QuantityScale s = QuantityScale::UNKNOWN) :
335 scale(s), object(object), name(name)
336 {
337 this->values = values;
338 }
339
340 // Scale to apply the quantity at
342
343 // Copy of the object
345 // Copy of the values to attach
346 std::vector<Type> values;
347 // Name of the property
348 std::string name;
349 };
350
376 template < typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
377 class Display3D {
378 public:
379 Display3D(const KSpace& space) :
380 myKSpace(space),
383 { }
384
386
387 // Usefull definitions
388 using Point = typename Space::Point;
389 using KCell = typename KSpace::Cell;
390 using SCell = typename KSpace::SCell;
391 using RealPoint = typename Space::RealPoint ;
392
396
402 struct Callback{
414 virtual void OnAttach(void* viewer) {};
420 virtual void OnUI(void* viewerData) {};
431 virtual void OnClick(const std::string& name, size_t index, const DisplayData<RealPoint>& data, void* viewerData) {};
432
433 // Pointer to the Display3D instance the callback is attached to
435 };
436 public: // General commands
442 virtual void show() = 0;
446 virtual void renderNewData() = 0;
447
453 virtual void renderAll() {
454 myToRender.clear();
455 myToRender.reserve(data.size());
456
457 for (const auto& m : data)
458 myToRender.push_back(m.first);
459
461 }
462
465 virtual void clearView() = 0;
469 virtual void clear();
473 virtual void setCallback(Callback* callback);
474
475 public: // Group/Lists managements
493 std::string newList(const std::string& name, size_t eSize = 0);
494
500 bool setCurrentList(const std::string& name);
501
507 bool canCreateNewList(size_t elementSize) const;
508
517 std::string createOrReuseList(const std::string& name, size_t elementSize);
518
526
527 // Some shortcuts for clearer code
528
529 std::string newCubeList(const std::string& name) { return newList(name, 8); }
530 std::string newBallList(const std::string& name) { return newList(name, 1); }
531 std::string newLineList(const std::string& name) { return newList(name, 2); }
532 std::string newQuadList(const std::string& name) { return newList(name, 4); }
533 std::string newPolygonList(const std::string& name) { return newList(name, 0); }
534 std::string newTriangleList(const std::string& name) { return newList(name, 3); }
535 std::string newVolumetricList(const std::string& name) { return newList(name, 8); }
536
537 std::string createOrReuseCubeList(const std::string& name) { return createOrReuseList(name, 8); }
538 std::string createOrReuseBallList(const std::string& name) { return createOrReuseList(name, 1); }
539 std::string createOrReuseLineList(const std::string& name) { return createOrReuseList(name, 2); }
540 std::string createOrReuseQuadList(const std::string& name) { return createOrReuseList(name, 4); }
541 std::string createOrReusePolygonList(const std::string& name) { return createOrReuseList(name, 0); }
542 std::string createOrReuseTriangleList(const std::string& name) { return createOrReuseList(name, 3); }
543 std::string createOrReuseVolumetricList(const std::string& name) { return createOrReuseList(name, 8); }
544
545 public: // Draw commands
546
552 template<typename Obj>
553 Display3D& operator<<(const Obj& obj);
554
555 // @brief Draws a Point with integer coodinates
556 std::string draw(const Point& p, const std::string& uname = "Point_{i}");
557
558 // @brief Draws a RealPoint with real coodinates
559 std::string draw(const RealPoint& rp, const std::string& uname = "Point_{i}");
560
561 // @brief Draws a vector of objects
562 template<typename T>
563 std::string draw(const std::vector<T>& vec, const std::string& uname = "");
564
565 // @brief Draws a range of any object
566 template<typename A, typename B, typename C>
567 std::string draw(const ConstRangeAdapter<A, B, C> range, const std::string& uname = "");
568
569 // @brief Draws any object provided through a ConstIteratorAdapter
570 template<typename A, typename B, typename C>
571 std::string draw(const ConstIteratorAdapter<A, B, C>& adapter, const std::string& uname = "");
572
573 // @brief Draws a grid curve
574 std::string draw(const GridCurve<KSpace>& curve, const std::string& uname = "GridCurve_{i}");
575
576 // @brief Draws a grid curve as mid points
577 std::string draw(const typename GridCurve<KSpace>::MidPointsRange& range, const std::string& uname = "MidPoints_{i}");
578
579 // @brief Draws a grid curve as arrows
580 std::string draw(const typename GridCurve<KSpace>::ArrowsRange& range, const std::string& uname = "Arrows_{i}");
581
582 // @brief Draws a DiscreteExteriorCalculus
583 template<DGtal::Dimension emb, DGtal::Dimension amb, typename Algebra, typename Int>
584 std::string draw(const DiscreteExteriorCalculus<emb, amb, Algebra, Int>& calc, const std::string& uname = "Calculus_{i}");
585
586 // @brief Draws a KForm
587 template<typename Calculus, DGtal::Order order, DGtal::Duality duality>
588 std::string draw(const KForm<Calculus, order, duality>& kform, const std::string& uname = "KForm_{i}");
589
590 // @brief Draws a VectorField
591 template<typename Calculus, DGtal::Duality dual>
592 std::string draw(const VectorField<Calculus, dual>& field, const std::string& uname = "Field_{i}");
593
594 // @brief Draws an unsigned KCell
595 std::string draw(const KCell& cell, const std::string& name = "KCell_{i}_{d}d");
596
597 // @brief Draws a singed KCell
598 std::string draw(const SCell& cell, const std::string& name = "SCell_{i}_{d}d");
599
600 // @brief Draws a Domain
601 //
602 // Note: the default name has a special hex code in the begining
603 // so that string based view-order draws domain in the background
604 std::string draw(const HyperRectDomain<Space>& domain, const std::string& uname = "\xff Domain_{i}");
605
611 template<typename Vec>
612 std::string drawPolygon(const std::vector<Vec>& vertices, const std::string& uname = "Polygon_{i}");
613
614 // @brief Draws a ball
615 std::string drawBall(const RealPoint& c, const std::string& uname = "Ball_{i}");
616
617 // @brief Draws a line
618 std::string drawLine(const RealPoint& a, const RealPoint& b, const std::string& uname = "Line_{i}");
619
620 // @brief Draws a quad
621 std::string drawQuad(const RealPoint& a, const RealPoint& b, const RealPoint& c, const RealPoint& d, const std::string& uname = "Quad_{i}");
622
623 // @brief Draws a DigitalSet
624 template<typename Obj, typename Cont>
625 std::string draw(const DigitalSetByAssociativeContainer<Obj, Cont>& set, const std::string& name = "Set_{i}");
626
627 // @brief Draws an Object
628 template<typename Adj, typename Set>
629 std::string draw(const DGtal::Object<Adj, Set>& obj, const std::string& uname = "Object_{i}");
630
631 // @brief Draws an Image
632 template<typename D, typename T>
633 std::string draw(const ImageContainerBySTLVector<D, T>& image, const std::string& name = "Image_{i}");
634
635 // @brief Draws an Image
636 template <typename TImageContainer,
637 typename TNewDomain,
638 typename TFunctorD,
639 typename TNewValue,
640 typename TFunctorV,
641 typename TFunctorVm1>
642 std::string draw(const ImageAdapter<TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1>& adapter, const std::string& name = "Image_{i}");
643
644 // @brief Draws an Image
645 template <typename TImageContainer,
646 typename TNewDomain,
647 typename TFunctorD,
648 typename TNewValue,
649 typename TFunctorV>
650 std::string draw(const ConstImageAdapter<TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV>& adapter, const std::string& name = "Image_{i}");
651
652 // @brief Draws a mesh
653 template <typename Pt>
654 std::string draw(const Mesh<Pt>& mesh, const std::string& uname = "Mesh_{i}");
655
656 // @brief Draws a DSS6Computer
657 template<typename It, typename Int, int Con>
658 std::string draw(const StandardDSS6Computer<It, Int, Con>& computer, const std::string& uname = "Computer_{i}");
659
660 template<typename It, typename Int, int Con>
661 std::string draw(const Naive3DDSSComputer<It, Int, Con>& computer, const std::string& uname = "Computer_{i}");
662
663 // @brief Draws any object with a property
664 template<typename T, typename Type>
665 std::string draw(const WithQuantity<T, Type>& props, const std::string& uname = "");
666
667 template<typename Type>
668 void addQuantity(const std::string& oName, const std::string& qName, const Type& value, QuantityScale scale = QuantityScale::UNKNOWN);
669
670 template<typename Type>
671 void addQuantity(const std::string& oName, const std::string& qName, const std::vector<Type>& value, QuantityScale scale = QuantityScale::UNKNOWN);
672
673
674 // @brief Adds a clipping plane
675 std::string draw(const ClippingPlane& plane, const std::string& name = "");
676
677 // @brief Draws a Spherical Accumulator
678 template<typename T>
679 std::string draw(const SphericalAccumulator<T> accumulator, const std::string& uname = "SphericalAccumulator_{i}");
680
681 // @brief Set the current draw color
682 std::string draw(const DGtal::Color& color, const std::string& name = "");
683
684 // @brief Set the current draw color
685 void drawColor(const DGtal::Color& color);
686
687 // @brief Use default colors
689
690 // @brief Draws adjacencies of further Object
691 void drawAdjacencies(bool toggle = true);
692
693 // @brief Draws 2D KCell as simplifed mode
694 void drawAsSimplified(bool toggle = true);
695
696 // @brief Draws grid of further domains
697 void drawAsGrid(bool toggle = true);
698
699 // @brief Reset style
701
702 // @brief Draws voxels of further object, domains and points
704
705 // @brief Draws balls of further object, domains and points
707 private: // Draw commands
708 // To avoid confusion, keep this function as private:
709
710 // @brief Draws an /!\ arrow (NOT A LINE)
711 std::string draw(const std::pair<RealPoint, RealPoint>& arrow, const std::string& uname = "Arrow_{i}");
712
716 template<typename Range>
717 std::string drawGenericRange(const Range& range, const std::string& uname);
718
719 // @brief Draws an image through an iterator
720 template<typename T>
721 std::string drawImage(const std::string& uname, const T& image);
722
723 // @brief Draws a KCell (signed or not)
724 std::string drawKCell(std::string uname, const RealPoint& rp, bool xodd, bool yodd, bool zodd, bool hasSign, bool sign);
725
726 public:
727 // The user is responsible for using these wrong..
728 //
730 bool allowReuseList = false;
731
732 std::vector<ClippingPlane> planes;
733 // Leave access to the user for thin modifications
734 std::map<std::string, DisplayData<RealPoint>> data;
735
736 protected:
741
743 std::vector<std::string> myToRender;
744
745 std::string myCurrentName = "";
747 }; // Display3D
748} // DGtal
749
750#include "Display3D.ih"
751
Structure representing an RGB triple with alpha component.
Definition Color.h:77
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for d...
This class adapts any iterator so that operator* returns another element than the one pointed to by t...
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: DiscreteExteriorCalculus represents a calculus in the dec package. This is the main structure in...
void drawAdjacencies(bool toggle=true)
std::string newTriangleList(const std::string &name)
Definition Display3D.h:534
CanonicEmbedder< Space > Embedder
Definition Display3D.h:393
void drawAsSimplified(bool toggle=true)
std::string myCurrentName
Definition Display3D.h:745
std::string createOrReuseLineList(const std::string &name)
Definition Display3D.h:539
void setDefaultColors()
bool canCreateNewList(size_t elementSize) const
Tells if a list of a given elementSize can be reused.
std::string draw(const DiscreteExteriorCalculus< emb, amb, Algebra, Int > &calc, const std::string &uname="Calculus_{i}")
typename KSpace::Cell KCell
Definition Display3D.h:389
void drawAsGrid(bool toggle=true)
std::string draw(const DGtal::Color &color, const std::string &name="")
std::string drawPolygon(const std::vector< Vec > &vertices, const std::string &uname="Polygon_{i}")
Draws a polygon.
std::string createOrReuseQuadList(const std::string &name)
Definition Display3D.h:540
void drawColor(const DGtal::Color &color)
std::string draw(const DigitalSetByAssociativeContainer< Obj, Cont > &set, const std::string &name="Set_{i}")
std::string draw(const ConstIteratorAdapter< A, B, C > &adapter, const std::string &uname="")
std::string drawGenericRange(const Range &range, const std::string &uname)
Draws a range of object to the screen.
std::string draw(const Point &p, const std::string &uname="Point_{i}")
bool setCurrentList(const std::string &name)
Set the current group for further updates.
std::string createOrReuseList(const std::string &name, size_t elementSize)
Reuse a list if possible, otherwise create a new one.
std::string draw(const WithQuantity< T, Type > &props, const std::string &uname="")
typename KSpace::SCell SCell
Definition Display3D.h:390
std::string draw(const ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 > &adapter, const std::string &name="Image_{i}")
virtual void renderAll()
(Re)Render all data
Definition Display3D.h:453
std::string newList(const std::string &name, size_t eSize=0)
Create a new group.
std::string createOrReusePolygonList(const std::string &name)
Definition Display3D.h:541
std::string draw(const Naive3DDSSComputer< It, Int, Con > &computer, const std::string &uname="Computer_{i}")
std::string createOrReuseCubeList(const std::string &name)
Definition Display3D.h:537
virtual void setCallback(Callback *callback)
Sets callback.
std::string createOrReuseBallList(const std::string &name)
Definition Display3D.h:538
virtual void clearView()=0
Clear the screen.
std::string draw(const KForm< Calculus, order, duality > &kform, const std::string &uname="KForm_{i}")
std::string draw(const HyperRectDomain< Space > &domain, const std::string &uname="\xff Domain_{i}")
Embedder myEmbedder
Definition Display3D.h:738
std::map< std::string, DisplayData< RealPoint > > data
Definition Display3D.h:734
std::string drawKCell(std::string uname, const RealPoint &rp, bool xodd, bool yodd, bool zodd, bool hasSign, bool sign)
std::vector< std::string > myToRender
Definition Display3D.h:743
std::string draw(const Mesh< Pt > &mesh, const std::string &uname="Mesh_{i}")
std::string draw(const typename GridCurve< KSpace >::MidPointsRange &range, const std::string &uname="MidPoints_{i}")
CanonicSCellEmbedder< KSpace > SCellEmbedder
Definition Display3D.h:395
void addQuantity(const std::string &oName, const std::string &qName, const Type &value, QuantityScale scale=QuantityScale::UNKNOWN)
std::string draw(const std::vector< T > &vec, const std::string &uname="")
CanonicCellEmbedder< KSpace > CellEmbedder
Definition Display3D.h:394
std::string draw(const ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV > &adapter, const std::string &name="Image_{i}")
SCellEmbedder mySCellEmbedder
Definition Display3D.h:740
std::string createOrReuseVolumetricList(const std::string &name)
Definition Display3D.h:543
std::string drawQuad(const RealPoint &a, const RealPoint &b, const RealPoint &c, const RealPoint &d, const std::string &uname="Quad_{i}")
std::string drawBall(const RealPoint &c, const std::string &uname="Ball_{i}")
std::string draw(const ConstRangeAdapter< A, B, C > range, const std::string &uname="")
virtual void show()=0
Starts the event loop and display of elements.
std::string draw(const VectorField< Calculus, dual > &field, const std::string &uname="Field_{i}")
std::string draw(const typename GridCurve< KSpace >::ArrowsRange &range, const std::string &uname="Arrows_{i}")
std::string newBallList(const std::string &name)
Definition Display3D.h:530
std::string draw(const KCell &cell, const std::string &name="KCell_{i}_{d}d")
std::string createOrReuseTriangleList(const std::string &name)
Definition Display3D.h:542
std::string draw(const SphericalAccumulator< T > accumulator, const std::string &uname="SphericalAccumulator_{i}")
std::string newQuadList(const std::string &name)
Definition Display3D.h:532
void addQuantity(const std::string &oName, const std::string &qName, const std::vector< Type > &value, QuantityScale scale=QuantityScale::UNKNOWN)
CellEmbedder myCellEmbedder
Definition Display3D.h:739
std::string draw(const DGtal::Object< Adj, Set > &obj, const std::string &uname="Object_{i}")
std::string drawLine(const RealPoint &a, const RealPoint &b, const std::string &uname="Line_{i}")
DisplayStyle currentStyle
Definition Display3D.h:729
std::string draw(const GridCurve< KSpace > &curve, const std::string &uname="GridCurve_{i}")
virtual void renderNewData()=0
Renders newly added data.
std::string newVolumetricList(const std::string &name)
Definition Display3D.h:535
Display3D(const KSpace &space)
Definition Display3D.h:379
std::string draw(const SCell &cell, const std::string &name="SCell_{i}_{d}d")
std::string draw(const RealPoint &rp, const std::string &uname="Point_{i}")
void endCurrentGroup()
End current group and sets an invalid current group.
DisplayData< RealPoint > * myCurrentData
Definition Display3D.h:746
std::string draw(const StandardDSS6Computer< It, Int, Con > &computer, const std::string &uname="Computer_{i}")
std::string drawImage(const std::string &uname, const T &image)
typename Space::Point Point
Definition Display3D.h:388
std::string newLineList(const std::string &name)
Definition Display3D.h:531
typename Space::RealPoint RealPoint
Definition Display3D.h:391
std::string draw(const ClippingPlane &plane, const std::string &name="")
std::string newPolygonList(const std::string &name)
Definition Display3D.h:533
Callback * myCallback
Definition Display3D.h:742
std::string draw(const std::pair< RealPoint, RealPoint > &arrow, const std::string &uname="Arrow_{i}")
virtual void clear()
Clear the viewer, including screen and internal data.
std::string newCubeList(const std::string &name)
Definition Display3D.h:529
std::vector< ClippingPlane > planes
Definition Display3D.h:732
Display3D & operator<<(const Obj &obj)
Draw object with stream API.
std::string draw(const ImageContainerBySTLVector< D, T > &image, const std::string &name="Image_{i}")
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
Definition GridCurve.h:173
ConstRangeAdapter< typename Storage::const_iterator, CanonicSCellEmbedder< KSpace >, typename KSpace::Space::RealPoint > MidPointsRange
Definition GridCurve.h:425
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToArrow< KSpace >, std::pair< Point, Vector > > ArrowsRange
Definition GridCurve.h:437
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Aim: implements an image adapter with a given domain (i.e. a subdomain) and 3 functors : g for domain...
Aim: KForm represents discrete kforms in the dec package.
Definition KForm.h:66
SignedKhalimskyCell< dim, Integer > SCell
KhalimskyCell< dim, Integer > Cell
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Definition Mesh.h:92
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
Aim: An object (or digital object) represents a set in some digital space associated with a digital t...
Definition Object.h:120
PointVector< dim, Integer > Point
Definition SpaceND.h:110
PointVector< dim, double > RealPoint
Definition SpaceND.h:117
Aim: implements an accumulator (as histograms for 1D scalars) adapted to spherical point samples.
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
Aim: VectorField represents a discrete vector field in the dec package. Vector field values are attac...
Definition VectorField.h:68
float scale
void insertCubeVertices(U &dest, T center, double scale)
Insert cube vertices into an array.
std::vector< std::array< size_t, I > > makeIndices(size_t N)
Create a list of indices for a vertex array with independent elements.
std::array< T, 8 > getCubeVertices(T center, double size)
Return the vertices of a cube.
void insertAASquare(U &dest, T center, int orientation, double size)
Insert vertices of a square into a container.
void insertPrism(U &dest, T center, int orientation, double size1, double size2, double shift1, double shift2)
Insert the vertices of a prism into a container.
std::array< T, 8 > getPrism(T center, int orientation, double size1, double size2, double shift1, double shift2)
Return the vertices of a prism.
std::array< T, 4 > getAASquareVertices(T center, int orientation, double size)
Return the vertices of an axis aligned square.
DGtal is the top-level namespace which contains all DGtal functions and types.
@ UNKNOWN
Definition Topology.h:52
QuantityScale
Enumerate where quantities can be applied.
Definition Display3D.h:207
Aim: A trivial embedder for signed and unsigned cell, which corresponds to the canonic injection of c...
Aim: A trivial embedder for digital points, which corresponds to the canonic injection of Zn into Rn.
Aim: A trivial embedder for signed cell, which corresponds to the canonic injection of cell centroids...
Clipping plane.
Definition Display3D.h:299
DisplayStyle style
Definition Display3D.h:304
A general callback for the viewer to give control to the user.
Definition Display3D.h:402
virtual void OnAttach(void *viewer)
Called when setCallback is performed on the viewer.
Definition Display3D.h:414
Display3D< Space, KSpace > * viewer
Definition Display3D.h:434
virtual void OnUI(void *viewerData)
Called to render or interact with some UI.
Definition Display3D.h:420
virtual void OnClick(const std::string &name, size_t index, const DisplayData< RealPoint > &data, void *viewerData)
Called when an element is clicked.
Definition Display3D.h:431
Data required to display an object.
Definition Display3D.h:247
Eigen::Affine3d transform
Definition Display3D.h:283
Quantity< Color > colorQuantities
Definition Display3D.h:289
Quantity< RealPoint > vectorQuantities
Definition Display3D.h:291
static constexpr auto getDefaultQuantityLevel
Definition Display3D.h:262
std::vector< std::vector< uint32_t > > indices
Definition Display3D.h:277
std::size_t elementSize
Definition Display3D.h:258
std::vector< RealPoint > vertices
Definition Display3D.h:280
DisplayStyle style
Definition Display3D.h:286
Quantity< double > scalarQuantities
Definition Display3D.h:293
Style of display of an element.
Definition Display3D.h:177
DrawMode
List available draw modes.
Definition Display3D.h:192
Wrapper for array of quantities.
Definition Display3D.h:223
const QType & operator[](int idx) const
Definition Display3D.h:228
QType & operator[](const QuantityScale &scale)
Definition Display3D.h:230
QType & operator[](int idx)
Definition Display3D.h:226
std::map< std::string, std::vector< T > > QType
Definition Display3D.h:224
std::array< QType, static_cast< size_t >(QuantityScale::UNKNOWN)> data
Definition Display3D.h:238
const QType & operator[](const QuantityScale &scale) const
Definition Display3D.h:234
Attach a property to an element.
Definition Display3D.h:327
std::string name
Definition Display3D.h:348
std::vector< Type > values
Definition Display3D.h:346
WithQuantity(const T &object, const std::string &name, const Type &value, QuantityScale s=QuantityScale::UNKNOWN)
Definition Display3D.h:328
QuantityScale scale
Definition Display3D.h:341
WithQuantity(const T &object, const std::string &name, const std::vector< Type > &values, QuantityScale s=QuantityScale::UNKNOWN)
Definition Display3D.h:334
unsigned int index(DGtal::uint32_t n, unsigned int b)
Definition testBits.cpp:44
Domain domain
Image image(domain)
ImageContainerBySTLVector< HyperRectDomain< Z2i::Space >, std::unordered_set< Z2i::Point > > TImageContainer