Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

IGPoint.cpp

Go to the documentation of this file.
00001 /* $Id: IGPoint.cpp,v 1.1 2001/05/27 15:25:28 formella Exp $ */
00002 
00003 /*
00004  *  Copyright (C) 2001, Dr. Arno Formella
00005  *                      Universidade de Vigo
00006  *                      Departamento de Informatica
00007  *
00008  *  This program is free software; you can redistribute it and/or modify
00009  *  it under the terms of the GNU General Public License as published by
00010  *  the Free Software Foundation; either version 2 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  This program is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *  GNU General Public License
00017  *          http://www.gnu.ai.mit.edu/copyleft/gpl.html
00018  *  for more details.
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 

Generated at Wed May 30 11:16:28 2001 for Computer Graphics Course by doxygen1.1.5 written by Dimitri van Heesch, © 1997-2000