diff --git a/SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp b/SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp index 54434dde4684a16fd604e960dcaef0c6d4e5ee63..578dbbd2879cd92d0c525e35a5f314f6b74fbef8 100644 --- a/SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp +++ b/SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp @@ -47,8 +47,8 @@ void DifferentialPropertiesPlugin::cb_computeNormal() if(!currentItems.empty()) { const QString& mapname = currentItems[0]->text(); - MapHandler* mh = reinterpret_cast*>(m_window->getMap(mapname)); - typename PFP2::MAP* map = mh->getMap(); + MapHandler* mh = static_cast*>(m_window->getMap(mapname)); + PFP2::MAP* map = mh->getMap(); std::string positionName = m_computeNormalDialog->combo_positionAttribute->currentText().toUtf8().constData(); std::string normalName; @@ -56,10 +56,10 @@ void DifferentialPropertiesPlugin::cb_computeNormal() normalName = m_computeNormalDialog->combo_normalAttribute->currentText().toUtf8().constData(); else normalName = m_computeNormalDialog->normalAttributeName->text().toUtf8().constData(); - VertexAttribute position = map->getAttribute(positionName); - VertexAttribute normal = map->getAttribute(normalName); + VertexAttribute position = map->getAttribute(positionName); + VertexAttribute normal = map->getAttribute(normalName); if(!normal.isValid()) - normal = map->addAttribute(normalName); + normal = map->addAttribute(normalName); Algo::Surface::Geometry::computeNormalVertices(*map, position, normal); @@ -81,63 +81,63 @@ void DifferentialPropertiesPlugin::cb_computeCurvature() if(!currentItems.empty()) { const QString& mapname = currentItems[0]->text(); - MapHandler* mh = reinterpret_cast*>(m_window->getMap(mapname)); - typename PFP2::MAP* map = mh->getMap(); + MapHandler* mh = static_cast*>(m_window->getMap(mapname)); + PFP2::MAP* map = mh->getMap(); std::string positionName = m_computeCurvatureDialog->combo_positionAttribute->currentText().toUtf8().constData(); std::string normalName = m_computeCurvatureDialog->combo_normalAttribute->currentText().toUtf8().constData(); - VertexAttribute position = map->getAttribute(positionName); - VertexAttribute normal = map->getAttribute(normalName); + VertexAttribute position = map->getAttribute(positionName); + VertexAttribute normal = map->getAttribute(normalName); std::string KmaxName; if(m_computeCurvatureDialog->KmaxAttributeName->text().isEmpty()) KmaxName = m_computeCurvatureDialog->combo_KmaxAttribute->currentText().toUtf8().constData(); else KmaxName = m_computeCurvatureDialog->KmaxAttributeName->text().toUtf8().constData(); - VertexAttribute Kmax = map->getAttribute(KmaxName); + VertexAttribute Kmax = map->getAttribute(KmaxName); if(!Kmax.isValid()) - Kmax = map->addAttribute(KmaxName); + Kmax = map->addAttribute(KmaxName); std::string kmaxName; if(m_computeCurvatureDialog->kmaxAttributeName->text().isEmpty()) kmaxName = m_computeCurvatureDialog->combo_kmaxAttribute->currentText().toUtf8().constData(); else kmaxName = m_computeCurvatureDialog->kmaxAttributeName->text().toUtf8().constData(); - VertexAttribute kmax = map->getAttribute(kmaxName); + VertexAttribute kmax = map->getAttribute(kmaxName); if(!kmax.isValid()) - kmax = map->addAttribute(kmaxName); + kmax = map->addAttribute(kmaxName); std::string KminName; if(m_computeCurvatureDialog->KminAttributeName->text().isEmpty()) KminName = m_computeCurvatureDialog->combo_KminAttribute->currentText().toUtf8().constData(); else KminName = m_computeCurvatureDialog->KminAttributeName->text().toUtf8().constData(); - VertexAttribute Kmin = map->getAttribute(KminName); + VertexAttribute Kmin = map->getAttribute(KminName); if(!Kmin.isValid()) - Kmin = map->addAttribute(KminName); + Kmin = map->addAttribute(KminName); std::string kminName; if(m_computeCurvatureDialog->kminAttributeName->text().isEmpty()) kminName = m_computeCurvatureDialog->combo_kminAttribute->currentText().toUtf8().constData(); else kminName = m_computeCurvatureDialog->kminAttributeName->text().toUtf8().constData(); - VertexAttribute kmin = map->getAttribute(kminName); + VertexAttribute kmin = map->getAttribute(kminName); if(!kmin.isValid()) - kmin = map->addAttribute(kminName); + kmin = map->addAttribute(kminName); std::string KnormalName; if(m_computeCurvatureDialog->KnormalAttributeName->text().isEmpty()) KnormalName = m_computeCurvatureDialog->combo_KnormalAttribute->currentText().toUtf8().constData(); else KnormalName = m_computeCurvatureDialog->KnormalAttributeName->text().toUtf8().constData(); - VertexAttribute Knormal = map->getAttribute(KnormalName); + VertexAttribute Knormal = map->getAttribute(KnormalName); if(!Knormal.isValid()) - Knormal = map->addAttribute(KnormalName); + Knormal = map->addAttribute(KnormalName); - EdgeAttribute edgeAngle = map->getAttribute("edgeAngle"); + EdgeAttribute edgeAngle = map->getAttribute("edgeAngle"); if(!edgeAngle.isValid()) - edgeAngle = map->addAttribute("edgeAngle"); + edgeAngle = map->addAttribute("edgeAngle"); Algo::Surface::Geometry::computeAnglesBetweenNormalsOnEdges(*map, position, edgeAngle); Algo::Surface::Geometry::computeCurvatureVertices_NormalCycles_Projected(*map, 0.01f * mh->getBBdiagSize(), position, normal, edgeAngle, kmax, kmin, Kmax, Kmin, Knormal); diff --git a/SCHNApps/Plugins/importSurface/importSurface.cpp b/SCHNApps/Plugins/importSurface/importSurface.cpp index 66b2cae0a99e331ec2d7a34d4ac110fb109f65c6..774efda07380b933b190a7172426a41bd567ff2c 100644 --- a/SCHNApps/Plugins/importSurface/importSurface.cpp +++ b/SCHNApps/Plugins/importSurface/importSurface.cpp @@ -22,16 +22,15 @@ void ImportSurfacePlugin::cb_import() if(fi.exists()) { -// typename PFP2::MAP* m = new typename PFP2::MAP(); GenericMap* m = m_window->createMap(2); - typename PFP2::MAP* map = static_cast(m); + PFP2::MAP* map = static_cast(m); MapHandler* h = new MapHandler(fi.baseName(), m_window, map); std::vector attrNames ; Algo::Surface::Import::importMesh(*map, fileName.toUtf8().constData(), attrNames); // get vertex position attribute - VertexAttribute position = map->getAttribute(attrNames[0]); + VertexAttribute position = map->getAttribute(attrNames[0]); // create VBO for vertex position attribute h->createVBO(position); diff --git a/SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp b/SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp index 95773abf87c2c3e5af5f921de11354184eebd84b..38c66c9c0c22a1a4d79304b124521a08b85e99c1 100644 --- a/SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp +++ b/SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp @@ -77,10 +77,10 @@ void SubdivideSurfacePlugin::cb_loopSubdivision() if(!currentItems.empty()) { const QString& mapname = currentItems[0]->text(); - MapHandler* mh = reinterpret_cast*>(m_window->getMap(mapname)); - typename PFP2::MAP* map = mh->getMap(); + MapHandler* mh = static_cast*>(m_window->getMap(mapname)); + PFP2::MAP* map = mh->getMap(); std::string positionName = m_dockTab->combo_positionAttribute->currentText().toUtf8().constData(); - VertexAttribute position = map->getAttribute(positionName); + VertexAttribute position = map->getAttribute(positionName); Algo::Surface::Modelisation::LoopSubdivision(*map, position); @@ -104,10 +104,10 @@ void SubdivideSurfacePlugin::cb_CCSubdivision() if(!currentItems.empty()) { const QString& mapname = currentItems[0]->text(); - MapHandler* mh = reinterpret_cast*>(m_window->getMap(mapname)); - typename PFP2::MAP* map = mh->getMap(); + MapHandler* mh = static_cast*>(m_window->getMap(mapname)); + PFP2::MAP* map = mh->getMap(); std::string positionName = m_dockTab->combo_positionAttribute->currentText().toUtf8().constData(); - VertexAttribute position = map->getAttribute(positionName); + VertexAttribute position = map->getAttribute(positionName); Algo::Surface::Modelisation::CatmullClarkSubdivision(*map, position); @@ -131,10 +131,10 @@ void SubdivideSurfacePlugin::cb_trianguleFaces() if(!currentItems.empty()) { const QString& mapname = currentItems[0]->text(); - MapHandler* mh = reinterpret_cast*>(m_window->getMap(mapname)); - typename PFP2::MAP* map = mh->getMap(); + MapHandler* mh = static_cast*>(m_window->getMap(mapname)); + PFP2::MAP* map = mh->getMap(); std::string positionName = m_dockTab->combo_positionAttribute->currentText().toUtf8().constData(); - VertexAttribute position = map->getAttribute(positionName); + VertexAttribute position = map->getAttribute(positionName); Algo::Surface::Modelisation::trianguleFaces(*map, position); diff --git a/SCHNApps/include/mapHandler.h b/SCHNApps/include/mapHandler.h index f3decc7a6306c156627ebab88a90769abaaa508c..bccd560176367d43358666871550488dd4aec969 100644 --- a/SCHNApps/include/mapHandler.h +++ b/SCHNApps/include/mapHandler.h @@ -103,11 +103,11 @@ public: delete m_map; } - typename PFP::MAP* getMap() { return reinterpret_cast(m_map); } + typename PFP::MAP* getMap() { return static_cast(m_map); } void updateBB(const VertexAttribute& position) { - CGoGN::Geom::BoundingBox bb = CGoGN::Algo::Geometry::computeBoundingBox(*(reinterpret_cast(m_map)), position); + CGoGN::Geom::BoundingBox bb = CGoGN::Algo::Geometry::computeBoundingBox(*(static_cast(m_map)), position); m_bbMin = qglviewer::Vec(bb.min()[0], bb.min()[1], bb.min()[2]); m_bbMax = qglviewer::Vec(bb.max()[0], bb.max()[1], bb.max()[2]); m_bbDiagSize = (m_bbMax - m_bbMin).norm(); @@ -115,7 +115,7 @@ public: void updatePrimitives(int primitive, const FunctorSelect& good = allDarts) { - m_render->initPrimitives(*(reinterpret_cast(m_map)), good, primitive) ; + m_render->initPrimitives(*(static_cast(m_map)), good, primitive) ; } };