f@0
|
1 /*
|
f@0
|
2 Cross-Modal DAW Prototype - Prototype of a simple Cross-Modal Digital Audio Workstation.
|
f@0
|
3
|
f@0
|
4 Copyright (C) 2015 Queen Mary University of London (http://depic.eecs.qmul.ac.uk/)
|
f@0
|
5
|
f@0
|
6 This program is free software: you can redistribute it and/or modify
|
f@0
|
7 it under the terms of the GNU General Public License as published by
|
f@0
|
8 the Free Software Foundation, either version 3 of the License, or
|
f@0
|
9 (at your option) any later version.
|
f@0
|
10
|
f@0
|
11 This program is distributed in the hope that it will be useful,
|
f@0
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
f@0
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
f@0
|
14 GNU General Public License for more details.
|
f@0
|
15
|
f@0
|
16 You should have received a copy of the GNU General Public License
|
f@0
|
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
|
f@0
|
18 */
|
f@0
|
19 #pragma once
|
f@0
|
20
|
f@0
|
21 #include <GL/glut.h>
|
f@0
|
22 #include <HL/hl.h>
|
f@0
|
23 #include <HLU/hlu.h>
|
f@0
|
24
|
f@0
|
25 class HPoint {
|
f@0
|
26 HLuint hapticID;
|
f@0
|
27 HDdouble x, y;
|
f@0
|
28 GLuint displayList;
|
f@0
|
29 int hashCode;
|
f@0
|
30
|
f@0
|
31 public:
|
f@0
|
32
|
f@0
|
33 HPoint(HLuint hID) : hapticID(hID), x(0), y(0) { }
|
f@0
|
34 HPoint(HLuint hID, HDdouble _x, HDdouble _y) : hapticID(hID), x(_x), y(_y) { }
|
f@0
|
35 //Point(HLuint id, HDdouble _x, HDdouble _y) : hapticID(id), x(_x), y(_y) {}
|
f@0
|
36
|
f@0
|
37 ~HPoint(){
|
f@0
|
38 hlDeleteShapes(hapticID, 1);
|
f@0
|
39 }
|
f@0
|
40
|
f@0
|
41 inline void setHashCode(int hash){
|
f@0
|
42 hashCode = hash;
|
f@0
|
43 }
|
f@0
|
44
|
f@0
|
45 inline const int getHashCode() const{
|
f@0
|
46 return hashCode;
|
f@0
|
47 }
|
f@0
|
48
|
f@0
|
49 inline void setCoord(HDdouble _x, HDdouble _y){
|
f@0
|
50 x = _x; y = _y;
|
f@0
|
51 }
|
f@0
|
52
|
f@0
|
53 inline HDdouble getX() const {
|
f@0
|
54 return x;
|
f@0
|
55 }
|
f@0
|
56
|
f@0
|
57 const HLuint getHapticID() const {
|
f@0
|
58 return hapticID;
|
f@0
|
59 }
|
f@0
|
60
|
f@0
|
61 inline HDdouble getY() const {
|
f@0
|
62 return y;
|
f@0
|
63 }
|
f@0
|
64
|
f@0
|
65 };
|
f@0
|
66
|
f@0
|
67 struct HLine {
|
f@0
|
68
|
f@0
|
69 HLine() : hapticID(hlGenShapes(1)) {}
|
f@0
|
70 ~HLine(){
|
f@0
|
71 hlDeleteShapes(hapticID, 1);
|
f@0
|
72 }
|
f@0
|
73
|
f@0
|
74 HLuint getID() const {
|
f@0
|
75 return hapticID;
|
f@0
|
76 }
|
f@0
|
77
|
f@0
|
78 inline void setHashCode(int hash){
|
f@0
|
79 hashCode = hash;
|
f@0
|
80 }
|
f@0
|
81
|
f@0
|
82 inline const int getHashCode() const{
|
f@0
|
83 return hashCode;
|
f@0
|
84 }
|
f@0
|
85
|
f@0
|
86 HDdouble X1;
|
f@0
|
87 HDdouble Y1;
|
f@0
|
88 HDdouble X2;
|
f@0
|
89 HDdouble Y2;
|
f@0
|
90 int hashCode;
|
f@0
|
91 private :
|
f@0
|
92 HLuint hapticID;
|
f@0
|
93
|
f@0
|
94 };
|