osg::DVRTriangle Class Reference

A triangle of a triangled clipping geometry object.

#include <OSGDVRTriangle.h>

List of all members.

Public Member Functions

 DVRTriangle (void)
 Constructor.
 DVRTriangle (const DVRTriangle &tri)
 Copy.
 ~DVRTriangle (void)
 Destructor.
void dump (void) const
 Usefull for debugging.
bool setNumAddPerVertexAttr (UInt32 additionalPerVertexAttributes)
 set the number of additional per vertex attributes for the cutpoint

Public Attributes

Int32 neighbours [3]
 Indices of the neighbour triangles of this triangle.
Int32 vertices [3]
 Indices of the vertices of this triangle.
Vec3f normal
 The triangles normal.
Vec3f transformedNormal
 The triangles normal.
bool visited
 A Flag. True, iff the triangle has been processed.
bool inContour
 True if the triangle belongs to a contour.
DVRTrianglecontourNeighbour
 the next triangle in the contour
Pnt3f cutPnt
GLdoublecutPoint
bool edgeCut [3]
 Indicates which edges are cut by the currently processed slice.


Detailed Description

Definition at line 14 of file OSGDVRTriangle.h.


Constructor & Destructor Documentation

DVRTriangle::DVRTriangle ( void   ) 

Definition at line 8 of file OSGDVRTriangle.cpp.

References cutPnt, cutPoint, GLdouble, neighbours, and vertices.

00009 {
00010     // at least we need the vertex position and a texture coordinate
00011     cutPoint = (GLdouble*) malloc(6 * sizeof(GLdouble));
00012   
00013     for(UInt32 i = 0; i < 3; i++)
00014     {
00015         vertices  [i] = -1;
00016         neighbours[i] = -1;
00017         cutPnt    [i] = 0.0f;
00018     }
00019 }

DVRTriangle::DVRTriangle ( const DVRTriangle tri  ) 

Definition at line 21 of file OSGDVRTriangle.cpp.

References cutPnt, cutPoint, GLdouble, neighbours, normal, and vertices.

00022 {
00023   cutPoint = (GLdouble*) malloc(6 * sizeof(GLdouble));
00024 
00025   for(UInt32 i = 0; i < 3; i++)
00026   {
00027       vertices  [i] = tri.vertices  [i];
00028       neighbours[i] = tri.neighbours[i];
00029       cutPnt    [i] = 0.0f;
00030   }
00031 
00032   normal = tri.normal;
00033 }

DVRTriangle::~DVRTriangle ( void   ) 

Definition at line 35 of file OSGDVRTriangle.cpp.

References cutPoint.

00036 {
00037     free(cutPoint); // allocation by malloc/realloc
00038 }


Member Function Documentation

void DVRTriangle::dump ( void   )  const

Definition at line 49 of file OSGDVRTriangle.cpp.

References neighbours, and vertices.

00050 {
00051     std::cerr <<"Verts: " 
00052               << vertices[0] << " " 
00053               << vertices[1] << " " 
00054               << vertices[2]
00055               <<" Neighbours: "
00056               << neighbours[0] << " " 
00057               << neighbours[1] << " " 
00058               << neighbours[2] << std::endl;
00059 }

bool DVRTriangle::setNumAddPerVertexAttr ( UInt32  additionalPerVertexAttributes  ) 

basically there are two attributes available, the vertex position and a 3D texture coordinate, if one needs additional attributes, e.g. color, texture coordinates,.., the number of (double) values needed has to be set with this function.

Definition at line 40 of file OSGDVRTriangle.cpp.

References cutPoint, and GLdouble.

00041 {
00042     cutPoint = (GLdouble*) realloc(
00043         cutPoint,
00044         (6 + additionalPerVertexAttributes) * sizeof(GLdouble));
00045 
00046     return cutPoint != NULL;
00047 }


Member Data Documentation

Definition at line 43 of file OSGDVRTriangle.h.

Referenced by dump(), DVRTriangle(), and osg::DVRClipGeometry::linkContour().

Definition at line 49 of file OSGDVRTriangle.h.

Referenced by osg::DVRClipGeometry::buildTriangledGeometry(), and DVRTriangle().

Definition at line 55 of file OSGDVRTriangle.h.

Referenced by osg::DVRClipGeometry::linkContour().

Definition at line 58 of file OSGDVRTriangle.h.

Referenced by osg::DVRClipGeometry::addNewActiveTriangles().

The intersection point of the triangle and the current slice that contributes to the contour

Definition at line 68 of file OSGDVRTriangle.h.

Referenced by osg::DVRClipGeometry::buildTriangledGeometry(), DVRTriangle(), and osg::DVRClipGeometry::linkContour().

The intersection point of the triangle and the current slice that contributes to the contour with additional texture coordinates, needed because GLUTesselator needs an opaque pointer. The first three values represent the vertex position, the next three the (always available) first texture coordinate for this point and the following values the additional per vertex attributes (if any)

Definition at line 77 of file OSGDVRTriangle.h.

Referenced by osg::DVRClipGeometry::buildTriangledGeometry(), osg::DVRClipper::clipSlice(), DVRTriangle(), osg::DVRClipGeometry::linkContour(), setNumAddPerVertexAttr(), and ~DVRTriangle().


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

Generated on Mon Mar 17 11:14:40 2008 for OpenSG by  doxygen 1.5.5