The SoFCMeshFaceSet class renders the mesh data structure. More...
#include <SoFCMeshFaceSet.h>
Public Member Functions | |
SoFCMeshFaceSet () | |
Static Public Member Functions | |
static void | initClass () |
Public Attributes | |
unsigned int | MaximumTriangles |
Protected Member Functions | |
virtual void | computeBBox (SoAction *action, SbBox3f &box, SbVec3f ¢er) |
Sets the bounding box of the mesh to box and its center to center. More... | |
virtual SoDetail * | createTriangleDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3, SoPickedPoint *pp) |
If the number of triangles exceeds MaximumTriangles 0 is returned. More... | |
virtual void | generatePrimitives (SoAction *action) |
Sets the point indices, the geometric points and the normal for each triangle. More... | |
virtual void | getPrimitiveCount (SoGetPrimitiveCountAction *action) |
Adds the number of the triangles to the SoGetPrimitiveCountAction. More... | |
virtual void | GLRender (SoGLRenderAction *action) |
Either renders the complete mesh or only a subset of the points. More... | |
virtual void | rayPick (SoRayPickAction *action) |
Calculates picked point based on primitives generated by subclasses. More... | |
The SoFCMeshFaceSet class renders the mesh data structure.
It does basically the same as SoFCMeshNode by rendering directly the FreeCAD mesh structure whereas this class follows more the Inventor way. While SoFCMeshFaceSet has a pointer to the mesh structure as a whole for SoFCMeshFaceSet the mesh is split into two nodes: an SoFCMeshVertex has a field that holds a pointer to vertex array and SoFCMeshFacet has a field that holds a pointer to the face array.
The advantage of separating the mesh structure is higher flexibility. E.g. to render open edges the class SoFCMeshOpenEdgeSet just takes the SoFCMeshVertex and SoFCMeshFaceSet nodes from the stack and does the rendering. The client programmer just has to add the an SoFCMeshOpenEdgeSet instance to the Inventor tree – nothing more. Another advantage is that memory is saved when writing the scene to a file. The actual data is only hold and written by SoFCMeshVertex and SoFCMeshFaceSet. Normally, no shape nodes have to save further data to the file.
SoFCMeshFaceSet::SoFCMeshFaceSet | ( | ) |
|
protectedvirtual |
Sets the bounding box of the mesh to box and its center to center.
References MeshGui::SoFCMeshVertexElement::get(), Base::BoundBox3< _Precision >::MaxX, Base::BoundBox3< _Precision >::MaxY, Base::BoundBox3< _Precision >::MaxZ, Base::BoundBox3< _Precision >::MinX, Base::BoundBox3< _Precision >::MinY, and Base::BoundBox3< _Precision >::MinZ.
|
protectedvirtual |
If the number of triangles exceeds MaximumTriangles 0 is returned.
This means that the client programmer needs to implement itself to get the index of the picked triangle. If the number of triangles doesn't exceed MaximumTriangles SoShape::createTriangleDetail() gets called. Against the default OpenInventor implementation which returns 0 as well Coin3d fills in the point and face indices.
References MaximumTriangles.
|
protectedvirtual |
Sets the point indices, the geometric points and the normal for each triangle.
If the number of triangles exceeds MaximumTriangles then only a triangulation of a rough model is filled in instead. This is due to performance issues.
References Base::Console(), MeshGui::SoFCMeshFacetElement::get(), MeshGui::SoFCMeshVertexElement::get(), and Base::ConsoleSingleton::Log().
|
protectedvirtual |
Adds the number of the triangles to the SoGetPrimitiveCountAction.
References MeshGui::SoFCMeshFacetElement::get().
|
protectedvirtual |
Either renders the complete mesh or only a subset of the points.
References Gui::SoFCInteractiveElement::get(), MeshGui::SoFCMeshFacetElement::get(), and MeshGui::SoFCMeshVertexElement::get().
|
static |
|
protectedvirtual |
Calculates picked point based on primitives generated by subclasses.
unsigned int MeshGui::SoFCMeshFaceSet::MaximumTriangles |
Referenced by createTriangleDetail().