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 # Init file for osg package.
22 # Hack to bring in all symbols OpenSG is linked against and loads from plugins
23 # Search for : setdlopenflags and RTLD_GLOBAL on google to see why
25 from ..OSGBase
import AttachmentContainer
27 original_dlopen_flags
= None
31 original_dlopen_flags
= sys
.getdlopenflags()
32 sys
.setdlopenflags(original_dlopen_flags | dl
.RTLD_GLOBAL
)
36 # Import everything from the opensg module
37 from ${PROJECT_NAME}Py
import *
39 if original_dlopen_flags
:
40 sys
.setdlopenflags(original_dlopen_flags
)
42 def _fc_cmp(self
, other
):
43 """ Comparison operator for field containers. """
47 id_self
= self
.getId()
49 id_other
= other
.getId()
51 return cmp(id_self
, id_other
)
59 for (n
,c
) in ${PROJECT_NAME}Py
.__dict
__.iteritems():
60 if isinstance(c
,type) and (AttachmentContainer
in c
.__mro
__):
64 # Add cored node types
65 import osg2
.helpers
.cored_node
as cored_node
66 cored_node
.addNodeCoreTypes(globals(), ${PROJECT_NAME}Py
)