1 /*************************************************************************** 2 virtualshape.h - Extends GLShape for virtual shapes 3 ------------------- 4 begin : Tue Jul 8 2008 5 copyright : (C) 2008 by Gabor Torok 6 email : cctorok@yahoo.com 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 18 #ifndef VIRTUALSHAPE_H_ 19 #define VIRTUALSHAPE_H_ 20 #pragma once 21 22 #include "glshape.h" 23 24 /** 25 *@author Gabor Torok 26 */ 27 28 /// Helper functions for virtual shapes. 29 30 class VirtualShape : public GLShape { 31 private: 32 int offsetX, offsetY, offsetZ; 33 bool draws; 34 GLShape *refShape; 35 36 public: 37 VirtualShape( char const* name, 38 int width, int height, int depth, 39 int offsetX, int offsetY, int offsetZ, 40 bool draws, GLShape *refShape, 41 int shapePalIndex ); 42 43 ~VirtualShape(); 44 45 void draw(); 46 void outline( float r, float g, float b ); isVirtual()47 virtual inline bool isVirtual() { 48 return true; 49 } getRef()50 inline GLShape *getRef() { 51 return refShape; 52 } isShownInMapEditor()53 virtual inline bool isShownInMapEditor() { 54 return false; 55 } getOffsetX()56 virtual inline int getOffsetX() { 57 return this->offsetX; 58 } getOffsetY()59 virtual inline int getOffsetY() { 60 return this->offsetY; 61 } getOffsetZ()62 virtual inline int getOffsetZ() { 63 return this->offsetZ; 64 } isDrawn()65 virtual inline bool isDrawn() { 66 return this->draws; 67 } 68 DECLARE_NOISY_OPENGL_SUPPORT(); 69 }; 70 71 #endif /*VIRTUALSHAPE_H_*/ 72