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)
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
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
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",
34 gen_classes
.append(osggen
.ClassInfo(c
))
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,
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));
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")))',
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
):
99 def postScanSetup(osg
, template_alias_db
):
105 def postGenClassesSetup(osg
, mb
):
111 def postFCDInfoSetup(osg
, mb
, adddition_exp
):
113 splitGenHelper
.customizeWindow(osg
, "ClusterWindow")
115 for class_name
in ["ClusterWindow"]:
117 for m
in ["initAsync", "setConnectionCB"]: