JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
Visualization.java
Go to the documentation of this file.
1 // rbAPPmit: An Android front-end for the Certified Reduced Basis Method
2 // Copyright (C) 2010 David J. Knezevic and Phuong Huynh
3 //
4 // This file is part of rbAPPmit
5 //
6 // @ref rbappmit is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // @ref rbappmit is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with rbAPPmit. If not, see <http://www.gnu.org/licenses/>.
18 
19 package jarmos.app.activity.kermor;
20 
26 import kermor.ReducedModel;
27 import android.app.Activity;
28 import android.os.Bundle;
29 
38 public class Visualization extends Activity {
39 
40  private GLView glView;
41 
42  // private SensorManager myManager;
43  // private List<Sensor> sensors;
44  // private Sensor accSensor;
45 
46  @Override
47  protected void onCreate(Bundle savedInstanceState) {
48  super.onCreate(savedInstanceState);
49 
51  GeometryData geoData = rm.getGeometry();
52  VisualizationData vData = new VisualizationData(geoData);
53 
54  // Bundle extras = getIntent().getExtras();
55 
56  SimulationResult res = rm.getSimulationResult();
57  vData.useResult(res);
58 
59  /*
60  * Add colors to the data!
61  */
62  vData.computeVisualFeatures(new ColorGenerator());
63 
64  // // Set Sensor + Manager
65  // myManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
66  // sensors = myManager.getSensorList(Sensor.TYPE_ACCELEROMETER);
67  // if (sensors.size() > 0) {
68  // accSensor = sensors.get(0);
69  // }
70 
71  glView = new GLView(this, vData);
72  setContentView(glView);
73  }
74 
75  // private final SensorEventListener mySensorListener = new SensorEventListener() {
76  // public void onSensorChanged(SensorEvent event) {
77  // // send data
78  // glView.setSensorParam(event.values[0], event.values[1],
79  // event.values[2]);
80  // // update (commented out since not used)
81  // /*
82  // * oldX = event.values[0]; oldY = event.values[1]; oldZ =
83  // * event.values[2];
84  // */
85  // }
86  //
87  // public void onAccuracyChanged(Sensor sensor, int accuracy) {
88  // }
89  // };
90  //
91  // @Override
92  // protected void onResume() {
93  // super.onResume();
94  // myManager.registerListener(mySensorListener, accSensor,
95  // SensorManager.SENSOR_DELAY_GAME);
96  // }
97  //
98  // @Override
99  // protected void onStop() {
100  // myManager.unregisterListener(mySensorListener);
101  // super.onStop();
102  // }
103 
104 }
Class for visualization of JKerMor ReducedModel simulation results.
Represents the results of a simulation.
Open GL view implementation for display of and interaction with reduced model visualizations.
Definition: GLView.java:24
Main reduced model class.
A container class for all model visual data.
This is a container class for all geometry-related data of a reduced model.
The color generator is used to produce RGBA (RGB+Alpha) values from a given array of floats...
void onCreate(Bundle savedInstanceState)