00001 /* $Id: snow.hh,v 1.6 2003/07/24 05:18:54 tetron Exp $ */ 00002 00003 00004 /* This file was generated by otd2cpp.pl, a script for VOS by Reed Hedges 00005 <reed@zerohour.net> and Peter Amstutz <tetron@interreality.org> 00006 00007 Copyright (C) 2002 Reed Hedges <reed@interreality.org> 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public 00011 License as published by the Free Software Foundation; either 00012 version 2 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 00023 */ 00024 00025 #ifndef _A3DL_SNOW_HH_ 00026 #define _A3DL_SNOW_HH_ 00027 00028 00029 #include <vos/corelibs/vos/vos.hh> 00030 #include <vos/metaobjects/property/property.hh> 00031 00032 #include <vos/3D/a3dl/object3d.hh> 00033 00034 #if defined(_WIN32) && defined(_MSC_VER) 00035 # ifdef A3DL_EXPORTS 00036 # define A3DL_API __declspec(dllexport) 00037 # else 00038 # define A3DL_API __declspec(dllimport) 00039 # endif 00040 #else 00041 # define A3DL_API 00042 #endif 00043 00044 /** MetaObject implementing Snow Object Type. 00045 00046 This object represents a region of snow-like precipitation. The scaling 00047 property represents the extents of the region (a box), and the orientation 00048 represents the direction from which the precipitation falls (i.e., "0 1 0 0" is 00049 normal, downward-falling snow.) The material property should contain an image 00050 used for each "snowflake." If it is not an image, then some default 00051 image will be used, possibly tinted with that color. 00052 00053 */ 00054 00055 namespace A3DL { 00056 00057 class A3DL_API Snow : public virtual Object3D { 00058 00059 protected: 00060 PropertyAccessControl* accessControl; 00061 00062 00063 public: 00064 00065 /** Constructor */ 00066 Snow(MetaObject* superobject); 00067 00068 /** Destructor */ 00069 virtual ~Snow(); 00070 00071 /** Return type string ("a3dl:object3D.MATERIALINFO.object3D.snow") */ 00072 virtual const string getType(); 00073 00074 /** Register Extenders */ 00075 static void registerExtenders(); 00076 00077 static MetaObject* new_Snow(MetaObject* s, const string& t); 00078 00079 /** Set default access control policy */ 00080 virtual void setPropertyAccessControl(PropertyAccessControl* ac); 00081 00082 /** Get default access control policy */ 00083 virtual PropertyAccessControl* getPropertyAccessControl(); 00084 00085 /** @name Access Subobjects */ 00086 //@{ 00087 00088 /** Get the value of a3dl:particle-density property (Number of "snowflakes" per square unit of space. 00089 */ 00090 virtual int getParticleDensity(); 00091 00092 /** Set a3dl:particle-density property. 00093 @param value The new value 00094 @param ac Property access control policy. If omitted, then &NoAccessControl::static_ will be used. 00095 */ 00096 virtual void setParticleDensity(int value, PropertyAccessControl* ac = NULL); 00097 00098 /** Get the a3dl:particle-density object. */ 00099 virtual Property* getParticleDensityObject(); 00100 00101 /** Set the a3dl:particle-density object. 00102 @param newobj The new subobject. */ 00103 virtual void setParticleDensityObject(Property* newobj); 00104 00105 /** Get the values in the a3dl:particle-size property 00106 @param x replaced with the width of each "snowflake" 00107 @param y replaced with the height of each "snowflake" 00108 */ 00109 virtual void getParticleSize(double& x, double& y); 00110 00111 /** Set a3dl:particle-size property. 00112 @param x The new width. 00113 @param y The new height. 00114 @param ac Property access control policy. If omitted, then &NoAccessControl::static_ will be used. 00115 */ 00116 virtual void setParticleSize(double x, double y, PropertyAccessControl* ac = NULL); 00117 00118 /** Get the a3dl:particle-size object. */ 00119 virtual Property* getParticleSizeObject(); 00120 00121 /** Set the a3dl:particle-size object. 00122 @param newobj The new subobject. */ 00123 virtual void setParticleSizeObject(Property* newobj); 00124 00125 /** Get the value of a3dl:falling-speed property. 00126 This is the general rate of falling of snow from direction given in orientation, 00127 units/sec. Actual speed vary to create more snowlike effect. 00128 */ 00129 virtual double getFallingSpeed(); 00130 00131 /** Set a3dl:falling-speed property. 00132 @param value The new value 00133 @param ac Property access control policy. If omitted, then &NoAccessControl::static_ will be used. 00134 */ 00135 virtual void setFallingSpeed(double value, PropertyAccessControl* ac = NULL); 00136 00137 /** Get the a3dl:falling-speed object. */ 00138 virtual Property* getFallingSpeedObject(); 00139 00140 /** Set the a3dl:falling-speed object. 00141 @param newobj The new subobject. */ 00142 virtual void setFallingSpeedObject(Property* newobj); 00143 00144 /** Get the value of a3dl:swirliness property. 00145 This value represents the probability that "snowflakes" will change 00146 direction as they fall. It will range from 0 to 1. 00147 */ 00148 virtual double getSwirliness(); 00149 00150 /** Set a3dl:swirliness property. 00151 @param value The new value. Should be between 0 and 1; values outside 00152 this range will be adjusted to either 0 or 1. 00153 @param ac Property access control policy. If omitted, then &NoAccessControl::static_ will be used. 00154 */ 00155 virtual void setSwirliness(double value, PropertyAccessControl* ac = NULL); 00156 00157 /** Get the a3dl:swirliness object. */ 00158 virtual Property* getSwirlinessObject(); 00159 00160 /** Set the a3dl:swirliness object. 00161 @param newobj The new subobject. */ 00162 virtual void setSwirlinessObject(Property* newobj); 00163 00164 //@} 00165 00166 00167 }; 00168 00169 } // namespace 00170 00171 #endif // #ifndef _A3DL_SNOW_HH_ 00172