view native/DawHaptics/DawHaptics/HapticObjects.h @ 0:3074a84ef81e

first import
author Fiore Martin <f.martin@qmul.ac.uk>
date Wed, 26 Aug 2015 16:16:53 +0100
parents
children
line wrap: on
line source
/*
Cross-Modal DAW Prototype - Prototype of a simple Cross-Modal Digital Audio Workstation.

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/>.
*/
#pragma once

#include <GL/glut.h>
#include <HL/hl.h>
#include <HLU/hlu.h>

class HPoint {
	HLuint hapticID;
	HDdouble x, y;
	GLuint displayList;
	int hashCode;

public:
	
	HPoint(HLuint hID) : hapticID(hID), x(0), y(0) { }
	HPoint(HLuint hID, HDdouble _x, HDdouble _y) : hapticID(hID), x(_x), y(_y) { }
	//Point(HLuint id, HDdouble _x, HDdouble _y) : hapticID(id), x(_x), y(_y) {}

	~HPoint(){
		hlDeleteShapes(hapticID, 1);
	}

	inline void setHashCode(int hash){
		hashCode = hash;
	}

	inline const int getHashCode() const{
		return hashCode;
	}

	inline void setCoord(HDdouble _x, HDdouble _y){
		x = _x; y = _y;
	}

	inline HDdouble getX() const {
		return x;
	}

	const HLuint getHapticID() const {
		return hapticID;
	}

	inline HDdouble getY() const {
		return y;
	}

};

struct HLine {

	HLine() : hapticID(hlGenShapes(1)) {}
	~HLine(){
		hlDeleteShapes(hapticID, 1);
	}

	HLuint getID() const {
		return hapticID;
	}

	inline void setHashCode(int hash){
		hashCode = hash;
	}

	inline const int getHashCode() const{
		return hashCode;
	}

	HDdouble X1;
	HDdouble Y1;
	HDdouble X2;
	HDdouble Y2;
	int hashCode;
private :
	HLuint hapticID;

};