Commit 49cda488 authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

Merge branch 'develop' of cgogn:~thery/CGoGNMR into develop

parents c9e91aef 38002988
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/vector_gen.h"
#include "Algo/Import/import.h"
#include "Algo/Export/export.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Geometry/normal.h"
#include "Algo/Modelisation/subdivision.h"
#include "Algo/Decimation/decimation.h"
#include "Utils/chrono.h"
#include "Algo/Filtering/average.h"
using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition of the map
typedef EmbeddedMap2 MAP ;
};
typedef PFP::MAP MAP ;
int main(int argc, char **argv)
{
if(argc != 2)
return 1;
MAP myMap;
std::vector<std::string> attrNames ;
if(!Algo::Surface::Import::importMesh<PFP>(myMap, argv[1], attrNames))
{
CGoGNerr << "could not import " << argv[1] << CGoGNendl ;
return 2;
}
VertexAttribute<PFP::VEC3, MAP> position = myMap.getAttribute<PFP::VEC3,VERTEX,MAP>( attrNames[0]) ;
Utils::Chrono chrono;
chrono.start();
Algo::Surface::Modelisation::LoopSubdivision<PFP>(myMap, position) ;
Algo::Surface::Modelisation::LoopSubdivision<PFP>(myMap, position) ;
Algo::Surface::Modelisation::LoopSubdivision<PFP>(myMap, position) ;
unsigned int nbVertices = Algo::Topo::getNbOrbits<VERTEX>(myMap) ;
std::vector<VertexAttribute<typename PFP::VEC3, MAP> *> attr;
attr.push_back(&position);
Algo::Surface::Decimation::decimate<PFP>(myMap, Algo::Surface::Decimation::S_QEM, Algo::Surface::Decimation::A_QEM, attr, nbVertices * 0.1) ;
Algo::Surface::Modelisation::LoopSubdivision<PFP>(myMap, position) ;
Algo::Surface::Modelisation::LoopSubdivision<PFP>(myMap, position) ;
nbVertices = Algo::Topo::getNbOrbits<VERTEX>(myMap) ;
Algo::Surface::Decimation::decimate<PFP>(myMap, Algo::Surface::Decimation::S_QEM, Algo::Surface::Decimation::A_QEM, attr, nbVertices * 0.1) ;
Algo::Surface::Modelisation::LoopSubdivision<PFP>(myMap, position) ;
Algo::Surface::Modelisation::LoopSubdivision<PFP>(myMap, position) ;
nbVertices = Algo::Topo::getNbOrbits<VERTEX>(myMap) ;
Algo::Surface::Decimation::decimate<PFP>(myMap, Algo::Surface::Decimation::S_QEM, Algo::Surface::Decimation::A_QEM, attr, nbVertices * 0.1) ;
Algo::Surface::Modelisation::CatmullClarkSubdivision<PFP>(myMap, position) ;
Algo::Surface::Modelisation::CatmullClarkSubdivision<PFP>(myMap, position) ;
CGoGNout << "BenchTime dynamic "<< chrono.elapsed() << " ms"<< CGoGNendl;
Algo::Surface::Export::exportOFF<PFP>(myMap,position,"bench_res.off");
return 0;
}
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap3.h"
#include "Algo/Tiling/Volume/cubic.h"
#include "Algo/Geometry/area.h"
#include "Algo/Geometry/volume.h"
#include "Utils/chrono.h"
using namespace CGoGN ;
/**
* Struct that contains some informations about the types of the manipulated objects
* Mainly here to be used by the algorithms that are parameterized by it
*/
struct PFP: public PFP_STANDARD
{
// definition of the type of the map
typedef EmbeddedMap3 MAP;
typedef double REAL;
typedef Geom::Vector<3,REAL> VEC3;
};
typedef PFP::MAP MAP;
typedef PFP::MAP::IMPL MAP_IMPL;
typedef PFP::VEC3 VEC3;
int main()
{
// declare a map to handle the mesh
MAP myMap;
Utils::Chrono ch;
ch.start();
// add position attribute on vertices and get handler on it
VertexAttribute<VEC3, MAP> position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
constexpr int nb = 100;
Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, nb, nb, nb);
cubic.embedIntoGrid(position, 10.0f, 10.0f, 10.0f);
std::cout<< "construct grid in " << ch.elapsed()<< " ms"<< std::endl;
ch.start();
VEC3 centerMesh(0,0,0);
int nbVols=0;
foreach_cell<VOLUME>(myMap, [&](Vol w) // foreach volume
{
VEC3 centerVol(0,0,0);
int nbFaces=0;
foreach_incident3<FACE>(myMap, w, [&](Face f) // foreach face of each volume
{
VEC3 centerFace(0,0,0);
int nbVert=0;
foreach_incident3<VERTEX>(myMap, f, [&](Vertex v) // foreach vertex of each face of each volume
{
centerFace += position[v];
nbVert++;
});
centerFace /=nbVert;
centerVol += centerFace;
});
centerVol /= nbFaces;
centerMesh += centerVol;
});
centerMesh /= nbVols;
CGoGNout<< "Traverse with foreach in " << ch.elapsed()<< " ms"<< CGoGNendl;
ch.start();
centerMesh=VEC3(0,0,0);
nbVols=0;
TraversorW<MAP> tw(myMap); // alias for Traversor<MAP,VERTEX>
for (Dart dw=tw.begin(); dw!=tw.end(); dw=tw.next())
{
VEC3 centerVol(0,0,0);
int nbFaces=0;
Traversor3WF<MAP> trwf(myMap, dw);
for (Dart df = trwf.begin(); df != trwf.end(); df = trwf.next())
{
VEC3 centerFace(0,0,0);
int nbVert=0;
Traversor3FV<MAP> trfv(myMap, df);
for (Dart dv = trfv.begin(); dv != trfv.end(); dv = trfv.next())
{
centerFace += position[dv];
nbVert++;
}
centerFace /=nbVert;
centerVol += centerFace;
}
centerVol /= nbFaces;
centerMesh += centerVol;
}
CGoGNout<< "Traverse with traversor in " << ch.elapsed()<< " ms"<< CGoGNendl;
ch.start();
PFP::REAL vol = Algo::Geometry::totalVolume<PFP>(myMap, position);
CGoGNout<< "Parallel volume:" << ch.elapsed()<< " ms val="<<vol<< CGoGNendl;
vol = 0;
foreach_cell<VOLUME>(myMap, [&](Vol w) // foreach volume
{
vol += Algo::Geometry::convexPolyhedronVolume<PFP>(myMap, w, position) ;
});
CGoGNout<< "Linear volume:" << ch.elapsed()<< " ms val="<<vol<< CGoGNendl;
return 0;
}
...@@ -35,6 +35,8 @@ ENDIF (WITH_QT) ...@@ -35,6 +35,8 @@ ENDIF (WITH_QT)
add_subdirectory(Examples/Tests) add_subdirectory(Examples/Tests)
add_subdirectory(Benches)
add_subdirectory(Tuto/Traversals) add_subdirectory(Tuto/Traversals)
add_subdirectory(Tuto/Attributes) add_subdirectory(Tuto/Attributes)
add_subdirectory(Tuto/Markers) add_subdirectory(Tuto/Markers)
......
...@@ -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, PFP2::MAP::IMPL> positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP> positionAttribute;
CellSelector<PFP2::MAP, VERTEX>* handleSelector; CellSelector<PFP2::MAP, VERTEX>* handleSelector;
CellSelector<PFP2::MAP, VERTEX>* freeSelector; CellSelector<PFP2::MAP, VERTEX>* freeSelector;
bool initialized; bool initialized;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionInit; VertexAttribute<PFP2::VEC3, PFP2::MAP> positionInit;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> diffCoord; VertexAttribute<PFP2::VEC3, PFP2::MAP> diffCoord;
VertexAttribute<Eigen_Matrix3f, PFP2::MAP::IMPL> vertexRotationMatrix; VertexAttribute<Eigen_Matrix3f, PFP2::MAP> vertexRotationMatrix;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> rotatedDiffCoord; VertexAttribute<PFP2::VEC3, PFP2::MAP> rotatedDiffCoord;
VertexAttribute<unsigned int, PFP2::MAP::IMPL> vIndex; VertexAttribute<unsigned int, PFP2::MAP> vIndex;
unsigned int nb_vertices; unsigned int nb_vertices;
NLContext nlContext; NLContext nlContext;
......
...@@ -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, PFP2::MAP::IMPL> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName);
if(!position.isValid()) if(!position.isValid())
return; return;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> normal = mh->getAttribute<PFP2::VEC3, VERTEX>(normalAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP> 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, PFP2::MAP::IMPL> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName);
if(!position.isValid()) if(!position.isValid())
return; return;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> normal = mh->getAttribute<PFP2::VEC3, VERTEX>(normalAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP> normal = mh->getAttribute<PFP2::VEC3, VERTEX>(normalAttributeName);
if(!normal.isValid()) if(!normal.isValid())
return; return;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> Kmax = mh->getAttribute<PFP2::VEC3, VERTEX>(KmaxAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP> 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, PFP2::MAP::IMPL> kmax = mh->getAttribute<PFP2::REAL, VERTEX>(kmaxAttributeName); VertexAttribute<PFP2::REAL, PFP2::MAP> 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, PFP2::MAP::IMPL> Kmin = mh->getAttribute<PFP2::VEC3, VERTEX>(KminAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP> 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, PFP2::MAP::IMPL> kmin = mh->getAttribute<PFP2::REAL, VERTEX>(kminAttributeName); VertexAttribute<PFP2::REAL, PFP2::MAP> 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, PFP2::MAP::IMPL> Knormal = mh->getAttribute<PFP2::VEC3, VERTEX>(KnormalAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP> 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, PFP2::MAP::IMPL> edgeAngle = mh->getAttribute<PFP2::REAL, EDGE>("edgeAngle"); EdgeAttribute<PFP2::REAL, PFP2::MAP> 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, PFP2::MAP::IMPL> kmean = mh->getAttribute<PFP2::REAL, VERTEX>("kmean"); VertexAttribute<PFP2::REAL, PFP2::MAP> 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, PFP2::MAP::IMPL> kgaussian = mh->getAttribute<PFP2::REAL, VERTEX>("kgaussian"); VertexAttribute<PFP2::REAL, PFP2::MAP> 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, PFP2::MAP::IMPL> position = map->getAttribute<PFP2::VEC3, VERTEX>(attrNames[0]); VertexAttribute<PFP2::VEC3, PFP2::MAP> position = map->getAttribute<PFP2::VEC3, VERTEX, PFP2::MAP>(attrNames[0]);
mh->registerAttribute(position); mh->registerAttribute(position);
// update corresponding VBO & emit attribute update signal // update corresponding VBO & emit attribute update signal
......
...@@ -25,7 +25,7 @@ struct MapParameters ...@@ -25,7 +25,7 @@ struct MapParameters
faceSelector(NULL) faceSelector(NULL)
{} {}
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP> positionAttribute;
CellSelector<PFP2::MAP, VERTEX>* vertexSelector; CellSelector<PFP2::MAP, VERTEX>* vertexSelector;
CellSelector<PFP2::MAP, EDGE>* edgeSelector; CellSelector<PFP2::MAP, EDGE>* edgeSelector;
......
...@@ -217,7 +217,7 @@ void Surface_Modelisation_Plugin::createEmptyMap() ...@@ -217,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, PFP2::MAP::IMPL> position = mh->addAttribute<PFP2::VEC3, VERTEX>("position"); VertexAttribute<PFP2::VEC3, PFP2::MAP> 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++;
...@@ -230,7 +230,7 @@ void Surface_Modelisation_Plugin::createNewFace(MapHandlerGen* mhg) ...@@ -230,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, PFP2::MAP::IMPL>& position = h_parameterSet[mhg].positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP>& 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());
...@@ -259,7 +259,7 @@ void Surface_Modelisation_Plugin::addCube(MapHandlerGen *mhg) ...@@ -259,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, PFP2::MAP::IMPL>& position = h_parameterSet[mhg].positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP>& 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);
...@@ -743,7 +743,7 @@ void Surface_Modelisation_Plugin::pathExtrudeFace(MapHandlerGen *mhg) ...@@ -743,7 +743,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, PFP2::MAP::IMPL>& position = p.positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP>& position = p.positionAttribute;
if(p.faceSelector && !p.faceSelector->getSelectedCells().empty()) if(p.faceSelector && !p.faceSelector->getSelectedCells().empty())
{ {
const std::vector<Face>& selectedDart = p.faceSelector->getSelectedCells(); const std::vector<Face>& selectedDart = p.faceSelector->getSelectedCells();
......
...@@ -160,7 +160,7 @@ void Surface_RenderScalar_Plugin::attributeModified(unsigned int orbit, QString ...@@ -160,7 +160,7 @@ void Surface_RenderScalar_Plugin::attributeModified(unsigned int orbit, QString
if(mapParam.scalarVBO && nameAttr == QString::fromStdString(mapParam.scalarVBO->name())) if(mapParam.scalarVBO && nameAttr == QString::fromStdString(mapParam.scalarVBO->name()))
{ {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
const VertexAttribute<PFP2::REAL, PFP2::MAP::IMPL>& attr = mh->getAttribute<PFP2::REAL, VERTEX>(nameAttr); const VertexAttribute<PFP2::REAL, PFP2::MAP>& 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))
...@@ -207,7 +207,7 @@ void Surface_RenderScalar_Plugin::changeScalarVBO(const QString& view, const QSt ...@@ -207,7 +207,7 @@ void Surface_RenderScalar_Plugin::changeScalarVBO(const QString& view, const QSt
if(vbuf) if(vbuf)
{ {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m); 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())); const VertexAttribute<PFP2::REAL, PFP2::MAP>& 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))
......
...@@ -60,7 +60,7 @@ void Surface_RenderScalar_DockTab::selectedScalarVBOChanged() ...@@ -60,7 +60,7 @@ void Surface_RenderScalar_DockTab::selectedScalarVBOChanged()
if(vbo) if(vbo)
{ {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map); 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())); const VertexAttribute<PFP2::REAL, PFP2::MAP>& 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();
for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i)) for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i))
......
...@@ -25,7 +25,7 @@ struct MapParameters ...@@ -25,7 +25,7 @@ struct MapParameters
facesScaleFactor(1.0f) facesScaleFactor(1.0f)
{} {}
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP> positionAttribute;
bool drawDarts; bool drawDarts;
QColor dartsColor; QColor dartsColor;
bool drawPhi1; bool drawPhi1;
......
...@@ -26,8 +26,8 @@ struct MapParameters ...@@ -26,8 +26,8 @@ struct MapParameters
selectionMethod(SingleCell) selectionMethod(SingleCell)
{} {}
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> positionAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP> positionAttribute;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> normalAttribute; VertexAttribute<PFP2::VEC3, PFP2::MAP> normalAttribute;
SelectionMethod selectionMethod; SelectionMethod selectionMethod;
}; };
......
...@@ -64,7 +64,7 @@ void Surface_Subdivision_Plugin::loopSubdivision( ...@@ -64,7 +64,7 @@ void Surface_Subdivision_Plugin::loopSubdivision(
if(mh == NULL) if(mh == NULL)
return; return;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName);
if(!position.isValid()) if(!position.isValid())
return; return;
...@@ -86,7 +86,7 @@ void Surface_Subdivision_Plugin::CCSubdivision( ...@@ -86,7 +86,7 @@ void Surface_Subdivision_Plugin::CCSubdivision(
if(mh == NULL) if(mh == NULL)
return; return;
VertexAttribute<PFP2::VEC3, PFP2::MAP::IMPL> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName); VertexAttribute<PFP2::VEC3, PFP2::MAP> position = mh->getAttribute<PFP2::VEC3, VERTEX>(positionAttributeName);
if(!position.isValid()) if(!position.isValid())