32#include "DGtal/dec/DiscreteExteriorCalculus.h"
34#include "Eigen/Geometry"
36#include "DGtal/helpers/StdDefs.h"
38#include "DGtal/io/Color.h"
39#include "DGtal/kernel/CanonicEmbedder.h"
41#include "DGtal/topology/KhalimskySpaceND.h"
42#include "DGtal/topology/CanonicCellEmbedder.h"
43#include "DGtal/topology/CanonicSCellEmbedder.h"
46#include "DGtal/base/ConstRangeAdapter.h"
48#include "DGtal/shapes/Mesh.h"
50#include "DGtal/dec/DiscreteExteriorCalculus.h"
52#include "DGtal/topology/Object.h"
54#include "DGtal/images/ImageAdapter.h"
55#include "DGtal/images/ConstImageAdapter.h"
56#include "DGtal/images/ImageContainerBySTLVector.h"
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"
98 template<
typename T,
typename U>
112 template <
typename T>
128 template<
typename U,
typename T>
149 T center,
int orientation,
150 double size1,
double size2,
double shift1,
double shift2
169 template<
typename T,
typename U>
171 double size1,
double size2,
double shift1,
double shift2);
224 using QType = std::map<std::string, std::vector<T>>;
246 template<
typename RealPo
int>
283 Eigen::Affine3d
transform = Eigen::Affine3d::Identity();
326 template<
typename T,
typename Type>
376 template <
typename Space = Z3i::Space,
typename KSpace = Z3i::KSpace>
420 virtual void OnUI(
void* viewerData) {};
457 for (
const auto& m :
data)
493 std::string
newList(
const std::string& name,
size_t eSize = 0);
552 template<
typename Obj>
556 std::string
draw(
const Point& p,
const std::string& uname =
"Point_{i}");
559 std::string
draw(
const RealPoint& rp,
const std::string& uname =
"Point_{i}");
563 std::string
draw(
const std::vector<T>& vec,
const std::string& uname =
"");
566 template<
typename A,
typename B,
typename C>
570 template<
typename A,
typename B,
typename C>
583 template<DGtal::Dimension emb, DGtal::Dimension amb,
typename Algebra,
typename Int>
587 template<
typename Calculus, DGtal::Order order, DGtal::Duality duality>
591 template<
typename Calculus, DGtal::Duality dual>
595 std::string
draw(
const KCell& cell,
const std::string& name =
"KCell_{i}_{d}d");
598 std::string
draw(
const SCell& cell,
const std::string& name =
"SCell_{i}_{d}d");
611 template<
typename Vec>
612 std::string
drawPolygon(
const std::vector<Vec>& vertices,
const std::string& uname =
"Polygon_{i}");
624 template<
typename Obj,
typename Cont>
628 template<
typename Adj,
typename Set>
632 template<
typename D,
typename T>
641 typename TFunctorVm1>
653 template <
typename Pt>
654 std::string
draw(
const Mesh<Pt>& mesh,
const std::string& uname =
"Mesh_{i}");
657 template<
typename It,
typename Int,
int Con>
660 template<
typename It,
typename Int,
int Con>
664 template<
typename T,
typename Type>
667 template<
typename Type>
670 template<
typename Type>
711 std::string
draw(
const std::pair<RealPoint, RealPoint>& arrow,
const std::string& uname =
"Arrow_{i}");
716 template<
typename Range>
724 std::string
drawKCell(std::string uname,
const RealPoint& rp,
bool xodd,
bool yodd,
bool zodd,
bool hasSign,
bool sign);
734 std::map<std::string, DisplayData<RealPoint>>
data;
750#include "Display3D.ih"
Structure representing an RGB triple with alpha component.
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)
CanonicEmbedder< Space > Embedder
void drawAsSimplified(bool toggle=true)
std::string myCurrentName
std::string createOrReuseLineList(const std::string &name)
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
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)
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
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
std::string newList(const std::string &name, size_t eSize=0)
Create a new group.
std::string createOrReusePolygonList(const std::string &name)
std::string draw(const Naive3DDSSComputer< It, Int, Con > &computer, const std::string &uname="Computer_{i}")
std::string createOrReuseCubeList(const std::string &name)
virtual void setCallback(Callback *callback)
Sets callback.
std::string createOrReuseBallList(const std::string &name)
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}")
std::map< std::string, DisplayData< RealPoint > > data
std::string drawKCell(std::string uname, const RealPoint &rp, bool xodd, bool yodd, bool zodd, bool hasSign, bool sign)
std::vector< std::string > myToRender
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
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
std::string draw(const ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV > &adapter, const std::string &name="Image_{i}")
SCellEmbedder mySCellEmbedder
std::string createOrReuseVolumetricList(const std::string &name)
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)
std::string draw(const KCell &cell, const std::string &name="KCell_{i}_{d}d")
std::string createOrReuseTriangleList(const std::string &name)
std::string draw(const SphericalAccumulator< T > accumulator, const std::string &uname="SphericalAccumulator_{i}")
std::string newQuadList(const std::string &name)
void addQuantity(const std::string &oName, const std::string &qName, const std::vector< Type > &value, QuantityScale scale=QuantityScale::UNKNOWN)
CellEmbedder myCellEmbedder
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
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)
Display3D(const KSpace &space)
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
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
std::string newLineList(const std::string &name)
typename Space::RealPoint RealPoint
std::string draw(const ClippingPlane &plane, const std::string &name="")
std::string newPolygonList(const std::string &name)
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)
std::vector< ClippingPlane > planes
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...
ConstRangeAdapter< typename Storage::const_iterator, CanonicSCellEmbedder< KSpace >, typename KSpace::Space::RealPoint > MidPointsRange
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToArrow< KSpace >, std::pair< Point, Vector > > ArrowsRange
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...
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....
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...
PointVector< dim, Integer > Point
PointVector< dim, double > RealPoint
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...
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.
QuantityScale
Enumerate where quantities can be applied.
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...
A general callback for the viewer to give control to the user.
virtual void OnAttach(void *viewer)
Called when setCallback is performed on the viewer.
Display3D< Space, KSpace > * viewer
virtual void OnUI(void *viewerData)
Called to render or interact with some UI.
virtual void OnClick(const std::string &name, size_t index, const DisplayData< RealPoint > &data, void *viewerData)
Called when an element is clicked.
Data required to display an object.
Eigen::Affine3d transform
Quantity< Color > colorQuantities
Quantity< RealPoint > vectorQuantities
static constexpr auto getDefaultQuantityLevel
std::vector< std::vector< uint32_t > > indices
std::vector< RealPoint > vertices
Quantity< double > scalarQuantities
Style of display of an element.
DrawMode
List available draw modes.
Wrapper for array of quantities.
const QType & operator[](int idx) const
QType & operator[](const QuantityScale &scale)
QType & operator[](int idx)
std::map< std::string, std::vector< T > > QType
std::array< QType, static_cast< size_t >(QuantityScale::UNKNOWN)> data
const QType & operator[](const QuantityScale &scale) const
Attach a property to an element.
std::vector< Type > values
WithQuantity(const T &object, const std::string &name, const Type &value, QuantityScale s=QuantityScale::UNKNOWN)
WithQuantity(const T &object, const std::string &name, const std::vector< Type > &values, QuantityScale s=QuantityScale::UNKNOWN)
unsigned int index(DGtal::uint32_t n, unsigned int b)
ImageContainerBySTLVector< HyperRectDomain< Z2i::Space >, std::unordered_set< Z2i::Point > > TImageContainer