C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2

DimensionGeometry class is the base class of geometry for two-dimensional representations of linear, radial, angular sizes. More...

#include <vsn_dimensiongeometry.h>

+ Inheritance diagram for VSN::DimensionGeometry:
+ Collaboration diagram for VSN::DimensionGeometry:

Public Types

enum  TextOrientation { to_Freeze , to_ScreenOnly , to_Readable }
 

Public Member Functions

virtual ~DimensionGeometry ()
 Destructor.
 
DimensionGeometry::TextOrientation GetTextOrientation () const
 Returns orientation of text on dimension line.
 
TextVPosition GetTextVPosition () const
 Returns vertical alignment of text.
 
TextHPosition GetTextHPosition () const
 Returns horizontal alignment of text.
 
bool IsValid () const
 Returns true if size is completely determined.
 
Color GetLabelColor () const
 Returns color of dimension text.
 
void SetLabelColor (const Color &color)
 Sets color of dimension text.
 
Color GetDimensionColor () const
 Returns color of dimension.
 
void SetDimensionColor (const Color &color)
 Sets color of dimension.
 
double GetExtensionLineHeight () const
 Returns height of extension line.
 
void SetExtensionLineHeight (double extHeight)
 Sets height of extension line.
 
double GetValue () const
 Returns calculated value.
 
void SetUserValue (double value)
 Sets user dimension value.
 
void SetUserValue (const String &value)
 Sets user dimension value.Unit conversion during display is not applicable.
 
void SetFontSize (uint size)
 Set the font size.
 
uint GetFontSize () const
 Get the font size.
 
const MbPlaneGetPlane () const
 Sets text orientation on dimension line. More...
 
virtual void SetPlane (const MbPlane &plane)
 Sets dimension plane in which 2D size representation is computed.
 
virtual const MbCubeGetBoundingBox () const override
 Returns bounding box.
 
virtual String GetDefaultUnits () const
 Returns default measurement units identical to model measurement units for correct converting.
 
virtual void SetDefaultUnits (const String &units)
 Sets default measurement units identical to model measurement units for correct converting.
 
virtual String GetOutputUnits () const
 Returns measurement units for output.
 
virtual void SetOutputUnits (const String &units)
 Sets measurement units for output.
 
bool IsTextPositionUser () const
 Returns true if text position is set by user with SetTextPosition function.
 
virtual const MbCartPoint3D GetTextPosition () const
 Returns text position of 2D size.
 
virtual void SetTextPosition (const MbCartPoint3D &textPos)
 Sets text position of 2D size.
 
virtual double CalculateValue () const
 Returns calculated measurement value. v.
 
bool IsArrowsVisible () const
 Get the visibility of dimension arrows.
 
void SetArrowsVisible (bool visible)
 Set the visibility of dimension arrows.
 
- Public Member Functions inherited from VSN::AnnotationGeometry
virtual ~AnnotationGeometry ()
 Destructor.
 
virtual bool IsAnnotation () const
 Checks if geometry is annotative.
 
- Public Member Functions inherited from VSN::MeshGeometry
 MeshGeometry (Node *pParent=nullptr)
 Default constructor.
 
virtual ~MeshGeometry ()
 Destructor.
 
virtual size_t GetFaceCount (size_t indexLod) const
 Returns face count.
 
virtual size_t GetVertexCount () const
 Returns vertex count.
 
size_t GetNormalCount () const
 Returns normal count.
 
const MbCubeGetMeshBoundingBox () const
 Returns wireframe bounding box.
 
bool IsActiveColorVertex () const
 Checks if vertex color is active.
 
void SetActiveColorVertex (bool bActive)
 Sets necessity of use of indexed color in vertices.
 
size_t GetLevelsDetail () const
 Returns count of Levels Of Detail (LOD).
 
std::vector< float > GetPositions () const
 Returns position container.
 
std::vector< float > GetNormals () const
 Returns normal container.
 
std::vector< float > GetTexels () const
 Returns texel container.
 
bool IsExistTriangles (int indexLod, const NodeKey &materialId) const
 Checks if triangulation exists in LOD container.
 
std::vector< uint > GetTriIndices (int indexLod, const NodeKey &materialId) const
 Returns specified triangulation indices.
 
std::vector< uint > GetSimilarTriStripsFansIndex (int lod, const NodeKey &materialId)
 Returns indices of triangles not depending on material and LOD.
 
size_t GetTriangleCount (int lod, const NodeKey &materialId) const
 Returns triangle count in the array of LOD.
 
bool IsExistStrips (int lod, const NodeKey &materialId) const
 Checks if object contains the mesh with given material.
 
std::vector< std::vector< uint > > GetTriStripsIndex (int lod, const NodeKey &materialId) const
 Returns triangulation indices.
 
int GetTriStripCount (int lod, const NodeKey &materialId) const
 Returns count of triangles corresponding to LOD.
 
bool IsExistFans (int lod, const NodeKey &materialId) const
 Checks if triangles with given material and LOD exist.
 
std::vector< std::vector< uint > > GetTriFansIndex (int lod, const NodeKey &materialId) const
 Returns triangulation indices.
 
int GetTriFansCount (int lod, const NodeKey &materialId) const
 Returns count of triangles corresponding to material and LOD.
 
bool IsExistLevelOfDetail (int lod) const
 Checks if LOD with given identifier exists.
 
bool LevelOfDetailIncludesMaterial (int lod, const NodeKey &materialId) const
 Checks if material for the specified LOD is included.
 
double GetAccuracyLevelOfDetail (int lod) const
 Returns the computational accuracy for given LOD.
 
void SetFaceOffset (float factor, float units)
 Set the scale and units that will be used to calculate the depth values.
 
MaterialGetMaterialPrimitiveById (uint id, int lod=0) const
 Returns material of primitive by the specified identifier and LOD.
 
std::set< uint > GetArrayIDsPrimitives () const
 Returns primitive identifiers.
 
bool IsEmpty () const
 Checks if object is empty.
 
MeshGeometryCreateMeshByIndexLod (int lodIndex)
 Creates mesh of LOD.
 
MeshGeometryCreateMeshFromByIndexLod (int lodIndex)
 Creates mesh of LOD.
 
virtual void TransformVerticesByMatrix (const Matrix3DF &matrix) override
 Transforms mesh vertices by the matrix.
 
virtual float GetVolume () override
 Returns geometry volume.
 
virtual void UpdateMesh (MbMesh *pMeshItem)
 Updates object mesh.
 
virtual void Clear ()
 Clears all geometry.
 
void ClearMeshGeometry ()
 Clears the object and all LODs.
 
bool IsVisibleTriangles (uint primitiveId) const
 Returns true if polygons by the specified ID are visible .
 
void SetVisibleTriangles (uint primitiveId, bool visible)
 Set visibility of the polygon by the specified ID.
 
void MakeAllTrianglesVisible ()
 Make all triangles visible.
 
void AddVertices (const std::vector< float > &vertices)
 Adds vertex coordinates.
 
void AddNormals (const std::vector< float > &normals)
 Adds normals.
 
void AddTexels (const std::vector< float > &texels)
 Adds texels.
 
void AddColors (const std::vector< float > &colors)
 Adds colors.
 
uint AddTriangles (TypeTriangulation type, Material *pMaterial, const std::vector< uint > &indices, int lod=0, float accuracy=0.0f)
 Adds triangulation and returns identifier.
 
void ReverseNormals ()
 Inverts direction of all normals.
 
void CloseMesh ()
 Completes preparing the object with set data.
 
virtual void SetLevelDetail (int value)
 Sets LOD in the range from 0 to 100.
 
virtual void ReplaceMainMaterial (Material *pMaterial)
 Replaces the main material with the specified material.
 
void ReplaceMaterial (const NodeKey &key, Material *pMaterial)
 Replaces the material with given identifier.
 
void SetWireframeColor (const Color &color)
 Sets wireframe color.
 
virtual void DuplicateVertexBufferToClientSide ()
 Duplicates vertex buffer into memory.
 
virtual void ReleaseVertexBufferClientSide (bool update)
 Creates vertex buffer.
 
virtual void PickObjectsInsideRect (const MbRect &rect, const Matrix3DF &viewMatrix, const Matrix3DF &mx, Filter filter, bool bUnifying, HitList &hits) override
 Find objects that are in the specified area.
 
- Public Member Functions inherited from VSN::WireframeGeometry
 WireframeGeometry (Node *pParent=nullptr)
 Constructor.
 
virtual ~WireframeGeometry ()
 Destructor.
 
bool IsValid () const
 Checks if geometry is valid.
 
bool HasMaterial () const
 Checks if material is set.
 
MaterialGetHeadMaterial () const
 Returns the first material from the table.
 
size_t GetMaterialCount () const override
 Returns material count from the table.
 
MaterialGetMaterialById (NodeKey id) const
 Returns the pointer corresponding to the identifier.
 
std::set< Material * > GetMaterialSet () const override
 Returns material table.
 
std::list< NodeKeyGetMaterialIds () const
 Returns material identifier list.
 
virtual bool HasMaterialById (const NodeKey &key) const override
 Checks if the material with set identifier exists in the table.
 
const MbCubeGetWireBoundingBox () const
 Returns wireframe bounding box.
 
bool IsBoundingBoxValid () const override
 Checks if bounding box is valid.
 
bool IsTransparent () const override
 Checks if geometry is transparent.
 
bool IsExistTransparentMaterials () const
 Checks if transparent material exists in the table.
 
bool IsColorEachVertex () const
 Checks if color of each vertex is set.
 
void SetColorEachVertex (bool bColorEachVertex)
 Sets flag of setting color for each vertex.
 
bool IsWireframe () const
 Checks if geometry is wireframe.
 
float GetLineWidth () const
 Returns line width(functions are overloaded for convenience).
 
void SetLineWidth (float lineWidth)
 Sets line width(functions are overloaded for convenience).
 
float GetSelectedLineWidth () const
 Returns width of the selected line(functions are overloaded for convenience).
 
void SetSelectedLineWidth (float lineWidth)
 Sets width of the selected line(functions are overloaded for convenience).
 
Color GetWireframeColor () const
 Returns wireframe color(functions are overloaded for convenience).
 
void SetWireframeColor (const Color &color)
 Sets wireframe color(functions are overloaded for convenience).
 
virtual Pen GetPen () const override
 Get pen.
 
virtual void SetPen (const Pen &pen) override
 Set pen.
 
bool IsWireframeEmpty () const
 Checks if wireframe is empty.
 
std::vector< float > GetWireFrameVertexPositions () const
 Returns vertex positions.
 
int GetPolylineCount () const
 Returns polyline count.
 
uint GetPolylineOffset (int index) const
 Returns polyline offset with set index in the container.
 
int GetPolylineSize (int index) const
 Returns size of polyline with given index.
 
virtual bool IsIgnorePixelCulling () const override
 NO TRANSLATION.
 
virtual void IgnorePixelCulling (bool value)
 NO TRANSLATION.
 
void AddMaterial (Material *pMaterial)
 Adds material to the table.
 
virtual void UpdateTransparentMaterialCount () override
 Updates transparent material count after table operations.
 
virtual void InvertNormals () override
 Inverts direction of all vertex normals.
 
uint AddPolygonGroup (const std::vector< float > &vector, uint id=0)
 Adds vertex group and returns its identifier.
 
uint AddPoligonQuadrangleGroup (const std::vector< float > &vector)
 Adds vertex quadrangle grid group and returns its identifier.
 
void SetUseGlobalIdentifier (int global)
 Sets if the global identifier will be used.
 
virtual void CopyVertexBufferToClientSide ()
 Copies vertex buffer into memory.
 
virtual TranslucentValue GetTranslucentValue () const override
 Translucent value.
 
virtual void DoRender (const RenderState &) override
 Performs rendering.
 
virtual void Render (RenderContext &) override
 Performs rendering.
 
- Public Member Functions inherited from VSN::Geometry
 Geometry (Node *pParent=nullptr)
 Default constructor.
 
virtual ~Geometry ()
 Destructor.
 
void SetDoubleSidedLighting (bool value)
 Set double side lighting.
 
bool IsDoubleSidedLighting () const
 Does geometry use double sided lighting.
 
void SetVisible (bool value)
 Set the visibility value to the geometry object.
 
bool IsVisible () const
 Check the visibility value.
 
virtual void UpdateGeometry ()
 Updates geometry by new data.
 
- Public Member Functions inherited from VSN::Node
 Node (Node *pParent=nullptr)
 Constructor with parent.
 
virtual ~Node ()
 Destructor.
 
NodeKey GetUniqueKey () const
 Returns key identifing Node instance.
 
void SetUniqueKey (const NodeKey &key)
 Sets the unique key for the instance.
 
NodeKey GetCustomKey () const
 Returns custom key identifing Node instance.
 
void SetCustomKey (const NodeKey &key)
 Sets the custom unique key for the instance.
 
NodeGetParentNode () const
 Returns pointer to the parent object or nullptr if no parent.
 
bool IsEnabled () const
 Returns the Node enabled flag. By default, the flag is always on.
 
ObjectList< Node * > GetChildNodes () const
 Return an array of child nodes for this node.
 
void SetParent (Node *pParent)
 Sets parent object to the object.
 
bool IsNotificationsBlocked () const
 True if notifications are blocked, otherwise, False.
 
bool SetBlockNotifications (bool block)
 Sets blocking of notifications and returns the previous blocking value.
 
- Public Member Functions inherited from VSN::Object
 Object (Object *pParent=nullptr)
 Default constructor. More...
 
virtual ~Object ()
 Destructor.
 
void SetParent (Object *pParent)
 NO TRANSLATION.
 
MutexGetMutex ()
 Object mutex.
 
String GetObjectName () const
 Returns name.
 
void SetObjectName (const String &name)
 Sets name.
 
bool IsControlType () const
 TRANSLATION.
 
ObjectGetParent () const
 NO TRANSLATION.
 
Variant GetProperty (const String &name) const
 NO TRANSLATION.
 
bool IsSignalsBlocked () const
 NO TRANSLATION.
 
bool SetBlockSignals (bool bBlock)
 NO TRANSLATION.
 
void AddEventListener (Object *pObject)
 NO TRANSLATION.
 
void RemoveEventListener (Object *pObject)
 NO TRANSLATION.
 
ObjectGetSender () const
 NO TRANSLATION.
 
Thread * GetThread () const
 NO TRANSLATION.
 
void BindWithThread (Thread *thread)
 NO TRANSLATION.
 
int StartTimer (int interval, TimerType timerType=tt_CoarseTimer)
 NO TRANSLATION.
 
void KillTimer (int id)
 NO TRANSLATION.
 
const ObjectList< Object * > & GetChildren () const
 NO TRANSLATION.
 
template<typename T >
FindChild (const String &objName=String()) const
 NO TRANSLATION.
 
template<typename T >
ObjectList< T > FindChildren (const String &objName=String(), VSN::ChildFindingPolicies policies=VSN::FindAllNestedChildren) const
 NO TRANSLATION.
 
- Public Member Functions inherited from VSN::BasicObject
 BasicObject ()
 Default constructor.
 
virtual ~BasicObject ()
 Destructor.
 

Static Public Member Functions

static void SetDefaultFont (const String &str)
 Sets default font.
 

Protected Member Functions

 DimensionGeometry ()
 Default constructor.
 
 DimensionGeometry (DimensionGeometryPrivate &dd, Node *pParent)
 Constructor with parameters.
 
virtual void OpenGLDraw (const RenderState &state) override
 Renders size with OpenGL.
 
- Protected Member Functions inherited from VSN::AnnotationGeometry
 AnnotationGeometry (AnnotationGeometryPrivate &dd, Node *pParent=nullptr)
 Constructor for inner use.
 
- Protected Member Functions inherited from VSN::MeshGeometry
void RenderWireframe (const RenderState &state)
 NOT TRANSLATED.
 
 MeshGeometry (MeshGeometryPrivate &dd, Node *pParent)
 Constructor for internal use.
 
- Protected Member Functions inherited from VSN::WireframeGeometry
virtual void OGLInitGeom (const RenderState &)
 Performs rendering.
 
void OGLDrawWireframe (const RenderState &, uint mode)
 Renders wireframe in one of the modes: GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP GL_LINES.
 
void ClearWireframe ()
 Clears all wireframe.
 
 WireframeGeometry (WireframeGeometryPrivate &dd, Node *pParent)
 NO TRANSLATION.
 
- Protected Member Functions inherited from VSN::Geometry
ObjectVector< GeometryTraits * > GetGeometryTraits () const
 Returns list of geometry data from this object.
 
void AddGeometryTraits (GeometryTraits *pTraits)
 Adds data group of geometric solid body.
 
void RemoveGeometryTraits (GeometryTraits *pTraits)
 Removes data group of geometric solid body.
 
 Geometry (GeometryPrivate &dd, Node *pParent)
 Signal about the end of rebuilding the whole geometry. More...
 
- Protected Member Functions inherited from VSN::Node
 Node (NodePrivate &dd, Node *pParent)
 Sets the node enable flag. More...
 
virtual void SceneModificationEvent (const std::shared_ptr< SceneModification > &modification)
 The function is called in case of scene being modified.
 

Detailed Description

DimensionGeometry class is the base class of geometry for two-dimensional representations of linear, radial, angular sizes.

DimensionGeometry class provides measuring such values as length, radius or flat angles. Measuring a size is performed in the space of a whole model. Measurement values are presented in units of model, specified by the user. When displaying the measured value is converted from a model unit to a display unit. To render DimensionGeometry consists of the following primitives:

  • the main snap points - points fixing a size to a dimension plane;
  • the main dimension line extending from snap points to up direction and contains a label of calculated value, for example, of length;
  • the extension lines - lines containing fixation points to the main dimension line;
  • the extension lines - lines used to extend the main dimension line in cases a text or arrows don't fit in the main dimension line because of their sizes.
  • the arrows denoting the end of main dimension line.

As a rule, in 2D drawings sizes are created on a dimension plane that can be considered as a placement for creating a size representation presenting the origin and the directed axis. Respectively, the main dimension line will be presented along X-axis, and the extension lines along Y-axis. It helps the user imagine how a size will be placed and oriented in a space of model. The dimension line orientation in a space about a supporting figure is defined with the extension lines. Calculations specify a length of extension lines and their orientation about fixation points to a working plane. For a linear size: direction of extension lines is defined by a direction of the main dimension line, i.e. by a vector from the first fixation point to the second one and a normal of a dimension plane. For an angular size: radii are defined by vectors from the central point to snap points. These directions of vectors must be the positive directions of extension lines. The negative directions of radius mean these vectors must be expanded.

The dimension plane can be built automatically by an application (if possible, it depends on computed geometry). Also a dimension plane can be set by the user. If the user's plane doesn't match a measurement geometry, i.e. fixation points doesn't belong to it, a size cannot be built. If impossible to compute automatic plane, for example, in case length between two points, then the user should specify the user's plane on his own.

Member Enumeration Documentation

◆ TextOrientation

Enumerator
to_Freeze 

In size plane.

to_ScreenOnly 

In screen plane.

to_Readable 

In dimension plane with a turn by view vector.

Member Function Documentation

◆ GetPlane()

const MbPlane& VSN::DimensionGeometry::GetPlane ( ) const

Sets text orientation on dimension line.

Sets vertical alignment of text. Sets horizontal alignment of text. Signal will be generated when modifying text orientation. Signal will be generated when modifying text position vertically. Signal will be generated when modifying text position horizontally. Returns dimension plane in which 2D size representation is computed.


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