Fade2.5D Documentation pages v1.85
Delaunay Features
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 addObject (const Segment2 &seg, const Color &c)
 Add a Segment2 object to the visualization.
 
void addObject (const Edge2 &edge, const Color &c)
 Add an Edge2 object 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< Point2 * > &vPoints, const Color &c)
 Add a vector of Point2* to the visualization.
 
void addObject (const std::vector< Segment2 > &vSegments, const Color &c)
 Add a vector of Segment2 objects 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< Triangle2 > &vT, const Color &c)
 Add a vector of Triangle2 objects to the visualization.
 
void addObject (const Circle2 &circ, const Color &c)
 Add a Circle2 object to the visualization.
 
void addObject (const Point2 &pnt, const Color &c)
 Add a Point2 object to the visualization.
 
void addObject (const Triangle2 &tri, const Color &c)
 Add a Triangle2 object to the visualization.
 
void addObject (const std::vector< Triangle2 * > &vT, const Color &c)
 Add a Triangle2* vector to the visualization.
 
void addObject (const Label &lab, const Color &c)
 Add a Label object to the visualization.
 
void addHeaderLine (const char *s)
 Add a header line to the visualization.
 
void writeFile ()
 Finish and write the postscript file. More...
 

Protected Member Functions

void writeHeaderLines ()
 
Point2 scaledPoint (const Point2 &p)
 
double scaledDouble (const double &d)
 
void changeColor (float r, float g, float b, float linewidth, bool bFill)
 
void changeColor (const Color &c)
 
void writeHeader (const char *title)
 
void writeFooter ()
 
void writeLabel (Label l)
 
void writeLine (const Point2 &pSource, const Point2 &pTarget)
 
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 writePoint (Point2 &p1_, float size)
 
void writeCircle (const Point2 &p1_, double radius, bool bFill)
 
void periodicStroke ()
 
void setRange ()
 

Protected Attributes

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

Detailed Description

Visualizer2 is a general Postscript writer. It draws the objects Point2, Segment2, Triangle2, Circle2 and Label.

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

Constructor & Destructor Documentation

◆ Visualizer2()

Visualizer2::Visualizer2 ( const char *  filename_)
explicit

Constructor.

Parameters
filename_is the name of the postscript file to be written

Member Function Documentation

◆ writeFile()

void Visualizer2::writeFile ( )

Finish and write the postscript 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: