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
45d8bfb6
Commit
45d8bfb6
authored
Nov 21, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~cgogn/CGoGN
parents
bdd079e7
3e67b53f
Changes
137
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
137 changed files
with
11351 additions
and
3952 deletions
+11351
-3952
Apps/Tuto/tuto_oper3.cpp
Apps/Tuto/tuto_oper3.cpp
+4
-0
Apps/deprecated/tp_master.cpp
Apps/deprecated/tp_master.cpp
+1
-1
CMakeLists.txt
CMakeLists.txt
+3
-1
README_ECLIPSE.TXT
README_ECLIPSE.TXT
+8
-0
apps_cmake.txt
apps_cmake.txt
+2
-1
doc/Doxyfile
doc/Doxyfile
+257
-95
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
+88
-30
include/Algo/Decimation/edgeSelector.hpp
include/Algo/Decimation/edgeSelector.hpp
+175
-78
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
+118
-140
include/Algo/Decimation/halfEdgeSelector.hpp
include/Algo/Decimation/halfEdgeSelector.hpp
+687
-862
include/Algo/Decimation/lightfieldApproximator.h
include/Algo/Decimation/lightfieldApproximator.h
+145
-82
include/Algo/Decimation/lightfieldApproximator.hpp
include/Algo/Decimation/lightfieldApproximator.hpp
+283
-64
include/Algo/Decimation/selector.h
include/Algo/Decimation/selector.h
+9
-3
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/Geometry/curvature.h
include/Algo/Geometry/curvature.h
+3
-0
include/Algo/Geometry/curvature.hpp
include/Algo/Geometry/curvature.hpp
+32
-34
include/Algo/Import/import2tablesSurface.hpp
include/Algo/Import/import2tablesSurface.hpp
+26
-15
include/Algo/Modelisation/extrusion.hpp
include/Algo/Modelisation/extrusion.hpp
+1
-1
include/Algo/Modelisation/polyhedron.h
include/Algo/Modelisation/polyhedron.h
+3
-4
include/Algo/Modelisation/polyhedron.hpp
include/Algo/Modelisation/polyhedron.hpp
+45
-46
include/Algo/Modelisation/subdivision3.h
include/Algo/Modelisation/subdivision3.h
+4
-0
include/Algo/Modelisation/subdivision3.hpp
include/Algo/Modelisation/subdivision3.hpp
+84
-0
include/Algo/Modelisation/tetrahedralization.h
include/Algo/Modelisation/tetrahedralization.h
+76
-50
include/Algo/Modelisation/tetrahedralization.hpp
include/Algo/Modelisation/tetrahedralization.hpp
+380
-600
include/Algo/Multiresolution/Map2MR/Filters/Dual/catmullClark.h
...e/Algo/Multiresolution/Map2MR/Filters/Dual/catmullClark.h
+137
-0
include/Algo/Multiresolution/Map2MR/Filters/bertram.h
include/Algo/Multiresolution/Map2MR/Filters/bertram.h
+659
-0
include/Algo/Multiresolution/Map2MR/Filters/catmullClark.h
include/Algo/Multiresolution/Map2MR/Filters/catmullClark.h
+455
-0
include/Algo/Multiresolution/Map2MR/Filters/lerp.h
include/Algo/Multiresolution/Map2MR/Filters/lerp.h
+0
-8
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
+337
-0
include/Algo/Multiresolution/Map2MR/Masks/lerp.h
include/Algo/Multiresolution/Map2MR/Masks/lerp.h
+2
-1
include/Algo/Multiresolution/Map2MR/Masks/sqrt3.h
include/Algo/Multiresolution/Map2MR/Masks/sqrt3.h
+168
-0
include/Algo/Multiresolution/Map2MR/lerpAttributes.h
include/Algo/Multiresolution/Map2MR/lerpAttributes.h
+245
-0
include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.h
include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.h
+92
-0
include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.hpp
include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.hpp
+154
-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_PrimalAdapt.h
include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.h
+10
-0
include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.hpp
+93
-2
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h
+9
-4
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
+79
-17
include/Algo/Multiresolution/Map3MR/Filters/bertram.h
include/Algo/Multiresolution/Map3MR/Filters/bertram.h
+519
-114
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
+34
-5
include/Algo/Multiresolution/Map3MR/Filters/mcCrackenJoy.h
include/Algo/Multiresolution/Map3MR/Filters/mcCrackenJoy.h
+349
-0
include/Algo/Multiresolution/Map3MR/Filters/schaefer.h
include/Algo/Multiresolution/Map3MR/Filters/schaefer.h
+0
-0
include/Algo/Multiresolution/Map3MR/Masks/lerp.h
include/Algo/Multiresolution/Map3MR/Masks/lerp.h
+159
-0
include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h
include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h
+184
-201
include/Algo/Multiresolution/Map3MR/Masks/schaefer.h
include/Algo/Multiresolution/Map3MR/Masks/schaefer.h
+318
-0
include/Algo/Multiresolution/Map3MR/Masks/schemes_Primal.h
include/Algo/Multiresolution/Map3MR/Masks/schemes_Primal.h
+0
-127
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h
+49
-56
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp
+231
-94
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.h
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.h
+2
-0
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
+81
-64
include/Algo/Multiresolution/filter.h
include/Algo/Multiresolution/filter.h
+56
-0
include/Algo/ProgressiveMesh/pmesh.h
include/Algo/ProgressiveMesh/pmesh.h
+1
-1
include/Algo/ProgressiveMesh/pmesh.hpp
include/Algo/ProgressiveMesh/pmesh.hpp
+1
-1
include/Algo/Render/GL2/colorPerFaceRender.h
include/Algo/Render/GL2/colorPerFaceRender.h
+0
-1
include/Algo/Render/GL2/explodeVolumeRender.h
include/Algo/Render/GL2/explodeVolumeRender.h
+0
-2
include/Algo/Render/GL2/mapRender.h
include/Algo/Render/GL2/mapRender.h
+0
-1
include/Algo/Render/GL2/topo3Render.h
include/Algo/Render/GL2/topo3Render.h
+0
-2
include/Algo/Render/GL2/topoRender.h
include/Algo/Render/GL2/topoRender.h
+0
-2
include/Algo/Selection/collector.h
include/Algo/Selection/collector.h
+1
-0
include/Algo/Selection/raySelector.hpp
include/Algo/Selection/raySelector.hpp
+1
-1
include/Geometry/distances.hpp
include/Geometry/distances.hpp
+1
-1
include/Geometry/tensor.h
include/Geometry/tensor.h
+12
-0
include/Geometry/tensor.hpp
include/Geometry/tensor.hpp
+16
-1
include/Geometry/vector_gen.h
include/Geometry/vector_gen.h
+1
-0
include/Geometry/vector_gen.hpp
include/Geometry/vector_gen.hpp
+9
-1
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/embeddedMap2.h
include/Topology/map/embeddedMap2.h
+1
-1
include/Topology/map/map2.h
include/Topology/map/map2.h
+7
-16
include/Utils/GLSLShader.h
include/Utils/GLSLShader.h
+6
-1
include/Utils/Qt/macgl3.h
include/Utils/Qt/macgl3.h
+25
-0
include/Utils/Qt/qtSimple.h
include/Utils/Qt/qtSimple.h
+2
-0
include/Utils/Qt/qtgl.h
include/Utils/Qt/qtgl.h
+5
-1
include/Utils/Shaders/shaderColorPerVertex.frag
include/Utils/Shaders/shaderColorPerVertex.frag
+2
-1
include/Utils/Shaders/shaderColorPerVertex.h
include/Utils/Shaders/shaderColorPerVertex.h
+17
-1
include/Utils/Shaders/shaderEnvMap.frag
include/Utils/Shaders/shaderEnvMap.frag
+41
-0
include/Utils/Shaders/shaderEnvMap.h
include/Utils/Shaders/shaderEnvMap.h
+171
-0
include/Utils/Shaders/shaderEnvMap.vert
include/Utils/Shaders/shaderEnvMap.vert
+38
-0
include/Utils/Shaders/shaderIsoLines.frag
include/Utils/Shaders/shaderIsoLines.frag
+6
-0
include/Utils/Shaders/shaderIsoLines.geom
include/Utils/Shaders/shaderIsoLines.geom
+82
-0
include/Utils/Shaders/shaderIsoLines.h
include/Utils/Shaders/shaderIsoLines.h
+121
-0
include/Utils/Shaders/shaderIsoLines.vert
include/Utils/Shaders/shaderIsoLines.vert
+9
-0
include/Utils/Shaders/shaderPhong.h
include/Utils/Shaders/shaderPhong.h
+9
-2
include/Utils/Shaders/shaderPhong.vert
include/Utils/Shaders/shaderPhong.vert
+12
-2
include/Utils/colourConverter.hpp
include/Utils/colourConverter.hpp
+2
-2
include/Utils/drawer.h
include/Utils/drawer.h
+20
-3
include/Utils/fbo.h
include/Utils/fbo.h
+0
-1
include/Utils/pointSprite.frag
include/Utils/pointSprite.frag
+41
-11
include/Utils/pointSprite.geom
include/Utils/pointSprite.geom
+49
-25
include/Utils/pointSprite.h
include/Utils/pointSprite.h
+21
-1
include/Utils/qem.h
include/Utils/qem.h
+562
-394
include/Utils/qem.hpp
include/Utils/qem.hpp
+1327
-0
include/Utils/text3d.frag
include/Utils/text3d.frag
+1
-1
include/Utils/text3d.h
include/Utils/text3d.h
+44
-4
include/Utils/text3d.vert
include/Utils/text3d.vert
+13
-0
include/Utils/textures.h
include/Utils/textures.h
+0
-1
include/Utils/vbo.h
include/Utils/vbo.h
+0
-1
include/Utils/vboRender.h
include/Utils/vboRender.h
+1
-1
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+27
-1
src/Topology/map/embeddedMap2.cpp
src/Topology/map/embeddedMap2.cpp
+7
-1
src/Topology/map/embeddedMap3.cpp
src/Topology/map/embeddedMap3.cpp
+18
-44
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+20
-19
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+8
-85
src/Utils/GLSLShader.cpp
src/Utils/GLSLShader.cpp
+27
-2
src/Utils/Qt/qtgl.cpp
src/Utils/Qt/qtgl.cpp
+29
-1
src/Utils/Shaders/shaderColorPerVertex.cpp
src/Utils/Shaders/shaderColorPerVertex.cpp
+14
-1
src/Utils/Shaders/shaderEnvMap.cpp
src/Utils/Shaders/shaderEnvMap.cpp
+490
-0
src/Utils/Shaders/shaderExplodeVolumes.cpp
src/Utils/Shaders/shaderExplodeVolumes.cpp
+0
-1
src/Utils/Shaders/shaderExplodeVolumesLines.cpp
src/Utils/Shaders/shaderExplodeVolumesLines.cpp
+1
-2
src/Utils/Shaders/shaderFlat.cpp
src/Utils/Shaders/shaderFlat.cpp
+0
-1
src/Utils/Shaders/shaderFlatColor.cpp
src/Utils/Shaders/shaderFlatColor.cpp
+0
-1
src/Utils/Shaders/shaderIsoLines.cpp
src/Utils/Shaders/shaderIsoLines.cpp
+131
-0
src/Utils/Shaders/shaderPhong.cpp
src/Utils/Shaders/shaderPhong.cpp
+19
-2
src/Utils/Shaders/shaderScalarField.cpp
src/Utils/Shaders/shaderScalarField.cpp
+0
-2
src/Utils/Shaders/shaderSimpleColor.cpp
src/Utils/Shaders/shaderSimpleColor.cpp
+0
-1
src/Utils/Shaders/shaderSimpleTexture.cpp
src/Utils/Shaders/shaderSimpleTexture.cpp
+0
-1
src/Utils/Shaders/shaderTextureMask.cpp
src/Utils/Shaders/shaderTextureMask.cpp
+0
-1
src/Utils/Shaders/shaderVectorPerVertex.cpp
src/Utils/Shaders/shaderVectorPerVertex.cpp
+0
-1
src/Utils/drawer.cpp
src/Utils/drawer.cpp
+69
-2
src/Utils/pointSprite.cpp
src/Utils/pointSprite.cpp
+44
-1
src/Utils/text3d.cpp
src/Utils/text3d.cpp
+108
-18
No files found.
Apps/Tuto/tuto_oper3.cpp
View file @
45d8bfb6
...
...
@@ -330,6 +330,7 @@ void MyQT::cb_mousePress(int button, int x, int y)
{
if
(
d
!=
Dart
::
nil
())
m_selected
=
d
;
std
::
cout
<<
myMap
.
edgeCanCollapse
(
d
)
<<
std
::
endl
;
}
if
(
button
==
Qt
::
RightButton
)
{
...
...
@@ -650,11 +651,14 @@ void MyQT::importMesh(std::string& filename)
else
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
m_selected
=
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
)
;
setParamObject
(
bb
.
maxSize
(),
bb
.
center
().
data
())
;
m_shift
=
bb
.
maxSize
()
/
200.0
f
;
...
...
Apps/deprecated/tp_master.cpp
View file @
45d8bfb6
...
...
@@ -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
();
...
...
CMakeLists.txt
View file @
45d8bfb6
...
...
@@ -27,7 +27,7 @@ IF(WIN32)
ENDIF
(
WIN32
)
find_package
(
OpenGL REQUIRED
)
find_package
(
Boost COMPONENTS regex thread REQUIRED
)
find_package
(
Boost COMPONENTS regex thread
system
REQUIRED
)
find_package
(
ZLIB REQUIRED
)
find_package
(
LibXml2 REQUIRED
)
find_package
(
GLEW REQUIRED
)
...
...
@@ -82,6 +82,7 @@ SET (CGoGN_EXT_LIBS
${
GLEW_LIBRARIES
}
${
ZLIB_LIBRARIES
}
${
LIBXML2_LIBRARIES
}
${
Boost_SYSTEM_LIBRARY
}
${
Boost_REGEX_LIBRARY
}
${
Boost_THREAD_LIBRARY
}
)
...
...
@@ -134,6 +135,7 @@ IF(APPLE)
SET
(
CMAKE_SHARED_LINKER_FLAGS
"
${
CMAKE_SHARED_LINKER_FLAGS
}
-Wl,-undefined -Wl,dynamic_lookup"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DMAC_OSX"
)
SET
(
CMAKE_OSX_ARCHITECTURES x86_64
)
SET
(
CGoGN_EXT_LIBS
${
CGoGN_EXT_LIBS
}
"-framework Foundation -framework cocoa"
)
ENDIF
(
APPLE
)
IF
(
WIN32
)
...
...
README_ECLIPSE.TXT
View file @
45d8bfb6
...
...
@@ -59,6 +59,10 @@ Dans Preferences -> Shaders Preferences, on peut désormais configurer certaines
- Installer et redémarrer
- Dans Preferences -> General -> Editors -> File Associations il est possible d'associer les CMakeLists.txt à ce logiciel d'édition
* Problème indexeur
Si l'indexeur plante avec comme message "Out of memory" (c'est la cas par défaut sur Juno lors de l'indexation totale de CGoGN),
relancer eclipse avec l'option "/opt/eclipse/eclipse -vmargs -Xms512m -Xmx1024M" avant de refaire une indexation globale.
=========================================================================================
ENGLISH VERSION
=========================================================================================
...
...
@@ -122,3 +126,7 @@ In Preferences -> Shaders Preferences, you can now configure some options relate
- Install and restart
- In Preferences -> General -> Editors -> File Associations You can associate the CMakeLists.txt to editing software
* Indexer problem
If the indexer fails with an "Out of Memory" error (this is the case when indexing CGoGN fully on eclipse Juno for instance),
then relaunch eclipse using some options to use a bigger heap "/opt/eclipse/eclipse -vmargs -Xms512m -Xmx1024M" before indexing
CGoGN globally.
apps_cmake.txt
View file @
45d8bfb6
...
...
@@ -30,7 +30,7 @@ IF(WIN32)
ENDIF(WIN32)
find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex thread REQUIRED)
find_package(Boost COMPONENTS regex thread
system
REQUIRED)
find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED)
...
...
@@ -58,6 +58,7 @@ SET (COMMON_LIBS
${GLEW_LIBRARIES}
${ZLIB_LIBRARIES}
${LIBXML2_LIBRARIES}
${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_THREAD_LIBRARY} )
...
...
doc/Doxyfile
View file @
45d8bfb6
This diff is collapsed.
Click to expand it.
include/Algo/Decimation/approximator.h
View file @
45d8bfb6
...
...
@@ -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 @
45d8bfb6
...
...
@@ -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 @
45d8bfb6
...
...
@@ -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 @
45d8bfb6
...
...
@@ -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
,
EdgeAttribute
<
typename
PFP
::
REAL
>
*
edgeErrors
=
NULL
,
void
(
*
callback_wrapper
)(
void
*
,
const
void
*
)
=
NULL
,
void
*
callback_object
=
NULL
)
;
...
...
include/Algo/Decimation/decimation.hpp
View file @
45d8bfb6
...
...
@@ -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 @
45d8bfb6
...
...
@@ -67,6 +67,7 @@ public:
void
updateAfterCollapse
(
Dart
d2
,
Dart
dd2
)
;