mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-16 17:44:36 +00:00
Converted to the new style with the Mark functions outside the trimesh class
This commit is contained in:
parent
8c38a0f0bd
commit
70f8536e6f
@ -75,8 +75,8 @@ bool EditPaintPlugin::StartEdit(MeshModel& m, GLArea * parent)
|
||||
m.updateDataMask(MeshModel::MM_VERTCOLOR);
|
||||
tri::UpdateColor<CMeshO>::VertexConstant(m.cm,Color4b(150, 150, 150, 255));
|
||||
}
|
||||
m.cm.InitFaceIMark();
|
||||
m.cm.InitVertexIMark();
|
||||
tri::InitFaceIMark(m.cm);
|
||||
tri::InitVertexIMark(m.cm);
|
||||
|
||||
parent->getCurrentRenderMode().colorMode=vcg::GLW::CMPerVert;
|
||||
|
||||
@ -310,12 +310,12 @@ void EditPaintPlugin::Decorate(MeshModel &m, GLArea * gla)
|
||||
case COLOR_SMOOTH:
|
||||
paintbox->getUndoStack()->beginMacro("Color Smooth");
|
||||
smoothed_vertices.clear();
|
||||
m.cm.UnMarkAll();
|
||||
tri::UnMarkAll(m.cm);
|
||||
break;
|
||||
case MESH_SMOOTH:
|
||||
paintbox->getUndoStack()->beginMacro("Mesh Smooth");
|
||||
smoothed_vertices.clear();
|
||||
m.cm.UnMarkAll();
|
||||
tri::UnMarkAll(m.cm);
|
||||
break;
|
||||
|
||||
default :
|
||||
@ -858,7 +858,7 @@ inline void EditPaintPlugin::updateSelection(MeshModel &m, vector< pair<CVertexO
|
||||
|
||||
if (current_options & EPP_AVG_NORMAL ) normal = Point3f(0.0, 0.0, 0.0);
|
||||
|
||||
m.cm.UnMarkAll();
|
||||
tri::UnMarkAll(m.cm);
|
||||
|
||||
if (selection->size() == 0) {
|
||||
CMeshO::FaceIterator fi;
|
||||
@ -955,7 +955,7 @@ inline void EditPaintPlugin::updateSelection(MeshModel &m, vector< pair<CVertexO
|
||||
{
|
||||
intern = true;
|
||||
if (vertex_result == NULL) continue;
|
||||
else if (!m.cm.IsMarked(fac->V(j)))
|
||||
else if (!tri::IsMarked(m.cm,fac->V(j)))
|
||||
{
|
||||
vd.position.setX((int)p[j].x()); vd.position.setY((int)p[j].y());
|
||||
pair<CVertexO *, PickingData> data(fac->V(j), vd);
|
||||
@ -963,7 +963,7 @@ inline void EditPaintPlugin::updateSelection(MeshModel &m, vector< pair<CVertexO
|
||||
|
||||
if (current_options & EPP_AVG_NORMAL ) normal += fac->V(j)->N();
|
||||
|
||||
m.cm.Mark(fac->V(j));
|
||||
tri::Mark(m.cm,fac->V(j));
|
||||
}
|
||||
}
|
||||
|
||||
@ -980,16 +980,16 @@ inline void EditPaintPlugin::updateSelection(MeshModel &m, vector< pair<CVertexO
|
||||
}
|
||||
}
|
||||
|
||||
if (intern && !m.cm.IsMarked(fac))
|
||||
if (intern && !tri::IsMarked(m.cm,fac))
|
||||
{
|
||||
m.cm.Mark(fac);
|
||||
tri::Mark(m.cm,fac);
|
||||
selection->push_back(fac);
|
||||
surround.clear();
|
||||
for (int lauf=0; lauf<3; lauf++) getSurroundingFacesVF(fac,lauf,&surround);
|
||||
|
||||
for (unsigned int lauf3=0; lauf3<surround.size(); lauf3++)
|
||||
{
|
||||
if (!m.cm.IsMarked(surround[lauf3]))
|
||||
if (!tri::IsMarked(m.cm,surround[lauf3]))
|
||||
{
|
||||
temp.push_back(surround[lauf3]);
|
||||
}
|
||||
|
||||
@ -326,7 +326,7 @@ public:
|
||||
for (unsigned int i = 0; i < 3; i++)
|
||||
if ((*fi).V1(i) - (*fi).V0(i) > 0) {
|
||||
PosType newpos(&*fi, i);
|
||||
Insert(heap, newpos, m.IMark());
|
||||
Insert(heap, newpos, tri::IMark(m));
|
||||
}
|
||||
}
|
||||
}; // end CurvEdgeFlip class
|
||||
|
||||
@ -237,7 +237,7 @@ bool AlignPair::InitFix(AlignPair::A2Mesh *fm,
|
||||
A2Grid &u,
|
||||
int PreferredGridSize)
|
||||
{
|
||||
fm->InitFaceIMark();
|
||||
tri::InitFaceIMark(*fm);
|
||||
|
||||
Box3d bb2=fm->bbox;
|
||||
// double MinDist= fm->bbox.Diag()*pp.MinDistPerc;
|
||||
|
||||
@ -169,9 +169,9 @@ private:
|
||||
|
||||
void InitIMark()
|
||||
{
|
||||
base_mesh.IMark()=0;
|
||||
base_mesh.InitFaceIMark();
|
||||
base_mesh.InitVertexIMark();
|
||||
vcg::tri::IMark(base_mesh)=0;
|
||||
vcg::tri::InitFaceIMark(base_mesh);
|
||||
vcg::tri::InitVertexIMark(base_mesh);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
//#define REDUNDANCY_ONLY 1
|
||||
//#define REFINE_PATCH_ONLY 1
|
||||
#define MAX_LOOP 150
|
||||
|
||||
using namespace vcg;
|
||||
// Constructor usually performs only two simple tasks of filling the two lists
|
||||
// - typeList: with all the possible id of the filtering actions
|
||||
// - actionList with the corresponding actions. If you want to add icons to your filtering actions you can do here by construction the QActions accordingly
|
||||
@ -156,7 +156,7 @@ bool FilterZippering::checkRedundancy( CMeshO::FacePointer face,
|
||||
|
||||
for ( unsigned int j = 0; j < edge_samples.size(); j ++ ) {
|
||||
CMeshO::FacePointer nearestF = 0;
|
||||
vcg::tri::FaceTmark<CMeshO> markerFunctor; markerFunctor.SetMesh(&m->cm); m->cm.UnMarkAll();
|
||||
vcg::tri::FaceTmark<CMeshO> markerFunctor; markerFunctor.SetMesh(&m->cm); tri::UnMarkAll(m->cm);
|
||||
vcg::face::PointDistanceBaseFunctor<CMeshO::ScalarType> PDistFunct;
|
||||
MeshFaceGrid::ScalarType dist = max_dist; MeshFaceGrid::CoordType closest;
|
||||
//Search closest point on A
|
||||
@ -185,7 +185,7 @@ bool FilterZippering::checkRedundancy( CMeshO::FacePointer face,
|
||||
// samples on A
|
||||
for ( int k = 0; k < edge_samples.size(); k ++ ) {
|
||||
CMeshO::FacePointer nearestF = 0;
|
||||
vcg::tri::FaceTmark<CMeshO> markerFunctor; markerFunctor.SetMesh(&m->cm); m->cm.UnMarkAll();
|
||||
vcg::tri::FaceTmark<CMeshO> markerFunctor; markerFunctor.SetMesh(&m->cm); tri::UnMarkAll(m->cm);
|
||||
vcg::face::PointDistanceBaseFunctor<CMeshO::ScalarType> PDistFunct;
|
||||
MeshFaceGrid::ScalarType dist = max_dist; MeshFaceGrid::CoordType closest;
|
||||
//Search closest point on A
|
||||
@ -222,7 +222,7 @@ bool FilterZippering::simpleCheckRedundancy( CMeshO::FacePointer f, //face
|
||||
//search for max_edge
|
||||
float max_edge = std::max( vcg::Distance<float>(f->P(0),f->P(1)), std::max( vcg::Distance<float>(f->P(1),f->P(2)), vcg::Distance<float>(f->P(2),f->P(0)) ) );
|
||||
float dist = max_dist; CMeshO::FacePointer nearestF = 0; vcg::Point3<CMeshO::ScalarType> closest;
|
||||
vcg::tri::FaceTmark<CMeshO> markerFunctor; markerFunctor.SetMesh(&m->cm); m->cm.UnMarkAll();
|
||||
vcg::tri::FaceTmark<CMeshO> markerFunctor; markerFunctor.SetMesh(&m->cm); UnMarkAll(m->cm);
|
||||
vcg::face::PointDistanceBaseFunctor<CMeshO::ScalarType> PDistFunct;
|
||||
nearestF = grid.GetClosest(PDistFunct, markerFunctor, qp, max_dist, dist, closest);
|
||||
if (nearestF == 0) return false; //too far away
|
||||
@ -622,9 +622,9 @@ bool FilterZippering::applyFilter(QAction *filter, MeshDocument &md, RichParamet
|
||||
/*end*/
|
||||
|
||||
a->cm.face.EnableFFAdjacency(); vcg::tri::UpdateTopology<CMeshO>::FaceFace(a->cm);
|
||||
a->cm.face.EnableMark(); a->cm.UnMarkAll();
|
||||
a->cm.face.EnableMark(); tri::UnMarkAll(a->cm);
|
||||
b->cm.face.EnableFFAdjacency(); vcg::tri::UpdateTopology<CMeshO>::FaceFace(b->cm);
|
||||
b->cm.face.EnableMark(); b->cm.UnMarkAll();
|
||||
b->cm.face.EnableMark(); tri::UnMarkAll(b->cm);
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerFaceNormalized(a->cm); vcg::tri::UpdateFlags<CMeshO>::FaceProjection(a->cm); vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalized(a->cm);
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerFaceNormalized(b->cm); vcg::tri::UpdateFlags<CMeshO>::FaceProjection(b->cm); vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalized(b->cm);
|
||||
CMeshO::ScalarType epsilon = par.getAbsPerc("distance");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user