Commit 773f4665 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

correctifs passage au typage d'orbite

parent 8997f1b9
......@@ -195,7 +195,7 @@ int decimate(
return -1 ; // init failed
}
unsigned int nbVertices = map.template getNbOrbits<VERTEX>() ;
unsigned int nbVertices = Algo::Topo::getNbOrbits<VERTEX>(map) ;
bool finished = false ;
while(!finished)
......
......@@ -71,7 +71,7 @@ void computeNormalVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT&
template <typename PFP, typename V_ATT>
typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart d, const V_ATT& position) ;
typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Edge d, const V_ATT& position) ;
template <typename PFP, typename V_ATT, typename E_ATT>
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const V_ATT& position, E_ATT& angles, unsigned int thread = 0) ;
......
......@@ -60,7 +60,7 @@ private:
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& position ;
DartMarker<MAP>& inactiveMarker ;
DartMarker<MAP>& inactiveMarker ;
Algo::Surface::Decimation::Selector<PFP>* m_selector ;
std::vector<Algo::Surface::Decimation::ApproximatorGen<PFP>*> m_approximators ;
......@@ -82,15 +82,15 @@ private:
public:
ProgressiveMesh(
MAP& map,
DartMarker<MAP>& inactive,
DartMarker<MAP>& inactive,
Algo::Surface::Decimation::SelectorType s,
Algo::Surface::Decimation::ApproximatorType a,
VertexAttribute<VEC3, MAP_IMPL>& position
) ;
ProgressiveMesh(
MAP& map, DartMarker& inactive,
MAP& map, DartMarker<MAP>& inactive,
Algo::Surface::Decimation::Selector<PFP>* selector, std::vector<Algo::Surface::Decimation::ApproximatorGen<PFP>*>& approximators,
VertexAttribute<typename PFP::VEC3>& position) ;
VertexAttribute<VEC3,MAP_IMPL>& position) ;
~ProgressiveMesh() ;
bool initOk() { return m_initOk ; }
......
......@@ -39,7 +39,7 @@ namespace PMesh
template <typename PFP>
ProgressiveMesh<PFP>::ProgressiveMesh(
MAP& map,
DartMarker<MAP>& inactive,
DartMarker<MAP>& inactive,
Algo::Surface::Decimation::SelectorType s,
Algo::Surface::Decimation::ApproximatorType a,
VertexAttribute<VEC3, MAP_IMPL>& pos
......@@ -87,22 +87,22 @@ ProgressiveMesh<PFP>::ProgressiveMesh(
switch(s)
{
case Algo::Surface::Decimation::S_MapOrder : {
m_selector = new Algo::Surface::Decimation::EdgeSelector_MapOrder<PFP>(m_map, positionsTable, m_approximators) ;
m_selector = new Algo::Surface::Decimation::EdgeSelector_MapOrder<PFP>(m_map, position, m_approximators) ;
break ; }
case Algo::Surface::Decimation::S_Random : {
m_selector = new Algo::Surface::Decimation::EdgeSelector_Random<PFP>(m_map, positionsTable, m_approximators) ;
m_selector = new Algo::Surface::Decimation::EdgeSelector_Random<PFP>(m_map, position, m_approximators) ;
break ; }
case Algo::Surface::Decimation::S_EdgeLength : {
m_selector = new Algo::Surface::Decimation::EdgeSelector_Length<PFP>(m_map, positionsTable, m_approximators) ;
m_selector = new Algo::Surface::Decimation::EdgeSelector_Length<PFP>(m_map, position, m_approximators) ;
break ; }
case Algo::Surface::Decimation::S_QEM : {
m_selector = new Algo::Surface::Decimation::EdgeSelector_QEM<PFP>(m_map, positionsTable, m_approximators) ;
m_selector = new Algo::Surface::Decimation::EdgeSelector_QEM<PFP>(m_map, position, m_approximators) ;
break ; }
case Algo::Surface::Decimation::S_MinDetail : {
m_selector = new Algo::Surface::Decimation::EdgeSelector_MinDetail<PFP>(m_map, positionsTable, m_approximators) ;
m_selector = new Algo::Surface::Decimation::EdgeSelector_MinDetail<PFP>(m_map, position, m_approximators) ;
break ; }
case Algo::Surface::Decimation::S_Curvature : {
m_selector = new Algo::Surface::Decimation::EdgeSelector_Curvature<PFP>(m_map, positionsTable, m_approximators) ;
m_selector = new Algo::Surface::Decimation::EdgeSelector_Curvature<PFP>(m_map, position, m_approximators) ;
break ; }
}
CGoGNout << "..done" << CGoGNendl ;
......@@ -137,11 +137,11 @@ ProgressiveMesh<PFP>::ProgressiveMesh(
template <typename PFP>
ProgressiveMesh<PFP>::ProgressiveMesh(
MAP& map, DartMarker& inactive,
MAP& map, DartMarker<MAP>& inactive,
Algo::Surface::Decimation::Selector<PFP>* selector, std::vector<Algo::Surface::Decimation::ApproximatorGen<PFP>*>& approximators,
VertexAttribute<typename PFP::VEC3>& position
VertexAttribute<VEC3,MAP_IMPL>& position
) :
m_map(map), m_selector(selector), m_approximators(approximators), positionsTable(position), inactiveMarker(inactive)
m_map(map), m_selector(selector), m_approximators(approximators), position(position), inactiveMarker(inactive)
{
CGoGNout << " initializing approximators.." << CGoGNflush ;
for(typename std::vector<Algo::Surface::Decimation::ApproximatorGen<PFP>*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it)
......@@ -187,7 +187,7 @@ ProgressiveMesh<PFP>::~ProgressiveMesh()
template <typename PFP>
void ProgressiveMesh<PFP>::createPM(unsigned int percentWantedVertices)
{
unsigned int nbVertices = m_map.template getNbOrbits<VERTEX>() ;
unsigned int nbVertices = Algo::Topo::getNbOrbits<VERTEX>(m_map) ;
unsigned int nbWantedVertices = nbVertices * percentWantedVertices / 100 ;
CGoGNout << " creating PM (" << nbVertices << " vertices).." << /* flush */ CGoGNendl ;
......@@ -543,7 +543,7 @@ float ProgressiveMesh<PFP>::computeDistance2()
float distance = 0; // sum of 2-distance between original vertices and new vertices
gotoLevel(0) ; // mesh reconstruction from detail vectors
DartMarker mUpdate(m_map) ;
DartMarker<MAP> mUpdate(m_map) ;
for(Dart d = m_map.begin(); d != m_map.end(); m_map.next(d)) // vertices loop
{
if(!mUpdate.isMarked(d))
......
......@@ -71,7 +71,7 @@ public:
*/
template<typename PFP, unsigned int ORBIT>
void updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboColor, typename PFP::MAP& map,
const VertexAttribute<typename PFP::VEC3>& positions, const AttributeHandler<typename PFP::VEC3,ORBIT>& colorPerXXX) ;
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& positions, const AttributeHandler<typename PFP::VEC3,ORBIT,typename PFP::MAP::IMPL>& colorPerXXX) ;
/**
* update drawing buffers
......@@ -85,7 +85,7 @@ public:
*/
template<typename PFP, unsigned int ORBIT>
void updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboNormal, Utils::VBO& vboColor, typename PFP::MAP& map,
const VertexAttribute<typename PFP::VEC3>& positions, const VertexAttribute<typename PFP::VEC3>& normals, const AttributeHandler<typename PFP::VEC3,ORBIT>& colorPerXXX) ;
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& positions, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& normals, const AttributeHandler<typename PFP::VEC3,ORBIT,typename PFP::MAP::IMPL>& colorPerXXX) ;
/**
......
......@@ -51,7 +51,7 @@ m_nbTris(0)
template<typename PFP, unsigned int ORBIT>
void ColorPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboColor, typename PFP::MAP& map,
const VertexAttribute<typename PFP::VEC3>& positions, const AttributeHandler<typename PFP::VEC3,ORBIT>& colorPerXXX)
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& positions, const AttributeHandler<typename PFP::VEC3,ORBIT, typename PFP::MAP::IMPL>& colorPerXXX)
{
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
......@@ -101,8 +101,8 @@ void ColorPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboColor
template<typename PFP, unsigned int ORBIT>
void ColorPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboNormal, Utils::VBO& vboColor, typename PFP::MAP& map,
const VertexAttribute<typename PFP::VEC3>& positions, const VertexAttribute<typename PFP::VEC3>& normals,
const AttributeHandler<typename PFP::VEC3,ORBIT>& colorPerXXX)
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& positions, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& normals,
const AttributeHandler<typename PFP::VEC3,ORBIT, typename PFP::MAP::IMPL>& colorPerXXX)
{
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
......
......@@ -70,7 +70,7 @@ public:
*/
template<typename PFP, unsigned int ORBIT, typename T>
void updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboData, typename PFP::MAP& map,
const VertexAttribute<typename PFP::VEC3>& positions, const AttributeHandler<T,ORBIT>& dataPerXXX) ;
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& positions, const AttributeHandler<T,ORBIT, typename PFP::MAP::IMPL>& dataPerXXX) ;
/**
* draw
......
......@@ -50,7 +50,7 @@ m_nbTris(0)
template<typename PFP, unsigned int ORBIT, typename T>
void
DataPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboData, typename PFP::MAP& map,
const VertexAttribute<typename PFP::VEC3>& positions, const AttributeHandler<T,ORBIT>& dataPerXXX)
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& positions, const AttributeHandler<T,ORBIT, typename PFP::MAP::IMPL>& dataPerXXX)
{
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
......
......@@ -28,6 +28,8 @@
#include "Container/fakeAttribute.h"
#include "Geometry/basic.h"
#include "Topology/generic/traversor/traversor2.h"
/*****************************************
* Class hierarchy :
* Collector (virtual)
......
......@@ -119,7 +119,7 @@ void Collector_OneRing<PFP>::collectAll(Dart d)
this->insideVertices.push_back(d);
foreach_incident2<EDGE>(this->map, d, [&] (Edge e)
foreach_incident2<EDGE>(this->map, Vertex(d), [&] (Edge e)
{
this->insideEdges.push_back(e);
this->insideFaces.push_back(e.dart);
......@@ -133,7 +133,7 @@ void Collector_OneRing<PFP>::collectBorder(Dart d)
this->init(d);
this->border.reserve(12);
foreach_incident2<FACE>(this->map, d, [&] (Face f)
foreach_incident2<FACE>(this->map, Vertex(d), [&] (Face f)
{
this->border.push_back(this->map.phi1(f.dart));
});
......@@ -146,7 +146,7 @@ typename PFP::REAL Collector_OneRing<PFP>::computeArea(const VertexAttribute<VEC
REAL area = 0;
for (std::vector<Dart>::const_iterator it = this->insideFaces.begin(); it != this->insideFaces.end(); ++it)
for (std::vector<Face>::const_iterator it = this->insideFaces.begin(); it != this->insideFaces.end(); ++it)
area += Algo::Surface::Geometry::triangleArea<PFP>(this->map, *it, pos);
return area;
......@@ -160,7 +160,7 @@ void Collector_OneRing<PFP>::computeNormalCyclesTensor (const VertexAttribute<VE
tensor.zero() ;
// collect edges inside the neighborhood
for (std::vector<Dart>::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it)
for (std::vector<Edge>::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it)
{
const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart<PFP>(this->map, *it, pos) ;
tensor += Geom::transposed_vectors_mult(e,e) * edgeangle[*it] * (1 / e.norm()) ;
......@@ -169,7 +169,7 @@ void Collector_OneRing<PFP>::computeNormalCyclesTensor (const VertexAttribute<VE
// collect edges on the border
// TODO : should be an option ?
// TODO : not boundary safe
for (std::vector<Dart>::const_iterator it = this->border.begin(); it != this->border.end(); ++it)
for (std::vector<Dart>::const_iterator it = this->border.begin(); it != this->border.end(); ++it)
{
const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart<PFP>(this->map, *it, pos) ;
tensor += Geom::transposed_vectors_mult(e,e) * edgeangle[*it] * (1 / e.norm()) ;
......@@ -186,7 +186,7 @@ void Collector_OneRing<PFP>::computeNormalCyclesTensor (const VertexAttribute<VE
tensor.zero() ;
// collect edges inside the neighborhood
for (std::vector<Dart>::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it)
for (std::vector<Edge>::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it)
{
const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart<PFP>(this->map, *it, pos) ;
const REAL edgeangle = Algo::Surface::Geometry::computeAngleBetweenNormalsOnEdge<PFP>(this->map, *it, pos) ;
......@@ -196,7 +196,7 @@ void Collector_OneRing<PFP>::computeNormalCyclesTensor (const VertexAttribute<VE
// collect edges on the border
// TODO : should be an option ?
// TODO : not boundary safe
for (std::vector<Dart>::const_iterator it = this->border.begin(); it != this->border.end(); ++it)
for (std::vector<Dart>::const_iterator it = this->border.begin(); it != this->border.end(); ++it)
{
const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart<PFP>(this->map, *it, pos) ;
const REAL edgeangle = Algo::Surface::Geometry::computeAngleBetweenNormalsOnEdge<PFP>(this->map, *it, pos) ;
......@@ -272,7 +272,7 @@ typename PFP::REAL Collector_OneRing_AroundEdge<PFP>::computeArea(const VertexAt
REAL area = 0;
for (std::vector<Dart>::const_iterator it = this->insideFaces.begin(); it != this->insideFaces.end(); ++it)
for (std::vector<Face>::const_iterator it = this->insideFaces.begin(); it != this->insideFaces.end(); ++it)
area += Algo::Surface::Geometry::triangleArea<PFP>(this->map, *it, pos);
return area;
......@@ -286,7 +286,7 @@ void Collector_OneRing_AroundEdge<PFP>::computeNormalCyclesTensor (const VertexA
tensor.zero() ;
// collect edges inside the neighborhood
for (std::vector<Dart>::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it)
for (std::vector<Edge>::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it)
{
const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart<PFP>(this->map, *it, pos) ;
tensor += Geom::transposed_vectors_mult(e,e) * edgeangle[*it] * (1 / e.norm()) ;
......@@ -312,7 +312,7 @@ void Collector_OneRing_AroundEdge<PFP>::computeNormalCyclesTensor (const VertexA
tensor.zero() ;
// collect edges inside the neighborhood
for (std::vector<Dart>::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it)
for (std::vector<Edge>::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it)
{
const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart<PFP>(this->map, *it, pos) ;
const REAL edgeangle = Algo::Surface::Geometry::computeAngleBetweenNormalsOnEdge<PFP>(this->map, *it, pos) ;
......@@ -518,12 +518,12 @@ void Collector_WithinSphere<PFP>::computeNormalCyclesTensor(const VertexAttribut
tensor += Geom::transposed_vectors_mult(e,e) * edgeangle * (1 / e.norm()) ;
}
// collect edges crossing the neighborhood's border
for (std::vector<Dart>::const_iterator it = this->border.begin(); it != this->border.end(); ++it)
for (std::vector<Dart>::iterator it = this->border.begin(); it != this->border.end(); ++it)
{
const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart<PFP>(this->map, *it, pos) ;
REAL alpha ;
Algo::Surface::Geometry::intersectionSphereEdge<PFP>(this->map, centerPosition, radius, *it, pos, alpha) ;
const REAL edgeangle = Algo::Surface::Geometry::computeAngleBetweenNormalsOnEdge<PFP>(this->map, *it, pos) ;
const REAL edgeangle = Algo::Surface::Geometry::computeAngleBetweenNormalsOnEdge<PFP>(this->map, Edge(*it), pos) ;
tensor += Geom::transposed_vectors_mult(e,e) * edgeangle * (1 / e.norm()) * alpha ;
}
......
......@@ -47,7 +47,7 @@ public:
Cell(): dart() {}
/// constructor from Dart
inline Cell(Dart d): dart(d) {}
inline Cell(Dart d): dart(d) {}
/// copy constructor
inline Cell(const Cell<ORBIT>& c): dart(c.dart) {}
......
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