113 class vertex |
113 class vertex |
114 { public: |
114 { public: |
115 vertex() {} |
115 vertex() {} |
116 vertex (double x, double y, double z); |
116 vertex (double x, double y, double z); |
117 |
117 |
118 vertex midpoint (const vertex& other); |
118 double distanceTo (const vertex& other) const; |
119 void move (const vertex& other); |
119 vertex midpoint (const vertex& other); |
120 str stringRep (bool mangled) const; |
120 void move (const vertex& other); |
121 void transform (matrix matr, vertex pos); |
121 str stringRep (bool mangled) const; |
|
122 void transform (matrix matr, vertex pos); |
|
123 |
|
124 vertex& operator+= (const vertex& other); |
|
125 vertex operator+ (const vertex& other) const; |
|
126 vertex operator/ (const double d) const; |
|
127 vertex& operator/= (const double d); |
|
128 bool operator== (const vertex& other) const; |
|
129 bool operator!= (const vertex& other) const; |
|
130 vertex operator-() const; |
|
131 int operator< (const vertex& other) const; |
|
132 double& operator[] (const Axis ax); |
|
133 const double& operator[] (const Axis ax) const; |
|
134 double& operator[] (const int ax); |
|
135 const double& operator[] (const int ax) const; |
122 |
136 |
123 inline double& coord (int n) |
137 inline double& coord (int n) |
124 { return m_coords[n]; |
138 { return m_coords[n]; |
125 } |
139 } |
126 |
140 |
127 inline const double& coord (int n) const |
141 inline const double& coord (int n) const |
128 { return m_coords[n]; |
142 { return m_coords[n]; |
129 } |
143 } |
130 |
144 |
131 inline double& x () |
145 inline double& x() |
132 { return m_coords[X]; |
146 { return m_coords[X]; |
133 } |
147 } |
134 |
148 |
135 inline const double& x () const |
149 inline const double& x() const |
136 { return m_coords[X]; |
150 { return m_coords[X]; |
137 } |
151 } |
138 |
152 |
139 inline double& y () |
153 inline double& y() |
140 { return m_coords[Y]; |
154 { return m_coords[Y]; |
141 } |
155 } |
142 |
156 |
143 inline const double& y () const |
157 inline const double& y() const |
144 { return m_coords[Y]; |
158 { return m_coords[Y]; |
145 } |
159 } |
146 |
160 |
147 inline double& z () |
161 inline double& z() |
148 { return m_coords[Z]; |
162 { return m_coords[Z]; |
149 } |
163 } |
150 |
164 |
151 inline const double& z () const |
165 inline const double& z() const |
152 { return m_coords[Z]; |
166 { return m_coords[Z]; |
153 } |
167 } |
154 |
|
155 vertex& operator+= (const vertex& other); |
|
156 vertex operator+ (const vertex& other) const; |
|
157 vertex operator/ (const double d) const; |
|
158 vertex& operator/= (const double d); |
|
159 bool operator== (const vertex& other) const; |
|
160 bool operator!= (const vertex& other) const; |
|
161 vertex operator- () const; |
|
162 int operator< (const vertex& other) const; |
|
163 double& operator[] (const Axis ax); |
|
164 const double& operator[] (const Axis ax) const; |
|
165 double& operator[] (const int ax); |
|
166 const double& operator[] (const int ax) const; |
|
167 |
168 |
168 private: |
169 private: |
169 double m_coords[3]; |
170 double m_coords[3]; |
170 }; |
171 }; |
171 |
172 |