DGtal  1.5.beta
DGtal::Display3D< Space, KSpace > Class Template Reference

Aim: This semi abstract class defines the stream mechanism to display 3d primitive (like BallVector, DigitalSetBySTLSet, Object ...). The class Viewer3D and Board3DTo2D implement two different ways to display 3D objects. The first one (Viewer3D), permits an interactive visualisation (based on OpenGL ) and the second one (Board3dto2d) provides 3D visualisation from 2D vectorial display (based on the CAIRO library) More...

#include <DGtal/io/Display3D.h>

Inheritance diagram for DGtal::Display3D< Space, KSpace >:
[legend]

Data Structures

struct  BallD3D
 
struct  ClippingPlaneD3D
 
struct  CommonD3D
 
struct  CubeD3D
 
struct  LineD3D
 
struct  PolygonD3D
 
struct  QuadD3D
 
struct  SelectCallbackFctStore
 
struct  TriangleD3D
 

Public Types

enum  StreamKey { addNewList , updateDisplay , shiftSurfelVisu }
 
typedef Display3D< Space, KSpaceSelf
 
typedef Space::RealPoint RealPoint
 RealPoint type. More...
 
typedef Space::RealVector RealVector
 RealVector type. More...
 
typedef CanonicEmbedder< SpaceEmbedder
 
typedef CanonicCellEmbedder< KSpaceCellEmbedder
 
typedef CanonicSCellEmbedder< KSpaceSCellEmbedder
 
typedef int(* SelectCallbackFct) (void *viewer, DGtal::int32_t name, void *data)
 Select callback function type. More...
 
typedef std::map< DGtal::int32_t, std::vector< QuadD3D > > QuadsMap
 The type that maps identifier name -> vector of QuadD3D. More...
 
typedef std::map< DGtal::int32_t, std::vector< CubeD3D > > CubesMap
 The type that maps identifier name -> vector of CubeD3D. More...
 
typedef std::map< std::string, std::string > ModeMapping
 
typedef std::map< std::string, CountedPtr< DrawableWithDisplay3D > > StyleMapping
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CSpace< Space >))
 
virtual ~Display3D ()
 
 Display3D (const KSpace &KSEmb)
 
 Display3D ()
 
 Display3D (const Display3D &)=delete
 Copy constructor. Deleted. More...
 
 Display3D (Display3D &&)=delete
 Move constructor. Deleted. More...
 
Display3Doperator= (const Display3D &)=delete
 Assignment operator. Deleted. More...
 
Display3Doperator= (Display3D &&)=delete
 Move operator. Deleted. More...
 
const Embedderembedder () const
 
const CellEmbeddercellEmbedder () const
 
const SCellEmbeddersCellEmbedder () const
 
const KSpacespace () const
 
virtual void setFillColor (DGtal::Color aColor)
 
virtual void setFillTransparency (unsigned char alpha)
 
virtual void setLineColor (DGtal::Color aColor)
 
virtual DGtal::Color getFillColor ()
 
virtual DGtal::Color getLineColor ()
 
virtual void setKSpace (const KSpace &aKSpace)
 
void setName3d (DGtal::int32_t name=-1)
 
DGtal::int32_t name3d () const
 
void setSelectCallback3D (SelectCallbackFct fct, void *data, DGtal::int32_t min_name, DGtal::int32_t max_name)
 
SelectCallbackFct getSelectCallback3D (DGtal::int32_t aName, void *&data) const
 
void addClippingPlane (double a, double b, double c, double d, bool drawPlane)
 
std::string getMode (const std::string &objectName) const
 
void createNewLineList (std::string s="")
 
void createNewBallList (std::string s="")
 
DGtal::int32_t createNewCubeList ()
 
bool deleteCubeList (const DGtal::int32_t name)
 
DGtal::int32_t createNewQuadList ()
 
bool deleteQuadList (const DGtal::int32_t name)
 
void createNewTriangleList (std::string s="")
 
void createNewPolygonList (std::string s="")
 
void addQuad (const RealPoint &p1, const RealPoint &p2, const RealPoint &p3, const RealPoint &p4)
 
void addQuadWithNormal (const RealPoint &p1, const RealPoint &p2, const RealPoint &p3, const RealPoint &p4, const RealPoint &n, const bool enableReorientation, const bool enableDoubleFace=false)
 
void addQuadFromSurfelCenter (const RealPoint &baseQuadCenter, bool xSurfel, bool ySurfel, bool zSurfel)
 
void addQuadFromSurfelCenterWithNormal (const RealPoint &baseQuadCenter, bool xSurfel, bool ySurfel, bool zSurfel, const RealVector &aNormal, const bool enableReorientation, const bool sign, const bool enableDoubleFace=false)
 
void addTriangle (const RealPoint &p1, const RealPoint &p2, const RealPoint &p3)
 
void addPolygon (const std::vector< RealPoint > &vertices)
 
void addLine (const RealPoint &p1, const RealPoint &p2, const double width=0.03)
 
void addCube (const RealPoint &center, double width=1.0)
 
void addBall (const RealPoint &center, const double radius=0.5, const unsigned int resolution=30)
 
void addPrism (const RealPoint &baseQuadCenter, bool xSurfel, bool ySurfel, bool zSurfel, double sizeShiftFactor, double sizeFactor=1.0, bool isSigned=false, bool aSign=true)
 
void addBasicSurfel (const RealPoint &baseQuadCenter, bool xSurfel, bool ySurfel, bool zSurfel)
 
void addCone (const RealPoint &p1, const RealPoint &p2, double width=0.08)
 
void addCylinder (const RealPoint &p1, const RealPoint &p2, const double width=0.02)
 
void updateBoundingBox (const RealPoint &point)
 
void exportToMesh (Mesh< RealPoint > &aMesh) const
 
template<typename TDrawableWithDisplay3D >
Display3Doperator<< (const TDrawableWithDisplay3D &object)
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
void clear ()
 
RealPoint embed (const typename Space::Point &dp) const
 
RealPoint embedKS (const typename KSpace::SCell &cell) const
 
RealPoint embedKS (const DGtal::TransformedPrism &aTrans) const
 
RealPoint embedK (const typename KSpace::Cell &cell) const
 

Data Fields

ModeMapping myModes
 
StyleMapping myStyles
 
bool myBoundingPtEmptyTag
 True if the bounding box is empty (no objects added) More...
 
double myBoundingPtUp [3]
 upper point of the bounding box More...
 
double myBoundingPtLow [3]
 lower point of the bouding box More...
 

Static Protected Member Functions

static void cross (double dst[3], double srcA[3], double srcB[3])
 
static void normalize (double vec[3])
 

Protected Attributes

KSpace myKSpace
 The Khalimsky space. More...
 
EmbeddermyEmbedder
 an embeder from a dgtal space point to a real space point More...
 
CellEmbeddermyCellEmbedder
 an embeder from a unsigned khalimsky space point to a real space point More...
 
SCellEmbeddermySCellEmbedder
 an embeder from a signed khalimsky space point to a real space point More...
 
DGtal::Color myCurrentFillColor
 
DGtal::Color myCurrentLineColor
 
double myCurrentfShiftVisuPrisms
 
std::vector< std::vector< LineD3D > > myLineSetList
 
std::vector< std::vector< BallD3D > > myBallSetList
 
std::vector< ClippingPlaneD3DmyClippingPlaneList
 
std::vector< QuadD3DmyPrismList
 
QuadsMap myQuadsMap
 
std::vector< std::vector< TriangleD3D > > myTriangleSetList
 Represents all the triangles drawn in the Display3D. More...
 
std::vector< std::vector< PolygonD3D > > myPolygonSetList
 Represents all the polygon drawn in the Display3D. More...
 
CubesMap myCubesMap
 
std::vector< std::string > myCubeSetNameList
 
std::vector< std::string > myLineSetNameList
 
std::vector< std::string > myBallSetNameList
 
std::vector< std::string > myClippingPlaneNameList
 
std::vector< std::string > myPrismNameList
 
std::vector< std::string > myQuadSetNameList
 
std::vector< std::string > myTriangleSetNameList
 
std::vector< std::string > myPolygonSetNameList
 
DGtal::int32_t myName3d
 
std::set< SelectCallbackFctStoremySelectCallBackFcts
 
bool myBoundingPtChangedTag = false
 

Detailed Description

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
class DGtal::Display3D< Space, KSpace >

Aim: This semi abstract class defines the stream mechanism to display 3d primitive (like BallVector, DigitalSetBySTLSet, Object ...). The class Viewer3D and Board3DTo2D implement two different ways to display 3D objects. The first one (Viewer3D), permits an interactive visualisation (based on OpenGL ) and the second one (Board3dto2d) provides 3D visualisation from 2D vectorial display (based on the CAIRO library)

Description of class 'Display3D'

See also
Viewer3D, Board3DTo2D

This class is parametrized by both the Digital and Khalimsky space used to display object. More precisely, embed methods are used to compute the Euclidean coordinate of digital objects/khalimksy cells.

Template Parameters
Spaceany model of Digital 3D Space
KSpaceany mode of Khalimksky 3D space

Definition at line 92 of file Display3D.h.

Member Typedef Documentation

◆ CellEmbedder

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef CanonicCellEmbedder<KSpace> DGtal::Display3D< Space, KSpace >::CellEmbedder

Definition at line 105 of file Display3D.h.

◆ CubesMap

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef std::map<DGtal::int32_t, std::vector< CubeD3D > > DGtal::Display3D< Space, KSpace >::CubesMap

The type that maps identifier name -> vector of CubeD3D.

Definition at line 257 of file Display3D.h.

◆ Embedder

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef CanonicEmbedder<Space> DGtal::Display3D< Space, KSpace >::Embedder

Definition at line 104 of file Display3D.h.

◆ ModeMapping

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef std::map< std::string, std::string > DGtal::Display3D< Space, KSpace >::ModeMapping

The associated map type for storing possible modes used for displaying for digital objects.

Definition at line 786 of file Display3D.h.

◆ QuadsMap

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef std::map<DGtal::int32_t, std::vector< QuadD3D > > DGtal::Display3D< Space, KSpace >::QuadsMap

The type that maps identifier name -> vector of QuadD3D.

Definition at line 254 of file Display3D.h.

◆ RealPoint

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef Space::RealPoint DGtal::Display3D< Space, KSpace >::RealPoint

RealPoint type.

Definition at line 101 of file Display3D.h.

◆ RealVector

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef Space::RealVector DGtal::Display3D< Space, KSpace >::RealVector

RealVector type.

Definition at line 103 of file Display3D.h.

◆ SCellEmbedder

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef CanonicSCellEmbedder<KSpace> DGtal::Display3D< Space, KSpace >::SCellEmbedder

Definition at line 106 of file Display3D.h.

◆ SelectCallbackFct

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef int(* DGtal::Display3D< Space, KSpace >::SelectCallbackFct) (void *viewer, DGtal::int32_t name, void *data)

Select callback function type.

Definition at line 109 of file Display3D.h.

◆ Self

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef Display3D<Space,KSpace> DGtal::Display3D< Space, KSpace >::Self

Definition at line 99 of file Display3D.h.

◆ StyleMapping

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
typedef std::map< std::string,CountedPtr<DrawableWithDisplay3D> > DGtal::Display3D< Space, KSpace >::StyleMapping

The associated map type for storing the default styles of digital objects.

Definition at line 792 of file Display3D.h.

Member Enumeration Documentation

◆ StreamKey

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
enum DGtal::Display3D::StreamKey
Enumerator
addNewList 
updateDisplay 
shiftSurfelVisu 

Definition at line 249 of file Display3D.h.

Constructor & Destructor Documentation

◆ ~Display3D()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
virtual DGtal::Display3D< Space, KSpace >::~Display3D ( )
inlinevirtual

Destructor.

Definition at line 281 of file Display3D.h.

282  {
283  delete myEmbedder;
284  delete mySCellEmbedder;
285  delete myCellEmbedder;
286  }
SCellEmbedder * mySCellEmbedder
an embeder from a signed khalimsky space point to a real space point
Definition: Display3D.h:268
Embedder * myEmbedder
an embeder from a dgtal space point to a real space point
Definition: Display3D.h:264
CellEmbedder * myCellEmbedder
an embeder from a unsigned khalimsky space point to a real space point
Definition: Display3D.h:266

References DGtal::Display3D< Space, KSpace >::myCellEmbedder, DGtal::Display3D< Space, KSpace >::myEmbedder, and DGtal::Display3D< Space, KSpace >::mySCellEmbedder.

◆ Display3D() [1/4]

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::Display3D< Space, KSpace >::Display3D ( const KSpace KSEmb)
inline

Constructor with the Khalimsky Space

Parameters
KSEmbthe khalimsky space for embedding

Definition at line 292 of file Display3D.h.

293  : myKSpace( KSEmb )
294  , myEmbedder( new Embedder() )
297  , myBoundingPtEmptyTag( true )
298  , myCurrentFillColor( 220, 220, 220 )
299  , myCurrentLineColor( 22, 22, 222, 50 )
300  {
301  }
CanonicSCellEmbedder< KSpace > SCellEmbedder
Definition: Display3D.h:106
KSpace myKSpace
The Khalimsky space.
Definition: Display3D.h:262
CanonicCellEmbedder< KSpace > CellEmbedder
Definition: Display3D.h:105
bool myBoundingPtEmptyTag
True if the bounding box is empty (no objects added)
Definition: Display3D.h:809
DGtal::Color myCurrentFillColor
Definition: Display3D.h:817
DGtal::Color myCurrentLineColor
Definition: Display3D.h:819
CanonicEmbedder< Space > Embedder
Definition: Display3D.h:104

◆ Display3D() [2/4]

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::Display3D< Space, KSpace >::Display3D ( )
inline

Default constructor Display3D

Definition at line 307 of file Display3D.h.

308  : Display3D( KSpace() )
309  {
310  }

◆ Display3D() [3/4]

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::Display3D< Space, KSpace >::Display3D ( const Display3D< Space, KSpace > &  )
delete

Copy constructor. Deleted.

◆ Display3D() [4/4]

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::Display3D< Space, KSpace >::Display3D ( Display3D< Space, KSpace > &&  )
delete

Move constructor. Deleted.

Member Function Documentation

◆ addBall()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addBall ( const RealPoint center,
const double  radius = 0.5,
const unsigned int  resolution = 30 
)

Method to add a point to the current display.

Parameters
centerball center x
radiusthe ball radius (default 0.5)
resolutionball resolution (default 30)

◆ addBasicSurfel()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addBasicSurfel ( const RealPoint baseQuadCenter,
bool  xSurfel,
bool  ySurfel,
bool  zSurfel 
)

Specific to display a surfel from Kahlimsky space from a basic way.

Parameters
baseQuadCenterbase quad center point
xSurfeltrue if the surfel has its main face in the direction of the x-axis
ySurfeltrue if the surfel has its main face in the direction of the y-axis
zSurfeltrue if the surfel has its main face in the direction of the z-axis

◆ addClippingPlane()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addClippingPlane ( double  a,
double  b,
double  c,
double  d,
bool  drawPlane 
)

Add a new 3D Clipping plane represented by ax+by+cz+d = 0 A maximal of five clipping plane can be added.

Parameters
aa
bb
cc
dd plane equation.
drawPlanetrue if the plane should be draw

◆ addCone()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addCone ( const RealPoint p1,
const RealPoint p2,
double  width = 0.08 
)

Add a signed KSLinel from the Kahlimsky space. Display it as a cone.

Parameters
p1the cone apex
p2the cone base
widththe width of the cone (default= 0.08)

◆ addCube()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addCube ( const RealPoint center,
double  width = 1.0 
)

Method to add specific cube. It includes several modes to display the cube with and without the wire visualisation.

Parameters
centercube center
widththe cube width.

◆ addCylinder()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addCylinder ( const RealPoint p1,
const RealPoint p2,
const double  width = 0.02 
)

Add a non signed KSLinel from the Kahlimsky space. Display it as a simple cylinder.

Parameters
p1the 1st point
p2the 2nd point
widththe width of the cylinder (default= 0.02)

◆ addLine()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addLine ( const RealPoint p1,
const RealPoint p2,
const double  width = 0.03 
)

Method to add a line to the current display. x1, y1, z1, x2, y2, z2 the two extremty line points.

Parameters
p1the 1st point
p2the 2nd point
widththe line width

Referenced by testLocalConvolutionNormalVectorEstimator(), and testShapes().

◆ addPolygon()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addPolygon ( const std::vector< RealPoint > &  vertices)

Method to add a specific polygon.

Parameters
verticesa vector containing the polygon vertices.

Referenced by main(), and viewPolygons().

◆ addPrism()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addPrism ( const RealPoint baseQuadCenter,
bool  xSurfel,
bool  ySurfel,
bool  zSurfel,
double  sizeShiftFactor,
double  sizeFactor = 1.0,
bool  isSigned = false,
bool  aSign = true 
)

Specific to display a surfel from Kahlimsky space. The display can take into accounts the sign of the cell.

Parameters
baseQuadCenterbase quad center point
xSurfeltrue if the surfel has its main face in the direction of the x-axis
ySurfeltrue if the surfel has its main face in the direction of the y-axis
zSurfeltrue if the surfel has its main face in the direction of the z-axis
sizeShiftFactorset the distance between the display of the surfel and potential Cube.
sizeFactorset the difference between the upper face of the prism and the down face
isSignedto specify if we want to display an signed or unsigned Cell.
aSignif isSigned is true it will be used to apply a different displays according this boolean parameter (if aSign=true oriented in the direct axis orientation)

◆ addQuad()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addQuad ( const RealPoint p1,
const RealPoint p2,
const RealPoint p3,
const RealPoint p4 
)

Method to add a specific quad (used by addClippingPlane or to represent basic surfels from Khalimsky space). The normal is computed from the vertex order.

Parameters
p1the 1st point
p2the 2nd point
p3the 3rd point
p4the 4th point

◆ addQuadFromSurfelCenter()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addQuadFromSurfelCenter ( const RealPoint baseQuadCenter,
bool  xSurfel,
bool  ySurfel,
bool  zSurfel 
)

Method to add a quad representing a surfel given from its center and its orientation.

Parameters
baseQuadCenterthe surfel center.
xSurfelindicates that the sufel is in the x axis direction
ySurfelindicates that the sufel is in the y axis direction
zSurfelindicates that the sufel is in the z axis direction

◆ addQuadFromSurfelCenterWithNormal()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addQuadFromSurfelCenterWithNormal ( const RealPoint baseQuadCenter,
bool  xSurfel,
bool  ySurfel,
bool  zSurfel,
const RealVector aNormal,
const bool  enableReorientation,
const bool  sign,
const bool  enableDoubleFace = false 
)

Method to add a quad representing a surfel given from its center and its orientation, and attach a unitary normal vector to it. Depending on enableReorientation, Quad points can be reordered to make its orientation constistant with the normal direction.

Parameters
baseQuadCenterthe surfel center.
xSurfelindicates that the sufel is in the x axis direction
ySurfelindicates that the sufel is in the y axis direction
zSurfelindicates that the sufel is in the z axis direction
aNormala unitary normal vector to attach to the quad.
enableReorientationif true, the quad orientation will match with prescribed normal vector (dot product between the normal and the canonical one is >0).
signif enableReorientation is true, we use this bool to get the surfel sign
enableDoubleFaceif true, two quad (with opposite normal vector) will be drawn.

◆ addQuadWithNormal()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addQuadWithNormal ( const RealPoint p1,
const RealPoint p2,
const RealPoint p3,
const RealPoint p4,
const RealPoint n,
const bool  enableReorientation,
const bool  enableDoubleFace = false 
)

Method to add a specific quad. The normal vector is specified by the user. Depending on enableReorientation, Quad points can be reordered to make its orientation constistant with the normal direction.

Parameters
p1the 1st point
p2the 2nd point
p3the 3rd point
p4the 4th point
nthe normal vector
enableReorientationif true, the quad orientation will match with prescribed normal vector (dot product between the normal and the canonical one is >0).
enableDoubleFaceif true, two quad (with opposite normal vector) will be drawn.

Referenced by main(), and testQuadNorm().

◆ addTriangle()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::addTriangle ( const RealPoint p1,
const RealPoint p2,
const RealPoint p3 
)

Method to add a specific quad (used by addClippingPlane). The normal is computed from the vertex order.

Parameters
p1the 1st point
p2the 2nd point
p3the 3rd point

◆ BOOST_CONCEPT_ASSERT()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::Display3D< Space, KSpace >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< Space >)  )

◆ cellEmbedder()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
const CellEmbedder& DGtal::Display3D< Space, KSpace >::cellEmbedder ( ) const
inline
Returns
the embedder Cell -> RealPoint

Definition at line 332 of file Display3D.h.

333  { return *myCellEmbedder; }

References DGtal::Display3D< Space, KSpace >::myCellEmbedder.

◆ clear()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::clear ( )

Removes all sent data.

◆ createNewBallList()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::createNewBallList ( std::string  s = "")

Used to create a new list containing new 3D objects (useful to use transparency between different objects).

Parameters
sname of the new list

◆ createNewCubeList()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::int32_t DGtal::Display3D< Space, KSpace >::createNewCubeList ( )

Used to create a new list containing new 3D objects (useful to use transparency between different objects).

Returns
the new key of the map associated to the new list.

◆ createNewLineList()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::createNewLineList ( std::string  s = "")

Used to create a new list containing new 3D objects (useful to use transparency between different objects).

Parameters
sname of the new list

◆ createNewPolygonList()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::createNewPolygonList ( std::string  s = "")

Used to create a new list containing new 3D objects (useful to use transparency between different objects).

Parameters
sname of the new list

Referenced by main().

◆ createNewQuadList()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::int32_t DGtal::Display3D< Space, KSpace >::createNewQuadList ( )

Used to create a new list containing new 3D objects (useful to use transparency between different objects).

Returns
the new key of the map associated to the new list.

◆ createNewTriangleList()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::createNewTriangleList ( std::string  s = "")

Used to create a new list containing new 3D objects (useful to use transparency between different objects).

Parameters
sname of the new list

◆ cross()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
static void DGtal::Display3D< Space, KSpace >::cross ( double  dst[3],
double  srcA[3],
double  srcB[3] 
)
staticprotected

Calculate the cross product of two 3d vectors and return it.

Parameters
dstdestination vector.
srcAsource vector A.
srcBsource vector B.

◆ deleteCubeList()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
bool DGtal::Display3D< Space, KSpace >::deleteCubeList ( const DGtal::int32_t  name)

Delete the cube list identified by a its name.

Parameters
[in]namethe name of the cube list.
Returns
true if the list was found and removed.

◆ deleteQuadList()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
bool DGtal::Display3D< Space, KSpace >::deleteQuadList ( const DGtal::int32_t  name)

Delete the quad list identified by a its name.

Parameters
[in]namethe name of the quad list.
Returns
true if the list was found and removed.

◆ embed()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
RealPoint DGtal::Display3D< Space, KSpace >::embed ( const typename Space::Point dp) const

Use to embed a DGtal point into space

Parameters
dpa DGtal Point
Returns
the point embeded in real space

◆ embedder()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
const Embedder& DGtal::Display3D< Space, KSpace >::embedder ( ) const
inline
Returns
the embedder Point -> RealPoint

Definition at line 328 of file Display3D.h.

329  { return *myEmbedder; }

References DGtal::Display3D< Space, KSpace >::myEmbedder.

◆ embedK()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
RealPoint DGtal::Display3D< Space, KSpace >::embedK ( const typename KSpace::Cell cell) const

Use to embed an unsigned DGtal kahlimsky cell into space

Parameters
cellkahlimsky cell
Returns
the point embeded in real space

◆ embedKS() [1/2]

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
RealPoint DGtal::Display3D< Space, KSpace >::embedKS ( const DGtal::TransformedPrism aTrans) const

Use to embed a signed DGtal kahlimsky cell into space

Parameters
aTransa transformed surfel prism
Returns
the cell embeded in real space

◆ embedKS() [2/2]

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
RealPoint DGtal::Display3D< Space, KSpace >::embedKS ( const typename KSpace::SCell cell) const

Use to embed a signed DGtal kahlimsky cell into space

Parameters
cella kahlimsky cell
Returns
the cell embeded in real space

Referenced by testBallQuad().

◆ exportToMesh()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::exportToMesh ( Mesh< RealPoint > &  aMesh) const

Export as Mesh the current displayed elements.

Parameters
aMesh: (return) the mesh containing the elements of the display.

◆ getFillColor()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
virtual DGtal::Color DGtal::Display3D< Space, KSpace >::getFillColor ( )
virtual

Used to get the fill color

Returns
the current fill color.

Referenced by viewPolygons().

◆ getLineColor()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
virtual DGtal::Color DGtal::Display3D< Space, KSpace >::getLineColor ( )
virtual

Used to get the line color

Returns
the current line color.

Referenced by testLocalConvolutionNormalVectorEstimator().

◆ getMode()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::string DGtal::Display3D< Space, KSpace >::getMode ( const std::string &  objectName) const
Parameters
objectNamethe name of the object (generally obtained with a 'object.className()').
Returns
the current mode for the given object name or "" if no specific mode has been set.

◆ getSelectCallback3D()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
SelectCallbackFct DGtal::Display3D< Space, KSpace >::getSelectCallback3D ( DGtal::int32_t  aName,
void *&  data 
) const
Parameters
[in]aNamethe "OpenGL name" that was selected.
[out]dataa pointer that was given setting the callback function.
Returns
the select callback function that match the given name, or 0 if none is associated to this name.

◆ isValid()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
bool DGtal::Display3D< Space, KSpace >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ name3d()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::int32_t DGtal::Display3D< Space, KSpace >::name3d ( ) const
Returns
the current "OpenGL name", an integer identifier or -1 if none was set.

◆ normalize()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
static void DGtal::Display3D< Space, KSpace >::normalize ( double  vec[3])
staticprotected

Normalize the input 3d vector.

Parameters
vecsource & destination vector.

◆ operator<<()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
template<typename TDrawableWithDisplay3D >
Display3D& DGtal::Display3D< Space, KSpace >::operator<< ( const TDrawableWithDisplay3D< Space, KSpace > &  object)

Draws the drawable [object] in this board. It should satisfy the concept CDrawableWithViewer3D, which requires for instance a method setStyle( Viewer3D & ).

Parameters
objectany drawable object.
Returns
a reference on 'this'.

◆ operator=() [1/2]

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
Display3D& DGtal::Display3D< Space, KSpace >::operator= ( const Display3D< Space, KSpace > &  )
delete

Assignment operator. Deleted.

◆ operator=() [2/2]

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
Display3D& DGtal::Display3D< Space, KSpace >::operator= ( Display3D< Space, KSpace > &&  )
delete

Move operator. Deleted.

◆ sCellEmbedder()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
const SCellEmbedder& DGtal::Display3D< Space, KSpace >::sCellEmbedder ( ) const
inline
Returns
the embedder SCell -> RealPoint

Definition at line 336 of file Display3D.h.

337  { return *mySCellEmbedder; }

References DGtal::Display3D< Space, KSpace >::mySCellEmbedder.

◆ selfDisplay()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setFillColor()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
virtual void DGtal::Display3D< Space, KSpace >::setFillColor ( DGtal::Color  aColor)
virtual

Used to set the current fill color

Parameters
aColorthe fill color.

Referenced by main(), and viewPolygons().

◆ setFillTransparency()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
virtual void DGtal::Display3D< Space, KSpace >::setFillTransparency ( unsigned char  alpha)
virtual

Used to set the alpha value of the current fill color.

Parameters
alphathe transparency value (from 0 to 255).

Referenced by main().

◆ setKSpace()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
virtual void DGtal::Display3D< Space, KSpace >::setKSpace ( const KSpace aKSpace)
virtual

Used to change the Khalimsky 3D Space.

Parameters
aKSpacethe new Khalimsky space.

◆ setLineColor()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
virtual void DGtal::Display3D< Space, KSpace >::setLineColor ( DGtal::Color  aColor)
virtual

Used to set the line fill color

Parameters
aColorthe line color.

Referenced by main(), testLocalConvolutionNormalVectorEstimator(), and testShapes().

◆ setName3d()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::setName3d ( DGtal::int32_t  name = -1)

Sets the "OpenGL name" for next graphical directives.

Parameters
namethe "OpenGL name", an integer identifier or -1 for none.

◆ setSelectCallback3D()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::setSelectCallback3D ( SelectCallbackFct  fct,
void *  data,
DGtal::int32_t  min_name,
DGtal::int32_t  max_name 
)

Sets the callback function called when selecting a graphical object with "OpenGL name" between min_name and max_name. Note that ranges should not overlap. If several functions can be called, behavior is undefined afterwards.

Parameters
fctany function.
dataan arbitrary pointer that is given when calling the callback function.
min_namethe first "OpenGL name" for which fct should be called.
max_namethe last "OpenGL name" for which fct should be called.

◆ space()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
const KSpace& DGtal::Display3D< Space, KSpace >::space ( ) const
inline
Returns
the cellular grid space.

Definition at line 340 of file Display3D.h.

341  { return myKSpace; }

References DGtal::Display3D< Space, KSpace >::myKSpace.

◆ updateBoundingBox()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
void DGtal::Display3D< Space, KSpace >::updateBoundingBox ( const RealPoint point)

Used to update the scene bounding box when objects are added.

Parameters
pointthe point to be taken into accounts.

Field Documentation

◆ myBallSetList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector< std::vector<BallD3D> > DGtal::Display3D< Space, KSpace >::myBallSetList
protected

Used to represent all the list of point primitive

Definition at line 831 of file Display3D.h.

◆ myBallSetNameList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector<std::string> DGtal::Display3D< Space, KSpace >::myBallSetNameList
protected

names of the lists in myBallSetList

Definition at line 870 of file Display3D.h.

◆ myBoundingPtChangedTag

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
bool DGtal::Display3D< Space, KSpace >::myBoundingPtChangedTag = false
protected

Definition at line 899 of file Display3D.h.

◆ myBoundingPtEmptyTag

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
bool DGtal::Display3D< Space, KSpace >::myBoundingPtEmptyTag

True if the bounding box is empty (no objects added)

Definition at line 809 of file Display3D.h.

◆ myBoundingPtLow

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
double DGtal::Display3D< Space, KSpace >::myBoundingPtLow[3]

lower point of the bouding box

Definition at line 813 of file Display3D.h.

◆ myBoundingPtUp

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
double DGtal::Display3D< Space, KSpace >::myBoundingPtUp[3]

upper point of the bounding box

Definition at line 811 of file Display3D.h.

◆ myCellEmbedder

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
CellEmbedder* DGtal::Display3D< Space, KSpace >::myCellEmbedder
protected

an embeder from a unsigned khalimsky space point to a real space point

Definition at line 266 of file Display3D.h.

Referenced by DGtal::Display3D< Space, KSpace >::cellEmbedder(), and DGtal::Display3D< Space, KSpace >::~Display3D().

◆ myClippingPlaneList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector< ClippingPlaneD3D > DGtal::Display3D< Space, KSpace >::myClippingPlaneList
protected

Represent all the clipping planes added to the scene (of maxSize=5).

Definition at line 835 of file Display3D.h.

◆ myClippingPlaneNameList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector<std::string> DGtal::Display3D< Space, KSpace >::myClippingPlaneNameList
protected

names of the lists in myClippingPlaneList

Definition at line 873 of file Display3D.h.

◆ myCubeSetNameList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector<std::string> DGtal::Display3D< Space, KSpace >::myCubeSetNameList
protected

names of the lists in myCubeSetList

Definition at line 862 of file Display3D.h.

◆ myCubesMap

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
CubesMap DGtal::Display3D< Space, KSpace >::myCubesMap
protected

Represents all the cubes drawn in the Display3D. The map int --> vector<CubeD3D> associates a vector of cubes to an integer identifier (OpenGL name)

Definition at line 857 of file Display3D.h.

◆ myCurrentFillColor

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::Color DGtal::Display3D< Space, KSpace >::myCurrentFillColor
protected

Definition at line 817 of file Display3D.h.

◆ myCurrentfShiftVisuPrisms

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
double DGtal::Display3D< Space, KSpace >::myCurrentfShiftVisuPrisms
protected

Used to specialized visualisation with KSpace surfels/cubes.

Definition at line 823 of file Display3D.h.

◆ myCurrentLineColor

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::Color DGtal::Display3D< Space, KSpace >::myCurrentLineColor
protected

Definition at line 819 of file Display3D.h.

◆ myEmbedder

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
Embedder* DGtal::Display3D< Space, KSpace >::myEmbedder
protected

an embeder from a dgtal space point to a real space point

Definition at line 264 of file Display3D.h.

Referenced by DGtal::Display3D< Space, KSpace >::embedder(), and DGtal::Display3D< Space, KSpace >::~Display3D().

◆ myKSpace

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
KSpace DGtal::Display3D< Space, KSpace >::myKSpace
protected

The Khalimsky space.

Definition at line 262 of file Display3D.h.

Referenced by DGtal::Display3D< Space, KSpace >::space().

◆ myLineSetList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector< std::vector<LineD3D> > DGtal::Display3D< Space, KSpace >::myLineSetList
protected

Used to represent all the list of line primitive

Definition at line 827 of file Display3D.h.

◆ myLineSetNameList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector<std::string> DGtal::Display3D< Space, KSpace >::myLineSetNameList
protected

names of the lists in myLineSetList

Definition at line 866 of file Display3D.h.

◆ myModes

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
ModeMapping DGtal::Display3D< Space, KSpace >::myModes

Definition at line 795 of file Display3D.h.

◆ myName3d

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
DGtal::int32_t DGtal::Display3D< Space, KSpace >::myName3d
protected

the "OpenGL name", used for instance by QGLViewer for selecting objects.

Definition at line 893 of file Display3D.h.

◆ myPolygonSetList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector<std::vector<PolygonD3D> > DGtal::Display3D< Space, KSpace >::myPolygonSetList
protected

Represents all the polygon drawn in the Display3D.

Definition at line 851 of file Display3D.h.

◆ myPolygonSetNameList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector<std::string> DGtal::Display3D< Space, KSpace >::myPolygonSetNameList
protected

names of the lists in myPolygonList

Definition at line 889 of file Display3D.h.

◆ myPrismList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector< QuadD3D > DGtal::Display3D< Space, KSpace >::myPrismList
protected

Represent truncated prism object to represent surfels of Khalimsky space (used to display Khalimsky Space Cell)

Definition at line 839 of file Display3D.h.

◆ myPrismNameList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector<std::string> DGtal::Display3D< Space, KSpace >::myPrismNameList
protected

names of the lists in myPrismList

Definition at line 877 of file Display3D.h.

◆ myQuadSetNameList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector<std::string> DGtal::Display3D< Space, KSpace >::myQuadSetNameList
protected

names of the lists in myQuadList

Definition at line 881 of file Display3D.h.

◆ myQuadsMap

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
QuadsMap DGtal::Display3D< Space, KSpace >::myQuadsMap
protected

Represents all the planes drawn in the Display3D or to display Khalimsky Space Cell. The map int --> vector< QuadD3D> associates a vector of quads to an integer identifier (OpenGL name)

Definition at line 845 of file Display3D.h.

◆ mySCellEmbedder

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
SCellEmbedder* DGtal::Display3D< Space, KSpace >::mySCellEmbedder
protected

an embeder from a signed khalimsky space point to a real space point

Definition at line 268 of file Display3D.h.

Referenced by DGtal::Display3D< Space, KSpace >::sCellEmbedder(), and DGtal::Display3D< Space, KSpace >::~Display3D().

◆ mySelectCallBackFcts

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::set<SelectCallbackFctStore> DGtal::Display3D< Space, KSpace >::mySelectCallBackFcts
protected

Stores the callback functions called when selecting a graphical object.

Definition at line 897 of file Display3D.h.

◆ myStyles

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
StyleMapping DGtal::Display3D< Space, KSpace >::myStyles

For instance, may associate a new style object T1 to the class "HyperRectDomain": myStyles[ "HyperRectDomain" ] = T1.

One can also store a new style T2 for a specific mode used for drawing a class: myStyles[ "HyperRectDomain/Paving" ] = T2.

Modes may only be used in objects implementing the concept CDrawableWithBoard2D.

Definition at line 806 of file Display3D.h.

◆ myTriangleSetList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector<std::vector< TriangleD3D > > DGtal::Display3D< Space, KSpace >::myTriangleSetList
protected

Represents all the triangles drawn in the Display3D.

Definition at line 848 of file Display3D.h.

◆ myTriangleSetNameList

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
std::vector<std::string> DGtal::Display3D< Space, KSpace >::myTriangleSetNameList
protected

names of the lists in myTriangleList

Definition at line 885 of file Display3D.h.


The documentation for this class was generated from the following files: