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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
36ea03db
Commit
36ea03db
authored
Jul 20, 2012
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug correction IHM3
parent
4f040f66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
139 additions
and
84 deletions
+139
-84
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+2
-2
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+26
-8
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
+111
-74
No files found.
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
36ea03db
...
...
@@ -360,12 +360,12 @@ public:
//!
/*!
*/
bool
neighborhoodLevel
DiffersBy
One
(
Dart
d
);
bool
neighborhoodLevel
Over
One
(
Dart
d
);
//! wired !!!
/*!
*/
bool
coarsenNeighborhoodLevel
DiffersBy
One
(
Dart
d
);
bool
coarsenNeighborhoodLevel
Over
One
(
Dart
d
);
//@}
/*! @name Cell Functors
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
View file @
36ea03db
...
...
@@ -81,6 +81,24 @@ void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
unsigned int cur = map.getCurrentLevel() ;
map.setCurrentLevel(fLevel) ; // go to the level of the face to subdivide its edges
unsigned int vLevel = map.volumeLevel(old);
//one level of subdivision in the neighbordhood
Traversor3VW<typename PFP::MAP> trav3EW(map, old);
for(Dart dit = trav3EW.begin() ; dit != trav3EW.end() ; dit = trav3EW.next())
{
Dart oldit = map.volumeOldestDart(dit);
if(((vLevel+1) - map.volumeLevel(oldit)) > 1)
Algo::IHM::subdivideVolumeClassic<PFP>(map, oldit, position);
// Dart oldNeighbor = map.volumeOldestDart(map.phi3(old));
// unsigned int vLevel = map.volumeLevel(oldNeighbor);
//
// std::cout << "vLevel courant = " << map.volumeLevel(old) << std::endl;
// std::cout << "vLevel voisin = " << vLevel << std::endl;
//
// if((map.volumeLevel(old)+1) - (vLevel) > 1)
// Algo::IHM::subdivideVolumeClassic<PFP>(map, oldNeighbor, position);
}
unsigned int degree = 0 ;
typename PFP::VEC3 p ;
...
...
@@ -188,14 +206,14 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
unsigned int cur = map.getCurrentLevel();
map.setCurrentLevel(vLevel);
// //one level of subdivision in the neighbordhood
// Traversor3VW<typename PFP::MAP> trav3EW(map, old);
// for(Dart dit = trav3EW.begin() ; dit != trav3EW.end() ; dit = trav3EW.next())
// {
// Dart oldit = map.volumeOldestDart(dit);
// if(((vLevel+1) - map.volumeLevel(oldit)) > 1)
// Algo::IHM::subdivideVolumeClassic<PFP>(map, oldit, position);
// }
// //one level of subdivision in the neighbordhood
// Traversor3VW<typename PFP::MAP> trav3EW(map, old);
// for(Dart dit = trav3EW.begin() ; dit != trav3EW.end() ; dit = trav3EW.next())
// {
// Dart oldit = map.volumeOldestDart(dit);
// if(((vLevel+1) - map.volumeLevel(oldit)) > 1)
// Algo::IHM::subdivideVolumeClassic<PFP>(map, oldit, position);
// }
/*
* au niveau du volume courant i
...
...
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
View file @
36ea03db
...
...
@@ -657,7 +657,10 @@ Dart ImplicitHierarchicalMap3::faceOldestDart(Dart d)
do
{
unsigned
int
l
=
m_dartLevel
[
it
]
;
if
(
l
<
l_old
||
(
l
==
l_old
&&
it
<
oldest
))
if
(
l
==
0
)
return
it
;
if
(
l
<
l_old
)
//if(l < l_old || (l == l_old && it < oldest))
{
oldest
=
it
;
l_old
=
l
;
...
...
@@ -672,38 +675,49 @@ Dart ImplicitHierarchicalMap3::volumeOldestDart(Dart d)
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
Dart
oldest
=
d
;
DartMarkerStore
mark
(
*
this
);
// Lock a marker
std
::
vector
<
Dart
>
visitedFaces
;
// Faces that are traversed
visitedFaces
.
reserve
(
512
);
visitedFaces
.
push_back
(
d
);
// Start with the face of d
// For every face added to the list
//the oldest dart from a volume is the oldest dart from all faces of this volume
mark
.
markOrbit
<
FACE
>
(
d
)
;
for
(
unsigned
int
i
=
0
;
i
<
visitedFaces
.
size
();
++
i
)
Traversor3WF
<
ImplicitHierarchicalMap3
>
trav3WF
(
*
this
,
d
);
for
(
Dart
dit
=
trav3WF
.
begin
()
;
dit
!=
trav3WF
.
end
()
;
dit
=
trav3WF
.
next
())
{
Dart
e
=
visitedFaces
[
i
]
;
//for every dart in this face
Dart
old
=
faceOldestDart
(
e
);
Dart
old
=
faceOldestDart
(
dit
);
if
(
m_dartLevel
[
old
]
<
m_dartLevel
[
oldest
])
oldest
=
old
;
do
// add all face neighbours to the table
{
Dart
ee
=
phi2
(
e
)
;
if
(
!
mark
.
isMarked
(
ee
))
// not already marked
{
visitedFaces
.
push_back
(
ee
)
;
mark
.
markOrbit
<
FACE
>
(
ee
)
;
}
e
=
phi1
(
e
)
;
}
while
(
e
!=
visitedFaces
[
i
])
;
}
return
oldest
;
// DartMarkerStore mark(*this); // Lock a marker
//
// std::vector<Dart> visitedFaces; // Faces that are traversed
// visitedFaces.reserve(512);
// visitedFaces.push_back(d); // Start with the face of d
//
// // For every face added to the list
// //the oldest dart from a volume is the oldest dart from all faces of this volume
// mark.markOrbit<FACE>(d) ;
//
// for(unsigned int i = 0; i < visitedFaces.size(); ++i)
// {
// Dart e = visitedFaces[i] ;
//
// //for every dart in this face
// Dart old = faceOldestDart(e);
// if(m_dartLevel[old] < m_dartLevel[oldest])
// oldest = old;
//
// do // add all face neighbours to the table
// {
// Dart ee = phi2(e) ;
// if(!mark.isMarked(ee)) // not already marked
// {
// visitedFaces.push_back(ee) ;
// mark.markOrbit<FACE>(ee) ;
// }
// e = phi1(e) ;
// } while(e != visitedFaces[i]) ;
// }
//
// return oldest;
}
bool
ImplicitHierarchicalMap3
::
edgeIsSubdivided
(
Dart
d
)
...
...
@@ -959,76 +973,99 @@ bool ImplicitHierarchicalMap3::volumeIsSubdividedOnce(Dart d)
return
subd
&&
subdOnce
;
}
bool
ImplicitHierarchicalMap3
::
neighborhoodLevel
DiffersBy
One
(
Dart
d
)
bool
ImplicitHierarchicalMap3
::
neighborhoodLevel
Over
One
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
bool
found
=
true
;
unsigned
int
vLevel
=
volumeLevel
(
d
);
// + 1;
bool
overOne
=
false
;
Dart
old
=
volumeOldestDart
(
d
);
Traversor3EW
<
ImplicitHierarchicalMap3
>
trav3EW
(
*
this
,
old
,
true
);
//Dart old = volumeOldestDart(d);
unsigned
int
vLevel
=
volumeLevel
(
d
);
for
(
Dart
dit
=
trav3EW
.
begin
()
;
dit
!=
trav3EW
.
end
()
;
dit
=
trav3EW
.
next
())
Traversor3WWaV
<
ImplicitHierarchicalMap3
>
trav3WWaV
(
*
this
,
d
);
for
(
Dart
dit
=
trav3WWaV
.
begin
()
;
dit
!=
trav3WWaV
.
end
()
;
dit
=
trav3WWaV
.
next
())
{
Dart
oldit
=
volumeOldestDart
(
dit
);
//if((abs(volumeLevel(old) - vLevel) > 1))
if
((
volumeLevel
(
oldit
)
-
vLevel
)
>
1
)
found
=
false
;
//Dart oldit = volumeOldestDart(dit);
if
(
abs
((
volumeLevel
(
dit
)
-
vLevel
))
>
1
)
overOne
=
true
;
}
return
found
;
return
overOne
;
// Traversor3EW<ImplicitHierarchicalMap3> trav3EW(*this, old);
// for(Dart dit = trav3EW.begin() ; dit != trav3EW.end() ; dit = trav3EW.next())
// {
// Dart oldit = volumeOldestDart(dit);
// if((volumeLevel(oldit) - vLevel) > 1)
// overOne = false;
// }
}
bool
ImplicitHierarchicalMap3
::
coarsenNeighborhoodLevel
DiffersBy
One
(
Dart
d
)
bool
ImplicitHierarchicalMap3
::
coarsenNeighborhoodLevel
Over
One
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
bool
found
=
false
;
//unsigned int vLevel = volumeLevel(d);
bool
overOne
=
false
;
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
)
;
if
(
m_curLevel
!=
0
)
--
m_curLevel
;
for
(
unsigned
int
i
=
0
;
!
found
&&
i
<
visitedFaces
.
size
();
++
i
)
{
Dart
e
=
visitedFaces
[
i
]
;
do
{
// add all face neighbours to the table
overOne
=
neighborhoodLevelOverOne
(
old
);
if
(
faceIsSubdivided
(
e
))
{
++
m_curLevel
;
if
(
m_curLevel
!=
0
)
++
m_curLevel
;
if
(
faceIsSubdividedOnce
(
e
))
found
=
true
;
return
overOne
;
--
m_curLevel
;
}
Dart
ee
=
phi2
(
e
)
;
if
(
!
mf
.
isMarked
(
ee
))
// not already marked
{
visitedFaces
.
push_back
(
ee
)
;
mf
.
markOrbit
<
FACE
>
(
ee
)
;
}
// Traversor3EW<ImplicitHierarchicalMap3> trav3EW(*this, old);
// for(Dart dit = trav3EW.begin() ; dit != trav3EW.end() ; dit = trav3EW.next())
// {
// if(!faceIsSubdividedOnce(dit))
// OverOne = true;
// }
e
=
phi1
(
e
)
;
}
while
(
e
!=
visitedFaces
[
i
])
;
}
//unsigned int vLevel = volumeLevel(d);
return
found
;
// 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(unsigned int i = 0; !found && i < visitedFaces.size(); ++i)
// {
// Dart e = visitedFaces[i] ;
// 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 != visitedFaces[i]) ;
// }
//
// return found;
}
}
//namespace IHM
...
...
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