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
c3bafddc
Commit
c3bafddc
authored
Feb 22, 2011
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
retour dans le namespace IHM
parent
9d11a4ad
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
50 deletions
+104
-50
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+1
-1
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+1
-1
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
+1
-1
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+100
-46
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
+1
-1
No files found.
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
c3bafddc
...
...
@@ -34,7 +34,7 @@ namespace CGoGN
namespace
Algo
{
namespace
IHM
3
namespace
IHM
{
template
<
typename
T
>
class
AttributeHandler_IHM
;
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
c3bafddc
...
...
@@ -28,7 +28,7 @@ namespace CGoGN
namespace
Algo
{
namespace
IHM
3
namespace
IHM
{
/***************************************************
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
View file @
c3bafddc
...
...
@@ -32,7 +32,7 @@ namespace CGoGN
namespace
Algo
{
namespace
IHM
3
namespace
IHM
{
template
<
typename
PFP
>
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
View file @
c3bafddc
...
...
@@ -31,7 +31,7 @@ namespace CGoGN
namespace
Algo
{
namespace
IHM
3
namespace
IHM
{
//OK
...
...
@@ -91,7 +91,7 @@ Dart subdivideFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
++
degree
;
p
+=
position
[
it
]
;
if
(
!
map
.
edgeIsSubdivided
(
it
))
// first cut the edges (if they are not already)
Algo
::
IHM
3
::
subdivideEdge
<
PFP
>
(
map
,
it
,
position
)
;
// and compute the degree of the face
Algo
::
IHM
::
subdivideEdge
<
PFP
>
(
map
,
it
,
position
)
;
// and compute the degree of the face
it
=
map
.
phi1
(
it
)
;
}
while
(
it
!=
old
)
;
p
/=
typename
PFP
::
REAL
(
degree
)
;
...
...
@@ -150,11 +150,8 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
unsigned
int
cur
=
map
.
getCurrentLevel
()
;
map
.
setCurrentLevel
(
vLevel
)
;
// go to the level of the face to subdivide its edges
// compute volume centroid
typename
PFP
::
VEC3
volCenter
;
// = Algo::Geometry::volumeCentroidGen<PFP, typename PFP::TVEC3, typename PFP::VEC3>(map, d, position);
std
::
cout
<<
"vLevel="
<<
vLevel
<<
std
::
endl
;
std
::
cout
<<
"vLevel
to subdivide volume
="
<<
vLevel
<<
std
::
endl
;
/*
* ou niveau du volume courant i
...
...
@@ -162,7 +159,6 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
*/
DartMarkerStore
mf
(
map
);
// Lock a face marker
DartMarkerStore
mv
(
map
);
// Lock a vertex marker
//Store faces that are traversed and start with the face of d
std
::
vector
<
Dart
>
visitedFaces
;
...
...
@@ -173,11 +169,6 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
std
::
vector
<
Dart
>
oldEdges
;
oldEdges
.
reserve
(
20
);
//Store the darts from quadrangulated faces
std
::
vector
<
Dart
>
quadfaces
;
quadfaces
.
reserve
(
100
);
mf
.
markOrbit
(
FACE_ORBIT
,
old
)
;
for
(
std
::
vector
<
Dart
>::
iterator
face
=
visitedFaces
.
begin
();
face
!=
visitedFaces
.
end
();
++
face
)
{
...
...
@@ -185,11 +176,9 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
do
// add all face neighbours to the table
{
//if(!mv.isMarked(e))
//{
oldEdges
.
push_back
(
e
);
// mv.markOrbit(VERTEX_ORBIT, e);
//}
oldEdges
.
push_back
(
e
);
Dart
ee
=
map
.
phi2
(
e
)
;
if
(
!
mf
.
isMarked
(
ee
))
// not already marked
{
...
...
@@ -200,12 +189,17 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
}
while
(
e
!=
*
face
)
;
}
/*
*
*/
// compute volume centroid
typename
PFP
::
VEC3
volCenter
=
Algo
::
Geometry
::
volumeCentroidGen
<
PFP
,
typename
PFP
::
TVEC3
,
typename
PFP
::
VEC3
>
(
map
,
d
,
position
);
DartMarker
me
(
map
)
;
//mark edge
unsigned
int
degree
=
0
;
DartMarker
mvolcent
(
map
);
//mark vertices vol centroid computing
//Store the darts from quadrangulated faces
std
::
vector
<
Dart
>
quadfaces
;
quadfaces
.
reserve
(
100
);
//First step : subdivide edges and faces
//creates a i+1 edge level and i+1 face level
...
...
@@ -213,32 +207,68 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
{
Dart
d
=
*
face
;
std
::
cout
<<
"subdiv de toutes les faces"
<<
std
::
endl
;
if
(
!
map
.
faceIsSubdivided
(
d
))
{
Dart
it
=
d
;
unsigned
int
fLevel
=
map
.
faceLevel
(
d
)
;
Dart
old
=
map
.
faceOldestDart
(
d
)
;
unsigned
int
cur
=
map
.
getCurrentLevel
()
;
map
.
setCurrentLevel
(
fLevel
)
;
// go to the level of the face to subdivide its edges
std
::
cout
<<
"fLevel="
<<
fLevel
<<
std
::
endl
;
unsigned
int
degree
=
0
;
typename
PFP
::
VEC3
p
;
Dart
it
=
old
;
do
{
if
(
!
mvolcent
.
isMarked
(
it
))
{
++
degree
;
volCenter
+=
position
[
it
]
;
mvolcent
.
markOrbit
(
VERTEX_ORBIT
,
it
);
}
++
degree
;
p
+=
position
[
it
]
;
if
(
!
map
.
edgeIsSubdivided
(
it
))
// first cut the edges (if they are not already)
Algo
::
IHM
::
subdivideEdge
<
PFP
>
(
map
,
it
,
position
)
;
// and compute the degree of the face
it
=
map
.
phi1
(
it
)
;
}
while
(
it
!=
d
)
;
}
while
(
it
!=
old
)
;
p
/=
typename
PFP
::
REAL
(
degree
)
;
map
.
setCurrentLevel
(
fLevel
+
1
)
;
// go to the next level to perform face subdivision
Dart
dd
=
map
.
phi1
(
old
)
;
map
.
splitFace
(
dd
,
map
.
phi1
(
map
.
phi1
(
dd
)))
;
unsigned
int
idface
=
map
.
getFaceId
(
d
);
map
.
setFaceId
(
map
.
phi1
(
map
.
phi1
(
dd
)),
idface
,
FACE_ORBIT
)
;
map
.
setFaceId
(
map
.
phi2
(
map
.
phi1
(
map
.
phi1
(
dd
))),
idface
,
FACE_ORBIT
)
;
std
::
cout
<<
"subdiv de toutes les faces"
<<
std
::
endl
;
if
(
!
map
.
faceIsSubdivided
(
d
))
{
Dart
ne
=
map
.
phi2
(
map
.
phi_1
(
dd
));
Dart
ne2
=
map
.
phi2
(
ne
);
Dart
cf
=
Algo
::
IHM3
::
subdivideFace
<
PFP
>
(
map
,
*
face
,
position
);
std
::
cout
<<
"face faite"
<<
std
::
endl
;
map
.
cutEdge
(
ne
)
;
unsigned
int
id
=
map
.
getNewEdgeId
()
;
map
.
setEdgeId
(
ne
,
id
,
EDGE_ORBIT
)
;
id
=
map
.
getNewEdgeId
()
;
map
.
setEdgeId
(
ne2
,
id
,
EDGE_ORBIT
)
;
Dart
res
=
map
.
phi2
(
ne
);
unsigned
int
fLevel
=
map
.
getDartLevel
(
cf
)
;
dd
=
map
.
phi1
(
map
.
phi1
(
map
.
phi1
(
map
.
phi1
(
ne
))))
;
while
(
dd
!=
ne
)
{
Dart
next
=
map
.
phi1
(
map
.
phi1
(
dd
))
;
map
.
splitFace
(
map
.
phi1
(
ne
),
dd
)
;
Dart
nne
=
map
.
phi2
(
map
.
phi_1
(
dd
))
;
id
=
map
.
getNewEdgeId
()
;
map
.
setEdgeId
(
nne
,
id
,
EDGE_ORBIT
)
;
map
.
setFaceId
(
nne
,
idface
,
FACE_ORBIT
)
;
dd
=
next
;
}
position
[
res
]
=
p
;
map
.
setCurrentLevel
(
fLevel
)
;
Dart
cf
=
res
;
Dart
e
=
cf
;
do
...
...
@@ -247,11 +277,44 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
quadfaces
.
push_back
(
map
.
phi2
(
e
));
e
=
map
.
phi2
(
map
.
phi_1
(
e
));
}
while
(
e
!=
cf
);
map
.
setCurrentLevel
(
cur
)
;
//Dart cf = Algo::IHM::subdivideFace<PFP>(map, *face, position);
std
::
cout
<<
"face faite"
<<
std
::
endl
;
// unsigned int fLevel = map.getDartLevel(cf) ;
//
// map.setCurrentLevel(fLevel) ;
//
// Dart e = cf;
// do
// {
// quadfaces.push_back(e);
// quadfaces.push_back(map.phi2(e));
// e = map.phi2(map.phi_1(e));
// }while (e != cf);
}
}
volCenter
/=
typename
PFP
::
REAL
(
degree
)
;
/*
*
*/
map
.
setCurrentLevel
(
vLevel
+
1
)
;
// go to the next level to perform volume subdivision
std
::
cout
<<
"vLevel+1="
<<
vLevel
+
1
<<
std
::
endl
;
...
...
@@ -261,14 +324,6 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
//Third pass : deconnect the corners
for
(
std
::
vector
<
Dart
>::
iterator
edge
=
oldEdges
.
begin
();
edge
!=
oldEdges
.
end
();
++
edge
)
{
// Dart e = *edge;
// do
// {
// map.unsewFaces(map.phi1(map.phi1(*edge)));
// map.unsewFaces(map.phi1(*edge));
// e = map.phi2(map.phi_1(e));
// }while (e != *edge);
map
.
unsewFaces
(
map
.
phi1
(
*
edge
));
moe
.
markOrbit
(
DART_ORBIT
,
map
.
phi1
(
*
edge
));
}
...
...
@@ -325,7 +380,6 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
moe
.
unmarkAll
();
for
(
std
::
vector
<
Dart
>::
iterator
nvol
=
quadfaces
.
begin
();
nvol
!=
quadfaces
.
end
();
nvol
=
nvol
+
2
)
{
if
(
map
.
phi3
(
map
.
phi2
(
*
nvol
))
==
map
.
phi2
(
*
nvol
)
&&
map
.
phi3
(
map
.
phi2
(
*
(
nvol
+
1
)))
==
map
.
phi2
(
*
(
nvol
+
1
)))
...
...
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
View file @
c3bafddc
...
...
@@ -31,7 +31,7 @@ namespace CGoGN
namespace
Algo
{
namespace
IHM
3
namespace
IHM
{
//OK
...
...
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