Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.58
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 std::string &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< 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 std::string &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 std::string &title)
 
void writeFooter ()
 
void writeLabel (Label l)
 
void writeLine (const Point2 &pSource, const Point2 &pTarget)
 
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

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
 
std::string filename
 
std::vector< std::string > vHeaderLines
 
bool bFileClosed
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Visualizer2()

GEOM_FADE2D::Visualizer2::Visualizer2 ( const std::string &  filename_)
explicit
Parameters
filename_is the name of the postscript file to be written

Member Function Documentation

◆ 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: