<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Crystal Space 1.2.1: cstool/objmodel.h Source File (Crystal Space 1.2.1 Public API Reference)</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <table border="0" cellpadding="0" cellspacing="0" width="100%" class="head"> <tr height="59"> <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td> <td class="head"><h2>Public API Reference</h2></td> </tr> <tr height="11"> <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td> </tr> </table> <div class="content"> <!-- Generated by Doxygen 1.5.3 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> <h1>cstool/objmodel.h</h1><a href="cstool_2objmodel_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> Crystal Space 3D engine</span> <a name="l00003"></a>00003 <span class="comment"> Copyright (C) 2003 by Jorrit Tyberghein</span> <a name="l00004"></a>00004 <span class="comment"></span> <a name="l00005"></a>00005 <span class="comment"> This library is free software; you can redistribute it and/or</span> <a name="l00006"></a>00006 <span class="comment"> modify it under the terms of the GNU Library General Public</span> <a name="l00007"></a>00007 <span class="comment"> License as published by the Free Software Foundation; either</span> <a name="l00008"></a>00008 <span class="comment"> version 2 of the License, or (at your option) any later version.</span> <a name="l00009"></a>00009 <span class="comment"></span> <a name="l00010"></a>00010 <span class="comment"> This library is distributed in the hope that it will be useful,</span> <a name="l00011"></a>00011 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00012"></a>00012 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00013"></a>00013 <span class="comment"> Library General Public License for more details.</span> <a name="l00014"></a>00014 <span class="comment"></span> <a name="l00015"></a>00015 <span class="comment"> You should have received a copy of the GNU Library General Public</span> <a name="l00016"></a>00016 <span class="comment"> License along with this library; if not, write to the Free</span> <a name="l00017"></a>00017 <span class="comment"> Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00018"></a>00018 <span class="comment">*/</span> <a name="l00019"></a>00019 <a name="l00020"></a>00020 <span class="preprocessor">#ifndef __CS_CSTOOL_OBJMODEL_H__</span> <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define __CS_CSTOOL_OBJMODEL_H__</span> <a name="l00022"></a>00022 <span class="preprocessor"></span> <a name="l00031"></a>00031 <span class="preprocessor">#include "csextern.h"</span> <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="refarr_8h.html" title="Smart Pointer array.">csutil/refarr.h</a>"</span> <a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="scf__implementation_8h.html" title="Crystal Space Shared Class Facility (SCF) - implementation creation support.">csutil/scf_implementation.h</a>"</span> <a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="hash_8h.html" title="A generic hash table.">csutil/hash.h</a>"</span> <a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="iutil_2strset_8h.html" title="Stringset interface.">iutil/strset.h</a>"</span> <a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="iutil_2objreg_8h.html" title="Object registry interface.">iutil/objreg.h</a>"</span> <a name="l00038"></a>00038 <span class="preprocessor">#include "<a class="code" href="imesh_2objmodel_8h.html" title="Mesh object models.">imesh/objmodel.h</a>"</span> <a name="l00039"></a>00039 <span class="preprocessor">#include "<a class="code" href="igeom_2polymesh_8h.html" title="Polygon mesh interfaces.">igeom/polymesh.h</a>"</span> <a name="l00040"></a>00040 <span class="preprocessor">#include "<a class="code" href="igeom_2trimesh_8h.html" title="Triangle mesh interface.">igeom/trimesh.h</a>"</span> <a name="l00041"></a>00041 <a name="l00042"></a>00042 <span class="keyword">struct </span><a class="code" href="structiTerraFormer.html" title="TerraFormer objects are used to retrieve terrain data.">iTerraFormer</a>; <a name="l00043"></a>00043 <a name="l00044"></a>00044 <span class="comment">// for iPolygonMesh</span> <a name="l00045"></a>00045 <span class="preprocessor">#include "<a class="code" href="msvc__deprecated__warn__off_8h.html" title="Disable MSVC deprecated warnings.">csutil/win32/msvc_deprecated_warn_off.h</a>"</span> <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="keyword">class </span>csTMIterator; <a name="l00048"></a>00048 <a name="l00054"></a><a class="code" href="classcsObjectModel.html">00054</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsObjectModel.html" title="Helper class to make it easier to implement iObjectModel in mesh objects.">csObjectModel</a> : <a name="l00055"></a>00055 <span class="keyword">public</span> <a class="code" href="classscfImplementation1.html">scfImplementation1</a><csObjectModel,iObjectModel> <a name="l00056"></a>00056 { <a name="l00057"></a><a class="code" href="classcsObjectModel.html#2744a97ec09d26389bfddffd99015f12">00057</a> <span class="keyword">friend</span> <span class="keyword">class </span>csTMIterator; <a name="l00058"></a>00058 <a name="l00059"></a>00059 <span class="keyword">private</span>: <a name="l00060"></a>00060 <span class="keywordtype">long</span> shapenr; <a name="l00061"></a>00061 <a class="code" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>* polymesh_base; <a name="l00062"></a>00062 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iPolygonMesh></a> polymesh_colldet; <a name="l00063"></a>00063 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iPolygonMesh></a> polymesh_viscull; <a name="l00064"></a>00064 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iPolygonMesh></a> polymesh_shadows; <a name="l00065"></a>00065 <a class="code" href="classcsRefArray.html" title="An array of smart pointers.">csRefArray<iObjectModelListener></a> listeners; <a name="l00066"></a>00066 <a name="l00067"></a>00067 <a class="code" href="classcsHash.html" title="A generic hash table class, which grows dynamically and whose buckets are unsorted...">csHash<csRef<iTriangleMesh></a>,<a class="code" href="group__util.html#gbe4f44c93bfeee85c507a999dccf21dd" title="An identifier for a string.">csStringID</a>> trimesh; <a name="l00068"></a>00068 <a name="l00069"></a>00069 <span class="keyword">public</span>: <a name="l00074"></a><a class="code" href="classcsObjectModel.html#32f58fa7a7031a53effc20e3fb5c0d66">00074</a> <a class="code" href="classcsObjectModel.html" title="Helper class to make it easier to implement iObjectModel in mesh objects.">csObjectModel</a> (<a class="code" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one...">iBase</a>* parent = 0) <a name="l00075"></a>00075 : <a class="code" href="classscfImplementation1.html">scfImplementationType</a> (this, parent), shapenr (-1), polymesh_base (0) <a name="l00076"></a>00076 { <a name="l00077"></a>00077 } <a name="l00078"></a>00078 <a name="l00079"></a><a class="code" href="classcsObjectModel.html#6a8fbdccc579bb98bb645a35aeee453c">00079</a> <span class="keyword">virtual</span> ~<a class="code" href="classcsObjectModel.html" title="Helper class to make it easier to implement iObjectModel in mesh objects.">csObjectModel</a> () {} <a name="l00080"></a>00080 <a name="l00085"></a><a class="code" href="classcsObjectModel.html#8b47864eba7b6199578e22778484b26d">00085</a> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iStringSet></a> GetStandardStringSet (<a class="code" href="structiObjectRegistry.html" title="This interface serves as a registry of other objects.">iObjectRegistry</a>* object_reg) <a name="l00086"></a>00086 { <a name="l00087"></a>00087 <span class="keywordflow">return</span> csQueryRegistryTagInterface<iStringSet> (object_reg, <a name="l00088"></a>00088 <span class="stringliteral">"crystalspace.shared.stringset"</span>); <a name="l00089"></a>00089 } <a name="l00090"></a>00090 <a name="l00095"></a><a class="code" href="classcsObjectModel.html#fa93475b9ee3984b1a47d70b117dc954">00095</a> <a class="code" href="group__util.html#gbe4f44c93bfeee85c507a999dccf21dd" title="An identifier for a string.">csStringID</a> GetBaseID (<a class="code" href="structiObjectRegistry.html" title="This interface serves as a registry of other objects.">iObjectRegistry</a>* object_reg) <a name="l00096"></a>00096 { <a name="l00097"></a>00097 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iStringSet></a> strings = GetStandardStringSet (object_reg); <a name="l00098"></a>00098 <span class="keywordflow">return</span> strings->Request (<span class="stringliteral">"base"</span>); <a name="l00099"></a>00099 } <a name="l00100"></a>00100 <a name="l00104"></a><a class="code" href="classcsObjectModel.html#bec7d869efd786848e5b42c8e3f1dddb">00104</a> <span class="keywordtype">void</span> SetPolygonMeshBase (<a class="code" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>* base) <a name="l00105"></a>00105 { <a name="l00106"></a>00106 polymesh_base = base; <a name="l00107"></a>00107 } <a name="l00108"></a>00108 <a name="l00112"></a><a class="code" href="classcsObjectModel.html#c83cff44920cf2d84c04df3826231f2d">00112</a> <span class="keywordtype">void</span> ShapeChanged () <a name="l00113"></a>00113 { <a name="l00114"></a>00114 shapenr++; <a name="l00115"></a>00115 FireListeners (); <a name="l00116"></a>00116 } <a name="l00117"></a>00117 <a name="l00121"></a><a class="code" href="classcsObjectModel.html#9053f5697cfb2e735ce87362cad51f9e">00121</a> <span class="keywordtype">void</span> SetShapeNumber (<span class="keywordtype">long</span> n) <a name="l00122"></a>00122 { <a name="l00123"></a>00123 shapenr = n; <a name="l00124"></a>00124 } <a name="l00125"></a>00125 <a name="l00129"></a><a class="code" href="classcsObjectModel.html#4a6fc5000d6e2c16ec6011a299c4f832">00129</a> <span class="keywordtype">void</span> FireListeners () <a name="l00130"></a>00130 { <a name="l00131"></a>00131 <span class="keywordtype">size_t</span> i; <a name="l00132"></a>00132 <span class="keywordflow">for</span> (i = 0 ; i < listeners.GetSize () ; i++) <a name="l00133"></a>00133 listeners[i]->ObjectModelChanged (<span class="keyword">this</span>); <a name="l00134"></a>00134 } <a name="l00135"></a>00135 <a name="l00136"></a><a class="code" href="classcsObjectModel.html#ac1075c91da02e10642b326c5f6af701">00136</a> <span class="keyword">virtual</span> <span class="keywordtype">long</span> GetShapeNumber ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> shapenr; } <a name="l00137"></a>00137 <span class="keyword">virtual</span> <a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>* GetTriangleData (<a class="code" href="group__util.html#gbe4f44c93bfeee85c507a999dccf21dd" title="An identifier for a string.">csStringID</a>); <a name="l00138"></a>00138 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iTriangleMeshIterator></a> GetTriangleDataIterator (); <a name="l00139"></a>00139 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetTriangleData (<a class="code" href="group__util.html#gbe4f44c93bfeee85c507a999dccf21dd" title="An identifier for a string.">csStringID</a>, <a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>*); <a name="l00140"></a>00140 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> IsTriangleDataSet (<a class="code" href="group__util.html#gbe4f44c93bfeee85c507a999dccf21dd" title="An identifier for a string.">csStringID</a>); <a name="l00141"></a>00141 <span class="keyword">virtual</span> <span class="keywordtype">void</span> ResetTriangleData (<a class="code" href="group__util.html#gbe4f44c93bfeee85c507a999dccf21dd" title="An identifier for a string.">csStringID</a>); <a name="l00142"></a>00142 <a name="l00143"></a><a class="code" href="classcsObjectModel.html#3e7d9f3e30351576fd2efa2f5e159374">00143</a> <span class="keyword">virtual</span> <a class="code" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>* GetPolygonMeshBase () { <span class="keywordflow">return</span> polymesh_base; } <a name="l00144"></a><a class="code" href="classcsObjectModel.html#7c2f79db00917dd10135440b8439c99f">00144</a> <span class="keyword">virtual</span> <a class="code" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>* GetPolygonMeshColldet () { <span class="keywordflow">return</span> polymesh_colldet; } <a name="l00145"></a><a class="code" href="classcsObjectModel.html#c09f022e071f526cbcb7c5ed1d15ab87">00145</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetPolygonMeshColldet (<a class="code" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>* polymesh) <a name="l00146"></a>00146 { <a name="l00147"></a>00147 polymesh_colldet = polymesh; <a name="l00148"></a>00148 } <a name="l00149"></a><a class="code" href="classcsObjectModel.html#42fc04cf312b1405fc0f9064e9d0dd7a">00149</a> <span class="keyword">virtual</span> <a class="code" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>* GetPolygonMeshViscull () { <span class="keywordflow">return</span> polymesh_viscull; } <a name="l00150"></a><a class="code" href="classcsObjectModel.html#6d415ef8523621d82bd3b540994a1df1">00150</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetPolygonMeshViscull (<a class="code" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>* polymesh) <a name="l00151"></a>00151 { <a name="l00152"></a>00152 polymesh_viscull = polymesh; <a name="l00153"></a>00153 } <a name="l00154"></a><a class="code" href="classcsObjectModel.html#8fed3c44ae3261fa450a8c09c2cde20a">00154</a> <span class="keyword">virtual</span> <a class="code" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>* GetPolygonMeshShadows () { <span class="keywordflow">return</span> polymesh_shadows; } <a name="l00155"></a><a class="code" href="classcsObjectModel.html#ec3504936a543de2fea9a131568ba8f8">00155</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetPolygonMeshShadows (<a class="code" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>* polymesh) <a name="l00156"></a>00156 { <a name="l00157"></a>00157 polymesh_shadows = polymesh; <a name="l00158"></a>00158 } <a name="l00159"></a><a class="code" href="classcsObjectModel.html#1d0a475b79e1557ca0e5bf42b8d1efa7">00159</a> <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iPolygonMesh></a> CreateLowerDetailPolygonMesh (<span class="keywordtype">float</span>) <a name="l00160"></a>00160 { <a name="l00161"></a>00161 <span class="keywordflow">return</span> 0; <a name="l00162"></a>00162 } <a name="l00163"></a><a class="code" href="classcsObjectModel.html#bef7c5bcb13ca768d5fe1a4990ae8e1a">00163</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> AddListener (<a class="code" href="structiObjectModelListener.html" title="Implement this class if you&#39;re interested in hearing about when the object model...">iObjectModelListener</a>* listener) <a name="l00164"></a>00164 { <a name="l00165"></a>00165 RemoveListener (listener); <a name="l00166"></a>00166 listeners.Push (listener); <a name="l00167"></a>00167 } <a name="l00168"></a><a class="code" href="classcsObjectModel.html#088c1c38c9ae9c7d1493ed6c45521690">00168</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> RemoveListener (<a class="code" href="structiObjectModelListener.html" title="Implement this class if you&#39;re interested in hearing about when the object model...">iObjectModelListener</a>* listener) <a name="l00169"></a>00169 { <a name="l00170"></a>00170 listeners.Delete (listener); <a name="l00171"></a>00171 } <a name="l00172"></a><a class="code" href="classcsObjectModel.html#4cffdad0c34be68df1fce291195c3d91">00172</a> <span class="keyword">virtual</span> <a class="code" href="structiTerraFormer.html" title="TerraFormer objects are used to retrieve terrain data.">iTerraFormer</a>* GetTerraFormerColldet() <a name="l00173"></a>00173 { <a name="l00174"></a>00174 <span class="keywordflow">return</span> 0; <a name="l00175"></a>00175 } <a name="l00176"></a><a class="code" href="classcsObjectModel.html#8f92cd29ac8d2f9a7452986dccc1c554">00176</a> <span class="keyword">virtual</span> <a class="code" href="structiTerrainSystem.html" title="This class represents the terrain object as a set of cells.">iTerrainSystem</a>* GetTerrainColldet () { <span class="keywordflow">return</span> 0; } <a name="l00177"></a>00177 }; <a name="l00178"></a>00178 <a name="l00181"></a>00181 <span class="comment">// for iPolygonMesh</span> <a name="l00182"></a>00182 <span class="preprocessor">#include "<a class="code" href="msvc__deprecated__warn__on_8h.html" title="Re-enable MSVC deprecated warnings.">csutil/win32/msvc_deprecated_warn_on.h</a>"</span> <a name="l00183"></a>00183 <a name="l00184"></a>00184 <span class="preprocessor">#endif // __CS_CSTOOL_OBJMODEL_H__</span> <a name="l00185"></a>00185 <span class="preprocessor"></span> </pre></div><hr size="1"><address><small>Generated for Crystal Space 1.2.1 by <a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 </small></address> </div></body> </html>