DGtal 2.1.1
Loading...
Searching...
No Matches
Display3D.h
1
16#pragma once
17
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 ClippingPlane(double _a, double _b, double _c, double _d) :
301 a(_a), b(_b), c(_c), d(_d)
302 { }
303
304 double a, b, c; //< Normal components
305 double d; //< Offset
306
307 // Some style for rendering (colors)
309 };
310
330 template<typename T, typename Type>
332 WithQuantity(const T& _object, const std::string& _name, const Type& value, QuantityScale s = QuantityScale::UNKNOWN) :
333 scale(s), object(_object), name(_name)
334 {
335 values.push_back(value);
336 }
337
338 WithQuantity(const T& _object, const std::string& _name, const std::vector<Type>& _values, QuantityScale s = QuantityScale::UNKNOWN) :
339 scale(s), object(_object), name(_name)
340 {
341 this->values = _values;
342 }
343
344 // Scale to apply the quantity at
346
347 // Copy of the object
349 // Copy of the values to attach
350 std::vector<Type> values;
351 // Name of the property
352 std::string name;
353 };
354
380 template < typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
381 class Display3D {
382 public:
383 Display3D(const KSpace& space) :
384 myKSpace(space),
387 { }
388
390
391 virtual ~Display3D() {};
392
393 // Useful definitions
394 using Point = typename Space::Point;
395 using KCell = typename KSpace::Cell;
396 using SCell = typename KSpace::SCell;
397 using RealPoint = typename Space::RealPoint ;
398
402
408 struct Callback{
420 virtual void OnAttach(void* _viewer) { ((void) _viewer); };
426 virtual void OnUI(void* viewerData) { ((void) viewerData); };
437 virtual void OnClick(const std::string& name, size_t index, const DisplayData<RealPoint>& data, void* viewerData) {((void) name); ((void) index); ((void) data); ((void) viewerData); };
438
439 // Pointer to the Display3D instance the callback is attached to
441 };
442 public: // General commands
448 virtual void show() = 0;
452 virtual void renderNewData() = 0;
453
459 virtual void renderAll() {
460 myToRender.clear();
461 myToRender.reserve(data.size());
462
463 for (const auto& m : data)
464 myToRender.push_back(m.first);
465
467 }
471 virtual void clearView() = 0;
475 virtual void clear();
479 virtual void setCallback(Callback* callback);
480
481 public: // Group/Lists managements
499 std::string newList(const std::string& name, size_t eSize = 0);
500
506 bool setCurrentList(const std::string& name);
507
513 bool canCreateNewList(size_t elementSize) const;
514
523 std::string createOrReuseList(const std::string& name, size_t elementSize);
524
532
533 // Some shortcuts for clearer code
534
535 std::string newCubeList(const std::string& name) { return newList(name, 1); }
536 std::string newLineList(const std::string& name) { return newList(name, 2); }
537 std::string newQuadList(const std::string& name) { return newList(name, 4); }
538 std::string newPolygonList(const std::string& name) { return newList(name, 0); }
539 std::string newTriangleList(const std::string& name) { return newList(name, 3); }
540 std::string newVolumetricList(const std::string& name) { return newList(name, 8); }
541
542 std::string newBallList(const std::string& name) {
543 auto n = newList(name, 1);
544 myCurrentData->style.mode |= DisplayStyle::BALLS;
545 return n;
546 }
547
548 std::string createOrReuseCubeList(const std::string& name) { return createOrReuseList(name, 1); }
549 std::string createOrReuseLineList(const std::string& name) { return createOrReuseList(name, 2); }
550 std::string createOrReuseQuadList(const std::string& name) { return createOrReuseList(name, 4); }
551 std::string createOrReusePolygonList(const std::string& name) { return createOrReuseList(name, 0); }
552 std::string createOrReuseTriangleList(const std::string& name) { return createOrReuseList(name, 3); }
553 std::string createOrReuseVolumetricList(const std::string& name) { return createOrReuseList(name, 8); }
554 std::string createOrReuseBallList(const std::string& name) {
555 auto n = createOrReuseList(name, 1);
556 myCurrentData->style.mode |= DisplayStyle::BALLS;
557 return n;
558 }
559
560 public: // Draw commands
561
567 template<typename Obj>
568 Display3D& operator<<(const Obj& obj);
569
570 // @brief Draws a Point with integer coordinates
571 std::string draw(const Point& p, const std::string& uname = "Point_{i}");
572
573 // @brief Draws a RealPoint with real coordinates
574 std::string draw(const RealPoint& rp, const std::string& uname = "Point_{i}");
575
576 // @brief Draws a vector of objects
577 template<typename T>
578 std::string draw(const std::vector<T>& vec, const std::string& uname = "");
579
580 // @brief Draws a range of any object
581 template<typename A, typename B, typename C>
582 std::string draw(const ConstRangeAdapter<A, B, C> range, const std::string& uname = "");
583
584 // @brief Draws any object provided through a ConstIteratorAdapter
585 template<typename A, typename B, typename C>
586 std::string draw(const ConstIteratorAdapter<A, B, C>& adapter, const std::string& uname = "");
587
588 // @brief Draws a grid curve
589 std::string draw(const GridCurve<KSpace>& curve, const std::string& uname = "GridCurve_{i}");
590
591 // @brief Draws a grid curve as mid points
592 std::string draw(const typename GridCurve<KSpace>::MidPointsRange& range, const std::string& uname = "MidPoints_{i}");
593
594 // @brief Draws a grid curve as arrows
595 std::string draw(const typename GridCurve<KSpace>::ArrowsRange& range, const std::string& uname = "Arrows_{i}");
596
597 // @brief Draws a DiscreteExteriorCalculus
598 template<DGtal::Dimension emb, DGtal::Dimension amb, typename Algebra, typename Int>
599 std::string draw(const DiscreteExteriorCalculus<emb, amb, Algebra, Int>& calc, const std::string& uname = "Calculus_{i}");
600
601 // @brief Draws a KForm
602 template<typename Calculus, DGtal::Order order, DGtal::Duality duality>
603 std::string draw(const KForm<Calculus, order, duality>& kform, const std::string& uname = "KForm_{i}");
604
605 // @brief Draws a VectorField
606 template<typename Calculus, DGtal::Duality dual>
607 std::string draw(const VectorField<Calculus, dual>& field, const std::string& uname = "Field_{i}");
608
609 // @brief Draws an unsigned KCell
610 std::string draw(const KCell& cell, const std::string& name = "KCell_{i}_{d}d");
611
612 // @brief Draws a signed KCell
613 std::string draw(const SCell& cell, const std::string& name = "SCell_{i}_{d}d");
614
615 // @brief Draws a Domain
616 //
617 // Note: the default name has a special hex code in the beginning
618 // so that string based view-order draws domain in the background
619 std::string draw(const HyperRectDomain<Space>& domain, const std::string& uname = "\xff Domain_{i}");
620
626 template<typename Vec>
627 std::string drawPolygon(const std::vector<Vec>& vertices, const std::string& uname = "Polygon_{i}");
628
629 // @brief Draws a ball
630 std::string drawBall(const RealPoint& c, const std::string& uname = "Ball_{i}");
631
632 // @brief Draws a line
633 std::string drawLine(const RealPoint& a, const RealPoint& b, const std::string& uname = "Line_{i}");
634
635 // @brief Draws a quad
636 std::string drawQuad(const RealPoint& a, const RealPoint& b, const RealPoint& c, const RealPoint& d, const std::string& uname = "Quad_{i}");
637
638 // @brief Draws a DigitalSet
639 template<typename Obj, typename Cont>
640 std::string draw(const DigitalSetByAssociativeContainer<Obj, Cont>& set, const std::string& name = "Set_{i}");
641
642 // @brief Draws an Object
643 template<typename Adj, typename Set>
644 std::string draw(const DGtal::Object<Adj, Set>& obj, const std::string& uname = "Object_{i}");
645
646 // @brief Draws an Image
647 template<typename D, typename T>
648 std::string draw(const ImageContainerBySTLVector<D, T>& image, const std::string& name = "Image_{i}");
649
650 // @brief Draws an Image
651 template <typename TImageContainer,
652 typename TNewDomain,
653 typename TFunctorD,
654 typename TNewValue,
655 typename TFunctorV,
656 typename TFunctorVm1>
657 std::string draw(const ImageAdapter<TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1>& adapter, const std::string& name = "Image_{i}");
658
659 // @brief Draws an Image
660 template <typename TImageContainer,
661 typename TNewDomain,
662 typename TFunctorD,
663 typename TNewValue,
664 typename TFunctorV>
665 std::string draw(const ConstImageAdapter<TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV>& adapter, const std::string& name = "Image_{i}");
666
667 // @brief Draws a mesh
668 template <typename Pt>
669 std::string draw(const Mesh<Pt>& mesh, const std::string& uname = "Mesh_{i}");
670
671 // @brief Draws a DSS6Computer
672 template<typename It, typename Int, int Con>
673 std::string draw(const StandardDSS6Computer<It, Int, Con>& computer, const std::string& uname = "Computer_{i}");
674
675 template<typename It, typename Int, int Con>
676 std::string draw(const Naive3DDSSComputer<It, Int, Con>& computer, const std::string& uname = "Computer_{i}");
677
678 // @brief Draws any object with a property
679 template<typename T, typename Type>
680 std::string draw(const WithQuantity<T, Type>& props, const std::string& uname = "");
681
682 template<typename Type>
683 void addQuantity(const std::string& oName, const std::string& qName, const Type& value, QuantityScale scale = QuantityScale::UNKNOWN);
684
685 template<typename Type>
686 void addQuantity(const std::string& oName, const std::string& qName, const std::vector<Type>& value, QuantityScale scale = QuantityScale::UNKNOWN);
687
688
689 // @brief Adds a clipping plane
690 std::string draw(const ClippingPlane& plane, const std::string& name = "");
691
692 // @brief Draws a Spherical Accumulator
693 template<typename T>
694 std::string draw(const SphericalAccumulator<T> accumulator, const std::string& uname = "SphericalAccumulator_{i}");
695
696 // @brief Set the current draw color
697 std::string draw(const DGtal::Color& color, const std::string& name = "");
698
699 // @brief Set the current draw color
700 void drawColor(const DGtal::Color& color);
701
702 // @brief Use default colors
704
705 // @brief Draws adjacencies of further Object
706 void drawAdjacencies(bool toggle = true);
707
708 // @brief Draws 2D KCell as simplified mode
709 void drawAsSimplified(bool toggle = true);
710
711 // @brief Draws grid of further domains
712 void drawAsGrid(bool toggle = true);
713
714 // @brief Reset style
716
717 // @brief Draws voxels of further object, domains and points
719
720 // @brief Draws balls of further object, domains and points
722 private: // Draw commands
723 // To avoid confusion, keep this function as private:
724
725 // @brief Draws an /!\ arrow (NOT A LINE)
726 std::string draw(const std::pair<RealPoint, RealPoint>& arrow, const std::string& uname = "Arrow_{i}");
727
731 template<typename Range>
732 std::string drawGenericRange(const Range& range, const std::string& uname);
733
734 // @brief Draws an image through an iterator
735 template<typename T>
736 std::string drawImage(const std::string& uname, const T& image);
737
738 // @brief Draws an image through an iterator and replacing from its original domain
739 template<typename T>
740 std::string drawImageAdaptDom(const std::string& uname, const T& image);
741
742 // @brief Draws a KCell (signed or not)
743 std::string drawKCell(std::string uname, const RealPoint& rp, bool xodd, bool yodd, bool zodd, bool hasSign, bool sign);
744
745 public:
746 // The user is responsible for using these wrong..
747 //
749 bool allowReuseList = false;
750
751 std::vector<ClippingPlane> planes;
752 // Leave access to the user for thin modifications
753 std::map<std::string, DisplayData<RealPoint>> data;
754
755 protected:
760
762 std::vector<std::string> myToRender;
763
764 std::string myCurrentName = "";
766 }; // Display3D
767} // DGtal
768
769#include "Display3D.ih"
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...
Base class for viewing DGtal objects.
Definition Display3D.h:381
void drawAdjacencies(bool toggle=true)
std::string newTriangleList(const std::string &name)
Definition Display3D.h:539
void drawAsSimplified(bool toggle=true)
std::string myCurrentName
Definition Display3D.h:764
std::string createOrReuseLineList(const std::string &name)
Definition Display3D.h:549
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:395
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:550
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:396
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:459
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:551
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:548
virtual void setCallback(Callback *callback)
Sets callback.
std::string createOrReuseBallList(const std::string &name)
Definition Display3D.h:554
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:757
std::map< std::string, DisplayData< RealPoint > > data
Definition Display3D.h:753
std::string drawImageAdaptDom(const std::string &uname, const T &image)
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:762
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}")
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="")
std::string draw(const ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV > &adapter, const std::string &name="Image_{i}")
SCellEmbedder mySCellEmbedder
Definition Display3D.h:759
std::string createOrReuseVolumetricList(const std::string &name)
Definition Display3D.h:553
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:542
std::string draw(const KCell &cell, const std::string &name="KCell_{i}_{d}d")
std::string createOrReuseTriangleList(const std::string &name)
Definition Display3D.h:552
std::string draw(const SphericalAccumulator< T > accumulator, const std::string &uname="SphericalAccumulator_{i}")
std::string newQuadList(const std::string &name)
Definition Display3D.h:537
void addQuantity(const std::string &oName, const std::string &qName, const std::vector< Type > &value, QuantityScale scale=QuantityScale::UNKNOWN)
CellEmbedder myCellEmbedder
Definition Display3D.h:758
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}")
virtual ~Display3D()
Definition Display3D.h:391
DisplayStyle currentStyle
Definition Display3D.h:748
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:540
Display3D(const KSpace &space)
Definition Display3D.h:383
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:765
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:394
std::string newLineList(const std::string &name)
Definition Display3D.h:536
typename Space::RealPoint RealPoint
Definition Display3D.h:397
std::string draw(const ClippingPlane &plane, const std::string &name="")
std::string newPolygonList(const std::string &name)
Definition Display3D.h:538
Callback * myCallback
Definition Display3D.h:761
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:535
std::vector< ClippingPlane > planes
Definition Display3D.h:751
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
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
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
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
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.
Clipping plane.
Definition Display3D.h:299
DisplayStyle style
Definition Display3D.h:308
ClippingPlane(double _a, double _b, double _c, double _d)
Definition Display3D.h:300
A general callback for the viewer to give control to the user.
Definition Display3D.h:408
virtual void OnAttach(void *_viewer)
Called when setCallback is performed on the viewer.
Definition Display3D.h:420
Display3D< Space, KSpace > * viewer
Definition Display3D.h:440
virtual void OnUI(void *viewerData)
Called to render or interact with some UI.
Definition Display3D.h:426
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:437
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::array< QType, static_cast< size_t >(QuantityScale::UNKNOWN)> data
Definition Display3D.h:238
std::map< std::string, std::vector< T > > QType
Definition Display3D.h:224
const QType & operator[](const QuantityScale &scale) const
Definition Display3D.h:234
Attach a property to an element.
Definition Display3D.h:331
WithQuantity(const T &_object, const std::string &_name, const Type &value, QuantityScale s=QuantityScale::UNKNOWN)
Definition Display3D.h:332
std::string name
Definition Display3D.h:352
std::vector< Type > values
Definition Display3D.h:350
QuantityScale scale
Definition Display3D.h:345
WithQuantity(const T &_object, const std::string &_name, const std::vector< Type > &_values, QuantityScale s=QuantityScale::UNKNOWN)
Definition Display3D.h:338
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