Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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

Int32 osg::DVRTriangle::neighbours[3]
 

Definition at line 43 of file OSGDVRTriangle.h.

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

Int32 osg::DVRTriangle::vertices[3]
 

Definition at line 46 of file OSGDVRTriangle.h.

Referenced by osg::DVRClipGeometry::buildTriangledGeometry(), dump(), DVRTriangle(), osg::DVRClipGeometry::interpolate(), osg::DVRClipGeometry::isBehindPlane(), osg::DVRClipGeometry::isCut(), and osg::DVRClipGeometry::renderTriangle().

Vec3f osg::DVRTriangle::normal
 

Definition at line 49 of file OSGDVRTriangle.h.

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

Vec3f osg::DVRTriangle::transformedNormal
 

Definition at line 55 of file OSGDVRTriangle.h.

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

bool osg::DVRTriangle::visited
 

Definition at line 58 of file OSGDVRTriangle.h.

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

bool osg::DVRTriangle::inContour
 

Definition at line 61 of file OSGDVRTriangle.h.

Referenced by osg::DVRClipGeometry::addNewActiveTriangles(), osg::DVRClipGeometry::buildContours(), osg::DVRClipGeometry::linkContour(), and osg::DVRClipGeometry::updateActiveTriangles().

DVRTriangle* osg::DVRTriangle::contourNeighbour
 

Definition at line 64 of file OSGDVRTriangle.h.

Referenced by osg::DVRClipper::clipSlice(), osg::DVRClipGeometry::linkContour(), and osg::DVRClipGeometry::updateActiveTriangles().

Pnt3f osg::DVRTriangle::cutPnt
 

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().

GLdouble* osg::DVRTriangle::cutPoint
 

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().

bool osg::DVRTriangle::edgeCut[3]
 

Definition at line 80 of file OSGDVRTriangle.h.

Referenced by osg::DVRClipGeometry::isCut(), and osg::DVRClipGeometry::linkContour().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:16:45 2005 for OpenSG by  doxygen 1.4.3