00001 #ifndef __VERTEX_H__
00002 #define __VERTEX_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <iostream>
00026
00027 class Vertex
00028 {
00029 public:
00030 Vertex();
00031 Vertex(float x, float y, float z);
00032 void set(float x, float y, float z);
00033
00034 Vertex &operator+=(const Vertex &v);
00035 Vertex &operator-=(const Vertex &v);
00036 Vertex &operator*=(float v);
00037 Vertex &operator/=(float v);
00038
00039 friend Vertex operator+(const Vertex &v1, const Vertex &v2);
00040 friend Vertex operator-(const Vertex &v1, const Vertex &v2);
00041 friend Vertex operator*(const Vertex &v, float f);
00042 friend Vertex operator/(const Vertex &v, float f);
00043
00044 float x,y,z;
00045 };
00046
00047 std::ostream &operator<<(std::ostream &os, const Vertex &v);
00048
00049 #endif