DGtal
0.6.devel
|
#include <Board3DTo2D.h>
Public Types | |
enum | CairoType { CairoPDF, CairoPNG, CairoPS, CairoEPS, CairoSVG } |
![]() | |
enum | StreamKey { addNewList, updateDisplay, shiftSurfelVisu } |
typedef std::map< std::string, std::string > | ModeMapping |
typedef std::map< std::string, CountedPtr < DrawableWithDisplay3D > > | StyleMapping |
Public Member Functions | |
Board3DTo2D () | |
~Board3DTo2D () | |
std::string | className () const |
void | setCameraPosition (double x, double y, double z) |
void | setCameraDirection (double x, double y, double z) |
void | setCameraUpVector (double x, double y, double z) |
void | setNearFar (double _near, double _far) |
void | saveCairo (const char *filename, CairoType type, int bWidth, int bHeight) |
Board3DTo2D & | operator<< (const DGtal::Color &aColor) |
template<typename TDrawableWithDisplay3D > | |
Board3DTo2D & | operator<< (const TDrawableWithDisplay3D &object) |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
![]() | |
virtual | ~Display3D () |
Display3D () | |
virtual void | setFillColor (DGtal::Color aColor) |
virtual void | setLineColor (DGtal::Color aColor) |
virtual DGtal::Color | getFillColor () |
virtual DGtal::Color | getLineColor () |
virtual void | addClippingPlane (double a, double b, double c, double d, bool drawPlane) |
virtual std::string | getMode (const std::string &objectName) const |
virtual void | createNewLineList () |
virtual void | createNewPointList () |
virtual void | createNewVoxelList (bool depthTest=true) |
virtual void | addQuad (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4, DGtal::Color aColor) |
virtual void | addTriangle (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, DGtal::Color aColor) |
virtual void | addPolygon (std::vector< pointD3D > vectPointsPolygon, DGtal::Color aColor) |
virtual void | addLine (double x1, double y1, double z1, double x2, double y2, double z2, const DGtal::Color &color=DGtal::Color(20, 20, 20, 200), double width=1.5) |
virtual void | addVoxel (DGtal::int64_t x, DGtal::int64_t y, DGtal::int64_t z, DGtal::Color color=DGtal::Color(220, 220, 220), double width=0.5, bool withWire=false) |
virtual void | addPoint (double x, double y, double z, const DGtal::Color &color=DGtal::Color(200, 20, 20), double size=40) |
virtual void | addKSSurfel (double x, double y, double z, bool xSurfel, bool ySurfel, bool zSurfel, double sizeShiftFactor, double positionShift=0.0, double sizeFactor=1.0, bool isSigned=false, bool aSign=true, bool basicMode=false) |
virtual void | addKSVoxel (int x, int y, int z, double sizeFactor=0.94) |
virtual void | addKSPointel (double x, double y, double z, double size=0.1, bool isSigned=false, bool aSign=true) |
virtual void | addKSLinel (double x1, double y1, double z1, double x2, double y2, double z2, double width=0.02, bool isSigned=false, bool aSign=true) |
void | updateBoundingBox (double x, double y, double z) |
void | exportToMesh (MeshFromPoints< Display3D::pointD3D > &aMesh) const |
void | setScale (float sx, float sy, float sz) |
Data Fields | |
DGtal::Color | myDefaultColor |
![]() | |
ModeMapping | myModes |
StyleMapping | myStyles |
bool | myBoundingPtEmptyTag |
double | myBoundingPtUp [3] |
double | myBoundingPtLow [3] |
Protected Member Functions | |
virtual void | init () |
Private Member Functions | |
void | precompute_projection_matrix () |
void | project (double x3d, double y3d, double z3d, double &x2d, double &y2d) |
Private Attributes | |
int | Viewport [4] |
double | matrix [16] |
double | camera_position [3] |
double | camera_direction [3] |
double | camera_upVector [3] |
double | ZNear |
double | ZFar |
Additional Inherited Members | |
![]() | |
float | myScaleX |
float | myScaleY |
float | myScaleZ |
DGtal::Color | myCurrentFillColor |
DGtal::Color | myCurrentLineColor |
double | myCurrentfShiftVisuKSSurfels |
std::vector< std::vector < voxelD3D > > | myVoxelSetList |
std::vector< std::vector < lineD3D > > | myLineSetList |
std::vector< std::vector < pointD3D > > | myPointSetList |
std::vector< clippingPlaneD3D > | myClippingPlaneList |
std::vector< quadD3D > | myKSSurfelList |
std::vector< pointD3D > | myKSPointelList |
std::vector< lineD3D > | myKSLinelList |
std::vector< quadD3D > | myQuadList |
std::vector< triangleD3D > | myTriangleList |
std::vector< polygonD3D > | myPolygonList |
std::vector< bool > | myListVoxelDepthTest |
float | myMeshDefaultLineWidth |
Class for PDF, PNG, PS, EPS, SVG export drawings with Cairo with 3D->2D projection.
Description of class 'Board3DTo2D'
Definition at line 66 of file Board3DTo2D.h.
DGtal::Board3DTo2D::Board3DTo2D | ( | ) |
|
inline |
Definition at line 80 of file Board3DTo2D.h.
|
inline |
Definition at line 86 of file Board3DTo2D.h.
|
protectedvirtual |
init function (should be in Constructor).
Definition at line 544 of file Board3DTo2D.cpp.
bool DGtal::Board3DTo2D::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Reimplemented from DGtal::Display3D.
Definition at line 79 of file Board3DTo2D.cpp.
|
inline |
Set the default color for future drawing.
aColor,: | a DGtal::Color (allow to set a trasnparency value). |
Definition at line 50 of file Board3DTo2D.ih.
References myDefaultColor.
|
inline |
Draws the drawable [object] in this board. It should satisfy the concept CDrawableWithDisplay3D, which requires for instance a method setStyle( Board3DTo2D & ).
object | any drawable object. |
Draws the drawable [object] in this board. It should satisfy the concept CDrawableWithBoard3DTo2D, which requires for instance a method setStyle( Board3DTo2D & ).
object | any drawable object. |
Reimplemented from DGtal::Display3D.
Definition at line 67 of file Board3DTo2D.ih.
References DGtal::Display3DFactory::draw().
|
private |
Precompute 4x4 projection matrix for 3D->2D projection.
Definition at line 152 of file Board3DTo2D.cpp.
References M_PI.
|
private |
Project a 3d point (3D->2D).
x3d | x position of the 3d point. |
y3d | y position of the 3d point. |
z3d | z position of the 3d point. |
x2d | x destination projection position of the 2d point. |
y2d | y destination projection position of the 2d point. |
Definition at line 199 of file Board3DTo2D.cpp.
void DGtal::Board3DTo2D::saveCairo | ( | const char * | filename, |
CairoType | type, | ||
int | bWidth, | ||
int | bHeight | ||
) |
Save a Cairo image.
filename | filename of the image to save. |
type | type of the image to save (CairoPDF, CairoPNG, CairoPS, CairoEPS, CairoSVG). |
bWidth | width of the image to save. |
bHeight | height of the image to save. |
Definition at line 232 of file Board3DTo2D.cpp.
References DGtal::Trace::info(), and DGtal::trace.
void DGtal::Board3DTo2D::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Reimplemented from DGtal::Display3D.
Definition at line 69 of file Board3DTo2D.cpp.
|
inlinevirtual |
Set camera direction.
x | x direction. |
y | y direction. |
z | z direction. |
Reimplemented from DGtal::Display3D.
Definition at line 106 of file Board3DTo2D.h.
References camera_direction.
|
inlinevirtual |
Set camera position.
x | x position. |
y | y position. |
z | z position. |
Reimplemented from DGtal::Display3D.
Definition at line 97 of file Board3DTo2D.h.
References camera_position.
|
inlinevirtual |
Set camera up-vector.
x | x coordinate of up-vector. |
y | y coordinate of up-vector. |
z | z coordinate of up-vector. |
Reimplemented from DGtal::Display3D.
Definition at line 115 of file Board3DTo2D.h.
References camera_upVector.
|
inlinevirtual |
Set near and far distance.
near | near distance. |
far | far distance. |
Reimplemented from DGtal::Display3D.
Definition at line 123 of file Board3DTo2D.h.
|
private |
|
private |
|
private |
|
private |
projection matrix
Definition at line 210 of file Board3DTo2D.h.
DGtal::Color DGtal::Board3DTo2D::myDefaultColor |
default color
The associated map type for storing possible modes used for displaying for digital objects. The associated map type for storing the default styles of digital objects.
Definition at line 146 of file Board3DTo2D.h.
Referenced by operator<<().
|
private |
2D viewport
Definition at line 209 of file Board3DTo2D.h.
|
private |
|
private |