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. | |
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. | |
virtual void | doAction (SoAction *action) |
virtual void | generatePrimitives (SoAction *action) |
Sets the point indices, the geometric points and the normal for each triangle. | |
virtual void | getPrimitiveCount (SoGetPrimitiveCountAction *action) |
Adds the number of the triangles to the SoGetPrimitiveCountAction. | |
virtual void | GLRender (SoGLRenderAction *action) |
Either renders the complete mesh or only a subset of the points. | |
virtual void | rayPick (SoRayPickAction *action) |
Calculates picked point based on primitives generated by subclasses. |
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 interation and set the status to false if not. This can be done e.g. in the actualRedraw() method of the viewer.
Definition at line 163 of file SoFCMeshObject.h.
SoFCMeshObjectShape::SoFCMeshObjectShape | ( | ) |
Definition at line 591 of file SoFCMeshObject.cpp.
void SoFCMeshObjectShape::computeBBox | ( | SoAction * | action, | |
SbBox3f & | box, | |||
SbVec3f & | center | |||
) | [protected, virtual] |
Sets the bounding box of the mesh to box and its center to center.
Definition at line 1091 of file SoFCMeshObject.cpp.
References Base::BoundBox3< _Precision >::CalcCenter(), Mesh::MeshObject::countPoints(), MeshGui::SoFCMeshObjectElement::get(), MeshCore::MeshKernel::GetBoundBox(), Mesh::MeshObject::getKernel(), Base::BoundBox3< _Precision >::MaxX, Base::BoundBox3< _Precision >::MaxY, Base::BoundBox3< _Precision >::MaxZ, Sketcher::mid, Base::BoundBox3< _Precision >::MinX, Base::BoundBox3< _Precision >::MinY, Base::BoundBox3< _Precision >::MinZ, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
SoDetail * SoFCMeshObjectShape::createTriangleDetail | ( | SoRayPickAction * | action, | |
const SoPrimitiveVertex * | v1, | |||
const SoPrimitiveVertex * | v2, | |||
const SoPrimitiveVertex * | v3, | |||
SoPickedPoint * | pp | |||
) | [protected, virtual] |
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.
Definition at line 1078 of file SoFCMeshObject.cpp.
void SoFCMeshObjectShape::doAction | ( | SoAction * | action | ) | [protected, virtual] |
Definition at line 845 of file SoFCMeshObject.cpp.
void SoFCMeshObjectShape::generatePrimitives | ( | SoAction * | action | ) | [protected, virtual] |
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.
Definition at line 991 of file SoFCMeshObject.cpp.
References Base::Console(), MeshGui::SoFCMeshObjectElement::get(), MeshCore::MeshKernel::GetFacets(), Mesh::MeshObject::getKernel(), MeshCore::MeshKernel::GetPoints(), sbvec3f(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
void SoFCMeshObjectShape::getPrimitiveCount | ( | SoGetPrimitiveCountAction * | action | ) | [protected, virtual] |
Adds the number of the triangles to the SoGetPrimitiveCountAction.
Definition at line 1111 of file SoFCMeshObject.cpp.
References Mesh::MeshObject::countFacets(), Mesh::MeshObject::countPoints(), and MeshGui::SoFCMeshObjectElement::get().
void SoFCMeshObjectShape::GLRender | ( | SoGLRenderAction * | action | ) | [protected, virtual] |
Either renders the complete mesh or only a subset of the points.
Definition at line 606 of file SoFCMeshObject.cpp.
References Mesh::MeshObject::countFacets(), Mesh::MeshObject::countPoints(), MeshGui::SoFCMeshObjectElement::get(), Gui::SoFCInteractiveElement::get(), Mesh2Shape::mesh, and renderTriangleLimit.
void SoFCMeshObjectShape::initClass | ( | void | ) | [static] |
Definition at line 586 of file SoFCMeshObject.cpp.
Referenced by initMeshGui().
void SoFCMeshObjectShape::rayPick | ( | SoRayPickAction * | action | ) | [protected, virtual] |
Calculates picked point based on primitives generated by subclasses.
Definition at line 972 of file SoFCMeshObject.cpp.
unsigned int MeshGui::SoFCMeshObjectShape::renderTriangleLimit |
Definition at line 172 of file SoFCMeshObject.h.
Referenced by MeshGui::ViewProviderMeshFaceSet::attach(), MeshGui::ViewProviderMeshObject::attach(), and GLRender().