Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

shape.h

00001 /***************************************************************************
00002                           shape.h  -  description
00003                              -------------------
00004     begin                : Sat May 3 2003
00005     copyright            : (C) 2003 by Gabor Torok
00006     email                : cctorok@yahoo.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef SHAPE_H
00019 #define SHAPE_H
00020 
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023 #include <string.h>
00024 #include "constants.h"
00025 
00026 class Shape {
00027   
00028 private:
00029   Uint8 index;
00030   char *name;
00031   int descriptionGroup;  
00032   bool stencil;
00033 
00034 protected:
00035   int width, height, depth;
00036   
00037 public: 
00038         Shape(int width, int depth, int height, char *name, int descriptionGroup);
00039         Shape(Shape *shape);
00040         virtual ~Shape();
00041 
00045     virtual inline void intialize() { }
00046 
00050   inline int getWidth() { return width; }
00054   inline int getDepth() { return depth; }
00058   inline int getHeight() { return height; }
00059 
00060   inline char *getName() { return name; }
00061   inline int getDescriptionGroup() { return descriptionGroup; }
00062 
00063   virtual void draw() = 0;
00064   virtual void outline( const Color *color ) { outline( color->r, color->g, color->b ); };
00065   virtual void outline( float r, float g, float b ) {};
00066   virtual void setupToDraw() = 0;
00067   
00068   inline void setIndex(Uint8 index) { this->index = index; }
00069   
00070   inline Uint8 getIndex() { return index; }
00071 
00075   virtual bool drawFirst() = 0;
00076   // if true, the next two functions are called
00077   virtual bool drawLater() = 0;
00078   virtual void setupBlending() = 0;
00079   virtual void endBlending() = 0;
00080 
00081 
00082   inline void setStencil(bool b) { stencil = b; }
00083   inline bool isStencil() { return stencil; }
00084 
00085 
00086 };
00087 
00088 #endif

Generated on Thu Jun 16 21:50:43 2005 for scourge by  doxygen 1.4.0