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
$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
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 )
{
VertexIterator v;
TetraIterator t;
ClearVTTopology( vert, tetra );
for(t=tetra.begin();t!=tetra.end();++t)
for( TetraIterator t = tetra.begin(); t != tetra.end(); ++t )
if( !(*t).IsD() )
for( int j = 0; j < 4; ++j )
{
(*t).TVp(j) = (*t).V(j)->VTp();
(*t).TVi(j) = (*t).V(j)->VTi();
(*t).VTp(j) = (*t).V(j)->VTp();
(*t).VTi(j) = (*t).V(j)->VTi();
(*t).V(j)->VTp() = &(*t);
(*t).V(j)->VTi() = j;
}
}
/// clear the Vertex-Tetra topology
/// Clear the vertex-tetra (VT) topology.
static void ClearVTTopology( VertexContainer & vert, TetraContainer & tetra )
{
VertexIterator v;
for(v=vert.begin();v!=vert.end();++v)
{
v->VTp() = 0;
v->VTi() = 0;
}
TetraIterator t;
for(t=tetra.begin();t!=tetra.end();++t)
for( VertexIterator v = vert.begin(); v != vert.end(); ++v ) { v->VTp() = 0; v->VTi() = 0; }
for( TetraIterator t = tetra.begin(); t != tetra.end(); ++t )
if( ! (*t).IsD() )
for(int j=0;j<4;++j)
{
(*t).TVp(j) = 0;
(*t).TVi(j) = 0;
}
for( int j = 0; j < 4; ++j ) { (*t).VTp(j) = 0; (*t).VTi(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 )
{
int i;
if( ! (*t).IsD() )
for(i=0;i<4;i++)
DetachVTTopology(t->V(i),t);
for( int i = 0; i < 4; i++ ) 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 )
{
TetraType *lastt;
@ -262,8 +250,8 @@ static void DetachVTTopology(VertexType *v,TetraType *t)
VTIterator<TetraType> Et( v->VTb(), v->VTi() );
if( Et.Vt() == t )
{
v->VTb()=(TetraType *)t->TVp(v->VTi());
v->VTi()=t->TVi(v->VTi());
v->VTb() = (TetraType *) t->VTp( v->VTi() );
v->VTi() = t->VTi( v->VTi() );
}
else
{
@ -274,40 +262,40 @@ static void DetachVTTopology(VertexType *v,TetraType *t)
lastt = Et.Vt();
++Et;
}
//in the list of the vertex v must be present the
//tetrahedron that you want to detach
/// In the list of the vertex v must be present the tetrahedron that you want to detach
assert( Et.Vt() != NULL );
lastt->TVp(lastz)=Et.Vt()->TVp(Et.Vi());
lastt->TVi(lastz)=Et.Vt()->TVi(Et.Vi());
lastt->VTp(lastz) = Et.Vt()->VTp( 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 )
{
if( ! (*t).IsD() )
{
t->TVp(z) = v->VTb();
t->TVi(z) = v->VTi();
t->VTp(z) = v->VTb();
t->VTi(z) = v->VTi();
v->VTb() = &(*t);
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 )
{
assert(!t->IsD());
int k=0;
for (k=0;k<4;k++)
assert( !( t->IsD() ) );
for( int k = 0; k < 4; k++ )
{
assert(!t->V(k)->IsD());
assert( !( t->V(k)->IsD() ) );
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 )
{
int i;
@ -321,12 +309,13 @@ static void TestVTTopology(VertexContainer &vert,TetraContainer &tetra)
{
assert( ( nextT->V(nextI) == &(*vi) ) );
oldI = nextI;
nextI=nextT->TVi(nextI);
nextT=nextT->TVp(oldI);
nextI = nextT->VTi(nextI);
nextT = nextT->VTp(oldI);
}
}
}
/*@}*/
/***********************************************/
/** @Tetrahedron-Tetrahedron Topology Funtions