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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
1a38e382
Commit
1a38e382
authored
Apr 22, 2013
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~untereiner/CGoGN
parents
ebf1b542
7e05804c
Changes
39
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
1454 additions
and
291 deletions
+1454
-291
Apps/Examples/viewer.cpp
Apps/Examples/viewer.cpp
+14
-4
Apps/Examples/viewer.h
Apps/Examples/viewer.h
+5
-2
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+16
-16
Apps/Tuto/tuto_oper2.cpp
Apps/Tuto/tuto_oper2.cpp
+2
-1
Apps/Tuto/tuto_oper3.cpp
Apps/Tuto/tuto_oper3.cpp
+16
-5
SCHNApps/Plugins/renderTopoSurface/include/renderTopoSurface.h
...pps/Plugins/renderTopoSurface/include/renderTopoSurface.h
+4
-1
SCHNApps/Plugins/renderTopoSurface/src/renderTopoSurface.cpp
SCHNApps/Plugins/renderTopoSurface/src/renderTopoSurface.cpp
+16
-0
include/Algo/DecimationVolumes/approximator.h
include/Algo/DecimationVolumes/approximator.h
+72
-35
include/Algo/DecimationVolumes/decimator.h
include/Algo/DecimationVolumes/decimator.h
+3
-3
include/Algo/DecimationVolumes/decimator.hpp
include/Algo/DecimationVolumes/decimator.hpp
+5
-5
include/Algo/DecimationVolumes/edgeSelector.h
include/Algo/DecimationVolumes/edgeSelector.h
+3
-3
include/Algo/DecimationVolumes/edgeSelector.hpp
include/Algo/DecimationVolumes/edgeSelector.hpp
+3
-3
include/Algo/DecimationVolumes/geometryApproximator.h
include/Algo/DecimationVolumes/geometryApproximator.h
+80
-13
include/Algo/DecimationVolumes/geometryApproximator.hpp
include/Algo/DecimationVolumes/geometryApproximator.hpp
+89
-47
include/Algo/DecimationVolumes/operator.h
include/Algo/DecimationVolumes/operator.h
+3
-3
include/Algo/DecimationVolumes/operator.hpp
include/Algo/DecimationVolumes/operator.hpp
+3
-3
include/Algo/DecimationVolumes/selector.h
include/Algo/DecimationVolumes/selector.h
+6
-6
include/Algo/ImplicitHierarchicalMesh/ihm.h
include/Algo/ImplicitHierarchicalMesh/ihm.h
+18
-1
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
+16
-1
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+2
-2
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
+84
-20
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+2
-2
include/Algo/Import/importMesh.hpp
include/Algo/Import/importMesh.hpp
+5
-1
include/Algo/Import/importObjEle.hpp
include/Algo/Import/importObjEle.hpp
+45
-39
include/Algo/Modelisation/polyhedron.h
include/Algo/Modelisation/polyhedron.h
+5
-0
include/Algo/Modelisation/polyhedron.hpp
include/Algo/Modelisation/polyhedron.hpp
+128
-0
include/Algo/Modelisation/subdivision3.h
include/Algo/Modelisation/subdivision3.h
+3
-0
include/Algo/Modelisation/subdivision3.hpp
include/Algo/Modelisation/subdivision3.hpp
+90
-0
include/Algo/Multiresolution/Map2MR/lerpAttributes.h
include/Algo/Multiresolution/Map2MR/lerpAttributes.h
+4
-4
include/Algo/Multiresolution/Map2MR/map2MR_PM.h
include/Algo/Multiresolution/Map2MR/map2MR_PM.h
+9
-9
include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp
+26
-2
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
+3
-20
include/Algo/Multiresolution/Map3MR/Filters/schaefer.h
include/Algo/Multiresolution/Map3MR/Filters/schaefer.h
+190
-0
include/Algo/Multiresolution/Map3MR/map3MR_PM.h
include/Algo/Multiresolution/Map3MR/map3MR_PM.h
+125
-0
include/Algo/Multiresolution/Map3MR/map3MR_PM.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PM.hpp
+298
-0
include/Algo/Render/GL2/topoRender.hpp
include/Algo/Render/GL2/topoRender.hpp
+22
-21
include/Topology/ihmap/ihm2.hpp
include/Topology/ihmap/ihm2.hpp
+0
-1
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
+38
-17
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
+1
-1
No files found.
Apps/Examples/viewer.cpp
View file @
1a38e382
...
...
@@ -31,6 +31,7 @@ Viewer::Viewer() :
m_drawFaces
(
true
),
m_drawNormals
(
false
),
m_drawTopo
(
false
),
m_drawBoundaryTopo
(
true
),
m_render
(
NULL
),
m_phongShader
(
NULL
),
m_flatShader
(
NULL
),
...
...
@@ -78,8 +79,6 @@ void Viewer::cb_initGL()
{
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
)
;
setFocal
(
5.0
f
)
;
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
()
;
m_topoRender
=
new
Algo
::
Render
::
GL2
::
TopoRender
()
;
...
...
@@ -109,7 +108,7 @@ void Viewer::cb_initGL()
m_simpleColorShader
=
new
Utils
::
ShaderSimpleColor
()
;
m_simpleColorShader
->
setAttributePosition
(
m_positionVBO
)
;
Geom
::
Vec4f
c
(
0.
1
f
,
0.1
f
,
0.1
f
,
1.0
f
)
;
Geom
::
Vec4f
c
(
0.
0
f
,
0.0
f
,
0.0
f
,
1.0
f
)
;
m_simpleColorShader
->
setColor
(
c
)
;
m_pointSprite
=
new
Utils
::
PointSprite
()
;
...
...
@@ -231,7 +230,7 @@ void Viewer::importMesh(std::string& filename)
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
LINES
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
TRIANGLES
)
;
m_topoRender
->
updateData
<
PFP
>
(
myMap
,
position
,
0.85
f
,
0.85
f
)
;
m_topoRender
->
updateData
<
PFP
>
(
myMap
,
position
,
0.85
f
,
0.85
f
,
m_drawBoundaryTopo
)
;
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
normalBaseSize
=
bb
.
diagSize
()
/
100.0
f
;
...
...
@@ -294,6 +293,17 @@ void Viewer::slot_drawEdges(bool b)
void
Viewer
::
slot_drawFaces
(
bool
b
)
{
m_drawFaces
=
b
;
if
(
b
)
{
Geom
::
Vec4f
c
(
0.0
f
,
0.0
f
,
0.0
f
,
1.0
f
)
;
m_simpleColorShader
->
setColor
(
c
)
;
}
else
{
Geom
::
Vec4f
c
(
0.9
f
,
0.9
f
,
0.1
f
,
1.0
f
)
;
m_simpleColorShader
->
setColor
(
c
)
;
}
updateGL
()
;
}
...
...
Apps/Examples/viewer.h
View file @
1a38e382
...
...
@@ -24,7 +24,8 @@
#include <iostream>
#include "Utils/Qt/qtSimple.h"
//#include "Utils/Qt/qtSimple.h"
#include "Utils/Qt/qtQGLV.h"
#include "ui_viewer.h"
#include "Utils/Qt/qtui.h"
...
...
@@ -65,7 +66,8 @@ struct PFP: public PFP_STANDARD
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
VEC3
VEC3
;
class
Viewer
:
public
Utils
::
QT
::
SimpleQT
//class Viewer : public Utils::QT::SimpleQT
class
Viewer
:
public
Utils
::
QT
::
SimpleQGLV
{
Q_OBJECT
...
...
@@ -96,6 +98,7 @@ public:
bool
m_drawFaces
;
bool
m_drawNormals
;
bool
m_drawTopo
;
bool
m_drawBoundaryTopo
;
VertexAttribute
<
VEC3
>
position
;
VertexAttribute
<
VEC3
>
normal
;
...
...
Apps/Examples/volumeExplorer.cpp
View file @
1a38e382
...
...
@@ -146,21 +146,21 @@ void MyQT::cb_Open()
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
if
(
extension
==
std
::
string
(
".off"
))
{
if
(
!
Algo
::
Volume
::
Import
::
importMeshToExtrude
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
else
{
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
myMap
.
closeMap
();
}
}
else
{
//
if(extension == std::string(".off"))
//
{
//
if(!Algo::Volume::Import::importMeshToExtrude<PFP>(myMap, filename, attrNames))
//
{
//
std::cerr << "could not import " << filename << std::endl ;
//
return ;
//
}
//
else
//
{
//
position = myMap.getAttribute<PFP::VEC3, VERTEX>(attrNames[0]) ;
//
myMap.closeMap();
//
}
//
}
//
else
//
{
if
(
!
Algo
::
Volume
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
...
...
@@ -168,7 +168,7 @@ void MyQT::cb_Open()
}
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
//
}
color
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VOLUME
>
(
"color"
);
...
...
Apps/Tuto/tuto_oper2.cpp
View file @
1a38e382
...
...
@@ -357,8 +357,9 @@ void MyQT::cb_Open()
void
MyQT
::
cb_Save
()
{
std
::
string
filename
=
selectFileSave
(
"Export
SVG
file "
,
"."
,
"(*.off)"
);
std
::
string
filename
=
selectFileSave
(
"Export
Off
file "
,
"."
,
"(*.off)"
);
Algo
::
Surface
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
filename
.
c_str
());
//std::cout << "could not save file : " << filename << std::endl;
}
void
MyQT
::
importMesh
(
std
::
string
&
filename
)
...
...
Apps/Tuto/tuto_oper3.cpp
View file @
1a38e382
...
...
@@ -259,9 +259,20 @@ void MyQT::createMap(int n)
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
if
(
!
position
.
isValid
())
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
prim
.
hexaGrid_topo
(
n
,
n
,
n
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
// Algo::Volume::Modelisation::Primitive3D<PFP> prim(myMap, position);
// prim.hexaGrid_topo(n,n,n);
// prim.embedHexaGrid(1.0f,1.0f,1.0f);
// Algo::Surface::Modelisation::Polyhedron<PFP> poly(myMap, position);
// poly.cylinder_topo(6,1,true,true);
// poly.embedCylinder(6.0,6.0,5.0);
// myMap.closeMap();
Dart
d
=
Algo
::
Surface
::
Modelisation
::
embedPrism
<
PFP
>
(
myMap
,
position
,
5
,
true
,
6.0
,
6.0
,
5.0
);
Dart
d2
=
Algo
::
Surface
::
Modelisation
::
embedPyramid
<
PFP
>
(
myMap
,
position
,
4
,
true
,
6.0
,
5.0
);
myMap
.
sewVolumes
(
myMap
.
phi2
(
d
),
d2
);
position
[
myMap
.
phi_1
(
myMap
.
phi2
(
d2
))]
+=
VEC3
(
9.0
,
-
5.0
,
-
2.5
);
myMap
.
check
();
...
...
@@ -565,8 +576,8 @@ void MyQT::cb_keyPress(int keycode)
updateGL
();
break
;
case
'W'
:
m_ex1
=
0.9
f
;
m_ex2
=
0.9
f
;
m_ex1
=
0.9
5
f
;
m_ex2
=
0.9
5
f
;
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_ex3
/*, nb*/
);
updateGL
();
break
;
...
...
SCHNApps/Plugins/renderTopoSurface/include/renderTopoSurface.h
View file @
1a38e382
...
...
@@ -64,7 +64,7 @@ public:
virtual
void
keyPress
(
View
*
view
,
QKeyEvent
*
event
)
{}
virtual
void
keyRelease
(
View
*
view
,
QKeyEvent
*
event
)
{}
virtual
void
mousePress
(
View
*
view
,
QMouseEvent
*
event
)
{}
virtual
void
mousePress
(
View
*
view
,
QMouseEvent
*
event
)
;
virtual
void
mouseRelease
(
View
*
view
,
QMouseEvent
*
event
)
{}
virtual
void
mouseMove
(
View
*
view
,
QMouseEvent
*
event
)
{}
virtual
void
wheelEvent
(
View
*
view
,
QWheelEvent
*
event
)
{}
...
...
@@ -100,6 +100,9 @@ public slots:
void
attributeModified
(
unsigned
int
orbit
,
QString
nameAttr
);
void
connectivityModified
();
signals:
void
dartSelected
(
Dart
d
);
};
}
// namespace SCHNApps
...
...
SCHNApps/Plugins/renderTopoSurface/src/renderTopoSurface.cpp
View file @
1a38e382
...
...
@@ -86,6 +86,22 @@ void RenderTopoSurfacePlugin::redraw(View* view)
}
}
void
RenderTopoSurfacePlugin
::
mousePress
(
View
*
view
,
QMouseEvent
*
event
)
{
// if (Shift())
// {
// ParameterSet* params = h_viewParams[view];
// m_renderTopo->updateData<PFP>(myMap, position, m_coeff_topo_explod[0], m_coeff_topo_explod[1], m_coeff_topo_explod[2], *m_selNoBoundary) ;
// Dart d = m_renderTopo->picking<PFP>(myMap, x, y, *m_selNoBoundary);
// if (d != Dart::nil())
// {
// emit(dartSelected(d);
// }
// }
}
void
RenderTopoSurfacePlugin
::
viewLinked
(
View
*
view
,
Plugin
*
plugin
)
{
if
(
plugin
==
this
)
...
...
include/Algo/DecimationVolumes/approximator.h
View file @
1a38e382
...
...
@@ -37,14 +37,17 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
enum
ApproximatorType
{
A_QEM
,
A_MidEdge
,
A_hHalfCollapse
A_MidFace
,
A_MidVolume
,
A_hHalfEdgeCollapse
,
A_QEM
};
template
<
typename
PFP
>
...
...
@@ -63,7 +66,7 @@ public:
{}
virtual
~
ApproximatorGen
()
{}
virtual
const
std
::
string
&
getApproximatedAttributeName
()
const
=
0
;
virtual
const
std
::
string
&
getApproximatedAttributeName
(
unsigned
int
index
=
0
)
const
=
0
;
virtual
ApproximatorType
getType
()
const
=
0
;
virtual
bool
init
()
=
0
;
virtual
void
approximate
(
Dart
d
)
=
0
;
...
...
@@ -73,67 +76,101 @@ public:
}
;
template
<
typename
PFP
,
typename
T
>
template
<
typename
PFP
,
typename
T
,
unsigned
int
ORBIT
>
class
Approximator
:
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
;
//Vertex attribute to be approximated
VertexAttribute
<
T
>&
m_attrV
;
//Attribute to store approximation result
EdgeAttribute
<
T
>
m_approx
;
// attribute to store detail information for reconstruction
EdgeAttribute
<
T
>
m_detail
;
T
m_app
;
std
::
vector
<
VertexAttribute
<
T
>*
>
m_attrV
;
// vertex attributes to be approximated
std
::
vector
<
AttributeHandler
<
T
,
ORBIT
>
>
m_approx
;
// attributes to store approximation result
std
::
vector
<
AttributeHandler
<
T
,
ORBIT
>
>
m_detail
;
// attributes to store detail information for reconstruction
std
::
vector
<
T
>
m_app
;
public:
Approximator
(
MAP
&
m
,
VertexAttribute
<
T
>&
a
,
Predictor
<
PFP
,
T
>
*
predictor
)
:
ApproximatorGen
<
PFP
>
(
m
),
m_predictor
(
predictor
),
m_attrV
(
a
)
Approximator
(
MAP
&
m
,
std
::
vector
<
VertexAttribute
<
T
>*
>
va
,
Predictor
<
PFP
,
T
>
*
predictor
)
:
ApproximatorGen
<
PFP
>
(
m
),
m_predictor
(
predictor
),
m_attrV
(
v
a
)
{
std
::
stringstream
aname
;
aname
<<
"approx_"
<<
m_attrV
.
name
()
;
m_approx
=
this
->
m_map
.
template
addAttribute
<
T
,
EDGE
>(
aname
.
str
())
;
if
(
m_predictor
)
// if a predictor is associated to the approximator
{
// create an attribute to store the detail needed for reconstruction
std
::
stringstream
dname
;
dname
<<
"detail_"
<<
m_attrV
.
name
()
;
m_detail
=
this
->
m_map
.
template
addAttribute
<
T
,
EDGE
>(
dname
.
str
())
;
const
unsigned
int
&
size
=
m_attrV
.
size
()
;
assert
(
size
>
0
||
!
"Approximator: 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
<<
"Approximator 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
,
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
,
ORBIT
>(
dname
.
str
())
;
}
}
}
virtual
~
Approximator
()
{
this
->
m_map
.
template
removeAttribute
(
m_approx
)
;
if
(
m_predictor
)
this
->
m_map
.
template
removeAttribute
(
m_detail
)
;
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
()
const
const
std
::
string
&
getApproximatedAttributeName
(
unsigned
int
index
=
0
)
const
{
return
m_attrV
.
name
()
;
return
m_attrV
[
index
]
->
name
()
;
}
const
T
&
getApprox
(
Dart
d
)
const
unsigned
int
getNbApproximated
(
)
const
{
return
m_a
pprox
[
d
]
;
return
m_a
ttrV
.
size
()
;
}
void
saveApprox
(
Dart
d
)
{
m_app
=
m_approx
[
d
]
;
for
(
unsigned
int
i
=
0
;
i
<
m_attrV
.
size
()
;
++
i
)
m_app
[
i
]
=
m_approx
[
i
][
d
]
;
}
void
affectApprox
(
Dart
d
)
{
m_attrV
[
d
]
=
m_app
;
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
]
;
}
const
VertexAttribute
<
T
>&
getAttr
(
unsigned
int
index
=
0
)
const
{
return
*
(
m_attrV
[
index
])
;
}
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
...
...
@@ -144,9 +181,9 @@ public:
};
}
// namespace Decimation
Volumes
}
// namespace Decimation
}
}
// namespace Volume
}
// namespace Algo
...
...
include/Algo/DecimationVolumes/decimator.h
View file @
1a38e382
...
...
@@ -39,7 +39,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
template
<
typename
PFP
>
...
...
@@ -51,9 +51,9 @@ void decimate(
unsigned
int
percentWantedVertices
);
}
//namespace Decimation
Volumes
}
//namespace Decimation
}
}
//namesapce Volume
}
//namespace Algo
...
...
include/Algo/DecimationVolumes/decimator.hpp
View file @
1a38e382
...
...
@@ -31,7 +31,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
template
<
typename
PFP
>
...
...
@@ -56,10 +56,10 @@ void decimate(typename PFP::MAP& map, SelectorType s, ApproximatorType a,
switch
(
s
)
{
case
S_MapOrder
:
selector
=
new
Algo
::
DecimationVolumes
::
EdgeSelector_MapOrder
<
PFP
>
(
map
,
position
,
approximators
)
;
selector
=
new
Algo
::
Volume
::
Decimation
::
EdgeSelector_MapOrder
<
PFP
>
(
map
,
position
,
approximators
)
;
break
;
case
S_Random
:
selector
=
new
Algo
::
DecimationVolumes
::
EdgeSelector_Random
<
PFP
>
(
map
,
position
,
approximators
)
;
selector
=
new
Algo
::
Volume
::
Decimation
::
EdgeSelector_Random
<
PFP
>
(
map
,
position
,
approximators
)
;
break
;
default:
CGoGNout
<<
"not yet implemented"
<<
CGoGNendl
;
...
...
@@ -122,9 +122,9 @@ void decimate(typename PFP::MAP& map, SelectorType s, ApproximatorType a,
delete
(
*
it
)
;
}
}
//namespace Decimation
Volumes
}
//namespace Decimation
}
}
//namespace Volume
}
//namespace Algo
...
...
include/Algo/DecimationVolumes/edgeSelector.h
View file @
1a38e382
...
...
@@ -15,7 +15,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
/*
...
...
@@ -186,9 +186,9 @@ public:
}
//end namespace Decimation
Volumes
}
//end namespace Decimation
}
}
//namespace Volume
}
//end namespace Algo
...
...
include/Algo/DecimationVolumes/edgeSelector.hpp
View file @
1a38e382
...
...
@@ -35,7 +35,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
/************************************************************************************
* MAP ORDER *
...
...
@@ -323,7 +323,7 @@ void EdgeSelector_SG98<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
// einfo.valid = true ;
}
}
//end namespace Decimation
Volumique
}
}
//end namespace Decimation
}
//namespace Volume
}
//end namespace Algo
}
//end namespace CGoGN
include/Algo/DecimationVolumes/geometryApproximator.h
View file @
1a38e382
...
...
@@ -36,20 +36,22 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
template
<
typename
PFP
>
class
Approximator_MidEdge
:
public
Approximator
<
PFP
,
typename
PFP
::
VEC3
>
class
Approximator_MidEdge
:
public
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
EDGE
>
{
public:
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
Approximator_MidEdge
(
MAP
&
m
,
VertexAttribute
<
VEC3
>&
pos
,
Predictor
<
PFP
,
VEC3
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
VEC3
>
(
m
,
pos
,
pred
)
{}
Approximator_MidEdge
(
MAP
&
m
,
std
::
vector
<
VertexAttribute
<
VEC3
>*
>
pos
,
Predictor
<
PFP
,
VEC3
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
VEC3
,
EDGE
>
(
m
,
pos
,
pred
)
{
assert
(
pos
.
size
()
>
0
||
!
"Approximator_MidEdge: attribute vector is empty"
)
;
}
~
Approximator_MidEdge
()
{}
ApproximatorType
getType
()
const
{
return
A_MidEdge
;
}
...
...
@@ -58,29 +60,94 @@ public:
}
;
template
<
typename
PFP
>
class
Approximator_
HalfCollapse
:
public
Approximator
<
PFP
,
typename
PFP
::
VEC3
>
class
Approximator_
MidFace
:
public
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
FACE
>
{
public:
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
Approximator_
HalfCollapse
(
MAP
&
m
,
VertexAttribute
<
VEC3
>&
pos
,
Predictor
<
PFP
,
VEC3
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
VEC3
>
(
m
,
pos
,
pred
)
Approximator_
MidFace
(
MAP
&
m
,
std
::
vector
<
VertexAttribute
<
VEC3
>*
>
pos
,
Predictor
<
PFP
,
VEC3
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
VEC3
,
FACE
>
(
m
,
pos
,
pred
)
{
assert
(
pos
.
size
()
>
0
||
!
"Approximator_
HalfCollaps
e: attribute vector is empty"
)
;
assert
(
pos
.
size
()
>
0
||
!
"Approximator_
MidFac
e: attribute vector is empty"
)
;
}
~
Approximator_
HalfCollaps
e
()
~
Approximator_
MidFac
e
()
{}
ApproximatorType
getType
()
const
{
return
A_
hHalfCollaps
e
;
}
ApproximatorType
getType
()
const
{
return
A_
MidFac
e
;
}
bool
init
()
;
void
approximate
(
Dart
d
)
;
}
;
template
<
typename
PFP
>
class
Approximator_MidVolume
:
public
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
VOLUME
>
{
public:
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
}
//namespace DecimationVolumes
Approximator_MidVolume
(
MAP
&
m
,
std
::
vector
<
VertexAttribute
<
VEC3
>*
>
pos
,
Predictor
<
PFP
,
VEC3
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
VEC3
,
VOLUME
>
(
m
,
pos
,
pred
)
{
assert
(
pos
.
size
()
>
0
||
!
"Approximator_MidVolume: attribute vector is empty"
)
;
}
~
Approximator_MidVolume
()
{}
ApproximatorType
getType
()
const
{
return
A_MidVolume
;
}
bool
init
()
;
void
approximate
(
Dart
d
)
;
}
;
template
<
typename
PFP
>
class
Approximator_HalfEdgeCollapse
:
public
Approximator
<
PFP
,
typename
PFP
::
VEC3
,
DART
>
{
public:
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
Approximator_HalfEdgeCollapse
(
MAP
&
m
,
std
::
vector
<
VertexAttribute
<
VEC3
>*
>
pos
,
Predictor
<
PFP
,
VEC3
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
VEC3
,
DART
>
(
m
,
pos
,
pred
)
{
assert
(
pos
.
size
()
>
0
||
!
"Approximator_HalfEdgeCollapse: attribute vector is empty"
)
;
}
~
Approximator_HalfEdgeCollapse
()
{}
ApproximatorType
getType
()
const
{
return
A_hHalfEdgeCollapse
;
}
bool
init
()
;
void
approximate
(
Dart
d
)
;
}
;
}
//template <typename PFP>
//class Approximator_QEM : public Approximator<PFP, typename PFP::VEC3, EDGE>
//{
//public:
// typedef typename PFP::MAP MAP ;
// typedef typename PFP::VEC3 VEC3 ;
// typedef typename PFP::REAL REAL ;
//
//protected: