MeshGui::SoFCMeshObjectShape Class Reference

class SoFCMeshObjectShape More...

#include <SoFCMeshObject.h>

List of all members.

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 &center)
 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.

Detailed Description

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.

Author:
Werner Mayer

Definition at line 163 of file SoFCMeshObject.h.


Constructor & Destructor Documentation

SoFCMeshObjectShape::SoFCMeshObjectShape (  ) 

Definition at line 591 of file SoFCMeshObject.cpp.


Member Function Documentation

void SoFCMeshObjectShape::computeBBox ( SoAction *  action,
SbBox3f &  box,
SbVec3f &  center 
) [protected, virtual]
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.

See also:
createTriangleDetail().

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]
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.


Member Data Documentation


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

Generated on Wed Nov 23 19:02:27 2011 for FreeCAD by  doxygen 1.6.1