MeshGui::SoFCMeshFaceSet Class Reference

The SoFCMeshFaceSet class renders the mesh data structure. More...

#include <SoFCMeshFaceSet.h>

List of all members.

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 &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 MaximumTriangles 0 is returned.
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

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

Author:
Werner Mayer

Definition at line 121 of file SoFCMeshFaceSet.h.


Constructor & Destructor Documentation

SoFCMeshFaceSet::SoFCMeshFaceSet (  ) 

Definition at line 429 of file SoFCMeshFaceSet.cpp.


Member Function Documentation

void SoFCMeshFaceSet::computeBBox ( SoAction *  action,
SbBox3f &  box,
SbVec3f &  center 
) [protected, virtual]
SoDetail * SoFCMeshFaceSet::createTriangleDetail ( SoRayPickAction *  action,
const SoPrimitiveVertex *  v1,
const SoPrimitiveVertex *  v2,
const SoPrimitiveVertex *  v3,
SoPickedPoint *  pp 
) [protected, virtual]

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.

Definition at line 1004 of file SoFCMeshFaceSet.cpp.

References MaximumTriangles.

void SoFCMeshFaceSet::generatePrimitives ( SoAction *  action  )  [protected, virtual]

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.

See also:
createTriangleDetail().

Definition at line 867 of file SoFCMeshFaceSet.cpp.

References Base::Console(), MeshGui::SoFCMeshFacetElement::get(), MeshGui::SoFCMeshVertexElement::get(), sbvec3f(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.

void SoFCMeshFaceSet::getPrimitiveCount ( SoGetPrimitiveCountAction *  action  )  [protected, virtual]

Adds the number of the triangles to the SoGetPrimitiveCountAction.

Definition at line 1047 of file SoFCMeshFaceSet.cpp.

References MeshGui::SoFCMeshFacetElement::get().

void SoFCMeshFaceSet::GLRender ( SoGLRenderAction *  action  )  [protected, virtual]

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

Definition at line 606 of file SoFCMeshFaceSet.cpp.

References MeshGui::SoFCMeshFacetElement::get(), MeshGui::SoFCMeshVertexElement::get(), Gui::SoFCInteractiveElement::get(), and MaximumTriangles.

void SoFCMeshFaceSet::initClass ( void   )  [static]

Definition at line 424 of file SoFCMeshFaceSet.cpp.

void SoFCMeshFaceSet::rayPick ( SoRayPickAction *  action  )  [protected, virtual]

Calculates picked point based on primitives generated by subclasses.

Definition at line 848 of file SoFCMeshFaceSet.cpp.


Member Data Documentation

Definition at line 130 of file SoFCMeshFaceSet.h.

Referenced by createTriangleDetail(), and GLRender().


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