// Path: src/main/java/org/n52/geoar/tracking/camera/RealityCamera.java
// public class RealityCamera {
// 	private static final String CAMERA_HEIGHT_PREF = "cameraHeight";
// 
// 	public interface CameraUpdateListener {
// 		void onCameraUpdate();
// 	}
// 
// 	public static float height = 1.6f; // "usage height", distance between
// 										// ground and device
// 	public static float fovY = 42.5f;
// 	// Viewport of camera preview
// 	public static int cameraViewportWidth;
// 	public static int cameraViewportHeight;
// 	private static boolean hasViewportSize = false;
// 
// 	private static List<CameraUpdateListener> listeners = new ArrayList<CameraUpdateListener>();
// 	public static float aspect;
// 
// 	public static void addCameraUpdateListener(CameraUpdateListener listener) {
// 		listeners.add(listener);
// 	}
// 
// 	public static void removeCameraUpdateListener(CameraUpdateListener listener) {
// 		listeners.remove(listener);
// 	}
// 
// 	private static void onUpdate() {
// 		for (CameraUpdateListener listener : listeners) {
// 			listener.onCameraUpdate();
// 		}
// 	}
// 
// 	public static void setFovY(float fov) {
// 		boolean changed = RealityCamera.fovY != fov;
// 		RealityCamera.fovY = fov;
// 		if (changed)
// 			onUpdate();
// 	}
// 
// 	public static void setViewportSize(Size size) {
// 		setViewportSize(size.width, size.height);
// 	}
// 
// 	public static void setViewportSize(int width, int height) {
// 		boolean changed = cameraViewportHeight != height
// 				|| cameraViewportWidth != width;
// 		cameraViewportHeight = height;
// 		cameraViewportWidth = width;
// 		RealityCamera.aspect = width / (float) height;
// 		hasViewportSize = true;
// 		if (changed)
// 			onUpdate();
// 	}
// 
// 	public static boolean hasViewportSize() {
// 		return hasViewportSize;
// 	}
// 
// 	@Deprecated
// 	public static void setAspect(float aspect) {
// 		// RealityCamera.aspect = aspect;
// 	}
// 
// 	public static void changeHeight(float inc) {
// 		height += inc;
// 		onUpdate();
// 	}
// 
// 	public static void setHeight(float height) {
// 		RealityCamera.height = height;
// 		onUpdate();
// 	}
// 
// 	public static void saveState() {
// 		SharedPreferences preferences = GeoARApplication.applicationContext
// 				.getSharedPreferences(GeoARApplication.PREFERENCES_FILE,
// 						Context.MODE_PRIVATE);
// 		Editor editor = preferences.edit();
// 		editor.putFloat(CAMERA_HEIGHT_PREF, RealityCamera.height);
// 		editor.commit();
// 	}
// 
// 	public static void restoreState() {
// 		SharedPreferences prefs = GeoARApplication.applicationContext
// 				.getSharedPreferences(GeoARApplication.PREFERENCES_FILE,
// 						Context.MODE_PRIVATE);
// 		RealityCamera.setHeight(prefs.getFloat(CAMERA_HEIGHT_PREF, 1.6f));
// 	}
// }


import org.n52.geoar.tracking.camera.RealityCamera;
import android.opengl.Matrix;

/**
 * Copyright 2012 52°North Initiative for Geospatial Open Source Software GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.n52.geoar.ar.view.gl;



public class SurfaceTopology {
	
	protected abstract class TopologyFunction{
		abstract float getHeightValue(float x, float z);
	}
	
	private TopologyFunction topology;
	

// Path: src/main/java/org/n52/geoar/tracking/camera/RealityCamera.java
// public class RealityCamera {
// 	private static final String CAMERA_HEIGHT_PREF = "cameraHeight";
// 
// 	public interface CameraUpdateListener {
// 		void onCameraUpdate();
// 	}
// 
// 	public static float height = 1.6f; // "usage height", distance between
// 										// ground and device
// 	public static float fovY = 42.5f;
// 	// Viewport of camera preview
// 	public static int cameraViewportWidth;
// 	public static int cameraViewportHeight;
// 	private static boolean hasViewportSize = false;
// 
// 	private static List<CameraUpdateListener> listeners = new ArrayList<CameraUpdateListener>();
// 	public static float aspect;
// 
// 	public static void addCameraUpdateListener(CameraUpdateListener listener) {
// 		listeners.add(listener);
// 	}
// 
// 	public static void removeCameraUpdateListener(CameraUpdateListener listener) {
// 		listeners.remove(listener);
// 	}
// 
// 	private static void onUpdate() {
// 		for (CameraUpdateListener listener : listeners) {
// 			listener.onCameraUpdate();
// 		}
// 	}
// 
// 	public static void setFovY(float fov) {
// 		boolean changed = RealityCamera.fovY != fov;
// 		RealityCamera.fovY = fov;
// 		if (changed)
// 			onUpdate();
// 	}
// 
// 	public static void setViewportSize(Size size) {
// 		setViewportSize(size.width, size.height);
// 	}
// 
// 	public static void setViewportSize(int width, int height) {
// 		boolean changed = cameraViewportHeight != height
// 				|| cameraViewportWidth != width;
// 		cameraViewportHeight = height;
// 		cameraViewportWidth = width;
// 		RealityCamera.aspect = width / (float) height;
// 		hasViewportSize = true;
// 		if (changed)
// 			onUpdate();
// 	}
// 
// 	public static boolean hasViewportSize() {
// 		return hasViewportSize;
// 	}
// 
// 	@Deprecated
// 	public static void setAspect(float aspect) {
// 		// RealityCamera.aspect = aspect;
// 	}
// 
// 	public static void changeHeight(float inc) {
// 		height += inc;
// 		onUpdate();
// 	}
// 
// 	public static void setHeight(float height) {
// 		RealityCamera.height = height;
// 		onUpdate();
// 	}
// 
// 	public static void saveState() {
// 		SharedPreferences preferences = GeoARApplication.applicationContext
// 				.getSharedPreferences(GeoARApplication.PREFERENCES_FILE,
// 						Context.MODE_PRIVATE);
// 		Editor editor = preferences.edit();
// 		editor.putFloat(CAMERA_HEIGHT_PREF, RealityCamera.height);
// 		editor.commit();
// 	}
// 
// 	public static void restoreState() {
// 		SharedPreferences prefs = GeoARApplication.applicationContext
// 				.getSharedPreferences(GeoARApplication.PREFERENCES_FILE,
// 						Context.MODE_PRIVATE);
// 		RealityCamera.setHeight(prefs.getFloat(CAMERA_HEIGHT_PREF, 1.6f));
// 	}
// }


// Path: src/main/java/org/n52/geoar/ar/view/gl/SurfaceTopology.java
import org.n52.geoar.tracking.camera.RealityCamera;
import android.opengl.Matrix;

/**
 * Copyright 2012 52°North Initiative for Geospatial Open Source Software GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.n52.geoar.ar.view.gl;



public class SurfaceTopology {
	
	protected abstract class TopologyFunction{
		abstract float getHeightValue(float x, float z);
	}
	
	private TopologyFunction topology;
	

	private float cameraLandOffset = RealityCamera.height;
