/home/tetron/hack/vos/libs/vos/metaobjects/a3dl/model.hh
Go to the documentation of this file.00001 /* 00002 This file is part of the Virtual Object System of 00003 the Interreality project (http://interreality.org). 00004 00005 Copyright (C) 2001, 2002 Peter Amstutz 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 00021 Peter Amstutz <http://www.interreality.org> 00022 */ 00023 00024 #ifndef _MODEL_HH_ 00025 #define _MODEL_HH_ 00026 00027 #ifndef A3DL_EXPORTS 00028 IMPORT_METAOBJECT_FACTORIES(A3DL_Model) 00029 #endif 00030 00031 #include "a3dldefs.hh" 00032 #include <vos/metaobjects/a3dl/object3d.hh> 00033 00034 00035 namespace A3DL 00036 { 00037 /** @class Model model.hh vos/metabojects/a3dl/model.hh 00038 * @ingroup libmetaobject_a3dl 00039 * This object's geometry is defined by model data in a 00040 * format such as 3DS, VRML, POV, etc. contained in a subproperty named 00041 * "model". 00042 * @note: if you use Object3D::initialize() on a Model object, make sure 00043 * that you also call setModel() or setModelToFile() to complete the object. 00044 */ 00045 class A3DL_API Model : public virtual Object3D 00046 { 00047 public: 00048 Model(VOS::VobjectBase* superobject); 00049 virtual ~Model(); 00050 00051 /** Set the value of "model" property to m. 00052 * @param m Model data 00053 * @param datatype Data type identifier (MIME type or typechain). 00054 * Default is "?". */ 00055 virtual void setModel(const std::string& m, const std::string& datatype = "?"); 00056 00057 /** Make the "model" property use a file as storage, rather than memory. 00058 * @param filename Name of the file on disk. 00059 * @param datatype Data type identifier. (MIME type or typechain). Default is "?". 00060 * @see FileProperty 00061 * @throw FileAccessError if the file cannot be opened. 00062 */ 00063 virtual void setModelToFile(const std::string& filename, const std::string& datatype = "?"); 00064 00065 virtual const std::string getVOSType(); 00066 static void registerExtenders(); 00067 static VOS::MetaObject* new_Model(VOS::VobjectBase* superobject, const std::string& type); 00068 00069 virtual VUtil::vRef<VOS::Property> getModelObj(); 00070 virtual void setModelObj(VOS::Property* obj); 00071 }; 00072 } 00073 00074 #endif