MeshGui::SoFCMeshObjectShape Class Reference

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

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 interaction and set the status to false if not. This can be done e.g. in the actualRedraw() method of the viewer.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ SoFCMeshObjectShape()

SoFCMeshObjectShape::SoFCMeshObjectShape ( )

Member Function Documentation

◆ computeBBox()

void SoFCMeshObjectShape::computeBBox ( SoAction action,
SbBox3f &  box,
SbVec3f &  center 
)
protectedvirtual

◆ createTriangleDetail()

SoDetail * SoFCMeshObjectShape::createTriangleDetail ( SoRayPickAction *  action,
const SoPrimitiveVertex *  v1,
const SoPrimitiveVertex *  v2,
const SoPrimitiveVertex *  v3,
SoPickedPoint *  pp 
)
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.

◆ doAction()

void SoFCMeshObjectShape::doAction ( SoAction action)
protectedvirtual

◆ generatePrimitives()

void SoFCMeshObjectShape::generatePrimitives ( SoAction action)
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.

See also
createTriangleDetail().

References Base::Console(), MeshGui::SoFCMeshObjectElement::get(), and Base::ConsoleSingleton::Log().

◆ getPrimitiveCount()

void SoFCMeshObjectShape::getPrimitiveCount ( SoGetPrimitiveCountAction *  action)
protectedvirtual

Adds the number of the triangles to the SoGetPrimitiveCountAction.

References MeshGui::SoFCMeshObjectElement::get().

◆ GLRender()

void SoFCMeshObjectShape::GLRender ( SoGLRenderAction action)
protectedvirtual

Either renders the complete mesh or only a subset of the points.

References Gui::SoFCInteractiveElement::get(), and MeshGui::SoFCMeshObjectElement::get().

◆ initClass()

void SoFCMeshObjectShape::initClass ( void  )
static

◆ rayPick()

void SoFCMeshObjectShape::rayPick ( SoRayPickAction *  action)
protectedvirtual

Calculates picked point based on primitives generated by subclasses.

Member Data Documentation

◆ renderTriangleLimit

unsigned int MeshGui::SoFCMeshObjectShape::renderTriangleLimit

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