C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
Class MathGeometry presents geometry for next rendering that was generated with math representation. More...
#include <vsn_mathgeometry.h>
Public Member Functions | |
MathGeometry (Node *pParent=nullptr) | |
Default constructor. | |
virtual | ~MathGeometry () |
Destructor. | |
bool | IsVerticesDisplaying () const |
Returns flag value of the vertices displaying. | |
void | SetVerticesDisplaying (bool bDisplay) |
Set flag value to vertices displaying. | |
float | GetSizeVertices () const |
Returns vertex display size. | |
void | SetSizeVertices (float size) |
Set vertex display size. | |
double | GetVisualSag () const |
Returns the maximum permissible sag of a curve or surface at adjacent points a step away. | |
void | SetVisualSag (double sag, bool bRebuildMesh) |
Returns accuracy to calculate step when triangulating surfaces and faces. | |
const MbItem * | GetMathItem () const |
Returns a pointer to math precise representation of MbItem. | |
void | SetMathItem (const MbItem *pItem, double sag=Math::visualSag) |
Sets a pointer to math precise representation of MbItem. | |
void | RebuildGeometry () |
Rebuild geometry by modified MbItem. | |
void | Clear () override |
Clears all primitives of this geometry. | |
virtual const MbCube & | GetBoundingBox () const override |
Returns object bounding box. | |
virtual void | UpdateGeometry () override |
Updates geometry with new data for inner using. | |
virtual void | PickObjectsInsideRect (const MbRect &rect, const Matrix3DF &viewMatrix, const Matrix3DF &mx, Filter filter, bool bUnifying, HitList &hits) override |
NO TRANSLATION. | |
![]() | |
CommandType | GetBuildType () const |
Returns mesh building type. | |
void | SetBuildType (CommandType type) |
Sets mesh building type. | |
virtual void | ClearAllMathPrimitives () |
Clear all mathematical primitives of this geometry. | |
InfoPrimitive | QueryMathByGeometry (uint geomId) const |
Returns a math identifier of primitive by the unique identifier of this geometry. | |
InfoPrimitive | QueryGeomByMath (uint mathId) const |
Returns a geometric identifier of primitive by the unique identifier of math primitive. | |
const MbTopologyItem * | QueryPrimitiveItemByMathId (uint mathId) const |
NO TRANSLATION. | |
const MbGrid * | QueryGridByGeometry (uint geomPrimId) const |
NO TRANSLATION. | |
MaterialCachePtr | GetMaterialCache () const |
Return the content cache for reuse. | |
void | SetMaterialCache (MaterialCachePtr pCache) |
Set a cache of materials for reuse. | |
![]() | |
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 MbCube & | GetMeshBoundingBox () 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. | |
Material * | GetMaterialPrimitiveById (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. | |
MeshGeometry * | CreateMeshByIndexLod (int lodIndex) |
Creates mesh of LOD. | |
MeshGeometry * | CreateMeshFromByIndexLod (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. | |
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. | |
![]() | |
WireframeGeometry (Node *pParent=nullptr) | |
Constructor. | |
virtual | ~WireframeGeometry () |
Destructor. | |
bool | IsValid () const |
Checks if geometry is valid. | |
bool | HasMaterial () const |
Checks if material is set. | |
Material * | GetHeadMaterial () const |
Returns the first material from the table. | |
size_t | GetMaterialCount () const override |
Returns material count from the table. | |
Material * | GetMaterialById (NodeKey id) const |
Returns the pointer corresponding to the identifier. | |
std::set< Material * > | GetMaterialSet () const override |
Returns material table. | |
std::list< NodeKey > | GetMaterialIds () 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 MbCube & | GetWireBoundingBox () 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. | |
![]() | |
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 bool | IsAnnotation () const |
NO TRANSLATION. | |
![]() | |
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. | |
Node * | GetParentNode () 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. | |
![]() | |
Object (Object *pParent=nullptr) | |
Default constructor. More... | |
virtual | ~Object () |
Destructor. | |
void | SetParent (Object *pParent) |
NO TRANSLATION. | |
Mutex * | GetMutex () |
Object mutex. | |
String | GetObjectName () const |
Returns name. | |
void | SetObjectName (const String &name) |
Sets name. | |
bool | IsControlType () const |
TRANSLATION. | |
Object * | GetParent () 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. | |
Object * | GetSender () 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 > | |
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. | |
![]() | |
BasicObject () | |
Default constructor. | |
virtual | ~BasicObject () |
Destructor. | |
Protected Member Functions | |
MathGeometry (MathGeometryPrivate &dd, Node *pParent) | |
NO TRANSLATION. | |
![]() | |
virtual | ~MathBaseGeometry () |
Destructor. | |
MathBaseGeometry (MathBaseGeometryPrivate &dd, Node *pParent) | |
NO TRANSLATION. | |
![]() | |
void | RenderWireframe (const RenderState &state) |
NOT TRANSLATED. | |
MeshGeometry (MeshGeometryPrivate &dd, Node *pParent) | |
Constructor for internal use. | |
![]() | |
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. | |
![]() | |
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... | |
![]() | |
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. | |
Class MathGeometry presents geometry for next rendering that was generated with math representation.
MathGeometry class takes a pointer to MbItem math representation for the next generating visual representation. MbItem can presents such objects as MbSolid, MbMesh, MbСontour, etc that are able to generate a polygonal model independently. MathGeometry class presents a set of useful functions. You can use SetVisualSag function to compute a triangulation step of planes and faces and you can call regeneration of triangulation in real time, what influences quality of geometry display. You can get primitive identification from visual representation to math one and vice versa using QueryMathByGeometry and QueryGeomByMath functions. It's necessary to know that identifiers of math representation are hash of real identifiers and paths to these primitives.