OpenLexocad
28.0
|
#include <Builder3D.h>
Public Member Functions | |
Builder3D () | |
Construction. More... | |
virtual | ~Builder3D () |
Destruction. More... | |
point set handling | |
void | startPoints (short pointSize=2, float color_r=1.0, float color_g=0.0, float color_b=0.0) |
starts a point set More... | |
void | addPoint (float x, float y, float z) |
insert a point in an point set More... | |
void | addPoint (const Vector3f &vec) |
add a vector to a point set More... | |
void | endPoints (void) |
ends the points set operation More... | |
void | addSinglePoint (float x, float y, float z, short pointSize=2, float color_r=1.0, float color_g=1.0, float color_b=1.0) |
add a singular point (without startPoints() & endPoints() ) More... | |
void | addSinglePoint (const Base::Vector3f &vec, short pointSize=2, float color_r=1.0, float color_g=1.0, float color_b=1.0) |
add a singular point (without startPoints() & endPoints() ) More... | |
line/direction handling | |
void | addSingleLine (Vector3f pt1, 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 More... | |
void | addSingleArrow (Vector3f pt1, 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. More... | |
triangle handling | |
void | addSingleTriangle (Vector3f pt0, Vector3f pt1, 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 More... | |
Transformation | |
void | addTransformation (const Base::Matrix4D &) |
adds a transformation More... | |
void | addTransformation (const Base::Vector3f &translation, const Base::Vector3f &rotationaxis, float fAngle) |
text handling | |
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 More... | |
void | addText (const Base::Vector3f &vec, const char *text, float color_r=1.0, float color_g=1.0, float color_b=1.0) |
add a text More... | |
void | clear (void) |
clear the string buffer More... | |
write the result | |
void | saveToLog (void) |
sends the result to the log and gui More... | |
void | saveToFile (const char *FileName) |
save the result to a file (*.iv) More... | |
A Builder class for 3D representations on App level On the application level nothing is known of the visual representation of data. Nevertheless it's often needed to see some 3D information, e.g. points, directions, when you program or debug an algorithm. Builder3D was made for this specific purpose. This class allows you to easily build up a 3D representation of some mathematical and algorithm internals. You can save this representation to a file and view it in an Inventor viewer, or send it to the log. In the case of using the log and a debug FreeCAD the representation will be loaded into the active viewer.
Base::Builder3D::Builder3D | ( | ) |
Construction.
|
virtual |
Destruction.
void Base::Builder3D::addPoint | ( | const Vector3f & | vec | ) |
add a vector to a point set
void Base::Builder3D::addPoint | ( | float | x, |
float | y, | ||
float | z | ||
) |
insert a point in an point set
void Base::Builder3D::addSingleArrow | ( | Vector3f | pt1, |
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 Base::Builder3D::addSingleLine | ( | Vector3f | pt1, |
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
void Base::Builder3D::addSinglePoint | ( | const Base::Vector3f & | vec, |
short | pointSize = 2 , |
||
float | color_r = 1.0 , |
||
float | color_g = 1.0 , |
||
float | color_b = 1.0 |
||
) |
add a singular point (without startPoints() & endPoints() )
void Base::Builder3D::addSinglePoint | ( | float | x, |
float | y, | ||
float | z, | ||
short | pointSize = 2 , |
||
float | color_r = 1.0 , |
||
float | color_g = 1.0 , |
||
float | color_b = 1.0 |
||
) |
add a singular point (without startPoints() & endPoints() )
void Base::Builder3D::addSingleTriangle | ( | Vector3f | pt0, |
Vector3f | pt1, | ||
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
void Base::Builder3D::addText | ( | const Base::Vector3f & | vec, |
const char * | text, | ||
float | color_r = 1.0 , |
||
float | color_g = 1.0 , |
||
float | color_b = 1.0 |
||
) |
add a text
void Base::Builder3D::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
void Base::Builder3D::addTransformation | ( | const Base::Matrix4D & | ) |
adds a transformation
void Base::Builder3D::addTransformation | ( | const Base::Vector3f & | translation, |
const Base::Vector3f & | rotationaxis, | ||
float | fAngle | ||
) |
void Base::Builder3D::clear | ( | void | ) |
clear the string buffer
void Base::Builder3D::endPoints | ( | void | ) |
ends the points set operation
void Base::Builder3D::saveToFile | ( | const char * | FileName | ) |
save the result to a file (*.iv)
void Base::Builder3D::saveToLog | ( | void | ) |
sends the result to the log and gui
void Base::Builder3D::startPoints | ( | short | pointSize = 2 , |
float | color_r = 1.0 , |
||
float | color_g = 0.0 , |
||
float | color_b = 0.0 |
||
) |
starts a point set