diff native/OpenHaptics/XYPad/HapticSceneFactory.h @ 0:011caca7515a

first import
author Fiore Martin <f.martin@qmul.ac.uk>
date Fri, 13 Feb 2015 14:44:20 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/native/OpenHaptics/XYPad/HapticSceneFactory.h	Fri Feb 13 14:44:20 2015 +0000
@@ -0,0 +1,37 @@
+/*
+XYPad - a haptic xy-pad that uses the jHapticGUI library
+
+Copyright (C) 2015  Queen Mary University of London (http://depic.eecs.qmul.ac.uk/)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <memory>
+#include "HapticScene.h"
+#include "XYScene.h"
+
+namespace jhapticgui{
+
+	/**
+	* The factory function is invoked when the haptic scene is created.
+	* If nullptr is returned the haptic initialization fails.
+	*/
+	std::unique_ptr<HapticScene> makeHapticScene(void(*messageCallback) (const Message & m)){
+
+		/* create your scene here */
+		HapticScene *scene = new XYScene(messageCallback);
+		return std::unique_ptr<HapticScene>(scene);
+	}
+
+}
+