Commit d574eb73 authored by Pierre Kraemer's avatar Pierre Kraemer

SCHNApps en bonne voie..

parent 13c0da82
...@@ -28,19 +28,19 @@ struct MapParameters ...@@ -28,19 +28,19 @@ struct MapParameters
void start(MapHandlerGen* mh); void start(MapHandlerGen* mh);
void stop(MapHandlerGen* mh); void stop(MapHandlerGen* mh);
VertexAttribute<PFP2::VEC3> positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionAttribute;
CellSelector<VERTEX>* handleSelector; CellSelector<PFP2::MAP, VERTEX>* handleSelector;
CellSelector<VERTEX>* freeSelector; CellSelector<PFP2::MAP, VERTEX>* freeSelector;
bool initialized; bool initialized;
VertexAttribute<PFP2::VEC3> positionInit; VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionInit;
VertexAttribute<PFP2::VEC3> diffCoord; VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> diffCoord;
VertexAttribute<Eigen_Matrix3f> vertexRotationMatrix; VertexAttribute<Eigen_Matrix3f, PFP2::MAP::IMPL> vertexRotationMatrix;
VertexAttribute<PFP2::VEC3> rotatedDiffCoord; VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> rotatedDiffCoord;
VertexAttribute<unsigned int> vIndex; VertexAttribute<unsigned int, PFP2::MAP::IMPL> vIndex;
unsigned int nb_vertices; unsigned int nb_vertices;
NLContext nlContext; NLContext nlContext;
......
...@@ -25,12 +25,14 @@ MapParameters::~MapParameters() ...@@ -25,12 +25,14 @@ MapParameters::~MapParameters()
nlDeleteContext(nlContext); nlDeleteContext(nlContext);
} }
void MapParameters::start(MapHandlerGen* mh) void MapParameters::start(MapHandlerGen* mhg)
{ {
if(!initialized) if(!initialized)
{ {
if(positionAttribute.isValid() && handleSelector && freeSelector) if(positionAttribute.isValid() && handleSelector && freeSelector)
{ {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(mhg);
positionInit = mh->getAttribute<PFP2::VEC3, VERTEX>("positionInit", false); positionInit = mh->getAttribute<PFP2::VEC3, VERTEX>("positionInit", false);
if(!positionInit.isValid()) if(!positionInit.isValid())
positionInit = mh->addAttribute<PFP2::VEC3, VERTEX>("positionInit", false); positionInit = mh->addAttribute<PFP2::VEC3, VERTEX>("positionInit", false);
...@@ -60,7 +62,7 @@ void MapParameters::start(MapHandlerGen* mh) ...@@ -60,7 +62,7 @@ void MapParameters::start(MapHandlerGen* mh)
for(unsigned int i = vertexRotationMatrix.begin(); i != vertexRotationMatrix.end(); vertexRotationMatrix.next(i)) for(unsigned int i = vertexRotationMatrix.begin(); i != vertexRotationMatrix.end(); vertexRotationMatrix.next(i))
vertexRotationMatrix[i] = Eigen::Matrix3f::Identity(); vertexRotationMatrix[i] = Eigen::Matrix3f::Identity();
nb_vertices = static_cast<AttribMap*>(map)->computeIndexCells<VERTEX>(vIndex); nb_vertices = map->computeIndexCells<VERTEX>(vIndex);
if(nlContext) if(nlContext)
nlDeleteContext(nlContext); nlDeleteContext(nlContext);
...@@ -317,7 +319,8 @@ void Surface_Deformation_Plugin::changePositionAttribute(const QString& map, con ...@@ -317,7 +319,8 @@ void Surface_Deformation_Plugin::changePositionAttribute(const QString& map, con
MapParameters& p = h_parameterSet[m]; MapParameters& p = h_parameterSet[m];
if(!p.initialized) if(!p.initialized)
{ {
p.positionAttribute = m->getAttribute<PFP2::VEC3, VERTEX>(name); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
p.positionAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(name);
if(m->isSelectedMap()) if(m->isSelectedMap())
m_dockTab->updateMapParameters(); m_dockTab->updateMapParameters();
} }
...@@ -332,7 +335,8 @@ void Surface_Deformation_Plugin::changeHandleSelector(const QString& map, const ...@@ -332,7 +335,8 @@ void Surface_Deformation_Plugin::changeHandleSelector(const QString& map, const
MapParameters& p = h_parameterSet[m]; MapParameters& p = h_parameterSet[m];
if(!p.initialized) if(!p.initialized)
{ {
p.handleSelector = m->getCellSelector<VERTEX>(name); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
p.handleSelector = mh->getCellSelector<VERTEX>(name);
if(m->isSelectedMap()) if(m->isSelectedMap())
m_dockTab->updateMapParameters(); m_dockTab->updateMapParameters();
} }
...@@ -347,7 +351,8 @@ void Surface_Deformation_Plugin::changeFreeSelector(const QString& map, const QS ...@@ -347,7 +351,8 @@ void Surface_Deformation_Plugin::changeFreeSelector(const QString& map, const QS
MapParameters& p = h_parameterSet[m]; MapParameters& p = h_parameterSet[m];
if(!p.initialized) if(!p.initialized)
{ {
p.freeSelector = m->getCellSelector<VERTEX>(name); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
p.freeSelector = mh->getCellSelector<VERTEX>(name);
if(m->isSelectedMap()) if(m->isSelectedMap())
m_dockTab->updateMapParameters(); m_dockTab->updateMapParameters();
} }
...@@ -406,7 +411,7 @@ void Surface_Deformation_Plugin::asRigidAsPossible(MapHandlerGen* mh) ...@@ -406,7 +411,7 @@ void Surface_Deformation_Plugin::asRigidAsPossible(MapHandlerGen* mh)
if(p.initialized) if(p.initialized)
{ {
CellMarkerNoUnmark<VERTEX> m(*map) ; CellMarkerNoUnmark<PFP2::MAP, VERTEX> m(*map) ;
for(Dart d = map->begin(); d != map->end(); map->next(d)) for(Dart d = map->begin(); d != map->end(); map->next(d))
{ {
......
...@@ -37,7 +37,10 @@ void Surface_Deformation_DockTab::positionAttributeChanged(int index) ...@@ -37,7 +37,10 @@ void Surface_Deformation_DockTab::positionAttributeChanged(int index)
if(index == 0) if(index == 0)
; ;
else else
m_plugin->h_parameterSet[map].positionAttribute = map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText()); {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].positionAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText());
}
} }
} }
} }
...@@ -48,7 +51,10 @@ void Surface_Deformation_DockTab::handleSelectorChanged(int index) ...@@ -48,7 +51,10 @@ void Surface_Deformation_DockTab::handleSelectorChanged(int index)
{ {
MapHandlerGen* map = m_schnapps->getSelectedMap(); MapHandlerGen* map = m_schnapps->getSelectedMap();
if(map) if(map)
m_plugin->h_parameterSet[map].handleSelector = map->getCellSelector<VERTEX>(combo_handleSelector->currentText()); {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].handleSelector = mh->getCellSelector<VERTEX>(combo_handleSelector->currentText());
}
} }
} }
...@@ -58,7 +64,10 @@ void Surface_Deformation_DockTab::freeSelectorChanged(int index) ...@@ -58,7 +64,10 @@ void Surface_Deformation_DockTab::freeSelectorChanged(int index)
{ {
MapHandlerGen* map = m_schnapps->getSelectedMap(); MapHandlerGen* map = m_schnapps->getSelectedMap();
if(map) if(map)
m_plugin->h_parameterSet[map].freeSelector = map->getCellSelector<VERTEX>(combo_freeSelector->currentText()); {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].freeSelector = mh->getCellSelector<VERTEX>(combo_freeSelector->currentText());
}
} }
} }
......
...@@ -185,11 +185,11 @@ void Surface_DifferentialProperties_Plugin::computeNormal( ...@@ -185,11 +185,11 @@ void Surface_DifferentialProperties_Plugin::computeNormal(
if(mh == NULL) if(mh == NULL)
return; return;
VertexAttribute<PFP2::VEC3> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName);
if(!position.isValid()) if(!position.isValid())
return; return;
VertexAttribute<PFP2::VEC3> normal = mh->getAttribute<PFP2::VEC3, VERTEX>(normalAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> normal = mh->getAttribute<PFP2::VEC3, VERTEX>(normalAttributeName);
if(!normal.isValid()) if(!normal.isValid())
normal = mh->addAttribute<PFP2::VEC3, VERTEX>(normalAttributeName); normal = mh->addAttribute<PFP2::VEC3, VERTEX>(normalAttributeName);
...@@ -219,35 +219,35 @@ void Surface_DifferentialProperties_Plugin::computeCurvature( ...@@ -219,35 +219,35 @@ void Surface_DifferentialProperties_Plugin::computeCurvature(
if(mh == NULL) if(mh == NULL)
return; return;
VertexAttribute<PFP2::VEC3> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName);
if(!position.isValid()) if(!position.isValid())
return; return;
VertexAttribute<PFP2::VEC3> normal = mh->getAttribute<PFP2::VEC3, VERTEX>(normalAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> normal = mh->getAttribute<PFP2::VEC3, VERTEX>(normalAttributeName);
if(!normal.isValid()) if(!normal.isValid())
return; return;
VertexAttribute<PFP2::VEC3> Kmax = mh->getAttribute<PFP2::VEC3, VERTEX>(KmaxAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> Kmax = mh->getAttribute<PFP2::VEC3, VERTEX>(KmaxAttributeName);
if(!Kmax.isValid()) if(!Kmax.isValid())
Kmax = mh->addAttribute<PFP2::VEC3, VERTEX>(KmaxAttributeName); Kmax = mh->addAttribute<PFP2::VEC3, VERTEX>(KmaxAttributeName);
VertexAttribute<PFP2::REAL> kmax = mh->getAttribute<PFP2::REAL, VERTEX>(kmaxAttributeName); VertexAttribute<PFP2::REAL, PFP2::MAP::IMPL> kmax = mh->getAttribute<PFP2::REAL, VERTEX>(kmaxAttributeName);
if(!kmax.isValid()) if(!kmax.isValid())
kmax = mh->addAttribute<PFP2::REAL, VERTEX>(kmaxAttributeName); kmax = mh->addAttribute<PFP2::REAL, VERTEX>(kmaxAttributeName);
VertexAttribute<PFP2::VEC3> Kmin = mh->getAttribute<PFP2::VEC3, VERTEX>(KminAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> Kmin = mh->getAttribute<PFP2::VEC3, VERTEX>(KminAttributeName);
if(!Kmin.isValid()) if(!Kmin.isValid())
Kmin = mh->addAttribute<PFP2::VEC3, VERTEX>(KminAttributeName); Kmin = mh->addAttribute<PFP2::VEC3, VERTEX>(KminAttributeName);
VertexAttribute<PFP2::REAL> kmin = mh->getAttribute<PFP2::REAL, VERTEX>(kminAttributeName); VertexAttribute<PFP2::REAL, PFP2::MAP::IMPL> kmin = mh->getAttribute<PFP2::REAL, VERTEX>(kminAttributeName);
if(!kmin.isValid()) if(!kmin.isValid())
kmin = mh->addAttribute<PFP2::REAL, VERTEX>(kminAttributeName); kmin = mh->addAttribute<PFP2::REAL, VERTEX>(kminAttributeName);
VertexAttribute<PFP2::VEC3> Knormal = mh->getAttribute<PFP2::VEC3, VERTEX>(KnormalAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> Knormal = mh->getAttribute<PFP2::VEC3, VERTEX>(KnormalAttributeName);
if(!Knormal.isValid()) if(!Knormal.isValid())
Knormal = mh->addAttribute<PFP2::VEC3, VERTEX>(KnormalAttributeName); Knormal = mh->addAttribute<PFP2::VEC3, VERTEX>(KnormalAttributeName);
EdgeAttribute<PFP2::REAL> edgeAngle = mh->getAttribute<PFP2::REAL, EDGE>("edgeAngle"); EdgeAttribute<PFP2::REAL, PFP2::MAP::IMPL> edgeAngle = mh->getAttribute<PFP2::REAL, EDGE>("edgeAngle");
if(!edgeAngle.isValid()) if(!edgeAngle.isValid())
edgeAngle = mh->addAttribute<PFP2::REAL, EDGE>("edgeAngle"); edgeAngle = mh->addAttribute<PFP2::REAL, EDGE>("edgeAngle");
...@@ -269,7 +269,7 @@ void Surface_DifferentialProperties_Plugin::computeCurvature( ...@@ -269,7 +269,7 @@ void Surface_DifferentialProperties_Plugin::computeCurvature(
if(compute_kmean) if(compute_kmean)
{ {
VertexAttribute<PFP2::REAL> kmean = mh->getAttribute<PFP2::REAL, VERTEX>("kmean"); VertexAttribute<PFP2::REAL, PFP2::MAP::IMPL> kmean = mh->getAttribute<PFP2::REAL, VERTEX>("kmean");
if(!kmean.isValid()) if(!kmean.isValid())
kmean = mh->addAttribute<PFP2::REAL, VERTEX>("kmean"); kmean = mh->addAttribute<PFP2::REAL, VERTEX>("kmean");
...@@ -281,7 +281,7 @@ void Surface_DifferentialProperties_Plugin::computeCurvature( ...@@ -281,7 +281,7 @@ void Surface_DifferentialProperties_Plugin::computeCurvature(
if(compute_kgaussian) if(compute_kgaussian)
{ {
VertexAttribute<PFP2::REAL> kgaussian = mh->getAttribute<PFP2::REAL, VERTEX>("kgaussian"); VertexAttribute<PFP2::REAL, PFP2::MAP::IMPL> kgaussian = mh->getAttribute<PFP2::REAL, VERTEX>("kgaussian");
if(!kgaussian.isValid()) if(!kgaussian.isValid())
kgaussian = mh->addAttribute<PFP2::REAL, VERTEX>("kgaussian"); kgaussian = mh->addAttribute<PFP2::REAL, VERTEX>("kgaussian");
......
...@@ -37,7 +37,7 @@ MapHandlerGen* Surface_Import_Plugin::importFromFile(const QString& fileName) ...@@ -37,7 +37,7 @@ MapHandlerGen* Surface_Import_Plugin::importFromFile(const QString& fileName)
Algo::Surface::Import::importMesh<PFP2>(*map, fileName.toStdString(), attrNames); Algo::Surface::Import::importMesh<PFP2>(*map, fileName.toStdString(), attrNames);
// get vertex position attribute // get vertex position attribute
VertexAttribute<PFP2::VEC3> position = map->getAttribute<PFP2::VEC3, VERTEX>(attrNames[0]); VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> position = map->getAttribute<PFP2::VEC3, VERTEX>(attrNames[0]);
mh->registerAttribute(position); mh->registerAttribute(position);
// update corresponding VBO & emit attribute update signal // update corresponding VBO & emit attribute update signal
......
...@@ -25,11 +25,11 @@ struct MapParameters ...@@ -25,11 +25,11 @@ struct MapParameters
faceSelector(NULL) faceSelector(NULL)
{} {}
VertexAttribute<PFP2::VEC3> positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionAttribute;
CellSelector<VERTEX>* vertexSelector; CellSelector<PFP2::MAP, VERTEX>* vertexSelector;
CellSelector<EDGE>* edgeSelector; CellSelector<PFP2::MAP, EDGE>* edgeSelector;
CellSelector<FACE>* faceSelector; CellSelector<PFP2::MAP, FACE>* faceSelector;
}; };
class Surface_Modelisation_Plugin : public PluginInteraction class Surface_Modelisation_Plugin : public PluginInteraction
......
...@@ -159,7 +159,8 @@ void Surface_Modelisation_Plugin::changePositionAttribute(const QString& view, c ...@@ -159,7 +159,8 @@ void Surface_Modelisation_Plugin::changePositionAttribute(const QString& view, c
MapHandlerGen* m = m_schnapps->getMap(map); MapHandlerGen* m = m_schnapps->getMap(map);
if(m) if(m)
{ {
h_parameterSet[m].positionAttribute = m->getAttribute<PFP2::VEC3, VERTEX>(name); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
h_parameterSet[m].positionAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(name);
if(m->isSelectedMap()) if(m->isSelectedMap())
m_dockTab->updateMapParameters(); m_dockTab->updateMapParameters();
} }
...@@ -170,8 +171,8 @@ void Surface_Modelisation_Plugin::changeVertexSelector(const QString& map, const ...@@ -170,8 +171,8 @@ void Surface_Modelisation_Plugin::changeVertexSelector(const QString& map, const
MapHandlerGen* m = m_schnapps->getMap(map); MapHandlerGen* m = m_schnapps->getMap(map);
if(m) if(m)
{ {
MapParameters& p = h_parameterSet[m]; MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
p.vertexSelector = m->getCellSelector<VERTEX>(name); h_parameterSet[m].vertexSelector = mh->getCellSelector<VERTEX>(name);
if(m->isSelectedMap()) if(m->isSelectedMap())
m_dockTab->updateMapParameters(); m_dockTab->updateMapParameters();
} }
...@@ -182,8 +183,8 @@ void Surface_Modelisation_Plugin::changeEdgeSelector(const QString& map, const Q ...@@ -182,8 +183,8 @@ void Surface_Modelisation_Plugin::changeEdgeSelector(const QString& map, const Q
MapHandlerGen* m = m_schnapps->getMap(map); MapHandlerGen* m = m_schnapps->getMap(map);
if(m) if(m)
{ {
MapParameters& p = h_parameterSet[m]; MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
p.edgeSelector = m->getCellSelector<EDGE>(name); h_parameterSet[m].edgeSelector = mh->getCellSelector<EDGE>(name);
if(m->isSelectedMap()) if(m->isSelectedMap())
m_dockTab->updateMapParameters(); m_dockTab->updateMapParameters();
} }
...@@ -194,8 +195,8 @@ void Surface_Modelisation_Plugin::changeFaceSelector(const QString& map, const Q ...@@ -194,8 +195,8 @@ void Surface_Modelisation_Plugin::changeFaceSelector(const QString& map, const Q
MapHandlerGen* m = m_schnapps->getMap(map); MapHandlerGen* m = m_schnapps->getMap(map);
if(m) if(m)
{ {
MapParameters& p = h_parameterSet[m]; MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
p.faceSelector = m->getCellSelector<FACE>(name); h_parameterSet[m].faceSelector = mh->getCellSelector<FACE>(name);
if(m->isSelectedMap()) if(m->isSelectedMap())
m_dockTab->updateMapParameters(); m_dockTab->updateMapParameters();
} }
...@@ -216,7 +217,7 @@ void Surface_Modelisation_Plugin::createEmptyMap() ...@@ -216,7 +217,7 @@ void Surface_Modelisation_Plugin::createEmptyMap()
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(mhg); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(mhg);
// add vertex position attribute // add vertex position attribute
VertexAttribute<PFP2::VEC3> position = mh->addAttribute<PFP2::VEC3, VERTEX>("position"); VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> position = mh->addAttribute<PFP2::VEC3, VERTEX>("position");
// update corresponding VBO & emit attribute update signal // update corresponding VBO & emit attribute update signal
mh->notifyAttributeModification(position); mh->notifyAttributeModification(position);
mapNumber++; mapNumber++;
...@@ -229,7 +230,7 @@ void Surface_Modelisation_Plugin::createNewFace(MapHandlerGen* mhg) ...@@ -229,7 +230,7 @@ void Surface_Modelisation_Plugin::createNewFace(MapHandlerGen* mhg)
PFP2::MAP* map = mh->getMap(); PFP2::MAP* map = mh->getMap();
if (h_parameterSet[mhg].positionAttribute.isValid()) if (h_parameterSet[mhg].positionAttribute.isValid())
{ {
VertexAttribute<PFP2::VEC3>& position = h_parameterSet[mhg].positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL>& position = h_parameterSet[mhg].positionAttribute;
if (collectedVertices.size() >= 3) if (collectedVertices.size() >= 3)
{ {
Dart d = map->newFace(collectedVertices.size()); Dart d = map->newFace(collectedVertices.size());
...@@ -258,7 +259,7 @@ void Surface_Modelisation_Plugin::addCube(MapHandlerGen *mhg) ...@@ -258,7 +259,7 @@ void Surface_Modelisation_Plugin::addCube(MapHandlerGen *mhg)
PFP2::MAP* map = mh->getMap(); PFP2::MAP* map = mh->getMap();
if (h_parameterSet[mhg].positionAttribute.isValid()) if (h_parameterSet[mhg].positionAttribute.isValid())
{ {
VertexAttribute<PFP2::VEC3>& position = h_parameterSet[mhg].positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL>& position = h_parameterSet[mhg].positionAttribute;
Algo::Surface::Modelisation::embedPrism<PFP2>(*map, position, 4, true, 0.7f, 0.7f, 1.0f); Algo::Surface::Modelisation::embedPrism<PFP2>(*map, position, 4, true, 0.7f, 0.7f, 1.0f);
...@@ -355,16 +356,17 @@ void Surface_Modelisation_Plugin::splitSurface(MapHandlerGen* mhg) ...@@ -355,16 +356,17 @@ void Surface_Modelisation_Plugin::splitSurface(MapHandlerGen* mhg)
else isPath = false; else isPath = false;
} }
CellMarker<PFP2::MAP, VERTEX> vm(*map);
if (isPath) if (isPath)
{ {
for(std::vector<Dart>::iterator it = path.begin() ; it != path.end()-1; ++it) for(std::vector<Dart>::iterator it = path.begin() ; it != path.end()-1; ++it)
{ {
if (isPath) if (isPath)
{ {
CellMarker<VERTEX>* vm = new CellMarker<VERTEX>(*map); if(vm.isMarked(*it))
if(vm->isMarked(*it))
isPath = false; isPath = false;
vm->mark(*it); vm.mark(*it);
std::vector<Dart>::iterator next; std::vector<Dart>::iterator next;
next = it + 1 ; next = it + 1 ;
...@@ -738,7 +740,7 @@ void Surface_Modelisation_Plugin::pathExtrudeFace(MapHandlerGen *mhg) ...@@ -738,7 +740,7 @@ void Surface_Modelisation_Plugin::pathExtrudeFace(MapHandlerGen *mhg)
PFP2::MAP* map = mh->getMap(); PFP2::MAP* map = mh->getMap();
MapParameters& p = h_parameterSet[mhg]; MapParameters& p = h_parameterSet[mhg];
VertexAttribute<PFP2::VEC3> position = p.positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL>& position = p.positionAttribute;
if(p.faceSelector && !p.faceSelector->getSelectedCells().empty()) if(p.faceSelector && !p.faceSelector->getSelectedCells().empty())
{ {
const std::vector<Dart>& selectedDart = p.faceSelector->getSelectedCells(); const std::vector<Dart>& selectedDart = p.faceSelector->getSelectedCells();
......
...@@ -41,7 +41,10 @@ void Surface_Modelisation_DockTab::positionAttributeChanged(int index) ...@@ -41,7 +41,10 @@ void Surface_Modelisation_DockTab::positionAttributeChanged(int index)
{ {
MapHandlerGen* map = m_schnapps->getSelectedMap(); MapHandlerGen* map = m_schnapps->getSelectedMap();
if(map) if(map)
m_plugin->h_parameterSet[map].positionAttribute = map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText()); {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].positionAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText());
}
} }
} }
...@@ -51,7 +54,10 @@ void Surface_Modelisation_DockTab::vertexSelectorChanged(int index) ...@@ -51,7 +54,10 @@ void Surface_Modelisation_DockTab::vertexSelectorChanged(int index)
{ {
MapHandlerGen* map = m_schnapps->getSelectedMap(); MapHandlerGen* map = m_schnapps->getSelectedMap();
if(map) if(map)
m_plugin->h_parameterSet[map].vertexSelector = map->getCellSelector<VERTEX>(combo_vertexSelector->currentText()); {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].vertexSelector = mh->getCellSelector<VERTEX>(combo_vertexSelector->currentText());
}
} }
} }
...@@ -61,7 +67,10 @@ void Surface_Modelisation_DockTab::edgeSelectorChanged(int index) ...@@ -61,7 +67,10 @@ void Surface_Modelisation_DockTab::edgeSelectorChanged(int index)
{ {
MapHandlerGen* map = m_schnapps->getSelectedMap(); MapHandlerGen* map = m_schnapps->getSelectedMap();
if(map) if(map)
m_plugin->h_parameterSet[map].edgeSelector = map->getCellSelector<EDGE>(combo_edgeSelector->currentText()); {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].edgeSelector = mh->getCellSelector<EDGE>(combo_edgeSelector->currentText());
}
} }
} }
...@@ -71,7 +80,10 @@ void Surface_Modelisation_DockTab::faceSelectorChanged(int index) ...@@ -71,7 +80,10 @@ void Surface_Modelisation_DockTab::faceSelectorChanged(int index)
{ {
MapHandlerGen* map = m_schnapps->getSelectedMap(); MapHandlerGen* map = m_schnapps->getSelectedMap();
if(map) if(map)
m_plugin->h_parameterSet[map].faceSelector = map->getCellSelector<FACE>(combo_faceSelector->currentText()); {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].faceSelector = mh->getCellSelector<FACE>(combo_faceSelector->currentText());
}
} }
} }
......
...@@ -159,7 +159,8 @@ void Surface_RenderScalar_Plugin::attributeModified(unsigned int orbit, QString ...@@ -159,7 +159,8 @@ void Surface_RenderScalar_Plugin::attributeModified(unsigned int orbit, QString
MapParameters& mapParam = viewParamSet[map]; MapParameters& mapParam = viewParamSet[map];
if(mapParam.scalarVBO && nameAttr == QString::fromStdString(mapParam.scalarVBO->name())) if(mapParam.scalarVBO && nameAttr == QString::fromStdString(mapParam.scalarVBO->name()))
{ {
const VertexAttribute<PFP2::REAL>& attr = map->getAttribute<PFP2::REAL, VERTEX>(nameAttr); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
const VertexAttribute<PFP2::REAL, PFP2::MAP::IMPL>& attr = mh->getAttribute<PFP2::REAL, VERTEX>(nameAttr);
mapParam.scalarMin = std::numeric_limits<float>::max(); mapParam.scalarMin = std::numeric_limits<float>::max();
mapParam.scalarMax = std::numeric_limits<float>::min(); mapParam.scalarMax = std::numeric_limits<float>::min();
for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i)) for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i))
...@@ -205,7 +206,8 @@ void Surface_RenderScalar_Plugin::changeScalarVBO(const QString& view, const QSt ...@@ -205,7 +206,8 @@ void Surface_RenderScalar_Plugin::changeScalarVBO(const QString& view, const QSt
if(vbuf) if(vbuf)
{ {
const VertexAttribute<PFP2::REAL>& attr = m->getAttribute<PFP2::REAL, VERTEX>(QString::fromStdString(vbuf->name())); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
const VertexAttribute<PFP2::REAL, PFP2::MAP::IMPL>& attr = mh->getAttribute<PFP2::REAL, VERTEX>(QString::fromStdString(vbuf->name()));
p.scalarMin = std::numeric_limits<float>::max(); p.scalarMin = std::numeric_limits<float>::max();
p.scalarMax = std::numeric_limits<float>::min(); p.scalarMax = std::numeric_limits<float>::min();
for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i)) for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i))
......
...@@ -59,7 +59,8 @@ void Surface_RenderScalar_DockTab::selectedScalarVBOChanged() ...@@ -59,7 +59,8 @@ void Surface_RenderScalar_DockTab::selectedScalarVBOChanged()
if(vbo) if(vbo)
{ {
const VertexAttribute<PFP2::REAL>& attr = map->getAttribute<PFP2::REAL, VERTEX>(QString::fromStdString(vbo->name())); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
const VertexAttribute<PFP2::REAL, PFP2::MAP::IMPL>& attr = mh->getAttribute<PFP2::REAL, VERTEX>(QString::fromStdString(vbo->name()));
p.scalarMin = std::numeric_limits<float>::max(); p.scalarMin = std::numeric_limits<float>::max();
p.scalarMax = std::numeric_limits<float>::min(); p.scalarMax = std::numeric_limits<float>::min();