Public Types | Public Member Functions | Private Member Functions | Private Attributes

DGtal::DGtalInventor< TSpace > Class Template Reference

Aim: A stream object based on Open Inventor for exporting or displaying DGtal objects. More...

#include <DGtalInventor.h>

Collaboration diagram for DGtal::DGtalInventor< TSpace >:
Collaboration graph
[legend]

Public Types

typedef TSpace Space
typedef TSpace::Point Point
typedef TSpace::Dimension Dimension
typedef TSpace::Integer Integer
typedef std::map< std::string,
std::string > 
ModeMapping
typedef SbVec3f Vec3f
typedef Vec3f Color
typedef std::map< Point, bool > CellSet
typedef std::map< Point, Vec3fColorMapping
typedef std::map< Point, ColorNormalMapping

Public Member Functions

 ~DGtalInventor ()
 DGtalInventor ()
void setLattice (const Lattice< Space > &l)
void clear ()
std::string getMode (const std::string &objectName) const
void setDiffuseColor (const float *color)
void setDiffuseColor (const Color &color)
void drawCell (const Point &c, bool orient, const float *n=0)
void drawPoint (const Point &c, const float *n=0)
void generate (SoGroup *result) const
void selfDisplay (std::ostream &out) const
bool isValid () const

Private Member Functions

 BOOST_CONCEPT_ASSERT ((CSpace< TSpace >))
 DGtalInventor (const DGtalInventor &other)
DGtalInventoroperator= (const DGtalInventor &other)

Private Attributes

Lattice< SpacemyLattice
ModeMapping myModes
Color myDiffuseColor
CellSet myCells [3]
ColorMapping myColors
NormalMapping myNormals

Detailed Description

template<typename TSpace>
class DGtal::DGtalInventor< TSpace >

Aim: A stream object based on Open Inventor for exporting or displaying DGtal objects.

Description of template class 'DGtalInventor'

Digital points, cells and objects may be outputed in that kind of object. The user may then ask to view the object or simply export its content.

Template Parameters:
TSpace the type of digital space (should realize a CSpace).

Member Typedef Documentation

template<typename TSpace>
typedef std::map< Point, bool > DGtal::DGtalInventor< TSpace >::CellSet
template<typename TSpace>
typedef Vec3f DGtal::DGtalInventor< TSpace >::Color
template<typename TSpace>
typedef std::map< Point, Vec3f > DGtal::DGtalInventor< TSpace >::ColorMapping
template<typename TSpace>
typedef TSpace::Dimension DGtal::DGtalInventor< TSpace >::Dimension
template<typename TSpace>
typedef TSpace::Integer DGtal::DGtalInventor< TSpace >::Integer
template<typename TSpace>
typedef std::map< std::string, std::string > DGtal::DGtalInventor< TSpace >::ModeMapping

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

template<typename TSpace>
typedef std::map< Point, Color > DGtal::DGtalInventor< TSpace >::NormalMapping
template<typename TSpace>
typedef TSpace::Point DGtal::DGtalInventor< TSpace >::Point
template<typename TSpace>
typedef TSpace DGtal::DGtalInventor< TSpace >::Space
template<typename TSpace>
typedef SbVec3f DGtal::DGtalInventor< TSpace >::Vec3f

Constructor & Destructor Documentation

template<typename TSpace>
DGtal::DGtalInventor< TSpace >::~DGtalInventor (  ) 

Destructor.

template<typename TSpace>
DGtal::DGtalInventor< TSpace >::DGtalInventor (  ) 

Constructor. Creates a default lattice for display.

template<typename TSpace>
DGtal::DGtalInventor< TSpace >::DGtalInventor ( const DGtalInventor< TSpace > &  other  )  [private]

Copy constructor.

Parameters:
other the object to clone. Forbidden by default.

Member Function Documentation

template<typename TSpace>
DGtal::DGtalInventor< TSpace >::BOOST_CONCEPT_ASSERT ( (CSpace< TSpace >)   )  [private]
template<typename TSpace>
void DGtal::DGtalInventor< TSpace >::clear (  ) 

Clears everything. The object is ready for a new visualization and keeps its lattice.

template<typename TSpace>
void DGtal::DGtalInventor< TSpace >::drawCell ( const Point c,
bool  orient,
const float *  n = 0 
)

Adds a cell for visualisation. Gives an optional normal. Nb : if a cell has dimension greater than 2, the boundary of the cell is taken and this method is recursively called.

Parameters:
c the cell to visualize (in Khalimsky coordinates).
n the (optional) normal to the cell as a 3D vector.
template<typename TSpace>
void DGtal::DGtalInventor< TSpace >::drawPoint ( const Point c,
const float *  n = 0 
)

Adds a Zn-point for visualisation. Gives an optional normal.

Parameters:
p the point to visualize.
n the (optional) normal to the cell as a 3D vector.

Referenced by testIVViewer().

template<typename TSpace>
void DGtal::DGtalInventor< TSpace >::generate ( SoGroup *  result  )  const

Generates the IV surface/lines/points with children rooted at the SoGroup [result].

Parameters:
result (returns) an updated IV node.

Referenced by testIVViewer().

template<typename TSpace>
std::string DGtal::DGtalInventor< TSpace >::getMode ( const std::string &  objectName  )  const
Parameters:
objectName the name of the object (generally obtained with a 'object.styleName()').
Returns:
the current mode for the given object name or "" if no specific mode has been set.
template<typename TSpace>
bool DGtal::DGtalInventor< TSpace >::isValid (  )  const

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.
template<typename TSpace>
DGtalInventor& DGtal::DGtalInventor< TSpace >::operator= ( const DGtalInventor< TSpace > &  other  )  [private]

Assignment.

Parameters:
other the object to copy.
Returns:
a reference on 'this'. Forbidden by default.
template<typename TSpace>
void DGtal::DGtalInventor< TSpace >::selfDisplay ( std::ostream &  out  )  const

Writes/Displays the object on an output stream.

Parameters:
out the output stream where the object is written.
template<typename TSpace>
void DGtal::DGtalInventor< TSpace >::setDiffuseColor ( const float *  color  ) 
Parameters:
color the diffuse color.

Referenced by testIVViewer().

template<typename TSpace>
void DGtal::DGtalInventor< TSpace >::setDiffuseColor ( const Color color  ) 
Parameters:
color the diffuse color.
template<typename TSpace>
void DGtal::DGtalInventor< TSpace >::setLattice ( const Lattice< Space > &  l  ) 

All further operations are immersed in Inventor 3D space with the lattice [l].

Parameters:
l the lattice space which should be of dimension TSpace::staticDimension.

Field Documentation

template<typename TSpace>
CellSet DGtal::DGtalInventor< TSpace >::myCells[3] [private]
template<typename TSpace>
ColorMapping DGtal::DGtalInventor< TSpace >::myColors [private]
template<typename TSpace>
Color DGtal::DGtalInventor< TSpace >::myDiffuseColor [private]
template<typename TSpace>
Lattice<Space> DGtal::DGtalInventor< TSpace >::myLattice [private]

lattice for embedding of digital space.

template<typename TSpace>
ModeMapping DGtal::DGtalInventor< TSpace >::myModes [private]

May associate a current mode for a given class. myModes[ "HyperRectDomain" ] = "Paving".

Next display of a HyperRectDomain object will used the mode "Paving". Modes may only be used in objects implementing the concept CDrawableWithDGtalBoard.

template<typename TSpace>
NormalMapping DGtal::DGtalInventor< TSpace >::myNormals [private]

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