// 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. // #include #include #include #include #include #include #include #include #include #include "Group.hpp" #include "held_ptr.hpp" using namespace boost::python; namespace { DEFINE_GROUP_CAST(ClipNode) void createClipBox(osg::ClipNode& self, const osg::BoundingBox& bb) { self.createClipBox(bb); } tuple getClipPlaneList(osg::ClipNode& self) { list cplist; osg::ClipNode::ClipPlaneList::iterator cpiter; for (cpiter = self.getClipPlaneList().begin(); cpiter < self.getClipPlaneList().end(); cpiter ++) { cplist.append(object(*cpiter)); } return tuple(cplist); } } // namespace namespace PyOSG { void init_ClipNode() { REGISTER_GROUP_CAST(ClipNode) class_, bases > clip_node("ClipNode", "Leaf Node for defining the position of ClipPlanes in the scene.\n", no_init); clip_node .def(init<>()) .def("createClipBox", &osg::ClipNode::createClipBox, "Create a 6 clip planes to create a clip box.") .def("createClipBox", &createClipBox, "Create a 6 clip planes to create a clip box.") .def("addClipPlane", &osg::ClipNode::addClipPlane, "Add a ClipPlane to a ClipNode. Return true if plane is added, \n" "return false if plane already exists in ClipNode, or clipplane is false.") .def("removeClipPlane", (bool (osg::ClipNode::*)(osg::ClipPlane* clipplane)) &osg::ClipNode::removeClipPlane, "Remove ClipPlane from a ClipNode. Return true if plane is removed, \n" "return false if plane does not exists in ClipNode.\n") .def("removeClipPlane", (bool (osg::ClipNode::*)(unsigned int pos)) &osg::ClipNode::removeClipPlane, "Remove ClipPlane, at specified index, from a ClipNode. Return true if plane is removed, \n" "return false if plane does not exists in ClipNode.\n") .def("getNumClipPlanes", &osg::ClipNode::getNumClipPlanes, "return the number of ClipPlanes.") .def("getClipPlane", (osg::ClipPlane * (osg::ClipNode::*)(unsigned int pos)) &osg::ClipNode::getClipPlane, return_value_policy(), "Get ClipPlane at specificed index position.\n") .def("getClipPlaneList", &getClipPlaneList) .def("setStateSetModes", &osg::ClipNode::setStateSetModes, "Set the GLModes on StateSet associated with the ClipPlanes.\n") .def("setLocalStateSetModes", &osg::ClipNode::setLocalStateSetModes, "Set up the local StateSet\n") ; } }