DGtal  1.0.beta
Public Member Functions | Data Fields
DGtal::TransformedPrism Struct Reference

#include <DGtal/io/DrawWithDisplay3DModifier.h>

Inheritance diagram for DGtal::TransformedPrism:
[legend]
Collaboration diagram for DGtal::TransformedPrism:
[legend]

Public Member Functions

 TransformedPrism (const DGtal::Z3i::SCell &aSurfel, double aShift, double aSizeFactor=1.0)
 
 TransformedPrism (const DGtal::Z3i::SCell &aSurfel, const DGtal::Z3i::SCell &aVoxel, double aShift=0.05, double aSizeFactor=0.75)
 
- Public Member Functions inherited from DGtal::DrawWithDisplay3DModifier
std::string className () const
 

Data Fields

DGtal::Z3i::SCell mySurfel
 
double myShift
 
double mySizeFactor
 

Detailed Description

class to modify the position and scale to construct better illustration mode.

Todo:
add a constructor to automatically define the shift and the scale according a given associated SCell.
Examples:
io/boards/dgtalBoard3D-2-ks.cpp, and io/viewers/viewer3D-4bis-illustrationMode.cpp.

Definition at line 179 of file DrawWithDisplay3DModifier.h.

Constructor & Destructor Documentation

DGtal::TransformedPrism::TransformedPrism ( const DGtal::Z3i::SCell aSurfel,
double  aShift,
double  aSizeFactor = 1.0 
)
inline

Constructor.

Parameters
aSurfela DGtal::Z3i::SCell ( KhalimskySpaceND< 3, Integer > SCell ) .
aShiftthe shift distance (positive or negative).
aSizeFactoruse to change the Prism size (1.0 initial size).

Definition at line 188 of file DrawWithDisplay3DModifier.h.

189  :mySurfel(aSurfel), myShift(aShift), mySizeFactor(aSizeFactor)
190  {
191  }
DGtal::TransformedPrism::TransformedPrism ( const DGtal::Z3i::SCell aSurfel,
const DGtal::Z3i::SCell aVoxel,
double  aShift = 0.05,
double  aSizeFactor = 0.75 
)
inline

Constructor.

Parameters
aSurfela DGtal::Z3i::SCell ( KhalimskySpaceND< 3, Integer > SCell ) .
aVoxela DGtal::Z3i::SCell represent the voxel for which the surfel is associated. It permits to determine automatically the shift parameter (the surfel is automatically shifted towards this voxel).
aShiftthe shift distance (positive or negative (default 0.05)).
aSizeFactoruse to change the Prism size (default 0.75).

Definition at line 202 of file DrawWithDisplay3DModifier.h.

References myShift, and DGtal::SignedKhalimskyCell< dim, TInteger >::preCell().

205  : mySurfel(aSurfel), myShift(aShift), mySizeFactor(aSizeFactor)
206  {
207  auto const& preSurfel = aSurfel.preCell();
208  auto const& preVoxel = aVoxel.preCell();
209 
210  bool xodd = (preSurfel.coordinates[ 0 ] & 1 );
211  bool yodd = (preSurfel.coordinates[ 1 ] & 1 );
212  bool zodd = (preSurfel.coordinates[ 2 ] & 1 );
213  if(!xodd )
214  {
215  myShift*= ((preVoxel.coordinates[ 0 ]-preSurfel.coordinates[ 0 ] <0)? -1.0: 1.0);
216  }else if(!yodd )
217  {
218  myShift*=((preVoxel.coordinates[ 1 ]-preSurfel.coordinates[ 1 ] <0)? -1.0: 1.0);
219  }else if(!zodd )
220  {
221  myShift*=((preVoxel.coordinates[ 2 ]-preSurfel.coordinates[ 2 ] <0)? -1.0: 1.0);
222  }
223  }
SPreCell const & preCell() const
Returns the underlying constant signed pre-cell.

Field Documentation

double DGtal::TransformedPrism::myShift

Definition at line 227 of file DrawWithDisplay3DModifier.h.

Referenced by TransformedPrism().

double DGtal::TransformedPrism::mySizeFactor

Definition at line 228 of file DrawWithDisplay3DModifier.h.

DGtal::Z3i::SCell DGtal::TransformedPrism::mySurfel
Todo:
FIX this member

Definition at line 226 of file DrawWithDisplay3DModifier.h.


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