fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Cluster / Bindings / Python / osgSetupBindings_OSGCluster.py.in
blobdc45c41afdc36e84e537bbfa741c77aae6f6a6b8
1 # PyOpenSG is (C) Copyright 2005-2009 by Allen Bierbaum
3 # This file is part of PyOpenSG.
5 # PyOpenSG is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Lesser General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option)
8 # any later version.
10 # PyOpenSG is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
13 # more details.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # This script is derived from gen_bindings.py, it contains all class specific
20 # tasks for the OSGClusterLib for the integration with the OpenSG CMake system
21 # (GV)
24 from goodies import *
26 import osggen
27 import splitGenHelper
29 def preScanSetup(gen_classes, fc_infos, core_mods, free_funcs, free_func_mods, exc_types):
31 # Add basic classes that can just be wrapped with no customization
32 for c in ["ClusterNetwork",
33 "ClusterServer",]:
34 gen_classes.append(osggen.ClassInfo(c))
36 ra_decl_code = """
37 namespace
40 bool invokeCallback(bp::object obj, const OSG::FieldContainer* fc,
41 OSG::RemoteAspect* ra)
43 return bp::extract<bool>(obj(fc, ra));
46 void wrapRegisterCreated(OSG::RemoteAspect* self,
47 const OSG::FieldContainerType& type, bp::object func)
49 self->registerCreated(type, boost::bind(invokeCallback, func, _1, _2));
52 void wrapRegisterDestroyed(OSG::RemoteAspect* self,
53 const OSG::FieldContainerType& type,
54 bp::object func)
56 self->registerDestroyed(type, boost::bind(invokeCallback, func, _1, _2));
59 void wrapRegisterChanged(OSG::RemoteAspect* self,
60 const OSG::FieldContainerType& type, bp::object func)
62 self->registerChanged(type, boost::bind(invokeCallback, func, _1, _2));
66 """
68 ra_reg_code = [
69 'def("registerCreated", wrapRegisterCreated, (bp::arg("type"), bp::arg("func")))',
70 'def("registerDestroyed", wrapRegisterDestroyed, (bp::arg("type"), bp::arg("func")))',
71 'def("registerChanged", wrapRegisterChanged, (bp::arg("type"), bp::arg("func")))',
74 gen_classes.append(
75 osggen.ClassInfo("RemoteAspect",
76 excludeList = ["registerCreated", "registerDestroyed", "registerChanged"],
77 declarationCode = [ra_decl_code],
78 registrationCode = ra_reg_code)
81 # OpenSG exceptions to be translated into a Python exception type.
82 exc_types.extend([("ClusterException", "IOError")])
85 def excludeFCDSetup(opensg_src_dir, fc_ignore_list, skip_fcds):
87 fc_ignore_list.extend(["ImageComposer", "DisplayCalibration", "SortFirstWindow", "SortLastWindow",
88 "SepiaComposer", "BinarySwapComposer", "PipelineComposer",
89 "ParallelComposer", "BalancedMultiWindow"])
93 def genTemplatesSetup(template_builder, tbuilder, non_fc_template_instances):
95 return
99 def postScanSetup(osg, template_alias_db):
101 return
105 def postGenClassesSetup(osg, mb):
107 return
111 def postFCDInfoSetup(osg, mb, adddition_exp):
113 splitGenHelper.customizeWindow(osg, "ClusterWindow")
115 for class_name in ["ClusterWindow"]:
116 c = osg[class_name]
117 for m in ["initAsync", "setConnectionCB"]:
118 c[m].exclude()
120 return