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
ea93f7ca
Commit
ea93f7ca
authored
Oct 26, 2012
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding catmull-clark and sqrt(3) lazy wavelets
parent
d25284ab
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
1874 additions
and
617 deletions
+1874
-617
Apps/Tuto/tuto_oper3.cpp
Apps/Tuto/tuto_oper3.cpp
+3
-0
include/Algo/Decimation/edgeSelector.h
include/Algo/Decimation/edgeSelector.h
+5
-5
include/Algo/Decimation/edgeSelector.hpp
include/Algo/Decimation/edgeSelector.hpp
+72
-12
include/Algo/DecimationVolumes/approximator.h
include/Algo/DecimationVolumes/approximator.h
+11
-37
include/Algo/DecimationVolumes/decimator.hpp
include/Algo/DecimationVolumes/decimator.hpp
+25
-26
include/Algo/DecimationVolumes/edgeSelector.h
include/Algo/DecimationVolumes/edgeSelector.h
+131
-46
include/Algo/DecimationVolumes/edgeSelector.hpp
include/Algo/DecimationVolumes/edgeSelector.hpp
+133
-118
include/Algo/DecimationVolumes/geometryApproximator.h
include/Algo/DecimationVolumes/geometryApproximator.h
+5
-10
include/Algo/DecimationVolumes/geometryApproximator.hpp
include/Algo/DecimationVolumes/geometryApproximator.hpp
+10
-61
include/Algo/DecimationVolumes/selector.h
include/Algo/DecimationVolumes/selector.h
+9
-56
include/Algo/Multiresolution/Map2MR/Filters/catmullClark.h
include/Algo/Multiresolution/Map2MR/Filters/catmullClark.h
+455
-0
include/Algo/Multiresolution/Map2MR/Filters/sqrt2.h
include/Algo/Multiresolution/Map2MR/Filters/sqrt2.h
+97
-0
include/Algo/Multiresolution/Map2MR/Filters/sqrt3.h
include/Algo/Multiresolution/Map2MR/Filters/sqrt3.h
+324
-0
include/Algo/Multiresolution/Map2MR/Masks/sqrt3.h
include/Algo/Multiresolution/Map2MR/Masks/sqrt3.h
+130
-0
include/Algo/Multiresolution/Map2MR/lerpAttributes.h
include/Algo/Multiresolution/Map2MR/lerpAttributes.h
+245
-0
include/Algo/Multiresolution/Map2MR/map2MR_PM.h
include/Algo/Multiresolution/Map2MR/map2MR_PM.h
+22
-1
include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp
+41
-59
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h
+3
-4
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
+61
-17
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
+16
-0
include/Topology/generic/functor.h
include/Topology/generic/functor.h
+27
-0
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+5
-4
include/Topology/map/map2.h
include/Topology/map/map2.h
+6
-15
src/Topology/map/embeddedMap3.cpp
src/Topology/map/embeddedMap3.cpp
+20
-46
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+12
-16
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+6
-84
No files found.
Apps/Tuto/tuto_oper3.cpp
View file @
ea93f7ca
...
@@ -650,11 +650,14 @@ void MyQT::importMesh(std::string& filename)
...
@@ -650,11 +650,14 @@ void MyQT::importMesh(std::string& filename)
else
else
{
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
}
m_selected
=
NIL
;
m_selected
=
NIL
;
m_selected2
=
NIL
;
m_selected2
=
NIL
;
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_ex3
,
nb
);
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
setParamObject
(
bb
.
maxSize
(),
bb
.
center
().
data
())
;
setParamObject
(
bb
.
maxSize
(),
bb
.
center
().
data
())
;
m_shift
=
bb
.
maxSize
()
/
200.0
f
;
m_shift
=
bb
.
maxSize
()
/
200.0
f
;
...
...
include/Algo/Decimation/edgeSelector.h
View file @
ea93f7ca
...
@@ -97,7 +97,7 @@ public:
...
@@ -97,7 +97,7 @@ public:
{}
{}
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateWithoutCollapse
()
{
}
void
updateWithoutCollapse
()
;
}
;
}
;
template
<
typename
PFP
>
template
<
typename
PFP
>
...
@@ -142,7 +142,7 @@ public:
...
@@ -142,7 +142,7 @@ public:
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateWithoutCollapse
()
{
}
void
updateWithoutCollapse
()
;
}
;
}
;
template
<
typename
PFP
>
template
<
typename
PFP
>
...
@@ -246,7 +246,7 @@ public:
...
@@ -246,7 +246,7 @@ public:
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateWithoutCollapse
()
{
}
void
updateWithoutCollapse
()
;
}
;
}
;
template
<
typename
PFP
>
template
<
typename
PFP
>
...
@@ -344,7 +344,7 @@ public:
...
@@ -344,7 +344,7 @@ public:
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateWithoutCollapse
()
{
}
void
updateWithoutCollapse
()
;
}
;
}
;
template
<
typename
PFP
>
template
<
typename
PFP
>
...
@@ -392,7 +392,7 @@ public:
...
@@ -392,7 +392,7 @@ public:
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateBeforeCollapse
(
Dart
d
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateWithoutCollapse
()
{
}
void
updateWithoutCollapse
()
;
}
;
}
;
/*****************************************************************************************************************
/*****************************************************************************************************************
...
...
include/Algo/Decimation/edgeSelector.hpp
View file @
ea93f7ca
...
@@ -69,6 +69,7 @@ void EdgeSelector_MapOrder<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
...
@@ -69,6 +69,7 @@ void EdgeSelector_MapOrder<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
}
}
}
}
/************************************************************************************
/************************************************************************************
* RANDOM *
* RANDOM *
************************************************************************************/
************************************************************************************/
...
@@ -126,6 +127,22 @@ void EdgeSelector_Random<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
...
@@ -126,6 +127,22 @@ void EdgeSelector_Random<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
}
while
(
!
this
->
m_select
(
cur
)
||
!
m
.
edgeCanCollapse
(
darts
[
cur
]))
;
}
while
(
!
this
->
m_select
(
cur
)
||
!
m
.
edgeCanCollapse
(
darts
[
cur
]))
;
}
}
template
<
typename
PFP
>
void
EdgeSelector_Random
<
PFP
>::
updateWithoutCollapse
()
{
MAP
&
m
=
this
->
m_map
;
allSkipped
=
false
;
do
{
++
cur
;
if
(
cur
==
darts
.
size
())
{
cur
=
0
;
allSkipped
=
true
;
}
}
while
(
!
this
->
m_select
(
cur
)
||
!
m
.
edgeCanCollapse
(
darts
[
cur
]))
;
}
/************************************************************************************
/************************************************************************************
* EDGE LENGTH *
* EDGE LENGTH *
************************************************************************************/
************************************************************************************/
...
@@ -222,6 +239,17 @@ void EdgeSelector_Length<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
...
@@ -222,6 +239,17 @@ void EdgeSelector_Length<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
cur
=
edges
.
begin
()
;
// set the current edge to the first one
cur
=
edges
.
begin
()
;
// set the current edge to the first one
}
}
template
<
typename
PFP
>
void
EdgeSelector_Length
<
PFP
>::
updateWithoutCollapse
()
{
EdgeInfo
&
einfo
=
edgeInfo
[(
*
cur
).
second
]
;
einfo
.
valid
=
false
;
edges
.
erase
(
einfo
.
it
)
;
//edges.erase(cur) ;
cur
=
edges
.
begin
();
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
EdgeSelector_Length
<
PFP
>::
initEdgeInfo
(
Dart
d
)
void
EdgeSelector_Length
<
PFP
>::
initEdgeInfo
(
Dart
d
)
{
{
...
@@ -417,6 +445,17 @@ void EdgeSelector_QEM<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
...
@@ -417,6 +445,17 @@ void EdgeSelector_QEM<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
cur
=
edges
.
begin
()
;
// set the current edge to the first one
cur
=
edges
.
begin
()
;
// set the current edge to the first one
}
}
template
<
typename
PFP
>
void
EdgeSelector_QEM
<
PFP
>::
updateWithoutCollapse
()
{
EdgeInfo
&
einfo
=
edgeInfo
[(
*
cur
).
second
]
;
einfo
.
valid
=
false
;
edges
.
erase
(
einfo
.
it
)
;
//edges.erase(cur) ;
cur
=
edges
.
begin
();
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
EdgeSelector_QEM
<
PFP
>::
initEdgeInfo
(
Dart
d
)
void
EdgeSelector_QEM
<
PFP
>::
initEdgeInfo
(
Dart
d
)
{
{
...
@@ -479,18 +518,6 @@ void EdgeSelector_QEM<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
...
@@ -479,18 +518,6 @@ void EdgeSelector_QEM<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
einfo
.
valid
=
true
;
einfo
.
valid
=
true
;
}
}
template
<
typename
PFP
>
void
EdgeSelector_QEM
<
PFP
>::
updateWithoutCollapse
()
{
EdgeInfo
&
einfo
=
edgeInfo
[(
*
cur
).
second
]
;
einfo
.
valid
=
false
;
edges
.
erase
(
einfo
.
it
)
;
//edges.erase(cur) ;
cur
=
edges
.
begin
();
}
/************************************************************************************
/************************************************************************************
* QUADRIC ERROR METRIC (Memoryless version) *
* QUADRIC ERROR METRIC (Memoryless version) *
************************************************************************************/
************************************************************************************/
...
@@ -660,6 +687,17 @@ void EdgeSelector_QEMml<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
...
@@ -660,6 +687,17 @@ void EdgeSelector_QEMml<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
cur
=
edges
.
begin
()
;
// set the current edge to the first one
cur
=
edges
.
begin
()
;
// set the current edge to the first one
}
}
template
<
typename
PFP
>
void
EdgeSelector_QEMml
<
PFP
>::
updateWithoutCollapse
()
{
EdgeInfo
&
einfo
=
edgeInfo
[(
*
cur
).
second
]
;
einfo
.
valid
=
false
;
edges
.
erase
(
einfo
.
it
)
;
//edges.erase(cur) ;
cur
=
edges
.
begin
();
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
EdgeSelector_QEMml
<
PFP
>::
initEdgeInfo
(
Dart
d
)
void
EdgeSelector_QEMml
<
PFP
>::
initEdgeInfo
(
Dart
d
)
{
{
...
@@ -839,6 +877,17 @@ void EdgeSelector_Curvature<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
...
@@ -839,6 +877,17 @@ void EdgeSelector_Curvature<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
cur
=
edges
.
begin
()
;
// set the current edge to the first one
cur
=
edges
.
begin
()
;
// set the current edge to the first one
}
}
template
<
typename
PFP
>
void
EdgeSelector_Curvature
<
PFP
>::
updateWithoutCollapse
()
{
EdgeInfo
&
einfo
=
edgeInfo
[(
*
cur
).
second
]
;
einfo
.
valid
=
false
;
edges
.
erase
(
einfo
.
it
)
;
//edges.erase(cur) ;
cur
=
edges
.
begin
();
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
EdgeSelector_Curvature
<
PFP
>::
initEdgeInfo
(
Dart
d
)
void
EdgeSelector_Curvature
<
PFP
>::
initEdgeInfo
(
Dart
d
)
{
{
...
@@ -1039,6 +1088,17 @@ void EdgeSelector_MinDetail<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
...
@@ -1039,6 +1088,17 @@ void EdgeSelector_MinDetail<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
cur
=
edges
.
begin
()
;
// set the current edge to the first one
cur
=
edges
.
begin
()
;
// set the current edge to the first one
}
}
template
<
typename
PFP
>
void
EdgeSelector_MinDetail
<
PFP
>::
updateWithoutCollapse
()
{
EdgeInfo
&
einfo
=
edgeInfo
[(
*
cur
).
second
]
;
einfo
.
valid
=
false
;
edges
.
erase
(
einfo
.
it
)
;
//edges.erase(cur) ;
cur
=
edges
.
begin
();
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
EdgeSelector_MinDetail
<
PFP
>::
initEdgeInfo
(
Dart
d
)
void
EdgeSelector_MinDetail
<
PFP
>::
initEdgeInfo
(
Dart
d
)
{
{
...
...
include/Algo/DecimationVolumes/approximator.h
View file @
ea93f7ca
...
@@ -39,7 +39,8 @@ namespace DecimationVolumes
...
@@ -39,7 +39,8 @@ namespace DecimationVolumes
enum
ApproximatorType
enum
ApproximatorType
{
{
A_QEM
A_QEM
,
A_MidEdge
};
};
template
<
typename
PFP
>
template
<
typename
PFP
>
...
@@ -61,12 +62,10 @@ public:
...
@@ -61,12 +62,10 @@ public:
virtual
const
std
::
string
&
getApproximatedAttributeName
()
const
=
0
;
virtual
const
std
::
string
&
getApproximatedAttributeName
()
const
=
0
;
virtual
ApproximatorType
getType
()
const
=
0
;
virtual
ApproximatorType
getType
()
const
=
0
;
virtual
bool
init
()
=
0
;
virtual
bool
init
()
=
0
;
virtual
void
approximate
(
Dart
d
)
=
0
;
virtual
void
saveApprox
(
Dart
d
)
=
0
;
virtual
void
affectApprox
(
Dart
d
)
=
0
;
virtual
const
PredictorGen
<
PFP
>*
getPredictor
()
const
=
0
;
virtual
const
PredictorGen
<
PFP
>*
getPredictor
()
const
=
0
;
virtual
void
approximate
(
Operator
<
PFP
>*
op
)
=
0
;
virtual
void
saveApprox
(
Operator
<
PFP
>*
op
)
=
0
;
virtual
void
affectApprox
(
Operator
<
PFP
>*
op
)
=
0
;
virtual
void
approximate
(
Dart
d
)
=
0
;
}
;
}
;
...
@@ -123,46 +122,21 @@ public:
...
@@ -123,46 +122,21 @@ public:
return
m_approx
[
d
]
;
return
m_approx
[
d
]
;
}
}
const
Predictor
<
PFP
,
T
>*
getPredictor
()
const
void
saveApprox
(
Dart
d
)
{
{
return
m_predictor
;
m_app
=
m_approx
[
d
]
;
}
}
const
T
&
getDetail
(
Dart
d
)
const
void
affectApprox
(
Dart
d
)
{
{
assert
(
m_predictor
||
!
"Trying to get detail on a non-predictive scheme"
)
;
m_attrV
[
d
]
=
m_app
;
return
m_detail
[
d
]
;
}
}
void
setDetail
(
Dart
d
,
T
&
val
)
const
Predictor
<
PFP
,
T
>*
getPredictor
()
const
{
assert
(
m_predictor
||
!
"Trying to set detail on a non-predictive scheme"
)
;
m_detail
[
d
]
=
val
;
}
virtual
void
saveApprox
(
Operator
<
PFP
>*
op
)
{
Dart
d
=
op
->
getEdge
();
m_app
=
m_approx
[
d
];
}
virtual
void
affectApprox
(
Operator
<
PFP
>*
op
)
{
{
Dart
d
=
op
->
getEdge
();
return
m_predictor
;
m_attrV
[
d
]
=
m_app
;
}
}
// void saveApprox(Dart d)
// {
// m_app = m_approx[d] ;
// }
//
// void affectApprox(Dart d)
// {
// m_attrV[d] = m_app ;
// }
};
};
...
...
include/Algo/DecimationVolumes/decimator.hpp
View file @
ea93f7ca
...
@@ -38,13 +38,13 @@ void decimate(
...
@@ -38,13 +38,13 @@ void decimate(
)
)
{
{
std
::
vector
<
ApproximatorGen
<
PFP
>*>
approximators
;
std
::
vector
<
ApproximatorGen
<
PFP
>*>
approximators
;
Edge
Selector
<
PFP
>*
selector
=
NULL
;
Selector
<
PFP
>*
selector
=
NULL
;
//choose the Approximator
//choose the Approximator
switch
(
a
)
switch
(
a
)
{
{
case
A_
QEM
:
case
A_
MidEdge
:
approximators
.
push_back
(
new
Approximator_
QEM
<
PFP
>
(
map
,
position
))
;
approximators
.
push_back
(
new
Approximator_
MidEdge
<
PFP
>
(
map
,
position
))
;
break
;
break
;
default
:
default
:
CGoGNout
<<
"not yet implemented"
<<
CGoGNendl
;
CGoGNout
<<
"not yet implemented"
<<
CGoGNendl
;
...
@@ -54,8 +54,11 @@ void decimate(
...
@@ -54,8 +54,11 @@ void decimate(
//choose the Selector
//choose the Selector
switch
(
s
)
switch
(
s
)
{
{
case
S_QEM
:
case
S_MapOrder
:
selector
=
new
EdgeSelector_QEM
<
PFP
>
(
map
,
position
,
approximators
,
selected
)
;
selector
=
new
Algo
::
DecimationVolumes
::
EdgeSelector_MapOrder
<
PFP
>
(
map
,
position
,
approximators
,
selected
)
;
break
;
case
S_Random
:
selector
=
new
Algo
::
DecimationVolumes
::
EdgeSelector_Random
<
PFP
>
(
map
,
position
,
approximators
,
selected
)
;
break
;
break
;
default:
default:
CGoGNout
<<
"not yet implemented"
<<
CGoGNendl
;
CGoGNout
<<
"not yet implemented"
<<
CGoGNendl
;
...
@@ -78,42 +81,38 @@ void decimate(
...
@@ -78,42 +81,38 @@ void decimate(
while
(
!
finished
)
while
(
!
finished
)
{
{
//Next Operator to perform
if
(
!
selector
->
nextEdge
(
d
))
Operator
<
PFP
>
*
op
;
break
;
if
((
op
=
selector
->
nextOperator
())
==
NULL
)
std
::
cout
<<
"d = "
<<
d
<<
std
::
endl
;
break
;
--
nbVertices
;
Dart
d2
=
map
.
phi2
(
map
.
phi_1
(
d
))
;
Dart
dd2
=
map
.
phi2
(
map
.
phi_1
(
map
.
phi2
(
d
)))
;
// compute approximated attributes
for
(
typename
std
::
vector
<
ApproximatorGen
<
PFP
>*>::
iterator
it
=
approximators
.
begin
();
it
!=
approximators
.
end
();
++
it
)
for
(
typename
std
::
vector
<
ApproximatorGen
<
PFP
>*>::
iterator
it
=
approximators
.
begin
();
it
!=
approximators
.
end
();
++
it
)
{
{
(
*
it
)
->
approximate
(
op
)
;
(
*
it
)
->
approximate
(
d
)
;
// compute approximated attributes
(
*
it
)
->
saveApprox
(
op
)
;
(
*
it
)
->
saveApprox
(
d
)
;
}
}
//Update the selector before performing operation
selector
->
updateBeforeCollapse
(
d
)
;
// update selector
if
(
!
selector
->
updateBeforeOperation
(
op
))
break
;
map
.
collapseEdge
(
d
)
;
// collapse edge
//Perform the topological operation and
if
(
!
map
.
check
())
//compute the number of resulting cells
finished
=
true
;
nbVertices
-=
op
->
collapse
(
map
,
position
);
for
(
typename
std
::
vector
<
ApproximatorGen
<
PFP
>*>::
iterator
it
=
approximators
.
begin
();
it
!=
approximators
.
end
();
++
it
)
for
(
typename
std
::
vector
<
ApproximatorGen
<
PFP
>*>::
iterator
it
=
approximators
.
begin
();
it
!=
approximators
.
end
();
++
it
)
(
*
it
)
->
affectApprox
(
op
);
// affect data to the resulting vertex
(
*
it
)
->
affectApprox
(
d2
);
// affect data to the resulting vertex
//Update the embedded position and
selector
->
updateAfterCollapse
(
d2
,
dd2
)
;
// update selector
//search the next operation to perform
selector
->
updateAfterOperation
(
op
);
if
(
nbVertices
<=
nbWantedVertices
)
if
(
nbVertices
<=
nbWantedVertices
)
finished
=
true
;
finished
=
true
;
delete
op
;
}
}
selector
->
finish
()
;
CGoGNout
<<
"..done ("
<<
nbVertices
<<
" vertices)"
<<
CGoGNendl
;
CGoGNout
<<
"..done ("
<<
nbVertices
<<
" vertices)"
<<
CGoGNendl
;
delete
selector
;
delete
selector
;
...
...
include/Algo/DecimationVolumes/edgeSelector.h
View file @
ea93f7ca
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#include "Container/fakeAttribute.h"
#include "Container/fakeAttribute.h"
#include "Algo/DecimationVolumes/selector.h"
#include "Algo/DecimationVolumes/selector.h"
#include "Algo/DecimationVolumes/operator.h"
#include "Utils/qem.h"
#include "Utils/qem.h"
#include "Topology/generic/traversorCell.h"
#include "Topology/generic/traversorCell.h"
...
@@ -16,80 +15,166 @@ namespace Algo
...
@@ -16,80 +15,166 @@ namespace Algo
namespace
DecimationVolumes
namespace
DecimationVolumes
{
{
/*
*******************************************************************************
/*
*
Parent Edge Selector *
*
Map Order
*
*******************************************************************************
/
*/
template
<
typename
PFP
>
template
<
typename
PFP
>
class
EdgeSelector
:
public
Selector
<
PFP
>
class
EdgeSelector
_MapOrder
:
public
Selector
<
PFP
>
{
{
public:
public:
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
protected:
private:
Dart
cur
;
public:
public:
EdgeSelector
(
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
pos
,
std
::
vector
<
ApproximatorGen
<
PFP
>*>&
approx
,
const
FunctorSelect
&
select
)
:
EdgeSelector
_MapOrder
(
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
pos
,
std
::
vector
<
ApproximatorGen
<
PFP
>*>&
approx
,
const
FunctorSelect
&
select
)
:
Selector
<
PFP
>
(
m
,
pos
,
approx
,
select
)
Selector
<
PFP
>
(
m
,
pos
,
approx
,
select
)
{}
{}
~
EdgeSelector_MapOrder
()
{}
SelectorType
getType
()
{
return
S_MapOrder
;
}
bool
init
()
;
bool
nextEdge
(
Dart
&
d
)
;
void
updateBeforeCollapse
(
Dart
d
)
{}
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
void
updateWithoutCollapse
()
{
}
}
;
};
/*
* Random
*/
template
<
typename
PFP
>
template
<
typename
PFP
>
class
EdgeSelector_
QEM
:
public
Edge
Selector
<
PFP
>
class
EdgeSelector_
Random
:
public
Selector
<
PFP
>
{
{
public:
public:
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
private:
private:
typedef
struct
std
::
vector
<
Dart
>
darts
;
{
unsigned
int
cur
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
it
;
bool
allSkipped
;
bool
valid
;
static
std
::
string
CGoGNnameOfType
()
{
return
"QEMedgeInfo"
;
}
public:
}
QEMedgeInfo
;
EdgeSelector_Random
(
MAP
&
m
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
pos
,
std
::
vector
<
ApproximatorGen
<
PFP
>*>&
approx
,
const
FunctorSelect
&
select
)
:
Selector
<
PFP
>
(
m
,
pos
,
approx
,
select
),
cur
(
0
),
allSkipped
(
false
)
{}
~
EdgeSelector_Random
()
{}
SelectorType
getType
()
{
return
S_Random
;
}
bool
init
()
;
bool
nextEdge
(
Dart
&
d
)
;
void
updateBeforeCollapse
(
Dart
d2
)
{}
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;
typedef
NoMathIOAttribute
<
QEMedgeInfo
>
EdgeInfo
;
void
updateWithoutCollapse
()
{
}
}
;