small gcc-related compiling issues (typenames,ending cr, initialization order)
This commit is contained in:
parent
2d2bbfb454
commit
44eb40324f
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.4 2005/07/01 11:17:06 cignoni
|
||||||
|
Added option of passing a base mesh to Sphere for spherifying it
|
||||||
|
|
||||||
Revision 1.3 2005/06/17 00:49:29 cignoni
|
Revision 1.3 2005/06/17 00:49:29 cignoni
|
||||||
Added missing Sphere function
|
Added missing Sphere function
|
||||||
|
|
||||||
|
@ -81,22 +84,23 @@ template <class TetraMeshType>
|
||||||
void Tetrahedron(TetraMeshType &in)
|
void Tetrahedron(TetraMeshType &in)
|
||||||
{
|
{
|
||||||
typedef TetraMeshType MeshType;
|
typedef TetraMeshType MeshType;
|
||||||
typedef typename MeshType::CoordType CoordType;
|
typedef typename TetraMeshType::CoordType CoordType;
|
||||||
typedef typename MeshType::VertexPointer VertexPointer;
|
typedef typename TetraMeshType::VertexPointer VertexPointer;
|
||||||
typedef typename MeshType::VertexIterator VertexIterator;
|
typedef typename TetraMeshType::VertexIterator VertexIterator;
|
||||||
typedef typename MeshType::FaceIterator FaceIterator;
|
typedef typename TetraMeshType::FaceIterator FaceIterator;
|
||||||
|
|
||||||
in.Clear();
|
in.Clear();
|
||||||
Allocator<TetraMeshType>::AddVertices(in,4);
|
Allocator<TetraMeshType>::AddVertices(in,4);
|
||||||
Allocator<TetraMeshType>::AddFaces(in,4);
|
Allocator<TetraMeshType>::AddFaces(in,4);
|
||||||
|
|
||||||
VertexPointer ivp[4];
|
VertexPointer ivp[4];
|
||||||
|
CoordType test;
|
||||||
|
test=CoordType ( 1.0, 1.0, 1.0);
|
||||||
VertexIterator vi=in.vert.begin();
|
VertexIterator vi=in.vert.begin();
|
||||||
ivp[0]=&*vi;(*vi).P()=TetraMeshType::CoordType ( 1, 1, 1); ++vi;
|
ivp[0]=&*vi;(*vi).P()=CoordType ( 1.0, 1.0, 1.0); ++vi;
|
||||||
ivp[1]=&*vi;(*vi).P()=TetraMeshType::CoordType (-1, 1,-1); ++vi;
|
ivp[1]=&*vi;(*vi).P()=CoordType (-1.0, 1.0,-1.0); ++vi;
|
||||||
ivp[2]=&*vi;(*vi).P()=TetraMeshType::CoordType (-1,-1, 1); ++vi;
|
ivp[2]=&*vi;(*vi).P()=CoordType (-1.0,-1.0, 1.0); ++vi;
|
||||||
ivp[3]=&*vi;(*vi).P()=TetraMeshType::CoordType ( 1,-1,-1);
|
ivp[3]=&*vi;(*vi).P()=CoordType ( 1.0,-1.0,-1.0);
|
||||||
|
|
||||||
FaceIterator fi=in.face.begin();
|
FaceIterator fi=in.face.begin();
|
||||||
(*fi).V(0)=ivp[0]; (*fi).V(1)=ivp[1]; (*fi).V(2)=ivp[2]; ++fi;
|
(*fi).V(0)=ivp[0]; (*fi).V(1)=ivp[1]; (*fi).V(2)=ivp[2]; ++fi;
|
||||||
|
@ -117,8 +121,8 @@ void Dodecahedron(DodMeshType & in)
|
||||||
typedef typename MeshType::VertexIterator VertexIterator;
|
typedef typename MeshType::VertexIterator VertexIterator;
|
||||||
typedef typename MeshType::FaceIterator FaceIterator;
|
typedef typename MeshType::FaceIterator FaceIterator;
|
||||||
typedef typename MeshType::ScalarType ScalarType;
|
typedef typename MeshType::ScalarType ScalarType;
|
||||||
const N_penta=12;
|
const int N_penta=12;
|
||||||
const N_points=62;
|
const int N_points=62;
|
||||||
|
|
||||||
int penta[N_penta*3*3]=
|
int penta[N_penta*3*3]=
|
||||||
{20,11, 18, 18, 11, 8, 8, 11, 4,
|
{20,11, 18, 18, 11, 8, 8, 11, 4,
|
||||||
|
@ -194,7 +198,7 @@ void Dodecahedron(DodMeshType & in)
|
||||||
added[ i ] = m++;
|
added[ i ] = m++;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<VertexPointer> index(in.vn);
|
std::vector<VertexPointer> index(in.vn);
|
||||||
|
|
||||||
for(j=0,vi=in.vert.begin();j<in.vn;++j,++vi) index[j] = &(*vi);
|
for(j=0,vi=in.vert.begin();j<in.vn;++j,++vi) index[j] = &(*vi);
|
||||||
|
|
||||||
|
@ -370,21 +374,26 @@ void Square(MeshType &in)
|
||||||
// this function build a sphere starting from a eventually not empty mesh.
|
// this function build a sphere starting from a eventually not empty mesh.
|
||||||
// If the mesh is not empty it is 'spherified' and used as base for the subdivision process.
|
// If the mesh is not empty it is 'spherified' and used as base for the subdivision process.
|
||||||
// otherwise an icosahedron is used.
|
// otherwise an icosahedron is used.
|
||||||
template <class MESH_TYPE>
|
template <class MeshType>
|
||||||
void Sphere(MESH_TYPE &in, const int subdiv = 3 )
|
void Sphere(MeshType &in, const int subdiv = 3 )
|
||||||
{
|
{
|
||||||
|
typedef typename MeshType::ScalarType ScalarType;
|
||||||
|
typedef typename MeshType::CoordType CoordType;
|
||||||
|
typedef typename MeshType::VertexPointer VertexPointer;
|
||||||
|
typedef typename MeshType::VertexIterator VertexIterator;
|
||||||
|
typedef typename MeshType::FaceIterator FaceIterator;
|
||||||
if(in.vn==0 && in.fn==0) Icosahedron(in);
|
if(in.vn==0 && in.fn==0) Icosahedron(in);
|
||||||
|
|
||||||
MESH_TYPE::VertexIterator vi;
|
VertexIterator vi;
|
||||||
for(vi = in.vert.begin(); vi!=in.vert.end();++vi)
|
for(vi = in.vert.begin(); vi!=in.vert.end();++vi)
|
||||||
vi->P().Normalize();
|
vi->P().Normalize();
|
||||||
|
|
||||||
tri::UpdateFlags<AMesh>::FaceBorderFromNone(in);
|
tri::UpdateFlags<MeshType>::FaceBorderFromNone(in);
|
||||||
|
|
||||||
int lastsize = 0;
|
int lastsize = 0;
|
||||||
for(int i=0;i<subdiv;++i)
|
for(int i=0;i<subdiv;++i)
|
||||||
{
|
{
|
||||||
Refine<MESH_TYPE, MidPoint<MESH_TYPE> >(in,MidPoint<MESH_TYPE>(),0);
|
Refine<MeshType, MidPoint<MeshType> >(in,MidPoint<MeshType>(),0);
|
||||||
|
|
||||||
for(vi = in.vert.begin()+lastsize;vi!=in.vert.end();++vi)
|
for(vi = in.vert.begin()+lastsize;vi!=in.vert.end();++vi)
|
||||||
vi->P().Normalize();
|
vi->P().Normalize();
|
||||||
|
@ -547,39 +556,45 @@ void Box(MeshType &in, const typename MeshType::BoxType & bb )
|
||||||
/// Questa funzione costruisce una mesh a partire da un insieme di coordiante
|
/// Questa funzione costruisce una mesh a partire da un insieme di coordiante
|
||||||
/// ed un insieme di terne di indici di vertici
|
/// ed un insieme di terne di indici di vertici
|
||||||
|
|
||||||
template <class M,class V, class F >
|
template <class MeshType,class V, class F >
|
||||||
void Build( M & in, const V & v, const F & f)
|
void Build( MeshType & in, const V & v, const F & f)
|
||||||
{
|
{
|
||||||
in.vn = v.size();
|
typedef typename MeshType::ScalarType ScalarType;
|
||||||
|
typedef typename MeshType::CoordType CoordType;
|
||||||
|
typedef typename MeshType::VertexPointer VertexPointer;
|
||||||
|
typedef typename MeshType::VertexIterator VertexIterator;
|
||||||
|
typedef typename MeshType::FaceIterator FaceIterator;
|
||||||
|
|
||||||
|
in.vn = v.size();
|
||||||
in.fn = f.size();
|
in.fn = f.size();
|
||||||
|
|
||||||
in.vert.clear();
|
in.vert.clear();
|
||||||
in.face.clear();
|
in.face.clear();
|
||||||
|
|
||||||
V::const_iterator vi;
|
typename V::const_iterator vi;
|
||||||
|
|
||||||
M::VertexType tv;
|
typename MeshType::VertexType tv;
|
||||||
tv.Supervisor_Flags()=0;
|
tv.Supervisor_Flags()=0;
|
||||||
|
|
||||||
for(vi=v.begin();vi!=v.end();++vi)
|
for(vi=v.begin();vi!=v.end();++vi)
|
||||||
{
|
{
|
||||||
tv.P() = M::CoordType(
|
tv.P() = CoordType(
|
||||||
(M::ScalarType)(*vi).Ext(0),
|
(ScalarType)(*vi).Ext(0),
|
||||||
(M::ScalarType)(*vi).Ext(1),
|
(ScalarType)(*vi).Ext(1),
|
||||||
(M::ScalarType)(*vi).Ext(2)
|
(ScalarType)(*vi).Ext(2)
|
||||||
);
|
);
|
||||||
in.vert.push_back(tv);
|
in.vert.push_back(tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<M::vertex_pointer> index(in.vn);
|
std::vector<VertexPointer> index(in.vn);
|
||||||
M::vertex_iterator j;
|
VertexIterator j;
|
||||||
int k;
|
int k;
|
||||||
for(k=0,j=in.vert.begin();j!=in.vert.end();++j,++k)
|
for(k=0,j=in.vert.begin();j!=in.vert.end();++j,++k)
|
||||||
index[k] = &*j;
|
index[k] = &*j;
|
||||||
|
|
||||||
F::const_iterator fi;
|
typename F::const_iterator fi;
|
||||||
|
|
||||||
M::face_type ft;
|
typename MeshType::FaceType ft;
|
||||||
ft.Supervisor_Flags()=0;
|
ft.Supervisor_Flags()=0;
|
||||||
|
|
||||||
for(fi=f.begin();fi!=f.end();++fi)
|
for(fi=f.begin();fi!=f.end();++fi)
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.5 2005/06/29 15:25:41 callieri
|
||||||
|
deleted a wrong declaration "typename typename"
|
||||||
|
|
||||||
Revision 1.4 2005/06/17 00:48:27 cignoni
|
Revision 1.4 2005/06/17 00:48:27 cignoni
|
||||||
Corrected the type name of wedge tex coords WedgeInterp in RefineE
|
Corrected the type name of wedge tex coords WedgeInterp in RefineE
|
||||||
|
|
||||||
|
@ -50,6 +53,7 @@ first working version
|
||||||
#include <vcg/space/tcoord2.h>
|
#include <vcg/space/tcoord2.h>
|
||||||
#include <vcg/space/color4.h>
|
#include <vcg/space/color4.h>
|
||||||
#include <vcg/simplex/face/pos.h>
|
#include <vcg/simplex/face/pos.h>
|
||||||
|
#include<vcg/complex/trimesh/allocate.h>
|
||||||
#include<vcg/complex/trimesh/update/topology.h>
|
#include<vcg/complex/trimesh/update/topology.h>
|
||||||
|
|
||||||
namespace vcg{
|
namespace vcg{
|
||||||
|
@ -297,10 +301,10 @@ template<class MESH_TYPE,class MIDPOINT, class EDGEPRED>
|
||||||
bool RefineE(MESH_TYPE &m, MIDPOINT mid, EDGEPRED ep,bool RefineSelected=false)
|
bool RefineE(MESH_TYPE &m, MIDPOINT mid, EDGEPRED ep,bool RefineSelected=false)
|
||||||
{
|
{
|
||||||
int j,NewVertNum=0,NewFaceNum=0;
|
int j,NewVertNum=0,NewFaceNum=0;
|
||||||
typedef std::pair<typename MESH_TYPE::VertexIterator,typename MESH_TYPE::VertexIterator> vvpair;
|
typedef std::pair<typename MESH_TYPE::VertexPointer,typename MESH_TYPE::VertexPointer> vvpair;
|
||||||
std::map<vvpair,typename MESH_TYPE::VertexIterator> Edge2Vert;
|
std::map<vvpair,typename MESH_TYPE::VertexPointer> Edge2Vert;
|
||||||
// Primo ciclo si conta quanti sono i vertici e facce da aggiungere
|
// Primo ciclo si conta quanti sono i vertici e facce da aggiungere
|
||||||
MESH_TYPE::FaceIterator fi;
|
typename MESH_TYPE::FaceIterator fi;
|
||||||
for(fi=m.face.begin();fi!=m.face.end();++fi) if(!(*fi).IsD())
|
for(fi=m.face.begin();fi!=m.face.end();++fi) if(!(*fi).IsD())
|
||||||
for(j=0;j<3;j++){
|
for(j=0;j<3;j++){
|
||||||
if(ep((*fi).V(j)->P(),(*fi).V1(j)->P()) &&
|
if(ep((*fi).V(j)->P(),(*fi).V1(j)->P()) &&
|
||||||
|
@ -325,7 +329,7 @@ bool RefineE(MESH_TYPE &m, MIDPOINT mid, EDGEPRED ep,bool RefineSelected=false)
|
||||||
(*lastv).UberFlags()=0;
|
(*lastv).UberFlags()=0;
|
||||||
mid( (*lastv), face::Pos<typename MESH_TYPE::FaceType> (&*fi,j));
|
mid( (*lastv), face::Pos<typename MESH_TYPE::FaceType> (&*fi,j));
|
||||||
//(*lastv).P()=((*fi).V(j)->P()+(*fi).V1(j)->P())/2;
|
//(*lastv).P()=((*fi).V(j)->P()+(*fi).V1(j)->P())/2;
|
||||||
Edge2Vert[ vvpair((*fi).V(j),(*fi).V1(j)) ] = lastv;
|
Edge2Vert[ vvpair((*fi).V(j),(*fi).V1(j)) ] = &*lastv;
|
||||||
++lastv;
|
++lastv;
|
||||||
}
|
}
|
||||||
assert(lastv==m.vert.end());
|
assert(lastv==m.vert.end());
|
||||||
|
@ -350,10 +354,10 @@ bool RefineE(MESH_TYPE &m, MIDPOINT mid, EDGEPRED ep,bool RefineSelected=false)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typename MESH_TYPE::VertexIterator vv[6]; // i sei vertici in gioco
|
typename MESH_TYPE::VertexPointer vv[6]; // i sei vertici in gioco
|
||||||
// 0..2 vertici originali del triangolo
|
// 0..2 vertici originali del triangolo
|
||||||
// 3..5 mp01, mp12, mp20 midpoints of the three edges
|
// 3..5 mp01, mp12, mp20 midpoints of the three edges
|
||||||
MESH_TYPE::FaceIterator nf[4]; // le quattro facce in gioco.
|
typename MESH_TYPE::FacePointer nf[4]; // le quattro facce in gioco.
|
||||||
|
|
||||||
typename MESH_TYPE::FaceType::TexCoordType wtt[6]; // per ogni faccia sono al piu' tre i nuovi valori
|
typename MESH_TYPE::FaceType::TexCoordType wtt[6]; // per ogni faccia sono al piu' tre i nuovi valori
|
||||||
// di texture per wedge (uno per ogni edge)
|
// di texture per wedge (uno per ogni edge)
|
||||||
|
@ -382,10 +386,10 @@ bool RefineE(MESH_TYPE &m, MIDPOINT mid, EDGEPRED ep,bool RefineSelected=false)
|
||||||
else vv[5]=0;
|
else vv[5]=0;
|
||||||
int ind=((&*vv[3])?1:0)+((&*vv[4])?2:0)+((&*vv[5])?4:0);
|
int ind=((&*vv[3])?1:0)+((&*vv[4])?2:0)+((&*vv[5])?4:0);
|
||||||
|
|
||||||
nf[0]=fi;
|
nf[0]=&*fi;
|
||||||
static int iii=0;
|
int i;
|
||||||
for(int i=1;i<SplitTab[ind].TriNum;++i){
|
for(i=1;i<SplitTab[ind].TriNum;++i){
|
||||||
nf[i]=lastf; ++lastf; fca++;
|
nf[i]=&*lastf; ++lastf; fca++;
|
||||||
if(RefineSelected) (*nf[i]).SetS();
|
if(RefineSelected) (*nf[i]).SetS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,7 +541,7 @@ struct MidPointButterfly : public std::unary_function<face::Pos<typename MESH_TY
|
||||||
if(vl==vdr) rule+=4;
|
if(vl==vdr) rule+=4;
|
||||||
if(vr==vdl) rule+=8;
|
if(vr==vdl) rule+=8;
|
||||||
switch(rule){
|
switch(rule){
|
||||||
/*
|
/* */
|
||||||
/* */ case 0 : return ((*vl)+(*vr))/2.0+((*vu)+(*vd))/8.0 - ((*vul)+(*vur)+(*vdl)+(*vdr))/16.0;
|
/* */ case 0 : return ((*vl)+(*vr))/2.0+((*vu)+(*vd))/8.0 - ((*vul)+(*vur)+(*vdl)+(*vdr))/16.0;
|
||||||
/* ul */ case 1 : return (*vl*6 + *vr*10 + *vu + *vd*3 - *vur - *vdl -*vdr*2 )/16.0;
|
/* ul */ case 1 : return (*vl*6 + *vr*10 + *vu + *vd*3 - *vur - *vdl -*vdr*2 )/16.0;
|
||||||
/* ur */ case 2 : return (*vr*6 + *vl*10 + *vu + *vd*3 - *vul - *vdr -*vdl*2 )/16.0;
|
/* ur */ case 2 : return (*vr*6 + *vl*10 + *vu + *vd*3 - *vul - *vdr -*vdl*2 )/16.0;
|
||||||
|
@ -590,7 +594,7 @@ double Rules[11][10] =
|
||||||
{ .175 , .1213525492 , .01545084973 , -.04635254918, -.04045084973, -.025 , -.04045084973, -.04635254918, .01545084973, .1213525492 } // valenza 10
|
{ .175 , .1213525492 , .01545084973 , -.04635254918, -.04045084973, -.025 , -.04045084973, -.04635254918, .01545084973, .1213525492 } // valenza 10
|
||||||
};
|
};
|
||||||
|
|
||||||
Pos<typename MESH_TYPE::FaceType> he(ep.f,ep.z,ep.f->V(ep.z));
|
face::Pos<typename MESH_TYPE::FaceType> he(ep.f,ep.z,ep.f->V(ep.z));
|
||||||
typename MESH_TYPE::CoordType *vl,*vr;
|
typename MESH_TYPE::CoordType *vl,*vr;
|
||||||
vl=&he.v->P();
|
vl=&he.v->P();
|
||||||
vr=&he.VFlip()->P();
|
vr=&he.VFlip()->P();
|
||||||
|
@ -609,7 +613,7 @@ double Rules[11][10] =
|
||||||
|
|
||||||
int kl=0,kr=0; // valence of left and right vertices
|
int kl=0,kr=0; // valence of left and right vertices
|
||||||
bool bl=false,br=false; // if left and right vertices are of border
|
bool bl=false,br=false; // if left and right vertices are of border
|
||||||
Pos<typename MESH_TYPE::FaceType> heStart=he;assert(he.v->P()==*vl);
|
face::Pos<typename MESH_TYPE::FaceType> heStart=he;assert(he.v->P()==*vl);
|
||||||
do { // compute valence of left vertex
|
do { // compute valence of left vertex
|
||||||
he.FlipE();he.FlipF();
|
he.FlipE();he.FlipF();
|
||||||
if(he.IsBorder()) bl=true;
|
if(he.IsBorder()) bl=true;
|
||||||
|
@ -763,4 +767,4 @@ class EdgeSplSphere
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,11 +23,27 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
History
|
History
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.2 2005/03/16 16:14:12 spinelli
|
||||||
|
aggiunta funzione PasoDobleSmooth e relative:
|
||||||
|
|
||||||
|
- FitMesh
|
||||||
|
- FaceErrorGrad
|
||||||
|
- CrossProdGradient
|
||||||
|
- TriAreaGradient
|
||||||
|
- NormalSmooth
|
||||||
|
|
||||||
|
e le classi:
|
||||||
|
|
||||||
|
- PDVertInfo
|
||||||
|
- PDFaceInfo
|
||||||
|
|
||||||
|
necessarie per utilizzare SimpleTempData
|
||||||
|
|
||||||
Revision 1.1 2004/12/11 14:53:19 ganovelli
|
Revision 1.1 2004/12/11 14:53:19 ganovelli
|
||||||
first partial porting: compiled gcc,intel and msvc
|
first partial porting: compiled gcc,intel and msvc
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#ifndef __VCGLIB__SMOOTH
|
#ifndef __VCGLIB__SMOOTH
|
||||||
|
@ -36,6 +52,7 @@ first partial porting: compiled gcc,intel and msvc
|
||||||
#include <vcg/space/point3.h>
|
#include <vcg/space/point3.h>
|
||||||
#include <vcg/space/line3.h>
|
#include <vcg/space/line3.h>
|
||||||
#include <vcg/container/simple_temporary_data.h>
|
#include <vcg/container/simple_temporary_data.h>
|
||||||
|
#include <vcg/complex/trimesh/update/normal.h>
|
||||||
|
|
||||||
namespace vcg
|
namespace vcg
|
||||||
{
|
{
|
||||||
|
@ -534,7 +551,7 @@ void NormalSmooth(MESH_TYPE &m,
|
||||||
vcg::face::VFIterator<typename MESH_TYPE::FaceType> ep;
|
vcg::face::VFIterator<typename MESH_TYPE::FaceType> ep;
|
||||||
|
|
||||||
|
|
||||||
MESH_TYPE::FaceIterator fi;
|
typename MESH_TYPE::FaceIterator fi;
|
||||||
for(fi=m.face.begin();fi!=m.face.end();++fi)
|
for(fi=m.face.begin();fi!=m.face.end();++fi)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -645,13 +662,13 @@ Point3<FLT> FaceErrorGrad(Point3<FLT> &p,Point3<FLT> &p0,Point3<FLT> &p1, Point3
|
||||||
|
|
||||||
template<class MESH_TYPE>
|
template<class MESH_TYPE>
|
||||||
void FitMesh(MESH_TYPE &m,
|
void FitMesh(MESH_TYPE &m,
|
||||||
SimpleTempData<typename MESH_TYPE::VertContainer, PDVertInfo<typename typename MESH_TYPE::ScalarType> > &TDV,
|
SimpleTempData<typename MESH_TYPE::VertContainer, PDVertInfo<typename MESH_TYPE::ScalarType> > &TDV,
|
||||||
SimpleTempData<typename MESH_TYPE::FaceContainer, PDFaceInfo<typename typename MESH_TYPE::ScalarType> > &TDF,
|
SimpleTempData<typename MESH_TYPE::FaceContainer, PDFaceInfo<typename MESH_TYPE::ScalarType> > &TDF,
|
||||||
float lambda)
|
float lambda)
|
||||||
{
|
{
|
||||||
//vcg::face::Pos<typename MESH_TYPE::FaceType> ep;
|
//vcg::face::Pos<typename MESH_TYPE::FaceType> ep;
|
||||||
vcg::face::VFIterator<typename MESH_TYPE::FaceType> ep;
|
vcg::face::VFIterator<typename MESH_TYPE::FaceType> ep;
|
||||||
MESH_TYPE::VertexIterator vi;
|
typename MESH_TYPE::VertexIterator vi;
|
||||||
for(vi=m.vert.begin();vi!=m.vert.end();++vi)
|
for(vi=m.vert.begin();vi!=m.vert.end();++vi)
|
||||||
{
|
{
|
||||||
Point3f ErrGrad=Point3f(0,0,0);
|
Point3f ErrGrad=Point3f(0,0,0);
|
||||||
|
@ -680,17 +697,19 @@ void FitMesh(MESH_TYPE &m,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class MESH_TYPE>
|
template<class MeshType>
|
||||||
void PasoDobleSmooth(MESH_TYPE &m, int step, typename MESH_TYPE::ScalarType Sigma=0, int FitStep=10, typename MESH_TYPE::ScalarType FitLambda=0.05)
|
void PasoDobleSmooth(MeshType &m, int step, typename MeshType::ScalarType Sigma=0, int FitStep=10, typename MeshType::ScalarType FitLambda=0.05)
|
||||||
{
|
{
|
||||||
|
typedef typename MeshType::ScalarType ScalarType;
|
||||||
|
typedef typename MeshType::CoordType CoordType;
|
||||||
|
|
||||||
|
|
||||||
SimpleTempData< typedef MESH_TYPE::VertContainer, PDVertInfo<MESH_TYPE::ScalarType> > TDV(m.vert);
|
SimpleTempData< typename MeshType::VertContainer, PDVertInfo<ScalarType> > TDV(m.vert);
|
||||||
SimpleTempData< typedef MESH_TYPE::FaceContainer, PDFaceInfo<MESH_TYPE::ScalarType> > TDF(m.face);
|
SimpleTempData< typename MeshType::FaceContainer, PDFaceInfo<ScalarType> > TDF(m.face);
|
||||||
PDVertInfo<MESH_TYPE::ScalarType> lpzv;
|
PDVertInfo<ScalarType> lpzv;
|
||||||
lpzv.np=typename MESH_TYPE::CoordType(0,0,0);
|
lpzv.np=CoordType(0,0,0);
|
||||||
PDFaceInfo<MESH_TYPE::ScalarType> lpzf;
|
PDFaceInfo<ScalarType> lpzf;
|
||||||
lpzf.m=typename MESH_TYPE::CoordType(0,0,0);
|
lpzf.m=CoordType(0,0,0);
|
||||||
|
|
||||||
assert(m.HasVFTopology());
|
assert(m.HasVFTopology());
|
||||||
m.HasVFTopology();
|
m.HasVFTopology();
|
||||||
|
@ -699,10 +718,10 @@ void PasoDobleSmooth(MESH_TYPE &m, int step, typename MESH_TYPE::ScalarType Sigm
|
||||||
for(int j=0;j<step;++j)
|
for(int j=0;j<step;++j)
|
||||||
{
|
{
|
||||||
|
|
||||||
vcg::tri::UpdateNormals<MyMesh>::PerFace(m);
|
vcg::tri::UpdateNormals<MeshType>::PerFace(m);
|
||||||
NormalSmooth<MESH_TYPE>(m,TDF,Sigma);
|
NormalSmooth<MeshType>(m,TDF,Sigma);
|
||||||
for(int k=0;k<FitStep;k++)
|
for(int k=0;k<FitStep;k++)
|
||||||
FitMesh<MESH_TYPE>(m,TDV,TDF,FitLambda);
|
FitMesh<MeshType>(m,TDV,TDF,FitLambda);
|
||||||
}
|
}
|
||||||
|
|
||||||
TDF.Stop();
|
TDF.Stop();
|
||||||
|
@ -714,4 +733,4 @@ void PasoDobleSmooth(MESH_TYPE &m, int step, typename MESH_TYPE::ScalarType Sigm
|
||||||
|
|
||||||
} // End namespace vcg
|
} // End namespace vcg
|
||||||
|
|
||||||
#endif // VCG_SMOOTH
|
#endif // VCG_SMOOTH
|
||||||
|
|
|
@ -24,11 +24,14 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.3 2004/12/11 15:37:47 ganovelli
|
||||||
|
added one more [], now it is polymorphic, added typenames
|
||||||
|
|
||||||
Revision 1.2 2004/03/31 22:36:44 ganovelli
|
Revision 1.2 2004/03/31 22:36:44 ganovelli
|
||||||
First Working Release (with this comment)
|
First Working Release (with this comment)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __VCGLIB_SIMPLE__
|
#ifndef __VCGLIB_SIMPLE__
|
||||||
#define __VCGLIB_SIMPLE__
|
#define __VCGLIB_SIMPLE__
|
||||||
|
@ -40,7 +43,6 @@ namespace vcg {
|
||||||
template <class STL_CONT, class ATTR_TYPE>
|
template <class STL_CONT, class ATTR_TYPE>
|
||||||
class SimpleTempData{
|
class SimpleTempData{
|
||||||
public:
|
public:
|
||||||
typedef typename ATTR_TYPE attr_type;
|
|
||||||
|
|
||||||
STL_CONT& c;
|
STL_CONT& c;
|
||||||
std::vector<ATTR_TYPE> data;
|
std::vector<ATTR_TYPE> data;
|
||||||
|
@ -57,7 +59,7 @@ void Start(){data.reserve(c.capacity());data.resize(c.size());}
|
||||||
|
|
||||||
// start and initialize temporary attribute
|
// start and initialize temporary attribute
|
||||||
void Start(ATTR_TYPE val){data.reserve(c.capacity());data.resize(c.size());
|
void Start(ATTR_TYPE val){data.reserve(c.capacity());data.resize(c.size());
|
||||||
std::vector<ATTR_TYPE>::iterator i;
|
typename std::vector<ATTR_TYPE>::iterator i;
|
||||||
for(i = data.begin(); i!= data.end(); ++i)
|
for(i = data.begin(); i!= data.end(); ++i)
|
||||||
*i = val;
|
*i = val;
|
||||||
}
|
}
|
||||||
|
@ -78,4 +80,4 @@ bool UpdateSize(){
|
||||||
|
|
||||||
}; // end namespace vcg
|
}; // end namespace vcg
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
History
|
History
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.21 2005/07/01 10:55:42 cignoni
|
||||||
|
Removed default values from the implementation of SetCavalieri and SetIsometric
|
||||||
|
|
||||||
Revision 1.20 2005/06/29 14:59:03 spinelli
|
Revision 1.20 2005/06/29 14:59:03 spinelli
|
||||||
aggiunto:
|
aggiunto:
|
||||||
- l' enum dei tipi PERSPECTIVE, ORTHO, ISOMETRIC, CAVALIERI
|
- l' enum dei tipi PERSPECTIVE, ORTHO, ISOMETRIC, CAVALIERI
|
||||||
|
@ -123,7 +126,7 @@ public:
|
||||||
f(0.f),s(vcg::Point2<S>(0.0,0.0)),
|
f(0.f),s(vcg::Point2<S>(0.0,0.0)),
|
||||||
c(vcg::Point2<S>(0.0,0.0)),
|
c(vcg::Point2<S>(0.0,0.0)),
|
||||||
viewport(vcg::Point2<int>(0,0)),
|
viewport(vcg::Point2<int>(0,0)),
|
||||||
_flags(0),viewportM(1), cameraType(0)
|
viewportM(1),_flags(0), cameraType(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
S f; // Focal Distance (cioe' la distanza del piano immagine dal centro di proiezione
|
S f; // Focal Distance (cioe' la distanza del piano immagine dal centro di proiezione
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
History
|
History
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.11 2005/01/22 11:20:20 ponchio
|
||||||
|
<...Point3.h> -> <...point3.h>
|
||||||
|
|
||||||
Revision 1.10 2005/01/05 13:26:15 ganovelli
|
Revision 1.10 2005/01/05 13:26:15 ganovelli
|
||||||
corretto cambiamento di sistema di rif.
|
corretto cambiamento di sistema di rif.
|
||||||
|
|
||||||
|
@ -47,7 +50,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_SHOT
|
#ifndef __VCGLIB_SHOT
|
||||||
|
|
Loading…
Reference in New Issue