Fade2.5D Documentation pages v2.14
Delaunay Features
GEOM_FADE25D::Visualizer2 Class Reference

Visualizer2 is a PDF- and Postscript writer. More...

#include <Visualizer2.h>

Public Member Functions

 Visualizer2 (const char *filename_)
 Constructor. More...
 
void addHeaderLine (const char *s)
 Add a header line to the visualization. More...
 
void addObject (const Circle2 &circ, const Color &c)
 Add a Circle2 object to the visualization. More...
 
void addObject (const Edge2 &edge, const Color &c)
 Add an Edge2 object to the visualization. More...
 
void addObject (const Label &lab, const Color &c)
 Add a Label object to the visualization. More...
 
void addObject (const Point2 &pnt, const Color &c)
 Add a Point2 object to the visualization. More...
 
void addObject (const PShape &polygonalShape, const Color &c)
 Add a polygonal shape. More...
 
void addObject (const Segment2 &seg, const Color &c)
 Add a Segment2 object to the visualization. More...
 
void addObject (const std::vector< ConstraintSegment2 * > &vConstraintSegments, const Color &c)
 Add a vector of ConstraintSegment2 pointers to the visualization. More...
 
void addObject (const std::vector< Edge2 > &vSegments, const Color &c)
 Add a vector of Edge2 objects to the visualization. More...
 
void addObject (const std::vector< Point2 * > &vPoints, const Color &c)
 Add a vector of Point2 pointers to the visualization. More...
 
void addObject (const std::vector< Point2 > &vPoints, const Color &c)
 Add a vector of Point2 objects to the visualization. More...
 
void addObject (const std::vector< PShape > &vPolygonalShapes, const Color &c)
 Add polygonal shapes. More...
 
void addObject (const std::vector< Segment2 > &vSegments, const Color &c)
 Add a vector of Segment2 objects to the visualization. More...
 
void addObject (const std::vector< Triangle2 * > &vT, const Color &c)
 Add a vector of Triangle2 pointers to the visualization. More...
 
void addObject (const std::vector< Triangle2 > &vT, const Color &c)
 Add a vector of Triangle2 objects to the visualization. More...
 
void addObject (const std::vector< VoroCell2 * > &vC, const Color &c)
 Add a vector of Voronoi Cells to the visualization. More...
 
void addObject (const Triangle2 &tri, const Color &c)
 Add a Triangle2 object to the visualization. More...
 
void addObject (ConstraintGraph2 *pCG, const Color &c)
 Add a ConstraintGraph2 object to the visualization. More...
 
void addObject (VoroCell2 *pVoroCell, const Color &c)
 Add a Voronoi cell to the visualization. More...
 
Bbox2 computeRange (bool bWithVoronoi)
 Compute the range. More...
 
void writeFile ()
 Finish and write the output file. More...
 

Protected Member Functions

 Visualizer2 (const Visualizer2 &)
 
void changeColor (const Color &c)
 
void changeColor (float r, float g, float b, float linewidth, bool bFill)
 
Visualizer2operator= (const Visualizer2 &)
 
void periodicStroke ()
 
double scaledDouble (const double &d)
 
Point2 scaledPoint (const Point2 &p)
 
void writeCircle (const Point2 &p1_, double radius, bool bFill)
 
void writeFooter ()
 
void writeHeader (const char *title)
 
void writeHeaderLines ()
 
void writeLabel (Label l)
 
void writeLine (const Point2 &pSource, const Point2 &pTarget)
 
void writeMark (const Point2 &p1_, float size)
 
void writePoint (const Point2 &p1_, float size)
 
void writePolygon (PShape &pshape, bool bFill, double width)
 
void writeTriangle (const Point2 &p0_, const Point2 &p1_, const Point2 &p2_, bool bFill, double width)
 
void writeTriangle (const Triangle2 *pT, bool bFill_, double width)
 
void writeVoroCell (VoroCell2 *pVoroCell, bool bFill, double width)
 

Protected Attributes

Bbox2 bbox
 
bool bFileClosed
 
bool bFill
 
bool bTypePS
 
Color lastColor
 
std::ofstream outFile
 
Dat * pDat
 
int updateCtr
 
std::vector< std::pair< Circle2, Color > > vCircles
 
std::vector< std::pair< Label, Color > > vLabels
 
std::vector< std::pair< Point2, Color > > vPoints
 
std::vector< std::pair< PShape, Color > > vPolygons
 
std::vector< std::pair< Segment2, Color > > vSegments
 
std::vector< std::pair< Triangle2, Color > > vTriangles
 
std::vector< std::pair< VoroCell2 *, Color > > vVoroCells
 

Detailed Description

Visualizer2 is a PDF- and Postscript writer.

See also
http://www.geom.at/example2-traversing/
Example output of the Visualizer

Constructor & Destructor Documentation

◆ Visualizer2()

GEOM_FADE25D::Visualizer2::Visualizer2 ( const char *  filename_)
explicit

Constructor.

Parameters
filename_must end with ".ps" or ".pdf".

Member Function Documentation

◆ addHeaderLine()

void GEOM_FADE25D::Visualizer2::addHeaderLine ( const char *  s)

Add a header line to the visualization.

Parameters
sHeader line as a C-string.

◆ addObject() [1/18]

void GEOM_FADE25D::Visualizer2::addObject ( const Circle2 circ,
const Color c 
)

Add a Circle2 object to the visualization.

Parameters
circCircle2 object.
cColor for the circle. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to fill the circle

◆ addObject() [2/18]

void GEOM_FADE25D::Visualizer2::addObject ( const Edge2 edge,
const Color c 
)

Add an Edge2 object to the visualization.

Parameters
edgeEdge2 object.
cColor for the edge. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to draw marks at the endpoints.

◆ addObject() [3/18]

void GEOM_FADE25D::Visualizer2::addObject ( const Label lab,
const Color c 
)

Add a Label object to the visualization.

Parameters
labLabel object.
cColor for the label.

◆ addObject() [4/18]

void GEOM_FADE25D::Visualizer2::addObject ( const Point2 pnt,
const Color c 
)

Add a Point2 object to the visualization.

Parameters
pntPoint2 object.
cColor for the point.

◆ addObject() [5/18]

void GEOM_FADE25D::Visualizer2::addObject ( const PShape polygonalShape,
const Color c 
)

Add a polygonal shape.

Parameters
polygonalShapeA single polygonal shape.
cColor for the polygonal shapes. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to fill the shape.

◆ addObject() [6/18]

void GEOM_FADE25D::Visualizer2::addObject ( const Segment2 seg,
const Color c 
)

Add a Segment2 object to the visualization.

Parameters
segSegment2 object.
cColor for the segment. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to draw marks at the endpoints.

◆ addObject() [7/18]

void GEOM_FADE25D::Visualizer2::addObject ( const std::vector< ConstraintSegment2 * > &  vConstraintSegments,
const Color c 
)

Add a vector of ConstraintSegment2 pointers to the visualization.

Parameters
vConstraintSegmentsVector of pointers to ConstraintSegment2 objects.
cColor for the constraint segments. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to draw marks at the endpoints.

◆ addObject() [8/18]

void GEOM_FADE25D::Visualizer2::addObject ( const std::vector< Edge2 > &  vSegments,
const Color c 
)

Add a vector of Edge2 objects to the visualization.

Parameters
vSegmentsVector of Edge2 objects.
cColor for the edges. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to draw marks at the endpoints.

◆ addObject() [9/18]

void GEOM_FADE25D::Visualizer2::addObject ( const std::vector< Point2 * > &  vPoints,
const Color c 
)

Add a vector of Point2 pointers to the visualization.

Parameters
vPointsVector of pointers to Point2 objects.
cColor for the points.

◆ addObject() [10/18]

void GEOM_FADE25D::Visualizer2::addObject ( const std::vector< Point2 > &  vPoints,
const Color c 
)

Add a vector of Point2 objects to the visualization.

Parameters
vPointsVector of Point2 objects.
cColor for the points.

◆ addObject() [11/18]

void GEOM_FADE25D::Visualizer2::addObject ( const std::vector< PShape > &  vPolygonalShapes,
const Color c 
)

Add polygonal shapes.

Parameters
vPolygonalShapesVector of polygonal shapes.
cColor for the polygonal shapes. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to fill the shapes.

◆ addObject() [12/18]

void GEOM_FADE25D::Visualizer2::addObject ( const std::vector< Segment2 > &  vSegments,
const Color c 
)

Add a vector of Segment2 objects to the visualization.

Parameters
vSegmentsVector of Segment2 objects.
cColor for the segments.

◆ addObject() [13/18]

void GEOM_FADE25D::Visualizer2::addObject ( const std::vector< Triangle2 * > &  vT,
const Color c 
)

Add a vector of Triangle2 pointers to the visualization.

Parameters
vTVector of pointers to Triangle2 objects.
cColor for the triangles. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to fill the triangles.

◆ addObject() [14/18]

void GEOM_FADE25D::Visualizer2::addObject ( const std::vector< Triangle2 > &  vT,
const Color c 
)

Add a vector of Triangle2 objects to the visualization.

Parameters
vTVector of Triangle2 objects.
cColor for the triangles. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to fill the triangles

◆ addObject() [15/18]

void GEOM_FADE25D::Visualizer2::addObject ( const std::vector< VoroCell2 * > &  vC,
const Color c 
)

Add a vector of Voronoi Cells to the visualization.

Parameters
vCVector of pointers to Voronoi cells.
cColor for the Voronoi cells. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to fill the Voronoi cells.

◆ addObject() [16/18]

void GEOM_FADE25D::Visualizer2::addObject ( const Triangle2 tri,
const Color c 
)

Add a Triangle2 object to the visualization.

Parameters
triTriangle2 object.
cColor for the triangle. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to fill the triangle.

◆ addObject() [17/18]

void GEOM_FADE25D::Visualizer2::addObject ( ConstraintGraph2 pCG,
const Color c 
)

Add a ConstraintGraph2 object to the visualization.

Parameters
pCGPointer to a ConstraintGraph2
cColor for the ConstraintGraph2. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to draw marks at the endpoints.

◆ addObject() [18/18]

void GEOM_FADE25D::Visualizer2::addObject ( VoroCell2 *  pVoroCell,
const Color c 
)

Add a Voronoi cell to the visualization.

Parameters
pVoroCellPointer to a Voronoi cell.
cColor for the Voronoi cell. Define the Color with bFill=true, i.e., Color(CRED,0.01,true), to fill the Voronoi cell.

◆ computeRange()

Bbox2 GEOM_FADE25D::Visualizer2::computeRange ( bool  bWithVoronoi)

Compute the range.

Parameters
bWithVoronoispecifies if the Voronoi cells shall be incorporated.
Returns
a bounding box of currently contained objects.

◆ writeFile()

void GEOM_FADE25D::Visualizer2::writeFile ( )

Finish and write the output file.

Note
This method must be called at the end when all the objects have been added.

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