#include <SoFCMeshNode.h>
Public Member Functions | |
void | setMesh (const Mesh::MeshObject *mesh) |
Sets the mesh. | |
SoFCMeshNode () | |
virtual void | write (SoWriteAction *action) |
Writes out the mesh node. | |
Static Public Member Functions | |
static void | initClass () |
Public Attributes | |
unsigned int | MaximumTriangles |
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 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 SbBool | readInstance (SoInput *in, unsigned short flags) |
Reads in the mesh node from the input stream. |
Definition at line 37 of file SoFCMeshNode.h.
SoFCMeshNode::SoFCMeshNode | ( | ) |
Definition at line 112 of file SoFCMeshNode.cpp.
References SketcherExample::f.
void SoFCMeshNode::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 548 of file SoFCMeshNode.cpp.
References Base::BoundBox3< _Precision >::CalcCenter(), SketcherExample::f, 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 * SoFCMeshNode::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 531 of file SoFCMeshNode.cpp.
References MaximumTriangles.
void SoFCMeshNode::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.
Definition at line 435 of file SoFCMeshNode.cpp.
References MeshCore::MeshKernel::GetFacets(), Mesh::MeshObject::getKernel(), MeshCore::MeshKernel::GetPoints(), MaximumTriangles, sbvec3f(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
void SoFCMeshNode::getPrimitiveCount | ( | SoGetPrimitiveCountAction * | action | ) | [protected, virtual] |
Adds the number of the triangles to the SoGetPrimitiveCountAction.
Definition at line 567 of file SoFCMeshNode.cpp.
void SoFCMeshNode::GLRender | ( | SoGLRenderAction * | action | ) | [protected, virtual] |
Either renders the complete mesh or only a subset of the points.
Definition at line 291 of file SoFCMeshNode.cpp.
References Gui::SoFCInteractiveElement::get(), and MaximumTriangles.
void SoFCMeshNode::initClass | ( | void | ) | [static] |
Definition at line 107 of file SoFCMeshNode.cpp.
SbBool SoFCMeshNode::readInstance | ( | SoInput * | in, | |
unsigned short | flags | |||
) | [protected, virtual] |
Reads in the mesh node from the input stream.
Definition at line 616 of file SoFCMeshNode.cpp.
References MeshCore::MeshKernel::Adopt(), and k.
void SoFCMeshNode::setMesh | ( | const Mesh::MeshObject * | mesh | ) |
Sets the mesh.
Definition at line 127 of file SoFCMeshNode.cpp.
Referenced by MeshGui::ViewProviderMeshNode::attach().
void SoFCMeshNode::write | ( | SoWriteAction * | action | ) | [virtual] |
Writes out the mesh node.
Definition at line 584 of file SoFCMeshNode.cpp.
References MeshCore::MeshKernel::GetFacets(), Mesh::MeshObject::getKernel(), MeshCore::MeshKernel::GetPoints(), and writeHeader().
unsigned int MeshGui::SoFCMeshNode::MaximumTriangles |
Definition at line 48 of file SoFCMeshNode.h.
Referenced by createTriangleDetail(), generatePrimitives(), and GLRender().