clean Mod/Mesh from #if 0

This commit is contained in:
Andrew
2023-03-12 15:35:11 +01:00
committed by wwmayer
parent 4c1e17aae0
commit bf57f49a2e
6 changed files with 7 additions and 419 deletions

View File

@@ -356,7 +356,6 @@ void ViewProviderMesh::onChanged(const App::Property* prop)
else if (prop == &Lighting) {
if (Lighting.getValue() == 0) {
pShapeHints->vertexOrdering = SoShapeHints::UNKNOWN_ORDERING;
//pShapeHints->vertexOrdering = SoShapeHints::COUNTERCLOCKWISE;
}
else {
pShapeHints->vertexOrdering = SoShapeHints::COUNTERCLOCKWISE;
@@ -484,8 +483,7 @@ void ViewProviderMesh::attach(App::DocumentObject *pcFeat)
void ViewProviderMesh::updateData(const App::Property* prop)
{
Gui::ViewProviderGeometryObject::updateData(prop);
//if (prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
//}
if (prop->getTypeId() == App::PropertyColorList::getClassTypeId()) {
Coloring.setStatus(App::Property::Hidden, false);
}
@@ -513,7 +511,6 @@ App::PropertyColorList* ViewProviderMesh::getColorProperty() const
}
}
}
return nullptr; // no such property found
}
@@ -1413,40 +1410,6 @@ private:
std::vector<Mesh::FacetIndex> ViewProviderMesh::getVisibleFacets(const SbViewportRegion& vp,
SoCamera* camera) const
{
#if 0
Q_UNUSED(vp)
SbVec3f pos = camera->position.getValue();
const Mesh::PropertyMeshKernel& meshProp = static_cast<Mesh::Feature*>(pcObject)->Mesh;
const Mesh::MeshObject& mesh = meshProp.getValue();
const MeshCore::MeshKernel& kernel = mesh.getKernel();
MeshCore::MeshFacetGrid grid(kernel);
std::vector<Base::Vector3f> points;
points.reserve(kernel.CountFacets());
for (unsigned long i = 0; i < kernel.CountFacets(); i++) {
points.push_back(kernel.GetFacet(i).GetGravityPoint());
}
Vertex v(kernel, grid, Base::convertTo<Base::Vector3f>(pos));
QFuture<bool> future = QtConcurrent::mapped
(points, std::bind(&Vertex::visible, &v, bp::_1));
QFutureWatcher<bool> watcher;
watcher.setFuture(future);
watcher.waitForFinished();
unsigned long index = 0;
std::vector<unsigned long> faces;
for (QFuture<bool>::const_iterator i = future.begin(); i != future.end(); ++i, index++) {
if ((*i)) {
faces.push_back(index);
}
}
return faces;
#else
const Mesh::PropertyMeshKernel& meshProp = static_cast<Mesh::Feature*>(pcObject)->Mesh;
const Mesh::MeshObject& mesh = meshProp.getValue();
uint32_t count = (uint32_t)mesh.countFacets();
@@ -1468,13 +1431,9 @@ std::vector<Mesh::FacetIndex> ViewProviderMesh::getVisibleFacets(const SbViewpor
mat->diffuseColor.finishEditing();
// backface culling
//SoShapeHints* hints = new SoShapeHints;
//hints->shapeType = SoShapeHints::SOLID;
//hints->vertexOrdering = SoShapeHints::COUNTERCLOCKWISE;
SoMaterialBinding* bind = new SoMaterialBinding();
bind->value = SoMaterialBinding::PER_FACE;
//root->addChild(hints);
root->addChild(mat);
root->addChild(bind);
root->addChild(this->getCoordNode());
@@ -1509,7 +1468,6 @@ std::vector<Mesh::FacetIndex> ViewProviderMesh::getVisibleFacets(const SbViewpor
faces.erase(std::unique(faces.begin(), faces.end()), faces.end());
return faces;
#endif
}
void ViewProviderMesh::cutMesh(const std::vector<SbVec2f>& picked,