Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

LayerComponent.hpp

Go to the documentation of this file.
00001 /****************************************************************************\ 00002 * VRVis * 00003 * http://vrvis.sourceforge.net * 00004 * (C) 2004 by Alex Loeffler * 00005 * mailto:aloeffler@users.sourceforge.net * 00006 **************************************************************************** 00007 * License * 00008 * * 00009 * This library is free software; you can redistribute it and/or modify it * 00010 * under the terms of the GNU Library General Public License as published * 00011 * by the Free Software Foundation, version 2. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, but * 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Library General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Library General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00021 \****************************************************************************/ 00022 00023 #ifndef LAYER_COMP_HPP 00024 #define LAYER_COMP_HPP 00025 00026 #include <map> 00027 #include <vector> 00028 #include "ColorDataDefs.hpp" 00029 #include "Drawable.hpp" 00030 #include "Selectable.hpp" 00031 00032 #include "Common.hpp" 00033 00034 namespace vrvis 00035 { 00036 00037 class Layer; 00038 class RasterData; 00039 class Texture; 00040 00043 class LayerComponent : public Drawable, public Selectable 00044 { 00045 // ================================================================== PUBLIC 00046 00047 public: 00048 00049 // ----------------------------------------------- Constructor & Destructor. 00051 00054 LayerComponent(RasterData* pRasterData0, 00055 eColor color0, 00056 RasterData* pRasterData1 = 0, 00057 eColor color1 = NONE, 00058 RasterData* pRasterData2 = 0, 00059 eColor color2 = NONE); 00060 00062 ~LayerComponent(void); 00063 00065 // -------------------------------------------------------------- Accessors. 00067 00069 float getRelativeOriginX(void) const; 00071 float getRelativeOriginY(void) const; 00073 float getRelativeSizeX(void) const; 00075 float getRelativeSizeY(void) const; 00076 00078 double getLowerTexLimit(void) const; 00080 double getUpperTexLimit(void) const; 00081 00083 const std::vector<Texture*>& getTextures(void) const; 00084 00086 // --------------------------------------------------------- Transformation. 00088 00090 void moveTo(const float cRelativeOriginX, const float cRelativeOriginY); 00092 void resizeTo(const float cRelativeSizeX, const float cRelativeSizeY); 00093 00095 // -------------------------- Data Initialization (Inherited from Drawable). 00097 00099 virtual void init(void); 00100 00101 // -------------------- GL Context Initialization (Inherited from Drawable). 00102 00104 virtual void contextInit(void); 00105 00106 // ---------------------------- GL Context Update (Inherited from Drawable). 00107 00109 virtual void contextUpdate(void); 00110 00111 // ----------------------------------- GL Drawing (Inherited from Drawable). 00112 00114 virtual void draw(void); 00115 00117 // ================================================================= PRIVATE 00118 00119 private: 00120 00121 // ---------------------------------------------------------------- Friends. 00122 00124 friend class Layer; 00125 00126 // --------------------------------------------------------------- Typedefs. 00127 00129 typedef std::vector<Texture*> TextureVector; 00130 00131 // ---------------------------------------------------------- Texture Stuff. 00132 00134 void prepareTextures(void); 00135 00137 void drawTextures(void); 00138 00139 // ---------------------------------------------------------------- Members. 00140 00142 vrvis::ColorDataMap mColorDataMap; 00144 TextureVector mTextures; 00145 00146 float mRelativeOriginX; 00147 float mRelativeOriginY; 00148 float mRelativeSizeX; 00149 float mRelativeSizeY; 00150 00151 int mPixelsX; 00152 int mPixelsY; 00153 }; 00154 00155 } // End namespace. 00156 00157 #endif // LAYER_COMP_HPP 00158

Generated on Tue Sep 21 07:31:08 2004 for VRVis by doxygen 1.3.8