minor changes to comply gcc compiler (typename's )

This commit is contained in:
Nico Pietroni 2004-09-01 12:22:04 +00:00
parent c3227ae7a0
commit cf20e1d0c1
9 changed files with 128 additions and 107 deletions

View File

@ -31,12 +31,12 @@
#include<vcg\complex\local_optimization.h> #include<vcg\complex\local_optimization.h>
struct FAIL{ struct FAIL{
static VOL(){static int vol=0; return vol++;} static int VOL(){static int vol=0; return vol++;}
static LKF(){static int lkf=0; return lkf++;} static int LKF(){static int lkf=0; return lkf++;}
static LKE(){static int lke=0; return lke++;} static int LKE(){static int lke=0; return lke++;}
static LKV(){static int lkv=0; return lkv++;} static int LKV(){static int lkv=0; return lkv++;}
static OFD(){static int ofd=0; return ofd++;} static int OFD(){static int ofd=0; return ofd++;}
static BOR(){static int bor=0; return bor++;} static int BOR(){static int bor=0; return bor++;}
}; };
@ -55,15 +55,15 @@ class TetraEdgeCollapse: public LocalOptimization<TETRA_MESH_TYPE>::LocModType
{ {
/// The tetrahedral mesh type /// The tetrahedral mesh type
typedef typename TETRA_MESH_TYPE TetraMeshType; //typedef typename TETRA_MESH_TYPE TETRA_MESH_TYPE;
/// The tetrahedron type /// The tetrahedron type
typedef typename TetraMeshType::TetraType TetraType; typedef typename TETRA_MESH_TYPE::TetraType TetraType;
/// The vertex type /// The vertex type
typedef typename TetraType::VertexType VertexType; typedef typename TetraType::VertexType VertexType;
/// The coordinate type /// The coordinate type
typedef typename TetraType::VertexType::CoordType CoordType; typedef typename TetraType::VertexType::CoordType CoordType;
/// The scalar type /// The scalar type
typedef typename TetraMeshType::VertexType::ScalarType ScalarType; typedef typename TETRA_MESH_TYPE::VertexType::ScalarType ScalarType;
/////the base type class /////the base type class
//typedef typename vcg::tri::LocalModification LocalMod; //typedef typename vcg::tri::LocalModification LocalMod;
/// The HEdgePos type /// The HEdgePos type
@ -77,7 +77,7 @@ private:
///the new point that substitute the edge ///the new point that substitute the edge
Point3<ScalarType> _NewPoint; Point3<ScalarType> _NewPoint;
///the pointer to edge collapser method ///the pointer to edge collapser method
vcg::tetra::EdgeCollapse<TetraMeshType> _EC; vcg::tetra::EdgeCollapse<TETRA_MESH_TYPE> _EC;
///mark for up_dating ///mark for up_dating
static int& _Imark(){ static int im=0; return im;} static int& _Imark(){ static int im=0; return im;}
///the pos of collapse ///the pos of collapse
@ -96,7 +96,7 @@ public:
TetraEdgeCollapse(PosType p,int mark) TetraEdgeCollapse(PosType p,int mark)
{ {
_Imark() = mark; _Imark() = mark;
pos=p; pos=p;
_priority = _AspectRatioMedia(p); _priority = _AspectRatioMedia(p);
} }
@ -129,7 +129,6 @@ ScalarType _VolumePreservingError(PosType &pos,CoordType &new_point,int nsteps)
{ {
VertexType *ve0=(pos.T()->V(Tetra::VofE(pos.E(),0))); VertexType *ve0=(pos.T()->V(Tetra::VofE(pos.E(),0)));
VertexType *ve1=(pos.T()->V(Tetra::VofE(pos.E(),1))); VertexType *ve1=(pos.T()->V(Tetra::VofE(pos.E(),1)));
vrem =ve0;
bool ext_v0=ve0->IsB(); bool ext_v0=ve0->IsB();
bool ext_v1=ve1->IsB(); bool ext_v1=ve1->IsB();
@ -167,11 +166,10 @@ ScalarType _VolumePreservingError(PosType &pos,CoordType &new_point,int nsteps)
public: public:
virtual const char *Info(TETRA_MESH_TYPE &m) {
virtual const char *Info(TetraMeshType &m) {
static char buf[60]; static char buf[60];
sprintf(buf,"collapse %i -> %i %f\n", pos.V()-&m.vert[0], pos.VFlip()-&m.vert[0],_priority); //sprintf(buf,"collapse %i -> %i %f\n", pos.()-&m.vert[0], pos.VFlip()-&m.vert[0],_priority);
return buf; return buf;
} }
@ -182,52 +180,59 @@ public:
ScalarType ComputeError() ScalarType ComputeError()
{ {
_EC.FindSets(pos); vrem=(pos.T()->V(Tetra::VofE(pos.E(),0)));
return (_VolumePreservingError(pos,_NewPoint,5));// magic number....parametrize! return (_VolumePreservingError(pos,_NewPoint,5));// magic number....parametrize!
} }
int Execute() void Execute(TETRA_MESH_TYPE &tm)
{ {
_EC.FindSets(pos); // _EC.FindSets(pos);
return -_EC.DoCollapse(pos,_NewPoint); assert(!vrem->IsD());
int del=_EC.DoCollapse(pos,_NewPoint);
tm.tn-=del;
tm.vn-=1;
} }
void UpdateHeap(typename LocalOptimization<TETRA_MESH_TYPE>::HeapType & h_ret)
void UpdateHeap(typename LocalOptimization<TetraMeshType>::HeapType & h_ret)
{ {
assert(!vrem->IsD()); assert(!vrem->IsD());
_Imark()++; _Imark()++;
VTIterator<FaceType> VTi(vrem->VTb(),vrem->VTi()); VTIterator<TetraType> VTi(vrem->VTb(),vrem->VTi());
while (!VTi.End()) while (!VTi.End())
{ {
VTi.Vt()->ComputeVolume(); VTi.Vt()->ComputeVolume();
for (int j=0;j<6;j++) for (int j=0;j<6;j++)
{ {
vcg::tri::Pos<FaceType> p=Pos<FaceType>(VTi.Vt(),Tetra::FofE(j,0),j,Tetra::VofE(j,0)); vcg::tetra::Pos<TetraType> p=Pos<TetraType>(VTi.Vt(),Tetra::FofE(j,0),j,Tetra::VofE(j,0));
h_ret.push_back(HeapElem(new TriEdgeCollapser<TriMeshType>(p,_Imark()))); assert(!p.T()->V(p.V())->IsD());
std::push_heap(h_ret.begin(),h_ret.end()); assert(!p.T()->IsD());
// update the mark of the vertices h_ret.push_back(HeapElem(new TetraEdgeCollapse<TETRA_MESH_TYPE>(p,_Imark())));
VTi.Vt()->V(Tetra::VofE(j,0))->IMark() = _Imark(); std::push_heap(h_ret.begin(),h_ret.end());
// update the mark of the vertices
VTi.Vt()->V(Tetra::VofE(j,0))->IMark() = _Imark();
} }
VTi++; ++VTi;
} }
} }
ModifierType IsOfType(){ return TetraEdgeCollapser;} /// return the type of operation
ModifierType IsOfType(){ return TetraEdgeCollapseOp;}
bool IsFeasible(){ bool IsFeasible(){
vcg::tri::EdgeCollapse<TriMeshType>::Reset(); vcg::tetra::EdgeCollapse<TETRA_MESH_TYPE>::Reset();
_EC.FindSets(pos); _EC.FindSets(pos);
return(_EC.CheckPreconditions(pos,_NewPoint)); ComputeError();
} return(_EC.CheckPreconditions(pos,_NewPoint));
}
bool IsUpToDate(){ bool IsUpToDate(){
if (!pos.T()->IsD()) if (!pos.T()->IsD())
{ {
VertexType *v0=pos.T()->V(Tetra::VofE(pos.E(),0)); VertexType *v0=pos.T()->V(Tetra::VofE(pos.E(),0));
VertexType *v1=pos.T()->V(Tetra::VofE(pos.E(),1)); VertexType *v1=pos.T()->V(Tetra::VofE(pos.E(),1));
assert(!v0->IsD());
assert(!v1->IsD());
if(! (( (!v0->IsD()) && (!v1->IsD())) && if(! (( (!v0->IsD()) && (!v1->IsD())) &&
_Imark()>=v0->IMark() && _Imark()>=v0->IMark() &&
_Imark()>=v1->IMark())) _Imark()>=v1->IMark()))
@ -242,13 +247,14 @@ public:
return false; return false;
} }
virtual ScalarType Priority(){ virtual ScalarType Priority() const {
return _priority; return _priority;
} }
virtual void Init(TetraMeshType &m,typename LocalOptimization<TetraMeshType>::HeapType& h_ret){ /// perform initialization
static void Init(TETRA_MESH_TYPE &m,typename LocalOptimization<TETRA_MESH_TYPE>::HeapType& h_ret){
h_ret.clear(); h_ret.clear();
TetraMeshType::TetraIterator ti; typename TETRA_MESH_TYPE::TetraIterator ti;
int j; int j;
for(ti = m.tetra.begin(); ti != m.tetra.end();++ti) for(ti = m.tetra.begin(); ti != m.tetra.end();++ti)
if(!(*ti).IsD()){ if(!(*ti).IsD()){
@ -256,7 +262,9 @@ public:
for (int j=0;j<6;j++) for (int j=0;j<6;j++)
{ {
PosType p=PosType(&*ti,Tetra::FofE(j,0),j,Tetra::VofE(j,0)); PosType p=PosType(&*ti,Tetra::FofE(j,0),j,Tetra::VofE(j,0));
h_ret.push_back(HeapElem(new TriEdgeCollapser<TetraMeshType>(p,m.IMark))); assert(!p.T()->V(p.V())->IsD());
assert(!p.T()->IsD());
h_ret.push_back(HeapElem(new TetraEdgeCollapse<TETRA_MESH_TYPE>(p,m.IMark)));
} }
} }
} }
@ -264,4 +272,4 @@ public:
}; };
}//end namespace tetra }//end namespace tetra
}//end namespace vcg }//end namespace vcg
#endif #endif

View File

@ -44,17 +44,17 @@ class EdgeCollapse
{ {
public: public:
/// The tetrahedral mesh type /// The tetrahedral mesh type
typedef typename TETRA_MESH_TYPE TetraMeshType; typedef TETRA_MESH_TYPE TetraMeshType;
/// The tetrahedron type /// The tetrahedron type
typedef typename TetraMeshType::TetraType TetraType; typedef typename TetraMeshType::TetraType TetraType;
/// The vertex type /// The vertex type
typedef typename TetraType::VertexType VertexType; typedef typename TetraType::VertexType VertexType;
/// The vertex iterator type /// The vertex iterator type
typedef typename TetraMeshType::VertexIterator VertexIterator; typedef typename TetraMeshType::VertexIterator VertexIterator;
/// The tetra iterator type /// The tetra iterator type
typedef typename TetraMeshType::TetraIterator TetraIterator; typedef typename TetraMeshType::TetraIterator TetraIterator;
/// The coordinate type /// The coordinate type
typedef typename TetraType::VertexType::CoordType CoordType; typedef typename TetraType::VertexType::CoordType CoordType;
/// The scalar type /// The scalar type
typedef typename TetraMeshType::VertexType::ScalarType ScalarType; typedef typename TetraMeshType::VertexType::ScalarType ScalarType;
///the container of tetrahedron type ///the container of tetrahedron type
@ -66,9 +66,9 @@ class EdgeCollapse
/// The HEdgePos Loop type /// The HEdgePos Loop type
typedef PosLoop<TetraType> PosLType; typedef PosLoop<TetraType> PosLType;
/// The topology updater type /// The topology updater type
typedef vcg::tetra::UpdateTetraTopology<VertexContainer,TetraContainer> Topology; typedef typename vcg::tetra::UpdateTetraTopology<VertexContainer,TetraContainer> Topology;
///the normal updater type ///the normal updater type
typedef vcg::tetra::UpdateNormals<TetraMeshType> UpdateNormals; typedef typename vcg::tetra::UpdateNormals<TetraMeshType> UpdateNormals;
/// Default Constructor /// Default Constructor
@ -81,6 +81,7 @@ class EdgeCollapse
}; };
private: private:
typedef pair <int,int> FacePair; typedef pair <int,int> FacePair;
struct Face struct Face
{ {
@ -277,7 +278,7 @@ static int _Collapse(PosType p,CoordType NewP)
//now I cycle on the tetrahedron that had the old vertex //now I cycle on the tetrahedron that had the old vertex
//reassegning the new one. //reassegning the new one.
VTIterator< TetraType> VTi(Vdel->VTb(),Vdel->VTi()); VTIterator<TetraType> VTi(Vdel->VTb(),Vdel->VTi());
while (!VTi.End()) while (!VTi.End())
{ {
TetraType *T_Change=VTi.Vt(); TetraType *T_Change=VTi.Vt();
@ -307,7 +308,7 @@ static int _Collapse(PosType p,CoordType NewP)
static void orMarkE(Edge E,char M) static void orMarkE(Edge E,char M)
{ {
map<Edge,char>::iterator EI; typename map<Edge,char>::iterator EI;
EI=_EdgeMark().find(E); EI=_EdgeMark().find(E);
if (EI==_EdgeMark().end()) if (EI==_EdgeMark().end())
_EdgeMark().insert (pair<Edge,char>(E,M)); _EdgeMark().insert (pair<Edge,char>(E,M));
@ -317,7 +318,7 @@ static void orMarkE(Edge E,char M)
static bool isMarkedE(Edge E,char M) static bool isMarkedE(Edge E,char M)
{ {
map<Edge,char>::iterator EI; typename map<Edge,char>::iterator EI;
EI=_EdgeMark().find(E); EI=_EdgeMark().find(E);
if (EI==_EdgeMark().end()) if (EI==_EdgeMark().end())
return false; return false;
@ -326,7 +327,7 @@ static bool isMarkedE(Edge E,char M)
static void orMarkF(Face F,char M) static void orMarkF(Face F,char M)
{ {
map<Face,char>::iterator FI; typename map< Face,char>::iterator FI;
FI=_FaceMark().find(F); FI=_FaceMark().find(F);
if (FI==_FaceMark().end()) if (FI==_FaceMark().end())
_FaceMark().insert (pair<Face,char>(F,M)); _FaceMark().insert (pair<Face,char>(F,M));
@ -336,7 +337,7 @@ static void orMarkF(Face F,char M)
static bool isMarkedF(Face F,char M) static bool isMarkedF(Face F,char M)
{ {
map<Face,char>::iterator FI; typename map<Face,char>::iterator FI;
FI=_FaceMark().find(F); FI=_FaceMark().find(F);
if (FI==_FaceMark().end()) if (FI==_FaceMark().end())
return false; return false;
@ -740,7 +741,7 @@ static bool _FlipCondition(PosType pos,CoordType NewP)
static void _InitTetrahedronValues(VertexType* v) static void _InitTetrahedronValues(VertexType* v)
{ {
VTIterator<TetraType> VTi=VTIterator<TetraType>(v->VTb(),v->VTi()); VTIterator<TetraType> VTi= VTIterator<TetraType>(v->VTb(),v->VTi());
while (!VTi.End()) while (!VTi.End())
{ {
if (TetraType::HasTetraQuality()) if (TetraType::HasTetraQuality())
@ -753,7 +754,7 @@ static void _InitTetrahedronValues(VertexType* v)
VTi.Vt()->ComputeNormal(); VTi.Vt()->ComputeNormal();
} }
VTi++; ++VTi;
} }
VTi.Vt()=v->VTb(); VTi.Vt()=v->VTb();
@ -787,7 +788,8 @@ static void Reset(){
///that share the adge to collapse ///that share the adge to collapse
static ScalarType AspectRatioCollapsed(PosType p) static ScalarType AspectRatioCollapsed(PosType p)
{ {
PosL pos=PosL(p.T(),p.F(),p.E(),p.V()); //PosL pos=PosL(p.T(),p.F(),p.E(),p.V());
PosLoop<TetraType> pos=PosLoop<TetraType>(p.T(),p.F(),p.E(),p.V());
pos.Reset(); pos.Reset();
int num=0; int num=0;
ScalarType ratio_media=0.f; ScalarType ratio_media=0.f;
@ -805,8 +807,8 @@ static ScalarType AspectRatioCollapsed(PosType p)
///check the topologycal preserving conditions for the collapse indicated by pos ///check the topologycal preserving conditions for the collapse indicated by pos
static bool CheckPreconditions(PosType pos,CoordType NewP) static bool CheckPreconditions(PosType pos,CoordType NewP)
{ {
VertexType *v0=pos.T()->V(Tetra::VofE(pos.E(),0)); VertexType *v0=pos.T()->V(Tetra::VofE(pos.E(),0));
VertexType *v1=pos.T()->V(Tetra::VofE(pos.E(),1)); VertexType *v1=pos.T()->V(Tetra::VofE(pos.E(),1));
//if the two vertices are of border and the edge is not a border edge //if the two vertices are of border and the edge is not a border edge
//we can do it. //we can do it.
bool border0=v0->IsB(); bool border0=v0->IsB();
@ -851,7 +853,7 @@ static ScalarType VolumeOriginal()
} }
///Calculate the volume on the vertex resulting after collapse... ///Calculate the volume on the vertex resulting after collapse...
static ScalarType VolumeSimulateCollapse(PosType Pos,CoordType newP) static ScalarType VolumeSimulateCollapse(PosType Pos,CoordType &newP)
{ {
VertexType *Vrem=(Pos.T()->V(Tetra::VofE(Pos.E(),0))); VertexType *Vrem=(Pos.T()->V(Tetra::VofE(Pos.E(),0)));
VertexType *Vdel=(Pos.T()->V(Tetra::VofE(Pos.E(),1))); VertexType *Vdel=(Pos.T()->V(Tetra::VofE(Pos.E(),1)));
@ -875,10 +877,10 @@ static ScalarType VolumeSimulateCollapse(PosType Pos,CoordType newP)
T.P2(0)=(*ti)->V(2)->cP(); T.P2(0)=(*ti)->V(2)->cP();
T.P3(0)=(*ti)->V(3)->cP(); T.P3(0)=(*ti)->V(3)->cP();
vol+=T.ComputeVolume(); */ vol+=T.ComputeVolume(); */
// vol+= vcg::ComputeVolume<TetraType>(*((Tetra3<ScalarType>*)&*ti)); // vol+= vcg::ComputeVolume<TetraType>(*((Tetra3<ScalarType>*)&*ti));
vol+= vcg::ComputeVolume(**ti); vol+= vcg::ComputeVolume(**ti);
ti++; ti++;
} }
Vrem->P()=oldpos; Vrem->P()=oldpos;
@ -917,7 +919,7 @@ static void FindSets(vcg::tetra::Pos<TetraType> pos)
//set of union minus intersection //set of union minus intersection
if ((vf0.Vt()->V(0)!=ve1)&&(vf0.Vt()->V(1)!=ve1)&&(vf0.Vt()->V(2)!=ve1)&&(vf0.Vt()->V(3)!=ve1)) if ((vf0.Vt()->V(0)!=ve1)&&(vf0.Vt()->V(1)!=ve1)&&(vf0.Vt()->V(2)!=ve1)&&(vf0.Vt()->V(3)!=ve1))
_Sets().no_E.push_back(vf0.Vt()); _Sets().no_E.push_back(vf0.Vt());
vf0++; ++vf0;
} }
//second vertex iteration //second vertex iteration
@ -934,7 +936,7 @@ static void FindSets(vcg::tetra::Pos<TetraType> pos)
//set of union minus intersection //set of union minus intersection
if ((vf0.Vt()->V(0)!=ve0)&&(vf0.Vt()->V(1)!=ve0)&&(vf0.Vt()->V(2)!=ve0)&&(vf0.Vt()->V(3)!=ve0)) if ((vf0.Vt()->V(0)!=ve0)&&(vf0.Vt()->V(1)!=ve0)&&(vf0.Vt()->V(2)!=ve0)&&(vf0.Vt()->V(3)!=ve0))
_Sets().no_E.push_back(vf0.Vt()); _Sets().no_E.push_back(vf0.Vt());
vf0++; ++vf0;
} }
//erase duplicated tetrahedrons from the union set //erase duplicated tetrahedrons from the union set
@ -959,13 +961,13 @@ static int DoCollapse(PosType p,CoordType newP)
{ {
VertexType *v=p.T()->V(p.V()); VertexType *v=p.T()->V(p.V());
assert(p.T()->HasVTAdjacency()); assert(p.T()->HasVTAdjacency());
int n_deleted = _Collapse(p,newP); int n_del=_Collapse(p,newP);
_InitTetrahedronValues(v); _InitTetrahedronValues(v);
return n_deleted; return n_del;
} }
}; };
}//end namespace }//end namespace
}//end namespace }//end namespace
#endif #endif

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.6 2004/06/25 11:25:07 pietroni
changrd update for a vertex normal functions void PerVertex(VertexType *v)
Revision 1.5 2004/06/15 16:01:26 pietroni Revision 1.5 2004/06/15 16:01:26 pietroni
added functions to update local vertices normal added functions to update local vertices normal
@ -74,6 +77,7 @@ typedef typename TetraMeshType::VertexIterator VertexIterator;
typedef typename TetraMeshType::TetraType TetraType; typedef typename TetraMeshType::TetraType TetraType;
typedef typename TetraMeshType::TetraPointer TetraPointer; typedef typename TetraMeshType::TetraPointer TetraPointer;
typedef typename TetraMeshType::TetraIterator TetraIterator; typedef typename TetraMeshType::TetraIterator TetraIterator;
typedef typename VertexType::NormalType NormalType;
typedef vcg::Face<VertexType,vcg::DUMMYEDGETYPE,vcg::DUMMYFACETYPE> FaceTemp; typedef vcg::Face<VertexType,vcg::DUMMYEDGETYPE,vcg::DUMMYFACETYPE> FaceTemp;
typedef vcg::tri::TriMesh< std::vector<VertexType>,std::vector<FaceTemp> > TriMeshTemp; typedef vcg::tri::TriMesh< std::vector<VertexType>,std::vector<FaceTemp> > TriMeshTemp;
@ -91,10 +95,10 @@ static void PerTetraFace(TetraMeshType &m)
static void PerVertex(VertexType *v) static void PerVertex(VertexType *v)
{ {
if( !VertexType::HasNormal()) return; if( !VertexType::HasNormal()) return;
VTIterator<TetraType> VTi=VTIterator<TetraType>(v->VTb(),v->VTi()); VTIterator<TetraType> VTi=VTIterator<TetraType>(v->VTb(),v->VTi());
VertexType::NormalType Norm=VertexType::NormalType(0,0,0); NormalType Norm=NormalType(0,0,0);
int iter=0; int iter=0;
while (!VTi.End()) while (!VTi.End())
{ {
@ -109,7 +113,7 @@ static void PerVertex(VertexType *v)
Norm+=VTi.Vt()->N(f); Norm+=VTi.Vt()->N(f);
} }
} }
VTi++; ++VTi;
} }
Norm/=iter; Norm/=iter;
v->N()=Norm.Normalize(); v->N()=Norm.Normalize();

View File

@ -259,7 +259,7 @@ static void DetachVTTopology(VertexType *v,TetraType *t)
{ {
lastz=Et.Vi(); lastz=Et.Vi();
lastt=Et.Vt(); lastt=Et.Vt();
Et++; ++Et;
} }
//in the list of the vertex v must be present the //in the list of the vertex v must be present the
//tetrahedron that you want to detach //tetrahedron that you want to detach
@ -270,7 +270,7 @@ static void DetachVTTopology(VertexType *v,TetraType *t)
} }
///insert the tetrahedron t in VT topology for vertex v of index z ///insert the tetrahedron t in VT topology for vertex v of index z
static void InsertVTTopology(VertexType *v,int z,TetraType *t) static void InsertVTTopology(VertexType *v,int z, TetraType *t)
{ {
if( ! (*t).IsD()) if( ! (*t).IsD())
{ {
@ -283,7 +283,7 @@ static void InsertVTTopology(VertexType *v,int z,TetraType *t)
///insert the tetrahedron t in VT topology for all his vertices ///insert the tetrahedron t in VT topology for all his vertices
static void InsertVTTopology(TetraType *t) static void InsertVTTopology( TetraType *t)
{ {
assert(!t->IsD()); assert(!t->IsD());
int k=0; int k=0;
@ -339,27 +339,27 @@ static void TTTopology(VertexContainer &vert,TetraContainer &tetra)
(*ti).TTp(2)=(&(*ti)); (*ti).TTp(2)=(&(*ti));
(*ti).TTp(3)=(&(*ti)); (*ti).TTp(3)=(&(*ti));
v0=(*ti).V(Tetra3<double>::VofF(0,0)); v0=(*ti).V(Tetra::VofF(0,0));
v1=(*ti).V(Tetra3<double>::VofF(0,1)); v1=(*ti).V(Tetra::VofF(0,1));
v2=(*ti).V(Tetra3<double>::VofF(0,2)); v2=(*ti).V(Tetra::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(Tetra3<double>::VofF(1,0)); v0=(*ti).V(Tetra::VofF(1,0));
v1=(*ti).V(Tetra3<double>::VofF(1,1)); v1=(*ti).V(Tetra::VofF(1,1));
v2=(*ti).V(Tetra3<double>::VofF(1,2)); v2=(*ti).V(Tetra::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(Tetra3<double>::VofF(2,0)); v0=(*ti).V(Tetra::VofF(2,0));
v1=(*ti).V(Tetra3<double>::VofF(2,1)); v1=(*ti).V(Tetra::VofF(2,1));
v2=(*ti).V(Tetra3<double>::VofF(2,2)); v2=(*ti).V(Tetra::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(Tetra3<double>::VofF(3,0)); v0=(*ti).V(Tetra::VofF(3,0));
v1=(*ti).V(Tetra3<double>::VofF(3,1)); v1=(*ti).V(Tetra::VofF(3,1));
v2=(*ti).V(Tetra3<double>::VofF(3,2)); v2=(*ti).V(Tetra::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));
} }
@ -415,17 +415,17 @@ static void TestTTTopology(VertexContainer &vert,TetraContainer &tetra)
{ {
assert( ((((*ti).TTp(i))->TTp((*ti).TTi(i)))==&(*ti))); assert( ((((*ti).TTp(i))->TTp((*ti).TTi(i)))==&(*ti)));
VertexType *v0=(*ti).V(Tetra3<double>::VofF(i,0)); VertexType *v0=(*ti).V(Tetra::VofF(i,0));
VertexType *v1=(*ti).V(Tetra3<double>::VofF(i,1)); VertexType *v1=(*ti).V(Tetra::VofF(i,1));
VertexType *v2=(*ti).V(Tetra3<double>::VofF(i,2)); VertexType *v2=(*ti).V(Tetra::VofF(i,2));
TetraType *t1=(TetraType*)(*ti).TTp(i); TetraType *t1=(TetraType*)(*ti).TTp(i);
assert (!t1->IsD()); assert (!t1->IsD());
int z1=(*ti).TTi(i); int z1=(*ti).TTi(i);
VertexType *vo0=(*t1).V(Tetra3<double>::VofF(z1,0)); VertexType *vo0=(*t1).V(Tetra::VofF(z1,0));
VertexType *vo1=(*t1).V(Tetra3<double>::VofF(z1,1)); VertexType *vo1=(*t1).V(Tetra::VofF(z1,1));
VertexType *vo2=(*t1).V(Tetra3<double>::VofF(z1,2)); VertexType *vo2=(*t1).V(Tetra::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

@ -48,9 +48,9 @@ class TriConverter
public: public:
/// The tetrahedral mesh type /// The tetrahedral mesh type
typedef typename TETRA_MESH TetraMeshType; typedef TETRA_MESH TetraMeshType;
/// The triangle mesh type /// The triangle mesh type
typedef typename TRI_MESH TriangleMeshType; typedef TRI_MESH TriangleMeshType;
/// The tetrahedron type /// The tetrahedron type
typedef typename TetraMeshType::TetraType TetraType; typedef typename TetraMeshType::TetraType TetraType;

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.11 2004/08/26 13:15:23 pietroni
added IsS() function
Revision 1.10 2004/07/09 10:13:00 ganovelli Revision 1.10 2004/07/09 10:13:00 ganovelli
C() ,Q() ,hastetracolor(),hasqualityt().... C() ,Q() ,hastetracolor(),hasqualityt()....
plus some misuse of tetra3 corrected plus some misuse of tetra3 corrected
@ -82,7 +85,7 @@ public:
/// The base type of the face /// The base type of the face
typedef TETRA_TYPE BaseTetraType; typedef TETRA_TYPE BaseTetraType;
/// The vertex type /// The vertex type
typedef typename VTYPE VertexType; typedef VTYPE VertexType;
/// The coordinate type used to represent the point (i.e. Point3f, Point3d, ...) /// The coordinate type used to represent the point (i.e. Point3f, Point3d, ...)
typedef typename VertexType::CoordType CoordType; typedef typename VertexType::CoordType CoordType;
/// The scalar type used to represent coords (i.e. float, double, ...) /// The scalar type used to represent coords (i.e. float, double, ...)

View File

@ -46,7 +46,7 @@ class VTIterator
{ {
public: public:
/// The tetrahedron type /// The tetrahedron type
typedef typename MTTYPE TetraType; typedef MTTYPE TetraType;
private: private:
/// Pointer to a tetrahedron /// Pointer to a tetrahedron
TetraType *_vt; TetraType *_vt;
@ -110,7 +110,7 @@ class Pos
public: public:
/// The tetrahedron type /// The tetrahedron type
typedef typename MTTYPE TetraType; typedef MTTYPE TetraType;
/// The vertex type /// The vertex type
typedef typename TetraType::VertexType VertexType; typedef typename TetraType::VertexType VertexType;
/// The coordinate type /// The coordinate type

View File

@ -24,6 +24,10 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.7 2004/07/09 10:08:21 ganovelli
ComputeVOlume moved outside the class and other
minor corrections
Revision 1.6 2004/06/25 18:17:03 ganovelli Revision 1.6 2004/06/25 18:17:03 ganovelli
minor changes minor changes
@ -278,8 +282,8 @@ static int FofEE(const int &indexE0,const int &indexE1)
class Tetra3:public Tetra class Tetra3:public Tetra
{ {
public: public:
typedef Point3< ScalarType > CoordType; typedef Point3< ScalarType > CoordType;
typedef ScalarType ScalarType; //typedef typename ScalarType ScalarType;
/********************************************* /*********************************************

View File

@ -9,7 +9,7 @@ namespace io {
template <typename MESHTYPE> template <typename MESHTYPE>
class ImporterTS{ class ImporterTS{
typedef typename MESHTYPE Tetramesh; typedef MESHTYPE Tetramesh;
typedef typename Tetramesh::VertexPointer VertexPointer; typedef typename Tetramesh::VertexPointer VertexPointer;
typedef typename Tetramesh::VertexType VertexType; typedef typename Tetramesh::VertexType VertexType;
typedef typename Tetramesh::TetraType FaceType; typedef typename Tetramesh::TetraType FaceType;
@ -31,7 +31,7 @@ static int Open( Tetramesh & m, const char * filename ) {
int tp3; int tp3;
float mass; float mass;
FILE *f; FILE *f;
Tetramesh::VertexType p1; typename Tetramesh::VertexType p1;
f = fopen(filename,"r"); f = fopen(filename,"r");
if(f == NULL ) if(f == NULL )
{ {
@ -62,7 +62,7 @@ static int Open( Tetramesh & m, const char * filename ) {
fscanf(f, "%i", &tp2 ); fscanf(f, "%i", &tp2 );
fscanf(f, "%i", &tp3 ); fscanf(f, "%i", &tp3 );
Tetramesh::TetraType newTetra; typename Tetramesh::TetraType newTetra;
m.tetra.push_back(newTetra); m.tetra.push_back(newTetra);
m.tetra.back().Init(&m.vert[tp0],&m.vert[tp1],&m.vert[tp2],&m.vert[tp3]); m.tetra.back().Init(&m.vert[tp0],&m.vert[tp1],&m.vert[tp2],&m.vert[tp3]);
} }
@ -76,4 +76,4 @@ static int Open( Tetramesh & m, const char * filename ) {
};// end of io };// end of io
};// end of tri };// end of tri
};// end of vcg };// end of vcg
#endif #endif