// Copyright (C) 2004 Brett Hartshorn (bhartsho@yahoo.com) // Copyright (C) 2005 Gideon May (gideon@computer.org) // // Permission to copy, use, sell and distribute this software is granted // provided this copyright notice appears in all copies. // Permission to modify the code and to distribute modified code is granted // provided this copyright notice appears in all copies, and a notice // that the code was modified is included with the copyright notice. // // This software is provided "as is" without express or implied warranty, // and with no claim as to its suitability for any purpose. #include #include #include #include #include #include #include "held_ptr.hpp" using namespace boost::python; namespace PyOSG { void init_CullSettings() { class_ cullsettings("CullSettings"); scope cullsettings_scope(cullsettings); cullsettings .def(init<>()) .def("setDefaults", &osg::CullSettings::setDefaults) .def("setInheritanceMask", &osg::CullSettings::setInheritanceMask) .def("getInheritanceMask", &osg::CullSettings::getInheritanceMask) .def("setCullSettings", &osg::CullSettings::setCullSettings) .def("inheritCullSettings", (void (osg::CullSettings::*)(const osg::CullSettings&)) &osg::CullSettings::inheritCullSettings) .def("inheritCullSettings", (void (osg::CullSettings::*)(const osg::CullSettings&, unsigned int )) &osg::CullSettings::inheritCullSettings) .def("readEnvironmentalVariables", &osg::CullSettings::readEnvironmentalVariables) // boost not like forward declared structs, tell Robert? -brett //.def("readCommandLine", &osg::CullSettings::readCommandLine) .def("setImpostorsActive", &osg::CullSettings::setImpostorsActive) .def("getImpostorsActive", &osg::CullSettings::getImpostorsActive) .def("setImpostorPixelErrorThreshold", &osg::CullSettings::setImpostorPixelErrorThreshold) .def("getImpostorPixelErrorThreshold", &osg::CullSettings::getImpostorPixelErrorThreshold) .def("setDepthSortImpostorSprites", (void (osg::CullSettings::*)(bool)) &osg::CullSettings::setDepthSortImpostorSprites) .def("setDepthSortImpostorSprites", (bool (osg::CullSettings::*)() const) &osg::CullSettings::setDepthSortImpostorSprites) .def("setNumberOfFrameToKeepImpostorSprites", &osg::CullSettings::setNumberOfFrameToKeepImpostorSprites) .def("getNumberOfFrameToKeepImpostorSprites", &osg::CullSettings::getNumberOfFrameToKeepImpostorSprites) .def("setComputeNearFarMode", (void (osg::CullSettings::*)(osg::CullSettings::ComputeNearFarMode)) &osg::CullSettings::setComputeNearFarMode) .def("getComputeNearFarMode", &osg::CullSettings::getComputeNearFarMode) .def("setNearFarRatio", &osg::CullSettings::setNearFarRatio) .def("getNearFarRatio", &osg::CullSettings::getNearFarRatio) .def("setCullingMode", &osg::CullSettings::setCullingMode) .def("getCullingMode", &osg::CullSettings::getCullingMode) .def("setCullMask", &osg::CullSettings::setCullMask) .def("getCullMask", &osg::CullSettings::getCullMask) .def("setCullMaskLeft", &osg::CullSettings::setCullMaskLeft) .def("getCullMaskLeft", &osg::CullSettings::getCullMaskLeft) .def("setCullMaskRight", &osg::CullSettings::setCullMaskRight) .def("getCullMaskRight", &osg::CullSettings::getCullMaskRight) .def("setLODScale", &osg::CullSettings::setLODScale) .def("getLODScale", &osg::CullSettings::getLODScale) .def("setSmallFeatureCullingPixelSize", &osg::CullSettings::setSmallFeatureCullingPixelSize) .def("getSmallFeatureCullingPixelSize", &osg::CullSettings::getSmallFeatureCullingPixelSize) ; //end class wrapper enum_ varmask("VariablesMask"); # define OSG_ENUM_VARMASK(VALUE) \ (varmask.value(#VALUE, osg::CullSettings::VALUE), \ cullsettings.def(#VALUE, object(osg::CullSettings::VALUE))) OSG_ENUM_VARMASK(COMPUTE_NEAR_FAR_MODE); OSG_ENUM_VARMASK(CULLING_MODE); OSG_ENUM_VARMASK(LOD_SCALE); OSG_ENUM_VARMASK(SMALL_FEATURE_CULLING_PIXEL_SIZE); OSG_ENUM_VARMASK(CLAMP_PROJECTION_MATRIX_CALLBACK); OSG_ENUM_VARMASK(NEAR_FAR_RATIO); OSG_ENUM_VARMASK(IMPOSTOR_ACTIVE); OSG_ENUM_VARMASK(DEPTH_SORT_IMPOSTOR_SPRITES); OSG_ENUM_VARMASK(IMPOSTOR_PIXEL_ERROR_THRESHOLD); OSG_ENUM_VARMASK(NUM_FRAMES_TO_KEEP_IMPOSTORS_SPRITES); OSG_ENUM_VARMASK(CULL_MASK); OSG_ENUM_VARMASK(CULL_MASK_LEFT); OSG_ENUM_VARMASK(CULL_MASK_RIGHT); OSG_ENUM_VARMASK(NO_VARIABLES); OSG_ENUM_VARMASK(ALL_VARIABLES); # define OSG_ENUM_MODE(VALUE) \ (mode.value(#VALUE, osg::CullSettings::VALUE), \ cullsettings.def(#VALUE, object(osg::CullSettings::VALUE))) enum_ mode("ComputeNearFarMode"); OSG_ENUM_MODE( DO_NOT_COMPUTE_NEAR_FAR); OSG_ENUM_MODE( COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES); OSG_ENUM_MODE( COMPUTE_NEAR_FAR_USING_PRIMITIVES); } } //namespace