Source: src/rectangle.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
    vim:tabstop=4
                          tristrip.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	_rectangle_
#define	_rectangle_

#include	"planesurf.h"
#include	"point.h"
#include	"couleur.h"


class rectangle : public planesurf
{
public:
	rectangle();
	rectangle(const couleur&);
	rectangle(
		const point &a,
		const point &b,
		const point &c,
		const point &d,
		const couleur*	pcol=0)
		:
		ma(a),
		mb(b),
		mc(c),
		md(d)
		{	if (pcol)
				mpcol=pcol->Duplicate();
			else
				mpcol=0;
		};

	rectangle(const rectangle&);

	virtual ~rectangle(){	delete	mpcol;	};

	
	// from planesurf
	virtual const vect&	Normal		()	const;
	vect	AVect(const point &p) 		const;


	// from glsurface
	virtual void		Translate	(const vect &v);
	virtual void 		Render		()	const;
	virtual glsurface*	Duplicate	() const;
	virtual float		PlanSide	(const planesurf*) const;
	virtual	planesurf*	Collision	(	const point	&ptStart,
										const vect	&vPath,
										point*		pptInter,
										glsolid*	&pSolid);
	virtual void		SetColor	(const couleur&	col)
									{
										ma.SetColor(col);
										mb.SetColor(col);
										mc.SetColor(col);
										md.SetColor(col);
									};
	virtual	point		GPoint		() const;

	const point&	pa()	const	{	return	ma;	};
	const point&	pb()	const	{	return	mb;	};
	const point&	pc()	const	{	return	mc;	};
	const point&	pd()	const	{	return	md;	};

private:
	rectangle&	operator=(const rectangle&);
	
	point ma;
	point mb;
	point mc;
	point md;

	couleur	*mpcol;
	
};

#endif

Generated by: saturn on FrancoisLinux on Sun Feb 3 20:01:44 2002, using kdoc 2.0a53.