00001
00002
00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019
00020
00021 #include "IGPoint.h"
00022 #include <GL/glut.h>
00023
00024 IGPoint::IGPoint(
00025 ) {
00026 }
00027
00028 IGPoint::IGPoint(
00029 double x,
00030 double y,
00031 double z,
00032 double gray
00033 ) :
00034 d3_point(x,y,z),
00035 col(gray)
00036 {
00037 }
00038
00039 IGPoint::IGPoint(
00040 double x,
00041 double y,
00042 double z,
00043 double red,
00044 double green,
00045 double blue
00046 ) :
00047 d3_point(x,y,z),
00048 col(red,green,blue)
00049 {
00050 }
00051
00052 IGPoint::IGPoint(
00053 const IGPoint& P
00054 ) :
00055 d3_point(P),
00056 col(P.col)
00057 {
00058 }
00059
00060 IGPoint::~IGPoint(
00061 ) {
00062 }
00063
00064 IGPoint& IGPoint::operator=(
00065 const IGPoint& P
00066 ) {
00067 if(this!=&P) {
00068 d3_point::operator=(P);
00069 col=P.col;
00070 }
00071 return(*this);
00072 }
00073
00074 void IGPoint::Draw(
00075 ) const {
00076 col.SetColor();
00077 glVertex3d(xcoord(),ycoord(),zcoord());
00078 }
00079
00080 istream& operator>>(
00081 istream& in,
00082 IGPoint& P
00083 ) {
00084 in >> (d3_point&)P >> P.col;
00085 return(in);
00086 }
00087
00088 ostream& operator<<(
00089 ostream& out,
00090 const IGPoint& P
00091 ) {
00092 out << "Point: " << (d3_point)P << endl << P.col;
00093 return(out);
00094 }
00095