Minor changes : replaced TVp and TVi calls with VTp and VTi respectively.

This commit is contained in:
Paolo Cignoni 2007-06-07 10:20:29 +00:00
parent 080ec71ca5
commit 7c12dca79d
1 changed files with 92 additions and 103 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.17 2006/12/03 14:56:30 ganovelli
*** empty log message ***
Revision 1.16 2006/06/29 13:07:33 ganovelli Revision 1.16 2006/06/29 13:07:33 ganovelli
Aggiunta superclasse UpdateTopology templated sui container e con funzioni sui container Aggiunta superclasse UpdateTopology templated sui container e con funzioni sui container
@ -204,57 +207,42 @@ public:
**/ **/
//@{ //@{
///create the VT topology for tetrahedrons that are into containers
/// Create the VT topology for tetrahedrons that are into containers.
static void VTTopology( VertexContainer & vert, TetraContainer & tetra ) static void VTTopology( VertexContainer & vert, TetraContainer & tetra )
{ {
VertexIterator v;
TetraIterator t;
ClearVTTopology( vert, tetra ); ClearVTTopology( vert, tetra );
for( TetraIterator t = tetra.begin(); t != tetra.end(); ++t )
for(t=tetra.begin();t!=tetra.end();++t)
if( !(*t).IsD() ) if( !(*t).IsD() )
for( int j = 0; j < 4; ++j ) for( int j = 0; j < 4; ++j )
{ {
(*t).TVp(j) = (*t).V(j)->VTp(); (*t).VTp(j) = (*t).V(j)->VTp();
(*t).TVi(j) = (*t).V(j)->VTi(); (*t).VTi(j) = (*t).V(j)->VTi();
(*t).V(j)->VTp() = &(*t); (*t).V(j)->VTp() = &(*t);
(*t).V(j)->VTi() = j; (*t).V(j)->VTi() = j;
} }
} }
/// clear the Vertex-Tetra topology
/// Clear the vertex-tetra (VT) topology.
static void ClearVTTopology( VertexContainer & vert, TetraContainer & tetra ) static void ClearVTTopology( VertexContainer & vert, TetraContainer & tetra )
{ {
VertexIterator v; for( VertexIterator v = vert.begin(); v != vert.end(); ++v ) { v->VTp() = 0; v->VTi() = 0; }
for(v=vert.begin();v!=vert.end();++v) for( TetraIterator t = tetra.begin(); t != tetra.end(); ++t )
{
v->VTp() = 0;
v->VTi() = 0;
}
TetraIterator t;
for(t=tetra.begin();t!=tetra.end();++t)
if( ! (*t).IsD() ) if( ! (*t).IsD() )
for(int j=0;j<4;++j) for( int j = 0; j < 4; ++j ) { (*t).VTp(j) = 0; (*t).VTi(j) = 0; }
{
(*t).TVp(j) = 0;
(*t).TVi(j) = 0;
}
} }
///erase one tetrahedron from VTTopology of all his vertices
/// Erase one tetrahedron from VTTopology of all his vertices.
static void DetachVTTopology( TetraType *t ) static void DetachVTTopology( TetraType *t )
{ {
int i;
if( ! (*t).IsD() ) if( ! (*t).IsD() )
for(i=0;i<4;i++) for( int i = 0; i < 4; i++ ) DetachVTTopology( t->V(i), t );
DetachVTTopology(t->V(i),t);
} }
///erase one tetrahedron from VTTopology of one specified vertex
/// Erase one tetrahedron from VTTopology of one specified vertex.
static void DetachVTTopology( VertexType *v, TetraType *t ) static void DetachVTTopology( VertexType *v, TetraType *t )
{ {
TetraType *lastt; TetraType *lastt;
@ -262,8 +250,8 @@ static void DetachVTTopology(VertexType *v,TetraType *t)
VTIterator<TetraType> Et( v->VTb(), v->VTi() ); VTIterator<TetraType> Et( v->VTb(), v->VTi() );
if( Et.Vt() == t ) if( Et.Vt() == t )
{ {
v->VTb()=(TetraType *)t->TVp(v->VTi()); v->VTb() = (TetraType *) t->VTp( v->VTi() );
v->VTi()=t->TVi(v->VTi()); v->VTi() = t->VTi( v->VTi() );
} }
else else
{ {
@ -274,40 +262,40 @@ static void DetachVTTopology(VertexType *v,TetraType *t)
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
assert( Et.Vt() != NULL ); assert( Et.Vt() != NULL );
lastt->TVp(lastz)=Et.Vt()->TVp(Et.Vi()); lastt->VTp(lastz) = Et.Vt()->VTp( Et.Vi() );
lastt->TVi(lastz)=Et.Vt()->TVi(Et.Vi()); lastt->VTi(lastz) = Et.Vt()->VTi( Et.Vi() );
} }
} }
///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() )
{ {
t->TVp(z) = v->VTb(); t->VTp(z) = v->VTb();
t->TVi(z) = v->VTi(); t->VTi(z) = v->VTi();
v->VTb() = &(*t); v->VTb() = &(*t);
v->VTi() = z; v->VTi() = z;
} }
} }
///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; for( int k = 0; k < 4; k++ )
for (k=0;k<4;k++)
{ {
assert(!t->V(k)->IsD()); assert( !( t->V(k)->IsD() ) );
InsertVTTopology( t->V(k), k, t ); InsertVTTopology( t->V(k), k, t );
} }
} }
///Test the Tetrahedron-Tetrahedron Topology (by Face)
/// Test the Tetrahedron-Tetrahedron (TT) topology (by face).
static void TestVTTopology( VertexContainer & vert, TetraContainer & tetra ) static void TestVTTopology( VertexContainer & vert, TetraContainer & tetra )
{ {
int i; int i;
@ -321,12 +309,13 @@ static void TestVTTopology(VertexContainer &vert,TetraContainer &tetra)
{ {
assert( ( nextT->V(nextI) == &(*vi) ) ); assert( ( nextT->V(nextI) == &(*vi) ) );
oldI = nextI; oldI = nextI;
nextI=nextT->TVi(nextI); nextI = nextT->VTi(nextI);
nextT=nextT->TVp(oldI); nextT = nextT->VTp(oldI);
} }
} }
} }
/*@}*/ /*@}*/
/***********************************************/ /***********************************************/
/** @Tetrahedron-Tetrahedron Topology Funtions /** @Tetrahedron-Tetrahedron Topology Funtions