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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
4d495942
Commit
4d495942
authored
Sep 23, 2011
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajout de la fonction coarsenNeighborhoodLevelDiffersByOne ...
parent
fd210c16
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
137 additions
and
1082 deletions
+137
-1082
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+4
-0
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+3
-6
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
+11
-25
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+52
-1036
include/Topology/map/map3.h
include/Topology/map/map3.h
+1
-1
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
+57
-4
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+9
-10
No files found.
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
4d495942
...
...
@@ -274,6 +274,10 @@ public:
*/
bool
neighborhoodLevelDiffersByOne
(
Dart
d
);
/**
* wired !!!
*/
bool
coarsenNeighborhoodLevelDiffersByOne
(
Dart
d
);
}
;
template
<
typename
T
>
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
4d495942
...
...
@@ -244,7 +244,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType
bool
found
=
false
;
// Last functor return value
std
::
vector
<
Dart
>
darts_list
;
//Darts that are traversed
darts_list
.
reserve
(
5
0
);
darts_list
.
reserve
(
5
12
);
darts_list
.
push_back
(
d
);
//Start with the dart d
mv
.
mark
(
d
);
...
...
@@ -288,11 +288,8 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge(Dart d, FunctorType&
if
(
f
(
dNext
))
return
true
;
Dart
d2
=
phi2
(
dNext
);
if
(
d2
!=
dNext
)
return
f
(
d2
);
else
return
false
;
if
(
f
(
phi2
(
dNext
)))
return
true
;
dNext
=
alpha2
(
dNext
);
}
while
(
dNext
!=
d
);
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
View file @
4d495942
...
...
@@ -41,11 +41,15 @@ enum SubdivideType
S_QUAD
}
;
/***********************************************************************************
* Subdivision *
***********************************************************************************/
template
<
typename
PFP
>
void
subdivideEdge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
)
;
template
<
typename
PFP
>
void
subdivideFace
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
void
subdivideFace
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
,
SubdivideType
sType
=
S_TRI
);
template
<
typename
PFP
>
Dart
subdivideVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
...
...
@@ -54,16 +58,18 @@ template <typename PFP>
Dart
subdivideVolumeGen
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
template
<
typename
PFP
>
Dart
subdivideVolume
Old
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
Dart
subdivideVolume
Classic
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
//template <typename PFP>
//void subdivideLoop(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position);
/***********************************************************************************
* Simplification *
***********************************************************************************/
template
<
typename
PFP
>
void
coarsenEdge
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
template
<
typename
PFP
>
void
coarsenFace
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
void
coarsenFace
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
,
SubdivideType
sType
=
S_TRI
);
template
<
typename
PFP
>
void
coarsenVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
...
...
@@ -77,27 +83,7 @@ void coarsenVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
template
<
typename
PFP
>
void
splitVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
/*******************************************************
*
*/
template
<
typename
PFP
>
void
subdivideVolume
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
,
SubdivideType
sType
);
template
<
typename
PFP
>
Dart
subdivideFaceTri
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
template
<
typename
PFP
>
void
subdivideVolumeTri
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
template
<
typename
PFP
>
void
macCrackenJoy
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
template
<
typename
PFP
>
void
bajaj
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
template
<
typename
PFP
>
typename
PFP
::
VEC3
bajajMask
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
&
position
);
}
//namespace IHM
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
View file @
4d495942
This diff is collapsed.
Click to expand it.
include/Topology/map/map3.h
View file @
4d495942
...
...
@@ -222,7 +222,7 @@ public:
* @param d a dart in the first face
* @param e a dart in the second face
*/
virtual
void
mergeFaces
(
Dart
d
,
Dart
e
);
virtual
bool
mergeFaces
(
Dart
d
,
Dart
e
);
//!
/*!
...
...
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
View file @
4d495942
...
...
@@ -397,7 +397,7 @@ bool ImplicitHierarchicalMap3::volumeIsSubdivided(Dart d)
DartMarkerStore
mark
(
*
this
);
// Lock a marker
std
::
vector
<
Dart
>
visitedFaces
;
// Faces that are traversed
visitedFaces
.
reserve
(
16
);
visitedFaces
.
reserve
(
512
);
visitedFaces
.
push_back
(
d
);
// Start with the face of d
std
::
vector
<
Dart
>::
iterator
face
;
...
...
@@ -455,6 +455,8 @@ bool ImplicitHierarchicalMap3::edgeCanBeCoarsened(Dart d)
Dart
d2
=
phi2
(
d
)
;
++
m_curLevel
;
std
::
cout
<<
"vertex degree = "
<<
vertexDegree
(
phi1
(
d
))
<<
std
::
endl
;
if
(
vertexDegree
(
phi1
(
d
))
==
2
)
{
degree2
=
true
;
...
...
@@ -553,6 +555,7 @@ bool ImplicitHierarchicalMap3::faceIsSubdividedOnce(Dart d)
bool
ImplicitHierarchicalMap3
::
volumeIsSubdividedOnce
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
return
true
;
}
...
...
@@ -563,7 +566,7 @@ bool ImplicitHierarchicalMap3::neighborhoodLevelDiffersByOne(Dart d)
bool
found
=
false
;
unsigned
int
vLevel
=
volumeLevel
(
d
)
+
1
;
unsigned
int
vLevel
=
volumeLevel
(
d
)
;
//
+ 1;
Dart
old
=
volumeOldestDart
(
d
);
...
...
@@ -571,7 +574,7 @@ bool ImplicitHierarchicalMap3::neighborhoodLevelDiffersByOne(Dart d)
//Store faces that are traversed and start with the face of d
std
::
vector
<
Dart
>
visitedFaces
;
visitedFaces
.
reserve
(
20
);
visitedFaces
.
reserve
(
512
);
visitedFaces
.
push_back
(
old
);
mf
.
markOrbit
(
FACE
,
old
)
;
...
...
@@ -586,7 +589,8 @@ bool ImplicitHierarchicalMap3::neighborhoodLevelDiffersByOne(Dart d)
if
(
phi3
(
e
)
!=
e
)
{
Dart
old
=
volumeOldestDart
(
phi3
(
e
));
if
((
abs
(
volumeLevel
(
old
)
-
vLevel
)
>
1
))
//if((abs(volumeLevel(old) - vLevel) > 1))
if
(
volumeLevel
(
old
)
<
vLevel
)
found
=
true
;
}
...
...
@@ -604,6 +608,55 @@ bool ImplicitHierarchicalMap3::neighborhoodLevelDiffersByOne(Dart d)
return
found
;
}
bool
ImplicitHierarchicalMap3
::
coarsenNeighborhoodLevelDiffersByOne
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
bool
found
=
false
;
//unsigned int vLevel = volumeLevel(d);
Dart
old
=
volumeOldestDart
(
d
);
DartMarkerStore
mf
(
*
this
);
// Lock a face marker to save one dart per face
//Store faces that are traversed and start with the face of d
std
::
vector
<
Dart
>
visitedFaces
;
visitedFaces
.
reserve
(
512
);
visitedFaces
.
push_back
(
old
);
mf
.
markOrbit
(
FACE
,
old
)
;
for
(
std
::
vector
<
Dart
>::
iterator
face
=
visitedFaces
.
begin
();
!
found
&&
face
!=
visitedFaces
.
end
();
++
face
)
{
Dart
e
=
*
face
;
do
{
// add all face neighbours to the table
if
(
faceIsSubdivided
(
e
))
{
++
m_curLevel
;
if
(
faceIsSubdividedOnce
(
e
))
found
=
true
;
--
m_curLevel
;
}
Dart
ee
=
phi2
(
e
)
;
if
(
!
mf
.
isMarked
(
ee
))
// not already marked
{
visitedFaces
.
push_back
(
ee
)
;
mf
.
markOrbit
(
FACE
,
ee
)
;
}
e
=
phi1
(
e
)
;
}
while
(
e
!=
*
face
)
;
}
return
found
;
}
}
//namespace IHM
}
//namespace Algo
...
...
src/Topology/map/map3.cpp
View file @
4d495942
...
...
@@ -41,7 +41,7 @@ void Map3::deleteOrientedVolume(Dart d)
DartMarkerStore
mark
(
*
this
);
// Lock a marker
std
::
vector
<
Dart
>
visitedFaces
;
// Faces that are traversed
visitedFaces
.
reserve
(
16
);
visitedFaces
.
reserve
(
512
);
visitedFaces
.
push_back
(
d
);
// Start with the face of d
// // For every face added to the list
...
...
@@ -207,14 +207,15 @@ bool Map3::deleteVertex(Dart d)
{
DartMarkerStore
mv
(
*
this
);
// Lock a marker
std
::
list
<
Dart
>
darts_list
;
//Darts that are traversed
std
::
vector
<
Dart
>
darts_list
;
//Darts that are traversed
darts_list
.
reserve
(
512
);
darts_list
.
push_back
(
d
);
//Start with the dart d
std
::
list
<
Dart
>::
iterator
darts
;
std
::
vector
<
Dart
>::
iterator
darts
;
mv
.
mark
(
d
);
std
::
list
<
Dart
>
unique_darts_list
;
//unique_darts_list.reserve(30
);
std
::
vector
<
Dart
>
unique_darts_list
;
unique_darts_list
.
reserve
(
512
);
unique_darts_list
.
push_back
(
d
);
...
...
@@ -546,10 +547,11 @@ void Map3::collapseVolume(Dart d, bool delDegenerateFaces,
//contracter toutes les faces de la liste
}
//TODO
void
Map3
::
mergeFaces
(
Dart
d
,
Dart
e
)
bool
Map3
::
mergeFaces
(
Dart
d
,
Dart
e
)
{
}
Dart
Map3
::
cutSpike
(
Dart
d
)
...
...
@@ -663,8 +665,6 @@ unsigned int Map3::vertexDegree(Dart d)
}
}
std
::
cout
<<
"#darts = "
<<
darts
.
size
()
<<
std
::
endl
;
DartMarkerStore
me
(
*
this
);
for
(
std
::
vector
<
Dart
>::
iterator
it
=
darts
.
begin
();
it
!=
darts
.
end
()
;
++
it
)
...
...
@@ -810,7 +810,6 @@ bool Map3::foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread)
bool
Map3
::
foreach_dart_of_open_edge
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
{
DartMarkerStore
mv
(
*
this
,
thread
);
// Lock a marker
bool
found
=
false
;
// Last functor return value
...
...
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