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
Hurstel
CGoGN
Commits
28b02542
Commit
28b02542
authored
Mar 13, 2014
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update filtering algos
parent
a5aeb607
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
92 additions
and
216 deletions
+92
-216
Apps/Examples/Debug/CMakeLists.txt
Apps/Examples/Debug/CMakeLists.txt
+4
-6
Apps/Examples/Release/CMakeLists.txt
Apps/Examples/Release/CMakeLists.txt
+1
-2
Apps/Examples/mcmesh.cpp
Apps/Examples/mcmesh.cpp
+1
-2
Apps/Examples/mcmesh.h
Apps/Examples/mcmesh.h
+2
-2
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+0
-1
include/Algo/Filtering/average.h
include/Algo/Filtering/average.h
+16
-16
include/Algo/Filtering/average_normals.h
include/Algo/Filtering/average_normals.h
+36
-32
include/Algo/Filtering/bilateral.h
include/Algo/Filtering/bilateral.h
+3
-3
include/Algo/Filtering/functors.h
include/Algo/Filtering/functors.h
+10
-7
include/Algo/Filtering/taubin.h
include/Algo/Filtering/taubin.h
+10
-7
include/Algo/Filtering/tools.h
include/Algo/Filtering/tools.h
+6
-6
include/Container/containerBrowser.hpp
include/Container/containerBrowser.hpp
+0
-1
include/Topology/generic/attribmap.h
include/Topology/generic/attribmap.h
+0
-52
include/Topology/generic/attribmap.hpp
include/Topology/generic/attribmap.hpp
+0
-29
include/Topology/map/map2.h
include/Topology/map/map2.h
+0
-1
src/Topology/generic/attribmap.cpp
src/Topology/generic/attribmap.cpp
+0
-46
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+1
-1
src/Topology/generic/mapMono.cpp
src/Topology/generic/mapMono.cpp
+1
-1
src/Topology/generic/mapMulti.cpp
src/Topology/generic/mapMulti.cpp
+1
-1
No files found.
Apps/Examples/Debug/CMakeLists.txt
View file @
28b02542
...
@@ -63,19 +63,17 @@ target_link_libraries( clippingD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
...
@@ -63,19 +63,17 @@ target_link_libraries( clippingD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI
(
volumeExplorer_ui ../volumeExplorer.ui
)
QT4_WRAP_UI
(
volumeExplorer_ui ../volumeExplorer.ui
)
QT4_WRAP_CPP
(
volumeExplorer_moc ../volumeExplorer.h
)
QT4_WRAP_CPP
(
volumeExplorer_moc ../volumeExplorer.h
)
add_executable
(
volumeExplorerD ../volumeExplorer.cpp
${
volumeExplorer_ui
}
${
volumeExplorer_moc
}
)
add_executable
(
volumeExplorerD ../volumeExplorer.cpp
${
volumeExplorer_ui
}
${
volumeExplorer_moc
}
)
target_link_libraries
(
volumeExplorerD
${
CGoGN_LIBS_D
}
${
CGoGN_EXT_LIBS
}
)
target_link_libraries
(
volumeExplorerD
${
CGoGN_LIBS_D
}
${
CGoGN_EXT_LIBS
}
)
#QT4_WRAP_UI( mcmesh_ui ../mcmesh.ui )
#QT4_WRAP_UI( mcmesh_ui ../mcmesh.ui )
#QT4_WRAP_CPP( mcmesh_moc ../mcmesh.h )
#QT4_WRAP_CPP( mcmesh_moc ../mcmesh.h )
#add_executable( mcmeshD ../mcmesh.cpp ${mcmesh_moc} ${mcmesh_ui} )
#add_executable( mcmeshD ../mcmesh.cpp ${mcmesh_moc} ${mcmesh_ui} )
#target_link_libraries( mcmeshD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS})
#target_link_libraries( mcmeshD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS}
)
QT4_WRAP_CPP
(
concave_rendering_moc ../concave_rendering.h
)
QT4_WRAP_CPP
(
concave_rendering_moc ../concave_rendering.h
)
add_executable
(
concave_renderingD ../concave_rendering.cpp
${
concave_rendering_moc
}
${
concave_rendering_ui
}
)
add_executable
(
concave_renderingD ../concave_rendering.cpp
${
concave_rendering_moc
}
${
concave_rendering_ui
}
)
target_link_libraries
(
concave_renderingD
${
CGoGN_LIBS_D
}
${
CGoGN_EXT_LIBS
}
)
target_link_libraries
(
concave_renderingD
${
CGoGN_LIBS_D
}
${
CGoGN_EXT_LIBS
}
)
QT4_WRAP_CPP
(
viewerOBJ_moc ../viewerOBJ.h
)
QT4_WRAP_CPP
(
viewerOBJ_moc ../viewerOBJ.h
)
add_executable
(
viewerOBJD ../viewerOBJ.cpp
${
viewerOBJ_moc
}
)
add_executable
(
viewerOBJD ../viewerOBJ.cpp
${
viewerOBJ_moc
}
)
target_link_libraries
(
viewerOBJD
${
CGoGN_LIBS_R
}
${
CGoGN_EXT_LIBS
}
)
target_link_libraries
(
viewerOBJD
${
CGoGN_LIBS_R
}
${
CGoGN_EXT_LIBS
}
)
Apps/Examples/Release/CMakeLists.txt
View file @
28b02542
...
@@ -73,5 +73,4 @@ target_link_libraries( concave_rendering ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
...
@@ -73,5 +73,4 @@ target_link_libraries( concave_rendering ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP
(
viewerOBJ_moc ../viewerOBJ.h
)
QT4_WRAP_CPP
(
viewerOBJ_moc ../viewerOBJ.h
)
add_executable
(
viewerOBJ ../viewerOBJ.cpp
${
viewerOBJ_moc
}
)
add_executable
(
viewerOBJ ../viewerOBJ.cpp
${
viewerOBJ_moc
}
)
target_link_libraries
(
viewerOBJ
${
CGoGN_LIBS_R
}
${
CGoGN_EXT_LIBS
}
)
target_link_libraries
(
viewerOBJ
${
CGoGN_LIBS_R
}
${
CGoGN_EXT_LIBS
}
)
Apps/Examples/mcmesh.cpp
View file @
28b02542
...
@@ -197,7 +197,6 @@ void MCMesh::sphere()
...
@@ -197,7 +197,6 @@ void MCMesh::sphere()
myImg
=
new
SAlgo
::
MC
::
Image
<
DATATYPE
>
(
img
,
128
,
128
,
128
,
1.0
f
,
1.0
f
,
1.0
f
,
false
);
myImg
=
new
SAlgo
::
MC
::
Image
<
DATATYPE
>
(
img
,
128
,
128
,
128
,
1.0
f
,
1.0
f
,
1.0
f
,
false
);
}
}
/**********************************************************************************************
/**********************************************************************************************
* MAIN FUNCTION *
* MAIN FUNCTION *
**********************************************************************************************/
**********************************************************************************************/
...
@@ -210,7 +209,7 @@ int main(int argc, char **argv)
...
@@ -210,7 +209,7 @@ int main(int argc, char **argv)
sqt
.
setGeometry
(
0
,
0
,
1000
,
800
);
sqt
.
setGeometry
(
0
,
0
,
1000
,
800
);
sqt
.
show
();
sqt
.
show
();
sqt
.
valLabel
=
DATATYPE
(
0
);
sqt
.
valLabel
=
DATATYPE
(
0
);
if
(
argc
==
2
)
if
(
argc
==
2
)
{
{
...
...
Apps/Examples/mcmesh.h
View file @
28b02542
...
@@ -31,6 +31,8 @@
...
@@ -31,6 +31,8 @@
#include "Topology/generic/parameters.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Algo/MC/marchingcube.h"
#include "Geometry/vector_gen.h"
#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"
#include "Geometry/matrix.h"
...
@@ -40,8 +42,6 @@
...
@@ -40,8 +42,6 @@
#include "Utils/vbo.h"
#include "Utils/vbo.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/MC/marchingcube.h"
using
namespace
CGoGN
;
using
namespace
CGoGN
;
...
...
SCHNApps/include/mapHandler.h
View file @
28b02542
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
#include "cellSelector.h"
#include "cellSelector.h"
#include "Topology/generic/genericmap.h"
#include "Topology/generic/genericmap.h"
#include "Topology/generic/attribmap.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/attributeHandler.h"
#include "Topology/generic/attributeHandler.h"
...
...
include/Algo/Filtering/average.h
View file @
28b02542
...
@@ -43,11 +43,11 @@ enum neighborhood { INSIDE = 1, BORDER = 2 };
...
@@ -43,11 +43,11 @@ enum neighborhood { INSIDE = 1, BORDER = 2 };
template
<
typename
PFP
,
typename
T
>
template
<
typename
PFP
,
typename
T
>
void
filterAverageAttribute_OneRing
(
void
filterAverageAttribute_OneRing
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
T
>&
attIn
,
const
VertexAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>&
attIn
,
VertexAttribute
<
T
>&
attOut
,
VertexAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>&
attOut
,
int
neigh
)
int
neigh
)
{
{
FunctorAverage
<
T
,
VERTEX
>
fa
(
attIn
)
;
FunctorAverage
<
VertexAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>
>
fa
(
attIn
)
;
Algo
::
Surface
::
Selection
::
Collector_OneRing
<
PFP
>
col
(
map
)
;
Algo
::
Surface
::
Selection
::
Collector_OneRing
<
PFP
>
col
(
map
)
;
TraversorV
<
typename
PFP
::
MAP
>
t
(
map
)
;
TraversorV
<
typename
PFP
::
MAP
>
t
(
map
)
;
...
@@ -88,13 +88,13 @@ void filterAverageAttribute_OneRing(
...
@@ -88,13 +88,13 @@ void filterAverageAttribute_OneRing(
template
<
typename
PFP
,
typename
T
>
template
<
typename
PFP
,
typename
T
>
void
filterAverageVertexAttribute_WithinSphere
(
void
filterAverageVertexAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
T
>&
attIn
,
const
VertexAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>&
attIn
,
VertexAttribute
<
T
>&
attOut
,
VertexAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>&
attOut
,
int
neigh
,
int
neigh
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
typename
PFP
::
REAL
radius
)
typename
PFP
::
REAL
radius
)
{
{
FunctorAverage
<
T
,
VERTEX
>
faInside
(
attIn
)
;
FunctorAverage
<
VertexAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>
>
faInside
(
attIn
)
;
FunctorAverageOnSphereBorder
<
PFP
,
T
>
faBorder
(
map
,
attIn
,
position
)
;
FunctorAverageOnSphereBorder
<
PFP
,
T
>
faBorder
(
map
,
attIn
,
position
)
;
Algo
::
Surface
::
Selection
::
Collector_WithinSphere
<
PFP
>
col
(
map
,
position
,
radius
)
;
Algo
::
Surface
::
Selection
::
Collector_WithinSphere
<
PFP
>
col
(
map
,
position
,
radius
)
;
...
@@ -129,13 +129,13 @@ void filterAverageVertexAttribute_WithinSphere(
...
@@ -129,13 +129,13 @@ void filterAverageVertexAttribute_WithinSphere(
template
<
typename
PFP
,
typename
T
>
template
<
typename
PFP
,
typename
T
>
void
filterAverageEdgeAttribute_WithinSphere
(
void
filterAverageEdgeAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
MAP
&
map
,
const
EdgeAttribute
<
T
>&
attIn
,
const
EdgeAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>&
attIn
,
EdgeAttribute
<
T
>&
attOut
,
EdgeAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>&
attOut
,
int
neigh
,
int
neigh
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
typename
PFP
::
REAL
radius
)
typename
PFP
::
REAL
radius
)
{
{
FunctorAverage
<
T
,
EDGE
>
fa
(
attIn
)
;
FunctorAverage
<
EdgeAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>
>
fa
(
attIn
)
;
Algo
::
Surface
::
Selection
::
Collector_WithinSphere
<
PFP
>
col
(
map
,
position
,
radius
)
;
Algo
::
Surface
::
Selection
::
Collector_WithinSphere
<
PFP
>
col
(
map
,
position
,
radius
)
;
TraversorE
<
typename
PFP
::
MAP
>
t
(
map
)
;
TraversorE
<
typename
PFP
::
MAP
>
t
(
map
)
;
...
@@ -156,13 +156,13 @@ void filterAverageEdgeAttribute_WithinSphere(
...
@@ -156,13 +156,13 @@ void filterAverageEdgeAttribute_WithinSphere(
template
<
typename
PFP
,
typename
T
>
template
<
typename
PFP
,
typename
T
>
void
filterAverageFaceAttribute_WithinSphere
(
void
filterAverageFaceAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
MAP
&
map
,
const
FaceAttribute
<
T
>&
attIn
,
const
FaceAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>&
attIn
,
FaceAttribute
<
T
>&
attOut
,
FaceAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>&
attOut
,
int
neigh
,
int
neigh
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
typename
PFP
::
REAL
radius
)
typename
PFP
::
REAL
radius
)
{
{
FunctorAverage
<
T
,
FACE
>
fa
(
attIn
)
;
FunctorAverage
<
FaceAttribute
<
T
,
typename
PFP
::
MAP
::
IMPL
>
>
fa
(
attIn
)
;
Algo
::
Surface
::
Selection
::
Collector_WithinSphere
<
PFP
>
col
(
map
,
position
,
radius
)
;
Algo
::
Surface
::
Selection
::
Collector_WithinSphere
<
PFP
>
col
(
map
,
position
,
radius
)
;
TraversorF
<
typename
PFP
::
MAP
>
t
(
map
)
;
TraversorF
<
typename
PFP
::
MAP
>
t
(
map
)
;
...
@@ -182,7 +182,7 @@ void filterAverageFaceAttribute_WithinSphere(
...
@@ -182,7 +182,7 @@ void filterAverageFaceAttribute_WithinSphere(
}
// namespace Filtering
}
// namespace Filtering
}
}
// namespace Surface
}
// namespace Algo
}
// namespace Algo
...
...
include/Algo/Filtering/average_normals.h
View file @
28b02542
...
@@ -44,12 +44,12 @@ namespace Filtering
...
@@ -44,12 +44,12 @@ namespace Filtering
template
<
typename
PFP
>
template
<
typename
PFP
>
void
computeNewPositionsFromFaceNormals
(
void
computeNewPositionsFromFaceNormals
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position2
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position2
,
const
FaceAttribute
<
typename
PFP
::
REAL
>&
faceArea
,
const
FaceAttribute
<
typename
PFP
::
REAL
,
typename
PFP
::
MAP
::
IMPL
>&
faceArea
,
const
FaceAttribute
<
typename
PFP
::
VEC3
>&
faceCentroid
,
const
FaceAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
faceCentroid
,
const
FaceAttribute
<
typename
PFP
::
VEC3
>&
faceNormal
,
const
FaceAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
faceNormal
,
const
FaceAttribute
<
typename
PFP
::
VEC3
>&
faceNewNormal
)
const
FaceAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
faceNewNormal
)
{
{
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
...
@@ -77,20 +77,21 @@ void computeNewPositionsFromFaceNormals(
...
@@ -77,20 +77,21 @@ void computeNewPositionsFromFaceNormals(
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
filterAverageNormals
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position2
)
void
filterAverageNormals
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position2
)
{
{
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
FaceAutoAttribute
<
REAL
>
faceArea
(
map
,
"faceArea"
)
;
FaceAutoAttribute
<
REAL
,
MAP_IMPL
>
faceArea
(
map
,
"faceArea"
)
;
FaceAutoAttribute
<
VEC3
>
faceNormal
(
map
,
"faceNormal"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceNormal
(
map
,
"faceNormal"
)
;
FaceAutoAttribute
<
VEC3
>
faceCentroid
(
map
,
"faceCentroid"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceCentroid
(
map
,
"faceCentroid"
)
;
Algo
::
Surface
::
Geometry
::
computeAreaFaces
<
PFP
>
(
map
,
position
,
faceArea
)
;
Algo
::
Surface
::
Geometry
::
computeAreaFaces
<
PFP
>
(
map
,
position
,
faceArea
)
;
Algo
::
Surface
::
Geometry
::
computeNormalFaces
<
PFP
>
(
map
,
position
,
faceNormal
)
;
Algo
::
Surface
::
Geometry
::
computeNormalFaces
<
PFP
>
(
map
,
position
,
faceNormal
)
;
Algo
::
Surface
::
Geometry
::
computeCentroidFaces
<
PFP
>
(
map
,
position
,
faceCentroid
)
;
Algo
::
Surface
::
Geometry
::
computeCentroidFaces
<
PFP
>
(
map
,
position
,
faceCentroid
)
;
FaceAutoAttribute
<
VEC3
>
faceNewNormal
(
map
,
"faceNewNormal"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceNewNormal
(
map
,
"faceNewNormal"
)
;
// Compute new normals
// Compute new normals
TraversorF
<
typename
PFP
::
MAP
>
tf
(
map
)
;
TraversorF
<
typename
PFP
::
MAP
>
tf
(
map
)
;
...
@@ -120,20 +121,21 @@ void filterAverageNormals(typename PFP::MAP& map, const VertexAttribute<typename
...
@@ -120,20 +121,21 @@ void filterAverageNormals(typename PFP::MAP& map, const VertexAttribute<typename
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
filterMMSE
(
typename
PFP
::
MAP
&
map
,
float
sigmaN2
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position2
)
void
filterMMSE
(
typename
PFP
::
MAP
&
map
,
float
sigmaN2
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position2
)
{
{
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
FaceAutoAttribute
<
REAL
>
faceArea
(
map
,
"faceArea"
)
;
FaceAutoAttribute
<
REAL
,
MAP_IMPL
>
faceArea
(
map
,
"faceArea"
)
;
FaceAutoAttribute
<
VEC3
>
faceNormal
(
map
,
"faceNormal"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceNormal
(
map
,
"faceNormal"
)
;
FaceAutoAttribute
<
VEC3
>
faceCentroid
(
map
,
"faceCentroid"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceCentroid
(
map
,
"faceCentroid"
)
;
Algo
::
Surface
::
Geometry
::
computeAreaFaces
<
PFP
>
(
map
,
position
,
faceArea
)
;
Algo
::
Surface
::
Geometry
::
computeAreaFaces
<
PFP
>
(
map
,
position
,
faceArea
)
;
Algo
::
Surface
::
Geometry
::
computeNormalFaces
<
PFP
>
(
map
,
position
,
faceNormal
)
;
Algo
::
Surface
::
Geometry
::
computeNormalFaces
<
PFP
>
(
map
,
position
,
faceNormal
)
;
Algo
::
Surface
::
Geometry
::
computeCentroidFaces
<
PFP
>
(
map
,
position
,
faceCentroid
)
;
Algo
::
Surface
::
Geometry
::
computeCentroidFaces
<
PFP
>
(
map
,
position
,
faceCentroid
)
;
FaceAutoAttribute
<
VEC3
>
faceNewNormal
(
map
,
"faceNewNormal"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceNewNormal
(
map
,
"faceNewNormal"
)
;
// Compute new normals
// Compute new normals
TraversorF
<
typename
PFP
::
MAP
>
tf
(
map
)
;
TraversorF
<
typename
PFP
::
MAP
>
tf
(
map
)
;
...
@@ -204,20 +206,21 @@ void filterMMSE(typename PFP::MAP& map, float sigmaN2, const VertexAttribute<typ
...
@@ -204,20 +206,21 @@ void filterMMSE(typename PFP::MAP& map, float sigmaN2, const VertexAttribute<typ
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
filterTNBA
(
typename
PFP
::
MAP
&
map
,
float
sigmaN2
,
float
SUSANthreshold
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position2
)
void
filterTNBA
(
typename
PFP
::
MAP
&
map
,
float
sigmaN2
,
float
SUSANthreshold
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position2
)
{
{
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
FaceAutoAttribute
<
REAL
>
faceArea
(
map
,
"faceArea"
)
;
FaceAutoAttribute
<
REAL
,
MAP_IMPL
>
faceArea
(
map
,
"faceArea"
)
;
FaceAutoAttribute
<
VEC3
>
faceNormal
(
map
,
"faceNormal"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceNormal
(
map
,
"faceNormal"
)
;
FaceAutoAttribute
<
VEC3
>
faceCentroid
(
map
,
"faceCentroid"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceCentroid
(
map
,
"faceCentroid"
)
;
Algo
::
Surface
::
Geometry
::
computeAreaFaces
<
PFP
>
(
map
,
position
,
faceArea
)
;
Algo
::
Surface
::
Geometry
::
computeAreaFaces
<
PFP
>
(
map
,
position
,
faceArea
)
;
Algo
::
Surface
::
Geometry
::
computeNormalFaces
<
PFP
>
(
map
,
position
,
faceNormal
)
;
Algo
::
Surface
::
Geometry
::
computeNormalFaces
<
PFP
>
(
map
,
position
,
faceNormal
)
;
Algo
::
Surface
::
Geometry
::
computeCentroidFaces
<
PFP
>
(
map
,
position
,
faceCentroid
)
;
Algo
::
Surface
::
Geometry
::
computeCentroidFaces
<
PFP
>
(
map
,
position
,
faceCentroid
)
;
FaceAutoAttribute
<
VEC3
>
faceNewNormal
(
map
,
"faceNewNormal"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceNewNormal
(
map
,
"faceNewNormal"
)
;
// Compute new normals
// Compute new normals
long
nbTot
=
0
;
long
nbTot
=
0
;
...
@@ -322,22 +325,23 @@ void filterTNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con
...
@@ -322,22 +325,23 @@ void filterTNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
filterVNBA
(
typename
PFP
::
MAP
&
map
,
float
sigmaN2
,
float
SUSANthreshold
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position2
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
)
void
filterVNBA
(
typename
PFP
::
MAP
&
map
,
float
sigmaN2
,
float
SUSANthreshold
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position2
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
normal
)
{
{
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
FaceAutoAttribute
<
REAL
>
faceArea
(
map
,
"faceArea"
)
;
FaceAutoAttribute
<
REAL
,
MAP_IMPL
>
faceArea
(
map
,
"faceArea"
)
;
FaceAutoAttribute
<
VEC3
>
faceNormal
(
map
,
"faceNormal"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceNormal
(
map
,
"faceNormal"
)
;
FaceAutoAttribute
<
VEC3
>
faceCentroid
(
map
,
"faceCentroid"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceCentroid
(
map
,
"faceCentroid"
)
;
Algo
::
Surface
::
Geometry
::
computeAreaFaces
<
PFP
>
(
map
,
position
,
faceArea
)
;
Algo
::
Surface
::
Geometry
::
computeAreaFaces
<
PFP
>
(
map
,
position
,
faceArea
)
;
Algo
::
Surface
::
Geometry
::
computeNormalFaces
<
PFP
>
(
map
,
position
,
faceNormal
)
;
Algo
::
Surface
::
Geometry
::
computeNormalFaces
<
PFP
>
(
map
,
position
,
faceNormal
)
;
Algo
::
Surface
::
Geometry
::
computeCentroidFaces
<
PFP
>
(
map
,
position
,
faceCentroid
)
;
Algo
::
Surface
::
Geometry
::
computeCentroidFaces
<
PFP
>
(
map
,
position
,
faceCentroid
)
;
VertexAutoAttribute
<
REAL
>
vertexArea
(
map
,
"vertexArea"
)
;
VertexAutoAttribute
<
REAL
,
MAP_IMPL
>
vertexArea
(
map
,
"vertexArea"
)
;
FaceAutoAttribute
<
VEC3
>
faceNewNormal
(
map
,
"faceNewNormal"
)
;
FaceAutoAttribute
<
VEC3
,
MAP_IMPL
>
faceNewNormal
(
map
,
"faceNewNormal"
)
;
VertexAutoAttribute
<
VEC3
>
vertexNewNormal
(
map
,
"vertexNewNormal"
)
;
VertexAutoAttribute
<
VEC3
,
MAP_IMPL
>
vertexNewNormal
(
map
,
"vertexNewNormal"
)
;
long
nbTot
=
0
;
long
nbTot
=
0
;
long
nbAdapt
=
0
;
long
nbAdapt
=
0
;
...
@@ -458,10 +462,10 @@ void filterVNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con
...
@@ -458,10 +462,10 @@ void filterVNBA(typename PFP::MAP& map, float sigmaN2, float SUSANthreshold, con
// CGoGNout <<" adaptive rate = "<< float(nbAdapt)/float(nbTot)<<CGoGNendl;
// CGoGNout <<" adaptive rate = "<< float(nbAdapt)/float(nbTot)<<CGoGNendl;
}
}
}
//namespace Filtering
}
//
namespace Filtering
}
}
// namespace Surface
}
//namespace Algo
}
//
namespace Algo
}
//namespace CGoGN
}
//
namespace CGoGN
include/Algo/Filtering/bilateral.h
View file @
28b02542
...
@@ -38,7 +38,7 @@ namespace Filtering
...
@@ -38,7 +38,7 @@ namespace Filtering
{
{
template
<
typename
PFP
>
template
<
typename
PFP
>
void
sigmaBilateral
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
,
float
&
sigmaC
,
float
&
sigmaS
)
void
sigmaBilateral
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
normal
,
float
&
sigmaC
,
float
&
sigmaS
)
{
{
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
...
@@ -60,7 +60,7 @@ void sigmaBilateral(typename PFP::MAP& map, const VertexAttribute<typename PFP::
...
@@ -60,7 +60,7 @@ void sigmaBilateral(typename PFP::MAP& map, const VertexAttribute<typename PFP::
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
filterBilateral
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position2
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
)
void
filterBilateral
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position2
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
normal
)
{
{
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
...
@@ -96,7 +96,7 @@ void filterBilateral(typename PFP::MAP& map, const VertexAttribute<typename PFP:
...
@@ -96,7 +96,7 @@ void filterBilateral(typename PFP::MAP& map, const VertexAttribute<typename PFP:
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
filterSUSAN
(
typename
PFP
::
MAP
&
map
,
float
SUSANthreshold
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position2
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
)
void
filterSUSAN
(
typename
PFP
::
MAP
&
map
,
float
SUSANthreshold
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position2
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
normal
)
{
{
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
...
...
include/Algo/Filtering/functors.h
View file @
28b02542
...
@@ -40,16 +40,18 @@ namespace Surface
...
@@ -40,16 +40,18 @@ namespace Surface
namespace
Filtering
namespace
Filtering
{
{
template
<
typename
T
,
unsigned
int
ORBIT
>
template
<
typename
ATTR_TYPE
>
class
FunctorAverage
:
public
virtual
FunctorType
class
FunctorAverage
:
public
virtual
FunctorType
{
{
typedef
typename
ATTR_TYPE
::
DATA_TYPE
T
;
protected:
protected:
const
A
ttributeHandler
<
T
,
ORBIT
>
&
attr
;
const
A
TTR_TYPE
&
attr
;
T
sum
;
T
sum
;
unsigned
int
count
;
unsigned
int
count
;
public:
public:
FunctorAverage
(
const
A
ttributeHandler
<
T
,
ORBIT
>
&
a
)
:
FunctorType
(),
attr
(
a
),
sum
(
0
),
count
(
0
)
FunctorAverage
(
const
A
TTR_TYPE
&
a
)
:
FunctorType
(),
attr
(
a
),
sum
(
0
),
count
(
0
)
{}
{}
bool
operator
()(
Dart
d
)
bool
operator
()(
Dart
d
)
{
{
...
@@ -66,18 +68,19 @@ public:
...
@@ -66,18 +68,19 @@ public:
template
<
typename
PFP
,
typename
T
>
template
<
typename
PFP
,
typename
T
>
class
FunctorAverageOnSphereBorder
:
public
FunctorMap
<
typename
PFP
::
MAP
>
class
FunctorAverageOnSphereBorder
:
public
FunctorMap
<
typename
PFP
::
MAP
>
{
{
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
protected:
protected:
const
VertexAttribute
<
T
>&
attr
;
const
VertexAttribute
<
T
,
MAP_IMPL
>&
attr
;
const
VertexAttribute
<
VEC3
>&
position
;
const
VertexAttribute
<
VEC3
,
MAP_IMPL
>&
position
;
VEC3
center
;
VEC3
center
;
typename
PFP
::
REAL
radius
;
typename
PFP
::
REAL
radius
;
T
sum
;
T
sum
;
unsigned
int
count
;
unsigned
int
count
;
public:
public:
FunctorAverageOnSphereBorder
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
T
,
VERTEX
>&
a
,
const
VertexAttribute
<
VEC3
>&
p
)
:
FunctorAverageOnSphereBorder
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
T
,
MAP_IMPL
>&
a
,
const
VertexAttribute
<
VEC3
,
MAP_IMPL
>&
p
)
:
FunctorMap
<
typename
PFP
::
MAP
>
(
map
),
attr
(
a
),
position
(
p
),
sum
(
0
),
count
(
0
)
FunctorMap
<
typename
PFP
::
MAP
>
(
map
),
attr
(
a
),
position
(
p
),
sum
(
0
),
count
(
0
)
{
{
center
=
VEC3
(
0
);
center
=
VEC3
(
0
);
...
@@ -99,7 +102,7 @@ public:
...
@@ -99,7 +102,7 @@ public:
}
// namespace Filtering
}
// namespace Filtering
}
}
// namespace Surface
}
// namespace Algo
}
// namespace Algo
...
...
include/Algo/Filtering/taubin.h
View file @
28b02542
...
@@ -38,8 +38,10 @@ namespace Filtering
...
@@ -38,8 +38,10 @@ namespace Filtering
{
{
template
<
typename
PFP
>
template
<
typename
PFP
>
void
filterTaubin
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position2
)
void
filterTaubin
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position2
)
{
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
Algo
::
Surface
::
Selection
::
Collector_OneRing
<
PFP
>
c
(
map
)
;
Algo
::
Surface
::
Selection
::
Collector_OneRing
<
PFP
>
c
(
map
)
;
...
@@ -47,9 +49,9 @@ void filterTaubin(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& p
...
@@ -47,9 +49,9 @@ void filterTaubin(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& p
const
float
lambda
=
0.6307
;
const
float
lambda
=
0.6307
;
const
float
mu
=
-
0.6732
;
const
float
mu
=
-
0.6732
;
CellMarkerNoUnmark
<
VERTEX
>
mv
(
map
)
;
CellMarkerNoUnmark
<
MAP
,
VERTEX
>
mv
(
map
)
;
FunctorAverage
<
V
EC3
,
VERTEX
>
fa1
(
position
)
;
FunctorAverage
<
V
ertexAttribute
<
VEC3
,
MAP_IMPL
>
>
fa1
(
position
)
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
{
if
(
!
mv
.
isMarked
(
d
))
if
(
!
mv
.
isMarked
(
d
))
...
@@ -72,7 +74,7 @@ void filterTaubin(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& p
...
@@ -72,7 +74,7 @@ void filterTaubin(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& p
}
}
// unshrinking step
// unshrinking step
FunctorAverage
<
V
EC3
,
VERTEX
>
fa2
(
position2
)
;
FunctorAverage
<
V
ertexAttribute
<
VEC3
,
MAP_IMPL
>
>
fa2
(
position2
)
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
{
if
(
mv
.
isMarked
(
d
))
if
(
mv
.
isMarked
(
d
))
...
@@ -99,14 +101,15 @@ void filterTaubin(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& p
...
@@ -99,14 +101,15 @@ void filterTaubin(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& p
* Taubin filter modified as proposed by [Lav09]
* Taubin filter modified as proposed by [Lav09]
*/
*/
template
<
typename
PFP
>
template
<
typename
PFP
>
void
filterTaubin_modified
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename