// Copyright (C) 2002-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. // // TODO Still a large number of methods to implement #include #include #include #include #include #include #include #include "held_ptr.hpp" using namespace boost::python; namespace PyOSG { void init_CullStack() { class_ cullStack("CullStack", "A CullStack class which accumulates the current project, modelview matrices\n" "and the CullingSet.\n", no_init); scope cullStack_scope(cullStack); cullStack .def("reset", &osg::CullStack::reset) .def("setOccluderList", &osg::CullStack::setOccluderList) //.def("getOccluderList", &osg::CullStack::getOccluderList) .def("pushViewport", &osg::CullStack::pushViewport) .def("popViewport", &osg::CullStack::popViewport) .def("pushProjectionMatrix", &osg::CullStack::pushProjectionMatrix) .def("popProjectionMatrix", &osg::CullStack::popProjectionMatrix) .def("pushModelViewMatrix", &osg::CullStack::pushModelViewMatrix) .def("popModelViewMatrix", &osg::CullStack::popModelViewMatrix) .def("getFrustumVolume", &osg::CullStack::getFrustumVolume) .def("pixelSize", (float (osg::CullStack::*)(const osg::Vec3&, float) const) &osg::CullStack::pixelSize) .def("pixelSize", (float (osg::CullStack::*)(const osg::BoundingSphere&) const) &osg::CullStack::pixelSize) .def("disableAndPushOccludersCurrentMask", &osg::CullStack::disableAndPushOccludersCurrentMask) .def("popOccludersCurrentMask", &osg::CullStack::popOccludersCurrentMask) .def("isCulled", (bool (osg::CullStack::*)(const std::vector&)) &osg::CullStack::isCulled) .def("isCulled", (bool (osg::CullStack::*)(const osg::BoundingBox&)) &osg::CullStack::isCulled) .def("isCulled", (bool (osg::CullStack::*)(const osg::BoundingSphere&)) &osg::CullStack::isCulled) .def("pushCurrentMask", &osg::CullStack::pushCurrentMask) .def("popCurrentMask", &osg::CullStack::popCurrentMask) .def("getClipSpaceCullingStack", &osg::CullStack::getClipSpaceCullingStack, return_value_policy()) .def("getProjectionCullingStack", &osg::CullStack::getProjectionCullingStack, return_value_policy()) .def("getViewport", &osg::CullStack::getViewport, return_value_policy()) .def("getModelViewMatrix", &osg::CullStack::getModelViewMatrix, return_internal_reference<>()) .def("getProjectionMatrix", &osg::CullStack::getProjectionMatrix, return_value_policy()) .def("getWindowMatrix", &osg::CullStack::getWindowMatrix) .def("getEyeLocal", &osg::CullStack::getEyeLocal, return_value_policy()) .def("getUpLocal", &osg::CullStack::getUpLocal) .def("getLookVectorLocal", &osg::CullStack::getLookVectorLocal) .def("setCullingMode", &osg::CullStack::setCullingMode) .def("getCullingMode", &osg::CullStack::getCullingMode) .def("setLODScale", &osg::CullStack::setLODScale) .def("getLODScale", &osg::CullStack::getLODScale) .def("setSmallFeatureCullingPixelSize", &osg::CullStack::setSmallFeatureCullingPixelSize) .def("getSmallFeatureCullingPixelSize", &osg::CullStack::getSmallFeatureCullingPixelSize) ; # define OSG_ENUM_VALUE(VALUE) \ (cullingMode.value(#VALUE, osg::CullStack::VALUE), \ cullStack.def(#VALUE, object(osg::CullStack::VALUE))) enum_ cullingMode("CullingModeValues"); OSG_ENUM_VALUE(NO_CULLING); OSG_ENUM_VALUE(VIEW_FRUSTUM_CULLING); OSG_ENUM_VALUE(NEAR_PLANE_CULLING); OSG_ENUM_VALUE(FAR_PLANE_CULLING); OSG_ENUM_VALUE(VIEW_FRUSTUM_CULLING); OSG_ENUM_VALUE(SMALL_FEATURE_CULLING); OSG_ENUM_VALUE(SHADOW_OCCLUSION_CULLING); OSG_ENUM_VALUE(DEFAULT_CULLING); OSG_ENUM_VALUE(ENABLE_ALL_CULLING); scope(); } } // namespace