cleaned up a lot of typename gcc compilation issues

This commit is contained in:
Paolo Cignoni 2008-12-02 10:04:16 +00:00
parent 928c8dd997
commit cca3b3ad5f
1 changed files with 49 additions and 45 deletions

View File

@ -61,9 +61,14 @@ class Geo{
public: public:
typedef typename MeshType::VertexType VertexType;
typedef typename MeshType::VertexIterator VertexIterator;
typedef typename MeshType::VertexPointer VertexPointer; typedef typename MeshType::VertexPointer VertexPointer;
typedef typename MeshType::FaceType FaceType;
typedef typename MeshType::CoordType CoordType;
typedef typename MeshType::ScalarType ScalarType; typedef typename MeshType::ScalarType ScalarType;
/* Auxiliary class for keeping the heap of vertices to visit and their estimated distance /* Auxiliary class for keeping the heap of vertices to visit and their estimated distance
*/ */
struct VertDist{ struct VertDist{
@ -76,7 +81,6 @@ class Geo{
/* Temporary data to associate to all the vertices: estimated distance and boolean flag /* Temporary data to associate to all the vertices: estimated distance and boolean flag
*/ */
template <class MeshType>
struct TempData{ struct TempData{
TempData(){} TempData(){}
TempData(const ScalarType & d_){d=d_;visited=false;} TempData(const ScalarType & d_){d=d_;visited=false;}
@ -84,7 +88,7 @@ class Geo{
bool visited; bool visited;
}; };
typedef SimpleTempData<std::vector<typename MeshType::VertexType>, TempData<MeshType> > TempDataType; typedef SimpleTempData<std::vector<VertexType>, TempData > TempDataType;
//TempDataType * TD; //TempDataType * TD;
@ -97,16 +101,16 @@ class Geo{
//************** calcolo della distanza di pw in base alle distanze note di pw1 e curr //************** calcolo della distanza di pw in base alle distanze note di pw1 e curr
//************** sapendo che (curr,pw,pw1) e'una faccia della mesh //************** sapendo che (curr,pw,pw1) e'una faccia della mesh
//************** (vedi figura in file distance.gif) //************** (vedi figura in file distance.gif)
static typename MeshType::ScalarType Distance(const typename MeshType::VertexPointer &pw, static ScalarType Distance(const VertexPointer &pw,
const typename MeshType::VertexPointer &pw1, const VertexPointer &pw1,
const typename MeshType::VertexPointer &curr, const VertexPointer &curr,
const typename MeshType::ScalarType &d_pw1, const ScalarType &d_pw1,
const typename MeshType::ScalarType &d_curr) const ScalarType &d_curr)
{ {
MeshType::ScalarType curr_d=0; ScalarType curr_d=0;
Point3<MeshType::ScalarType> w_c = pw->cP()- curr->cP(); CoordType w_c = pw->cP()- curr->cP();
Point3<MeshType::ScalarType> w_w1 = pw->cP()- pw1->cP(); CoordType w_w1 = pw->cP()- pw1->cP();
Point3<MeshType::ScalarType> w1_c = pw1->cP()- curr->cP(); CoordType w1_c = pw1->cP()- curr->cP();
ScalarType ew_c = (w_c).Norm(); ScalarType ew_c = (w_c).Norm();
ScalarType ew_w1 = (w_w1).Norm(); ScalarType ew_w1 = (w_w1).Norm();
@ -145,7 +149,7 @@ class Geo{
This is function is not meant to be called (although is not prevented). Instead, it is invoked by This is function is not meant to be called (although is not prevented). Instead, it is invoked by
wrapping function. wrapping function.
*/ */
static typename MeshType::VertexPointer Visit( static VertexPointer Visit(
MeshType & m, MeshType & m,
std::vector<VertDist> & _frontier, std::vector<VertDist> & _frontier,
ScalarType & max_distance, ScalarType & max_distance,
@ -154,15 +158,15 @@ class Geo{
{ {
bool isLeaf,toQueue; bool isLeaf,toQueue;
std::vector<VertDist> frontier; std::vector<VertDist> frontier;
MeshType::VertexIterator ii; VertexIterator ii;
std::list<typename MeshType::VertexPointer> children; std::list<VertexPointer> children;
typename MeshType::VertexPointer curr,farthest,pw1; VertexPointer curr,farthest,pw1;
std::list<typename MeshType::VertexPointer>::iterator is; typename std::list<VertexPointer>::iterator is;
std::deque<typename MeshType::VertexPointer> leaves; std::deque<VertexPointer> leaves;
std::vector <std::pair<typename MeshType::VertexPointer,typename MeshType::ScalarType> > expansion; std::vector <std::pair<VertexPointer,ScalarType> > expansion;
std::vector <VertDist >::iterator ifr; typename std::vector <VertDist >::iterator ifr;
face::VFIterator<typename MeshType::FaceType> x;int k; face::VFIterator<FaceType> x;int k;
typename MeshType::VertexPointer pw; VertexPointer pw;
//Requirements //Requirements
assert(m.HasVFTopology()); assert(m.HasVFTopology());
@ -197,7 +201,7 @@ class Geo{
make_heap(frontier.begin(),frontier.end(),pred()); make_heap(frontier.begin(),frontier.end(),pred());
ScalarType curr_d,d_curr = 0.0; ScalarType curr_d,d_curr = 0.0;
max_distance=0.0; max_distance=0.0;
std::vector<VertDist >:: iterator iv; typename std::vector<VertDist >:: iterator iv;
while(!frontier.empty()) while(!frontier.empty())
{ //printf("size: %d\n", frontier.size()); { //printf("size: %d\n", frontier.size());
@ -211,7 +215,7 @@ class Geo{
isLeaf = (!fartestOnBorder || curr->IsB()); isLeaf = (!fartestOnBorder || curr->IsB());
face::VFIterator<typename MeshType::FaceType> x;int k; face::VFIterator<FaceType> x;int k;
for( x.f = curr->VFp(), x.z = curr->VFi(); x.f!=0; ++x ) for( x.f = curr->VFp(), x.z = curr->VFi(); x.f!=0; ++x )
@ -232,7 +236,7 @@ class Geo{
{ {
if( (*TD)[pw].d == -1){ if( (*TD)[pw].d == -1){
curr_d = (*TD)[curr].d + (pw->P()-curr->P()).Norm(); curr_d = (*TD)[curr].d + (pw->P()-curr->P()).Norm();
expansion.push_back(std::pair<typename MeshType::VertexPointer,typename MeshType::ScalarType>(pw,curr_d)); expansion.push_back(std::pair<VertexPointer,ScalarType>(pw,curr_d));
} }
continue; continue;
} }
@ -282,7 +286,7 @@ class Geo{
toQueue = ( (*TD)[(pw)].d==-1); toQueue = ( (*TD)[(pw)].d==-1);
if(toQueue){// se non e'gia' in coda ce lo mette if(toQueue){// se non e'gia' in coda ce lo mette
expansion.push_back(std::pair<typename MeshType::VertexPointer,typename MeshType::ScalarType>(pw,curr_d)); expansion.push_back(std::pair<VertexPointer,ScalarType>(pw,curr_d));
}else }else
{ {
if( (*TD)[(pw)].d > curr_d ) if( (*TD)[(pw)].d > curr_d )
@ -298,7 +302,7 @@ class Geo{
} }
std::vector <std::pair<typename MeshType::VertexPointer,typename MeshType::ScalarType> > ::iterator i; typename std::vector <std::pair<VertexPointer,ScalarType> > ::iterator i;
for(i = expansion.begin(); i!= expansion.end(); ++i) for(i = expansion.begin(); i!= expansion.end(); ++i)
{ {
(*TD)[(*i).first].d = (*i).second; (*TD)[(*i).first].d = (*i).second;
@ -308,7 +312,7 @@ class Geo{
}// end while }// end while
// scrivi le distanze sul campo qualita' (nn: farlo parametrico) // scrivi le distanze sul campo qualita' (nn: farlo parametrico)
MeshType::VertexIterator vi; VertexIterator vi;
for(vi = m.vert.begin(); vi != m.vert.end(); ++vi) for(vi = m.vert.begin(); vi != m.vert.end(); ++vi)
(*vi).Q() = (*TD)[&(*vi)].d; (*vi).Q() = (*TD)[&(*vi)].d;
@ -329,11 +333,11 @@ public:
Note: update the field Q() of the vertices Note: update the field Q() of the vertices
*/ */
static void FartestVertex( MeshType & m, static void FartestVertex( MeshType & m,
std::vector<typename MeshType::VertexPointer> & fro, std::vector<VertexPointer> & fro,
typename MeshType::VertexPointer & farthest, VertexPointer & farthest,
ScalarType & distance){ ScalarType & distance){
std::vector<typename MeshType::VertexPointer>::iterator fi; typename std::vector<VertexPointer>::iterator fi;
std::vector<VertDist>fr; std::vector<VertDist>fr;
for( fi = fro.begin(); fi != fro.end() ; ++fi) for( fi = fro.begin(); fi != fro.end() ; ++fi)
@ -346,12 +350,12 @@ public:
Note: update the field Q() of the vertices Note: update the field Q() of the vertices
*/ */
static void FartestVertex( MeshType & m, static void FartestVertex( MeshType & m,
typename MeshType::VertexPointer seed, VertexPointer seed,
typename MeshType::VertexPointer & farthest, VertexPointer & farthest,
ScalarType & distance){ ScalarType & distance){
std::vector<typename MeshType::VertexPointer> fro; std::vector<VertexPointer> fro;
fro.push_back( seed ); fro.push_back( seed );
typename MeshType::VertexPointer v0; VertexPointer v0;
FartestVertex(m,fro,v0,distance); FartestVertex(m,fro,v0,distance);
farthest = v0; farthest = v0;
} }
@ -361,11 +365,11 @@ public:
Note: update the field Q() of the vertices Note: update the field Q() of the vertices
*/ */
static void FartestBVertex(MeshType & m, static void FartestBVertex(MeshType & m,
std::vector<typename MeshType::VertexPointer> & fro, std::vector<VertexPointer> & fro,
typename MeshType::VertexPointer & farthest, VertexPointer & farthest,
ScalarType & distance){ ScalarType & distance){
std::vector<typename MeshType::VertexPointer>::iterator fi; typename std::vector<VertexPointer>::iterator fi;
std::vector<VertDist>fr; std::vector<VertDist>fr;
for( fi = fro.begin(); fi != fro.end() ; ++fi) for( fi = fro.begin(); fi != fro.end() ; ++fi)
@ -377,12 +381,12 @@ public:
Note: update the field Q() of the vertices Note: update the field Q() of the vertices
*/ */
static void FartestBVertex( MeshType & m, static void FartestBVertex( MeshType & m,
typename MeshType::VertexPointer seed, VertexPointer seed,
typename MeshType::VertexPointer & farthest, VertexPointer & farthest,
ScalarType & distance){ ScalarType & distance){
std::vector<typename MeshType::VertexPointer> fro; std::vector<VertexPointer> fro;
fro.push_back( seed ); fro.push_back( seed );
typename MeshType::VertexPointer v0; VertexPointer v0;
FartestBVertex(m,fro,v0,distance); FartestBVertex(m,fro,v0,distance);
farthest = v0; farthest = v0;
} }
@ -392,12 +396,12 @@ public:
Note: update the field Q() of the vertices Note: update the field Q() of the vertices
*/ */
static void DistanceFromBorder( MeshType & m, static void DistanceFromBorder( MeshType & m,
typename MeshType::VertexPointer & v0, VertexPointer & v0,
ScalarType & distance ScalarType & distance
){ ){
std::vector<typename MeshType::VertexPointer> fro; std::vector<VertexPointer> fro;
MeshType::VertexIterator vi; VertexIterator vi;
MeshType::VertexPointer farthest; VertexPointer farthest;
for(vi = m.vert.begin(); vi != m.vert.end(); ++vi) for(vi = m.vert.begin(); vi != m.vert.end(); ++vi)
if( (*vi).IsB()) if( (*vi).IsB())
fro.push_back(&(*vi)); fro.push_back(&(*vi));