JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
RBVisualization.java
Go to the documentation of this file.
1 package jarmos.app.activity.rb;
2 
6 import rb.RBContainer;
7 import rb.RBSystem;
8 import android.app.Activity;
9 import android.os.Bundle;
10 import android.util.Log;
11 
21 public class RBVisualization extends Activity {
22 
23  private GLView glView;
24 
25  // private SensorManager myManager;
26  // private List<Sensor> sensors;
27  // private Sensor accSensor;
28 
29  @Override
30  protected void onCreate(Bundle savedInstanceState) {
31  super.onCreate(savedInstanceState);
32 
34 
35  Bundle extras = getIntent().getExtras();
36  SimulationResult simRes = null;
37  RBSystem s = rb.mRbSystem;
38  /*
39  * Standard case: Normal display.
40  */
41  if (extras.getBoolean("isSweep")) {
42  Log.d("RBVisualization", "Visualizing parameter sweep");
43  simRes = s.getSweepSimResults();
44  } else {
45  Log.d("RBVisualization", "Visualizing normal RB results");
46  simRes = s.getSimulationResults();
47  }
48 
50 
51  /*
52  * Assign the result to the VisualizationData
53  */
54  visData.useResult(simRes);
55 
56  /*
57  * Add colors to the data!
58  */
59  visData.computeVisualFeatures(RBActivity.cg);
60 
61  // // Set Sensor + Manager
62  // myManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
63  // sensors = myManager.getSensorList(Sensor.TYPE_ACCELEROMETER);
64  // if (sensors.size() > 0) {
65  // accSensor = sensors.get(0);
66  // }
67 
68  glView = new GLView(this, visData);
69  setContentView(glView);
70  }
71 
72  // private final SensorEventListener mySensorListener = new SensorEventListener() {
73  // public void onSensorChanged(SensorEvent event) {
74  // // send data
75  // glView.setSensorParam(event.values[0], event.values[1], event.values[2]);
76  // // update (commented out since not used)
77  // /*
78  // * oldX = event.values[0]; oldY = event.values[1]; oldZ =
79  // * event.values[2];
80  // */
81  // }
82  //
83  // public void onAccuracyChanged(Sensor sensor, int accuracy) {
84  // }
85  // };
86 
87  // @Override
88  // protected void onResume() {
89  // super.onResume();
90  // myManager.registerListener(mySensorListener, accSensor, SensorManager.SENSOR_DELAY_GAME);
91  // }
92  //
93  // @Override
94  // protected void onStop() {
95  // myManager.unregisterListener(mySensorListener);
96  // super.onStop();
97  // }
98 }
GeometryData getGeometry()
The model&#39;s geometry data.
Definition: ModelBase.java:69
This class provides the Online stage for the reduced basis method for elliptic steady state problems...
Definition: RBSystem.java:54
Represents the results of a simulation.
Main RB visualization activity.
Open GL view implementation for display of and interaction with reduced model visualizations.
Definition: GLView.java:24
static RBContainer rb
The RB Container with all the system and model data (from JRB)
Base class for RB models and systems.
static ColorGenerator cg
The color generator used to color the field values.
A container class for all model visual data.
void onCreate(Bundle savedInstanceState)