modified this node

This commit is contained in:
Radu Ursu 2003-07-15 14:23:01 +00:00
parent ca9b71dc67
commit 4e8e28e65c
1 changed files with 18 additions and 24 deletions

View File

@ -35,8 +35,6 @@
#include <qgl.h> #include <qgl.h>
#include <Inventor/SbLinear.h> #include <Inventor/SbLinear.h>
#include <Inventor/SbBox.h> #include <Inventor/SbBox.h>
#include <Inventor/SoPickedPoint.h>
#include <Inventor/actions/SoRayPickAction.h>
#include <Inventor/SoPrimitiveVertex.h> #include <Inventor/SoPrimitiveVertex.h>
#include <Inventor/elements/SoGLLazyElement.h> #include <Inventor/elements/SoGLLazyElement.h>
#include <Inventor/elements/SoGLTextureCoordinateElement.h> #include <Inventor/elements/SoGLTextureCoordinateElement.h>
@ -52,8 +50,6 @@
#include <Inventor/nodes/SoNode.h> #include <Inventor/nodes/SoNode.h>
#include <Inventor/nodes/SoNonIndexedShape.h> #include <Inventor/nodes/SoNonIndexedShape.h>
#include "SoPolyhedronDetail.h"
template <class Kernel> template <class Kernel>
class Node_tetrahedron_3 : public SoNonIndexedShape{ class Node_tetrahedron_3 : public SoNonIndexedShape{
@ -88,7 +84,7 @@ public:
} while (0); } while (0);
} while (0); } while (0);
}; // Initializes this class }; // Initializes this class
Node_tetrahedron_3() : t(t_temp){ Node_tetrahedron_3(){
do { do {
Node_tetrahedron_3::classinstances++; Node_tetrahedron_3::classinstances++;
// Catch attempts to use a node class which has not been initialized. // Catch attempts to use a node class which has not been initialized.
@ -105,7 +101,7 @@ public:
this->isBuiltIn = FALSE; this->isBuiltIn = FALSE;
} while (0); } while (0);
}; // The constructor }; // The constructor
Node_tetrahedron_3(Tetrahedron &T) : t(T){ Node_tetrahedron_3(Tetrahedron *T) : t(T){
do { do {
Node_tetrahedron_3::classinstances++; Node_tetrahedron_3::classinstances++;
// Catch attempts to use a node class which has not been initialized. // Catch attempts to use a node class which has not been initialized.
@ -194,10 +190,10 @@ protected:
Point_3 p0, p1, p2, p3; Point_3 p0, p1, p2, p3;
if(t.orientation() == CGAL::NEGATIVE){ if(t->orientation() == CGAL::NEGATIVE){
p0 = t[0]; p1 = t[2]; p2 = t[1]; p3 = t[3]; p0 = (*t)[0]; p1 = (*t)[2]; p2 = (*t)[1]; p3 = (*t)[3];
} else { } else {
p0 = t[0]; p1 = t[1]; p2 = t[2]; p3 = t[3]; p0 = (*t)[0]; p1 = (*t)[1]; p2 = (*t)[2]; p3 = (*t)[3];
} }
glPushMatrix(); glPushMatrix();
@ -253,18 +249,18 @@ protected:
SbBox3f &box, SbVec3f &center){ SbBox3f &box, SbVec3f &center){
Kernel::FT xmin = 0, ymin = 0, zmin = 0, xmax = 0, ymax = 0, zmax = 0; Kernel::FT xmin = 0, ymin = 0, zmin = 0, xmax = 0, ymax = 0, zmax = 0;
for(int i=0; i<4; i++){ for(int i=0; i<4; i++){
if(t.vertex(i).x() < xmin) if(t->vertex(i).x() < xmin)
xmin = t.vertex(i).x(); xmin = t->vertex(i).x();
if(t.vertex(i).y() < ymin) if(t->vertex(i).y() < ymin)
ymin = t.vertex(i).y(); ymin = t->vertex(i).y();
if(t.vertex(i).z() < zmin) if(t->vertex(i).z() < zmin)
zmin = t.vertex(i).z(); zmin = t->vertex(i).z();
if(t.vertex(i).x() > xmax) if(t->vertex(i).x() > xmax)
xmax = t.vertex(i).x(); xmax = t->vertex(i).x();
if(t.vertex(i).y() > ymax) if(t->vertex(i).y() > ymax)
ymax = t.vertex(i).y(); ymax = t->vertex(i).y();
if(t.vertex(i).z() > zmax) if(t->vertex(i).z() > zmax)
zmax = t.vertex(i).z(); zmax = t->vertex(i).z();
} }
SbVec3f min, max; SbVec3f min, max;
@ -361,9 +357,7 @@ protected:
private: private:
virtual ~Node_tetrahedron_3(){}; //The destructor virtual ~Node_tetrahedron_3(){}; //The destructor
Tetrahedron &t; Tetrahedron *t;
Tetrahedron t_temp;
}; };
template<class Tetrahedron_3> template<class Tetrahedron_3>