// 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" #include #include #include using namespace boost::python; namespace { std::string __str__(osg::CullSettings& self) { std::ostringstream ost; ost << "CullSettings :\n"; ost << " InheritanceMask = " << self.getInheritanceMask() << std::endl; ost << " ImpostorsActive = " << self.getImpostorsActive() << std::endl; ost << " ImpostorPixelErrorThreshold = " << self.getImpostorPixelErrorThreshold() << std::endl; ost << " DepthSortImpostorSprites = " << self.getDepthSortImpostorSprites() << std::endl; ost << " NumberOfFrameToKeepImpostorSprites = " << self.getNumberOfFrameToKeepImpostorSprites() << std::endl; ost << " ComputeNearFarMode = " << self.getComputeNearFarMode() << std::endl; ost << " NearFarRatio = " << self.getNearFarRatio() << std::endl; ost << " CullingMode = " << self.getCullingMode() << std::endl; ost << " CullMask = " << self.getCullMask() << std::endl; ost << " LODScale = " << self.getLODScale() << std::endl; ost << " SmallFeatureCullingPixelSize = " << self.getSmallFeatureCullingPixelSize() << std::endl; return ost.str(); } } namespace PyOSG { void init_CullSettings() { class_ cullsettings("CullSettings"); scope cullsettings_scope(cullsettings); cullsettings .def(init<>()) .def("__str__", &__str__) .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) .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", &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); enum_ nearfar("ComputeNearFarMode"); # define OSG_ENUM_NEARFAR(VALUE) \ (nearfar.value(#VALUE, osg::CullSettings::VALUE), \ cullsettings.def(#VALUE, object(osg::CullSettings::VALUE))) OSG_ENUM_NEARFAR(DO_NOT_COMPUTE_NEAR_FAR); OSG_ENUM_NEARFAR(COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES); OSG_ENUM_NEARFAR(COMPUTE_NEAR_FAR_USING_PRIMITIVES); enum_ cmode("CullingModeValues"); # define OSG_ENUM_CULLINGMODE(VALUE) \ (cmode.value(#VALUE, osg::CullSettings::VALUE), \ cullsettings.def(#VALUE, object(osg::CullSettings::VALUE))) OSG_ENUM_CULLINGMODE(NO_CULLING); OSG_ENUM_CULLINGMODE(VIEW_FRUSTUM_SIDES_CULLING); OSG_ENUM_CULLINGMODE(NEAR_PLANE_CULLING); OSG_ENUM_CULLINGMODE(FAR_PLANE_CULLING); OSG_ENUM_CULLINGMODE(VIEW_FRUSTUM_CULLING); OSG_ENUM_CULLINGMODE(SMALL_FEATURE_CULLING); OSG_ENUM_CULLINGMODE(SHADOW_OCCLUSION_CULLING); OSG_ENUM_CULLINGMODE(CLUSTER_CULLING); OSG_ENUM_CULLINGMODE(DEFAULT_CULLING); OSG_ENUM_CULLINGMODE(ENABLE_ALL_CULLING); } } //namespace