Commit 8e159d31 authored by Pierre Kraemer's avatar Pierre Kraemer

remove useless typename

parent e4048ec3
......@@ -47,8 +47,8 @@ void DifferentialPropertiesPlugin::cb_computeNormal()
if(!currentItems.empty())
{
const QString& mapname = currentItems[0]->text();
MapHandler<PFP2>* mh = reinterpret_cast<MapHandler<PFP2>*>(m_window->getMap(mapname));
typename PFP2::MAP* map = mh->getMap();
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(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<typename PFP2::VEC3> position = map->getAttribute<typename PFP2::VEC3, VERTEX>(positionName);
VertexAttribute<typename PFP2::VEC3> normal = map->getAttribute<typename PFP2::VEC3, VERTEX>(normalName);
VertexAttribute<PFP2::VEC3> position = map->getAttribute<PFP2::VEC3, VERTEX>(positionName);
VertexAttribute<PFP2::VEC3> normal = map->getAttribute<PFP2::VEC3, VERTEX>(normalName);
if(!normal.isValid())
normal = map->addAttribute<typename PFP2::VEC3, VERTEX>(normalName);
normal = map->addAttribute<PFP2::VEC3, VERTEX>(normalName);
Algo::Surface::Geometry::computeNormalVertices<PFP2>(*map, position, normal);
......@@ -81,63 +81,63 @@ void DifferentialPropertiesPlugin::cb_computeCurvature()
if(!currentItems.empty())
{
const QString& mapname = currentItems[0]->text();
MapHandler<PFP2>* mh = reinterpret_cast<MapHandler<PFP2>*>(m_window->getMap(mapname));
typename PFP2::MAP* map = mh->getMap();
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(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<typename PFP2::VEC3> position = map->getAttribute<typename PFP2::VEC3, VERTEX>(positionName);
VertexAttribute<typename PFP2::VEC3> normal = map->getAttribute<typename PFP2::VEC3, VERTEX>(normalName);
VertexAttribute<PFP2::VEC3> position = map->getAttribute<PFP2::VEC3, VERTEX>(positionName);
VertexAttribute<PFP2::VEC3> normal = map->getAttribute<PFP2::VEC3, VERTEX>(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<typename PFP2::VEC3> Kmax = map->getAttribute<typename PFP2::VEC3, VERTEX>(KmaxName);
VertexAttribute<PFP2::VEC3> Kmax = map->getAttribute<PFP2::VEC3, VERTEX>(KmaxName);
if(!Kmax.isValid())
Kmax = map->addAttribute<typename PFP2::VEC3, VERTEX>(KmaxName);
Kmax = map->addAttribute<PFP2::VEC3, VERTEX>(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<typename PFP2::REAL> kmax = map->getAttribute<typename PFP2::REAL, VERTEX>(kmaxName);
VertexAttribute<PFP2::REAL> kmax = map->getAttribute<PFP2::REAL, VERTEX>(kmaxName);
if(!kmax.isValid())
kmax = map->addAttribute<typename PFP2::REAL, VERTEX>(kmaxName);
kmax = map->addAttribute<PFP2::REAL, VERTEX>(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<typename PFP2::VEC3> Kmin = map->getAttribute<typename PFP2::VEC3, VERTEX>(KminName);
VertexAttribute<PFP2::VEC3> Kmin = map->getAttribute<PFP2::VEC3, VERTEX>(KminName);
if(!Kmin.isValid())
Kmin = map->addAttribute<typename PFP2::VEC3, VERTEX>(KminName);
Kmin = map->addAttribute<PFP2::VEC3, VERTEX>(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<typename PFP2::REAL> kmin = map->getAttribute<typename PFP2::REAL, VERTEX>(kminName);
VertexAttribute<PFP2::REAL> kmin = map->getAttribute<PFP2::REAL, VERTEX>(kminName);
if(!kmin.isValid())
kmin = map->addAttribute<typename PFP2::REAL, VERTEX>(kminName);
kmin = map->addAttribute<PFP2::REAL, VERTEX>(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<typename PFP2::VEC3> Knormal = map->getAttribute<typename PFP2::VEC3, VERTEX>(KnormalName);
VertexAttribute<PFP2::VEC3> Knormal = map->getAttribute<PFP2::VEC3, VERTEX>(KnormalName);
if(!Knormal.isValid())
Knormal = map->addAttribute<typename PFP2::VEC3, VERTEX>(KnormalName);
Knormal = map->addAttribute<PFP2::VEC3, VERTEX>(KnormalName);
EdgeAttribute<typename PFP2::REAL> edgeAngle = map->getAttribute<typename PFP2::REAL, EDGE>("edgeAngle");
EdgeAttribute<PFP2::REAL> edgeAngle = map->getAttribute<PFP2::REAL, EDGE>("edgeAngle");
if(!edgeAngle.isValid())
edgeAngle = map->addAttribute<typename PFP2::REAL, EDGE>("edgeAngle");
edgeAngle = map->addAttribute<PFP2::REAL, EDGE>("edgeAngle");
Algo::Surface::Geometry::computeAnglesBetweenNormalsOnEdges<PFP2>(*map, position, edgeAngle);
Algo::Surface::Geometry::computeCurvatureVertices_NormalCycles_Projected<PFP2>(*map, 0.01f * mh->getBBdiagSize(), position, normal, edgeAngle, kmax, kmin, Kmax, Kmin, Knormal);
......
......@@ -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<typename PFP2::MAP*>(m);
PFP2::MAP* map = static_cast<PFP2::MAP*>(m);
MapHandler<PFP2>* h = new MapHandler<PFP2>(fi.baseName(), m_window, map);
std::vector<std::string> attrNames ;
Algo::Surface::Import::importMesh<PFP2>(*map, fileName.toUtf8().constData(), attrNames);
// get vertex position attribute
VertexAttribute<typename PFP2::VEC3> position = map->getAttribute<typename PFP2::VEC3, CGoGN::VERTEX>(attrNames[0]);
VertexAttribute<PFP2::VEC3> position = map->getAttribute<typename PFP2::VEC3, CGoGN::VERTEX>(attrNames[0]);
// create VBO for vertex position attribute
h->createVBO(position);
......
......@@ -77,10 +77,10 @@ void SubdivideSurfacePlugin::cb_loopSubdivision()
if(!currentItems.empty())
{
const QString& mapname = currentItems[0]->text();
MapHandler<PFP2>* mh = reinterpret_cast<MapHandler<PFP2>*>(m_window->getMap(mapname));
typename PFP2::MAP* map = mh->getMap();
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m_window->getMap(mapname));
PFP2::MAP* map = mh->getMap();
std::string positionName = m_dockTab->combo_positionAttribute->currentText().toUtf8().constData();
VertexAttribute<typename PFP2::VEC3> position = map->getAttribute<typename PFP2::VEC3, VERTEX>(positionName);
VertexAttribute<PFP2::VEC3> position = map->getAttribute<PFP2::VEC3, VERTEX>(positionName);
Algo::Surface::Modelisation::LoopSubdivision<PFP2>(*map, position);
......@@ -104,10 +104,10 @@ void SubdivideSurfacePlugin::cb_CCSubdivision()
if(!currentItems.empty())
{
const QString& mapname = currentItems[0]->text();
MapHandler<PFP2>* mh = reinterpret_cast<MapHandler<PFP2>*>(m_window->getMap(mapname));
typename PFP2::MAP* map = mh->getMap();
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m_window->getMap(mapname));
PFP2::MAP* map = mh->getMap();
std::string positionName = m_dockTab->combo_positionAttribute->currentText().toUtf8().constData();
VertexAttribute<typename PFP2::VEC3> position = map->getAttribute<typename PFP2::VEC3, VERTEX>(positionName);
VertexAttribute<PFP2::VEC3> position = map->getAttribute<PFP2::VEC3, VERTEX>(positionName);
Algo::Surface::Modelisation::CatmullClarkSubdivision<PFP2>(*map, position);
......@@ -131,10 +131,10 @@ void SubdivideSurfacePlugin::cb_trianguleFaces()
if(!currentItems.empty())
{
const QString& mapname = currentItems[0]->text();
MapHandler<PFP2>* mh = reinterpret_cast<MapHandler<PFP2>*>(m_window->getMap(mapname));
typename PFP2::MAP* map = mh->getMap();
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m_window->getMap(mapname));
PFP2::MAP* map = mh->getMap();
std::string positionName = m_dockTab->combo_positionAttribute->currentText().toUtf8().constData();
VertexAttribute<typename PFP2::VEC3> position = map->getAttribute<typename PFP2::VEC3, VERTEX>(positionName);
VertexAttribute<PFP2::VEC3> position = map->getAttribute<PFP2::VEC3, VERTEX>(positionName);
Algo::Surface::Modelisation::trianguleFaces<PFP2>(*map, position);
......
......@@ -103,11 +103,11 @@ public:
delete m_map;
}
typename PFP::MAP* getMap() { return reinterpret_cast<typename PFP::MAP*>(m_map); }
typename PFP::MAP* getMap() { return static_cast<typename PFP::MAP*>(m_map); }
void updateBB(const VertexAttribute<typename PFP::VEC3>& position)
{
CGoGN::Geom::BoundingBox<typename PFP::VEC3> bb = CGoGN::Algo::Geometry::computeBoundingBox<PFP>(*(reinterpret_cast<typename PFP::MAP*>(m_map)), position);
CGoGN::Geom::BoundingBox<typename PFP::VEC3> bb = CGoGN::Algo::Geometry::computeBoundingBox<PFP>(*(static_cast<typename PFP::MAP*>(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<PFP>(*(reinterpret_cast<typename PFP::MAP*>(m_map)), good, primitive) ;
m_render->initPrimitives<PFP>(*(static_cast<typename PFP::MAP*>(m_map)), good, primitive) ;
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment