fix samples after removing using namespace in header files
This commit is contained in:
parent
8de019c1e3
commit
ad562ed9f1
|
@ -45,7 +45,7 @@ class MyMesh : public vcg::tri::TriMesh< std::vector<MyVertex>, std::vector<MyFa
|
|||
int main()
|
||||
{
|
||||
MyMesh m;
|
||||
Torus<MyMesh>(m, 3.0f, 1.0f);
|
||||
vcg::tri::Torus<MyMesh>(m, 3.0f, 1.0f);
|
||||
//! [Adding a few attributes]
|
||||
// add a per-vertex attribute with type float named "GaussianCurvature"
|
||||
MyMesh::PerVertexAttributeHandle<float>
|
||||
|
|
|
@ -229,7 +229,7 @@ int main(int argc,char ** argv){
|
|||
{
|
||||
f1=f2;
|
||||
f2++;
|
||||
TriSplit<MyMesh,CenterPointBarycenter<MyMesh> >::Apply(vf[i],&(*f1),&(*f2),&(*vertp),CenterPointBarycenter<MyMesh>() );
|
||||
vcg::tri::TriSplit<MyMesh,vcg::tri::CenterPointBarycenter<MyMesh> >::Apply(vf[i],&(*f1),&(*f2),&(*vertp),vcg::tri::CenterPointBarycenter<MyMesh>() );
|
||||
f1->SetS();
|
||||
f2->SetS();
|
||||
for(int itr=0;itr<3;itr++)
|
||||
|
|
|
@ -70,7 +70,7 @@ int main(int ,char **)
|
|||
tri::UpdateSelection<MyMesh>::FaceDilate(m1);
|
||||
tri::Clean<MyMesh>::SelectIntersectingFaces(m2,m1);
|
||||
tri::UpdateSelection<MyMesh>::FaceDilate(m2);
|
||||
IsotropicRemeshing<MyMesh>::Params params;
|
||||
vcg::tri::IsotropicRemeshing<MyMesh>::Params params;
|
||||
|
||||
float len = (tri::Stat<MyMesh>::ComputeFaceEdgeLengthAverage(m1,true) + tri::Stat<MyMesh>::ComputeFaceEdgeLengthAverage(m1,true));
|
||||
params.SetTargetLen(len*0.8f);
|
||||
|
@ -78,8 +78,8 @@ int main(int ,char **)
|
|||
params.iter=1; // just one iteration to avoid overtessellating.
|
||||
params.selectedOnly=true;
|
||||
printf(" Input mesh %8i v %8i f\n",m1.VN(),m1.FN());
|
||||
IsotropicRemeshing<MyMesh>::Do(m1, params);
|
||||
IsotropicRemeshing<MyMesh>::Do(m2, params);
|
||||
vcg::tri::IsotropicRemeshing<MyMesh>::Do(m1, params);
|
||||
vcg::tri::IsotropicRemeshing<MyMesh>::Do(m2, params);
|
||||
printf(" Input mesh %8i v %8i f\n",m1.VN(),m1.FN());
|
||||
}
|
||||
tri::Clean<MyMesh>::SelectIntersectingFaces(m1,m2);
|
||||
|
|
|
@ -75,7 +75,7 @@ int main( int argc, char **argv )
|
|||
|
||||
// Mesh cleaning
|
||||
tri::Clean<MyMesh>::RemoveUnreferencedVertex(original);
|
||||
Allocator<MyMesh>::CompactEveryVector(original);
|
||||
vcg::tri::Allocator<MyMesh>::CompactEveryVector(original);
|
||||
|
||||
|
||||
tri::UpdateNormal<MyMesh>::PerVertexNormalizedPerFaceNormalized(original);
|
||||
|
@ -90,7 +90,7 @@ int main( int argc, char **argv )
|
|||
float maxSurfDist = maxSurfDistPerc*(original.bbox.Diag()/100.f);
|
||||
printf("Length Thr: %8.3f ~ %4.2f %% on %5.3f\n",lengthThr,targetLenPerc,original.bbox.Diag());
|
||||
|
||||
IsotropicRemeshing<MyMesh>::Params params;
|
||||
vcg::tri::IsotropicRemeshing<MyMesh>::Params params;
|
||||
params.SetTargetLen(lengthThr);
|
||||
params.SetFeatureAngleDeg(creaseAngle);
|
||||
params.iter=iterNum;
|
||||
|
@ -111,7 +111,7 @@ int main( int argc, char **argv )
|
|||
|
||||
|
||||
printf(" Input mesh %8i v %8i f\n",toremesh.VN(),toremesh.FN());
|
||||
IsotropicRemeshing<MyMesh>::Do(toremesh, original, params);
|
||||
vcg::tri::IsotropicRemeshing<MyMesh>::Do(toremesh, original, params);
|
||||
vcg::tri::io::ExporterPLY<MyMesh>::Save(toremesh, "remesh.ply");
|
||||
printf("Output mesh %8i v %8i f\n",toremesh.VN(),toremesh.FN());
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ int main(int ,char ** )
|
|||
|
||||
// generate a simple 2D grid
|
||||
Grid(m,20,20,1,1);
|
||||
// assign it a simple planar parametrization
|
||||
tri:UpdateTexture<MyMesh>::WedgeTexFromPlane(m,Point3f(1.0f,0,0),Point3f(0,1.0f,0),true);
|
||||
// assign it a simple planar parametrization
|
||||
tri::UpdateTexture<MyMesh>::WedgeTexFromPlane(m,Point3f(1.0f,0,0),Point3f(0,1.0f,0),true);
|
||||
tri::io::ExporterOBJ<MyMesh>::Save(m,"grid_0.obj",mask);
|
||||
|
||||
// randomly perturb a few coord textures introducing fake seams
|
||||
|
|
|
@ -474,9 +474,9 @@ bool TagFaceEdgeSelWithPolyLine(MeshType &poly,bool markFlag=true)
|
|||
{
|
||||
CoordType p0=f->P0(i);
|
||||
CoordType p1=f->P1(i);
|
||||
if (p0>p1) std::swap(p0,p1);
|
||||
if(edgeToPolyVertMap[make_pair(p0,p1)]) printf("Found an already used Edge %lu - %lu %lu!!!\n", tri::Index(base,f->V0(i)),tri::Index(base,f->V1(i)),tri::Index(poly,&*vi));
|
||||
edgeToPolyVertMap[make_pair(p0,p1)]=&*vi;
|
||||
if (p0>p1) std::swap(p0,p1);
|
||||
if(edgeToPolyVertMap[std::make_pair(p0,p1)]) printf("Found an already used Edge %lu - %lu %lu!!!\n", tri::Index(base,f->V0(i)),tri::Index(base,f->V1(i)),tri::Index(poly,&*vi));
|
||||
edgeToPolyVertMap[std::make_pair(p0,p1)]=&*vi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1136,7 +1136,7 @@ public:
|
|||
CoordType p0 = ep.V()->P();
|
||||
CoordType p1 = ep.VFlip()->P();
|
||||
if (p0>p1) std::swap(p0,p1);
|
||||
VertexPointer vp=edgeToPolyVertMap[make_pair(p0,p1)];
|
||||
VertexPointer vp=edgeToPolyVertMap[std::make_pair(p0,p1)];
|
||||
return vp!=0;
|
||||
}
|
||||
};
|
||||
|
@ -1152,7 +1152,7 @@ public:
|
|||
CoordType p0 = ep.V()->P();
|
||||
CoordType p1 = ep.VFlip()->P();
|
||||
if (p0>p1) std::swap(p0,p1);
|
||||
VertexPointer vp=edgeToPolyVertMap[make_pair(p0,p1)];
|
||||
VertexPointer vp=edgeToPolyVertMap[std::make_pair(p0,p1)];
|
||||
assert(vp);
|
||||
nv.P()=vp->P();
|
||||
return;
|
||||
|
|
|
@ -260,7 +260,7 @@ public:
|
|||
|
||||
//add the entries for mass matrix
|
||||
if (SParam.useMassMatrix)
|
||||
MeshToMatrix<MeshType>::MassMatrixEntry(mesh,IndexM,ValuesM,!SParam.SmoothQ);
|
||||
vcg::tri::MeshToMatrix<MeshType>::MassMatrixEntry(mesh,IndexM,ValuesM,!SParam.SmoothQ);
|
||||
|
||||
//then add entries for lagrange mult due to barycentric constraints
|
||||
for (size_t i=0;i<SParam.ConstrainedF.size();i++)
|
||||
|
@ -313,7 +313,7 @@ public:
|
|||
//get the entries for laplacian matrix
|
||||
std::vector<std::pair<int,int> > IndexL;
|
||||
std::vector<ScalarType> ValuesL;
|
||||
MeshToMatrix<MeshType>::GetLaplacianMatrix(mesh,IndexL,ValuesL,SParam.useCotWeight,SParam.lapWeight,!SParam.SmoothQ);
|
||||
vcg::tri::MeshToMatrix<MeshType>::GetLaplacianMatrix(mesh,IndexL,ValuesL,SParam.useCotWeight,SParam.lapWeight,!SParam.SmoothQ);
|
||||
|
||||
//initialize sparse laplacian matrix
|
||||
if (!SParam.SmoothQ)
|
||||
|
|
|
@ -214,9 +214,9 @@ namespace vcg
|
|||
|
||||
for(typename MeshType::EdgeIterator ei1 = m.edge.begin(); ei1 != m.edge.end(); ++ei1 )
|
||||
{
|
||||
vector<HEdgePointer> hedges = HalfEdgeTopology<MeshType>::get_incident_hedges((*ei1).V(0));
|
||||
std::vector<HEdgePointer> hedges = HalfEdgeTopology<MeshType>::get_incident_hedges((*ei1).V(0));
|
||||
|
||||
for(typename vector<HEdgePointer>::iterator hi = hedges.begin(); hi != hedges.end(); ++hi)
|
||||
for(typename std::vector<HEdgePointer>::iterator hi = hedges.begin(); hi != hedges.end(); ++hi)
|
||||
{
|
||||
if((*hi)->HOp()->HVp() == (*ei1).V(1))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue