/home/tetron/hack/vos/libs/vos/metaobjects/a3dl/portal.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 _PORTAL_HH_
00024 #define _PORTAL_HH_
00025
00026 #ifndef A3DL_EXPORTS
00027 IMPORT_METAOBJECT_FACTORIES(A3DL_Portal)
00028 #endif
00029
00030 #include "a3dldefs.hh"
00031 #include <vos/vos/vos.hh>
00032 #include <vos/metaobjects/a3dl/texture.hh>
00033 #include <vos/metaobjects/a3dl/sector.hh>
00034
00035
00036 namespace A3DL
00037 {
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 class A3DL_API Portal : public VOS::MetaObject
00048 {
00049 public:
00050 Portal(VOS::VobjectBase* superobject);
00051 virtual ~Portal();
00052
00053 static VOS::MetaObject* new_Portal(VOS::VobjectBase* superobject, const std::string& type);
00054 virtual const std::string getVOSType();
00055
00056 virtual void setTargetSector(Sector* sector);
00057 virtual VUtil::vRef<Sector> getTargetSector();
00058
00059 virtual void setWarpingTransform(float m11, float m12, float m13,
00060 float m21, float m22, float m23,
00061 float m31, float m32, float m33,
00062 float tx, float ty, float tz);
00063
00064 virtual void getWarpingTransform(float& m11, float& m12, float& m13,
00065 float& m21, float& m22, float& m23,
00066 float& m31, float& m32, float& m33,
00067 float& tx, float& ty, float& tz);
00068
00069
00070 virtual VUtil::vRef<Material> getMaterial(bool createIfNone = true);
00071
00072
00073 virtual void setMaterialObj(Material* material);
00074 };
00075 }
00076
00077 namespace VUtil {
00078 template<> inline void iteratorReleaseItem(A3DL::Portal** v)
00079 {
00080 (*v)->release();
00081 }
00082 }
00083
00084 namespace A3DL {
00085 class PortalIterator : public VUtil::Iterator<Portal*>
00086 {
00087 public:
00088 PortalIterator() : VUtil::Iterator<Portal*>() { }
00089 PortalIterator(const PortalIterator& i) : VUtil::Iterator<Portal*>(i) { }
00090 PortalIterator(std::vector<Portal*>& vec) {
00091 items->resize(vec.size());
00092 int c = 0;
00093 for(std::vector<Portal*>::const_iterator i = vec.begin();
00094 i != vec.end();
00095 i++)
00096 {
00097 (*i)->acquire();
00098 (*items)[c] = (*i);
00099 c++;
00100 }
00101 }
00102 VUtil::vRef<Portal> operator*() {
00103 if(pos < items->size()) return VUtil::vRef<Portal>((*items)[pos], true);
00104 else return VUtil::vRef<Portal>();
00105 }
00106 };
00107 }
00108
00109 #endif