|
|
// vim:tabstop=4 #ifndef _glsurface_ #define _glsurface_ #include "vect.h" #include "mecanique.h" #include "CList.h" #include "couleur.h" #include "CString.h" #includeusing namespace std; extern bool bDrawNormals; class triangle; class rectangle; class glsurface; class zone; class glsolid; class planesurf; class point; /** A glsurface is an abstract object that can be really displayed on the screen * a surface can be either opened or closed. * The normal vector is directed outside. */ class glsurface { public: glsurface () : msName("noname"){}; glsurface (const CString &sName) : msName(sName) {}; virtual ~glsurface () ; /** * Translation of the glsurface along a vector */ virtual void Translate (const vect&)=0; /** * Create a clone of the surface */ virtual glsurface* Duplicate ()const=0; /** * Render the surface on the current window */ virtual void Render () const=0; //virtual float PlanSide (const planesurf*) const=0; /** * Check if a point is inside the volume define by the surface. * @param p The point to check * @return true if the point is inside the glsurface */ virtual bool IsInside (const point &p) const; /** * Collision detection with a path. * If any intersection occurs, pptInter is the point of * intersection and pSolid is the glsolid touched by the * path. * This method does not work if the path goes through the volume * defined by the surface. (The end point of the path must be * inside (IsInside) the glsurface. * Also, the start point of the path must be outside the glsurface. * @see glsolid * @param poStart The starting point of the path * @param vPath The length of the path. * @param pptInter modified, this is a return value * @param pSolid * @return the planesurf (eg. triangle) that the path goes through. */ virtual planesurf* Collision ( const point &poStart, const vect &vPath, point* pptInter, glsolid* &pSolid)=0; virtual void SetColor (const couleur &)=0; /** * Find the G point of the glsurface. * G Point is the mass center of the glsurface. */ virtual point GPoint () const=0; void SetName (const CString& sName) { msName=sName; }; const CString& GetName () const { return msName; }; private: CString msName; }; #endif
Generated by: saturn on FrancoisLinux on Sun Feb 3 20:01:44 2002, using kdoc 2.0a53. |