Small gcc compiling issues

This commit is contained in:
Paolo Cignoni 2007-05-31 09:39:56 +00:00
parent 007d53b7e0
commit f354a9f445
6 changed files with 57 additions and 39 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.8 2007/05/21 11:12:10 cignoni
Corrected gcc compiling issues
Revision 1.7 2006/01/19 14:18:08 spinelli Revision 1.7 2006/01/19 14:18:08 spinelli
fix bug end iterator++ fix bug end iterator++

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.3 2004/10/28 00:47:51 cignoni
Better Doxygen documentation
Revision 1.2 2004/05/10 14:42:17 ganovelli Revision 1.2 2004/05/10 14:42:17 ganovelli
nimor changes nimor changes
@ -114,7 +117,7 @@ static void EdgeEdge(MeshType &m)
vector<PVertex> v; vector<PVertex> v;
EdgeIterator pf; EdgeIterator pf;
vector<PVertex>::iterator p; typename vector<PVertex>::iterator p;
if( m.en == 0 ) return; if( m.en == 0 ) return;
@ -132,12 +135,12 @@ static void EdgeEdge(MeshType &m)
int ne = 0; // Numero di edge reali int ne = 0; // Numero di edge reali
vector<PVertex>::iterator pe,ps; typename vector<PVertex>::iterator pe,ps;
for(ps = v.begin(),pe=v.begin();pe<=v.end();++pe) // Scansione vettore ausiliario for(ps = v.begin(),pe=v.begin();pe<=v.end();++pe) // Scansione vettore ausiliario
{ {
if( pe==v.end() || *pe != *ps ) // Trovo blocco di edge uguali if( pe==v.end() || *pe != *ps ) // Trovo blocco di edge uguali
{ {
vector<PVertex>::iterator q,q_next; typename vector<PVertex>::iterator q,q_next;
for (q=ps;q<pe-1;++q) // Scansione edge associati for (q=ps;q<pe-1;++q) // Scansione edge associati
{ {
assert((*q).z>=0); assert((*q).z>=0);
@ -179,7 +182,7 @@ static void VertexEdge(MeshType &m)
{ {
(*ei).Ev(j) = (*ei).V(j)->Ep(); (*ei).Ev(j) = (*ei).V(j)->Ep();
(*ei).Zv(j) = (*ei).V(j)->Ei(); (*ei).Zv(j) = (*ei).V(j)->Ei();
(*ei).V(j)->Ep() = &(*fi); (*ei).V(j)->Ep() = &(*ei);
(*ei).V(j)->Ei() = j; (*ei).V(j)->Ei() = j;
} }
} }

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.11 2006/07/06 12:30:32 ganovelli
misleading comment removed
Revision 1.10 2005/12/14 17:14:13 pietroni Revision 1.10 2005/12/14 17:14:13 pietroni
added assert on deleted flag condition added assert on deleted flag condition
@ -101,9 +104,9 @@ template <class S_MESH_TYPE, class STL_CONT>
void SubSet(S_MESH_TYPE & m, STL_CONT & subSet) void SubSet(S_MESH_TYPE & m, STL_CONT & subSet)
{ {
std::vector< InsertedV<S_MESH_TYPE> > newVertices; std::vector< InsertedV<S_MESH_TYPE> > newVertices;
STL_CONT::iterator pfi; typename STL_CONT::iterator pfi;
S_MESH_TYPE::VertexIterator vi; typename S_MESH_TYPE::VertexIterator vi;
std::vector<S_MESH_TYPE::VertexPointer> redirect; std::vector<typename S_MESH_TYPE::VertexPointer> redirect;
for(pfi=subSet.begin(); pfi!=subSet.end(); ++pfi) for(pfi=subSet.begin(); pfi!=subSet.end(); ++pfi)
{ {
@ -111,7 +114,7 @@ void SubSet(S_MESH_TYPE & m, STL_CONT & subSet)
m.face.push_back(*(*pfi)); m.face.push_back(*(*pfi));
} }
S_MESH_TYPE::FaceIterator fi; typename S_MESH_TYPE::FaceIterator fi;
for(fi=m.face.begin(); fi!=m.face.end(); ++fi) for(fi=m.face.begin(); fi!=m.face.end(); ++fi)
{ {
newVertices.push_back(InsertedV<S_MESH_TYPE>((*fi).V(0), &(*fi),0)); newVertices.push_back(InsertedV<S_MESH_TYPE>((*fi).V(0), &(*fi),0));
@ -121,19 +124,19 @@ void SubSet(S_MESH_TYPE & m, STL_CONT & subSet)
sort(newVertices.begin(), newVertices.end()); sort(newVertices.begin(), newVertices.end());
std::vector< InsertedV<S_MESH_TYPE> >::iterator curr, next; typename std::vector< InsertedV<S_MESH_TYPE> >::iterator curr, next;
int pos=0; int pos=0;
curr=next=newVertices.begin(); curr=next=newVertices.begin();
while(next!=newVertices.end()) while(next!=newVertices.end())
{ {
if((*curr)!=(*next)) if((*curr)!=(*next))
pos++; pos++;
(*next).f->V((*next).z)=(S_MESH_TYPE::VertexPointer)pos; (*next).f->V((*next).z)=(typename S_MESH_TYPE::VertexPointer)pos;
curr=next; curr=next;
next++; next++;
} }
std::vector< InsertedV<S_MESH_TYPE> >::iterator newE=unique(newVertices.begin(), newVertices.end()); typename std::vector< InsertedV<S_MESH_TYPE> >::iterator newE=unique(newVertices.begin(), newVertices.end());
for(curr=newVertices.begin(); curr!=newE; ++curr) for(curr=newVertices.begin(); curr!=newE; ++curr)
m.vert.push_back(*((*curr).v)); m.vert.push_back(*((*curr).v));

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.2 2004/05/10 14:40:47 ganovelli
name of adhacency function updated
Revision 1.1 2004/05/10 14:01:56 ganovelli Revision 1.1 2004/05/10 14:01:56 ganovelli
created created
@ -84,14 +87,14 @@ public:
/// The vertex type /// The vertex type
typedef typename EDGETYPE::VertexType VertexType; typedef typename EDGETYPE::VertexType VertexType;
/////The HEdgePos type /////The HEdgePos type
typedef typename Pos< EDGETYPE> POSTYPE; typedef Pos< EDGETYPE> POSTYPE;
///// The vector type ///// The vector type
//typedef typename MVTYPE::coord_type vectorial_type; //typedef typename MVTYPE::coord_type vectorial_type;
///// The scalar type ///// The scalar type
//typedef typename MVTYPE::scalar_type scalar_type; //typedef typename MVTYPE::scalar_type scalar_type;
/// Pointer to the face of the half-edge /// Pointer to the face of the half-edge
typename EDGETYPE *e; EDGETYPE *e;
/// Pointer to the vertex /// Pointer to the vertex
VertexType *v; VertexType *v;
@ -167,7 +170,7 @@ public:
// return the vertex that it should have if we make FlipV; // return the vertex that it should have if we make FlipV;
VertexType *VFlip() VertexType *VFlip()
{ {
return (t->V(0)==v)?t->V(1):t->V(0); return (e->V(0)==v)?e->V(1):e->V(0);
} }
// Trova il prossimo half-edge di bordo (nhe) // Trova il prossimo half-edge di bordo (nhe)
@ -202,14 +205,14 @@ public:
} }
/// Checks if the half-edge is of border /// Checks if the half-edge is of border
bool IsBorder() //bool IsBorder()
{ //{
//return f->IsBorder(z); //return f->IsBorder(z);
} //}
/// Return the dimension of the star /// Return the dimension of the star
int StarSize() //int StarSize()
{ //{
//int n=0; //int n=0;
//POSTYPE ht=*this; //POSTYPE ht=*this;
//bool bf=false; //bool bf=false;
@ -222,7 +225,7 @@ public:
//if(bf) return n/2; //if(bf) return n/2;
//else return n; //else return n;
} //}
/** Function to inizialize an half-edge. /** Function to inizialize an half-edge.
@param fp Puntatore alla faccia @param fp Puntatore alla faccia
@ -256,10 +259,10 @@ public:
// Controlla la coerenza di orientamento di un hpos con la relativa faccia // Controlla la coerenza di orientamento di un hpos con la relativa faccia
/// Checks the orientation coherence of a half-edge with the face /// Checks the orientation coherence of a half-edge with the face
inline bool Coherent() const //inline bool Coherent() const
{ //{
return v == f->V(z); // e^(ip)+1=0 ovvero E=mc^2 // return v == f->V(z); // e^(ip)+1=0 ovvero E=mc^2
} //}
}; };
} // end namespace } // end namespace

View File

@ -23,6 +23,9 @@
/**************************************************************************** /****************************************************************************
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.14 2006/12/18 16:02:57 matteodelle
minor eroor correction on variable names
Revision 1.13 2006/12/18 14:28:07 matteodelle Revision 1.13 2006/12/18 14:28:07 matteodelle
*** empty log message *** *** empty log message ***
@ -68,7 +71,7 @@ changed from classes to functions
Revision 1.1 2004/09/15 22:59:13 ganovelli Revision 1.1 2004/09/15 22:59:13 ganovelli
creation creation
/****************************************************************************/ ****************************************************************************/
#ifndef __GL_CAMERA #ifndef __GL_CAMERA

View File

@ -23,6 +23,9 @@
/**************************************************************************** /****************************************************************************
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.12 2006/12/18 16:02:57 matteodelle
minor eroor correction on variable names
Revision 1.11 2006/12/18 15:26:24 callieri Revision 1.11 2006/12/18 15:26:24 callieri
added a function to approximate a far plane value given a shot and the mesh bbox added a function to approximate a far plane value given a shot and the mesh bbox
@ -67,7 +70,7 @@ Revision 1.2 2004/09/06 21:41:30 ganovelli
Revision 1.1 2004/09/03 13:01:51 ganovelli Revision 1.1 2004/09/03 13:01:51 ganovelli
creation creation
/****************************************************************************/ ****************************************************************************/
#ifndef __VCGLIB_GLSHOT #ifndef __VCGLIB_GLSHOT
@ -89,7 +92,7 @@ template <class ShotType>
struct GlShot { struct GlShot {
typedef typename ShotType::ScalarType ScalarType; typedef typename ShotType::ScalarType ScalarType;
typedef typename GlCamera<typename ShotType::CameraType> GlCameraType; typedef GlCamera<typename ShotType::CameraType> GlCameraType;
/// returns the OpenGL 4x4 MODELVIEW matrix that describes the shot position and orientation (extrinsics) /// returns the OpenGL 4x4 MODELVIEW matrix that describes the shot position and orientation (extrinsics)
static void MatrixGL(ShotType & shot,vcg::Matrix44<ScalarType> & m) static void MatrixGL(ShotType & shot,vcg::Matrix44<ScalarType> & m)
@ -142,23 +145,23 @@ static ScalarType GetFarPlane(vcg::Shot<ScalarType> & shot, vcg::Box3<ScalarType
{ {
ScalarType farDist; ScalarType farDist;
Point3<ScalarType> farcorner; vcg::Point3<ScalarType> farcorner;
Point3<ScalarType> campos = shot.Extrinsics.tra; vcg::Point3<ScalarType> campos = shot.Extrinsics.tra;
if (abs(campos.X() - mainmodel->bbox.max.X()) > abs(campos.X() - bbox.min.X())) if (abs(campos.X() - bbox.max.X()) > abs(campos.X() - bbox.min.X()))
farcorner.X() = mainmodel->bbox.max.X(); farcorner.X() = bbox.max.X();
else else
farcorner.X() = mainmodel->bbox.min.X(); farcorner.X() = bbox.min.X();
if (abs(campos.Y() - mainmodel->bbox.max.Y()) > abs(campos.Y() - bbox.min.Y())) if (abs(campos.Y() - bbox.max.Y()) > abs(campos.Y() - bbox.min.Y()))
farcorner.Y() = mainmodel->bbox.max.Y(); farcorner.Y() = bbox.max.Y();
else else
farcorner.Y() = mainmodel->bbox.min.Y(); farcorner.Y() = bbox.min.Y();
if (abs(campos.Z() - mainmodel->bbox.max.Z()) > abs(campos.Z() - bbox.min.Z())) if (abs(campos.Z() - bbox.max.Z()) > abs(campos.Z() - bbox.min.Z()))
farcorner.Z() = mainmodel->bbox.max.Z(); farcorner.Z() = bbox.max.Z();
else else
farcorner.Z() = mainmodel->bbox.min.Z(); farcorner.Z() = bbox.min.Z();
farDist = (campos - farcorner).Norm(); farDist = (campos - farcorner).Norm();