/***************************************************************************
vim:tabstop=4
point.h - description
-------------------
begin : Sun Jul 1 2001
copyright : (C) 2001 by Francois Biot
email : fbiot@free.fr
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef _point_
#define _point_
#include "couleur.h"
#include "vect.h"
class planesurf;
#include
using namespace std;
class rectangle;
class glsurface;
class point
{
public:
point() :
mx(0.0),
my(0.0),
mz(0.0),
mpcol(0) {};
point(float x,float y,float z)
:
mx(x),
my(y),
mz(z),
mpcol(0) {};
point(float x,float y,float z,couleur col)
:
mx(x),
my(y),
mz(z),
mpcol(col.Duplicate()) {};
point(const point &p,couleur c)
:
mx(p.mx),
my(p.my),
mz(p.mz),
mpcol(c.Duplicate()) {};
point(const point &p)
:
mx(p.mx),
my(p.my),
mz(p.mz)
{ if (p.mpcol)
mpcol=p.mpcol->Duplicate();
else
mpcol=0; };
point& operator =(const point &);
virtual ~point(){ delete mpcol; };
void Render () const ;
void Translate (const vect &v);
virtual point* Duplicate () const;
float PlanSide (const planesurf*) const;
void SetColor (const couleur& col) { delete mpcol;
mpcol=col.Duplicate(); };
point& operator +=(const point&);
point& operator /=(const float);
point operator +(const vect&)const;
bool operator ==(const point&) const;
friend ostream& operator << (ostream&,const point &);
const couleur& getcol() const { return *mpcol;};
// TODO, to make private !
//
float mx;
float my;
float mz;
private:
couleur *mpcol;
};
#endif
| Generated by: saturn on FrancoisLinux on Sun Feb 3 20:01:44 2002, using kdoc 2.0a53. |