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
5876d497
Commit
5876d497
authored
Nov 30, 2012
by
Jund Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import svg avec building
parent
b80a842a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18805 additions
and
20 deletions
+18805
-20
src/env_map.cpp
src/env_map.cpp
+15
-0
src/viewer.cpp
src/viewer.cpp
+7
-20
svg/mapBuild.svg
svg/mapBuild.svg
+18783
-0
No files found.
src/env_map.cpp
View file @
5876d497
...
...
@@ -36,6 +36,8 @@ EnvMap::EnvMap() :
position
=
map
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
)
;
normal
=
map
.
addAttribute
<
VEC3
,
VERTEX
>
(
"normal"
)
;
positionScenary
=
mapScenary
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
)
;
#ifndef SPATIAL_HASHING
agentvect
=
map
.
addAttribute
<
PFP
::
AGENTVECT
,
FACE
>
(
"agents"
)
;
neighborAgentvect
=
map
.
addAttribute
<
PFP
::
AGENTVECT
,
FACE
>
(
"neighborAgents"
)
;
...
...
@@ -91,6 +93,19 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
// std::string filename = "./svg/simpleCross.svg" ;
Algo
::
Import
::
importSVG
<
PFP
>
(
map
,
filename
,
position
,
obstacleMark
,
buildingMark
)
;
std
::
cout
<<
"test"
<<
std
::
endl
;
mapScenary
.
addAttribute
<
float
,
FACE
>
(
"agents"
)
;
std
::
string
filename2
=
"./svg/mapBuild.svg"
;
Algo
::
Import
::
importSVG
<
PFP
>
(
mapScenary
,
filename2
,
positionScenary
,
obstacleMarkS
,
buildingMarkS
)
;
// TraversorF<PFP::MAP> tF(mapScenary);
// for(Dart d = tF.begin() ; d != tF.end() ; d = tF.next())
// {
// CityGenerator::generateBuilding(mapScenary,d,5,1);
// }
// Algo::BooleanOperator::mergeVertices<PFP>(map, position) ;
// map.closeMap() ;
// Algo::Modelisation::CatmullClarkSubdivision<PFP>(map, position) ;
...
...
src/viewer.cpp
View file @
5876d497
...
...
@@ -413,9 +413,9 @@ void SocialAgents::cb_redraw()
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_LINE
)
;
Algo
::
Render
::
GL1
::
renderTriQuadPoly
<
PFP
>
(
sim
.
envMap_
.
map
,
Algo
::
Render
::
GL1
::
LINE
,
1.0
,
sim
.
envMap_
.
position
,
sim
.
envMap_
.
normal
)
;
//
Algo::Render::GL1::renderTriQuadPoly<PFP>(sim.envMap_.mapScenary, Algo::Render::GL1::LINE,
//
1.0, sim.envMap_.positionScenary,
//
sim.envMap_.normalScenary) ;
Algo
::
Render
::
GL1
::
renderTriQuadPoly
<
PFP
>
(
sim
.
envMap_
.
mapScenary
,
Algo
::
Render
::
GL1
::
LINE
,
1.0
,
sim
.
envMap_
.
positionScenary
,
sim
.
envMap_
.
normalScenary
)
;
#endif
}
...
...
@@ -1075,19 +1075,6 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
VEC3
col
=
Utils
::
color_map_BCGYR
(
float
(
i
)
/
float
(
sim
.
agents_
.
size
()))
;
out
<<
"pigment { color <"
<<
col
[
0
]
<<
","
<<
col
[
1
]
<<
","
<<
col
[
2
]
<<
"> }"
<<
std
::
endl
;
// unsigned int col = (unsigned int)(float(i) / float(sim.agents_.size()) * 0xfffffe) ;
//
// std::cout << "i" << i << " truc " << xfloat(i) / float(sim.agents_.size())
// << std::endl ;
//
// std::cout << "col " << (col / 256 / 256) % 256 << "," << (col / 256) % 256 << ","
// << col % 256 << std::endl ;
//
// out << "pigment { color <" << (col > 16) / 256.0f << "," << ((col > 8) & 0xff) / 256.0f
// << "," << (col & 0xff) / 256.0f << "> }" << std::endl ;
// out << "pigment { color <" << (col / 256 / 256) % 256 << "," << (col / 256) % 256 << ","
// << col % 256 << "> }" << std::endl ;
}
else
{
...
...
@@ -1126,11 +1113,11 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
VEC3
base
(
0
,
-
1
,
0
)
;
VEC3
axisRot
=
base
^
dir
;
int
sign
=
axisRot
[
2
]
>
0
?
1
:
-
1
;
//
//
//57,2957795 : conversion from radian to degree
//57,2957795 : conversion from radian to degree
float
myRot
=
acos
(
-
dir
[
1
])
*
57.2957795
f
;
//
//
out
<<
"rotate <0,0,"
<<
-
90
+
sign
*
myRot
<<
">"
<<
std
::
endl
;
out
<<
"rotate <"
<<
angleX
-
90
<<
","
<<
angleY
<<
","
<<
angleZ
<<
"> "
<<
std
::
endl
;
// out << "translate <" << posR[0] << "," << posR[1] << "," << posR[2]+1+typeOfAgent*4*0.0638297872 << "> " << std::endl;
...
...
svg/mapBuild.svg
0 → 100644
View file @
5876d497
This diff is collapsed.
Click to expand 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