Commit d574eb73 authored by Pierre Kraemer's avatar Pierre Kraemer

SCHNApps en bonne voie..

parent 13c0da82
......@@ -28,19 +28,19 @@ struct MapParameters
void start(MapHandlerGen* mh);
void stop(MapHandlerGen* mh);
VertexAttribute<PFP2::VEC3> positionAttribute;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionAttribute;
CellSelector<VERTEX>* handleSelector;
CellSelector<VERTEX>* freeSelector;
CellSelector<PFP2::MAP, VERTEX>* handleSelector;
CellSelector<PFP2::MAP, VERTEX>* freeSelector;
bool initialized;
VertexAttribute<PFP2::VEC3> positionInit;
VertexAttribute<PFP2::VEC3> diffCoord;
VertexAttribute<Eigen_Matrix3f> vertexRotationMatrix;
VertexAttribute<PFP2::VEC3> rotatedDiffCoord;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionInit;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> diffCoord;
VertexAttribute<Eigen_Matrix3f, PFP2::MAP::IMPL> vertexRotationMatrix;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> rotatedDiffCoord;
VertexAttribute<unsigned int> vIndex;
VertexAttribute<unsigned int, PFP2::MAP::IMPL> vIndex;
unsigned int nb_vertices;
NLContext nlContext;
......
......@@ -25,12 +25,14 @@ MapParameters::~MapParameters()
nlDeleteContext(nlContext);
}
void MapParameters::start(MapHandlerGen* mh)
void MapParameters::start(MapHandlerGen* mhg)
{
if(!initialized)
{
if(positionAttribute.isValid() && handleSelector && freeSelector)
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(mhg);
positionInit = mh->getAttribute<PFP2::VEC3, VERTEX>("positionInit", false);
if(!positionInit.isValid())
positionInit = mh->addAttribute<PFP2::VEC3, VERTEX>("positionInit", false);
......@@ -60,7 +62,7 @@ void MapParameters::start(MapHandlerGen* mh)
for(unsigned int i = vertexRotationMatrix.begin(); i != vertexRotationMatrix.end(); vertexRotationMatrix.next(i))
vertexRotationMatrix[i] = Eigen::Matrix3f::Identity();
nb_vertices = static_cast<AttribMap*>(map)->computeIndexCells<VERTEX>(vIndex);
nb_vertices = map->computeIndexCells<VERTEX>(vIndex);
if(nlContext)
nlDeleteContext(nlContext);
......@@ -317,7 +319,8 @@ void Surface_Deformation_Plugin::changePositionAttribute(const QString& map, con
MapParameters& p = h_parameterSet[m];
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())
m_dockTab->updateMapParameters();
}
......@@ -332,7 +335,8 @@ void Surface_Deformation_Plugin::changeHandleSelector(const QString& map, const
MapParameters& p = h_parameterSet[m];
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())
m_dockTab->updateMapParameters();
}
......@@ -347,7 +351,8 @@ void Surface_Deformation_Plugin::changeFreeSelector(const QString& map, const QS
MapParameters& p = h_parameterSet[m];
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())
m_dockTab->updateMapParameters();
}
......@@ -406,7 +411,7 @@ void Surface_Deformation_Plugin::asRigidAsPossible(MapHandlerGen* mh)
if(p.initialized)
{
CellMarkerNoUnmark<VERTEX> m(*map) ;
CellMarkerNoUnmark<PFP2::MAP, VERTEX> m(*map) ;
for(Dart d = map->begin(); d != map->end(); map->next(d))
{
......
......@@ -37,7 +37,10 @@ void Surface_Deformation_DockTab::positionAttributeChanged(int index)
if(index == 0)
;
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)
{
MapHandlerGen* map = m_schnapps->getSelectedMap();
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)
{
MapHandlerGen* map = m_schnapps->getSelectedMap();
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(
if(mh == NULL)
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())
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())
normal = mh->addAttribute<PFP2::VEC3, VERTEX>(normalAttributeName);
......@@ -219,35 +219,35 @@ void Surface_DifferentialProperties_Plugin::computeCurvature(
if(mh == NULL)
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())
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())
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())
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())
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())
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())
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())
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())
edgeAngle = mh->addAttribute<PFP2::REAL, EDGE>("edgeAngle");
......@@ -269,7 +269,7 @@ void Surface_DifferentialProperties_Plugin::computeCurvature(
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())
kmean = mh->addAttribute<PFP2::REAL, VERTEX>("kmean");
......@@ -281,7 +281,7 @@ void Surface_DifferentialProperties_Plugin::computeCurvature(
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())
kgaussian = mh->addAttribute<PFP2::REAL, VERTEX>("kgaussian");
......
......@@ -37,7 +37,7 @@ MapHandlerGen* Surface_Import_Plugin::importFromFile(const QString& fileName)
Algo::Surface::Import::importMesh<PFP2>(*map, fileName.toStdString(), attrNames);
// 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);
// update corresponding VBO & emit attribute update signal
......
......@@ -25,11 +25,11 @@ struct MapParameters
faceSelector(NULL)
{}
VertexAttribute<PFP2::VEC3> positionAttribute;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionAttribute;
CellSelector<VERTEX>* vertexSelector;
CellSelector<EDGE>* edgeSelector;
CellSelector<FACE>* faceSelector;
CellSelector<PFP2::MAP, VERTEX>* vertexSelector;
CellSelector<PFP2::MAP, EDGE>* edgeSelector;
CellSelector<PFP2::MAP, FACE>* faceSelector;
};
class Surface_Modelisation_Plugin : public PluginInteraction
......
......@@ -159,7 +159,8 @@ void Surface_Modelisation_Plugin::changePositionAttribute(const QString& view, c
MapHandlerGen* m = m_schnapps->getMap(map);
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())
m_dockTab->updateMapParameters();
}
......@@ -170,8 +171,8 @@ void Surface_Modelisation_Plugin::changeVertexSelector(const QString& map, const
MapHandlerGen* m = m_schnapps->getMap(map);
if(m)
{
MapParameters& p = h_parameterSet[m];
p.vertexSelector = m->getCellSelector<VERTEX>(name);
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
h_parameterSet[m].vertexSelector = mh->getCellSelector<VERTEX>(name);
if(m->isSelectedMap())
m_dockTab->updateMapParameters();
}
......@@ -182,8 +183,8 @@ void Surface_Modelisation_Plugin::changeEdgeSelector(const QString& map, const Q
MapHandlerGen* m = m_schnapps->getMap(map);
if(m)
{
MapParameters& p = h_parameterSet[m];
p.edgeSelector = m->getCellSelector<EDGE>(name);
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
h_parameterSet[m].edgeSelector = mh->getCellSelector<EDGE>(name);
if(m->isSelectedMap())
m_dockTab->updateMapParameters();
}
......@@ -194,8 +195,8 @@ void Surface_Modelisation_Plugin::changeFaceSelector(const QString& map, const Q
MapHandlerGen* m = m_schnapps->getMap(map);
if(m)
{
MapParameters& p = h_parameterSet[m];
p.faceSelector = m->getCellSelector<FACE>(name);
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
h_parameterSet[m].faceSelector = mh->getCellSelector<FACE>(name);
if(m->isSelectedMap())
m_dockTab->updateMapParameters();
}
......@@ -216,7 +217,7 @@ void Surface_Modelisation_Plugin::createEmptyMap()
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(mhg);
// 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
mh->notifyAttributeModification(position);
mapNumber++;
......@@ -229,7 +230,7 @@ void Surface_Modelisation_Plugin::createNewFace(MapHandlerGen* mhg)
PFP2::MAP* map = mh->getMap();
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)
{
Dart d = map->newFace(collectedVertices.size());
......@@ -258,7 +259,7 @@ void Surface_Modelisation_Plugin::addCube(MapHandlerGen *mhg)
PFP2::MAP* map = mh->getMap();
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);
......@@ -355,16 +356,17 @@ void Surface_Modelisation_Plugin::splitSurface(MapHandlerGen* mhg)
else isPath = false;
}
CellMarker<PFP2::MAP, VERTEX> vm(*map);
if (isPath)
{
for(std::vector<Dart>::iterator it = path.begin() ; it != path.end()-1; ++it)
{
if (isPath)
{
CellMarker<VERTEX>* vm = new CellMarker<VERTEX>(*map);
if(vm->isMarked(*it))
{
if(vm.isMarked(*it))
isPath = false;
vm->mark(*it);
vm.mark(*it);
std::vector<Dart>::iterator next;
next = it + 1 ;
......@@ -738,7 +740,7 @@ void Surface_Modelisation_Plugin::pathExtrudeFace(MapHandlerGen *mhg)
PFP2::MAP* map = mh->getMap();
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())
{
const std::vector<Dart>& selectedDart = p.faceSelector->getSelectedCells();
......
......@@ -41,7 +41,10 @@ void Surface_Modelisation_DockTab::positionAttributeChanged(int index)
{
MapHandlerGen* map = m_schnapps->getSelectedMap();
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)
{
MapHandlerGen* map = m_schnapps->getSelectedMap();
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)
{
MapHandlerGen* map = m_schnapps->getSelectedMap();
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)
{
MapHandlerGen* map = m_schnapps->getSelectedMap();
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
MapParameters& mapParam = viewParamSet[map];
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.scalarMax = std::numeric_limits<float>::min();
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
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.scalarMax = std::numeric_limits<float>::min();
for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i))
......
......@@ -59,7 +59,8 @@ void Surface_RenderScalar_DockTab::selectedScalarVBOChanged()
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.scalarMax = std::numeric_limits<float>::min();
for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i))
......
......@@ -25,7 +25,7 @@ struct MapParameters
facesScaleFactor(1.0f)
{}
VertexAttribute<PFP2::VEC3> positionAttribute;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionAttribute;
bool drawDarts;
QColor dartsColor;
bool drawPhi1;
......
......@@ -40,10 +40,10 @@ void Surface_RenderTopo_DockTab::positionAttributeChanged(int index)
MapHandlerGen* map = m_schnapps->getSelectedMap();
if(view && map)
{
if(index == 0)
;
else
m_plugin->h_viewParameterSet[view][map].positionAttribute = map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText());
// if(index == 0)
// ;
// else
// m_plugin->h_viewParameterSet[view][map].positionAttribute = map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText());
view->updateGL();
}
}
......
......@@ -26,8 +26,8 @@ struct MapParameters
selectionMethod(SingleCell)
{}
VertexAttribute<PFP2::VEC3> positionAttribute;
VertexAttribute<PFP2::VEC3> normalAttribute;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionAttribute;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> normalAttribute;
SelectionMethod selectionMethod;
};
......
......@@ -586,7 +586,8 @@ void Surface_Selection_Plugin::changePositionAttribute(const QString& map, const
MapHandlerGen* m = m_schnapps->getMap(map);
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())
m_dockTab->updateMapParameters();
}
......@@ -597,7 +598,8 @@ void Surface_Selection_Plugin::changeNormalAttribute(const QString& map, const Q
MapHandlerGen* m = m_schnapps->getMap(map);
if(m)
{
h_parameterSet[m].normalAttribute = m->getAttribute<PFP2::VEC3, VERTEX>(name);
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
h_parameterSet[m].normalAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(name);
if(m->isSelectedMap())
m_dockTab->updateMapParameters();
}
......
......@@ -31,7 +31,10 @@ void Surface_Selection_DockTab::positionAttributeChanged(int index)
{
MapHandlerGen* map = m_schnapps->getSelectedMap();
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());
}
}
}
......@@ -41,7 +44,10 @@ void Surface_Selection_DockTab::normalAttributeChanged(int index)
{
MapHandlerGen* map = m_schnapps->getSelectedMap();
if(map)
m_plugin->h_parameterSet[map].normalAttribute = map->getAttribute<PFP2::VEC3, VERTEX>(combo_normalAttribute->currentText());
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].normalAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(combo_normalAttribute->currentText());
}
}
}
......
......@@ -64,7 +64,7 @@ void Surface_Subdivision_Plugin::loopSubdivision(
if(mh == NULL)
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())
return;
......@@ -86,7 +86,7 @@ void Surface_Subdivision_Plugin::CCSubdivision(
if(mh == NULL)
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())
return;
......@@ -108,7 +108,7 @@ void Surface_Subdivision_Plugin::trianguleFaces(
if(mh == NULL)
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())
return;
......
......@@ -37,7 +37,7 @@ MapHandlerGen* Volume_Import_Plugin::importFromFile(const QString& fileName)
Algo::Volume::Import::importMesh<PFP3>(*map, fileName.toStdString(), attrNames);
// get vertex position attribute
VertexAttribute<PFP3::VEC3> position = map->getAttribute<PFP3::VEC3, VERTEX>(attrNames[0]);
VertexAttribute<PFP3::VEC3, PFP3::MAP::IMPL> position = map->getAttribute<PFP3::VEC3, VERTEX>(attrNames[0]);
mh->registerAttribute(position);
// update corresponding VBO & emit attribute update signal
......
......@@ -92,11 +92,11 @@ protected:
QList<CellSelectorGen*> m_mutuallyExclusive;
};
template <unsigned int ORBIT>
template <typename MAP, unsigned int ORBIT>
class CellSelector : public CellSelectorGen
{
public:
CellSelector(GenericMap& map, const QString& name, unsigned int thread = 0) :
CellSelector(MAP& map, const QString& name, unsigned int thread = 0) :
CellSelectorGen(name),
m_map(map),
m_cm(map, thread)
......@@ -107,7 +107,7 @@ public:
inline unsigned int getOrbit() { return ORBIT; }
inline const CellMarker<ORBIT>& getMarker() { return m_cm; }
inline const CellMarker<MAP, ORBIT>& getMarker() { return m_cm; }
inline void select(Dart d, bool emitSignal = true)
{
......@@ -131,12 +131,12 @@ public:
{
if(m_cm.isMarked(d))
{
unsigned int v = m_map.getEmbedding<ORBIT>(d);
unsigned int v = m_map.template getEmbedding<ORBIT>(d);
bool found = false;
unsigned int i;
for(i = 0; i < m_cells.size() && !found; ++i)
{
if(m_map.getEmbedding<ORBIT>(m_cells[i]) == v)
if(m_map.template getEmbedding<ORBIT>(m_cells[i]) == v)
found = true ;
}
if(found)
......@@ -160,7 +160,7 @@ public:
void rebuild()
{
m_cells.clear();
TraversorCell<GenericMap, ORBIT> t(m_map, true);
TraversorCell<MAP, ORBIT> t(m_map, true);
for(Dart d = t.begin(); d != t.end(); d = t.next())
{
if(m_cm.isMarked(d))
......@@ -170,8 +170,8 @@ public:
}
private:
GenericMap& m_map;
CellMarker<ORBIT> m_cm;
MAP& m_map;
CellMarker<MAP, ORBIT> m_cm;
};
} // namespace SCHNApps
......
......@@ -85,12 +85,6 @@ public:
* MANAGE ATTRIBUTES
*********************************************************/
template <typename T, unsigned int ORBIT>
AttributeHandler<T, ORBIT> getAttribute(const QString& nameAttr, bool onlyRegistered = true) const;
template <typename T, unsigned int ORBIT>
AttributeHandler<T, ORBIT> addAttribute(const QString& nameAttr, bool registerAttr = true);