/home/tetron/hack/vos/libs/vos/metaobjects/a3dl/texture.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _TEXTURE_HH_
00024 #define _TEXTURE_HH_
00025
00026 #include "a3dldefs.hh"
00027 #include <vos/vos/vos.hh>
00028 #include <vos/metaobjects/a3dl/material.hh>
00029
00030 #ifndef A3DL_EXPORTS
00031 IMPORT_METAOBJECT_FACTORIES(A3DL_Texture)
00032 #endif
00033
00034
00035 namespace A3DL
00036 {
00037
00038
00039
00040
00041
00042
00043
00044 class A3DL_API Texture : public VOS::MetaObject
00045 {
00046 public:
00047 Texture(VOS::VobjectBase* superobject);
00048 virtual ~Texture();
00049
00050 static MetaObject* new_Texture(VOS::VobjectBase* superobject, const std::string& type);
00051 virtual const std::string getVOSType();
00052
00053 virtual VUtil::vRef<VOS::Property> getImage();
00054 virtual void setImage(VOS::Property* p);
00055
00056
00057
00058
00059
00060
00061 virtual void setImageToFile(const std::string& filename, const std::string& datatype);
00062
00063
00064 virtual void setImageData(const std::string& data, const std::string& datatype);
00065
00066
00067
00068
00069
00070 virtual void setBlendMode(Material::BlendMode mode);
00071
00072
00073
00074
00075
00076
00077
00078 virtual Material::BlendMode getBlendMode();
00079
00080
00081 virtual VUtil::vRef<VOS::Property> getBlendModeObj();
00082
00083
00084 virtual void setBlendModeObj(VOS::Property* p);
00085
00086
00087
00088
00089
00090
00091
00092
00093 virtual void setAlpha(double a);
00094
00095
00096
00097
00098 virtual double getAlpha();
00099
00100
00101 virtual VUtil::vRef<VOS::Property> getAlphaObj();
00102
00103
00104 virtual void setAlphaObj(VOS::Property* obj);
00105
00106
00107 virtual void setShaded(bool s);
00108
00109
00110
00111 virtual bool getShaded();
00112
00113
00114
00115
00116 virtual VUtil::vRef<VOS::Property> getShadedObj();
00117
00118
00119 virtual void setShadedObj(VOS::Property* obj);
00120
00121
00122 virtual void setTransparentKeycolor(float r, float g, float b);
00123
00124
00125
00126
00127
00128
00129 virtual void getTransparentKeycolor(float& r, float& g, float& b);
00130
00131 virtual void setUVScaleAndShift(float uscale, float vscale, float ushift, float vshift);
00132 virtual void getUVScaleAndShift(float& uscale, float& vscale, float& ushift, float& vshift);
00133 };
00134
00135 }
00136
00137 namespace VUtil {
00138 template<> inline void iteratorReleaseItem(A3DL::Texture** v)
00139 {
00140 (*v)->release();
00141 }
00142 }
00143
00144 namespace A3DL {
00145 class TextureIterator : public VUtil::Iterator<Texture*>
00146 {
00147 public:
00148 TextureIterator() : VUtil::Iterator<Texture*>() { }
00149 TextureIterator(const TextureIterator& i) : VUtil::Iterator<Texture*>(i) { }
00150 TextureIterator(std::vector<Texture*>& vec) {
00151 items->resize(vec.size());
00152 int c = 0;
00153 for(std::vector<Texture*>::const_iterator i = vec.begin();
00154 i != vec.end();
00155 i++)
00156 {
00157 (*i)->acquire();
00158 (*items)[c] = (*i);
00159 c++;
00160 }
00161 }
00162 VUtil::vRef<Texture> operator*() {
00163 if(pos < items->size()) return VUtil::vRef<Texture>((*items)[pos], true);
00164 else return VUtil::vRef<Texture>();
00165 }
00166 };
00167 }
00168
00169 #endif