class SoFCMeshObjectShape More...
#include <SoFCMeshObject.h>
Public Member Functions | |
SoFCMeshObjectShape () | |
Static Public Member Functions | |
static void | initClass () |
Public Attributes | |
unsigned int | renderTriangleLimit |
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 renderTriangleLimit 0 is returned. More... | |
virtual void | doAction (SoAction *action) |
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... | |
class SoFCMeshObjectShape
The SoFCMeshObjectShape class is designed to render huge meshes.
The SoFCMeshObjectShape is an Inventor shape node that is designed to render huge meshes. If the mesh exceeds a certain number of triangles and the user does some intersections (e.g. moving, rotating, zooming, spinning, etc.) with the mesh then the GLRender() method renders only the gravity points of a subset of the triangles. If there is no user interaction with the mesh then all triangles are rendered. The limit of maximum allowed triangles can be specified in renderTriangleLimit, the default value is set to 100.000.
The GLRender() method checks the status of the SoFCInteractiveElement to decide to be in interactive mode or not. To take advantage of this facility the client programmer must set the status of the SoFCInteractiveElement to true if there is a user interaction and set the status to false if not. This can be done e.g. in the actualRedraw() method of the viewer.
SoFCMeshObjectShape::SoFCMeshObjectShape | ( | ) |
|
protectedvirtual |
Sets the bounding box of the mesh to box and its center to center.
References MeshGui::SoFCMeshObjectElement::get(), Base::BoundBox3< _Precision >::GetCenter(), 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 renderTriangleLimit 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 renderTriangleLimit SoShape::createTriangleDetail() gets called. Against the default OpenInventor implementation which returns 0 as well Coin3d fills in the point and face indices.
|
protectedvirtual |
|
protectedvirtual |
Sets the point indices, the geometric points and the normal for each triangle.
If the number of triangles exceeds renderTriangleLimit then only a triangulation of a rough model is filled in instead. This is due to performance issues.
References Base::Console(), MeshGui::SoFCMeshObjectElement::get(), and Base::ConsoleSingleton::Log().
|
protectedvirtual |
Adds the number of the triangles to the SoGetPrimitiveCountAction.
References MeshGui::SoFCMeshObjectElement::get().
|
protectedvirtual |
Either renders the complete mesh or only a subset of the points.
References Gui::SoFCInteractiveElement::get(), and MeshGui::SoFCMeshObjectElement::get().
|
static |
|
protectedvirtual |
Calculates picked point based on primitives generated by subclasses.
unsigned int MeshGui::SoFCMeshObjectShape::renderTriangleLimit |
Referenced by MeshGui::ViewProviderMeshObject::attach(), and MeshGui::ViewProviderMeshFaceSet::attach().