Base::InventorBuilder Class Reference

This class does basically the same as Builder3D except that it writes the data directly into a given stream without buffering the output data in a string stream. More...

#include <Builder3D.h>

List of all members.

Public Member Functions

void addDrawStyle (short pointSize, short lineWidth, unsigned short linePattern=0xffff, const char *style="FILLED")
void addMaterial (float color_r, float color_g, float color_b)
void addMaterialBinding (const char *="OVERALL")
void beginSeparator ()
void close ()
void endSeparator ()
 InventorBuilder (std::ostream &)
 Construction.
virtual ~InventorBuilder ()
 Destruction.
Bounding Box handling



void addBoundingBox (const Vector3f &pt1, const Vector3f &pt2, short lineWidth=2, float color_r=1.0, float color_g=1.0, float color_b=1.0)
Surface handling



void addCylinder (float radius, float height)
void addNurbsSurface (const std::vector< Base::Vector3f > &controlPoints, int numUControlPoints, int numVControlPoints, const std::vector< float > &uKnots, const std::vector< float > &vKnots)
 The number of control points must be numUControlPoints * numVControlPoints.
Line/Direction handling



void addIndexedFaceSet (const std::vector< Vector3f > &points, const std::vector< int > &indices, float crease)
void addLineSet (const std::vector< Vector3f > &points, short lineSize=2, float color_r=1.0, float color_g=1.0, float color_b=1.0, unsigned short linePattern=0xffff)
 add a line defined by a list of points whereat always a pair (i.e. a point and the following point) builds a line.
void addSingleArrow (const Vector3f &pt1, const Vector3f &pt2, short lineSize=2, float color_r=1.0, float color_g=1.0, float color_b=1.0, unsigned short linePattern=0xffff)
 add a arrow (directed line) by 2 Vector3D. The arrow shows in direction of point 2.
void addSingleLine (const Vector3f &pt1, const Vector3f &pt2, short lineSize=2, float color_r=1.0, float color_g=1.0, float color_b=1.0, unsigned short linePattern=0xffff)
 add a line defined by 2 Vector3D
Point set handling



void addPoint (const Vector3f &vec)
 add a vector to a point set
void addPoint (float x, float y, float z)
 insert a point in an point set
void beginPoints ()
 starts a point set
void endPoints (void)
 ends the points set operation
Triangle handling



void addSinglePlane (const Vector3f &base, const Vector3f &eX, const Vector3f &eY, float length, float width, bool filled=true, short lineSize=2, float color_r=1.0, float color_g=1.0, float color_b=1.0)
void addSingleTriangle (const Vector3f &pt0, const Vector3f &pt1, const Vector3f &pt2, bool filled=true, short lineSize=2, float color_r=1.0, float color_g=1.0, float color_b=1.0)
 add a (filled) triangle defined by 3 vectors
Text handling



void addText (const Vector3f &vec, const char *text, float color_r=1.0, float color_g=1.0, float color_b=1.0)
 add a text
void addText (float pos_x, float pos_y, float pos_z, const char *text, float color_r=1.0, float color_g=1.0, float color_b=1.0)
 add a text
Transformation



void addTransformation (const Vector3f &translation, const Vector3f &rotationaxis, float fAngle)
void addTransformation (const Matrix4D &)
 adds a transformation

Detailed Description

This class does basically the same as Builder3D except that it writes the data directly into a given stream without buffering the output data in a string stream.

Compared to file streams string streams are quite slow when writing data with more than a few hundred lines. Due to performance reasons the user should use a file stream in this case.

Author:
Werner Mayer

Definition at line 141 of file Builder3D.h.


Constructor & Destructor Documentation

InventorBuilder::InventorBuilder ( std::ostream &  output  ) 

Construction.

Definition at line 333 of file Builder3D.cpp.

References beginSeparator(), and result.

InventorBuilder::~InventorBuilder (  )  [virtual]

Destruction.

Definition at line 340 of file Builder3D.cpp.

References close().


Member Function Documentation

void InventorBuilder::addBoundingBox ( const Vector3f pt1,
const Vector3f pt2,
short  lineWidth = 2,
float  color_r = 1.0,
float  color_g = 1.0,
float  color_b = 1.0 
)
void InventorBuilder::addCylinder ( float  radius,
float  height 
)

Definition at line 722 of file Builder3D.cpp.

References Base::blanks(), indent, and result.

void InventorBuilder::addDrawStyle ( short  pointSize,
short  lineWidth,
unsigned short  linePattern = 0xffff,
const char *  style = "FILLED" 
)

Definition at line 379 of file Builder3D.cpp.

References Base::blanks(), indent, and result.

void InventorBuilder::addIndexedFaceSet ( const std::vector< Vector3f > &  points,
const std::vector< int > &  indices,
float  crease 
)

Definition at line 578 of file Builder3D.cpp.

References result.

Referenced by Part::TopoShape::exportFaceSet(), and Mesh::MeshPy::writeInventor().

void InventorBuilder::addLineSet ( const std::vector< Vector3f > &  points,
short  lineSize = 2,
float  color_r = 1.0,
float  color_g = 1.0,
float  color_b = 1.0,
unsigned short  linePattern = 0xffff 
)

add a line defined by a list of points whereat always a pair (i.e. a point and the following point) builds a line.

Add a line defined by a list of points whereat always a pair (i.e.

a point and the following point) builds a line. the size of the list must then be even.

Definition at line 534 of file Builder3D.cpp.

References result.

Referenced by Part::TopoShape::exportLineSet().

void InventorBuilder::addMaterial ( float  color_r,
float  color_g,
float  color_b 
)

Definition at line 365 of file Builder3D.cpp.

References Base::blanks(), indent, and result.

void InventorBuilder::addMaterialBinding ( const char *  bind = "OVERALL"  ) 

Definition at line 373 of file Builder3D.cpp.

References Base::blanks(), indent, and result.

void InventorBuilder::addNurbsSurface ( const std::vector< Base::Vector3f > &  controlPoints,
int  numUControlPoints,
int  numVControlPoints,
const std::vector< float > &  uKnots,
const std::vector< float > &  vKnots 
)

The number of control points must be numUControlPoints * numVControlPoints.

The order in u or v direction of the NURBS surface is implicitly given by number of elements in uKnots - numUControlPoints or number of elements in vKnots - numVControlPoints.

Definition at line 673 of file Builder3D.cpp.

References result.

void InventorBuilder::addPoint ( const Vector3f vec  ) 

add a vector to a point set

Definition at line 414 of file Builder3D.cpp.

References addPoint(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.

void InventorBuilder::addPoint ( float  x,
float  y,
float  z 
)

insert a point in an point set

Definition at line 408 of file Builder3D.cpp.

References Base::blanks(), indent, and result.

Referenced by addPoint(), and Points::PointsPy::writeInventor().

void InventorBuilder::addSingleArrow ( const Vector3f pt1,
const Vector3f pt2,
short  lineSize = 2,
float  color_r = 1.0,
float  color_g = 1.0,
float  color_b = 1.0,
unsigned short  linePattern = 0xffff 
)
void InventorBuilder::addSingleLine ( const Vector3f pt1,
const Vector3f pt2,
short  lineSize = 2,
float  color_r = 1.0,
float  color_g = 1.0,
float  color_b = 1.0,
unsigned short  linePattern = 0xffff 
)

add a line defined by 2 Vector3D

Definition at line 468 of file Builder3D.cpp.

References result, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.

void InventorBuilder::addSinglePlane ( const Vector3f base,
const Vector3f eX,
const Vector3f eY,
float  length,
float  width,
bool  filled = true,
short  lineSize = 2,
float  color_r = 1.0,
float  color_g = 1.0,
float  color_b = 1.0 
)
void InventorBuilder::addSingleTriangle ( const Vector3f pt0,
const Vector3f pt1,
const Vector3f pt2,
bool  filled = true,
short  lineSize = 2,
float  color_r = 1.0,
float  color_g = 1.0,
float  color_b = 1.0 
)

add a (filled) triangle defined by 3 vectors

Definition at line 613 of file Builder3D.cpp.

References result, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.

void InventorBuilder::addText ( const Vector3f vec,
const char *  text,
float  color_r = 1.0,
float  color_g = 1.0,
float  color_b = 1.0 
)
void InventorBuilder::addText ( float  pos_x,
float  pos_y,
float  pos_z,
const char *  text,
float  color_r = 1.0,
float  color_g = 1.0,
float  color_b = 1.0 
)

add a text

Add a Text with a given position to the 3D set.

The origion is the lower leftmost corner.

Parameters:
pos_x,pos_y,pos_z origin of the text
text the text to display.
color_r red part of the text color (0.0 - 1.0).
color_g green part of the text color (0.0 - 1.0).
color_b blue part of the text color (0.0 - 1.0).

Definition at line 445 of file Builder3D.cpp.

References Base::blanks(), indent, and result.

Referenced by addText(), and Mesh::MeshPy::nearestFacetOnRay().

void InventorBuilder::addTransformation ( const Vector3f translation,
const Vector3f rotationaxis,
float  fAngle 
)
void InventorBuilder::addTransformation ( const Matrix4D transform  ) 
void InventorBuilder::beginPoints (  ) 

starts a point set

Starts the definition of point set.

If posible make not too much beginPoints() and endPoints() calls. Try to put all points in one set.

See also:
startPoints()
endPoints()

Definition at line 399 of file Builder3D.cpp.

References Base::blanks(), indent, and result.

Referenced by Points::PointsPy::writeInventor().

void InventorBuilder::beginSeparator (  ) 

Definition at line 353 of file Builder3D.cpp.

References Base::blanks(), indent, and result.

Referenced by InventorBuilder().

void InventorBuilder::close (  ) 
void InventorBuilder::endPoints ( void   ) 

ends the points set operation

Ends the point set operations and write the resulting inventor string.

See also:
startPoints()

Definition at line 423 of file Builder3D.cpp.

References Base::blanks(), indent, and result.

Referenced by Points::PointsPy::writeInventor().

void InventorBuilder::endSeparator (  ) 

Definition at line 359 of file Builder3D.cpp.

References Base::blanks(), indent, and result.

Referenced by close().


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

Generated on Wed Nov 23 19:01:47 2011 for FreeCAD by  doxygen 1.6.1