| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | #include <osgIntrospection/ReflectionMacros> |
|---|
| 9 | #include <osgIntrospection/TypedMethodInfo> |
|---|
| 10 | #include <osgIntrospection/StaticMethodInfo> |
|---|
| 11 | #include <osgIntrospection/Attributes> |
|---|
| 12 | |
|---|
| 13 | #include <osg/Drawable> |
|---|
| 14 | #include <osg/Geode> |
|---|
| 15 | #include <osg/Group> |
|---|
| 16 | #include <osg/LOD> |
|---|
| 17 | #include <osg/Node> |
|---|
| 18 | #include <osg/Switch> |
|---|
| 19 | #include <osg/Transform> |
|---|
| 20 | #include <osg/Vec2> |
|---|
| 21 | #include <osg/Vec2d> |
|---|
| 22 | #include <osg/Vec3> |
|---|
| 23 | #include <osg/Vec3d> |
|---|
| 24 | #include <osg/Vec4> |
|---|
| 25 | #include <osg/Vec4d> |
|---|
| 26 | #include <osgUtil/Statistics> |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | #ifdef IN |
|---|
| 30 | #undef IN |
|---|
| 31 | #endif |
|---|
| 32 | #ifdef OUT |
|---|
| 33 | #undef OUT |
|---|
| 34 | #endif |
|---|
| 35 | |
|---|
| 36 | TYPE_NAME_ALIAS(std::pair< unsigned int COMMA unsigned int >, osgUtil::Statistics::PrimitivePair) |
|---|
| 37 | |
|---|
| 38 | TYPE_NAME_ALIAS(std::map< GLenum COMMA osgUtil::Statistics::PrimitivePair >, osgUtil::Statistics::PrimitiveValueMap) |
|---|
| 39 | |
|---|
| 40 | TYPE_NAME_ALIAS(std::map< GLenum COMMA unsigned int >, osgUtil::Statistics::PrimitiveCountMap) |
|---|
| 41 | |
|---|
| 42 | BEGIN_ENUM_REFLECTOR(osgUtil::Statistics::StatsType) |
|---|
| 43 | I_DeclaringFile("osgUtil/Statistics"); |
|---|
| 44 | I_EnumLabel(osgUtil::Statistics::STAT_NONE); |
|---|
| 45 | I_EnumLabel(osgUtil::Statistics::STAT_FRAMERATE); |
|---|
| 46 | I_EnumLabel(osgUtil::Statistics::STAT_GRAPHS); |
|---|
| 47 | I_EnumLabel(osgUtil::Statistics::STAT_PRIMS); |
|---|
| 48 | I_EnumLabel(osgUtil::Statistics::STAT_PRIMSPERVIEW); |
|---|
| 49 | I_EnumLabel(osgUtil::Statistics::STAT_PRIMSPERBIN); |
|---|
| 50 | I_EnumLabel(osgUtil::Statistics::STAT_DC); |
|---|
| 51 | I_EnumLabel(osgUtil::Statistics::STAT_RESTART); |
|---|
| 52 | END_REFLECTOR |
|---|
| 53 | |
|---|
| 54 | BEGIN_OBJECT_REFLECTOR(osgUtil::Statistics) |
|---|
| 55 | I_DeclaringFile("osgUtil/Statistics"); |
|---|
| 56 | I_BaseType(osg::PrimitiveFunctor); |
|---|
| 57 | I_Constructor0(____Statistics, |
|---|
| 58 | "", |
|---|
| 59 | ""); |
|---|
| 60 | I_Method0(void, reset, |
|---|
| 61 | Properties::NON_VIRTUAL, |
|---|
| 62 | __void__reset, |
|---|
| 63 | "", |
|---|
| 64 | ""); |
|---|
| 65 | I_Method1(void, setType, IN, osgUtil::Statistics::StatsType, t, |
|---|
| 66 | Properties::NON_VIRTUAL, |
|---|
| 67 | __void__setType__StatsType, |
|---|
| 68 | "", |
|---|
| 69 | ""); |
|---|
| 70 | I_Method2(void, setVertexArray, IN, unsigned int, count, IN, const osg::Vec3 *, x, |
|---|
| 71 | Properties::VIRTUAL, |
|---|
| 72 | __void__setVertexArray__unsigned_int__C5_osg_Vec3_P1, |
|---|
| 73 | "Sets the array of vertices used to describe the primitives. ", |
|---|
| 74 | "Somehow mimics the OpenGL glVertexPointer() function. "); |
|---|
| 75 | I_Method2(void, setVertexArray, IN, unsigned int, count, IN, const osg::Vec2 *, x, |
|---|
| 76 | Properties::VIRTUAL, |
|---|
| 77 | __void__setVertexArray__unsigned_int__C5_osg_Vec2_P1, |
|---|
| 78 | "Sets the array of vertices used to describe the primitives. ", |
|---|
| 79 | "Somehow mimics the OpenGL glVertexPointer() function. "); |
|---|
| 80 | I_Method2(void, setVertexArray, IN, unsigned int, count, IN, const osg::Vec4 *, x, |
|---|
| 81 | Properties::VIRTUAL, |
|---|
| 82 | __void__setVertexArray__unsigned_int__C5_osg_Vec4_P1, |
|---|
| 83 | "Sets the array of vertices used to describe the primitives. ", |
|---|
| 84 | "Somehow mimics the OpenGL glVertexPointer() function. "); |
|---|
| 85 | I_Method2(void, setVertexArray, IN, unsigned int, count, IN, const osg::Vec3d *, x, |
|---|
| 86 | Properties::VIRTUAL, |
|---|
| 87 | __void__setVertexArray__unsigned_int__C5_osg_Vec3d_P1, |
|---|
| 88 | "Sets the array of vertices used to describe the primitives. ", |
|---|
| 89 | "Somehow mimics the OpenGL glVertexPointer() function. "); |
|---|
| 90 | I_Method2(void, setVertexArray, IN, unsigned int, count, IN, const osg::Vec2d *, x, |
|---|
| 91 | Properties::VIRTUAL, |
|---|
| 92 | __void__setVertexArray__unsigned_int__C5_osg_Vec2d_P1, |
|---|
| 93 | "Sets the array of vertices used to describe the primitives. ", |
|---|
| 94 | "Somehow mimics the OpenGL glVertexPointer() function. "); |
|---|
| 95 | I_Method2(void, setVertexArray, IN, unsigned int, count, IN, const osg::Vec4d *, x, |
|---|
| 96 | Properties::VIRTUAL, |
|---|
| 97 | __void__setVertexArray__unsigned_int__C5_osg_Vec4d_P1, |
|---|
| 98 | "Sets the array of vertices used to describe the primitives. ", |
|---|
| 99 | "Somehow mimics the OpenGL glVertexPointer() function. "); |
|---|
| 100 | I_Method3(void, drawArrays, IN, GLenum, mode, IN, GLint, x, IN, GLsizei, count, |
|---|
| 101 | Properties::VIRTUAL, |
|---|
| 102 | __void__drawArrays__GLenum__GLint__GLsizei, |
|---|
| 103 | "Mimics the OpenGL glDrawArrays() function. ", |
|---|
| 104 | ""); |
|---|
| 105 | I_Method3(void, drawElements, IN, GLenum, mode, IN, GLsizei, count, IN, const GLubyte *, x, |
|---|
| 106 | Properties::VIRTUAL, |
|---|
| 107 | __void__drawElements__GLenum__GLsizei__C5_GLubyte_P1, |
|---|
| 108 | "Mimics the OpenGL glDrawElements() function. ", |
|---|
| 109 | ""); |
|---|
| 110 | I_Method3(void, drawElements, IN, GLenum, mode, IN, GLsizei, count, IN, const GLushort *, x, |
|---|
| 111 | Properties::VIRTUAL, |
|---|
| 112 | __void__drawElements__GLenum__GLsizei__C5_GLushort_P1, |
|---|
| 113 | "Mimics the OpenGL glDrawElements() function. ", |
|---|
| 114 | ""); |
|---|
| 115 | I_Method3(void, drawElements, IN, GLenum, mode, IN, GLsizei, count, IN, const GLuint *, x, |
|---|
| 116 | Properties::VIRTUAL, |
|---|
| 117 | __void__drawElements__GLenum__GLsizei__C5_GLuint_P1, |
|---|
| 118 | "Mimics the OpenGL glDrawElements() function. ", |
|---|
| 119 | ""); |
|---|
| 120 | I_Method1(void, begin, IN, GLenum, mode, |
|---|
| 121 | Properties::VIRTUAL, |
|---|
| 122 | __void__begin__GLenum, |
|---|
| 123 | "Mimics the OpenGL glBegin() function. ", |
|---|
| 124 | ""); |
|---|
| 125 | I_Method0(void, vertex, |
|---|
| 126 | Properties::NON_VIRTUAL, |
|---|
| 127 | __void__vertex, |
|---|
| 128 | "", |
|---|
| 129 | ""); |
|---|
| 130 | I_Method3(void, vertex, IN, float, x, IN, float, x, IN, float, x, |
|---|
| 131 | Properties::VIRTUAL, |
|---|
| 132 | __void__vertex__float__float__float, |
|---|
| 133 | "Mimics the OpenGL glVertex() \"family of functions\". ", |
|---|
| 134 | ""); |
|---|
| 135 | I_Method1(void, vertex, IN, const osg::Vec3 &, x, |
|---|
| 136 | Properties::VIRTUAL, |
|---|
| 137 | __void__vertex__C5_osg_Vec3_R1, |
|---|
| 138 | "Mimics the OpenGL glVertex() \"family of functions\". ", |
|---|
| 139 | ""); |
|---|
| 140 | I_Method1(void, vertex, IN, const osg::Vec2 &, x, |
|---|
| 141 | Properties::VIRTUAL, |
|---|
| 142 | __void__vertex__C5_osg_Vec2_R1, |
|---|
| 143 | "Mimics the OpenGL glVertex() \"family of functions\". ", |
|---|
| 144 | ""); |
|---|
| 145 | I_Method1(void, vertex, IN, const osg::Vec4 &, x, |
|---|
| 146 | Properties::VIRTUAL, |
|---|
| 147 | __void__vertex__C5_osg_Vec4_R1, |
|---|
| 148 | "Mimics the OpenGL glVertex() \"family of functions\". ", |
|---|
| 149 | ""); |
|---|
| 150 | I_Method2(void, vertex, IN, float, x, IN, float, x, |
|---|
| 151 | Properties::VIRTUAL, |
|---|
| 152 | __void__vertex__float__float, |
|---|
| 153 | "Mimics the OpenGL glVertex() \"family of functions\". ", |
|---|
| 154 | ""); |
|---|
| 155 | I_Method4(void, vertex, IN, float, x, IN, float, x, IN, float, x, IN, float, x, |
|---|
| 156 | Properties::VIRTUAL, |
|---|
| 157 | __void__vertex__float__float__float__float, |
|---|
| 158 | "Mimics the OpenGL glVertex() \"family of functions\". ", |
|---|
| 159 | ""); |
|---|
| 160 | I_Method0(void, end, |
|---|
| 161 | Properties::VIRTUAL, |
|---|
| 162 | __void__end, |
|---|
| 163 | "Mimics the OpenGL glEnd() function. ", |
|---|
| 164 | ""); |
|---|
| 165 | I_Method0(void, addDrawable, |
|---|
| 166 | Properties::NON_VIRTUAL, |
|---|
| 167 | __void__addDrawable, |
|---|
| 168 | "", |
|---|
| 169 | ""); |
|---|
| 170 | I_Method0(void, addMatrix, |
|---|
| 171 | Properties::NON_VIRTUAL, |
|---|
| 172 | __void__addMatrix, |
|---|
| 173 | "", |
|---|
| 174 | ""); |
|---|
| 175 | I_Method1(void, addLight, IN, int, np, |
|---|
| 176 | Properties::NON_VIRTUAL, |
|---|
| 177 | __void__addLight__int, |
|---|
| 178 | "", |
|---|
| 179 | ""); |
|---|
| 180 | I_Method1(void, addImpostor, IN, int, np, |
|---|
| 181 | Properties::NON_VIRTUAL, |
|---|
| 182 | __void__addImpostor__int, |
|---|
| 183 | "", |
|---|
| 184 | ""); |
|---|
| 185 | I_Method0(int, getBins, |
|---|
| 186 | Properties::NON_VIRTUAL, |
|---|
| 187 | __int__getBins, |
|---|
| 188 | "", |
|---|
| 189 | ""); |
|---|
| 190 | I_Method1(void, setDepth, IN, int, d, |
|---|
| 191 | Properties::NON_VIRTUAL, |
|---|
| 192 | __void__setDepth__int, |
|---|
| 193 | "", |
|---|
| 194 | ""); |
|---|
| 195 | I_Method1(void, addBins, IN, int, np, |
|---|
| 196 | Properties::NON_VIRTUAL, |
|---|
| 197 | __void__addBins__int, |
|---|
| 198 | "", |
|---|
| 199 | ""); |
|---|
| 200 | I_Method1(void, setBinNo, IN, int, n, |
|---|
| 201 | Properties::NON_VIRTUAL, |
|---|
| 202 | __void__setBinNo__int, |
|---|
| 203 | "", |
|---|
| 204 | ""); |
|---|
| 205 | I_Method1(void, add, IN, const osgUtil::Statistics &, stats, |
|---|
| 206 | Properties::NON_VIRTUAL, |
|---|
| 207 | __void__add__C5_Statistics_R1, |
|---|
| 208 | "", |
|---|
| 209 | ""); |
|---|
| 210 | I_Method0(osgUtil::Statistics::PrimitiveCountMap &, getPrimitiveCountMap, |
|---|
| 211 | Properties::NON_VIRTUAL, |
|---|
| 212 | __PrimitiveCountMap_R1__getPrimitiveCountMap, |
|---|
| 213 | "", |
|---|
| 214 | ""); |
|---|
| 215 | I_Method0(const osgUtil::Statistics::PrimitiveCountMap &, getPrimitiveCountMap, |
|---|
| 216 | Properties::NON_VIRTUAL, |
|---|
| 217 | __C5_PrimitiveCountMap_R1__getPrimitiveCountMap, |
|---|
| 218 | "", |
|---|
| 219 | ""); |
|---|
| 220 | I_Method0(osgUtil::Statistics::PrimitiveCountMap::iterator, GetPrimitivesBegin, |
|---|
| 221 | Properties::NON_VIRTUAL, |
|---|
| 222 | __PrimitiveCountMap_iterator__GetPrimitivesBegin, |
|---|
| 223 | "deprecated ", |
|---|
| 224 | ""); |
|---|
| 225 | I_Method0(osgUtil::Statistics::PrimitiveCountMap::iterator, GetPrimitivesEnd, |
|---|
| 226 | Properties::NON_VIRTUAL, |
|---|
| 227 | __PrimitiveCountMap_iterator__GetPrimitivesEnd, |
|---|
| 228 | "deprecated ", |
|---|
| 229 | ""); |
|---|
| 230 | I_SimpleProperty(int, BinNo, |
|---|
| 231 | 0, |
|---|
| 232 | __void__setBinNo__int); |
|---|
| 233 | I_SimpleProperty(int, Bins, |
|---|
| 234 | __int__getBins, |
|---|
| 235 | 0); |
|---|
| 236 | I_SimpleProperty(int, Depth, |
|---|
| 237 | 0, |
|---|
| 238 | __void__setDepth__int); |
|---|
| 239 | I_SimpleProperty(osgUtil::Statistics::PrimitiveCountMap &, PrimitiveCountMap, |
|---|
| 240 | __PrimitiveCountMap_R1__getPrimitiveCountMap, |
|---|
| 241 | 0); |
|---|
| 242 | I_SimpleProperty(osgUtil::Statistics::StatsType, Type, |
|---|
| 243 | 0, |
|---|
| 244 | __void__setType__StatsType); |
|---|
| 245 | I_PublicMemberProperty(int, numDrawables); |
|---|
| 246 | I_PublicMemberProperty(int, nummat); |
|---|
| 247 | I_PublicMemberProperty(int, nbins); |
|---|
| 248 | I_PublicMemberProperty(int, nlights); |
|---|
| 249 | I_PublicMemberProperty(int, depth); |
|---|
| 250 | I_PublicMemberProperty(int, _binNo); |
|---|
| 251 | I_PublicMemberProperty(osgUtil::Statistics::StatsType, stattype); |
|---|
| 252 | I_PublicMemberProperty(int, nimpostor); |
|---|
| 253 | I_PublicMemberProperty(unsigned int, _vertexCount); |
|---|
| 254 | I_PublicMemberProperty(osgUtil::Statistics::PrimitiveValueMap, _primitiveCount); |
|---|
| 255 | I_PublicMemberProperty(GLenum, _currentPrimitiveFunctorMode); |
|---|
| 256 | END_REFLECTOR |
|---|
| 257 | |
|---|
| 258 | TYPE_NAME_ALIAS(std::set< osg::Node * >, osgUtil::StatsVisitor::NodeSet) |
|---|
| 259 | |
|---|
| 260 | TYPE_NAME_ALIAS(std::set< osg::Drawable * >, osgUtil::StatsVisitor::DrawableSet) |
|---|
| 261 | |
|---|
| 262 | TYPE_NAME_ALIAS(std::set< osg::StateSet * >, osgUtil::StatsVisitor::StateSetSet) |
|---|
| 263 | |
|---|
| 264 | BEGIN_OBJECT_REFLECTOR(osgUtil::StatsVisitor) |
|---|
| 265 | I_DeclaringFile("osgUtil/Statistics"); |
|---|
| 266 | I_BaseType(osg::NodeVisitor); |
|---|
| 267 | I_Constructor0(____StatsVisitor, |
|---|
| 268 | "", |
|---|
| 269 | ""); |
|---|
| 270 | I_Method0(const char *, libraryName, |
|---|
| 271 | Properties::VIRTUAL, |
|---|
| 272 | __C5_char_P1__libraryName, |
|---|
| 273 | "return the library name/namespapce of the visitor's. ", |
|---|
| 274 | "Should be defined by derived classes. "); |
|---|
| 275 | I_Method0(const char *, className, |
|---|
| 276 | Properties::VIRTUAL, |
|---|
| 277 | __C5_char_P1__className, |
|---|
| 278 | "return the name of the visitor's class type. ", |
|---|
| 279 | "Should be defined by derived classes. "); |
|---|
| 280 | I_Method0(void, reset, |
|---|
| 281 | Properties::VIRTUAL, |
|---|
| 282 | __void__reset, |
|---|
| 283 | "Method to call to reset visitor. ", |
|---|
| 284 | "Useful if your visitor accumulates state during a traversal, and you plan to reuse the visitor. To flush that state for the next traversal: call reset() prior to each traversal. "); |
|---|
| 285 | I_Method1(void, apply, IN, osg::Node &, node, |
|---|
| 286 | Properties::VIRTUAL, |
|---|
| 287 | __void__apply__osg_Node_R1, |
|---|
| 288 | "", |
|---|
| 289 | ""); |
|---|
| 290 | I_Method1(void, apply, IN, osg::Group &, node, |
|---|
| 291 | Properties::VIRTUAL, |
|---|
| 292 | __void__apply__osg_Group_R1, |
|---|
| 293 | "", |
|---|
| 294 | ""); |
|---|
| 295 | I_Method1(void, apply, IN, osg::Transform &, node, |
|---|
| 296 | Properties::VIRTUAL, |
|---|
| 297 | __void__apply__osg_Transform_R1, |
|---|
| 298 | "", |
|---|
| 299 | ""); |
|---|
| 300 | I_Method1(void, apply, IN, osg::LOD &, node, |
|---|
| 301 | Properties::VIRTUAL, |
|---|
| 302 | __void__apply__osg_LOD_R1, |
|---|
| 303 | "", |
|---|
| 304 | ""); |
|---|
| 305 | I_Method1(void, apply, IN, osg::Switch &, node, |
|---|
| 306 | Properties::VIRTUAL, |
|---|
| 307 | __void__apply__osg_Switch_R1, |
|---|
| 308 | "", |
|---|
| 309 | ""); |
|---|
| 310 | I_Method1(void, apply, IN, osg::Geode &, node, |
|---|
| 311 | Properties::VIRTUAL, |
|---|
| 312 | __void__apply__osg_Geode_R1, |
|---|
| 313 | "", |
|---|
| 314 | ""); |
|---|
| 315 | I_Method1(void, apply, IN, osg::Drawable &, drawable, |
|---|
| 316 | Properties::NON_VIRTUAL, |
|---|
| 317 | __void__apply__osg_Drawable_R1, |
|---|
| 318 | "", |
|---|
| 319 | ""); |
|---|
| 320 | I_Method0(void, totalUpStats, |
|---|
| 321 | Properties::NON_VIRTUAL, |
|---|
| 322 | __void__totalUpStats, |
|---|
| 323 | "", |
|---|
| 324 | ""); |
|---|
| 325 | I_Method1(void, print, IN, std::ostream &, out, |
|---|
| 326 | Properties::NON_VIRTUAL, |
|---|
| 327 | __void__print__std_ostream_R1, |
|---|
| 328 | "", |
|---|
| 329 | ""); |
|---|
| 330 | I_PublicMemberProperty(unsigned int, _numInstancedGroup); |
|---|
| 331 | I_PublicMemberProperty(unsigned int, _numInstancedSwitch); |
|---|
| 332 | I_PublicMemberProperty(unsigned int, _numInstancedLOD); |
|---|
| 333 | I_PublicMemberProperty(unsigned int, _numInstancedTransform); |
|---|
| 334 | I_PublicMemberProperty(unsigned int, _numInstancedGeode); |
|---|
| 335 | I_PublicMemberProperty(unsigned int, _numInstancedDrawable); |
|---|
| 336 | I_PublicMemberProperty(unsigned int, _numInstancedGeometry); |
|---|
| 337 | I_PublicMemberProperty(unsigned int, _numInstancedStateSet); |
|---|
| 338 | I_PublicMemberProperty(osgUtil::StatsVisitor::NodeSet, _groupSet); |
|---|
| 339 | I_PublicMemberProperty(osgUtil::StatsVisitor::NodeSet, _transformSet); |
|---|
| 340 | I_PublicMemberProperty(osgUtil::StatsVisitor::NodeSet, _lodSet); |
|---|
| 341 | I_PublicMemberProperty(osgUtil::StatsVisitor::NodeSet, _switchSet); |
|---|
| 342 | I_PublicMemberProperty(osgUtil::StatsVisitor::NodeSet, _geodeSet); |
|---|
| 343 | I_PublicMemberProperty(osgUtil::StatsVisitor::DrawableSet, _drawableSet); |
|---|
| 344 | I_PublicMemberProperty(osgUtil::StatsVisitor::DrawableSet, _geometrySet); |
|---|
| 345 | I_PublicMemberProperty(osgUtil::StatsVisitor::StateSetSet, _statesetSet); |
|---|
| 346 | I_PublicMemberProperty(osgUtil::Statistics, _uniqueStats); |
|---|
| 347 | I_PublicMemberProperty(osgUtil::Statistics, _instancedStats); |
|---|
| 348 | END_REFLECTOR |
|---|
| 349 | |
|---|
| 350 | STD_MAP_REFLECTOR(std::map< GLenum COMMA osgUtil::Statistics::PrimitivePair >) |
|---|
| 351 | |
|---|
| 352 | STD_MAP_REFLECTOR(std::map< GLenum COMMA unsigned int >) |
|---|
| 353 | |
|---|
| 354 | STD_SET_REFLECTOR(std::set< osg::Drawable * >) |
|---|
| 355 | |
|---|
| 356 | STD_SET_REFLECTOR(std::set< osg::StateSet * >) |
|---|