openmbvcppinterface
3.1.0
OpenMBV C++ Interface
|
#include <ivscreenannotation.h>
Public Member Functions | |
void | initializeUsingXML (xercesc::DOMElement *element) override |
xercesc::DOMElement * | writeXMLFile (xercesc::DOMNode *parent) override |
void | setScale1To1 (bool scale1To1_) |
bool | getScale1To1 () |
void | setScale1To1At (const std::vector< double > &scale1To1Center_) |
std::vector< double > | getScale1To1At () |
void | setIvFileName (std::string ivFileName_) |
std::string | getIvFileName () |
void | setIvContent (std::string ivContent_) |
const std::string & | getIvContent () |
void | setColumnLabels (const std::vector< std::string > &columnLabels_) |
const std::vector< std::string > & | getColumnLabels () const |
void | createHDF5File () override |
void | openHDF5File () override |
template<typename T > | |
void | append (const T &row) |
int | getRows () override |
std::vector< double > | getRow (int i) override |
![]() | |
void | setOutLine (bool ol) |
bool | getOutLine () |
void | setShilouetteEdge (bool ol) |
bool | getShilouetteEdge () |
void | setDrawMethod (DrawStyle ds) |
DrawStyle | getDrawMethod () |
void | setPointSize (double ps) |
double | getPointSize () |
void | setLineWidth (double lw) |
double | getLineWidth () |
void | initializeUsingXML (xercesc::DOMElement *element) override |
xercesc::DOMElement * | writeXMLFile (xercesc::DOMNode *parent) override |
virtual int | getRows ()=0 |
virtual std::vector< double > | getRow (int i)=0 |
![]() | |
void | setEnable (bool enable) |
bool | getEnable () |
void | setBoundingBox (bool bbox) |
bool | getBoundingBox () |
void | setName (const std::string &name_) |
std::string | getName () |
virtual std::string | getFullName () |
void | setEnvironment (bool env) |
bool | getEnvironment () |
virtual void | initializeUsingXML (xercesc::DOMElement *element) |
virtual xercesc::DOMElement * | writeXMLFile (xercesc::DOMNode *parent) |
std::shared_ptr< Group > | getTopLevelGroup () |
std::weak_ptr< Group > | getParent () |
H5::GroupBase * | getHDF5Group () |
std::string | getID () const |
void | setID (std::string ID_) |
Protected Attributes | |
bool | scale1To1 |
std::vector< double > | scale1To1Center |
std::string | ivFileName |
std::string | ivContent |
std::vector< std::string > | columnLabels |
H5::VectorSerie< double > * | data {nullptr} |
![]() | |
std::string | outLineStr |
std::string | shilouetteEdgeStr |
DrawStyle | drawMethod {filled} |
double | pointSize {0} |
double | lineWidth {0} |
![]() | |
std::string | name |
std::string | enableStr |
std::string | boundingBoxStr |
std::string | ID |
std::string | environmentStr |
std::weak_ptr< Group > | parent |
H5::GroupBase * | hdf5Group {nullptr} |
std::string | fullName |
Friends | |
class | ObjectFactory |
Additional Inherited Members | |
![]() | |
enum | DrawStyle { filled , lines , points } |
void | createHDF5File () override |
void | openHDF5File () override |
virtual void | createHDF5File ()=0 |
virtual void | openHDF5File ()=0 |
A screen annotation defined by a Open Inventor file or a VRML file.
This object is very special and behaves quite different compared to usual objects. It not placed in the 3D scene and is not influenced by the camera or lights in the scene. Hence, use e.g. a Material node with emissiveColor field to define the color of geometry. It is placed in normalized screen coordinates. The x-axis is horizontal and the y-axis is vertical. The bottom left coordinate is -1,-1 and the top right coordinate is 1,1. The z-coordinate is irrelevant since z-buffering is disabled for these objects sicne its children are transparently render on top of the other. This means that a node defined later in the IV file will override previously nodes on the screen.
Note that the aspect ratio is only 1:1 if the screen is a square. However, it is possible to do an automatically scaling to ensure that the aspect ratio is always 1:1, see setScale1To1At.
The dynamic data of this object is defined by the user, see setColumnLabels. For each column a named node is created which can be accessed from the IV file. The node name is the column label and the field "value" of this node holds the dynamic data of the column.
As e.g. RigidBody this object also provides drawing a path. The path point for each frame is defined by the origin of the node named "OpenMBVIvScreenAnnotationPathOrigin" in the IV file. If no such node exists, no path is drawn. If "OpenMBVIvScreenAnnotationPathOrigin" is given than also a node named "OpenMBVIvScreenAnnotationPathSep" of type Separator must exist in the IV file. "OpenMBVIvScreenAnnotationPathSep" MUST NOT be influenced by any translation! However, its position in the scene graph defines the order in with the path is drawn compared to the other nodes, see above. The path is added as a child of this node.
This object can also draw more than one path if the nodes are named "OpenMBVIvScreenAnnotationPathOrigin<nr>". <nr> counts from 1 to N and stops if at the first node name which does not exist. In this case the path is added as a child of the OpenMBVIvScreenAnnotationPathSep node, see above, or, if this node does not exist, as a child of the OpenMBVIvScreenAnnotationPathSep<nr> node.
All named nodes of name OpenMBVIvScreenAnnotation* are remove (during the ctor) from the node/name mapping.
|
overridevirtual |
Reimplemented from OpenMBV::Body.
|
inlineoverridevirtual |
Get row number i of the default data. NOTE: see also append()
Implements OpenMBV::Body.
|
inlineoverridevirtual |
Get the number of rows of the default data. Returns 0, if no default data is avaliable. NOTE: see also append()
Implements OpenMBV::Body.
|
overridevirtual |
Initializes the time invariant part of the object using a XML node
Reimplemented from OpenMBV::Body.
|
overridevirtual |
Reimplemented from OpenMBV::Body.
void OpenMBV::IvScreenAnnotation::setScale1To1At | ( | const std::vector< double > & | scale1To1Center_ | ) |
Scales the screen to ensure that the screen coordinates have a aspect ratio of 1:1. This scaling is done with a scale center at the specified point and the smaller axis is not scaled. This means that the smaller axis still runs from -1 to 1.
Use this function is you want to draw something with a aspect ratio of 1:1. If you want the draw it e.g. in the top right corner set scale1To1Center_ to 1,1 and the coordinate of the top right corner will still be 1,1 after the scaling to 1:1.
|
overridevirtual |
Reimplemented from OpenMBV::Body.