Fade2D Documentation pages v2.12
Delaunay Features
GEOM_FADE2D::Visualizer2 Class Reference

Visualizer2 is a general Postscript writer. It draws the objects Point2, Segment2, Triangle2, Circle2 and Label. 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.
 
void addObject (const Circle2 &circ, const Color &c)
 Add a Circle2 object to the visualization.
 
void addObject (const Edge2 &edge, const Color &c)
 Add an Edge2 object to the visualization.
 
void addObject (const Label &lab, const Color &c)
 Add a Label object to the visualization.
 
void addObject (const Point2 &pnt, const Color &c)
 Add a Point2 object to the visualization.
 
void addObject (const PShape &polygonalShape, const Color &c)
 Add a polygonal shape.
 
void addObject (const Segment2 &seg, const Color &c)
 Add a Segment2 object to the visualization.
 
void addObject (const std::vector< ConstraintSegment2 * > &vConstraintSegments, const Color &c)
 Add a vector of ConstraintSegment2 objects to the visualization.
 
void addObject (const std::vector< Edge2 > &vSegments, const Color &c)
 Add a vector of Edge2 objects to the visualization.
 
void addObject (const std::vector< Point2 * > &vPoints, const Color &c)
 Add a vector of Point2* to the visualization.
 
void addObject (const std::vector< Point2 > &vPoints, const Color &c)
 Add a vector of Point2 objects to the visualization.
 
void addObject (const std::vector< PShape > &vPolygonalShapes, const Color &c)
 Add polygonal shapes.
 
void addObject (const std::vector< Segment2 > &vSegments, const Color &c)
 Add a vector of Segment2 objects to the visualization.
 
void addObject (const std::vector< Triangle2 * > &vT, const Color &c)
 Add a Triangle2* vector to the visualization.
 
void addObject (const std::vector< Triangle2 > &vT, const Color &c)
 Add a vector of Triangle2 objects to the visualization.
 
void addObject (const std::vector< VoroCell2 * > &vT, const Color &c)
 Add a vector of Voronoi Cells to the visualization.
 
void addObject (const Triangle2 &tri, const Color &c)
 Add a Triangle2 object to the visualization.
 
void addObject (VoroCell2 *pVoroCell, const Color &c)
 Add a Voronoi cell to the visualization.
 
Bbox2 computeRange (bool bWithVoronoi)
 Compute the range. More...
 
void writeFile ()
 Finish and write the postscript 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
 
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

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

Constructor & Destructor Documentation

◆ Visualizer2()

GEOM_FADE2D::Visualizer2::Visualizer2 ( const char *  filename_)
explicit
Parameters
filename_is the name of the postscript file to be written

Member Function Documentation

◆ computeRange()

Bbox2 GEOM_FADE2D::Visualizer2::computeRange ( bool  bWithVoronoi)
Parameters
bWithVoronoispecifies if the Voronoi cells shall be incorporated.
Returns
a bounding box of currently contained objects

◆ writeFile()

void GEOM_FADE2D::Visualizer2::writeFile ( )
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: