Conformed C++ syntax to GCC requirements

This commit is contained in:
Paolo Cignoni 2004-05-12 12:23:23 +00:00
parent e826bde7c3
commit ed904aa9ac
3 changed files with 36 additions and 25 deletions

View File

@ -45,7 +45,7 @@ using namespace std;
// Vertex, Face, Mesh and Grid definitions.
class MyEdge;
class CFace;
class CVertex : public VertexCMNQ< double,MyEdge,CFace > {};
class CVertex : public VertexVCVMVNVQ< double,MyEdge,CFace > {};
class CFace : public FaceRTFMFN< CVertex,MyEdge,CFace > {};
class CMesh : public tri::TriMesh< vector<CVertex>, vector<CFace> > {};

View File

@ -70,6 +70,15 @@ private:
typedef GridStaticPtr< typename MetroMesh::FaceContainer > MetroMeshGrid;
typedef Point3<typename MetroMesh::ScalarType> Point3x;
typedef typename MetroMesh::CoordType CoordType;
typedef typename MetroMesh::ScalarType ScalarType;
typedef typename MetroMesh::VertexPointer VertexPointer;
typedef typename MetroMesh::VertexIterator VertexIterator;
typedef typename MetroMesh::FaceIterator FaceIterator;
typedef typename MetroMesh::FaceType FaceType;
// data structures
MetroMesh &S1;
MetroMesh &S2;
@ -100,7 +109,7 @@ private:
// private methods
inline double ComputeMeshArea(MetroMesh & mesh);
float AddSample(const Point3x &p);
inline void AddRandomSample(typename MetroMesh::FaceIterator &T);
inline void AddRandomSample(FaceIterator &T);
inline void SampleEdge(const Point3x & v0, const Point3x & v1, int n_samples_per_edge);
void VertexSampling();
void EdgeSampling();
@ -164,7 +173,7 @@ void Sampling<MetroMesh>::SetSamplesPerAreaUnit(double _n_samp)
template <class MetroMesh>
inline double Sampling<MetroMesh>::ComputeMeshArea(MetroMesh & mesh)
{
typename MetroMesh::FaceIterator face;
FaceIterator face;
double area = 0.0;
for(face=mesh.face.begin(); face != mesh.face.end(); face++)
@ -177,9 +186,9 @@ inline double Sampling<MetroMesh>::ComputeMeshArea(MetroMesh & mesh)
template <class MetroMesh>
float Sampling<MetroMesh>::AddSample(const Point3x &p)
{
typename MetroMesh::FaceType *f=0;
FaceType *f=0;
Point3x normf, bestq, ip;
typename MetroMesh::ScalarType dist;
ScalarType dist;
dist = dist_upper_bound;
@ -214,7 +223,7 @@ void Sampling<MetroMesh>::VertexSampling()
float error;
printf("Vertex sampling\n");
typename MetroMesh::VertexIterator vi;
VertexIterator vi;
for(vi=S1.vert.begin();vi!=S1.vert.end();++vi)
{
error = AddSample((*vi).cP());
@ -269,13 +278,13 @@ template <class MetroMesh>
void Sampling<MetroMesh>::EdgeSampling()
{
// Edge sampling.
typedef std::pair<typename MetroMesh::VertexPointer, typename MetroMesh::VertexPointer> pvv;
typedef std::pair<VertexPointer, VertexPointer> pvv;
std::vector< pvv > Edges;
printf("Edge sampling\n");
// compute edge list.
typename MetroMesh::FaceIterator fi;
FaceIterator fi;
for(fi=S1.face.begin(); fi != S1.face.end(); fi++)
for(int i=0; i<3; ++i)
{
@ -288,7 +297,7 @@ void Sampling<MetroMesh>::EdgeSampling()
Edges.resize(edgeend-Edges.begin());
// sample edges.
std::vector<pvv>::iterator ei;
typename std::vector<pvv>::iterator ei;
double n_samples_per_length_unit;
double n_samples_decimal = 0.0;
int cnt=0;
@ -316,7 +325,7 @@ void Sampling<MetroMesh>::EdgeSampling()
// Montecarlo sampling.
template <class MetroMesh>
inline void Sampling<MetroMesh>::AddRandomSample(typename MetroMesh::FaceIterator &T)
inline void Sampling<MetroMesh>::AddRandomSample(FaceIterator &T)
{
// random sampling over the input face.
double rnd_1, rnd_2;
@ -349,7 +358,7 @@ void Sampling<MetroMesh>::MontecarloFaceSampling()
// Montecarlo sampling.
int cnt = 0;
double n_samples_decimal = 0.0;
typename MetroMesh::FaceIterator fi;
FaceIterator fi;
srand(clock());
// printf("Montecarlo face sampling\n");
@ -474,7 +483,7 @@ void Sampling<MetroMesh>::SimilarFaceSampling()
// Similar Triangles sampling.
int cnt = 0, n_samples_per_edge;
double n_samples_decimal = 0.0;
typename MetroMesh::FaceIterator fi;
FaceIterator fi;
printf("Similar Triangles face sampling\n");
for(fi=S1.face.begin(); fi != S1.face.end(); fi++)
@ -505,7 +514,7 @@ void Sampling<MetroMesh>::SimilarFaceSampling()
template <class MetroMesh>
void Sampling<MetroMesh>::Hausdorff()
{
Box3< typename MetroMesh::ScalarType> bbox;
Box3< ScalarType> bbox;
// set grid meshes.
gS2.SetBBox(S2.bbox);
@ -551,7 +560,7 @@ void Sampling<MetroMesh>::Hausdorff()
// compute vertex colour
if(Flags & FLAG_SAVE_ERROR_AS_COLOUR)
{
typename MetroMesh::VertexIterator vi;
VertexIterator vi;
float error;
int cnt = 0;
for(vi=S1.vert.begin();vi!=S1.vert.end();++vi)

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.6 2004/05/11 16:03:18 ganovelli
changed from "thi" to "&f" in Vfdetach
Revision 1.5 2004/05/10 15:20:49 cignoni
Updated names of POS and adj functions to the new standards for many functions
@ -215,28 +218,27 @@ void Swap (SwapFaceType &f, const int z )
template <class FaceType>
void VFDetach(FaceType & f, int z)
{
if(f.V(z)->Fp()==&f )
if(f.V(z)->VFp()==&f ) //if it is the first face detach from the begin
{
int fz = f.V(z)->Zp();
f.V(z)->Fp() = (face_from_vert_type *) f.F(fz);
f.V(z)->Zp() = f.Z(fz);
int fz = f.V(z)->VFb();
f.V(z)->VFb() = f.VFp(fz);
f.V(z)->VFi() = f.VFi(fz);
}
else
else // scan the list of faces in order to finde the current face f to be detached
{
VEdgePosB<FACE_TYPE> x,y;
x.f = V(z)->Fp();
x.z = V(z)->Zp();
Pos< FaceType > x(V(z)->VFb(),V(z)->VFi());
Pos< FaceType > y;
for(;;)
{
y = x;
x.NextF();
assert(x.f!=0);
if(x.f==&f)
if(x.f==&f) // found!
{
y.f->F(y.z) = f.F(z);
y.f->Z(y.z) = f.Z(z);
y.f->FFp(y.z) = f.FFp(z);
y.f->FFi(y.z) = f.FFi(z);
break;
}
}