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
46711425
Commit
46711425
authored
Jul 11, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of cgogn:~vanhoey/CGoGN into develop
Conflicts: include/Algo/Geometry/normal.hpp
parents
b9ae811b
5ebd12a3
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
109 additions
and
134 deletions
+109
-134
CMakeLists.txt
CMakeLists.txt
+1
-1
include/Algo/Decimation/decimation.hpp
include/Algo/Decimation/decimation.hpp
+1
-1
include/Algo/Decimation/halfEdgeSelector.h
include/Algo/Decimation/halfEdgeSelector.h
+2
-2
include/Algo/Decimation/halfEdgeSelector.hpp
include/Algo/Decimation/halfEdgeSelector.hpp
+2
-2
include/Algo/Export/export.hpp
include/Algo/Export/export.hpp
+0
-2
include/Algo/Filtering/bilateral.h
include/Algo/Filtering/bilateral.h
+16
-5
include/Algo/Geometry/normal.hpp
include/Algo/Geometry/normal.hpp
+25
-48
include/Algo/Import/import2tablesSurface.hpp
include/Algo/Import/import2tablesSurface.hpp
+1
-13
include/Algo/Import/importFileTypes.h
include/Algo/Import/importFileTypes.h
+0
-9
include/Algo/ProgressiveMesh/pmesh.h
include/Algo/ProgressiveMesh/pmesh.h
+4
-4
include/Algo/ProgressiveMesh/pmesh.hpp
include/Algo/ProgressiveMesh/pmesh.hpp
+14
-14
include/Algo/Render/GL2/colorPerFaceRender.h
include/Algo/Render/GL2/colorPerFaceRender.h
+2
-2
include/Algo/Render/GL2/colorPerFaceRender.hpp
include/Algo/Render/GL2/colorPerFaceRender.hpp
+3
-3
include/Algo/Render/GL2/dataPerFaceRender.h
include/Algo/Render/GL2/dataPerFaceRender.h
+1
-1
include/Algo/Render/GL2/dataPerFaceRender.hpp
include/Algo/Render/GL2/dataPerFaceRender.hpp
+1
-1
include/Algo/Selection/collector.h
include/Algo/Selection/collector.h
+2
-0
include/Algo/Selection/collector.hpp
include/Algo/Selection/collector.hpp
+7
-7
include/Geometry/basic.h
include/Geometry/basic.h
+5
-3
include/Geometry/vector_gen.h
include/Geometry/vector_gen.h
+1
-1
include/Topology/generic/cells.h
include/Topology/generic/cells.h
+1
-1
include/Topology/generic/mapCommon.hpp
include/Topology/generic/mapCommon.hpp
+2
-2
include/Utils/Shaders/shaderFlat.frag
include/Utils/Shaders/shaderFlat.frag
+1
-0
include/Utils/Shaders/shaderFlat.geom
include/Utils/Shaders/shaderFlat.geom
+5
-3
include/Utils/Shaders/shaderFlatColor.frag
include/Utils/Shaders/shaderFlatColor.frag
+1
-0
include/Utils/Shaders/shaderIsoLines.frag
include/Utils/Shaders/shaderIsoLines.frag
+1
-0
include/Utils/pointSprite.frag
include/Utils/pointSprite.frag
+1
-0
include/Utils/qem.h
include/Utils/qem.h
+2
-2
include/Utils/svg.h
include/Utils/svg.h
+2
-2
src/Utils/GLSLShader.cpp
src/Utils/GLSLShader.cpp
+1
-1
src/Utils/Qt/qtSimple.cpp
src/Utils/Qt/qtSimple.cpp
+1
-1
src/Utils/svg.cpp
src/Utils/svg.cpp
+3
-3
No files found.
CMakeLists.txt
View file @
46711425
...
@@ -142,7 +142,7 @@ IF (WITH_QT)
...
@@ -142,7 +142,7 @@ IF (WITH_QT)
ADD_DEFINITIONS
(
${
QT_DEFINITIONS
}
)
ADD_DEFINITIONS
(
${
QT_DEFINITIONS
}
)
find_package
(
QGLViewer REQUIRED
)
find_package
(
QGLViewer REQUIRED
)
SET
(
CGoGN_EXT_INCLUDES
${
CGoGN_EXT_INCLUDES
}
${
QT_INCLUDE_DIR
}
${
QGLVIEWER_INCLUDE_DIR
}
)
SET
(
CGoGN_EXT_INCLUDES
${
CGoGN_EXT_INCLUDES
}
${
QT_INCLUDE_DIR
}
${
QGLVIEWER_INCLUDE_DIR
}
)
SET
(
CGoGN_EXT_LIBS
${
CGoGN_EXT_LIBS
}
${
QT_LIBRARIES
}
${
QGLVIEWER_LIBRARIES
}
)
SET
(
CGoGN_EXT_LIBS
${
QT_LIBRARIES
}
${
QGLVIEWER_LIBRARIES
}
${
CGoGN_EXT_LIBS
}
)
ENDIF
(
WITH_QT
)
ENDIF
(
WITH_QT
)
IF
(
WITH_GLEWMX
)
IF
(
WITH_GLEWMX
)
...
...
include/Algo/Decimation/decimation.hpp
View file @
46711425
...
@@ -195,7 +195,7 @@ int decimate(
...
@@ -195,7 +195,7 @@ int decimate(
return
-
1
;
// init failed
return
-
1
;
// init failed
}
}
unsigned
int
nbVertices
=
Algo
::
Topo
::
getNbOrbits
<
VERTEX
>
(
map
)
;
unsigned
int
nbVertices
=
Algo
::
Topo
::
getNbOrbits
<
VERTEX
>
(
map
)
;
bool
finished
=
false
;
bool
finished
=
false
;
while
(
!
finished
)
while
(
!
finished
)
...
...
include/Algo/Decimation/halfEdgeSelector.h
View file @
46711425
...
@@ -230,8 +230,8 @@ public:
...
@@ -230,8 +230,8 @@ public:
m_approxindex_normal
(
-
1
),
m_approxindex_normal
(
-
1
),
m_attrindex_normal
(
-
1
)
m_attrindex_normal
(
-
1
)
{
{
halfEdgeInfo
=
m
.
template
addAttribute
<
HalfEdgeInfo
,
DART
>(
"halfEdgeInfo"
)
;
halfEdgeInfo
=
m
.
template
addAttribute
<
HalfEdgeInfo
,
DART
,
MAP
>(
"halfEdgeInfo"
)
;
m_quadric
=
m
.
template
addAttribute
<
Utils
::
QuadricNd
<
REAL
,
9
>,
VERTEX
>
(
"hQEMextNormal-quadric"
)
;
m_quadric
=
m
.
template
addAttribute
<
Utils
::
QuadricNd
<
REAL
,
9
>,
VERTEX
,
MAP
>
(
"hQEMextNormal-quadric"
)
;
}
}
~
HalfEdgeSelector_QEMextColorNormal
()
~
HalfEdgeSelector_QEMextColorNormal
()
{
{
...
...
include/Algo/Decimation/halfEdgeSelector.hpp
View file @
46711425
...
@@ -619,7 +619,7 @@ bool HalfEdgeSelector_QEMextColorNormal<PFP>::init()
...
@@ -619,7 +619,7 @@ bool HalfEdgeSelector_QEMextColorNormal<PFP>::init()
++ok ;
++ok ;
m_approxindex_color = approxindex ;
m_approxindex_color = approxindex ;
m_attrindex_color = attrindex ;
m_attrindex_color = attrindex ;
m_color = m.template getAttribute<typename PFP::VEC3, VERTEX
>("color") ;
m_color = m.template getAttribute<typename PFP::VEC3, VERTEX, MAP
>("color") ;
assert(m_color.isValid() || !"EdgeSelector_QEMextColor: color attribute is not valid") ;
assert(m_color.isValid() || !"EdgeSelector_QEMextColor: color attribute is not valid") ;
if (!saved)
if (!saved)
{
{
...
@@ -632,7 +632,7 @@ bool HalfEdgeSelector_QEMextColorNormal<PFP>::init()
...
@@ -632,7 +632,7 @@ bool HalfEdgeSelector_QEMextColorNormal<PFP>::init()
++ok ;
++ok ;
m_approxindex_normal = approxindex ;
m_approxindex_normal = approxindex ;
m_attrindex_normal = attrindex ;
m_attrindex_normal = attrindex ;
m_normal = m.template getAttribute<typename PFP::VEC3, VERTEX
>("normal") ;
m_normal = m.template getAttribute<typename PFP::VEC3, VERTEX, MAP
>("normal") ;
assert(m_normal.isValid() || !"EdgeSelector_QEMextColorNormal: normal attribute is not valid") ;
assert(m_normal.isValid() || !"EdgeSelector_QEMextColorNormal: normal attribute is not valid") ;
if (!saved)
if (!saved)
{
{
...
...
include/Algo/Export/export.hpp
View file @
46711425
...
@@ -46,7 +46,6 @@ template <typename PFP>
...
@@ -46,7 +46,6 @@ template <typename PFP>
bool
exportPLY
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
,
bool
binary
)
bool
exportPLY
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
,
bool
binary
)
{
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
// open file
// open file
std
::
ofstream
out
;
std
::
ofstream
out
;
...
@@ -989,7 +988,6 @@ template <typename PFP>
...
@@ -989,7 +988,6 @@ template <typename PFP>
bool
exportChoupi
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
)
bool
exportChoupi
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
const
char
*
filename
)
{
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
std
::
ofstream
out
(
filename
,
std
::
ios
::
out
)
;
std
::
ofstream
out
(
filename
,
std
::
ios
::
out
)
;
if
(
!
out
.
good
())
if
(
!
out
.
good
())
...
...
include/Algo/Filtering/bilateral.h
View file @
46711425
...
@@ -59,13 +59,24 @@ void sigmaBilateral(typename PFP::MAP& map, const VertexAttribute<typename PFP::
...
@@ -59,13 +59,24 @@ void sigmaBilateral(typename PFP::MAP& map, const VertexAttribute<typename PFP::
sigmaS
=
2.5
f
*
(
sumAngles
/
float
(
nbEdges
)
)
;
sigmaS
=
2.5
f
*
(
sumAngles
/
float
(
nbEdges
)
)
;
}
}
/**
* \brief Function applying a bilateral filter smoothing on the mesh.
* \param map the map of the mesh
* \param positionIn the current positions container of the mesh
* \param positionOut the smoothed positions after the function call
* \param normal the normals
*/
template
<
typename
PFP
>
template
<
typename
PFP
>
void
filterBilateral
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
position2
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
normal
)
void
filterBilateral
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
positionIn
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
positionOut
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
normal
)
{
{
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
float
sigmaC
,
sigmaS
;
float
sigmaC
,
sigmaS
;
sigmaBilateral
<
PFP
>
(
map
,
positio
n
,
normal
,
sigmaC
,
sigmaS
)
;
sigmaBilateral
<
PFP
>
(
map
,
positionI
n
,
normal
,
sigmaC
,
sigmaS
)
;
TraversorV
<
typename
PFP
::
MAP
>
t
(
map
)
;
TraversorV
<
typename
PFP
::
MAP
>
t
(
map
)
;
for
(
Dart
d
=
t
.
begin
();
d
!=
t
.
end
();
d
=
t
.
next
())
for
(
Dart
d
=
t
.
begin
();
d
!=
t
.
end
();
d
=
t
.
next
())
...
@@ -80,7 +91,7 @@ void filterBilateral(typename PFP::MAP& map, const VertexAttribute<typename PFP:
...
@@ -80,7 +91,7 @@ void filterBilateral(typename PFP::MAP& map, const VertexAttribute<typename PFP:
Traversor2VE
<
typename
PFP
::
MAP
>
te
(
map
,
d
)
;
Traversor2VE
<
typename
PFP
::
MAP
>
te
(
map
,
d
)
;
for
(
Dart
it
=
te
.
begin
();
it
!=
te
.
end
();
it
=
te
.
next
())
for
(
Dart
it
=
te
.
begin
();
it
!=
te
.
end
();
it
=
te
.
next
())
{
{
VEC3
vec
=
Algo
::
Surface
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
map
,
it
,
positio
n
)
;
VEC3
vec
=
Algo
::
Surface
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
map
,
it
,
positionI
n
)
;
float
h
=
normal_d
*
vec
;
float
h
=
normal_d
*
vec
;
float
t
=
vec
.
norm
()
;
float
t
=
vec
.
norm
()
;
float
wcs
=
exp
(
(
-
1.0
f
*
(
t
*
t
)
/
(
2.0
f
*
sigmaC
*
sigmaC
)
)
+
(
-
1.0
f
*
(
h
*
h
)
/
(
2.0
f
*
sigmaS
*
sigmaS
)
)
)
;
float
wcs
=
exp
(
(
-
1.0
f
*
(
t
*
t
)
/
(
2.0
f
*
sigmaC
*
sigmaC
)
)
+
(
-
1.0
f
*
(
h
*
h
)
/
(
2.0
f
*
sigmaS
*
sigmaS
)
)
)
;
...
@@ -88,10 +99,10 @@ void filterBilateral(typename PFP::MAP& map, const VertexAttribute<typename PFP:
...
@@ -88,10 +99,10 @@ void filterBilateral(typename PFP::MAP& map, const VertexAttribute<typename PFP:
normalizer
+=
wcs
;
normalizer
+=
wcs
;
}
}
position2
[
d
]
=
positio
n
[
d
]
+
((
sum
/
normalizer
)
*
normal_d
)
;
positionOut
[
d
]
=
positionI
n
[
d
]
+
((
sum
/
normalizer
)
*
normal_d
)
;
}
}
else
else
position2
[
d
]
=
positio
n
[
d
]
;
positionOut
[
d
]
=
positionI
n
[
d
]
;
}
}
}
}
...
...
include/Algo/Geometry/normal.hpp
View file @
46711425
...
@@ -28,6 +28,8 @@
...
@@ -28,6 +28,8 @@
#include "Topology/generic/traversor/traversorCell.h"
#include "Topology/generic/traversor/traversorCell.h"
#include "Topology/generic/traversor/traversor2.h"
#include "Topology/generic/traversor/traversor2.h"
#include "Algo/Parallel/parallel_foreach.h"
#include <cmath>
#include <cmath>
namespace
CGoGN
namespace
CGoGN
...
@@ -45,8 +47,6 @@ namespace Geometry
...
@@ -45,8 +47,6 @@ namespace Geometry
template
<
typename
PFP
,
typename
V_ATT
>
template
<
typename
PFP
,
typename
V_ATT
>
typename
V_ATT
::
DATA_TYPE
triangleNormal
(
typename
PFP
::
MAP
&
map
,
Face
f
,
const
V_ATT
&
position
)
typename
V_ATT
::
DATA_TYPE
triangleNormal
(
typename
PFP
::
MAP
&
map
,
Face
f
,
const
V_ATT
&
position
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
typename
V_ATT
::
DATA_TYPE
N
=
Geom
::
triangleNormal
(
typename
V_ATT
::
DATA_TYPE
N
=
Geom
::
triangleNormal
(
position
[
f
.
dart
],
position
[
f
.
dart
],
position
[
map
.
phi1
(
f
)],
position
[
map
.
phi1
(
f
)],
...
@@ -59,8 +59,6 @@ typename V_ATT::DATA_TYPE triangleNormal(typename PFP::MAP& map, Face f, const V
...
@@ -59,8 +59,6 @@ typename V_ATT::DATA_TYPE triangleNormal(typename PFP::MAP& map, Face f, const V
template
<
typename
PFP
,
typename
V_ATT
>
template
<
typename
PFP
,
typename
V_ATT
>
typename
V_ATT
::
DATA_TYPE
newellNormal
(
typename
PFP
::
MAP
&
map
,
Face
f
,
const
V_ATT
&
position
)
typename
V_ATT
::
DATA_TYPE
newellNormal
(
typename
PFP
::
MAP
&
map
,
Face
f
,
const
V_ATT
&
position
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
VEC3
N
(
0
);
VEC3
N
(
0
);
...
@@ -80,8 +78,6 @@ typename V_ATT::DATA_TYPE newellNormal(typename PFP::MAP& map, Face f, const V_A
...
@@ -80,8 +78,6 @@ typename V_ATT::DATA_TYPE newellNormal(typename PFP::MAP& map, Face f, const V_A
template
<
typename
PFP
,
typename
V_ATT
>
template
<
typename
PFP
,
typename
V_ATT
>
typename
V_ATT
::
DATA_TYPE
faceNormal
(
typename
PFP
::
MAP
&
map
,
Face
f
,
const
V_ATT
&
position
)
typename
V_ATT
::
DATA_TYPE
faceNormal
(
typename
PFP
::
MAP
&
map
,
Face
f
,
const
V_ATT
&
position
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
if
(
map
.
faceDegree
(
f
)
==
3
)
if
(
map
.
faceDegree
(
f
)
==
3
)
return
triangleNormal
<
PFP
>
(
map
,
f
,
position
)
;
return
triangleNormal
<
PFP
>
(
map
,
f
,
position
)
;
else
else
...
@@ -91,8 +87,6 @@ typename V_ATT::DATA_TYPE faceNormal(typename PFP::MAP& map, Face f, const V_ATT
...
@@ -91,8 +87,6 @@ typename V_ATT::DATA_TYPE faceNormal(typename PFP::MAP& map, Face f, const V_ATT
template
<
typename
PFP
,
typename
V_ATT
>
template
<
typename
PFP
,
typename
V_ATT
>
typename
V_ATT
::
DATA_TYPE
vertexNormal
(
typename
PFP
::
MAP
&
map
,
Vertex
v
,
const
V_ATT
&
position
)
typename
V_ATT
::
DATA_TYPE
vertexNormal
(
typename
PFP
::
MAP
&
map
,
Vertex
v
,
const
V_ATT
&
position
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
VEC3
N
(
0
)
;
VEC3
N
(
0
)
;
...
@@ -104,12 +98,8 @@ typename V_ATT::DATA_TYPE vertexNormal(typename PFP::MAP& map, Vertex v, const V
...
@@ -104,12 +98,8 @@ typename V_ATT::DATA_TYPE vertexNormal(typename PFP::MAP& map, Vertex v, const V
{
{
VEC3
v1
=
vectorOutOfDart
<
PFP
>
(
map
,
f
.
dart
,
position
)
;
VEC3
v1
=
vectorOutOfDart
<
PFP
>
(
map
,
f
.
dart
,
position
)
;
VEC3
v2
=
vectorOutOfDart
<
PFP
>
(
map
,
map
.
phi_1
(
f
),
position
)
;
VEC3
v2
=
vectorOutOfDart
<
PFP
>
(
map
,
map
.
phi_1
(
f
),
position
)
;
typename
VEC3
::
DATA_TYPE
l
=
(
v1
.
norm2
()
*
v2
.
norm2
());
n
*=
convexFaceArea
<
PFP
>
(
map
,
f
,
position
)
/
(
v1
.
norm2
()
*
v2
.
norm2
())
;
if
(
l
>
(
typename
VEC3
::
DATA_TYPE
(
0.0
))
)
N
+=
n
;
{
n
*=
convexFaceArea
<
PFP
>
(
map
,
f
,
position
)
/
l
;
N
+=
n
;
}
}
}
});
});
...
@@ -120,7 +110,6 @@ typename V_ATT::DATA_TYPE vertexNormal(typename PFP::MAP& map, Vertex v, const V
...
@@ -120,7 +110,6 @@ typename V_ATT::DATA_TYPE vertexNormal(typename PFP::MAP& map, Vertex v, const V
template
<
typename
PFP
,
typename
V_ATT
>
template
<
typename
PFP
,
typename
V_ATT
>
typename
V_ATT
::
DATA_TYPE
vertexBorderNormal
(
typename
PFP
::
MAP
&
map
,
Vertex
v
,
const
V_ATT
&
position
)
typename
V_ATT
::
DATA_TYPE
vertexBorderNormal
(
typename
PFP
::
MAP
&
map
,
Vertex
v
,
const
V_ATT
&
position
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
assert
(
map
.
dimension
()
==
3
);
assert
(
map
.
dimension
()
==
3
);
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
...
@@ -156,43 +145,39 @@ typename V_ATT::DATA_TYPE vertexBorderNormal(typename PFP::MAP& map, Vertex v, c
...
@@ -156,43 +145,39 @@ typename V_ATT::DATA_TYPE vertexBorderNormal(typename PFP::MAP& map, Vertex v, c
template
<
typename
PFP
,
typename
V_ATT
,
typename
F_ATT
>
template
<
typename
PFP
,
typename
V_ATT
,
typename
F_ATT
>
void
computeNormalFaces
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
F_ATT
&
face_normal
,
unsigned
int
thread
)
void
computeNormalFaces
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
F_ATT
&
face_normal
,
unsigned
int
thread
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
CHECK_ATTRIBUTEHANDLER_ORBIT
(
F_ATT
,
FACE
);
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
{
Parallel
::
computeNormalFaces
<
PFP
,
V_ATT
,
F_ATT
>
(
map
,
position
,
face_normal
);
Parallel
::
computeNormalFaces
<
PFP
,
V_ATT
,
F_ATT
>
(
map
,
position
,
face_normal
);
return
;
return
;
}
}
foreach_cell
<
FACE
>
(
map
,
[
&
]
(
Face
f
)
foreach_cell
<
FACE
>
(
map
,
[
&
]
(
Face
f
)
{
{
face_normal
[
f
]
=
faceNormal
<
PFP
>
(
map
,
f
,
position
)
;
face_normal
[
f
]
=
faceNormal
<
PFP
>
(
map
,
f
,
position
)
;
},
AUTO
,
thread
);
},
AUTO
,
thread
);
}
}
template
<
typename
PFP
,
typename
V_ATT
>
template
<
typename
PFP
,
typename
V_ATT
>
void
computeNormalVertices
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
V_ATT
&
normal
,
unsigned
int
thread
)
void
computeNormalVertices
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
V_ATT
&
normal
,
unsigned
int
thread
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
{
Parallel
::
computeNormalVertices
<
PFP
,
V_ATT
>
(
map
,
position
,
normal
);
Parallel
::
computeNormalVertices
<
PFP
,
V_ATT
>
(
map
,
position
,
normal
);
return
;
return
;
}
}
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
)
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
)
{
{
normal
[
v
]
=
vertexNormal
<
PFP
>
(
map
,
v
,
position
)
;
normal
[
v
]
=
vertexNormal
<
PFP
>
(
map
,
v
,
position
)
;
},
FORCE_CELL_MARKING
,
thread
);
},
FORCE_CELL_MARKING
,
thread
);
}
}
template
<
typename
PFP
,
typename
V_ATT
>
template
<
typename
PFP
,
typename
V_ATT
>
typename
PFP
::
REAL
computeAngleBetweenNormalsOnEdge
(
typename
PFP
::
MAP
&
map
,
Edge
e
,
const
V_ATT
&
position
)
typename
PFP
::
REAL
computeAngleBetweenNormalsOnEdge
(
typename
PFP
::
MAP
&
map
,
Edge
e
,
const
V_ATT
&
position
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
if
(
map
.
isBoundaryEdge
(
e
))
if
(
map
.
isBoundaryEdge
(
e
))
...
@@ -226,58 +211,50 @@ typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Edge
...
@@ -226,58 +211,50 @@ typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Edge
template
<
typename
PFP
,
typename
V_ATT
,
typename
E_ATT
>
template
<
typename
PFP
,
typename
V_ATT
,
typename
E_ATT
>
void
computeAnglesBetweenNormalsOnEdges
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
E_ATT
&
angles
,
unsigned
int
thread
)
void
computeAnglesBetweenNormalsOnEdges
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
E_ATT
&
angles
,
unsigned
int
thread
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
CHECK_ATTRIBUTEHANDLER_ORBIT
(
E_ATT
,
EDGE
);
if
((
CGoGN
::
Parallel
::
NumberOfThreads
>
1
)
&&
(
thread
==
0
))
{
{
Parallel
::
computeAnglesBetweenNormalsOnEdges
<
PFP
,
V_ATT
,
E_ATT
>
(
map
,
position
,
angles
);
Parallel
::
computeAnglesBetweenNormalsOnEdges
<
PFP
,
V_ATT
,
E_ATT
>
(
map
,
position
,
angles
);
return
;
return
;
}
}
foreach_cell
<
EDGE
>
(
map
,
[
&
]
(
Edge
e
)
foreach_cell
<
EDGE
>
(
map
,
[
&
]
(
Edge
e
)
{
{
angles
[
e
]
=
computeAngleBetweenNormalsOnEdge
<
PFP
>
(
map
,
e
,
position
)
;
angles
[
e
]
=
computeAngleBetweenNormalsOnEdge
<
PFP
>
(
map
,
e
,
position
)
;
},
AUTO
,
thread
);
},
AUTO
,
thread
);
}
}
namespace
Parallel
namespace
Parallel
{
{
template
<
typename
PFP
,
typename
V_ATT
>
template
<
typename
PFP
,
typename
V_ATT
>
void
computeNormalVertices
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
V_ATT
&
normal
)
void
computeNormalVertices
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
V_ATT
&
normal
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,[
&
](
Vertex
v
,
unsigned
int
/*thr*/
)
CGoGN
::
Parallel
::
foreach_cell
<
VERTEX
>
(
map
,
[
&
]
(
Vertex
v
,
unsigned
int
/*thr*/
)
{
{
normal
[
v
]
=
vertexNormal
<
PFP
>
(
map
,
v
,
position
)
;
normal
[
v
]
=
vertexNormal
<
PFP
>
(
map
,
v
,
position
)
;
},
FORCE_CELL_MARKING
);
},
true
,
FORCE_CELL_MARKING
);
}
}
template
<
typename
PFP
,
typename
V_ATT
,
typename
F_ATT
>
template
<
typename
PFP
,
typename
V_ATT
,
typename
F_ATT
>
void
computeNormalFaces
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
F_ATT
&
normal
)
void
computeNormalFaces
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
F_ATT
&
normal
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
CGoGN
::
Parallel
::
foreach_cell
<
FACE
>
(
map
,[
&
](
Face
f
,
unsigned
int
thr
)
CHECK_ATTRIBUTEHANDLER_ORBIT
(
F_ATT
,
FACE
);
CGoGN
::
Parallel
::
foreach_cell
<
FACE
>
(
map
,
[
&
]
(
Face
f
,
unsigned
int
/*thr*/
)
{
{
normal
[
f
]
=
faceNormal
<
PFP
>
(
map
,
f
,
position
)
;
normal
[
f
]
=
faceNormal
<
PFP
>
(
map
,
f
,
position
)
;
});
}
,
true
,
AUTO
);
}
}
template
<
typename
PFP
,
typename
V_ATT
,
typename
E_ATT
>
template
<
typename
PFP
,
typename
V_ATT
,
typename
E_ATT
>
void
computeAnglesBetweenNormalsOnEdges
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
E_ATT
&
angles
)
void
computeAnglesBetweenNormalsOnEdges
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
position
,
E_ATT
&
angles
)
{
{
CHECK_ATTRIBUTEHANDLER_ORBIT
(
V_ATT
,
VERTEX
);
CGoGN
::
Parallel
::
foreach_cell
<
EDGE
>
(
map
,[
&
](
Edge
e
,
unsigned
int
thr
)
CHECK_ATTRIBUTEHANDLER_ORBIT
(
E_ATT
,
EDGE
);
CGoGN
::
Parallel
::
foreach_cell
<
EDGE
>
(
map
,[
&
](
Edge
e
,
unsigned
int
/*thr*/
)
{
{
angles
[
e
]
=
computeAngleBetweenNormalsOnEdge
<
PFP
>
(
map
,
e
,
position
)
;
angles
[
e
]
=
computeAngleBetweenNormalsOnEdge
<
PFP
>
(
map
,
e
,
position
)
;
});
}
,
true
,
AUTO
);
}
}
}
// namespace Parallel
}
// namespace Parallel
...
...
include/Algo/Import/import2tablesSurface.hpp
View file @
46711425
...
@@ -73,18 +73,6 @@ bool MeshTablesSurface<PFP>::importMesh(const std::string& filename, std::vector
...
@@ -73,18 +73,6 @@ bool MeshTablesSurface<PFP>::importMesh(const std::string& filename, std::vector
CGoGNout << "TYPE: PLY" << CGoGNendl;
CGoGNout << "TYPE: PLY" << CGoGNendl;
return importPly(filename, attrNames);
return importPly(filename, attrNames);
break;
break;
/* case PLYPTM:
CGoGNout << "TYPE: PLYPTM" << CGoGNendl;
return importPlyPTM(filename, attrNames);
break;
*/ case PLYSLFgeneric:
CGoGNout << "TYPE: PLYSLFgeneric" << CGoGNendl;
return importPlySLFgeneric(filename, attrNames);
break;
case PLYSLFgenericBin:
CGoGNout << "TYPE: PLYSLFgenericBin" << CGoGNendl;
return importPlySLFgenericBin(filename, attrNames);
break;
case OBJ:
case OBJ:
CGoGNout << "TYPE: OBJ" << CGoGNendl;
CGoGNout << "TYPE: OBJ" << CGoGNendl;
return importObj(filename, attrNames);
return importObj(filename, attrNames);
...
@@ -772,7 +760,7 @@ bool MeshTablesSurface<PFP>::importPlySLFgeneric(const std::string& filename, st
...
@@ -772,7 +760,7 @@ bool MeshTablesSurface<PFP>::importPlySLFgeneric(const std::string& filename, st
// Define containers
// Define containers
VertexAttribute<VEC3, MAP> positions = m_map.template getAttribute<VEC3, VERTEX, MAP>("position") ;
VertexAttribute<VEC3, MAP> positions = m_map.template getAttribute<VEC3, VERTEX, MAP>("position") ;
;
if (!positions.isValid())
if (!positions.isValid())
positions = m_map.template addAttribute<VEC3, VERTEX, MAP>("position") ;
positions = m_map.template addAttribute<VEC3, VERTEX, MAP>("position") ;
attrNames.push_back(positions.name()) ;
attrNames.push_back(positions.name()) ;
...
...
include/Algo/Import/importFileTypes.h
View file @
46711425
...
@@ -48,15 +48,6 @@ namespace Import
...
@@ -48,15 +48,6 @@ namespace Import
if
((
filename
.
rfind
(
".meshbin"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".MESHBIN"
)
!=
std
::
string
::
npos
))
if
((
filename
.
rfind
(
".meshbin"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".MESHBIN"
)
!=
std
::
string
::
npos
))
return
MESHBIN
;
return
MESHBIN
;
/* if ((filename.rfind(".plyptm")!=std::string::npos) || (filename.rfind(".PLYGEN")!=std::string::npos))
return PLYPTM;
*/
if
((
filename
.
rfind
(
".plyPTMextBin"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".plySHrealBin"
)
!=
std
::
string
::
npos
))
return
PLYSLFgenericBin
;
if
((
filename
.
rfind
(
".plyPTMext"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".plySHreal"
)
!=
std
::
string
::
npos
))
return
PLYSLFgeneric
;
if
((
filename
.
rfind
(
".ply"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".PLY"
)
!=
std
::
string
::
npos
))
if
((
filename
.
rfind
(
".ply"
)
!=
std
::
string
::
npos
)
||
(
filename
.
rfind
(
".PLY"
)
!=
std
::
string
::
npos
))
return
PLY
;
return
PLY
;
...
...
include/Algo/ProgressiveMesh/pmesh.h
View file @
46711425
...
@@ -59,7 +59,7 @@ private:
...
@@ -59,7 +59,7 @@ private:
MAP
&
m_map
;
MAP
&
m_map
;
VertexAttribute
<
VEC3
,
MAP
>&
position
;
VertexAttribute
<
VEC3
,
MAP
>&
position
;
DartMarker
<
MAP
>&
inactiveMarker
;
DartMarker
<
MAP
>&
inactiveMarker
;
Algo
::
Surface
::
Decimation
::
Selector
<
PFP
>*
m_selector
;
Algo
::
Surface
::
Decimation
::
Selector
<
PFP
>*
m_selector
;
std
::
vector
<
Algo
::
Surface
::
Decimation
::
ApproximatorGen
<
PFP
>*>
m_approximators
;
std
::
vector
<
Algo
::
Surface
::
Decimation
::
ApproximatorGen
<
PFP
>*>
m_approximators
;
...
@@ -81,15 +81,15 @@ private:
...
@@ -81,15 +81,15 @@ private:
public:
public:
ProgressiveMesh
(
ProgressiveMesh
(
MAP
&
map
,
MAP
&
map
,
DartMarker
<
MAP
>&
inactive
,
DartMarker
<
MAP
>&
inactive
,
Algo
::
Surface
::
Decimation
::
SelectorType
s
,
Algo
::
Surface
::
Decimation
::
SelectorType
s
,
Algo
::
Surface
::
Decimation
::
ApproximatorType
a
,
Algo
::
Surface
::
Decimation
::
ApproximatorType
a
,
VertexAttribute
<
VEC3
,
MAP
>&
position
VertexAttribute
<
VEC3
,
MAP
>&
position
)
;
)
;
ProgressiveMesh
(
ProgressiveMesh
(
MAP
&
map
,
DartMarker
&
inactive
,
MAP
&
map
,
DartMarker
<
MAP
>
&
inactive
,
Algo
::
Surface
::
Decimation
::
Selector
<
PFP
>*
selector
,
std
::
vector
<
Algo
::
Surface
::
Decimation
::
ApproximatorGen
<
PFP
>*>&
approximators
,
Algo
::
Surface
::
Decimation
::
Selector
<
PFP
>*
selector
,
std
::
vector
<
Algo
::
Surface
::
Decimation
::
ApproximatorGen
<
PFP
>*>&
approximators
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
)
;
VertexAttribute
<
VEC3
,
MAP
>&
position
)
;
~
ProgressiveMesh
()
;
~
ProgressiveMesh
()
;
bool
initOk
()
{
return
m_initOk
;
}
bool
initOk
()
{
return
m_initOk
;
}
...
...
include/Algo/ProgressiveMesh/pmesh.hpp
View file @
46711425
...
@@ -39,13 +39,13 @@ namespace PMesh
...
@@ -39,13 +39,13 @@ namespace PMesh
template
<
typename
PFP
>
template
<
typename
PFP
>
ProgressiveMesh
<
PFP
>::
ProgressiveMesh
(
ProgressiveMesh
<
PFP
>::
ProgressiveMesh
(
MAP
&
map
,
MAP
&
map
,
DartMarker
<
MAP
>&
inactive
,
DartMarker
<
MAP
>&
inactive
,
Algo
::
Surface
::
Decimation
::
SelectorType
s
,
Algo
::
Surface
::
Decimation
::
SelectorType
s
,
Algo
::
Surface
::
Decimation
::
ApproximatorType
a
,
Algo
::
Surface
::
Decimation
::
ApproximatorType
a
,
VertexAttribute
<
VEC3
,
MAP
>&
pos
VertexAttribute
<
VEC3
,
MAP
>&
pos
)
:
)
:
m_map
(
map
),
m_map
(
map
),
position
(
pos
),
position
(
pos
),
inactiveMarker
(
inactive
)
inactiveMarker
(
inactive
)
{
{
CGoGNout
<<
" creating approximator and predictor.."
<<
CGoGNflush
;
CGoGNout
<<
" creating approximator and predictor.."
<<
CGoGNflush
;
...
@@ -87,22 +87,22 @@ ProgressiveMesh<PFP>::ProgressiveMesh(
...
@@ -87,22 +87,22 @@ ProgressiveMesh<PFP>::ProgressiveMesh(
switch
(
s
)
switch
(
s
)
{
{
case
Algo
::
Surface
::
Decimation
::
S_MapOrder
:
{
case
Algo
::
Surface
::
Decimation
::
S_MapOrder
:
{
m_selector
=
new
Algo
::
Surface
::
Decimation
::
EdgeSelector_MapOrder
<
PFP
>
(
m_map
,
positionsTable
,
m_approximators
)
;
m_selector
=
new
Algo
::
Surface
::
Decimation
::
EdgeSelector_MapOrder
<
PFP
>
(
m_map
,
position
,
m_approximators
)
;
break
;
}
break
;
}
case
Algo
::
Surface
::
Decimation
::
S_Random
:
{
case
Algo
::
Surface
::
Decimation
::
S_Random
:
{
m_selector
=
new
Algo
::
Surface
::
Decimation
::
EdgeSelector_Random
<
PFP
>
(
m_map
,
positionsTable
,
m_approximators
)
;
m_selector
=
new
Algo
::
Surface
::
Decimation
::
EdgeSelector_Random
<
PFP
>
(
m_map
,
position
,
m_approximators
)
;
break
;
}
break
;
}
case
Algo
::
Surface
::
Decimation
::
S_EdgeLength
:
{
case
Algo
::
Surface
::
Decimation
::
S_EdgeLength
:
{
m_selector
=
new
Algo
::
Surface
::
Decimation
::
EdgeSelector_Length
<
PFP
>
(
m_map
,
positionsTable
,
m_approximators
)
;
m_selector
=
new
Algo
::
Surface
::
Decimation
::
EdgeSelector_Length
<
PFP
>
(
m_map
,
position
,
m_approximators
)
;
break
;
}
break
;
}
case
Algo
::
Surface
::
Decimation
::
S_QEM
:
{
case
Algo
::
Surface
::
Decimation
::
S_QEM
:
{
m_selector
=
new
Algo
::
Surface
::
Decimation
::
EdgeSelector_QEM
<
PFP
>
(
m_map
,
positionsTable
,
m_approximators
)
;
m_selector
=
new
Algo
::
Surface
::
Decimation
::
EdgeSelector_QEM
<
PFP
>
(
m_map
,
position
,
m_approximators
)
;
break
;
}
break
;
}