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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
d313283f
Commit
d313283f
authored
Sep 21, 2011
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajout de coarsenVolume pour les IHM3
parent
ac57f8fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
185 additions
and
141 deletions
+185
-141
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+5
-0
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+123
-127
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
+46
-3
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+11
-11
No files found.
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
d313283f
...
...
@@ -254,6 +254,11 @@ public:
*/
bool
edgeCanBeCoarsened
(
Dart
d
);
/**
*
*/
bool
faceCanBeCoarsened
(
Dart
d
);
/**
*
*/
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
View file @
d313283f
...
...
@@ -527,119 +527,119 @@ Dart subdivideVolumeGen(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& pos
std::cout << "2e etape finished" << std::endl;
//
{
//
//Third step : 3-sew internal faces
//
for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedfacesT.begin(); it != subdividedfacesT.end(); ++it)
//
{
//
Dart f1 = (*it).first;
//
Dart f2 = (*it).second;
//
//
//
//
if(map.phi3(map.phi2(f1)) == map.phi2(f1) && map.phi3(map.phi2(f2)) == map.phi2(f2))
//
{
//
if(map.getEmbedding(VERTEX, map.phi_1(map.phi2(f2))) == map.getEmbedding(VERTEX, map.phi_1(map.phi2(f1))))
//
{
//
map.Map3::sewVolumes(map.phi2(f2), map.phi2(f1));
//
}
//
else
//
{
//
//
//id pour toutes les faces interieures
//
map.sewVolumes(map.phi2(f2), map.phi2(f1));
//
//
//
}
//
//
//Fais a la couture !!!!!
//
unsigned int idface = map.getNewFaceId();
//
map.setFaceId(map.phi2(f1),idface, FACE);
//
}
//
//
//
//FAIS a la couture !!!!!!!
//
//id pour toutes les aretes exterieurs des faces quadrangulees
//
unsigned int idedge = map.getEdgeId(f1);
//
map.setEdgeId(map.phi2(f1), idedge, DART);
//
map.setEdgeId( map.phi2(f2), idedge, DART);
//
//
}
//
//
//LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!!
//
//id pour les aretes interieurs : (i.e. 16 pour un octa)
//
DartMarker mne(map);
//
for(std::vector<Dart>::iterator it = newEdges.begin() ; it != newEdges.end() ; ++it)
//
{
//
if(!mne.isMarked(*it))
//
{
//
unsigned int idedge = map.getNewEdgeId();
//
map.setEdgeId(*it, idedge, EDGE);
//
mne.markOrbit(EDGE,*it);
//
}
//
}
//
}
//
//
{
//
//Third step : 3-sew internal faces
//
for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedfacesQ.begin(); it != subdividedfacesQ.end(); ++it)
//
{
//
Dart f1 = (*it).first;
//
Dart f2 = (*it).second;
//
//
if(map.phi3(map.phi2(f1)) == map.phi2(f1) && map.phi3(map.phi2(f2)) == map.phi2(f2))
//
{
//
//id pour toutes les faces interieures
//
map.sewVolumes(map.phi2(f2), map.phi2(f1));
//
//
//Fais a la couture !!!!!
//
unsigned int idface = map.getNewFaceId();
//
map.setFaceId(map.phi2(f1),idface, FACE);
//
}
//
//
//FAIS a la couture !!!!!!!
//
//id pour toutes les aretes exterieurs des faces quadrangulees
//
unsigned int idedge = map.getEdgeId(f1);
//
map.setEdgeId(map.phi2(f1), idedge, DART);
//
map.setEdgeId( map.phi2(f2), idedge, DART);
//
}
//
//LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!!
//
//id pour les aretes interieurs : (i.e. 16 pour un octa)
//
DartMarker mne(map);
//
for(std::vector<Dart>::iterator it = newEdges.begin() ; it != newEdges.end() ; ++it)
//
{
//
if(!mne.isMarked(*it))
//
{
//
unsigned int idedge = map.getNewEdgeId();
//
map.setEdgeId(*it, idedge, EDGE);
//
mne.markOrbit(EDGE,*it);
//
}
//
}
//
}
//
//
//
//cas tordu pour le prisme
//
for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedfacesT.begin(); it != subdividedfacesT.end(); ++it)
//
{
//
Dart f1 = (*it).first;
//
Dart f2 = (*it).second;
//
//
if( !(map.Map2::faceDegree(f2) == 3 && map.Map2::faceDegree(map.phi2(f2)) == 3 &&
//
map.Map2::faceDegree(map.phi2(map.phi1(f2))) == 3 && map.Map2::faceDegree(map.phi2(map.phi_1(f2))) == 3))
//
{
//
//
//
if(map.phi2(map.phi1(map.phi1(map.phi2(f1)))) == map.phi3(map.phi2(map.phi1(map.phi1(map.phi2(f1))))) &&
//
map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi2(map.phi1(map.phi1(map.phi2(f1))))))))))) ==
//
map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi2(map.phi1(map.phi1(map.phi2(f1))))))))))))
//
)
//
{
//
map.sewVolumes(map.phi2(map.phi1(map.phi1(map.phi2(f1)))),
//
map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi1(map.phi1(map.phi2(f1))))))))));
//
}
//
//
}
//
//
}
{
//Third step : 3-sew internal faces
for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedfacesT.begin(); it != subdividedfacesT.end(); ++it)
{
Dart f1 = (*it).first;
Dart f2 = (*it).second;
if(map.phi3(map.phi2(f1)) == map.phi2(f1) && map.phi3(map.phi2(f2)) == map.phi2(f2))
{
if(map.getEmbedding(VERTEX, map.phi_1(map.phi2(f2))) == map.getEmbedding(VERTEX, map.phi_1(map.phi2(f1))))
{
map.Map3::sewVolumes(map.phi2(f2), map.phi2(f1));
}
else
{
//id pour toutes les faces interieures
map.sewVolumes(map.phi2(f2), map.phi2(f1));
}
//Fais a la couture !!!!!
unsigned int idface = map.getNewFaceId();
map.setFaceId(map.phi2(f1),idface, FACE);
}
//FAIS a la couture !!!!!!!
//id pour toutes les aretes exterieurs des faces quadrangulees
unsigned int idedge = map.getEdgeId(f1);
map.setEdgeId(map.phi2(f1), idedge, DART);
map.setEdgeId( map.phi2(f2), idedge, DART);
}
//LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!!
//id pour les aretes interieurs : (i.e. 16 pour un octa)
DartMarker mne(map);
for(std::vector<Dart>::iterator it = newEdges.begin() ; it != newEdges.end() ; ++it)
{
if(!mne.isMarked(*it))
{
unsigned int idedge = map.getNewEdgeId();
map.setEdgeId(*it, idedge, EDGE);
mne.markOrbit(EDGE,*it);
}
}
}
{
//Third step : 3-sew internal faces
for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedfacesQ.begin(); it != subdividedfacesQ.end(); ++it)
{
Dart f1 = (*it).first;
Dart f2 = (*it).second;
if(map.phi3(map.phi2(f1)) == map.phi2(f1) && map.phi3(map.phi2(f2)) == map.phi2(f2))
{
//id pour toutes les faces interieures
map.sewVolumes(map.phi2(f2), map.phi2(f1));
//Fais a la couture !!!!!
unsigned int idface = map.getNewFaceId();
map.setFaceId(map.phi2(f1),idface, FACE);
}
//FAIS a la couture !!!!!!!
//id pour toutes les aretes exterieurs des faces quadrangulees
unsigned int idedge = map.getEdgeId(f1);
map.setEdgeId(map.phi2(f1), idedge, DART);
map.setEdgeId( map.phi2(f2), idedge, DART);
}
//LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!!
//id pour les aretes interieurs : (i.e. 16 pour un octa)
DartMarker mne(map);
for(std::vector<Dart>::iterator it = newEdges.begin() ; it != newEdges.end() ; ++it)
{
if(!mne.isMarked(*it))
{
unsigned int idedge = map.getNewEdgeId();
map.setEdgeId(*it, idedge, EDGE);
mne.markOrbit(EDGE,*it);
}
}
}
//cas tordu pour le prisme
for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedfacesT.begin(); it != subdividedfacesT.end(); ++it)
{
Dart f1 = (*it).first;
Dart f2 = (*it).second;
if( !(map.Map2::faceDegree(f2) == 3 && map.Map2::faceDegree(map.phi2(f2)) == 3 &&
map.Map2::faceDegree(map.phi2(map.phi1(f2))) == 3 && map.Map2::faceDegree(map.phi2(map.phi_1(f2))) == 3))
{
if(map.phi2(map.phi1(map.phi1(map.phi2(f1)))) == map.phi3(map.phi2(map.phi1(map.phi1(map.phi2(f1))))) &&
map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi2(map.phi1(map.phi1(map.phi2(f1))))))))))) ==
map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi2(map.phi1(map.phi1(map.phi2(f1))))))))))))
)
{
map.sewVolumes(map.phi2(map.phi1(map.phi1(map.phi2(f1)))),
map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi1(map.phi1(map.phi2(f1))))))))));
}
}
}
map.setCurrentLevel(cur) ;
...
...
@@ -1457,11 +1457,13 @@ void coarsenFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
map.setCurrentLevel(cur) ;
}
// fit = d ;
// do
// {
// if(map.edgeCanBeCoarsened(fit))
// coarsenEdge<PFP>(map, fit, position) ;
//
// fit = map.phi1(fit) ;
// } while(fit != d) ;
}
...
...
@@ -1484,7 +1486,7 @@ void coarsenVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
//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(d);
mf.markOrbit(FACE, d) ;
...
...
@@ -1519,16 +1521,15 @@ void coarsenVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
*/
for(std::vector<Dart>::iterator face = visitedFaces.begin(); face != visitedFaces.end(); ++face)
{
Dart
d
= *face;
Dart
fit
= *face;
if(map.face
IsSubdividedOnce(d
))
if(map.face
CanBeCoarsened(fit
))
{
std::cout << "once : " << d << std::endl;
coarsenFace<PFP>(map, d, position);
Algo::IHM::coarsenFace<PFP>(map, fit, position);
}
}
map.setCurrentLevel(cur) ;
//
map.setCurrentLevel(cur) ;
/*
* simplifier les aretes
...
...
@@ -1539,18 +1540,13 @@ void coarsenVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
do
{
if(map.edgeCanBeCoarsened(fit))
{
std::cout << "edge coarsened = " << fit << std::endl;
}
//coarsenEdge<PFP>(map, fit, position) ;
std::cout << "boucle = " << fit << std::endl;
Algo::IHM::coarsenEdge<PFP>(map, fit, position) ;
fit = map.phi1(fit) ;
} while(fit != *face) ;
}
std::cout << "end" << std::endl;
map.setCurrentLevel(cur) ;
// map.setCurrentLevel(cur) ;
}
/***********************************************************************************
...
...
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
View file @
d313283f
...
...
@@ -382,6 +382,7 @@ bool ImplicitHierarchicalMap3::faceIsSubdivided(Dart d)
if
(
m_dartLevel
[
phi1
(
d
)]
==
m_curLevel
&&
m_edgeId
[
phi1
(
d
)]
!=
m_edgeId
[
d
])
subd
=
true
;
--
m_curLevel
;
return
subd
;
}
...
...
@@ -402,7 +403,7 @@ bool ImplicitHierarchicalMap3::volumeIsSubdivided(Dart d)
Dart
old
=
d
;
bool
facesAreSubdivided
=
fa
lse
;
bool
facesAreSubdivided
=
fa
ceIsSubdivided
(
d
)
;
//parcours les faces du volume au niveau courant
//on cherche le brin de niveau le plus bas de la hierarchie
...
...
@@ -418,7 +419,6 @@ bool ImplicitHierarchicalMap3::volumeIsSubdivided(Dart d)
facesAreSubdivided
&=
faceIsSubdivided
(
e
)
;
do
// add all face neighbours to the table
{
Dart
ee
=
phi2
(
e
)
;
...
...
@@ -441,7 +441,7 @@ bool ImplicitHierarchicalMap3::volumeIsSubdivided(Dart d)
}
bool
ImplicitHierarchicalMap3
::
edgeCanBeCoarsened
(
Dart
d
)
bool
ImplicitHierarchicalMap3
::
edgeCanBeCoarsened
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
...
...
@@ -466,6 +466,49 @@ bool ImplicitHierarchicalMap3::edgeCanBeCoarsened(Dart d)
return
subd
&&
degree2
&&
subdOnce
;
}
bool
ImplicitHierarchicalMap3
::
faceCanBeCoarsened
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
bool
subd
=
false
;
bool
subdOnce
=
true
;
bool
subdNeighborhood
=
false
;
//deux volumes voisins de la face ne sont pas subdivise
if
(
faceIsSubdivided
(
d
))
{
subd
=
true
;
Dart
d3
=
phi3
(
d
);
std
::
cout
<<
"d3 = "
<<
d3
<<
std
::
endl
;
std
::
cout
<<
"d = "
<<
d
<<
std
::
endl
;
std
::
cout
<<
"curLevel = "
<<
m_curLevel
<<
std
::
endl
;
std
::
cout
<<
"volSubd(d3) = "
<<
volumeIsSubdivided
(
d3
)
<<
std
::
endl
;
//tester si le volume voisin est subdivise
if
(
d3
!=
d
&&
volumeIsSubdivided
(
d3
))
subdNeighborhood
=
true
;
++
m_curLevel
;
//tester si la face subdivise a des faces subdivise
Dart
cf
=
phi1
(
d
);
do
{
if
(
faceIsSubdivided
(
cf
))
subdOnce
=
false
;
cf
=
phi2
(
phi1
(
cf
));
}
while
(
subdOnce
&&
cf
!=
phi1
(
d
));
--
m_curLevel
;
}
std
::
cout
<<
"subdNeighborhood = "
<<
subdNeighborhood
<<
std
::
endl
;
return
subd
&&
!
subdNeighborhood
&&
subdOnce
;
}
bool
ImplicitHierarchicalMap3
::
faceIsSubdividedOnce
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
...
...
src/Topology/map/map3.cpp
View file @
d313283f
...
...
@@ -635,15 +635,15 @@ unsigned int Map3::vertexDegree(Dart d)
int
count
=
0
;
DartMarkerStore
mv
(
*
this
);
// Lock a marker
std
::
list
<
Dart
>
darts_list
;
//Darts that are traversed
darts
_list
.
push_back
(
d
);
//Start with the dart d
std
::
list
<
Dart
>::
iterator
darts
;
std
::
vector
<
Dart
>
darts
;
//Darts that are traversed
darts
.
reserve
(
512
);
darts
.
push_back
(
d
);
//Start with the dart d
mv
.
mark
(
d
);
for
(
darts
=
darts_list
.
begin
();
darts
!=
darts_list
.
end
()
;
++
darts
)
for
(
std
::
vector
<
Dart
>::
iterator
it
=
darts
.
begin
();
it
!=
darts
.
end
()
;
++
it
)
{
Dart
dc
=
*
darts
;
Dart
dc
=
*
it
;
//add phi21 and phi23 successor if they are not marked yet
Dart
d2
=
phi2
(
dc
);
...
...
@@ -652,27 +652,27 @@ unsigned int Map3::vertexDegree(Dart d)
if
(
!
mv
.
isMarked
(
d21
))
{
darts
_list
.
push_back
(
d21
);
darts
.
push_back
(
d21
);
mv
.
mark
(
d21
);
}
if
((
d23
!=
d2
)
&&
!
mv
.
isMarked
(
d23
))
{
darts
_list
.
push_back
(
d23
);
darts
.
push_back
(
d23
);
mv
.
mark
(
d23
);
}
}
std
::
cout
<<
"#darts = "
<<
darts
_list
.
size
()
<<
std
::
endl
;
std
::
cout
<<
"#darts = "
<<
darts
.
size
()
<<
std
::
endl
;
DartMarkerStore
me
(
*
this
);
for
(
darts
=
darts_list
.
begin
();
darts
!=
darts_list
.
end
()
;
++
darts
)
for
(
std
::
vector
<
Dart
>::
iterator
it
=
darts
.
begin
();
it
!=
darts
.
end
()
;
++
it
)
{
if
(
!
me
.
isMarked
(
*
darts
))
if
(
!
me
.
isMarked
(
*
it
))
{
++
count
;
me
.
markOrbit
(
EDGE
,
*
darts
);
me
.
markOrbit
(
EDGE
,
*
it
);
}
}
...
...
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