Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
CGoGN
Commits
256936a6
Commit
256936a6
authored
Nov 06, 2012
by
Kenneth Vanhoey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for decimation on half-edge criteria
parent
deda6b1b
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1595 additions
and
271 deletions
+1595
-271
Apps/deprecated/tp_master.cpp
Apps/deprecated/tp_master.cpp
+1
-1
include/Algo/Decimation/approximator.h
include/Algo/Decimation/approximator.h
+171
-7
include/Algo/Decimation/colorPerVertexApproximator.h
include/Algo/Decimation/colorPerVertexApproximator.h
+44
-5
include/Algo/Decimation/colorPerVertexApproximator.hpp
include/Algo/Decimation/colorPerVertexApproximator.hpp
+5
-5
include/Algo/Decimation/decimation.h
include/Algo/Decimation/decimation.h
+15
-0
include/Algo/Decimation/decimation.hpp
include/Algo/Decimation/decimation.hpp
+30
-21
include/Algo/Decimation/edgeSelector.h
include/Algo/Decimation/edgeSelector.h
+41
-23
include/Algo/Decimation/edgeSelector.hpp
include/Algo/Decimation/edgeSelector.hpp
+38
-36
include/Algo/Decimation/geometryApproximator.h
include/Algo/Decimation/geometryApproximator.h
+14
-14
include/Algo/Decimation/geometryApproximator.hpp
include/Algo/Decimation/geometryApproximator.hpp
+10
-10
include/Algo/Decimation/halfEdgeSelector.h
include/Algo/Decimation/halfEdgeSelector.h
+149
-16
include/Algo/Decimation/halfEdgeSelector.hpp
include/Algo/Decimation/halfEdgeSelector.hpp
+691
-16
include/Algo/Decimation/lightfieldApproximator.h
include/Algo/Decimation/lightfieldApproximator.h
+136
-77
include/Algo/Decimation/lightfieldApproximator.hpp
include/Algo/Decimation/lightfieldApproximator.hpp
+230
-35
include/Algo/Decimation/selector.h
include/Algo/Decimation/selector.h
+18
-3
include/Algo/ProgressiveMesh/pmesh.h
include/Algo/ProgressiveMesh/pmesh.h
+1
-1
include/Algo/ProgressiveMesh/pmesh.hpp
include/Algo/ProgressiveMesh/pmesh.hpp
+1
-1
No files found.
Apps/deprecated/tp_master.cpp
View file @
256936a6
...
...
@@ -371,7 +371,7 @@ void MyQT::cb_initGL()
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
m_render_topo
=
new
Algo
::
Render
::
GL2
::
TopoRender
()
;
m_ds
=
new
Utils
::
Drawer
();
m_ds
=
new
Utils
::
Drawer
()
;
// create VBO for position
m_positionVBO
=
new
Utils
::
VBO
();
...
...
include/Algo/Decimation/approximator.h
View file @
256936a6
...
...
@@ -48,8 +48,8 @@ enum ApproximatorType
A_Lightfield
,
// note: the following "h" prefix means that half-edges are prioritized instead of edges.
A_hHalfCollapse
,
A_hQEM
// A_hLightfieldHalf,
A_hQEM
,
A_hLightfieldHalf
}
;
template
<
typename
PFP
>
...
...
@@ -81,7 +81,8 @@ public:
virtual
void
addDetail
(
Dart
d
,
double
amount
,
bool
sign
,
typename
PFP
::
MATRIX33
*
detailTransform
)
=
0
;
}
;
template
<
typename
PFP
,
typename
T
>
template
<
typename
PFP
,
typename
T
,
unsigned
int
ORBIT
>
class
Approximator
:
public
ApproximatorGen
<
PFP
>
{
public:
...
...
@@ -93,8 +94,8 @@ protected:
Predictor
<
PFP
,
T
>*
m_predictor
;
std
::
vector
<
VertexAttribute
<
T
>*
>
m_attrV
;
// vertex attributes to be approximated
std
::
vector
<
EdgeAttribute
<
T
>
>
m_approx
;
// attributes to store approximation result
std
::
vector
<
EdgeAttribute
<
T
>
>
m_detail
;
// attributes to store detail information for reconstruction
std
::
vector
<
AttributeHandler
<
T
,
ORBI
T
>
>
m_approx
;
// attributes to store approximation result
std
::
vector
<
AttributeHandler
<
T
,
ORBI
T
>
>
m_detail
;
// attributes to store detail information for reconstruction
std
::
vector
<
T
>
m_app
;
public:
...
...
@@ -115,13 +116,13 @@ public:
std
::
stringstream
aname
;
aname
<<
"approx_"
<<
m_attrV
[
i
]
->
name
()
;
m_approx
[
i
]
=
this
->
m_map
.
template
addAttribute
<
T
,
EDGE
>(
aname
.
str
())
;
m_approx
[
i
]
=
this
->
m_map
.
template
addAttribute
<
T
,
ORBIT
>(
aname
.
str
())
;
if
(
m_predictor
)
// if predictors are associated to the approximator
{
// create attributes to store the details needed for reconstruction
std
::
stringstream
dname
;
dname
<<
"detail_"
<<
m_attrV
[
i
]
->
name
()
;
m_detail
[
i
]
=
this
->
m_map
.
template
addAttribute
<
T
,
EDGE
>(
dname
.
str
())
;
m_detail
[
i
]
=
this
->
m_map
.
template
addAttribute
<
T
,
ORBIT
>(
dname
.
str
())
;
}
}
}
...
...
@@ -244,6 +245,169 @@ public:
}
}
;
//template <typename PFP, typename T>
//class ApproximatorEdge : public ApproximatorGen<PFP>
//{
//public:
// typedef typename PFP::MAP MAP ;
// typedef typename PFP::VEC3 VEC3 ;
// typedef typename PFP::REAL REAL ;
//
//protected:
// Predictor<PFP, T>* m_predictor ;
//
// std::vector<VertexAttribute<T>* > m_attrV ; // vertex attributes to be approximated
// std::vector<EdgeAttribute<T> > m_approx ; // attributes to store approximation result
// std::vector<EdgeAttribute<T> > m_detail ; // attributes to store detail information for reconstruction
// std::vector<T> m_app ;
//
//public:
// ApproximatorEdge(MAP& m, std::vector<VertexAttribute<T>* > va, Predictor<PFP, T> * predictor) :
// ApproximatorGen<PFP>(m), m_predictor(predictor), m_attrV(va)
// {
// const unsigned int& size = m_attrV.size() ;
// assert(size > 0 || !"ApproximatorEdge: no attributes provided") ;
//
// m_approx.resize(size) ;
// m_detail.resize(size) ;
// m_app.resize(size) ;
//
// for (unsigned int i = 0 ; i < size ; ++i)
// {
// if (!m_attrV[i]->isValid())
// std::cerr << "ApproximatorEdge Warning: attribute number " << i << " is not valid" << std::endl ;
//
// std::stringstream aname ;
// aname << "approx_" << m_attrV[i]->name() ;
// m_approx[i] = this->m_map.template addAttribute<T, EDGE>(aname.str()) ;
//
// if(m_predictor) // if predictors are associated to the approximator
// { // create attributes to store the details needed for reconstruction
// std::stringstream dname ;
// dname << "detail_" << m_attrV[i]->name() ;
// m_detail[i] = this->m_map.template addAttribute<T, EDGE>(dname.str()) ;
// }
// }
// }
//
// virtual ~ApproximatorEdge()
// {
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// {
// this->m_map.template removeAttribute(m_approx[i]) ;
// if(m_predictor)
// this->m_map.template removeAttribute(m_detail[i]) ;
// }
// }
//
// const std::string& getApproximatedAttributeName(unsigned int index = 0) const
// {
// return m_attrV[index]->name() ;
// }
//
//// std::vector<std::string> getApproximatedAttributeNames() const
//// {
//// std::vector<std::string> names ;
//// names.resize(m_attrV.size()) ;
//// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
//// names[i] = m_attrV[i]->name() ;
////
//// return names ;
//// }
//
// unsigned int getNbApproximated() const
// {
// return m_attrV.size() ;
// }
//
// void saveApprox(Dart d)
// {
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// m_app[i] = m_approx[i][d] ;
// }
//
// void affectApprox(Dart d)
// {
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// m_attrV[i]->operator[](d) = m_app[i] ;
// }
//
// const T& getApprox(Dart d, unsigned int index = 0) const
// {
// return m_approx[index][d] ;
// }
//
// std::vector<T> getAllApprox(Dart d) const
// {
// std::vector<T> res ;
// res.resize(m_attrV.size()) ;
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// res[i] = m_approx[i][d] ;
//
// return res ;
// }
//
// const Predictor<PFP, T>* getPredictor() const
// {
// return m_predictor ;
// }
//
// const T& getDetail(Dart d, unsigned int index = 0) const
// {
// assert(m_predictor || !"Trying to get detail on a non-predictive scheme") ;
// return m_detail[index][d] ;
// }
//
// std::vector<T> getAllDetail(Dart d) const
// {
// assert(m_predictor || !"Trying to get detail on a non-predictive scheme") ;
//
// std::vector<T> res ;
// res.resize(m_attrV.size()) ;
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// res[i] = m_detail[i][d] ;
// return res ;
// }
//
// void setDetail(Dart d, unsigned int index, T& val)
// {
// assert(m_predictor || !"Trying to set detail on a non-predictive scheme") ;
// m_detail[index][d] = val ;
// }
//
// void setDetail(Dart d, std::vector<T>& val)
// {
// assert(m_predictor || !"Trying to set detail on a non-predictive scheme") ;
//
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// m_detail[index][d] = val[i] ;
// }
//
//
//// // TODO works only for vector types !!
//// REAL detailMagnitude(Dart d)
//// {
//// assert(m_predictor || !"Trying to get detail magnitude on a non-predictive scheme") ;
//// return m_detail[d].norm2() ;
//// }
//
// void addDetail(Dart d, double amount, bool sign, typename PFP::MATRIX33* detailTransform)
// {
// assert(m_predictor || !"Trying to add detail on a non-predictive scheme") ;
//
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// {
// T det = m_detail[i][d] ;
// if(detailTransform)
// det = (*detailTransform) * det ;
// det *= amount ;
// if(!sign)
// det *= REAL(-1) ;
// m_attrV[i]->operator[](d) += det ;
// }
// }
//} ;
}
//namespace Decimation
}
//namespace Algo
...
...
include/Algo/Decimation/colorPerVertexApproximator.h
View file @
256936a6
...
...
@@ -38,7 +38,7 @@ namespace Decimation
{
template
<
typename
PFP
>
class
Approximator_ColorNaive
:
public
Approximator
<
PFP
,
typename
PFP
::
VEC3
>
class
Approximator_ColorNaive
:
public
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
EDGE
>
{
public:
typedef
typename
PFP
::
MAP
MAP
;
...
...
@@ -53,7 +53,7 @@ protected:
public:
Approximator_ColorNaive
(
MAP
&
m
,
std
::
vector
<
VertexAttribute
<
VEC3
>*
>&
attr
,
Predictor
<
PFP
,
VEC3
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
VEC3
>
(
m
,
attr
,
pred
)
Approximator
<
PFP
,
VEC3
,
EDGE
>
(
m
,
attr
,
pred
)
{
m_color
=
this
->
m_attrV
[
0
]
;
}
...
...
@@ -82,7 +82,7 @@ public:
}
;
template
<
typename
PFP
>
class
Approximator_ColorQEMext
:
public
Approximator
<
PFP
,
typename
PFP
::
VEC3
>
class
Approximator_ColorQEMext
:
public
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
EDGE
>
{
public:
typedef
typename
PFP
::
MAP
MAP
;
...
...
@@ -91,13 +91,13 @@ public:
typedef
Geom
::
Vector
<
6
,
REAL
>
VEC6
;
protected:
VertexAttribute
<
QuadricNd
<
REAL
,
6
>
>
m_quadric
;
VertexAttribute
<
Utils
::
QuadricNd
<
REAL
,
6
>
>
m_quadric
;
VertexAttribute
<
VEC3
>
*
m_position
;
VertexAttribute
<
VEC3
>
*
m_color
;
public:
Approximator_ColorQEMext
(
MAP
&
m
,
std
::
vector
<
VertexAttribute
<
VEC3
>*
>&
attr
,
Predictor
<
PFP
,
VEC3
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
VEC3
>
(
m
,
attr
,
pred
)
Approximator
<
PFP
,
VEC3
,
EDGE
>
(
m
,
attr
,
pred
)
{
assert
(
attr
.
size
()
>
1
||
!
"Approximator_ColorQEMext: there are not sufficient attributes provided"
)
;
...
...
@@ -118,6 +118,45 @@ public:
void
approximate
(
Dart
d
)
;
}
;
/*
template <typename PFP>
class Approximator_ColorQEMextHalfCollapse : public Approximator<PFP, typename PFP::VEC3>
{
public:
typedef typename PFP::MAP MAP ;
typedef typename PFP::REAL REAL ;
typedef typename PFP::VEC3 VEC3 ;
typedef Geom::Vector<6,REAL> VEC6 ;
protected:
VertexAttribute<Utils::QuadricNd<REAL,6> > m_quadric ;
VertexAttribute<VEC3> *m_position ;
VertexAttribute<VEC3> *m_color ;
public:
Approximator_ColorQEMextHalfCollapse(MAP& m, std::vector<VertexAttribute<VEC3>* >& attr, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, attr, pred)
{
assert(attr.size() > 1 || !"Approximator_ColorQEMext_HalfCollapse: there are not sufficient attributes provided") ;
m_position = this->m_attrV[0] ;
m_color = this->m_attrV[1] ;
}
~Approximator_ColorQEMextHalfCollapse()
{}
ApproximatorType getType() const
{
return A_ColorQEMextHalfCollapse ;
}
bool init() ;
void approximate(Dart d) ;
} ;
*/
}
//namespace Decimation
}
//namespace Algo
...
...
include/Algo/Decimation/colorPerVertexApproximator.hpp
View file @
256936a6
...
...
@@ -56,7 +56,7 @@ void Approximator_ColorNaive<PFP>::approximate(Dart d)
template
<
typename
PFP
>
bool
Approximator_ColorQEMext
<
PFP
>::
init
()
{
m_quadric
=
this
->
m_map
.
template
getAttribute
<
QuadricNd
<
REAL
,
6
>,
VERTEX
>
(
"QEMext-quadric"
)
;
m_quadric
=
this
->
m_map
.
template
getAttribute
<
Utils
::
QuadricNd
<
REAL
,
6
>,
VERTEX
>
(
"QEMext-quadric"
)
;
// Does not require to be valid (if it is not, altenatives will be used).
if
(
this
->
m_predictor
)
...
...
@@ -75,7 +75,7 @@ void Approximator_ColorQEMext<PFP>::approximate(Dart d)
// get some darts
Dart
dd
=
m
.
phi2
(
d
)
;
QuadricNd
<
REAL
,
6
>
q1
,
q2
;
Utils
::
QuadricNd
<
REAL
,
6
>
q1
,
q2
;
if
(
!
m_quadric
.
isValid
())
// if the selector is not QEM, compute local error quadrics
{
// compute the error quadric associated to v1
...
...
@@ -93,7 +93,7 @@ void Approximator_ColorQEMext<PFP>::approximate(Dart d)
p2
[
i
+
3
]
=
this
->
m_attrV
[
1
]
->
operator
[](
m
.
phi_1
(
it
))[
i
]
;
}
QuadricNd
<
REAL
,
6
>
q
(
p0
,
p1
,
p2
)
;
Utils
::
QuadricNd
<
REAL
,
6
>
q
(
p0
,
p1
,
p2
)
;
q1
+=
q
;
it
=
m
.
phi2_1
(
it
)
;
}
while
(
it
!=
d
)
;
...
...
@@ -113,7 +113,7 @@ void Approximator_ColorQEMext<PFP>::approximate(Dart d)
p2
[
i
+
3
]
=
this
->
m_attrV
[
1
]
->
operator
[](
m
.
phi_1
(
it
))[
i
]
;
}
QuadricNd
<
REAL
,
6
>
q
(
p0
,
p1
,
p2
)
;
Utils
::
QuadricNd
<
REAL
,
6
>
q
(
p0
,
p1
,
p2
)
;
q2
+=
q
;
it
=
m
.
phi2_1
(
it
)
;
}
while
(
it
!=
dd
)
;
...
...
@@ -124,7 +124,7 @@ void Approximator_ColorQEMext<PFP>::approximate(Dart d)
q2
=
m_quadric
[
dd
]
;
}
QuadricNd
<
REAL
,
6
>
quad
;
Utils
::
QuadricNd
<
REAL
,
6
>
quad
;
quad
+=
q1
;
// compute the sum of the
quad
+=
q2
;
// two vertices quadrics
...
...
include/Algo/Decimation/decimation.h
View file @
256936a6
...
...
@@ -40,6 +40,20 @@ namespace Algo
namespace
Decimation
{
/**
* Decimate the mesh through edge contraction
* by using a selector and approximator scheme.
*
* \param map the map to decimate
* \param s the SelectorType
* \param a the ApproximatorType
* \param position the vertex position embeddings
* \param nbWantedVertices the aimed amount of vertices after decimation
* \param selected the selector stipulating which darts are eligible for contraction
* \param edgeErrors will (if not null) contain the edge errors computed by the approximator/selector (default NULL)
* \param callback_wrapper a callback function for progress monitoring (default NULL)
* \param callback_object the object to call the callback on (default NULL)
*/
template
<
typename
PFP
>
void
decimate
(
typename
PFP
::
MAP
&
map
,
...
...
@@ -48,6 +62,7 @@ void decimate(
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
>
*>&
position
,
unsigned
int
nbWantedVertices
,
const
FunctorSelect
&
selected
=
allDarts
,
VertexAttribute
<
typename
PFP
::
VEC3
>
*
edgeErrors
=
NULL
,
void
(
*
callback_wrapper
)(
void
*
,
const
void
*
)
=
NULL
,
void
*
callback_object
=
NULL
)
;
...
...
include/Algo/Decimation/decimation.hpp
View file @
256936a6
...
...
@@ -35,6 +35,7 @@ template <typename PFP>
void
decimate
(
typename
PFP
::
MAP
&
map
,
SelectorType
s
,
ApproximatorType
a
,
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
>*
>&
attribs
,
unsigned
int
nbWantedVertices
,
const
FunctorSelect
&
selected
,
EdgeAttribute
<
typename
PFP
::
REAL
>
*
edgeErrors
,
void
(
*
callback_wrapper
)(
void
*
,
const
void
*
),
void
*
callback_object
)
{
...
...
@@ -92,27 +93,27 @@ void decimate(
// pos
approximators
.
push_back
(
new
Approximator_QEMhalfEdge
<
PFP
>
(
map
,
attribs
))
;
break
;
//
case A_hLightfieldHalf:
//
{
//
v_approx = new std::vector<VertexAttribute<typename PFP::VEC3>* >[3] ;
//
//
// pos
//
v_approx[0].push_back(attribs[0]) ;
// approximators.push_back(new Approximator_HalfCollaps
e<PFP>(map, v_approx[0])) ;
//
//
// frame
// assert(attribs.size() >= 4 || !"Decimate: A_
LightfieldHalf --> not enough attribs provided") ;
//
for (unsigned int i = 0 ; i < 3 ; ++i)
//
v_approx[1].push_back(attribs[i+1]) ;
// approximators.push_back(new Approximator_FrameHalf
<PFP>(map, v_approx[1])) ;
//
//
// hemifunction
// assert(attribs.size() >= 5 || !"Decimate: A_
LightfieldHalf --> not enough attribs provided") ;
//
for (unsigned int i = 0 ; i < attribs.size() - 4 ; ++i)
//
v_approx[2].push_back(attribs[i+4]) ;
// approximators.push_back(new Approximator_LightfieldCoefsHalf
<PFP>(map, v_approx[2])) ;
//
}
//
break ;
case
A_hLightfieldHalf
:
{
v_approx
=
new
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
>*
>
[
3
]
;
// pos
v_approx
[
0
].
push_back
(
attribs
[
0
])
;
approximators
.
push_back
(
new
Approximator_QEMhalfEdg
e
<
PFP
>
(
map
,
v_approx
[
0
]))
;
// frame
assert
(
attribs
.
size
()
>=
4
||
!
"Decimate: A_h
LightfieldHalf --> not enough attribs provided"
)
;
for
(
unsigned
int
i
=
0
;
i
<
3
;
++
i
)
v_approx
[
1
].
push_back
(
attribs
[
i
+
1
])
;
approximators
.
push_back
(
new
Approximator_FrameInterpolationHalfEdge
<
PFP
>
(
map
,
v_approx
[
1
]))
;
// hemifunction
assert
(
attribs
.
size
()
>=
5
||
!
"Decimate: A_h
LightfieldHalf --> not enough attribs provided"
)
;
for
(
unsigned
int
i
=
0
;
i
<
attribs
.
size
()
-
4
;
++
i
)
v_approx
[
2
].
push_back
(
attribs
[
i
+
4
])
;
approximators
.
push_back
(
new
Approximator_HemiFuncCoefsHalfEdge
<
PFP
>
(
map
,
v_approx
[
2
]))
;
}
break
;
case
A_Lightfield
:
{
v_approx
=
new
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
>*
>
[
3
]
;
...
...
@@ -165,12 +166,18 @@ void decimate(
case
S_QEMextColor
:
selector
=
new
EdgeSelector_QEMextColor
<
PFP
>
(
map
,
position
,
approximators
,
selected
)
;
break
;
case
S_hQEMextColor
:
selector
=
new
HalfEdgeSelector_QEMextColor
<
PFP
>
(
map
,
position
,
approximators
,
selected
)
;
break
;
case
S_hQEMml
:
selector
=
new
HalfEdgeSelector_QEMml
<
PFP
>
(
map
,
position
,
approximators
,
selected
)
;
break
;
case
S_Lightfield
:
selector
=
new
EdgeSelector_Lightfield
<
PFP
>
(
map
,
position
,
approximators
,
selected
)
;
break
;
case
S_hLightfield
:
selector
=
new
HalfEdgeSelector_Lightfield
<
PFP
>
(
map
,
position
,
approximators
,
selected
)
;
break
;
}
for
(
typename
std
::
vector
<
ApproximatorGen
<
PFP
>*>::
iterator
it
=
approximators
.
begin
();
it
!=
approximators
.
end
();
++
it
)
...
...
@@ -188,6 +195,8 @@ void decimate(
return
;
}
if
(
edgeErrors
!=
NULL
)
selector
->
getEdgeErrors
(
edgeErrors
)
;
unsigned
int
nbVertices
=
map
.
template
getNbOrbits
<
VERTEX
>()
;
bool
finished
=
false
;
...
...
include/Algo/Decimation/edgeSelector.h
View file @
256936a6
...
...
@@ -163,13 +163,13 @@ private:
typedef
NoMathIOAttribute
<
QEMedgeInfo
>
EdgeInfo
;
EdgeAttribute
<
EdgeInfo
>
edgeInfo
;
VertexAttribute
<
Quadric
<
REAL
>
>
quadric
;
Quadric
<
REAL
>
tmpQ
;
VertexAttribute
<
Utils
::
Quadric
<
REAL
>
>
quadric
;
Utils
::
Quadric
<
REAL
>
tmpQ
;
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
Approximator
<
PFP
,
typename
PFP
::
VEC3
>*
m_positionApproximator
;
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
EDGE
>*
m_positionApproximator
;
void
initEdgeInfo
(
Dart
d
)
;
void
updateEdgeInfo
(
Dart
d
,
bool
recompute
)
;
...
...
@@ -181,7 +181,7 @@ public:
m_positionApproximator
(
NULL
)
{
edgeInfo
=
m
.
template
addAttribute
<
EdgeInfo
,
EDGE
>(
"edgeInfo"
)
;
quadric
=
m
.
template
addAttribute
<
Quadric
<
REAL
>,
VERTEX
>
(
"QEMquadric"
)
;
quadric
=
m
.
template
addAttribute
<
Utils
::
Quadric
<
REAL
>,
VERTEX
>
(
"QEMquadric"
)
;
}
~
EdgeSelector_QEM
()
{
...
...
@@ -215,12 +215,12 @@ private:
typedef
NoMathIOAttribute
<
QEMedgeInfo
>
EdgeInfo
;
EdgeAttribute
<
EdgeInfo
>
edgeInfo
;
VertexAttribute
<
Quadric
<
REAL
>
>
quadric
;
VertexAttribute
<
Utils
::
Quadric
<
REAL
>
>
quadric
;
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
Approximator
<
PFP
,
typename
PFP
::
VEC3
>*
m_positionApproximator
;
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
EDGE
>*
m_positionApproximator
;
void
initEdgeInfo
(
Dart
d
)
;
void
updateEdgeInfo
(
Dart
d
,
bool
recompute
)
;
...
...
@@ -233,7 +233,7 @@ public:
m_positionApproximator
(
NULL
)
{
edgeInfo
=
m
.
template
addAttribute
<
EdgeInfo
,
EDGE
>(
"edgeInfo"
)
;
quadric
=
m
.
template
addAttribute
<
Quadric
<
REAL
>,
VERTEX
>
(
"QEMquadric"
)
;
quadric
=
m
.
template
addAttribute
<
Utils
::
Quadric
<
REAL
>,
VERTEX
>
(
"QEMquadric"
)
;
}
~
EdgeSelector_QEMml
()
{
...
...
@@ -281,7 +281,7 @@ private:
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
Approximator
<
PFP
,
VEC3
>*
m_positionApproximator
;
Approximator
<
PFP
,
VEC3
,
EDGE
>*
m_positionApproximator
;
void
initEdgeInfo
(
Dart
d
)
;
void
updateEdgeInfo
(
Dart
d
,
bool
recompute
)
;
...
...
@@ -369,7 +369,7 @@ private:
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
Approximator
<
PFP
,
typename
PFP
::
VEC3
>*
m_positionApproximator
;
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
EDGE
>*
m_positionApproximator
;
void
initEdgeInfo
(
Dart
d
)
;
void
updateEdgeInfo
(
Dart
d
,
bool
recompute
)
;
...
...
@@ -416,13 +416,13 @@ private:
typedef
NoMathIOAttribute
<
ColorNaiveedgeInfo
>
EdgeInfo
;
EdgeAttribute
<
EdgeInfo
>
edgeInfo
;
VertexAttribute
<
Quadric
<
REAL
>
>
m_quadric
;
VertexAttribute
<
Utils
::
Quadric
<
REAL
>
>
m_quadric
;
VertexAttribute
<
VEC3
>
m_pos
,
m_color
;
int
m_approxindex_pos
,
m_attrindex_pos
;
int
m_approxindex_color
,
m_attrindex_color
;
std
::
vector
<
Approximator
<
PFP
,
typename
PFP
::
VEC3
>*
>
m_approx
;
std
::
vector
<
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
EDGE
>*
>
m_approx
;
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
...
...
@@ -441,7 +441,7 @@ public:
m_attrindex_color
(
-
1
)
{
edgeInfo
=
m
.
template
addAttribute
<
EdgeInfo
,
EDGE
>(
"edgeInfo"
)
;
m_quadric
=
m
.
template
addAttribute
<
Quadric
<
REAL
>,
VERTEX
>
(
"QEMquadric"
)
;
m_quadric
=
m
.
template
addAttribute
<
Utils
::
Quadric
<
REAL
>,
VERTEX
>
(
"QEMquadric"
)
;
}
~
EdgeSelector_ColorNaive
()
{
...
...
@@ -479,13 +479,13 @@ private:
typedef
NoMathIOAttribute
<
QEMextColorEdgeInfo
>
EdgeInfo
;
EdgeAttribute
<
EdgeInfo
>
edgeInfo
;
VertexAttribute
<
QuadricNd
<
REAL
,
6
>
>
m_quadric
;
VertexAttribute
<
Utils
::
QuadricNd
<
REAL
,
6
>
>
m_quadric
;
VertexAttribute
<
VEC3
>
m_pos
,
m_color
;
int
m_approxindex_pos
,
m_attrindex_pos
;
int
m_approxindex_color
,
m_attrindex_color
;
std
::
vector
<
Approximator
<
PFP
,
typename
PFP
::
VEC3
>*
>
m_approx
;
std
::
vector
<
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
EDGE
>*
>
m_approx
;
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
...
...
@@ -504,7 +504,7 @@ public:
m_attrindex_color
(
-
1
)
{
edgeInfo
=
m
.
template
addAttribute
<
EdgeInfo
,
EDGE
>(
"edgeInfo"
)
;
m_quadric
=
m
.
template
addAttribute
<
QuadricNd
<
REAL
,
6
>,
VERTEX
>
(
"QEMext-quadric"
)
;
m_quadric
=
m
.
template
addAttribute
<
Utils
::
QuadricNd
<
REAL
,
6
>,
VERTEX
>
(
"QEMext-quadric"
)
;
}
~
EdgeSelector_QEMextColor
()
{
...
...
@@ -538,8 +538,8 @@ private:
typename
std
::
multimap
<
float
,
Dart
>::
iterator
it
;
bool
valid
;
static
std
::
string
CGoGNnameOfType
()
{
return
"QEMextColorEdgeInfo"
;
}
}
QEMextColor
EdgeInfo
;
typedef
NoMathIOAttribute
<
QEMextColor
EdgeInfo
>
EdgeInfo
;
}
Lightfield
EdgeInfo
;
typedef
NoMathIOAttribute
<
Lightfield
EdgeInfo
>
EdgeInfo
;
EdgeAttribute
<
EdgeInfo
>
edgeInfo
;
...
...
@@ -550,10 +550,10 @@ private:
std
::
vector
<
unsigned
int
>
m_approxindex_HF
,
m_attrindex_HF
;
unsigned
int
m_K
;
VertexAttribute
<
Quadric
<
REAL
>
>
m_quadricGeom
;
EdgeAttribute
<
QuadricHF
<
REAL
>
>
m_quadricHF
;
VertexAttribute
<
Utils
::
Quadric
<
REAL
>
>
m_quadricGeom
;
EdgeAttribute
<
Utils
::
QuadricHF
<
REAL
>
>
m_quadricHF
;
std
::
vector
<
Approximator
<
PFP
,
typename
PFP
::
VEC3
>*
>
m_approx
;