Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
SWE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaurav Kukreja
SWE
Commits
d6f0651c
Commit
d6f0651c
authored
Oct 19, 2012
by
Sebastian Rettenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Chile
parent
8a22a1bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
6 deletions
+64
-6
controller.cpp
src/opengl/controller.cpp
+58
-0
controller.h
src/opengl/controller.h
+1
-1
visualization.cpp
src/opengl/visualization.cpp
+5
-5
No files found.
src/opengl/controller.cpp
View file @
d6f0651c
...
...
@@ -290,6 +290,64 @@ bool Controller::handleKeyPress( SDL_keysym *keysym) {
visualization
->
updateBathymetryVBO
(
simulation
);
}
break
;
case
SDLK_6
:
// Load scenario 6
{
allowStep
=
paused
;
if
(
scenarios
[
5
]
==
0
)
{
//simulation area
float
simulationArea
[
4
];
simulationArea
[
0
]
=
-
13775000
;
simulationArea
[
1
]
=
1655000
;
simulationArea
[
2
]
=
-
2765000
;
simulationArea
[
3
]
=
8870000
;
scenarios
[
5
]
=
new
SWE_AsagiScenario
(
ASAGI_INPUT_DIR
"chile_gebco_usgs_500m_bath.nc"
,
ASAGI_INPUT_DIR
"chile_gebco_usgs_500m_displ.nc"
,
(
float
)
28800.
,
simulationArea
);
}
SWE_Scenario
*
newScene
=
scenarios
[
5
];
// define grid size and initial time step
float
dx
=
(
newScene
->
getBoundaryPos
(
BND_RIGHT
)
-
newScene
->
getBoundaryPos
(
BND_LEFT
)
)
/
SWE_Block
::
getNx
();
float
dy
=
(
newScene
->
getBoundaryPos
(
BND_TOP
)
-
newScene
->
getBoundaryPos
(
BND_BOTTOM
)
)
/
SWE_Block
::
getNy
();
SWE_Block
::
initGridData
(
SWE_Block
::
getNx
(),
SWE_Block
::
getNy
(),
dx
,
dy
);
simulation
->
loadNewScenario
(
newScene
,
NULL
);
visualization
->
updateBathymetryVBO
(
simulation
);
}
break
;
case
SDLK_7
:
// Load scenario 7
{
allowStep
=
paused
;
if
(
scenarios
[
6
]
==
0
)
{
//simulation area
float
simulationArea
[
4
];
simulationArea
[
0
]
=
-
2275000
;
simulationArea
[
1
]
=
1655000
;
simulationArea
[
2
]
=
-
2265000
;
simulationArea
[
3
]
=
1870000
;
scenarios
[
6
]
=
new
SWE_AsagiScenario
(
ASAGI_INPUT_DIR
"chile_gebco_usgs_500m_bath.nc"
,
ASAGI_INPUT_DIR
"chile_gebco_usgs_500m_displ.nc"
,
(
float
)
28800.
,
simulationArea
);
}
SWE_Scenario
*
newScene
=
scenarios
[
6
];
// define grid size and initial time step
float
dx
=
(
newScene
->
getBoundaryPos
(
BND_RIGHT
)
-
newScene
->
getBoundaryPos
(
BND_LEFT
)
)
/
SWE_Block
::
getNx
();
float
dy
=
(
newScene
->
getBoundaryPos
(
BND_TOP
)
-
newScene
->
getBoundaryPos
(
BND_BOTTOM
)
)
/
SWE_Block
::
getNy
();
SWE_Block
::
initGridData
(
SWE_Block
::
getNx
(),
SWE_Block
::
getNy
(),
dx
,
dy
);
simulation
->
loadNewScenario
(
newScene
,
NULL
);
visualization
->
updateBathymetryVBO
(
simulation
);
}
break
;
#endif // ASAGI
default
:
break
;
...
...
src/opengl/controller.h
View file @
d6f0651c
...
...
@@ -24,7 +24,7 @@
#include "visualization.h"
/** The number of different scenarios */
#define SCENARIO_COUNT
5
#define SCENARIO_COUNT
7
class
Controller
{
public
:
...
...
src/opengl/visualization.cpp
View file @
d6f0651c
...
...
@@ -111,16 +111,16 @@ void Visualization::renderDisplay() {
text
->
showText
(
"Keys:"
,
location
);
location
.
y
-=
location
.
h
;
#ifdef ASAGI
text
->
showText
(
"
Scenarios: 1-5
"
,
location
);
text
->
showText
(
"
1-7: Select scenario
"
,
location
);
#else // ASAGI
text
->
showText
(
"
Scenarios: 1-3
"
,
location
);
text
->
showText
(
"
1-3: Select scenario
"
,
location
);
#endif // ASAGI
location
.
y
-=
location
.
h
;
text
->
showText
(
"
Pause/Resume: Spac
e"
,
location
);
text
->
showText
(
"
Space: Pause/Resum
e"
,
location
);
location
.
y
-=
location
.
h
;
text
->
showText
(
"
Next frame (when paused): ->
"
,
location
);
text
->
showText
(
"
->: Next frame (when paused)
"
,
location
);
location
.
y
-=
location
.
h
;
text
->
showText
(
"
Reset scenario: r
"
,
location
);
text
->
showText
(
"
r: Restart scenario
"
,
location
);
location
.
y
-=
location
.
h
;
text
->
showText
(
"Mouse:"
,
location
);
location
.
y
-=
location
.
h
;
...
...
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