예제 #1
0
def ManualExclude ( mb ):
    global_ns = mb.global_ns
    if MAIN_NAMESPACE:
        main_ns = global_ns.namespace( MAIN_NAMESPACE )
    else:
        main_ns = global_ns    
        
    excludes=[
                #'::QuickGUI::ComboBox::_clearSelection'
                #'::QuickGUI::ComboBox::addComboBoxEventHandler'
#                 ,'::QuickGUI::ContainerWidget::setDrawChildrenWhenNotVisible'
#                 ,'::QuickGUI::ContainerWidget::getDrawChildrenWhenNotVisible'
#                 ,'::QuickGUI::TreeViewNode::isSelected'
                '::QuickGUI::ComboBox::_clearSelection',
                '::QuickGUI::ContainerWidget::setDrawChildrenWhenNotVisible',
                '::QuickGUI::PropertyGrid::getPropertyWidth',
                '::QuickGUI::PropertyGridItem::isSelected',
                '::QuickGUI::ScriptProperty::ScriptProperty',
                '::QuickGUI::ContainerWidget::getDrawChildrenWhenNotVisible',
                '::QuickGUI::TreeViewNode::isSelected',
                '::QuickGUI::Widget::setConsumeMouseEvents',
                '::QuickGUI::ScriptProperty::getPropertyName',
                '::QuickGUI::ScriptProperty::getValues',
                '::QuickGUI::DescFactory::createInstance'
                ]
            
    for e in excludes:
        try:
            global_ns.member_functions(e).exclude()
            print "Excluding Function", e
        except:
            print "Failed to exclude function", e
    
 
    NotExported=[]
    for c in NotExported:
        try:
            main_ns.class_( c ).exclude()
            print "Excluding Class", c
        except:
            print "Unable to exclude class", c
 
    # excluding static const strings that cause a boost cant set variable error    
    for v in main_ns.variables():
        if '::Ogre::String const' in v.type.decl_string:
            v.exclude()
            print "Excluding Const String var:",v, v.decl_string   
            
    try:
        main_ns.class_('::QuickGUI::ScriptReader').operator('=').exclude()
        log_exclude("ScriptReader operator =")
    except:
        log_exclude("ScriptReader operator =", False)

    main_ns.constructor('::QuickGUI::Character::Character', arg_types=[None]).exclude()
    main_ns.class_('::QuickGUI::ScriptReader').noncopyable = True
예제 #2
0
def ManualExclude ( mb ):
    global_ns = mb.global_ns
    if MAIN_NAMESPACE:
        main_ns = global_ns.namespace( MAIN_NAMESPACE )
    else:
        main_ns = global_ns    
    ex = ['PageLoadableUnit', 'PageContent',
        '::std::list<Ogre::HardwareVertexBufferSharedPtr, Ogre::STLAllocator<Ogre::HardwareVertexBufferSharedPtr, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > >'
        ]
    for c in ex:
        try:
            main_ns.class_(c).exclude()
            print "Excluded:", c
        except:
            print "Failed to exclude:", c
    ex = ['::Ogre::TerrainLayerBlendMap::upload',
        '::Ogre::TerrainGroup::boxIntersects',     #hand wrapped
        '::Ogre::TerrainGroup::sphereIntersects',
        ]
    for c in ex:
        try:
            main_ns.member_functions(c).exclude()
            print "Excluded:", c
        except:
            print "Failed to exclude:", c
    for c in global_ns.namespace( 'std' ).classes():
        if "HardwareVertexBufferSharedPtr" in c.name:
            print c.ignore, c
            if c.decl_string.startswith ("::std::list<Ogre::HardwareVertexBufferSharedPtr"):
                c.include(already_exposed=True)
                print "excluded:", c
                
    # iterator fixes from the ogre generate code scripts
    #Exclude non default constructors of iterator classes.
    for cls in main_ns.classes():
        if not declarations.templates.is_instantiation( cls.name ):
           continue
        name = declarations.templates.name( cls.name )
        if not name.endswith( 'Iterator' ):
           continue
        #default constructor does not have arguments
        constructors = cls.constructors( lambda decl: bool( decl.arguments )
                                                      , allow_empty=True
                                                      , recursive=False )
        constructors.exclude()
        # and while we are here we have problems with '=' on these classes
        try:
            cls.operator('=').exclude()
            log_exclude(cls)
        except:
            log_exclude(cls, False)
    main_ns.calldefs ('peekNextPtr').exclude ()
    main_ns.calldefs ('peekNextValuePtr').exclude ()    #in many of the Iterator classes
예제 #3
0
def ManualExclude ( mb ):
    global_ns = mb.global_ns
    
    #
    # Exclude problem functions
    #
    excludes=[  '::OgreOde_Loader::DotLoader::loadFile', 
                '::OgreOde::EntityInformer::getIndices',   # returns const * to TriangleIndex
                '::OgreOde_Prefab::Vehicle::load',
#                '::OgreOde::Geometry::setUserObject',   #hand wrapped
#                '::OgreOde::Geometry::getUserObject',   #hand wrapped
                '::OgreOde::PlaneBoundedRegionGeometry::_planeCallback',
                '::OgreOde::TerrainGeometry::_heightCallback',
                '::OgreOde::EntityInformer::getIndices', ## unsigned int const *
#                 '::OgreOde::RagdollFactory::requestTypeFlags', # causes issues with moveableobjectfactory
                '::OgreOde::EntityInformer::getBoneVertices',  # hand wrapped
                '::OgreOde::TriangleMeshData::getIndices', ## needs to be hand wrapped
#                 '::OgreOde::PlaneBoundedRegionGeometryPlaneListener::planesAt',
                '::OgreOde::World::fastStep', # it's not in the external lib
                ]
    for e in excludes:
        try:
            global_ns.member_functions(e).exclude()
            log_exclude(e)
        except:
            log_exclude(e, False) # log it failing

    global_ns.namespace( 'OgreOde' ).class_("CircularBuffer<OgreOde::BodyState*>").exclude() 
    #
    # Exclude problem variables
    #
    excludes = ['::OgreOde::Body::MovableType',
                '::OgreOde::Utility::Infinity'
                ]
    for e in excludes:
        try:
            global_ns.variable(e).exclude()
            log_exclude(e)
        except:
            log_exclude(e, False) # log it failing
    #
    # Exclude problem classes
    #
    # Unfortunately the classes here being used with Maintainedlist don't implement ALL of
    # maintaintlist's functions - hence Py++ has tried to expose them all and it fails at
    # compile time.  Probably need to patch the source to implement null functions.
    excludes =['MaintainedList<OgreOde::Body>',
                'MaintainedList<OgreOde::Geometry>',
                'MaintainedList<OgreOde::Joint>',
                'MaintainedList<OgreOde::JointGroup>', 
                'MaintainedList<OgreOde::Space>',
                'PlaneBoundedRegionGeometry'  # has std::list <plane> causing an issue
                ]
    for e in excludes:
        try:
            global_ns.namespace( 'OgreOde' ).class_(e).exclude()
            log_exclude(e)
        except:
            log_exclude(e, False) # log it failing
            
    #global_ns.namespace("Ogre").class_('list<Ogre::Plane>').include(already_exposed=True)  
    
    try: # this only works with ogre 1.7 so wrap in a try..
        global_ns.class_('::std::list<Ogre::Plane, Ogre::STLAllocator<Ogre::Plane, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > >').include(already_exposed=True)
        print "***SPECIAL 1 OK ***"
    except:
        print "FAIL ON 1"
    try: # this only works with ogre 1.7 so wrap in a try..
        global_ns.class_('::std::list< Ogre::Plane >').include(already_exposed=True)  #std::list< Ogre::Plane >
        print "***SPECIAL 2 OK ***"
    except:
        print "FAIL ON 2"
    # a specal set as the constructors require pointers to vertex buffers which we can't do 
    # so make them no initable (so boost won't allow you to try and make them)
    # and have helper functions in hand wrappers to use instead   
    excludes =['::OgreOde::TriangleMeshGeometry'  
               ,'::OgreOde::ComplexGeometry'
               ]
#     for c in excludes:
#         print dir ( global_ns.class_( c ) )
#           
                
    global_ns.class_('::Ogre::Plane').include(already_exposed=True)