*** empty log message ***

This commit is contained in:
Nico Pietroni 2004-04-28 11:37:15 +00:00
parent 6d04f844de
commit f154f17acd
5 changed files with 51 additions and 40 deletions

View File

@ -314,27 +314,27 @@ void TTTopology(VertexContainer &vert,TetraContainer &tetra)
(*ti).T(2)=(&(*ti)); (*ti).T(2)=(&(*ti));
(*ti).T(3)=(&(*ti)); (*ti).T(3)=(&(*ti));
v0=(*ti).V(Tetra4<double>::VofF(0,0)); v0=(*ti).V(Tetra3<double>::VofF(0,0));
v1=(*ti).V(Tetra4<double>::VofF(0,1)); v1=(*ti).V(Tetra3<double>::VofF(0,1));
v2=(*ti).V(Tetra4<double>::VofF(0,2)); v2=(*ti).V(Tetra3<double>::VofF(0,2));
VF.push_back(Facet<VertexType,TetraType>(v0,v1,v2,&(*ti),0)); VF.push_back(Facet<VertexType,TetraType>(v0,v1,v2,&(*ti),0));
v0=(*ti).V(Tetra4<double>::VofF(1,0)); v0=(*ti).V(Tetra3<double>::VofF(1,0));
v1=(*ti).V(Tetra4<double>::VofF(1,1)); v1=(*ti).V(Tetra3<double>::VofF(1,1));
v2=(*ti).V(Tetra4<double>::VofF(1,2)); v2=(*ti).V(Tetra3<double>::VofF(1,2));
VF.push_back(Facet<VertexType,TetraType>(v0,v1,v2,&(*ti),1)); VF.push_back(Facet<VertexType,TetraType>(v0,v1,v2,&(*ti),1));
v0=(*ti).V(Tetra4<double>::VofF(2,0)); v0=(*ti).V(Tetra3<double>::VofF(2,0));
v1=(*ti).V(Tetra4<double>::VofF(2,1)); v1=(*ti).V(Tetra3<double>::VofF(2,1));
v2=(*ti).V(Tetra4<double>::VofF(2,2)); v2=(*ti).V(Tetra3<double>::VofF(2,2));
VF.push_back(Facet<VertexType,TetraType>(v0,v1,v2,&(*ti),2)); VF.push_back(Facet<VertexType,TetraType>(v0,v1,v2,&(*ti),2));
v0=(*ti).V(Tetra4<double>::VofF(3,0)); v0=(*ti).V(Tetra3<double>::VofF(3,0));
v1=(*ti).V(Tetra4<double>::VofF(3,1)); v1=(*ti).V(Tetra3<double>::VofF(3,1));
v2=(*ti).V(Tetra4<double>::VofF(3,2)); v2=(*ti).V(Tetra3<double>::VofF(3,2));
VF.push_back(Facet<VertexType,TetraType>(v0,v1,v2,&(*ti),3)); VF.push_back(Facet<VertexType,TetraType>(v0,v1,v2,&(*ti),3));
} }
@ -378,16 +378,16 @@ void TestTTTopology(VertexContainer &vert,TetraContainer &tetra)
{ {
assert( ((((*ti).T(i))->T((*ti).Z(i)))==&(*ti))); assert( ((((*ti).T(i))->T((*ti).Z(i)))==&(*ti)));
VertexType *v0=(*ti).V(Tetra4<double>::VofF(i,0)); VertexType *v0=(*ti).V(Tetra3<double>::VofF(i,0));
VertexType *v1=(*ti).V(Tetra4<double>::VofF(i,1)); VertexType *v1=(*ti).V(Tetra3<double>::VofF(i,1));
VertexType *v2=(*ti).V(Tetra4<double>::VofF(i,2)); VertexType *v2=(*ti).V(Tetra3<double>::VofF(i,2));
TetraType *t1=(TetraType*)(*ti).T(i); TetraType *t1=(TetraType*)(*ti).T(i);
int z1=(*ti).Z(i); int z1=(*ti).Z(i);
VertexType *vo0=(*t1).V(Tetra4<double>::VofF(z1,0)); VertexType *vo0=(*t1).V(Tetra3<double>::VofF(z1,0));
VertexType *vo1=(*t1).V(Tetra4<double>::VofF(z1,1)); VertexType *vo1=(*t1).V(Tetra3<double>::VofF(z1,1));
VertexType *vo2=(*t1).V(Tetra4<double>::VofF(z1,2)); VertexType *vo2=(*t1).V(Tetra3<double>::VofF(z1,2));
assert((v0!=v1)&&(v0!=v2)&&(v1!=v2)); assert((v0!=v1)&&(v0!=v2)&&(v1!=v2));
assert((vo0!=vo1)&&(vo0!=vo2)&&(vo1!=vo2)); assert((vo0!=vo1)&&(vo0!=vo2)&&(vo1!=vo2));

View File

@ -106,9 +106,9 @@ void Convert(TetraMeshType &tetram,TriangleMeshType &trim)
for (int i=0;i<4;i++) for (int i=0;i<4;i++)
if (ti->IsBorderF(i)) if (ti->IsBorderF(i))
{ {
v0=ti->V(Tetra4<double>::VofF(i,0)); v0=ti->V(Tetra3<double>::VofF(i,0));
v1=ti->V(Tetra4<double>::VofF(i,1)); v1=ti->V(Tetra3<double>::VofF(i,1));
v2=ti->V(Tetra4<double>::VofF(i,2)); v2=ti->V(Tetra3<double>::VofF(i,2));
FaceType f=FaceType(); FaceType f=FaceType();
f.ClearFlags(); f.ClearFlags();
f.V(0)=v0; f.V(0)=v0;

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.3 2004/04/26 09:38:54 pietroni
*** empty log message ***
Revision 1.2 2004/04/20 12:42:37 pietroni Revision 1.2 2004/04/20 12:42:37 pietroni
*** empty log message *** *** empty log message ***
@ -38,7 +41,7 @@ Revision 1.1 2004/04/15 08:54:20 pietroni
#else #else
#define NULL 0 #define NULL 0
#include<vcg/space/point3.h> #include<vcg/space/point3.h>
#include<vcg/space/tetra4.h> #include<vcg/space/tetra3.h>
namespace vcg { namespace vcg {
/** /**
@ -289,7 +292,7 @@ public:
ScalarType ComputeVolume(){ ScalarType ComputeVolume(){
Tetra4<ScalarType> T(V(0)->cP(),V(1)->cP(),V(2)->cP(),V(3)->cP()); Tetra3<ScalarType> T(V(0)->cP(),V(1)->cP(),V(2)->cP(),V(3)->cP());
#ifdef __VCGLIB_TETRA_Q #ifdef __VCGLIB_TETRA_Q
_volume = T.ComputeVolume(); _volume = T.ComputeVolume();
return _volume; return _volume;

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.6 2004/04/26 09:40:15 pietroni
*** empty log message ***
Revision 1.6 2004/04/23 14:55:06 pietroni Revision 1.6 2004/04/23 14:55:06 pietroni
conversion funtion conversion funtion
@ -573,20 +576,22 @@ static bool HasVFAdjacency() {
//@{ //@{
template <class VERT_TYPE> template <class VERT_TYPE>
inline Convert( const VERT_TYPE &v ) inline Convert( VERT_TYPE &v )
{ {
this->P()=v->P(); P()=v.P();
this._flags=v._flags; Flags()=v.Flags();
if (this->HasNormal())&&(v.HasNormal()) if ((HasNormal())&&(v.HasNormal()))
this->N()=v->N(); N()=v.N();
if (this->HasColor())&&(v.HasColor()) if ((HasColor())&&(v.HasColor()))
this->C()=v->C(); C()=v.C();
if (this->HasMark())&&(v.HasMark()) #ifdef __VCGLIB_VERTEX_M
this.IMark()=v.IMark(); if ((HasMark())&&(v.HasMark()))
if (this->HasQuality())&&(v.HasQuality()) IMark()=v.IMark();
this->Q()=v->Q(); #endif
if (this->HasTexture())&&(v.HasTexture()) if ((HasQuality())&&(v.HasQuality()))
this->T()=v->T(); Q()=v.Q();
if ((HasTexture())&&(v.HasTexture()))
T()=v.T();
} }
//@} //@}

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.1 2004/04/22 13:19:12 ganovelli
first version
Revision 1.2 2004/04/20 16:26:48 pietroni Revision 1.2 2004/04/20 16:26:48 pietroni
*** empty log message *** *** empty log message ***
@ -46,7 +49,7 @@ namespace vcg {
Templated class for storing a generic tetrahedron in a 3D space. Templated class for storing a generic tetrahedron in a 3D space.
Note the relation with the Face class of TetraMesh complex, both classes provide the P(i) access functions to their points and therefore they share the algorithms on it (e.g. area, normal etc...) Note the relation with the Face class of TetraMesh complex, both classes provide the P(i) access functions to their points and therefore they share the algorithms on it (e.g. area, normal etc...)
*/ */
template <class SCALAR_TETRA_TYPE> class Tetra4 template <class SCALAR_TETRA_TYPE> class Tetra3
{ {
public: public:
typedef SCALAR_TETRA_TYPE ScalarType; typedef SCALAR_TETRA_TYPE ScalarType;
@ -62,7 +65,7 @@ protected:
public: public:
///constructor with 4 points ///constructor with 4 points
Tetra4(CoordType p0,CoordType p1,CoordType p2,CoordType p3) Tetra3(CoordType p0,CoordType p1,CoordType p2,CoordType p3)
{ {
_v[0]=p0; _v[0]=p0;
_v[1]=p1; _v[1]=p1;
@ -165,8 +168,8 @@ ScalarType ComputeAspectRatio()
return vertface[indexV][indexF]; return vertface[indexV][indexF];
} }
static int FofE(const int &indexE,const int &indexF) static int FofE(const int &indexE,const int &indexSide)
{ assert ((indexE<6)&&(indexF<2)); { assert ((indexE<6)&&(indexSide<2));
static int edgeface[6][2]={{0,1}, static int edgeface[6][2]={{0,1},
{0,2}, {0,2},
{1,2}, {1,2},