Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thomas Pitiot
CGoGN
Commits
c227798f
Commit
c227798f
authored
Feb 02, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SocialAgents -> suite simplif faces
parent
059b23c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
24 deletions
+17
-24
Apps/Examples/SocialAgents/src/simulator.cpp
Apps/Examples/SocialAgents/src/simulator.cpp
+1
-1
Apps/Examples/miniTest.cpp
Apps/Examples/miniTest.cpp
+0
-17
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
+14
-4
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
+2
-2
No files found.
Apps/Examples/SocialAgents/src/simulator.cpp
View file @
c227798f
...
...
@@ -20,7 +20,7 @@ Simulator::Simulator() : agents_(), defaultAgent_(0), globalTime_(0.0f), timeSte
// CGoGN::CityGenerator::generateToboggan<PFP>(envMap.map,envMap.position,envMap.closeMark,100,0.25,200,10);
// std::cout << "simplify" << std::endl;
envMap
.
simplify
();
//
envMap.simplify();
envMap
.
map
.
init
();
std
::
cout
<<
"setup scenario"
<<
std
::
endl
;
setupScenario
();
...
...
Apps/Examples/miniTest.cpp
View file @
c227798f
...
...
@@ -552,23 +552,6 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
break
;
}
case
'v'
:
{
srand
(
time
(
NULL
))
;
unsigned
int
nbDarts
=
myMap
.
getNbDarts
()
;
unsigned
int
r
=
rand
()
%
nbDarts
;
Dart
d
(
r
)
;
if
(
myMap
.
isDartValid
(
d
))
{
myMap
.
deleteVertex
(
d
)
;
updateVBOprimitives
(
Algo
::
Render
::
VBO
::
TRIANGLES
|
Algo
::
Render
::
VBO
::
LINES
|
Algo
::
Render
::
VBO
::
POINTS
)
;
updateVBOdata
(
Algo
::
Render
::
VBO
::
POSITIONS
|
Algo
::
Render
::
VBO
::
NORMALS
)
;
topo_render
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
)
;
}
glutPostRedisplay
()
;
break
;
}
case
'x'
:
{
Algo
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
"export.off"
)
;
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
View file @
c227798f
...
...
@@ -146,6 +146,15 @@ void coarsenEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
assert
(
map
.
getDartLevel
(
d
)
<=
map
.
getCurrentLevel
()
||
!
"Access to a dart introduced after current level"
)
;
assert
(
map
.
edgeCanBeCoarsened
(
d
)
||
!
"Trying to coarsen an edge that can not be coarsened"
)
;
unsigned
int
cur
=
map
.
getCurrentLevel
()
;
Dart
d2
=
map
.
phi2
(
d
)
;
map
.
setCurrentLevel
(
cur
+
1
)
;
map
.
unsewFaces
(
d
)
;
map
.
unsewFaces
(
d2
)
;
map
.
collapseEdge
(
map
.
phi1
(
d
))
;
map
.
collapseEdge
(
map
.
phi1
(
d2
))
;
map
.
sewFaces
(
d
,
d2
)
;
map
.
setCurrentLevel
(
cur
)
;
}
template
<
typename
PFP
>
...
...
@@ -155,13 +164,14 @@ void coarsenFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
assert
(
map
.
faceIsSubdividedOnce
(
d
)
||
!
"Trying to coarsen a non-subdivided face or a more than once subdivided face"
)
;
unsigned
int
cur
=
map
.
getCurrentLevel
()
;
map
.
setCurrentLevel
(
cur
+
1
)
;
map
.
deleteVertex
(
map
.
phi1
(
map
.
phi1
(
d
)))
;
map
.
setCurrentLevel
(
cur
)
;
Dart
fit
=
d
;
do
{
map
.
setCurrentLevel
(
cur
+
1
)
;
map
.
deleteVertex
(
map
.
phi1
(
map
.
phi1
(
fit
)))
;
map
.
setCurrentLevel
(
cur
)
;
if
(
map
.
edgeCanBeCoarsened
(
fit
))
coarsenEdge
<
PFP
>
(
map
,
fit
,
position
)
;
fit
=
map
.
phi1
(
fit
)
;
}
while
(
fit
!=
d
)
;
}
...
...
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
View file @
c227798f
...
...
@@ -200,8 +200,8 @@ bool ImplicitHierarchicalMap::faceIsSubdividedOnce(Dart d)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
unsigned
int
fLevel
=
faceLevel
(
d
)
;
if
(
fLevel
<
m_curLevel
)
return
false
;
if
(
fLevel
<
m_curLevel
)
// a face whose level in the current level map is lower than
return
false
;
// the current level can not be subdivided to higher levels
unsigned
int
degree
=
0
;
bool
subd
=
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