Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

guge Namespace Reference


Compounds

class  guge::AltMethodTable
class  guge::MethodTable
struct  guge::PatternRec

Functions

template<class T> bool RegularIntersectLines (const point< T > &A, const point< T > &B, const point< T > &a, const point< T > &b, T *lambda, T *mu)
template<class T> bool IntersectTriangles (const triangle< T > &tri0, const triangle< T > &tri1, point< T > *retP1, point< T > *retP2)
template<class T, class HP, class EP> bool IsLinear (const int n, const Ptr< HP > &Pw, const T tol)
template bool IsLinear< float, hpoint< float >, point< float > > (const int n, const Ptr< hpoint< float > > &Pw, const float tol)
template bool IsLinear< double, hpoint< double >, point< double > > (const int n, const Ptr< hpoint< double > > &Pw, const double tol)
template bool IsLinear< float, point< float >, point< float > > (const int n, const Ptr< point< float > > &Pw, const float tol)
template bool IsLinear< double, point< double >, point< double > > (const int n, const Ptr< point< double > > &Pw, const double tol)
template bool IsLinear< float, hpoint2< float >, point2< float > > (const int n, const Ptr< hpoint2< float > > &Pw, const float tol)
template bool IsLinear< double, hpoint2< double >, point2< double > > (const int n, const Ptr< hpoint2< double > > &Pw, const double tol)
template bool IsLinear< float, point2< float >, point2< float > > (const int n, const Ptr< point2< float > > &Pw, const float tol)
template bool IsLinear< double, point2< double >, point2< double > > (const int n, const Ptr< point2< double > > &Pw, const double tol)
template<class T, class HP> bool IsPlanar (const int nu, const int nv, const Ptr< Ptr< HP > > &Pw, const T tol)
template bool IsPlanar (const int nu, const int nv, const Ptr< Ptr< hpoint< float > > > &Pw, const float tol)
template bool IsPlanar (const int nu, const int nv, const Ptr< Ptr< hpoint< double > > > &Pw, const double tol)
template bool IsPlanar (const int nu, const int nv, const Ptr< Ptr< point< float > > > &Pw, const float tol)
template bool IsPlanar (const int nu, const int nv, const Ptr< Ptr< point< double > > > &Pw, const double tol)
template<class T> GULAPI bool isRectangle (int nP, const Ptr< point2< T > > &P, T &u1, T &u2, T &v1, T &v2)
template GULAPI bool isRectangle (int nP, const Ptr< point2< float > > &P, float &u1, float &u2, float &v1, float &v2)
template GULAPI bool isRectangle (int nP, const Ptr< point2< double > > &P, double &u1, double &u2, double &v1, double &v2)
template<class T> GULAPI bool isRectangle (int nP, const Ptr< gul::point2< T > > &P, T &u1, T &u2, T &v1, T &v2)
template<class T> void RenumberVerts (const point< T > &P1, const point< T > &P2, const point< T > &P3, const point< T > &T1, const point< T > &T2, const point< T > &T3, bool inv, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw1 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw2 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw3 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw3a (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw4 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw5 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw6 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw6a (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw7 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw7a (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw8 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw9 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw10 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw10a (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw11 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw12 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw12a (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw13 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw13a (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void Draw14 (unsigned char pat, point< T > *med, point< T > *norm, void(*func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *fdat)
template<class T> void FirstPlane (int nx, int ny, Ptr< Ptr< T > > F0, Ptr< Ptr< unsigned char > > Pat1)
template<class T> void NextPlane (int nx, int ny, Ptr< Ptr< T > > Fi, Ptr< Ptr< unsigned char > > Pat0, Ptr< Ptr< unsigned char > > Pat1)
void Harmonize (int k, int j, int i, int nx, int ny, int nz, Ptr< Ptr< Ptr< unsigned char > > > flags)
template<class T> GULAPI void MarchingCube (T x0, T y0, T z0, T dx, T dy, T dz, int nx, int ny, int nz, Ptr< Ptr< Ptr< T > > > F, void(*trifunc)(const bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *), void *tridata)
template GULAPI void MarchingCube (float x0, float y0, float z0, float dx, float dy, float dz, int nx, int ny, int nz, Ptr< Ptr< Ptr< float > > > F, void(*trifunc)(const bool, const point< float > *, const point< float > *, const point< float > *, const point< float > *, const point< float > *, const point< float > *, void *), void *tridata)
template GULAPI void MarchingCube (double x0, double y0, double z0, double dx, double dy, double dz, int nx, int ny, int nz, Ptr< Ptr< Ptr< double > > > F, void(*trifunc)(const bool, const point< double > *, const point< double > *, const point< double > *, const point< double > *, const point< double > *, const point< double > *, void *), void *tridata)
template<class T> void UpdateBoundingBoxH (const int nP, const Ptr< hpoint< T > > &Pw, T &minx, T &maxx, T &miny, T &maxy, T &minz, T &maxz)
template<class T> void UpdateBoundingBoxH (const int nP, const Ptr< hpoint2< T > > &Pw, T &minx, T &maxx, T &miny, T &maxy)
template<class T> void UpdateBoundingBoxH (const int nP, const Ptr< hpoint1< T > > &Pw, T &minx, T &maxx)
template<class T> void UpdateBoundingBoxE (const int nP, const Ptr< point< T > > &P, T &minx, T &maxx, T &miny, T &maxy, T &minz, T &maxz)
template<class T> void UpdateBoundingBoxE (const int nP, const Ptr< point2< T > > &P, T &minx, T &maxx, T &miny, T &maxy)
template<class T> void UpdateBoundingBoxE (const int nP, const Ptr< point1< T > > &P, T &minx, T &maxx)
template<class T> void CalcBoundingBoxE (const int nP, const Ptr< point< T > > &P, T &minx, T &maxx, T &miny, T &maxy, T &minz, T &maxz)
template<class T> void CalcBoundingBoxE (const int nP, const Ptr< point2< T > > &P, T &minx, T &maxx, T &miny, T &maxy)
template<class T> void CalcBoundingBoxE (const int nP, const Ptr< point1< T > > &P, T &minx, T &maxx)
template<class T> void CalcBoundingBoxH (const int nP, const Ptr< hpoint< T > > &Pw, T &minx, T &maxx, T &miny, T &maxy, T &minz, T &maxz)
template<class T> void CalcBoundingBoxH (const int nP, const Ptr< hpoint2< T > > &Pw, T &minx, T &maxx, T &miny, T &maxy)
template<class T> void CalcBoundingBoxH (const int nP, const Ptr< hpoint1< T > > &Pw, T &minx, T &maxx)
template<class HP, class EP> void CalcBoundingBoxVerts (int nPw, const Ptr< HP > &Pw, EP &minP, EP &maxP)
template<class HP, class EP> void UpdateBoundingBoxVerts (int nPw, const Ptr< HP > &Pw, EP &minP, EP &maxP)
template<> void CalcBoundingBoxVerts (int nP, const Ptr< point1< float > > &P, point1< float > &minP, point1< float > &maxP)
template<> void CalcBoundingBoxVerts (int nP, const Ptr< point1< double > > &P, point1< double > &minP, point1< double > &maxP)
template<> void CalcBoundingBoxVerts (int nPw, const Ptr< hpoint1< float > > &Pw, point1< float > &minP, point1< float > &maxP)
template<> void CalcBoundingBoxVerts (int nPw, const Ptr< hpoint1< double > > &Pw, point1< double > &minP, point1< double > &maxP)
template<> void CalcBoundingBoxVerts (int nP, const Ptr< point2< float > > &P, point2< float > &minP, point2< float > &maxP)
template<> void CalcBoundingBoxVerts (int nP, const Ptr< point2< double > > &P, point2< double > &minP, point2< double > &maxP)
template<> void CalcBoundingBoxVerts (int nPw, const Ptr< hpoint2< float > > &Pw, point2< float > &minP, point2< float > &maxP)
template<> void CalcBoundingBoxVerts (int nPw, const Ptr< hpoint2< double > > &Pw, point2< double > &minP, point2< double > &maxP)
template<> void CalcBoundingBoxVerts (int nP, const Ptr< point< float > > &P, point< float > &minP, point< float > &maxP)
template<> void CalcBoundingBoxVerts (int nP, const Ptr< point< double > > &P, point< double > &minP, point< double > &maxP)
template<> void CalcBoundingBoxVerts (int nPw, const Ptr< hpoint< float > > &Pw, point< float > &minP, point< float > &maxP)
template<> void CalcBoundingBoxVerts (int nPw, const Ptr< hpoint< double > > &Pw, point< double > &minP, point< double > &maxP)
template<> void UpdateBoundingBoxVerts (int nP, const Ptr< point1< float > > &P, point1< float > &minP, point1< float > &maxP)
template<> void UpdateBoundingBoxVerts (int nP, const Ptr< point1< double > > &P, point1< double > &minP, point1< double > &maxP)
template<> void UpdateBoundingBoxVerts (int nPw, const Ptr< hpoint1< float > > &Pw, point1< float > &minP, point1< float > &maxP)
template<> void UpdateBoundingBoxVerts (int nPw, const Ptr< hpoint1< double > > &Pw, point1< double > &minP, point1< double > &maxP)
template<> void UpdateBoundingBoxVerts (int nP, const Ptr< point2< float > > &P, point2< float > &minP, point2< float > &maxP)
template<> void UpdateBoundingBoxVerts (int nP, const Ptr< point2< double > > &P, point2< double > &minP, point2< double > &maxP)
template<> void UpdateBoundingBoxVerts (int nPw, const Ptr< hpoint2< float > > &Pw, point2< float > &minP, point2< float > &maxP)
template<> void UpdateBoundingBoxVerts (int nPw, const Ptr< hpoint2< double > > &Pw, point2< double > &minP, point2< double > &maxP)
template<> void UpdateBoundingBoxVerts (int nP, const Ptr< point< float > > &P, point< float > &minP, point< float > &maxP)
template<> void UpdateBoundingBoxVerts (int nP, const Ptr< point< double > > &P, point< double > &minP, point< double > &maxP)
template<> void UpdateBoundingBoxVerts (int nPw, const Ptr< hpoint< float > > &Pw, point< float > &minP, point< float > &maxP)
template<> void UpdateBoundingBoxVerts (int nPw, const Ptr< hpoint< double > > &Pw, point< double > &minP, point< double > &maxP)
template<class T> void NormalizePointsE (const int nP, const Ptr< point< T > > P, const T minx, const T scalex, const T miny, const T scaley, const T minz, const T scalez)
template<class T> void NormalizePointsE (const int nP, const Ptr< point2< T > > P, const T minx, const T scalex, const T miny, const T scaley)
template<class T> void NormalizePointsH (const int nP, const Ptr< hpoint< T > > Pw, const T minx, const T scalex, const T miny, const T scaley, const T minz, const T scalez)
template<class T> void DeNormalizePointsE (const int nP, const Ptr< point< T > > P, const T minx, const T scalex, const T miny, const T scaley, const T minz, const T scalez)
template<class T> void DeNormalizePointsE (const int nP, const Ptr< point2< T > > P, const T minx, const T scalex, const T miny, const T scaley)
template<class T> void DeNormalizePointsH (const int nP, const Ptr< hpoint< T > > Pw, const T minx, const T scalex, const T miny, const T scaley, const T minz, const T scalez)
template<class T1, class T2> void set (gul::bounding_box< T1 > &box, const gul::point< T2 > &minP, const gul::point< T2 > &maxP)
template<class T1, class T2> void set (gul::bounding_box< T1 > &box, const gul::hpoint< T2 > &minP, const gul::hpoint< T2 > &maxP)
template<class T1, class T2> void set (gul::bounding_box< T1 > &box, const gul::point2< T2 > &minP, const gul::point2< T2 > &maxP)
template<class T1, class T2> void set (gul::bounding_box< T1 > &box, const gul::hpoint2< T2 > &minP, const gul::hpoint2< T2 > &maxP)
template<class T1, class T2> void set (gul::bounding_box< T1 > &box, const gul::point1< T2 > &minP, const gul::point1< T2 > &maxP)

Variables

template class MethodTable< float >
template class MethodTable< double >
template class AltMethodTable< float >
template class AltMethodTable< double >
int EdgePerms [8][8]
int VertexPerms [24][8]
PatternRec PatternTable [256]


Function Documentation

template<class T>
void CalcBoundingBoxE const int    nP,
const Ptr< point1< T > > &    P,
T &    minx,
T &    maxx
[inline]
 

Definition at line 178 of file guge_normalize.h.

00180 {
00181   minx = maxx = P[0].x;
00182  
00183   UpdateBoundingBoxE( nP, P, minx, maxx );
00184 }

template<class T>
void CalcBoundingBoxE const int    nP,
const Ptr< point2< T > > &    P,
T &    minx,
T &    maxx,
T &    miny,
T &    maxy
[inline]
 

Definition at line 167 of file guge_normalize.h.

00170 {
00171   minx = maxx = P[0].x;
00172   miny = maxy = P[0].y;
00173  
00174   UpdateBoundingBoxE( nP, P, minx, maxx, miny, maxy );
00175 }

template<class T>
void CalcBoundingBoxE const int    nP,
const Ptr< point< T > > &    P,
T &    minx,
T &    maxx,
T &    miny,
T &    maxy,
T &    minz,
T &    maxz
[inline]
 

Definition at line 154 of file guge_normalize.h.

00158 {
00159   minx = maxx = P[0].x;
00160   miny = maxy = P[0].y;
00161   minz = maxz = P[0].z;
00162  
00163   UpdateBoundingBoxE( nP, P, minx, maxx, miny, maxy, minz, maxz );
00164 }

template<class T>
void CalcBoundingBoxH const int    nP,
const Ptr< hpoint1< T > > &    Pw,
T &    minx,
T &    maxx
[inline]
 

Definition at line 219 of file guge_normalize.h.

00221 {
00222   T w = Pw[0].w;
00223 
00224   minx = maxx = Pw[0].x / w;
00225  
00226   UpdateBoundingBoxH( nP, Pw, minx, maxx );
00227 }

template<class T>
void CalcBoundingBoxH const int    nP,
const Ptr< hpoint2< T > > &    Pw,
T &    minx,
T &    maxx,
T &    miny,
T &    maxy
[inline]
 

Definition at line 206 of file guge_normalize.h.

00209 {
00210   T w = Pw[0].w;
00211 
00212   minx = maxx = Pw[0].x / w;
00213   miny = maxy = Pw[0].y / w;
00214  
00215   UpdateBoundingBoxH( nP, Pw, minx, maxx, miny, maxy );
00216 }

template<class T>
void CalcBoundingBoxH const int    nP,
const Ptr< hpoint< T > > &    Pw,
T &    minx,
T &    maxx,
T &    miny,
T &    maxy,
T &    minz,
T &    maxz
[inline]
 

Definition at line 191 of file guge_normalize.h.

00195 {
00196   T w = Pw[0].w;
00197 
00198   minx = maxx = Pw[0].x / w;
00199   miny = maxy = Pw[0].y / w;
00200   minz = maxz = Pw[0].z / w;
00201  
00202   UpdateBoundingBoxH( nP, Pw, minx, maxx, miny, maxy, minz, maxz );
00203 }

template<>
void CalcBoundingBoxVerts int    nPw,
const Ptr< hpoint< double > > &    Pw,
point< double > &    minP,
point< double > &    maxP
[inline]
 

Definition at line 309 of file guge_normalize.h.

00311 {                    
00312   CalcBoundingBoxH( nPw, Pw, minP.x, maxP.x, minP.y, maxP.y, minP.z, maxP.z );                 
00313 } 

template<>
void CalcBoundingBoxVerts int    nPw,
const Ptr< hpoint< float > > &    Pw,
point< float > &    minP,
point< float > &    maxP
[inline]
 

Definition at line 303 of file guge_normalize.h.

00305 {                    
00306   CalcBoundingBoxH( nPw, Pw, minP.x, maxP.x, minP.y, maxP.y, minP.z, maxP.z );                 
00307 }  

template<>
void CalcBoundingBoxVerts int    nP,
const Ptr< point< double > > &    P,
point< double > &    minP,
point< double > &    maxP
[inline]
 

Definition at line 297 of file guge_normalize.h.

00299 {                    
00300   CalcBoundingBoxE( nP, P, minP.x, maxP.x, minP.y, maxP.y, minP.z, maxP.z );                 
00301 } 

template<>
void CalcBoundingBoxVerts int    nP,
const Ptr< point< float > > &    P,
point< float > &    minP,
point< float > &    maxP
[inline]
 

Definition at line 291 of file guge_normalize.h.

00293 {                    
00294   CalcBoundingBoxE( nP, P, minP.x, maxP.x, minP.y, maxP.y, minP.z, maxP.z );                 
00295 }  

template<>
void CalcBoundingBoxVerts int    nPw,
const Ptr< hpoint2< double > > &    Pw,
point2< double > &    minP,
point2< double > &    maxP
[inline]
 

Definition at line 284 of file guge_normalize.h.

00286 {                    
00287   CalcBoundingBoxH( nPw, Pw, minP.x, maxP.x, minP.y, maxP.y );
00288 }

template<>
void CalcBoundingBoxVerts int    nPw,
const Ptr< hpoint2< float > > &    Pw,
point2< float > &    minP,
point2< float > &    maxP
[inline]
 

Definition at line 278 of file guge_normalize.h.

00280 {                    
00281   CalcBoundingBoxH( nPw, Pw, minP.x, maxP.x, minP.y, maxP.y );
00282 }

template<>
void CalcBoundingBoxVerts int    nP,
const Ptr< point2< double > > &    P,
point2< double > &    minP,
point2< double > &    maxP
[inline]
 

Definition at line 272 of file guge_normalize.h.

00274 {                    
00275   CalcBoundingBoxE( nP, P, minP.x, maxP.x, minP.y, maxP.y );
00276 }

template<>
void CalcBoundingBoxVerts int    nP,
const Ptr< point2< float > > &    P,
point2< float > &    minP,
point2< float > &    maxP
[inline]
 

Definition at line 266 of file guge_normalize.h.

00268 {                    
00269   CalcBoundingBoxE( nP, P, minP.x, maxP.x, minP.y, maxP.y );
00270 }

template<>
void CalcBoundingBoxVerts int    nPw,
const Ptr< hpoint1< double > > &    Pw,
point1< double > &    minP,
point1< double > &    maxP
[inline]
 

Definition at line 259 of file guge_normalize.h.

00261 {                    
00262   CalcBoundingBoxH( nPw, Pw, minP.x, maxP.x );
00263 }

template<>
void CalcBoundingBoxVerts int    nPw,
const Ptr< hpoint1< float > > &    Pw,
point1< float > &    minP,
point1< float > &    maxP
[inline]
 

Definition at line 253 of file guge_normalize.h.

00255 {                    
00256   CalcBoundingBoxH( nPw, Pw, minP.x, maxP.x );
00257 }

template<>
void CalcBoundingBoxVerts int    nP,
const Ptr< point1< double > > &    P,
point1< double > &    minP,
point1< double > &    maxP
[inline]
 

Definition at line 247 of file guge_normalize.h.

00249 {                    
00250   CalcBoundingBoxE( nP, P, minP.x, maxP.x );
00251 }

template<>
void CalcBoundingBoxVerts int    nP,
const Ptr< point1< float > > &    P,
point1< float > &    minP,
point1< float > &    maxP
[inline]
 

Definition at line 241 of file guge_normalize.h.

00243 {                    
00244   CalcBoundingBoxE( nP, P, minP.x, maxP.x );
00245 }

template<class HP, class EP>
void CalcBoundingBoxVerts int    nPw,
const Ptr< HP > &    Pw,
EP &    minP,
EP &    maxP
[inline]
 

template<class T>
void DeNormalizePointsE const int    nP,
const Ptr< point2< T > >    P,
const T    minx,
const T    scalex,
const T    miny,
const T    scaley
[inline]
 

Definition at line 458 of file guge_normalize.h.

00461 {
00462   for( int i = 0; i < nP; i++ )
00463   {
00464     P[i].x = P[i].x * (scalex) + minx;
00465     P[i].y = P[i].y * (scaley) + miny;
00466   }
00467 }

template<class T>
void DeNormalizePointsE const int    nP,
const Ptr< point< T > >    P,
const T    minx,
const T    scalex,
const T    miny,
const T    scaley,
const T    minz,
const T    scalez
[inline]
 

Definition at line 445 of file guge_normalize.h.

00449 {
00450   for( int i = 0; i < nP; i++ )
00451   {
00452     P[i].x = P[i].x * (scalex) + minx;
00453     P[i].y = P[i].y * (scaley) + miny;
00454     P[i].z = P[i].z * (scalez) + minz;    
00455   }
00456 }

template<class T>
void DeNormalizePointsH const int    nP,
const Ptr< hpoint< T > >    Pw,
const T    minx,
const T    scalex,
const T    miny,
const T    scaley,
const T    minz,
const T    scalez
[inline]
 

Definition at line 473 of file guge_normalize.h.

00477 {
00478   int i;
00479   T w;
00480   for( i = 0; i < nP; i++ )
00481   {
00482     w = Pw[i].w;
00483     Pw[i].x = Pw[i].x * (scalex) + w * minx;
00484     Pw[i].y = Pw[i].y * (scaley) + w * miny;
00485     Pw[i].z = Pw[i].z * (scalez) + w * minz;    
00486   }
00487 }

template<class T>
void Draw1 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 111 of file guge_marchcube.cpp.

00120 {
00121   int *perm;
00122   bool inv = PatternTable[pat].nbits > 4;
00123   perm = VertexPerms[PatternTable[pat].perm];
00124   FUNC( MPT(0,2), MPT(0,4), MPT(0,1), NPT(0,2), NPT(0,4), NPT(0,1) );   
00125 }

template<class T>
void Draw10 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 381 of file guge_marchcube.cpp.

00390 {
00391   int *perm;
00392   bool inv = PatternTable[pat].nbits > 4;
00393   perm = VertexPerms[PatternTable[pat].perm];
00394   FUNC( MPT(0,4), MPT(1,3), MPT(0,2), NPT(0,4), NPT(1,3), NPT(0,2)  );   
00395   FUNC( MPT(0,4), MPT(1,5), MPT(1,3), NPT(0,4), NPT(1,5), NPT(1,3) );   
00396   FUNC( MPT(4,6), MPT(2,6), MPT(5,7), NPT(4,6), NPT(2,6), NPT(5,7)  );   
00397   FUNC( MPT(5,7), MPT(2,6), MPT(3,7), NPT(5,7), NPT(2,6), NPT(3,7)  );   
00398 }

template<class T>
void Draw10a unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 399 of file guge_marchcube.cpp.

00408 {
00409   int *perm;
00410   bool inv = PatternTable[pat].nbits > 4;
00411   perm = VertexPerms[PatternTable[pat].perm];
00412   FUNC( MPT(0,2), MPT(2,6), MPT(3,7), NPT(0,2), NPT(2,6), NPT(3,7) );   
00413   FUNC( MPT(0,2), MPT(3,7), MPT(1,3), NPT(0,2), NPT(3,7), NPT(1,3) );   
00414   FUNC( MPT(4,6), MPT(0,4), MPT(5,7), NPT(4,6), NPT(0,4), NPT(5,7) );   
00415   FUNC( MPT(0,4), MPT(1,5), MPT(5,7), NPT(0,4), NPT(1,5), NPT(5,7) );   
00416 
00417 }

template<class T>
void Draw11 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 426 of file guge_marchcube.cpp.

00435 {
00436   int *perm;
00437   bool inv = PatternTable[pat].nbits > 4;
00438   perm = VertexPerms[PatternTable[pat].perm];
00439   FUNC( MPT(4,6), MPT(0,4), MPT(1,5), NPT(4,6), NPT(0,4), NPT(1,5) );
00440   FUNC( MPT(4,6), MPT(1,5), MPT(6,7), NPT(4,6), NPT(1,5), NPT(6,7) );   
00441   FUNC( MPT(6,7), MPT(1,5), MPT(1,3), NPT(6,7), NPT(1,5), NPT(1,3) );   
00442   FUNC( MPT(1,3), MPT(2,3), MPT(6,7), NPT(1,3), NPT(2,3), NPT(6,7) );   
00443 }

template<class T>
void Draw12 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 452 of file guge_marchcube.cpp.

00461 {
00462   int *perm;
00463   bool inv = PatternTable[pat].nbits > 4;
00464   perm = VertexPerms[PatternTable[pat].perm];
00465   FUNC( MPT(0,4), MPT(1,5), MPT(2,6), NPT(0,4), NPT(1,5), NPT(2,6) );   
00466   FUNC( MPT(2,6), MPT(1,3), MPT(2,3), NPT(2,6), NPT(1,3), NPT(2,3) );   
00467   FUNC( MPT(1,3), MPT(2,6), MPT(1,5), NPT(1,3), NPT(2,6), NPT(1,5) );   
00468   FUNC( MPT(6,7), MPT(3,7), MPT(5,7), NPT(6,7), NPT(3,7), NPT(5,7) );
00469 }

template<class T>
void Draw12a unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 470 of file guge_marchcube.cpp.

00479 {
00480   int *perm;
00481   bool inv = PatternTable[pat].nbits > 4;
00482   perm = VertexPerms[PatternTable[pat].perm];
00483   FUNC( MPT(0,4), MPT(1,5), MPT(2,6), NPT(0,4), NPT(1,5), NPT(2,6) );   
00484   FUNC( MPT(1,3), MPT(2,3), MPT(3,7), NPT(1,3), NPT(2,3), NPT(3,7) );   
00485   FUNC( MPT(1,5), MPT(5,7), MPT(6,7), NPT(1,5), NPT(5,7), NPT(6,7) );   
00486   FUNC( MPT(6,7), MPT(2,6), MPT(1,5), NPT(6,7), NPT(2,6), NPT(1,5) );   
00487 }

template<class T>
void Draw13 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 495 of file guge_marchcube.cpp.

00504 {
00505   int *perm;
00506   bool inv = PatternTable[pat].nbits > 4;
00507   perm = VertexPerms[PatternTable[pat].perm];
00508   FUNC( MPT(0,2), MPT(0,4), MPT(0,1), NPT(0,2), NPT(0,4), NPT(0,1) );   
00509   FUNC( MPT(2,3), MPT(1,3), MPT(3,7), NPT(2,3), NPT(1,3), NPT(3,7)  );   
00510   FUNC( MPT(4,5), MPT(5,7), MPT(1,5), NPT(4,5), NPT(5,7), NPT(1,5) );   
00511   FUNC( MPT(4,6), MPT(2,6), MPT(6,7), NPT(4,6), NPT(2,6), NPT(6,7) );   
00512 }

template<class T>
void Draw13a unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 513 of file guge_marchcube.cpp.

00522 {
00523   int *perm;
00524   bool inv = PatternTable[pat].nbits > 4;
00525   perm = VertexPerms[PatternTable[pat].perm];
00526   FUNC( MPT(0,1), MPT(1,3), MPT(1,5), NPT(0,1), NPT(1,3), NPT(1,5) );   
00527   FUNC( MPT(0,2), MPT(2,6), MPT(2,3), NPT(0,2), NPT(2,6), NPT(2,3) );   
00528   FUNC( MPT(4,6), MPT(0,4), MPT(4,5), NPT(4,6), NPT(0,4), NPT(4,5) );   
00529   FUNC( MPT(6,7), MPT(5,7), MPT(3,7), NPT(6,7), NPT(5,7), NPT(3,7) );   
00530 }

template<class T>
void Draw14 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 538 of file guge_marchcube.cpp.

00547 {
00548   int *perm;
00549   bool inv = PatternTable[pat].nbits > 4;
00550   perm = VertexPerms[PatternTable[pat].perm];
00551   FUNC( MPT(5,7), MPT(2,6), MPT(0,4), NPT(5,7), NPT(2,6), NPT(0,4) );   
00552   FUNC( MPT(5,7), MPT(2,3), MPT(2,6), NPT(5,7), NPT(2,3), NPT(2,6) );   
00553   FUNC( MPT(5,7), MPT(1,3), MPT(2,3), NPT(5,7), NPT(1,3), NPT(2,3) );   
00554   FUNC( MPT(0,4), MPT(4,5), MPT(5,7), NPT(0,4), NPT(4,5), NPT(5,7) );   
00555 }

template<class T>
void Draw2 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 133 of file guge_marchcube.cpp.

00142 {
00143   int *perm;
00144   bool inv = PatternTable[pat].nbits > 4;
00145   perm = VertexPerms[PatternTable[pat].perm];
00146   FUNC( MPT(0,2), MPT(1,5), MPT(1,3), NPT(0,2), NPT(1,5), NPT(1,3) );   
00147   FUNC( MPT(0,2), MPT(0,4), MPT(1,5), NPT(0,2), NPT(0,4), NPT(1,5) );   
00148 }

template<class T>
void Draw3 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 156 of file guge_marchcube.cpp.

00165 {
00166   int *perm;
00167   bool inv = PatternTable[pat].nbits > 4;
00168   perm = VertexPerms[PatternTable[pat].perm];
00169   FUNC( MPT(0,2), MPT(0,4), MPT(0,1), NPT(0,2), NPT(0,4), NPT(0,1) );   
00170   FUNC( MPT(4,5), MPT(5,7), MPT(1,5), NPT(4,5), NPT(5,7), NPT(1,5) );   
00171 }

template<class T>
void Draw3a unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 172 of file guge_marchcube.cpp.

00181 {
00182   int *perm;
00183   bool inv = PatternTable[pat].nbits > 4;
00184   perm = VertexPerms[PatternTable[pat].perm];
00185   FUNC( MPT(0,4), MPT(4,5), MPT(0,2), NPT(0,4), NPT(4,5), NPT(0,2) );   
00186   FUNC( MPT(4,5), MPT(5,7), MPT(0,2), NPT(4,5), NPT(5,7), NPT(0,2) );   
00187   FUNC( MPT(0,2), MPT(5,7), MPT(1,5), NPT(0,2), NPT(5,7), NPT(1,5) );
00188   FUNC( MPT(1,5), MPT(0,1), MPT(0,2), NPT(1,5), NPT(0,1), NPT(0,2) );
00189 }

template<class T>
void Draw4 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 197 of file guge_marchcube.cpp.

00206 {
00207   int *perm;
00208   bool inv = PatternTable[pat].nbits > 4;
00209   perm = VertexPerms[PatternTable[pat].perm];
00210   FUNC( MPT(0,2), MPT(0,4), MPT(0,1), NPT(0,2), NPT(0,4), NPT(0,1) );   
00211   FUNC( MPT(6,7), MPT(3,7), MPT(5,7), NPT(6,7), NPT(3,7), NPT(5,7) );   
00212 }

template<class T>
void Draw5 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 220 of file guge_marchcube.cpp.

00229 {
00230   int *perm;
00231   bool inv = PatternTable[pat].nbits > 4;
00232   perm = VertexPerms[PatternTable[pat].perm];
00233   FUNC( MPT(0,2), MPT(0,4), MPT(2,3), NPT(0,2), NPT(0,4), NPT(2,3)  );   
00234   FUNC( MPT(0,4), MPT(3,7), MPT(2,3), NPT(0,4), NPT(3,7), NPT(2,3) );   
00235   FUNC( MPT(0,4), MPT(1,5), MPT(3,7), NPT(0,4), NPT(1,5), NPT(3,7) );   
00236 }

template<class T>
void Draw6 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 244 of file guge_marchcube.cpp.

00253 {
00254   int *perm;
00255   bool inv = PatternTable[pat].nbits > 4;
00256   perm = VertexPerms[PatternTable[pat].perm];
00257   FUNC( MPT(0,2), MPT(1,5), MPT(1,3), NPT(0,2), NPT(1,5), NPT(1,3) );   
00258   FUNC( MPT(0,2), MPT(0,4), MPT(1,5), NPT(0,2), NPT(0,4), NPT(1,5) );   
00259   FUNC( MPT(6,7), MPT(3,7), MPT(5,7), NPT(6,7), NPT(3,7), NPT(5,7) );   
00260 }

template<class T>
void Draw6a unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 261 of file guge_marchcube.cpp.

00270 {
00271   int *perm;
00272   bool inv = PatternTable[pat].nbits > 4;
00273   perm = VertexPerms[PatternTable[pat].perm];
00274   FUNC( MPT(0,2), MPT(3,7), MPT(1,3), NPT(0,2), NPT(3,7), NPT(1,3) );   
00275   FUNC( MPT(0,2), MPT(6,7), MPT(3,7), NPT(0,2), NPT(6,7), NPT(3,7) );   
00276   FUNC( MPT(0,2), MPT(0,4), MPT(6,7), NPT(0,2), NPT(0,4), NPT(6,7) );   
00277   FUNC( MPT(0,4), MPT(1,5), MPT(6,7), NPT(0,4), NPT(1,5), NPT(6,7) );   
00278   FUNC( MPT(1,5), MPT(5,7), MPT(6,7), NPT(1,5), NPT(5,7), NPT(6,7) );   
00279 }

template<class T>
void Draw7 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 288 of file guge_marchcube.cpp.

00297 {
00298   int *perm;
00299   bool inv = PatternTable[pat].nbits > 4;
00300   perm = VertexPerms[PatternTable[pat].perm];
00301   FUNC( MPT(0,2), MPT(0,4), MPT(0,1), NPT(0,2), NPT(0,4), NPT(0,1)  );   
00302   FUNC( MPT(2,3), MPT(1,3), MPT(3,7), NPT(2,3), NPT(1,3), NPT(3,7)  );   
00303   FUNC( MPT(1,5), MPT(4,5), MPT(5,7), NPT(1,5), NPT(4,5), NPT(5,7)  );
00304 }

template<class T>
void Draw7a unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 305 of file guge_marchcube.cpp.

00314 {
00315   int *perm;
00316   bool inv = PatternTable[pat].nbits > 4;
00317   perm = VertexPerms[PatternTable[pat].perm];
00318   FUNC( MPT(2,3), MPT(5,7), MPT(3,7), NPT(2,3), NPT(5,7), NPT(3,7)  );   
00319   FUNC( MPT(0,2), MPT(5,7), MPT(2,3), NPT(0,2), NPT(5,7), NPT(2,3)  );   
00320   FUNC( MPT(5,7), MPT(0,2), MPT(4,5), NPT(5,7), NPT(0,2), NPT(4,5)  );   
00321   FUNC( MPT(4,5), MPT(0,2), MPT(0,4), NPT(4,5), NPT(0,2), NPT(0,4)  );   
00322   FUNC( MPT(0,1), MPT(1,3), MPT(1,5), NPT(0,1), NPT(1,3), NPT(1,5)  );   
00323 }

template<class T>
void Draw8 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 333 of file guge_marchcube.cpp.

00342 {
00343   int *perm;
00344   bool inv = PatternTable[pat].nbits > 4;
00345   perm = VertexPerms[PatternTable[pat].perm];
00346   FUNC( MPT(0,4), MPT(1,5), MPT(3,7), NPT(0,4), NPT(1,5), NPT(3,7) );   
00347   FUNC( MPT(0,4), MPT(3,7), MPT(2,6), NPT(0,4), NPT(3,7), NPT(2,6) );   
00348 }

template<class T>
void Draw9 unsigned char    pat,
point< T > *    med,
point< T > *    norm,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 356 of file guge_marchcube.cpp.

00365 {
00366   int *perm;
00367   bool inv = PatternTable[pat].nbits > 4;
00368   perm = VertexPerms[PatternTable[pat].perm];
00369   FUNC( MPT(4,5), MPT(1,5), MPT(1,3), NPT(4,5), NPT(1,5), NPT(1,3) );   
00370   FUNC( MPT(4,5), MPT(1,3), MPT(4,6), NPT(4,5), NPT(1,3), NPT(4,6) );   
00371   FUNC( MPT(4,6), MPT(1,3), MPT(2,3), NPT(4,6), NPT(1,3), NPT(2,3) );   
00372   FUNC( MPT(4,6), MPT(2,3), MPT(2,6), NPT(4,6), NPT(2,3), NPT(2,6) );   
00373 }

template<class T>
void FirstPlane int    nx,
int    ny,
Ptr< Ptr< T > >    F0,
Ptr< Ptr< unsigned char > >    Pat1
 

Definition at line 682 of file guge_marchcube.cpp.

00688 {
00689   T f;
00690   int ix,iy;
00691 
00692   /* --- initial code for iy=0,ix=0 --- */
00693 
00694   Pat1[0][0] = 0x00;   /*initialize new pattern */
00695 
00696   f = F0[0][0]; /* get function value */
00697   if( f < 0.0 )
00698   {
00699     Pat1[0][0] |= 0x01;     /* influenced patterns */
00700   }
00701   /* --- initial code for iy=0 and ix = 1,..,nx ---- */
00702 
00703   for( ix=1; ix<=nx; ix++ ) 
00704   {
00705     Pat1[0][ix] = 0x00;   /*initialize new pattern */
00706 
00707     f = F0[0][ix]; /* get function value */
00708     if( f < 0.0 )
00709     {
00710       Pat1[0][ix] |= 0x01;     /* influenced patterns */
00711       Pat1[0][ix-1] |= 0x02;
00712     }
00713   }
00714   for( iy=1; iy<=ny; iy++ ) 
00715   {
00716     /* --- initial code for ix = 0 --- */
00717     
00718     Pat1[iy][0] = 0x00;   /*initialize new pattern */
00719  
00720     f = F0[iy][0]; /* get function value */
00721     if( f < 0.0 )
00722     { 
00723       Pat1[iy][0] |= 0x01;     /* influenced patterns */
00724       Pat1[iy-1][0] |= 0x04;
00725     }  
00726     /* ---- code for ix=1,..,nx ---- */
00727     
00728     for( ix=1; ix<=nx; ix++ ) 
00729     {
00730       Pat1[iy][ix] = 0x00;   /*initialize new pattern */
00731       
00732       f = F0[iy][ix]; /* get function value */            
00733       if( f < 0.0 )
00734       {
00735         Pat1[iy][ix] |= 0x01;     /* influenced patterns */
00736         Pat1[iy][ix-1] |= 0x02;
00737         Pat1[iy-1][ix] |= 0x04;
00738         Pat1[iy-1][ix-1] |= 0x08;
00739       }
00740     }      
00741   }
00742 }

void Harmonize int    k,
int    j,
int    i,
int    nx,
int    ny,
int    nz,
Ptr< Ptr< Ptr< unsigned char > > >    flags
 

Definition at line 824 of file guge_marchcube.cpp.

00827 {
00828   if( (flags[i][j][k]&(DRAW_ALT|CON_SPECIAL)) != 0 )
00829     return;
00830 
00831   flags[i][j][k] |= DRAW_ALT;
00832   
00833   if( ((flags[i][j][k]&CON_X1)!=0) && (k>0) )
00834     Harmonize( k-1, j, i, nx, ny, nz, flags );
00835 
00836   if( ((flags[i][j][k]&CON_X2)!=0) && (k<nx-1) )
00837     Harmonize( k+1, j, i, nx, ny, nz, flags );
00838 
00839   if( ((flags[i][j][k]&CON_Y1)!=0) && (j>0) )
00840     Harmonize( k, j-1, i, nx, ny, nz, flags );
00841       
00842   if( ((flags[i][j][k]&CON_Y2)!=0) && (j<ny-1) )
00843     Harmonize( k, j+1, i, nx, ny, nz, flags );
00844 
00845   if( ((flags[i][j][k]&CON_Z1)!=0) && (i>0) )
00846     Harmonize( k, j, i-1, nx, ny, nz, flags );
00847 
00848   if( ((flags[i][j][k]&CON_Z2)!=0) && (i<nz-1) )
00849     Harmonize( k, j, i+1, nx, ny, nz, flags );
00850 }  

template<class T>
bool IntersectTriangles const triangle< T > &    tri0,
const triangle< T > &    tri1,
point< T > *    retP1,
point< T > *    retP2
 

template<class T, class HP, class EP>
bool guge::IsLinear const int    n,
const Ptr< HP > &    Pw,
const T    tol
 

Definition at line 47 of file guge_linear.cpp.

00049 {
00050   EP A,B,b,u0,X;
00051   point<T> L,H,R;
00052   int i;
00053   bool bzero;
00054 
00055   A = euclid( Pw[0] );
00056   B = euclid( Pw[n] );
00057 
00058   b = B - A;
00059   bzero = rel_equal(B,A,rtr<T>::zero_tol());
00060   
00061   if( !bzero )
00062   {
00063     normalize( &u0, b );
00064     L = cross_product( u0, A );
00065 
00066     for( i = 1; i < n; i++ )
00067     {
00068       X = euclid( Pw[i] );
00069 
00070       H = cross_product( u0, X );
00071       R = H - L;
00072 
00073       if( !abs_equal( H, L, tol ) )
00074         return false;
00075     }
00076   }
00077   else
00078   {
00079     for( i = 0; i <= n; i++ )
00080     {
00081       X = euclid( Pw[i] );
00082       B = X - A;
00083 
00084       if( !abs_equal(X,A,tol) )
00085         return false;
00086     }
00087   }
00088   return true;
00089 }

template bool IsLinear< double, hpoint2< double >, point2< double > > const int    n,
const Ptr< hpoint2< double > > &    Pw,
const double    tol
 

template bool IsLinear< double, hpoint< double >, point< double > > const int    n,
const Ptr< hpoint< double > > &    Pw,
const double    tol
 

template bool IsLinear< double, point2< double >, point2< double > > const int    n,
const Ptr< point2< double > > &    Pw,
const double    tol
 

template bool IsLinear< double, point< double >, point< double > > const int    n,
const Ptr< point< double > > &    Pw,
const double    tol
 

template bool IsLinear< float, hpoint2< float >, point2< float > > const int    n,
const Ptr< hpoint2< float > > &    Pw,
const float    tol
 

template bool IsLinear< float, hpoint< float >, point< float > > const int    n,
const Ptr< hpoint< float > > &    Pw,
const float    tol
 

template bool IsLinear< float, point2< float >, point2< float > > const int    n,
const Ptr< point2< float > > &    Pw,
const float    tol
 

template bool IsLinear< float, point< float >, point< float > > const int    n,
const Ptr< point< float > > &    Pw,
const float    tol
 

template bool IsPlanar const int    nu,
const int    nv,
const Ptr< Ptr< point< double > > > &    Pw,
const double    tol
 

template bool IsPlanar const int    nu,
const int    nv,
const Ptr< Ptr< point< float > > > &    Pw,
const float    tol
 

template bool IsPlanar const int    nu,
const int    nv,
const Ptr< Ptr< hpoint< double > > > &    Pw,
const double    tol
 

template bool IsPlanar const int    nu,
const int    nv,
const Ptr< Ptr< hpoint< float > > > &    Pw,
const float    tol
 

template<class T, class HP>
bool guge::IsPlanar const int    nu,
const int    nv,
const Ptr< Ptr< HP > > &    Pw,
const T    tol
 

Definition at line 123 of file guge_linear.cpp.

00125 {
00126   point<T> A,B,C,D,b,c,d,h,n0,u0,X,H,L,R;
00127   T r,l;
00128   bool is_point,is_plane, bzero,czero,dzero;
00129   int i,j;
00130   
00131   A = euclid( Pw[0][0] );
00132   B = euclid( Pw[nv][0] );
00133   C = euclid( Pw[nv][nu] );
00134   D = euclid( Pw[0][nu] );
00135 
00136   b = B - A;
00137   bzero = rel_equal( B, A, rtr<T>::zero_tol() );
00138   c = C - A;
00139   czero = rel_equal( C, A, rtr<T>::zero_tol() );
00140   d = D - A;
00141   dzero = rel_equal( D, A, rtr<T>::zero_tol() );      
00142 
00143   is_point = false;
00144   is_plane = false;
00145   
00146   if( bzero && czero && dzero )               /* Punkt */
00147     is_point = true;
00148   else                                                             /* Ebene */
00149   {
00150     if( (!bzero) && (!czero) )
00151     {
00152       h = cross_product( b, c );
00153       is_plane = !zero_sine( b, c, rtr<T>::zero_tol() );  /* b || c ??? */      
00154     }
00155        
00156     if( is_plane )
00157     {
00158       normalize( &n0, h );  
00159     }  
00160     else
00161     {  
00162       if( (!bzero) && (!dzero) )
00163       {
00164         h = cross_product( b, d );
00165         is_plane = !zero_sine( b, d, rtr<T>::zero_tol() );  /* b || d ??? */ 
00166       }               
00167 
00168       if( is_plane )
00169       {
00170         normalize( &n0, h );
00171       }
00172       else
00173       {
00174         if( (!czero) && (!dzero) )
00175         {
00176           h = cross_product( c, d );
00177           is_plane = !zero_sine( c, d, rtr<T>::zero_tol() );  /* c || d ??? */ 
00178         }               
00179 
00180         if( is_plane )
00181         {
00182           normalize( &n0, h );
00183         }
00184         else                                                     /* Gerade */ 
00185           if( !bzero )
00186             normalize( &u0, b );
00187           else
00188             if( !czero )
00189               normalize( &u0, c );
00190             else
00191               normalize( &u0, d );              
00192       }
00193     }            
00194   } 
00195 
00196   if( is_plane )
00197   {
00198     r = n0 * A;
00199     if( r < 0 )
00200     {
00201       r = -r;
00202       n0 = -n0;
00203     }  
00204     
00205     for( j = 0; j <= nv; j++ )
00206       for( i = 0; i <= nu; i++ )
00207       {
00208         X = euclid( Pw[j][i] );
00209 
00210         l = n0 * X;
00211         if( gul::rtr<T>::fabs( l - r ) > tol ) return false;
00212       }
00213   }                 
00214   else if( !is_point )
00215   {
00216     L = cross_product( u0, A );
00217 
00218     for( j = 0; j <= nv; j++ )
00219       for( i = 0; i <= nu; i++ )
00220       {
00221         X = euclid( Pw[j][i] );
00222 
00223         H = cross_product( u0, X );
00224         R = H - L;
00225 
00226         if( !abs_equal( H, L, tol ) )
00227           return false;
00228       }
00229   }
00230   else
00231   {
00232     for( j = 0; j <= nv; j++ )
00233       for( i = 0; i <= nu; i++ )
00234       {
00235         X = euclid( Pw[j][i] );
00236         R = X - A;
00237 
00238         if( !abs_equal( X, A, tol ) )
00239           return false;
00240       }
00241   }
00242   return true;
00243 }

template<class T>
GULAPI bool isRectangle int    nP,
const Ptr< gul::point2< T > > &    P,
T &    u1,
T &    u2,
T &    v1,
T &    v2
 

template GULAPI bool isRectangle int    nP,
const Ptr< point2< double > > &    P,
double &    u1,
double &    u2,
double &    v1,
double &    v2
 

template GULAPI bool isRectangle int    nP,
const Ptr< point2< float > > &    P,
float &    u1,
float &    u2,
float &    v1,
float &    v2
 

template<class T>
GULAPI bool isRectangle int    nP,
const Ptr< point2< T > > &    P,
T &    u1,
T &    u2,
T &    v1,
T &    v2
 

Definition at line 264 of file guge_linear.cpp.

00266 {
00267   if( nP != 5 ) return false;
00268 
00269   // last point must be the same as the first one 
00270   if( (P[0].x != P[4].x) || (P[0].y != P[4].y) )
00271     return false;
00272 
00273   if( P[0].y == P[1].y )
00274   {
00275     if( (P[2].y != P[3].y) || 
00276         (P[3].x != P[0].x) || (P[2].x != P[1].x) )
00277       return false;
00278 
00279     if( P[3].y < P[0].y )
00280     {
00281       v1 = P[3].y;
00282       v2 = P[0].y;
00283     }
00284     else
00285     {
00286       v1 = P[0].y;
00287       v2 = P[3].y;
00288     }
00289     if( P[2].x < P[0].x )
00290     {
00291       u1 = P[2].x;
00292       u2 = P[0].x;
00293     }
00294     else
00295     {
00296       u1 = P[0].x;
00297       u2 = P[2].x;
00298     }
00299   }
00300   else if( P[0].x == P[1].x )
00301   {
00302     if( (P[2].x != P[3].x) || 
00303         (P[3].y != P[0].y) || (P[2].y != P[1].y) )
00304       return false;
00305 
00306     if( P[3].x < P[0].x )
00307     {
00308       u1 = P[3].x;
00309       u2 = P[0].x;
00310     }
00311     else
00312     {
00313       u1 = P[0].x;
00314       u2 = P[3].x;
00315     }
00316     if( P[2].y < P[0].y )
00317     {
00318       u1 = P[2].x;
00319       u2 = P[0].x;
00320     }
00321     else
00322     {
00323       u1 = P[0].x;
00324       u2 = P[2].x;
00325     }
00326   }
00327   else
00328     return false;
00329 
00330   return true;
00331 }

template GULAPI void MarchingCube double    x0,
double    y0,
double    z0,
double    dx,
double    dy,
double    dz,
int    nx,
int    ny,
int    nz,
Ptr< Ptr< Ptr< double > > >    F,
void(*    trifunc)(const bool, const point< double > *, const point< double > *, const point< double > *, const point< double > *, const point< double > *, const point< double > *, void *),
void *    tridata
 

template GULAPI void MarchingCube float    x0,
float    y0,
float    z0,
float    dx,
float    dy,
float    dz,
int    nx,
int    ny,
int    nz,
Ptr< Ptr< Ptr< float > > >    F,
void(*    trifunc)(const bool, const point< float > *, const point< float > *, const point< float > *, const point< float > *, const point< float > *, const point< float > *, void *),
void *    tridata
 

template<class T>
GULAPI void guge::MarchingCube   x0,
  y0,
  z0,
  dx,
  dy,
  dz,
int    nx,
int    ny,
int    nz,
Ptr< Ptr< Ptr< T > > >    F,
void(*    trifunc)(const bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    tridata
 

Definition at line 853 of file guge_marchcube.cpp.

00870 {
00871   Ptr< Ptr< Ptr<unsigned char> > > Pat,Flags;
00872   unsigned char pat,pat0; 
00873   int i,j,k,iz;
00874   T dx2,dy2,dz2,bx0,by0,bz0,bx1,by1,bz1,f,a;
00875   point<T> M[12],G[12],D[8];
00876   unsigned char ders;
00877 
00878   dx2 = dx+dx;
00879   dy2 = dy+dy;
00880   dz2 = dz+dz;
00881 
00882   Pat.reserve_pool(nz+1);
00883   Flags.reserve_pool(nz+1);
00884 
00885   for( i = 0; i <= nz; i++ )
00886   {
00887     Pat[i].reserve_pool(ny+1);
00888     Flags[i].reserve_pool(ny+1);
00889 
00890     for( j = 0; j <= ny; j++ )
00891     {
00892       Pat[i][j].reserve_pool(nx+1);
00893       Flags[i][j].reserve_pool(nx+1);
00894     }
00895   }
00896 
00897   FirstPlane( nx, ny, F[0], Pat[0] );
00898 
00899   for( i=1; i <= nz; i++ )
00900   {
00901     NextPlane( nx, ny, F[i], Pat[i-1], Pat[i] );
00902   }  
00903 
00904   for( k = 0; k < nz; k++ )
00905     for( i = 0; i < ny; i++ )
00906       for( j = 0; j < nx; j++ )
00907         Flags[k][i][j] = 0x00;
00908 
00909   for( k = 1; k < nz; k++ )
00910   {
00911     for( i = 1; i < ny; i++ )
00912     {
00913       for( j = 1; j < nx; j++ )
00914       {
00915         pat = Pat[k][i][j];
00916 
00917         if( ((pat & 0x33)==0x21)||((pat & 0x33)==0x12) )
00918         {
00919           Flags[k][i][j] |= CON_Y1;
00920           Flags[k][i-1][j] |= CON_Y2;
00921 
00922           pat0 = Pat[k][i-1][j];
00923           if(
00924       ((PatternTable[pat].nbits>4)&&(PatternTable[pat0].nbits<=4))||
00925       ((PatternTable[pat].nbits<=4)&&(PatternTable[pat0].nbits>4))
00926           )
00927           {
00928             Flags[k][i][j] |= CON_SPECIAL;
00929             Flags[k][i-1][j] |= CON_SPECIAL;
00930 
00931             if( (k&1) )
00932             {
00933               if( ((!(i&1)) && (!(j&1))) ||
00934                   (((i&1)) && ((j&1))) )
00935                 Flags[k][i][j] |= DRAW_ALT;
00936               else
00937                 Flags[k][i-1][j] |= DRAW_ALT;
00938             }
00939             else
00940             {
00941               if( ((!(i&1)) && (!(j&1))) ||
00942                   ((i&1) && (j&1)) )
00943                 Flags[k][i-1][j] |= DRAW_ALT;
00944               else
00945                 Flags[k][i][j] |= DRAW_ALT;
00946             }                                    
00947           }
00948         }
00949 
00950         if( ((pat & 0x55)==0x41)||((pat & 0x55)==0x14) )
00951         {
00952           Flags[k][i][j] |= CON_X1;
00953           Flags[k][i][j-1] |= CON_X2;
00954 
00955           pat0 = Pat[k][i][j-1];
00956           if(
00957       ((PatternTable[pat].nbits>4)&&(PatternTable[pat0].nbits<=4))||
00958       ((PatternTable[pat].nbits<=4)&&(PatternTable[pat0].nbits>4))
00959           )
00960           {
00961             Flags[k][i][j] |= CON_SPECIAL;
00962             Flags[k][i][j-1] |= CON_SPECIAL;
00963 
00964             if( (k&1) )
00965             {
00966               if( ((!(i&1)) && (!(j&1))) ||
00967                   ((i&1) && (j&1)) )
00968                 Flags[k][i][j] |= DRAW_ALT;
00969               else
00970                 Flags[k][i][j-1] |= DRAW_ALT;
00971             }
00972             else
00973             {
00974               if( ((!(i&1)) && (!(j&1))) ||
00975                   ((i&1) && (j&1)) )
00976                 Flags[k][i][j-1] |= DRAW_ALT;
00977               else
00978                 Flags[k][i][j] |= DRAW_ALT;
00979             }
00980           }
00981         }
00982 
00983         if( ((pat & 0x0f)==0x09)||((pat & 0x0f)==0x06) )
00984         {
00985           Flags[k][i][j] |= CON_Z1;
00986           Flags[k-1][i][j] |= CON_Z2;
00987 
00988           pat0 = Pat[k-1][i][j];
00989           if(
00990       ((PatternTable[pat].nbits>4)&&(PatternTable[pat0].nbits<=4))||
00991       ((PatternTable[pat].nbits<=4)&&(PatternTable[pat0].nbits>4))
00992           )
00993           {
00994             Flags[k][i][j] |= CON_SPECIAL;
00995             Flags[k-1][i][j] |= CON_SPECIAL;
00996 
00997             if( (k&1) )
00998             {
00999               if( ((!(i&1)) && (!(j&1))) ||
01000                   ((i&1) && (j&1)) )
01001                 Flags[k][i][j] |= DRAW_ALT;
01002               else
01003                 Flags[k-1][i][j] |= DRAW_ALT;
01004             }
01005             else
01006             {
01007               if( ((!(i&1)) && (!(j&1))) ||
01008                   ((i&1) && (j&1)) )
01009                 Flags[k-1][i][j] |= DRAW_ALT;
01010               else
01011                 Flags[k][i][j] |= DRAW_ALT;
01012             }
01013           }
01014         }
01015 
01016 
01017       }
01018     }
01019   }
01020 
01021   for( i = 0; i < nz; i++ )
01022     for( j = 0; j < ny; j++ )
01023       for( k = 0; k < nx; k++ )
01024       {
01025         if( ((Flags[i][j][k]&CON_X1)!=0) && (k>0) )
01026           Harmonize( k-1, j, i, nx, ny, nz, Flags );
01027 
01028         if( ((Flags[i][j][k]&CON_X2)!=0) && (k<nx-1) )
01029           Harmonize( k+1, j, i, nx, ny, nz, Flags );
01030  
01031         if( ((Flags[i][j][k]&CON_Y1)!=0) && (j>0) )
01032           Harmonize( k, j-1, i, nx, ny, nz, Flags );
01033       
01034         if( ((Flags[i][j][k]&CON_Y2)!=0) && (j<ny-1) )
01035           Harmonize( k, j+1, i, nx, ny, nz, Flags );
01036 
01037         if( ((Flags[i][j][k]&CON_Z1)!=0) && (i>0) )
01038           Harmonize( k, j, i-1, nx, ny, nz, Flags );
01039 
01040         if( ((Flags[i][j][k]&CON_Z2)!=0) && (i<nz-1) )
01041           Harmonize( k, j, i+1, nx, ny, nz, Flags );
01042       }
01043 
01044 
01045   for( iz=1,bz0=z0+dz; iz < nz-1; iz++,bz0+=dz )
01046   {
01047     for( i=1,by0=y0+dy; i < ny-1; i++,by0+=dy )
01048     {
01049       for( j=1,bx0=x0+dx; j < nx-1; j++,bx0+=dx )
01050       {
01051         pat = Pat[iz][i][j];
01052         
01053         if( (pat != 0x00) && (pat != 0xff) )
01054         {
01055           bx1 = bx0+dx;
01056           by1 = by0+dy;
01057           bz1 = bz0+dz; 
01058           ders = 0;
01059 
01060           if( ((pat & 0x03) == 0x01) || ((pat & 0x03) == 0x02) )
01061           {
01062             DER( D[0], iz, i, j );
01063             DER( D[1], iz, i, j+1 );
01064             ders |= 0x03;
01065 
01066             f=F[iz][i][j+1];      /* intersection */  
01067             a=F[iz][i][j];        
01068             VEC( M[0], bx0+a*dx/(a-f), by0, bz0 );
01069 
01070             G[0].x = D[0].x + (M[0].x-bx0)*(D[1].x-D[0].x)/dx;
01071             G[0].y = D[0].y + (M[0].x-bx0)*(D[1].y-D[0].y)/dx;
01072             G[0].z = D[0].z + (M[0].x-bx0)*(D[1].z-D[0].z)/dx;
01073             normalize(&G[0],G[0]);
01074           }
01075           if( ((pat & 0x05) == 0x01) || ((pat & 0x05) == 0x04) )
01076           {
01077             if( (ders & 0x01) == 0 )
01078               DER( D[0], iz, i, j );
01079             if( (ders & 0x04) == 0 )
01080               DER( D[2], iz, i+1, j );
01081             ders |= 0x05;
01082 
01083             f=F[iz][i+1][j];      /* intersection */  
01084             a=F[iz][i][j];        
01085             VEC( M[2], bx0, by0+a*dy/(a-f), bz0 );
01086             
01087             G[2].x = D[0].x + (M[2].y-by0)*(D[2].x-D[0].x)/dy;
01088             G[2].y = D[0].y + (M[2].y-by0)*(D[2].y-D[0].y)/dy;
01089             G[2].z = D[0].z + (M[2].y-by0)*(D[2].z-D[0].z)/dy;
01090             normalize(&G[2],G[2]);
01091           }
01092           if( ((pat & 0x0a) == 0x02) || ((pat & 0x0a) == 0x08) )
01093           {
01094             if( (ders & 0x02) == 0 )
01095               DER( D[1], iz, i, j+1 );
01096             if( (ders & 0x08) == 0 )
01097               DER( D[3], iz, i+1, j+1 );
01098             ders |= 0x0a;
01099               
01100             f=F[iz][i+1][j+1];      /* intersection */  
01101             a=F[iz][i][j+1];        
01102             VEC( M[3], bx1, by0+a*dy/(a-f), bz0 );
01103 
01104             G[3].x = D[1].x + (M[3].y-by0)*(D[3].x-D[1].x)/dy;
01105             G[3].y = D[1].y + (M[3].y-by0)*(D[3].y-D[1].y)/dy;
01106             G[3].z = D[1].z + (M[3].y-by0)*(D[3].z-D[1].z)/dy;
01107             normalize(&G[3],G[3]);
01108           }
01109           if( ((pat & 0x0c) == 0x04) || ((pat & 0x0c) == 0x08) )
01110           {
01111             if( (ders & 0x04) == 0 )
01112               DER( D[2], iz, i+1, j );
01113             if( (ders & 0x08) == 0 )
01114               DER( D[3], iz, i+1, j+1 );
01115             ders |= 0x0c;
01116 
01117             f=F[iz][i+1][j+1];      /* intersection */  
01118             a=F[iz][i+1][j];        
01119             VEC( M[1], bx0+a*dx/(a-f), by1, bz0 );
01120               
01121             G[1].x = D[2].x + (M[1].x-bx0)*(D[3].x-D[2].x)/dx;
01122             G[1].y = D[2].y + (M[1].x-bx0)*(D[3].y-D[2].y)/dx;
01123             G[1].z = D[2].z + (M[1].x-bx0)*(D[3].z-D[2].z)/dx;
01124             normalize(&G[1],G[1]);
01125           }
01126 
01127 
01128           if( ((pat & 0x30) == 0x10) || ((pat & 0x30) == 0x20) )
01129           {
01130             if( (ders & 0x10) == 0 )
01131               DER( D[4], iz+1, i, j );
01132             if( (ders & 0x20) == 0 )
01133               DER( D[5], iz+1, i, j+1 );
01134             ders |= 0x30;
01135              
01136             f=F[iz+1][i][j+1];      /* intersection */  
01137             a=F[iz+1][i][j];        
01138             VEC( M[4], bx0+a*dx/(a-f), by0, bz1 );
01139 
01140             G[4].x = D[4].x + (M[4].x-bx0)*(D[5].x-D[4].x)/dx;
01141             G[4].y = D[4].y + (M[4].x-bx0)*(D[5].y-D[4].y)/dx;
01142             G[4].z = D[4].z + (M[4].x-bx0)*(D[5].z-D[4].z)/dx;
01143             normalize(&G[4],G[4]);
01144           }
01145           if( ((pat & 0x50) == 0x10) || ((pat & 0x50) == 0x40) )
01146           {
01147             if( (ders & 0x10) == 0 )
01148               DER( D[4], iz+1, i, j );
01149             if( (ders & 0x40) == 0 )
01150               DER( D[6], iz+1, i+1, j );
01151             ders |= 0x50;
01152               
01153             f=F[iz+1][i+1][j];      /* intersection */  
01154             a=F[iz+1][i][j];        
01155             VEC( M[6], bx0, by0+a*dy/(a-f), bz1 );
01156 
01157             G[6].x = D[4].x + (M[6].y-by0)*(D[6].x-D[4].x)/dy;
01158             G[6].y = D[4].y + (M[6].y-by0)*(D[6].y-D[4].y)/dy; 
01159             G[6].z = D[4].z + (M[6].y-by0)*(D[6].z-D[4].z)/dy; 
01160             normalize(&G[6],G[6]);
01161           }
01162           if( ((pat & 0xa0) == 0x20) || ((pat & 0xa0) == 0x80) )
01163           {
01164             if( (ders & 0x20) == 0 )
01165               DER( D[5], iz+1, i, j+1 );
01166             if( (ders & 0x80) == 0 )
01167               DER( D[7], iz+1, i+1, j+1 );
01168             ders |= 0xa0;
01169               
01170             f=F[iz+1][i+1][j+1];     /* intersection */  
01171             a=F[iz+1][i][j+1];        
01172             VEC( M[7], bx1, by0+a*dy/(a-f), bz1 );
01173 
01174             G[7].x = D[5].x + (M[7].y-by0)*(D[7].x-D[5].x)/dy;  
01175             G[7].y = D[5].y + (M[7].y-by0)*(D[7].y-D[5].y)/dy;  
01176             G[7].z = D[5].z + (M[7].y-by0)*(D[7].z-D[5].z)/dy;  
01177             normalize(&G[7],G[7]);
01178           }
01179           if( ((pat & 0xc0) == 0x40) || ((pat & 0xc0) == 0x80) )
01180           {
01181             if( (ders & 0x40) == 0 )
01182               DER( D[6], iz+1, i+1, j );
01183             if( (ders & 0x80) == 0 )
01184               DER( D[7], iz+1, i+1, j+1 );
01185             ders |= 0xc0;
01186               
01187             f=F[iz+1][i+1][j+1];      /* intersection */  
01188             a=F[iz+1][i+1][j];        
01189             VEC( M[5], bx0+a*dx/(a-f), by1, bz1 );
01190             
01191             G[5].x = D[6].x + (M[5].x-bx0)*(D[7].x-D[6].x)/dx;  
01192             G[5].y = D[6].y + (M[5].x-bx0)*(D[7].y-D[6].y)/dx;  
01193             G[5].z = D[6].z + (M[5].x-bx0)*(D[7].z-D[6].z)/dx;  
01194             normalize(&G[5],G[5]);
01195           }
01196 
01197 
01198           if( ((pat & 0x11) == 0x01) || ((pat & 0x11) == 0x10) )
01199           {
01200             if( (ders & 0x01) == 0 )
01201               DER( D[0], iz, i, j );
01202             if( (ders & 0x10) == 0 )
01203               DER( D[4], iz+1, i, j );
01204             ders |= 0x11;
01205      
01206             f=F[iz+1][i][j];      /* intersection */  
01207             a=F[iz][i][j];        
01208             VEC( M[8], bx0, by0, bz0+a*dz/(a-f) );
01209 
01210             G[8].x = D[0].x + (M[8].z-bz0)*(D[4].x-D[0].x)/dz;   
01211             G[8].y = D[0].y + (M[8].z-bz0)*(D[4].y-D[0].y)/dz;   
01212             G[8].z = D[0].z + (M[8].z-bz0)*(D[4].z-D[0].z)/dz;   
01213             normalize(&G[8],G[8]);
01214           }
01215           if( ((pat & 0x22) == 0x02) || ((pat & 0x22) == 0x20) )
01216           {
01217             if( (ders & 0x02) == 0 )
01218               DER( D[1], iz, i, j+1 );
01219             if( (ders & 0x20) == 0 )
01220               DER( D[5], iz+1, i, j+1 );
01221             ders |= 0x22;
01222 
01223             f=F[iz+1][i][j+1];      /* intersection */  
01224             a=F[iz][i][j+1];        
01225             VEC( M[9], bx1, by0, bz0+a*dz/(a-f) );
01226               
01227             G[9].x = D[1].x + (M[9].z-bz0)*(D[5].x-D[1].x)/dz;   
01228             G[9].y = D[1].y + (M[9].z-bz0)*(D[5].y-D[1].y)/dz;   
01229             G[9].z = D[1].z + (M[9].z-bz0)*(D[5].z-D[1].z)/dz;   
01230             normalize(&G[9],G[9]);
01231           }
01232           if( ((pat & 0x44) == 0x04) || ((pat & 0x44) == 0x40) )
01233           {
01234             if( (ders & 0x04) == 0 )
01235               DER( D[2], iz, i+1, j );
01236             if( (ders & 0x40) == 0 )
01237               DER( D[6], iz+1, i+1, j );
01238             ders |= 0x44;
01239               
01240             f=F[iz+1][i+1][j];      /* intersection */  
01241             a=F[iz][i+1][j];        
01242             VEC( M[10], bx0, by1, bz0+a*dz/(a-f) );
01243 
01244             G[10].x = D[2].x + (M[10].z-bz0)*(D[6].x-D[2].x)/dz;   
01245             G[10].y = D[2].y + (M[10].z-bz0)*(D[6].y-D[2].y)/dz;   
01246             G[10].z = D[2].z + (M[10].z-bz0)*(D[6].z-D[2].z)/dz;   
01247             normalize(&G[10],G[10]);
01248           }
01249           if( ((pat & 0x88) == 0x08) || ((pat & 0x88) == 0x80) )
01250           {
01251             if( (ders & 0x08) == 0 )
01252               DER( D[3], iz, i+1, j+1 );
01253             if( (ders & 0x80) == 0 )
01254               DER( D[7], iz+1, i+1, j+1 );
01255             ders |= 0x88;
01256 
01257             f=F[iz+1][i+1][j+1];      /* intersection */  
01258             a=F[iz][i+1][j+1];        
01259             VEC( M[11], bx1, by1, bz0+a*dz/(a-f) );
01260               
01261             G[11].x = D[3].x + (M[11].z-bz0)*(D[7].x-D[3].x)/dz;   
01262             G[11].y = D[3].y + (M[11].z-bz0)*(D[7].y-D[3].y)/dz;   
01263             G[11].z = D[3].z + (M[11].z-bz0)*(D[7].z-D[3].z)/dz;   
01264             normalize(&G[11],G[11]);
01265           }
01266 
01267           if( (Flags[iz][i][j]&DRAW_ALT)!=0 )
01268           {
01269             if( AltMethodTable<T>::get(PatternTable[pat].method) != 0 )       
01270               AltMethodTable<T>::get(PatternTable[pat].method)
01271                                            ( pat, M, G, trifunc, tridata );
01272           }
01273           else
01274           {
01275             if( MethodTable<T>::get(PatternTable[pat].method) != NULL )       
01276               MethodTable<T>::get(PatternTable[pat].method)
01277                                            ( pat, M, G, trifunc, tridata );
01278           }
01279         }
01280       }
01281     }
01282   }
01283 } 

template<class T>
void NextPlane int    nx,
int    ny,
Ptr< Ptr< T > >    Fi,
Ptr< Ptr< unsigned char > >    Pat0,
Ptr< Ptr< unsigned char > >    Pat1
 

Definition at line 748 of file guge_marchcube.cpp.

00755 {
00756   T f;
00757   int ix,iy;
00758 
00759   /* --- initial code for iy=0,ix=0 --- */
00760 
00761   Pat1[0][0] = 0x00;   /*initialize new pattern */
00762 
00763   f = Fi[0][0]; /* get function value */
00764   if( f < 0.0 )
00765   {
00766     Pat1[0][0] |= 0x01;     /* influenced patterns */
00767   }
00768   /* --- initial code for iy=0 and ix = 1,..,nx ---- */
00769 
00770   for( ix=1; ix<=nx; ix++ ) 
00771   {
00772     Pat1[0][ix] = 0x00;   /*initialize new pattern */
00773 
00774     f = Fi[0][ix]; /* get function value */
00775     if( f < 0.0 )
00776     {
00777       Pat1[0][ix] |= 0x01;     /* influenced patterns */
00778       Pat1[0][ix-1] |= 0x02;
00779       Pat0[0][ix] |= 0x10;
00780       Pat0[0][ix-1] |= 0x20;
00781     }
00782   }
00783   for( iy=1; iy<=ny; iy++ ) 
00784   {
00785     /* --- initial code for ix = 0 --- */
00786     
00787     Pat1[iy][0] = 0x00;   /*initialize new pattern */
00788  
00789     f = Fi[iy][0]; /* get function value */
00790     if( f < 0.0 )
00791     { 
00792       Pat1[iy][0] |= 0x01;     /* influenced patterns */
00793       Pat1[iy-1][0] |= 0x04;
00794       Pat0[iy][0] |= 0x10;
00795       Pat0[iy-1][0] |= 0x40;
00796     }
00797     /* ---- code for ix=1,..,nx ---- */
00798     
00799     for( ix=1; ix<=nx; ix++ ) 
00800     {
00801       Pat1[iy][ix] = 0x00;   /*initialize new pattern */
00802       
00803       f = Fi[iy][ix]; /* get function value */
00804       if( f < 0.0 )
00805       {
00806         Pat1[iy][ix] |= 0x01;     /* influenced patterns */
00807         Pat1[iy][ix-1] |= 0x02;
00808         Pat1[iy-1][ix] |= 0x04;
00809         Pat1[iy-1][ix-1] |= 0x08;
00810         Pat0[iy][ix] |= 0x10;
00811         Pat0[iy][ix-1] |= 0x20;
00812         Pat0[iy-1][ix] |= 0x40;
00813         Pat0[iy-1][ix-1] |= 0x80;
00814       }
00815     }      
00816   }
00817 }

template<class T>
void NormalizePointsE const int    nP,
const Ptr< point2< T > >    P,
const T    minx,
const T    scalex,
const T    miny,
const T    scaley
[inline]
 

Definition at line 410 of file guge_normalize.h.

00413 {
00414   for( int i = 0; i < nP; i++ )
00415   {
00416     P[i].x = (P[i].x - minx) / (scalex);
00417     P[i].y = (P[i].y - miny) / (scaley);
00418   }
00419 }

template<class T>
void NormalizePointsE const int    nP,
const Ptr< point< T > >    P,
const T    minx,
const T    scalex,
const T    miny,
const T    scaley,
const T    minz,
const T    scalez
[inline]
 

Definition at line 397 of file guge_normalize.h.

00401 {
00402   for( int i = 0; i < nP; i++ )
00403   {
00404     P[i].x = (P[i].x - minx) / (scalex);
00405     P[i].y = (P[i].y - miny) / (scaley);
00406     P[i].z = (P[i].z - minz) / (scalez);
00407   }
00408 }

template<class T>
void NormalizePointsH const int    nP,
const Ptr< hpoint< T > >    Pw,
const T    minx,
const T    scalex,
const T    miny,
const T    scaley,
const T    minz,
const T    scalez
[inline]
 

Definition at line 425 of file guge_normalize.h.

00429 {
00430   int i;
00431   T w;
00432   for( i = 0; i < nP; i++ )
00433   {
00434     w = Pw[i].w;
00435     Pw[i].x = (Pw[i].x - w*minx) / (scalex);
00436     Pw[i].y = (Pw[i].y - w*miny) / (scaley);
00437     Pw[i].z = (Pw[i].z - w*minz) / (scalez);
00438   }
00439 }

template<class T>
bool RegularIntersectLines const point< T > &    A,
const point< T > &    B,
const point< T > &    a,
const point< T > &    b,
T *    lambda,
T *    mu
 

template<class T>
void RenumberVerts const point< T > &    P1,
const point< T > &    P2,
const point< T > &    P3,
const point< T > &    T1,
const point< T > &    T2,
const point< T > &    T3,
bool    inv,
void(*    func)(bool, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, const point< T > *, void *),
void *    fdat
 

Definition at line 59 of file guge_marchcube.cpp.

00068 {
00069   point<T> a,b,N;
00070   T s;
00071  
00072   if( !inv )
00073   {
00074     a = P2 - P1;
00075     b = P3 - P1;
00076     N = cross_product( a, b );
00077   
00078     s=(T1.x+T2.x+T3.x)*N.x + (T1.y+T2.y+T3.y)*N.y + (T1.z+T2.z+T3.z)*N.z;
00079     
00080     if( s > 0.0 )
00081       func(0,&P1,&P2,&P3,&T1,&T2,&T3,fdat);
00082     else
00083       func(1,&P1,&P3,&P2,&T1,&T3,&T2,fdat); /* front and back faces swapped */
00084   }
00085   else
00086   {
00087     a = P3 - P1;
00088     b = P2 - P1;
00089     N = cross_product( a, b );
00090   
00091     s=(T1.x+T2.x+T3.x)*N.x + (T1.y+T2.y+T3.y)*N.y + (T1.z+T2.z+T3.z)*N.z;
00092 
00093     if( s > 0.0 )
00094       func(0,&P1,&P3,&P2,&T1,&T3,&T2,fdat);
00095     else
00096       func(1,&P1,&P2,&P3,&T1,&T2,&T3,fdat);
00097   }
00098 }        

template<class T1, class T2>
void set gul::bounding_box< T1 > &    box,
const gul::point1< T2 > &    minP,
const gul::point1< T2 > &    maxP
 

Definition at line 535 of file guge_normalize.h.

00537 {
00538   box.x1 = (T1)minP.x;
00539   box.x2 = (T1)maxP.x;
00540   box.y1 = 0;
00541   box.y2 = 0;
00542   box.z1 = 0;
00543   box.z2 = 0;  
00544 }

template<class T1, class T2>
void set gul::bounding_box< T1 > &    box,
const gul::hpoint2< T2 > &    minP,
const gul::hpoint2< T2 > &    maxP
 

Definition at line 524 of file guge_normalize.h.

00526 {
00527   box.x1 = (T1)(minP.x/minP.w);
00528   box.x2 = (T1)(maxP.x/maxP.w);
00529   box.y1 = (T1)(minP.y/minP.w);
00530   box.y2 = (T1)(maxP.y/maxP.w);
00531   box.z1 = 0;
00532   box.z2 = 0;  
00533 }

template<class T1, class T2>
void set gul::bounding_box< T1 > &    box,
const gul::point2< T2 > &    minP,
const gul::point2< T2 > &    maxP
 

Definition at line 513 of file guge_normalize.h.

00515 {
00516   box.x1 = (T1)minP.x;
00517   box.x2 = (T1)maxP.x;
00518   box.y1 = (T1)minP.y;
00519   box.y2 = (T1)maxP.y;
00520   box.z1 = 0;
00521   box.z2 = 0;  
00522 }

template<class T1, class T2>
void set gul::bounding_box< T1 > &    box,
const gul::hpoint< T2 > &    minP,
const gul::hpoint< T2 > &    maxP
 

Definition at line 501 of file guge_normalize.h.

00503 {
00504   box.x1 = (T1)(minP.x/minP.w);
00505   box.x2 = (T1)(maxP.x/maxP.w);
00506   box.y1 = (T1)(minP.y/minP.w);
00507   box.y2 = (T1)(maxP.y/maxP.w);
00508   box.z1 = (T1)(minP.z/minP.w);
00509   box.z2 = (T1)(maxP.z/maxP.w);
00510 }

template<class T1, class T2>
void set gul::bounding_box< T1 > &    box,
const gul::point< T2 > &    minP,
const gul::point< T2 > &    maxP
 

Definition at line 490 of file guge_normalize.h.

00492 {
00493   box.x1 = (T1)minP.x;
00494   box.x2 = (T1)maxP.x;
00495   box.y1 = (T1)minP.y;
00496   box.y2 = (T1)maxP.y;
00497   box.z1 = (T1)minP.z;
00498   box.z2 = (T1)maxP.z;
00499 }

template<class T>
void UpdateBoundingBoxE const int    nP,
const Ptr< point1< T > > &    P,
T &    minx,
T &    maxx
[inline]
 

Definition at line 139 of file guge_normalize.h.

00141 {
00142   for( int i = 0; i < nP; i++ )
00143   {
00144     if( P[i].x < minx ) minx = P[i].x;
00145     else if( P[i].x > maxx ) maxx = P[i].x;
00146   }
00147 }

template<class T>
void UpdateBoundingBoxE const int    nP,
const Ptr< point2< T > > &    P,
T &    minx,
T &    maxx,
T &    miny,
T &    maxy
[inline]
 

Definition at line 124 of file guge_normalize.h.

00127 {
00128   for( int i = 0; i < nP; i++ )
00129   {
00130     if( P[i].x < minx ) minx = P[i].x;
00131     else if( P[i].x > maxx ) maxx = P[i].x;
00132     
00133     if( P[i].y < miny ) miny = P[i].y;
00134     else if( P[i].y > maxy ) maxy = P[i].y;
00135   }
00136 }

template<class T>
void UpdateBoundingBoxE const int    nP,
const Ptr< point< T > > &    P,
T &    minx,
T &    maxx,
T &    miny,
T &    maxy,
T &    minz,
T &    maxz
[inline]
 

Definition at line 105 of file guge_normalize.h.

00109 {                    
00110   for( int i = 0; i < nP; i++ )
00111   {
00112     if( P[i].x < minx ) minx = P[i].x;
00113     else if( P[i].x > maxx ) maxx = P[i].x;
00114     
00115     if( P[i].y < miny ) miny = P[i].y;
00116     else if( P[i].y > maxy ) maxy = P[i].y;
00117 
00118     if( P[i].z < minz ) minz = P[i].z;
00119     else if( P[i].z > maxz ) maxz = P[i].z;
00120   }                      
00121 }                                              

template<class T>
void UpdateBoundingBoxH const int    nP,
const Ptr< hpoint1< T > > &    Pw,
T &    minx,
T &    maxx
[inline]
 

Definition at line 86 of file guge_normalize.h.

00088 {
00089   T x,w;  
00090   int i;
00091 
00092   for( i = 0; i < nP; i++ )
00093   {
00094     w = Pw[i].w;
00095     
00096     x = Pw[i].x / w;
00097     if( x < minx ) minx = x;
00098     else if( x > maxx ) maxx = x;
00099   }  
00100 }

template<class T>
void UpdateBoundingBoxH const int    nP,
const Ptr< hpoint2< T > > &    Pw,
T &    minx,
T &    maxx,
T &    miny,
T &    maxy
[inline]
 

Definition at line 64 of file guge_normalize.h.

00067 {
00068   T x,y,w;  
00069   int i;
00070 
00071   for( i = 0; i < nP; i++ )
00072   {
00073     w = Pw[i].w;
00074     
00075     x = Pw[i].x / w;
00076     if( x < minx ) minx = x;
00077     else if( x > maxx ) maxx = x;
00078     
00079     y = Pw[i].y / w;
00080     if( y < miny ) miny = y;
00081     else if( y > maxy ) maxy = y;
00082   }  
00083 }

template<class T>
void UpdateBoundingBoxH const int    nP,
const Ptr< hpoint< T > > &    Pw,
T &    minx,
T &    maxx,
T &    miny,
T &    maxy,
T &    minz,
T &    maxz
[inline]
 

Definition at line 37 of file guge_normalize.h.

00041 {
00042   T x,y,z,w;  
00043   int i;
00044 
00045   for( i = 0; i < nP; i++ )
00046   {
00047     w = Pw[i].w;
00048     
00049     x = Pw[i].x / w;
00050     if( x < minx ) minx = x;
00051     else if( x > maxx ) maxx = x;
00052     
00053     y = Pw[i].y / w;
00054     if( y < miny ) miny = y;
00055     else if( y > maxy ) maxy = y;
00056     
00057     z = Pw[i].z / w;
00058     if( z < minz ) minz = z;
00059     else if( z > maxz ) maxz = z;
00060   }  
00061 }

template<>
void UpdateBoundingBoxVerts int    nPw,
const Ptr< hpoint< double > > &    Pw,
point< double > &    minP,
point< double > &    maxP
[inline]
 

Definition at line 385 of file guge_normalize.h.

00387 {                    
00388   UpdateBoundingBoxH( nPw, Pw, minP.x, maxP.x, minP.y, maxP.y, minP.z, maxP.z );                 
00389 } 

template<>
void UpdateBoundingBoxVerts int    nPw,
const Ptr< hpoint< float > > &    Pw,
point< float > &    minP,
point< float > &    maxP
[inline]
 

Definition at line 379 of file guge_normalize.h.

00381 {                    
00382   UpdateBoundingBoxH( nPw, Pw, minP.x, maxP.x, minP.y, maxP.y, minP.z, maxP.z );                 
00383 }  

template<>
void UpdateBoundingBoxVerts int    nP,
const Ptr< point< double > > &    P,
point< double > &    minP,
point< double > &    maxP
[inline]
 

Definition at line 373 of file guge_normalize.h.

00375 {                    
00376   UpdateBoundingBoxE( nP, P, minP.x, maxP.x, minP.y, maxP.y, minP.z, maxP.z );                 
00377 } 

template<>
void UpdateBoundingBoxVerts int    nP,
const Ptr< point< float > > &    P,
point< float > &    minP,
point< float > &    maxP
[inline]
 

Definition at line 367 of file guge_normalize.h.

00369 {                    
00370   UpdateBoundingBoxE( nP, P, minP.x, maxP.x, minP.y, maxP.y, minP.z, maxP.z );                 
00371 }  

template<>
void UpdateBoundingBoxVerts int    nPw,
const Ptr< hpoint2< double > > &    Pw,
point2< double > &    minP,
point2< double > &    maxP
[inline]
 

Definition at line 360 of file guge_normalize.h.

00362 {                    
00363   UpdateBoundingBoxH( nPw, Pw, minP.x, maxP.x, minP.y, maxP.y );
00364 }

template<>
void UpdateBoundingBoxVerts int    nPw,
const Ptr< hpoint2< float > > &    Pw,
point2< float > &    minP,
point2< float > &    maxP
[inline]
 

Definition at line 354 of file guge_normalize.h.

00356 {                    
00357   UpdateBoundingBoxH( nPw, Pw, minP.x, maxP.x, minP.y, maxP.y );
00358 }

template<>
void UpdateBoundingBoxVerts int    nP,
const Ptr< point2< double > > &    P,
point2< double > &    minP,
point2< double > &    maxP
[inline]
 

Definition at line 348 of file guge_normalize.h.

00350 {                    
00351   UpdateBoundingBoxE( nP, P, minP.x, maxP.x, minP.y, maxP.y );
00352 }

template<>
void UpdateBoundingBoxVerts int    nP,
const Ptr< point2< float > > &    P,
point2< float > &    minP,
point2< float > &    maxP
[inline]
 

Definition at line 342 of file guge_normalize.h.

00344 {                    
00345   UpdateBoundingBoxE( nP, P, minP.x, maxP.x, minP.y, maxP.y );
00346 }

template<>
void UpdateBoundingBoxVerts int    nPw,
const Ptr< hpoint1< double > > &    Pw,
point1< double > &    minP,
point1< double > &    maxP
[inline]
 

Definition at line 335 of file guge_normalize.h.

00337 {                    
00338   UpdateBoundingBoxH( nPw, Pw, minP.x, maxP.x );
00339 }

template<>
void UpdateBoundingBoxVerts int    nPw,
const Ptr< hpoint1< float > > &    Pw,
point1< float > &    minP,
point1< float > &    maxP
[inline]
 

Definition at line 329 of file guge_normalize.h.

00331 {                    
00332   UpdateBoundingBoxH( nPw, Pw, minP.x, maxP.x );
00333 }

template<>
void UpdateBoundingBoxVerts int    nP,
const Ptr< point1< double > > &    P,
point1< double > &    minP,
point1< double > &    maxP
[inline]
 

Definition at line 323 of file guge_normalize.h.

00325 {                    
00326   UpdateBoundingBoxE( nP, P, minP.x, maxP.x );
00327 }

template<>
void UpdateBoundingBoxVerts int    nP,
const Ptr< point1< float > > &    P,
point1< float > &    minP,
point1< float > &    maxP
[inline]
 

Definition at line 317 of file guge_normalize.h.

00319 {                    
00320   UpdateBoundingBoxE( nP, P, minP.x, maxP.x );
00321 }

template<class HP, class EP>
void UpdateBoundingBoxVerts int    nPw,
const Ptr< HP > &    Pw,
EP &    minP,
EP &    maxP
[inline]
 


Variable Documentation

template class guge::AltMethodTable< double >
 

Definition at line 637 of file guge_marchcube.cpp.

template class guge::AltMethodTable< float >
 

Definition at line 636 of file guge_marchcube.cpp.

int guge::EdgePerms
 

Initial value:

 {
     
  { 0, 0, 2, 0, 8, 0, 0, 0},

  { 0, 0, 0, 3, 0, 9, 0, 0},

  { 2, 0, 0, 1, 0, 0,10, 0},

  { 0, 3, 1, 0, 0, 0, 0,11},

  { 8, 0, 0, 0, 0, 4, 6, 0},

  { 0, 9, 0, 0, 4, 0, 0, 7},

  { 0, 0,10, 0, 6, 0, 0, 5},

  { 0, 0, 0,11, 0, 7, 5, 0},
}

Definition at line 27 of file guge_mcpattern.cpp.

template class guge::MethodTable< double >
 

Definition at line 577 of file guge_marchcube.cpp.

template class guge::MethodTable< float >
 

Definition at line 576 of file guge_marchcube.cpp.

PatternRec guge::PatternTable
 

Definition at line 73 of file guge_mcpattern.cpp.

int guge::VertexPerms
 

Initial value:

 {
{0,1,2,3,4,5,6,7},
{1,3,0,2,5,7,4,6},
{3,2,1,0,7,6,5,4},
{2,0,3,1,6,4,7,5},
{4,5,0,1,6,7,2,3},
{0,4,1,5,2,6,3,7},
{1,0,5,4,3,2,7,6},
{5,1,4,0,7,3,6,2},
{5,7,1,3,4,6,0,2},
{1,5,3,7,0,4,2,6},
{3,1,7,5,2,0,6,4},
{7,3,5,1,6,2,4,0},
{6,4,2,0,7,5,3,1},
{2,6,0,4,3,7,1,5},
{0,2,4,6,1,3,5,7},
{4,0,6,2,5,1,7,3},
{7,6,3,2,5,4,1,0},
{3,7,2,6,1,5,0,4},
{2,3,6,7,0,1,4,5},
{6,2,7,3,4,0,5,1},
{5,4,7,6,1,0,3,2},
{7,5,6,4,3,1,2,0},
{6,7,4,5,2,3,0,1},
{4,6,5,7,0,2,1,3},
}

Definition at line 46 of file guge_mcpattern.cpp.


Generated on Mon Jan 21 04:17:50 2002 for GUL 0.6 - Geometry Utility Library by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001