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
Hurstel
CGoGN
Commits
79d29457
Commit
79d29457
authored
Jul 05, 2011
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajout d'une methode cointains dans bouding box + modifs subdiv volume
parent
824c4141
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
72 deletions
+68
-72
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+37
-72
include/Geometry/bounding_box.h
include/Geometry/bounding_box.h
+6
-0
include/Geometry/bounding_box.hpp
include/Geometry/bounding_box.hpp
+24
-0
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+1
-0
No files found.
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
View file @
79d29457
...
...
@@ -85,9 +85,7 @@ void 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
::
subdivideEdge
<
PFP
>
(
map
,
it
,
position
)
;
// and compute the degree of the face
}
it
=
map
.
phi1
(
it
)
;
}
while
(
it
!=
old
)
;
p
/=
typename
PFP
::
REAL
(
degree
)
;
...
...
@@ -96,38 +94,38 @@ void subdivideFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
Dart
res
;
//
if(degree == 3 && sType == S_TRI) //subdiviser une face triangulaire
//
{
//
Dart dd = map.phi1(old) ;
//
Dart e = map.phi1(map.phi1(dd)) ;
//
map.splitFace(dd, e) ; // insert a new edge
//
unsigned int id = map.getNewEdgeId() ;
//
map.setEdgeId(map.phi_1(dd), id, EDGE) ; // set the edge id of the inserted edge to the next available id
//
//
unsigned int idface = map.getFaceId(old);
//
map.setFaceId(dd, idface, FACE) ;
//
map.setFaceId(e, idface, FACE) ;
//
//
dd = e ;
//
e = map.phi1(map.phi1(dd)) ;
//
map.splitFace(dd, e) ;
//
id = map.getNewEdgeId() ;
//
map.setEdgeId(map.phi_1(dd), id, EDGE) ;
//
//
map.setFaceId(dd, idface, FACE) ;
//
map.setFaceId(e, idface, FACE) ;
//
//
dd = e ;
//
e = map.phi1(map.phi1(dd)) ;
//
map.splitFace(dd, e) ;
//
id = map.getNewEdgeId() ;
//
map.setEdgeId(map.phi_1(dd), id, EDGE) ;
//
//
map.setFaceId(dd, idface, FACE) ;
//
map.setFaceId(e, idface, FACE) ;
//
}
//
else
//
{
if
(
degree
==
3
&&
sType
==
S_TRI
)
//subdiviser une face triangulaire
{
Dart
dd
=
map
.
phi1
(
old
)
;
Dart
e
=
map
.
phi1
(
map
.
phi1
(
dd
))
;
map
.
splitFace
(
dd
,
e
)
;
// insert a new edge
unsigned
int
id
=
map
.
getNewEdgeId
()
;
map
.
setEdgeId
(
map
.
phi_1
(
dd
),
id
,
EDGE
)
;
// set the edge id of the inserted edge to the next available id
unsigned
int
idface
=
map
.
getFaceId
(
old
);
map
.
setFaceId
(
dd
,
idface
,
FACE
)
;
map
.
setFaceId
(
e
,
idface
,
FACE
)
;
dd
=
e
;
e
=
map
.
phi1
(
map
.
phi1
(
dd
))
;
map
.
splitFace
(
dd
,
e
)
;
id
=
map
.
getNewEdgeId
()
;
map
.
setEdgeId
(
map
.
phi_1
(
dd
),
id
,
EDGE
)
;
map
.
setFaceId
(
dd
,
idface
,
FACE
)
;
map
.
setFaceId
(
e
,
idface
,
FACE
)
;
dd
=
e
;
e
=
map
.
phi1
(
map
.
phi1
(
dd
))
;
map
.
splitFace
(
dd
,
e
)
;
id
=
map
.
getNewEdgeId
()
;
map
.
setEdgeId
(
map
.
phi_1
(
dd
),
id
,
EDGE
)
;
map
.
setFaceId
(
dd
,
idface
,
FACE
)
;
map
.
setFaceId
(
e
,
idface
,
FACE
)
;
}
else
{
Dart
dd
=
map
.
phi1
(
old
)
;
map
.
splitFace
(
dd
,
map
.
phi1
(
map
.
phi1
(
dd
)))
;
...
...
@@ -164,7 +162,7 @@ void subdivideFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
dd
=
map
.
phi2
(
map
.
phi1
(
dd
));
}
while
(
dd
!=
ne
);
//
}
}
map
.
setCurrentLevel
(
cur
)
;
}
...
...
@@ -182,8 +180,6 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
map
.
setCurrentLevel
(
vLevel
);
std
::
cout
<<
"vLevel = "
<<
vLevel
<<
std
::
endl
;
/*
* au niveau du volume courant i
* stockage d'un brin de chaque face de celui-ci
...
...
@@ -191,7 +187,6 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
*/
DartMarkerStore
mf
(
map
);
// Lock a face marker to save one dart per face
//DartMarkerStore mv(map); // Lock a vertex marker to compute volume center
CellMarker
mv
(
map
,
VERTEX
);
typename
PFP
::
VEC3
volCenter
;
...
...
@@ -217,7 +212,6 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
//compute volume centroid
if
(
!
mv
.
isMarked
(
e
))
{
//mv.markOrbit(VERTEX, e);
mv
.
mark
(
e
);
volCenter
+=
position
[
e
];
++
count
;
...
...
@@ -246,7 +240,6 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
std
::
vector
<
std
::
pair
<
Dart
,
Dart
>
>
subdividedfaces
;
subdividedfaces
.
reserve
(
25
);
int
i
=
0
;
//First step : subdivide edges and faces
//creates a i+1 edge level and i+1 face level
for
(
std
::
vector
<
Dart
>::
iterator
face
=
visitedFaces
.
begin
();
face
!=
visitedFaces
.
end
();
++
face
)
...
...
@@ -255,24 +248,12 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
//if needed subdivide face
if
(
!
map
.
faceIsSubdivided
(
d
))
{
++
i
;
Algo
::
IHM
::
subdivideFace
<
PFP
>
(
map
,
d
,
position
);
}
std
::
cout
<<
"CHECK FACES "
<<
std
::
endl
;
map
.
check
();
//save a dart from the subdivided face
unsigned
int
cur
=
map
.
getCurrentLevel
()
;
map
.
setCurrentLevel
(
map
.
getMaxLevel
());
Dart
old
=
map
.
faceOldestDart
(
d
);
std
::
cout
<<
" Oldest dart Face = "
<<
old
<<
std
::
endl
;
unsigned
int
fLevel
=
map
.
faceLevel
(
old
);
//puisque dans tous les cas, la face est subdivisee
std
::
cout
<<
"FACE LEVEL = "
<<
fLevel
<<
std
::
endl
;
unsigned
int
fLevel
=
map
.
faceLevel
(
d
)
+
1
;
//puisque dans tous les cas, la face est subdivisee
map
.
setCurrentLevel
(
fLevel
)
;
...
...
@@ -288,8 +269,6 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
map
.
setCurrentLevel
(
cur
);
}
map
.
setCurrentLevel
(
vLevel
+
1
)
;
// go to the next level to perform volume subdivision
std
::
vector
<
Dart
>
newEdges
;
//save darts from inner edges
...
...
@@ -301,33 +280,21 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
Dart
e
=
*
edge
;
Dart
f1
=
map
.
phi1
(
*
edge
);
int
i
=
0
;
do
{
std
::
cout
<<
"corner #"
<<
i
<<
" degree = "
<<
map
.
faceDegree
(
e
)
<<
std
::
endl
;
if
(
map
.
phi2
(
map
.
phi1
(
map
.
phi1
(
e
)))
!=
map
.
phi1
(
map
.
phi1
(
e
)))
map
.
unsewFaces
(
map
.
phi1
(
map
.
phi1
(
e
)));
map
.
unsewFaces
(
map
.
phi1
(
map
.
phi1
(
e
)));
//TODO utile ?
if
(
map
.
phi2
(
map
.
phi1
(
e
))
!=
map
.
phi1
(
e
))
//
if(map.phi2(map.phi1(e)) != map.phi1(e))
map
.
unsewFaces
(
map
.
phi1
(
e
));
++
i
;
e
=
map
.
phi2
(
map
.
phi_1
(
e
));
}
while
(
e
!=
*
edge
);
map
.
closeHole
(
f1
);
std
::
cout
<<
"CHECK CLOSE HOLE "
<<
std
::
endl
;
map
.
check
();
std
::
cout
<<
"corner degree = "
<<
i
<<
std
::
endl
;
std
::
cout
<<
"face degree = "
<<
map
.
faceDegree
(
map
.
phi2
(
f1
))
<<
std
::
endl
;
// if(map.faceDegree(map.phi2(f1)) > 6)
// return Dart::nil();
Dart
old
=
map
.
phi2
(
map
.
phi1
(
e
));
Dart
dd
=
map
.
phi1
(
map
.
phi1
(
old
))
;
map
.
splitFace
(
old
,
dd
)
;
...
...
@@ -395,8 +362,6 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
map
.
setCurrentLevel
(
cur
)
;
std
::
cout
<<
std
::
endl
;
return
subdividedfaces
.
begin
()
->
first
;
}
...
...
include/Geometry/bounding_box.h
View file @
79d29457
...
...
@@ -86,6 +86,12 @@ class BoundingBox
// fusion with the given bounding box
void
fusion
(
const
BoundingBox
<
VEC
>&
bb
)
;
//return true if the vector belongs strictly to a bounding box
bool
contains
(
const
VEC
&
p
);
//return true if the bounding box belongs strictly to a bounding box
bool
contains
(
const
BoundingBox
<
VEC
>
&
bb
);
/**********************************************/
/* STREAM OPERATORS */
/**********************************************/
...
...
include/Geometry/bounding_box.hpp
View file @
79d29457
...
...
@@ -178,6 +178,30 @@ void BoundingBox<VEC>::fusion(const BoundingBox<VEC>& bb)
}
}
template
<
typename
VEC
>
bool
BoundingBox
<
VEC
>::
contains
(
const
VEC
&
p
)
{
for
(
unsigned
int
i
=
0
;
i
<
m_pMin
.
dimension
();
++
i
)
{
if
(
m_pMin
[
i
]
>
p
[
i
])
return
false
;
if
(
p
[
i
]
>
m_pMax
[
i
])
return
false
;
}
return
true
;
}
template
<
typename
VEC
>
bool
BoundingBox
<
VEC
>::
contains
(
const
BoundingBox
<
VEC
>&
bb
)
{
return
this
->
contains
(
bb
.
min
())
&&
this
->
contains
(
bb
.
max
());
}
//template <typename VEC>
//friend std::ostream& BoundingBox<VEC>::operator<<(std::ostream& out, const BoundingBox<VEC>& bb)
//{
...
...
src/Topology/map/map3.cpp
View file @
79d29457
...
...
@@ -1205,6 +1205,7 @@ bool Map3::check()
{
if
(
!
m
.
isMarked
(
d
))
// phi1 a au moins un antécédent ?
{
std
::
cout
<<
"dart = "
<<
d
<<
std
::
endl
;
CGoGNout
<<
"Check: dart with no phi1 predecessor"
<<
CGoGNendl
;
return
false
;
}
...
...
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