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
S
SocialAgents3D
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
SocialAgents3D
Commits
9daeca4c
Commit
9daeca4c
authored
Feb 27, 2015
by
pitiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
8f6a48f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
13 deletions
+36
-13
include/env_map.h
include/env_map.h
+2
-1
src/env_map.cpp
src/env_map.cpp
+30
-7
src/needle.cpp
src/needle.cpp
+4
-5
No files found.
include/env_map.h
View file @
9daeca4c
...
...
@@ -2,7 +2,7 @@
#define ENV_MAP_H
//
#define DEBUG_affichage
#define DEBUG_affichage
//#define DEBUG
#include <iostream>
...
...
@@ -47,6 +47,7 @@ public:
void
init
(
int
argc
,
char
**
argv
)
;
bool
checkPointInMap
(
VEC3
pos
,
Dart
neighborhood
);
bool
insideVolume
(
VEC3
pos
,
Dart
d
);
REAL
volumeMaxdistance
(
Vol
volume
);
VEC3
normaleFromVolume
(
Dart
volume
,
Dart
face
);
void
open_file
(
std
::
string
filename
);
VEC3
mapMinX
;
...
...
src/env_map.cpp
View file @
9daeca4c
...
...
@@ -129,14 +129,28 @@ void EnvMap::init(int argc, char **argv)
// std::cout << "level :"<<map.getCurrentLevel() << std::endl ;
}
}
}
REAL
EnvMap
::
volumeMaxdistance
(
Vol
volume
)
{
Dart
d
=
volume
;
VEC3
center
=
Algo
::
Surface
::
Geometry
::
volumeCentroid
<
PFP
,
VertexAttribute
<
VEC3
,
MAP
>>
(
map
,
volume
,
position
);
REAL
res
=
(
position
[
d
]
-
center
).
norm2
();
for
(
Vertex
vert
:
verticesIncidentToVolume3
(
map
,
volume
))
{
REAL
size
=
(
position
[
vert
]
-
center
).
norm2
();
if
(
size
>
res
)
{
res
=
size
;
}
}
return
res
;
}
VEC3
EnvMap
::
normaleFromVolume
(
Dart
volume
,
Dart
face
)
// renvoie la normale a la face pointant vers l'extérieur du volume
{
VEC3
center
=
Algo
::
Surface
::
Geometry
::
volumeCentroid
<
PFP
,
VertexAttribute
<
VEC3
,
MAP
>>
(
map
,
volume
,
position
);
...
...
@@ -537,14 +551,19 @@ bool EnvMap::subdivideVolume(Dart dglobal)
map
.
setCurrentLevel
(
map
.
getMaxLevel
())
;
unsigned
int
vLevel
=
map
.
volumeLevel
(
dglobal
);
Dart
old
=
map
.
volumeOldestDart
(
dglobal
);
#ifdef DEBUG_affichage
int
count
=
0
;
#endif
// la subdivision ne doit pas mettre plus d'un level de différence entre des cellules adjacentes
// on commence donc par subdiviser les voisins qui ont trop de différence
// Traversor3WF<typename PFP::MAP> traF(map, old, true);
// for(Dart dit = traF.begin(); dit != traF.end(); dit = traF.next())
// {
for
(
Face
dit
:
facesIncidentToVolume3
(
map
,
old
))
{
#ifdef DEBUG_affichage
count
++
;
#endif
Dart
nv
=
map
.
phi3
(
dit
);
if
(
!
map
.
isBoundaryMarked
(
3
,
nv
))
{
...
...
@@ -553,18 +572,22 @@ bool EnvMap::subdivideVolume(Dart dglobal)
#ifdef DEBUG_affichage
std
::
cout
<<
"OK pour cascade en : "
<<
nv
<<
std
::
endl
;
#endif
int
currentLevel
=
map
.
getCurrentLevel
();
subdivideVolume
(
nv
);
map
.
setCurrentLevel
(
currentLevel
);
}
}
}
// on commence ensuite a subdiviser
// map.check();
map
.
setCurrentLevel
(
map
.
getMaxLevel
())
;
#ifdef DEBUG_affichage
CGoGNout
<<
"debut refine"
<<
CGoGNendl
;
std
::
cout
<<
"dglobal = "
<<
dglobal
<<
"level = "
<<
map
.
getDartLevel
(
dglobal
)
<<
std
::
endl
;
std
::
cout
<<
"dglobal = "
<<
dglobal
<<
"level = "
<<
map
.
getDartLevel
(
dglobal
)
<<
" nombre de faces verifiées : "
<<
count
<<
std
::
endl
;
#endif
ARETES
oldobst
(
RegisteredEdges
[
dglobal
])
;
...
...
src/needle.cpp
View file @
9daeca4c
...
...
@@ -41,7 +41,7 @@ Needle::Needle(Simulator* sim,std::pair<VEC3, Dart> startingPoint)
createEdge
(
0
);
#ifdef IHMap
refine
();
//
refine();
#endif
}
...
...
@@ -253,13 +253,12 @@ void Needle::refine()
{
#ifdef IHMap
Dart
volume
=
parts_
[
0
]
->
d
;
volume
=
sim_
->
envMap_
.
map
.
volumeOldestDart
(
volume
);
PFP
::
VEC3
edge
=
Algo
::
Surface
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
sim_
->
envMap_
.
map
,
volume
,
sim_
->
envMap_
.
position
)
;
if
(
edge
.
norm2
()
>
2.0
f
)
REAL
rayon
=
sim_
->
envMap_
.
volumeMaxdistance
(
volume
)
;
if
(
rayon
>
2.0
f
)
{
if
(
sim_
->
envMap_
.
subdivideVolume
(
volume
))
{
refine
();
//
refine();
}
}
...
...
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