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
3b468c90
Commit
3b468c90
authored
Mar 17, 2014
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last commit before merge !
parent
995544b7
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
51 deletions
+40
-51
Apps/SandBox/testPlaneCutting.cpp
Apps/SandBox/testPlaneCutting.cpp
+8
-13
Apps/SandBox/testPlaneCutting.h
Apps/SandBox/testPlaneCutting.h
+4
-3
include/Algo/Geometry/distances.h
include/Algo/Geometry/distances.h
+4
-4
include/Algo/Geometry/distances.hpp
include/Algo/Geometry/distances.hpp
+4
-11
include/Algo/Modelisation/planeCutting.h
include/Algo/Modelisation/planeCutting.h
+4
-4
include/Algo/Modelisation/planeCutting.hpp
include/Algo/Modelisation/planeCutting.hpp
+2
-2
include/Algo/Topo/Map2/uniformOrientation.hpp
include/Algo/Topo/Map2/uniformOrientation.hpp
+1
-1
include/Topology/generic/mapCommon.h
include/Topology/generic/mapCommon.h
+1
-1
include/Topology/generic/mapMulti.h
include/Topology/generic/mapMulti.h
+7
-7
include/Topology/generic/mapMulti.hpp
include/Topology/generic/mapMulti.hpp
+5
-5
No files found.
Apps/SandBox/testPlaneCutting.cpp
View file @
3b468c90
...
...
@@ -85,7 +85,7 @@ void Viewer::cb_initGL()
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
)
;
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
()
;
m_topoRender
=
new
Algo
::
Render
::
GL2
::
TopoRender
()
;
m_topoRender
=
new
Algo
::
Render
::
GL2
::
TopoRender
Map
<
PFP
>
()
;
m_topoRender
->
setInitialDartsColor
(
0.25
f
,
0.25
f
,
0.25
f
)
;
...
...
@@ -211,7 +211,7 @@ void Viewer::cb_keyPress(int keycode)
Geom
::
Plane3D
<
PFP
::
REAL
>
plan
(
n
,
o
);
CellMarker
<
FACE
>
over
(
myMap
);
CellMarker
<
MAP
,
FACE
>
over
(
myMap
);
Algo
::
Surface
::
Modelisation
::
planeCut
<
PFP
>
(
myMap
,
position
,
plan
,
over
,
true
,
true
);
std
::
cout
<<
"PlaneCut Ok"
<<
std
::
endl
;
...
...
@@ -224,7 +224,6 @@ void Viewer::cb_keyPress(int keycode)
position
[
d
]
+=
n
;
}
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
POINTS
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
LINES
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
TRIANGLES
)
;
...
...
@@ -233,7 +232,7 @@ void Viewer::cb_keyPress(int keycode)
m_positionVBO
->
updateData
(
position
)
;
m_normalVBO
->
updateData
(
normal
)
;
m_topoRender
->
updateData
<
PFP
>
(
myMap
,
position
,
0.85
f
,
0.85
f
,
m_drawBoundaryTopo
)
;
m_topoRender
->
updateData
(
myMap
,
position
,
0.85
f
,
0.85
f
,
m_drawBoundaryTopo
)
;
updateGL
();
break
;
...
...
@@ -247,13 +246,13 @@ void Viewer::cb_keyPress(int keycode)
Geom
::
Plane3D
<
PFP
::
REAL
>
plan
(
n
,
o
);
CellMarker
<
FACE
>
over
(
myMap
);
CellMarker
<
MAP
,
FACE
>
over
(
myMap
);
Algo
::
Surface
::
Modelisation
::
planeCut2
<
PFP
>
(
myMap
,
position
,
plan
,
over
,
true
);
std
::
cout
<<
"PlaneCut Ok"
<<
std
::
endl
;
n
*=
bb
.
diagSize
()
/
20.0
f
;
TraversorV
<
PFP
::
MAP
>
trav
(
myMap
);
TraversorV
<
MAP
>
trav
(
myMap
);
for
(
Dart
d
=
trav
.
begin
();
d
!=
trav
.
end
();
d
=
trav
.
next
())
{
if
(
over
.
isMarked
(
d
))
...
...
@@ -269,7 +268,7 @@ void Viewer::cb_keyPress(int keycode)
m_positionVBO
->
updateData
(
position
)
;
m_normalVBO
->
updateData
(
normal
)
;
m_topoRender
->
updateData
<
PFP
>
(
myMap
,
position
,
0.85
f
,
0.85
f
,
m_drawBoundaryTopo
)
;
m_topoRender
->
updateData
(
myMap
,
position
,
0.85
f
,
0.85
f
,
m_drawBoundaryTopo
)
;
updateGL
();
break
;
...
...
@@ -296,10 +295,6 @@ void Viewer::cb_keyPress(int keycode)
break
;
}
default:
break
;
}
...
...
@@ -334,7 +329,7 @@ void Viewer::importMesh(std::string& filename)
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
LINES
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
TRIANGLES
)
;
m_topoRender
->
updateData
<
PFP
>
(
myMap
,
position
,
0.85
f
,
0.85
f
,
m_drawBoundaryTopo
)
;
m_topoRender
->
updateData
(
myMap
,
position
,
0.85
f
,
0.85
f
,
m_drawBoundaryTopo
)
;
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
normalBaseSize
=
bb
.
diagSize
()
/
100.0
f
;
...
...
@@ -366,7 +361,7 @@ void Viewer::exportMesh(std::string& filename, bool askExportMode)
if
(
askExportMode
)
Utils
::
QT
::
inputValues
(
Utils
::
QT
::
VarCombo
(
"binary mode;ascii mode"
,
ascii
,
"Save in"
))
;
std
::
vector
<
VertexAttribute
<
VEC3
>*>
attributes
;
std
::
vector
<
VertexAttribute
<
VEC3
,
MAP_IMPL
>*>
attributes
;
attributes
.
push_back
(
&
position
)
;
Algo
::
Surface
::
Export
::
exportPLYnew
<
PFP
>
(
myMap
,
attributes
,
filename
.
c_str
(),
!
ascii
)
;
}
...
...
Apps/SandBox/testPlaneCutting.h
View file @
3b468c90
...
...
@@ -63,6 +63,7 @@ struct PFP: public PFP_STANDARD
};
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
PFP
::
VEC3
VEC3
;
...
...
@@ -99,11 +100,11 @@ public:
bool
m_drawTopo
;
bool
m_drawBoundaryTopo
;
VertexAttribute
<
VEC3
>
position
;
VertexAttribute
<
VEC3
>
normal
;
VertexAttribute
<
VEC3
,
MAP_IMPL
>
position
;
VertexAttribute
<
VEC3
,
MAP_IMPL
>
normal
;
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
Algo
::
Render
::
GL2
::
TopoRender
*
m_topoRender
;
Algo
::
Render
::
GL2
::
TopoRender
Map
<
PFP
>
*
m_topoRender
;
Utils
::
VBO
*
m_positionVBO
;
Utils
::
VBO
*
m_normalVBO
;
...
...
include/Algo/Geometry/distances.h
View file @
3b468c90
...
...
@@ -42,7 +42,7 @@ namespace Geometry
* @return the squared distance to tha plane
*/
template
<
typename
PFP
>
typename
PFP
::
REAL
squaredDistancePoint2FacePlane
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VEC3
&
P
)
;
typename
PFP
::
REAL
squaredDistancePoint2FacePlane
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
VEC3
&
P
)
;
/**
* compute squared distance from point to face (assuming face is convex)
...
...
@@ -53,7 +53,7 @@ typename PFP::REAL squaredDistancePoint2FacePlane(typename PFP::MAP& map, Dart d
* @return the squared distance
*/
template
<
typename
PFP
>
typename
PFP
::
REAL
squaredDistancePoint2Face
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VEC3
&
P
)
;
typename
PFP
::
REAL
squaredDistancePoint2Face
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
VEC3
&
P
)
;
/**
...
...
@@ -64,10 +64,10 @@ typename PFP::REAL squaredDistancePoint2Face(typename PFP::MAP& map, Dart d, con
* @return the squared distance
*/
template
<
typename
PFP
>
typename
PFP
::
REAL
squaredDistancePoint2Edge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VEC3
&
P
)
;
typename
PFP
::
REAL
squaredDistancePoint2Edge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
VEC3
&
P
)
;
template
<
typename
PFP
>
bool
isPlanar
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
);
bool
isPlanar
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
);
}
// namespace Geometry
...
...
include/Algo/Geometry/distances.hpp
View file @
3b468c90
...
...
@@ -36,7 +36,7 @@ namespace Geometry
{
template
<
typename
PFP
>
bool
isPlanar
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
)
bool
isPlanar
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
)
{
if
(
map
.
phi
<
111
>
(
d
)
==
d
)
return
true
;
...
...
@@ -53,10 +53,8 @@ bool isPlanar(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP
}
}
template
<
typename
PFP
>
typename
PFP
::
REAL
squaredDistancePoint2FacePlane
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VEC3
&
P
)
typename
PFP
::
REAL
squaredDistancePoint2FacePlane
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
VEC3
&
P
)
{
const
typename
PFP
::
VEC3
&
A
=
position
[
d
];
d
=
map
.
phi1
(
d
);
...
...
@@ -66,9 +64,8 @@ typename PFP::REAL squaredDistancePoint2FacePlane(typename PFP::MAP& map, Dart d
return
Geom
::
squaredDistancePoint2TrianglePlane
(
P
,
A
,
B
,
C
);
}
template
<
typename
PFP
>
typename
PFP
::
REAL
squaredDistancePoint2Face
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VEC3
&
P
)
typename
PFP
::
REAL
squaredDistancePoint2Face
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
VEC3
&
P
)
{
typedef
typename
PFP
::
REAL
REAL
;
const
typename
PFP
::
VEC3
&
A
=
position
[
d
];
...
...
@@ -90,9 +87,8 @@ typename PFP::REAL squaredDistancePoint2Face(typename PFP::MAP& map, Dart d, con
return
dist2
;
}
template
<
typename
PFP
>
typename
PFP
::
REAL
squaredDistancePoint2Edge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VEC3
&
P
)
typename
PFP
::
REAL
squaredDistancePoint2Edge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
VEC3
&
P
)
{
const
typename
PFP
::
VEC3
&
A
=
position
[
d
];
typename
PFP
::
VEC3
&
AB
=
position
[
map
.
phi1
(
d
)]
-
A
;
...
...
@@ -100,11 +96,8 @@ typename PFP::REAL squaredDistancePoint2Edge(typename PFP::MAP& map, Dart d, con
return
Geom
::
squaredDistanceSeg2Point
(
A
,
AB
,
AB2
,
P
)
;
}
}
// namespace Geometry
}
// namespace Algo
}
// namespace CGoGN
include/Algo/Modelisation/planeCutting.h
View file @
3b468c90
...
...
@@ -60,9 +60,9 @@ void planeCut(
template
<
typename
PFP
>
void
planeCut2
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
Geom
::
Plane3D
<
typename
PFP
::
REAL
>&
plane
,
CellMarker
<
FACE
>&
cmf_over
,
CellMarker
<
typename
PFP
::
MAP
,
FACE
>&
cmf_over
,
bool
with_unsew
);
...
...
@@ -79,9 +79,9 @@ namespace Modelisation
template
<
typename
PFP
>
void
planeCut
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
Geom
::
Plane3D
<
typename
PFP
::
REAL
>&
plane
,
CellMarker
<
FACE
>&
cmv_over
,
CellMarker
<
typename
PFP
::
MAP
,
FACE
>&
cmv_over
,
bool
keepTetrahedra
=
false
,
bool
with_unsew
=
true
);
...
...
include/Algo/Modelisation/planeCutting.hpp
View file @
3b468c90
...
...
@@ -263,7 +263,7 @@ void planeCut2(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
Geom
::
Plane3D
<
typename
PFP
::
REAL
>&
plane
,
CellMarker
<
FACE
>&
cmf_over
,
CellMarker
<
typename
PFP
::
MAP
,
FACE
>&
cmf_over
,
bool
with_unsew
)
{
typedef
typename
PFP
::
MAP
MAP
;
...
...
@@ -407,7 +407,7 @@ void planeCut(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
Geom
::
Plane3D
<
typename
PFP
::
REAL
>&
plane
,
CellMarker
<
FACE
>&
cmf_over
,
CellMarker
<
typename
PFP
::
MAP
,
FACE
>&
cmf_over
,
bool
keepTetrahedra
=
false
,
bool
with_unsew
=
true
)
{
...
...
include/Algo/Topo/Map2/uniformOrientation.hpp
View file @
3b468c90
...
...
@@ -104,7 +104,7 @@ void uniformOrientationCC(MAP& map, Dart faceSeed)
propag_inv
.
reserve
(
1024
);
face2invert
.
reserve
(
1024
);
DartMarker
cmf
(
map
);
DartMarker
<
MAP
>
cmf
(
map
);
cmf
.
markOrbit
<
FACE
>
(
faceSeed
);
propag
.
push_back
(
faceSeed
);
...
...
include/Topology/generic/mapCommon.h
View file @
3b468c90
...
...
@@ -198,7 +198,7 @@ public:
* @return an AttributeHandler
*/
template
<
typename
T
,
unsigned
int
ORBIT
>
inline
AttributeHandler
<
T
,
ORBIT
,
MAP_IMPL
>
addAttribute
(
const
std
::
string
&
nameAttr
)
;
inline
AttributeHandler
<
T
,
ORBIT
,
MAP_IMPL
>
addAttribute
(
const
std
::
string
&
nameAttr
=
""
)
;
/**
* remove an attribute
...
...
include/Topology/generic/mapMulti.h
View file @
3b468c90
...
...
@@ -95,37 +95,37 @@ public:
/**
* get the number of darts inserted in the given leveldart
*/
unsigned
int
getNbInsertedDarts
(
unsigned
int
level
)
const
;
inline
unsigned
int
getNbInsertedDarts
(
unsigned
int
level
)
const
;
/**
* get the number of darts that define the map of the given leveldart
*/
unsigned
int
getNbDarts
(
unsigned
int
level
)
const
;
inline
unsigned
int
getNbDarts
(
unsigned
int
level
)
const
;
/**
* @return the number of darts in the map
*/
virtual
unsigned
int
getNbDarts
()
const
;
inline
virtual
unsigned
int
getNbDarts
()
const
;
inline
AttributeContainer
&
getDartContainer
();
/**
* get the insertion level of a dart
*/
unsigned
int
getDartLevel
(
Dart
d
)
const
;
inline
unsigned
int
getDartLevel
(
Dart
d
)
const
;
protected:
/**
*
*/
void
incDartLevel
(
Dart
d
)
const
;
inline
void
incDartLevel
(
Dart
d
)
const
;
/**
* duplicate a dart starting from current level
*/
void
duplicateDart
(
Dart
d
)
;
inline
void
duplicateDart
(
Dart
d
)
;
void
duplicateDartAtOneLevel
(
Dart
d
,
unsigned
int
level
)
;
inline
void
duplicateDartAtOneLevel
(
Dart
d
,
unsigned
int
level
)
;
/****************************************
* RELATIONS MANAGEMENT *
...
...
include/Topology/generic/mapMulti.hpp
View file @
3b468c90
...
...
@@ -151,6 +151,11 @@ inline unsigned int MapMulti::getDartLevel(Dart d) const
return
(
*
m_mrLevels
)[
d
.
index
]
;
}
inline
AttributeContainer
&
MapMulti
::
getDartContainer
()
{
return
m_mrattribs
;
}
inline
void
MapMulti
::
incDartLevel
(
Dart
d
)
const
{
++
((
*
m_mrLevels
)[
d
.
index
])
;
...
...
@@ -185,11 +190,6 @@ inline void MapMulti::duplicateDartAtOneLevel(Dart d, unsigned int level)
(
*
m_mrDarts
[
level
])[
d
.
index
]
=
copyDartLine
(
dartIndex
(
d
))
;
}
inline
AttributeContainer
&
MapMulti
::
getDartContainer
()
{
return
m_mrattribs
;
}
/****************************************
* RELATIONS MANAGEMENT *
****************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment