Exemple #1
0
static void write_type(const type_t *type)
{
	switch(type->kind) {
	case TYPE_ATOMIC:
		write_atomic_type(&type->atomic);
		return;
	case TYPE_POINTER:
		write_pointer_type(&type->pointer);
		return;
	case TYPE_COMPOUND_UNION:
	case TYPE_COMPOUND_STRUCT:
		write_compound_type(&type->compound);
		return;
	case TYPE_ENUM:
		write_enum_type(&type->enumt);
		return;
	case TYPE_FUNCTION:
		write_function_type(&type->function);
		return;
	case TYPE_INVALID:
		panic("invalid type found");
	case TYPE_COMPLEX:
	case TYPE_IMAGINARY:
	default:
		fprintf(out, "/* TODO type */");
		break;
	}
}
void register_ExternalFileWriter_class(){

    { //::osgDB::ExternalFileWriter
        typedef bp::class_< osgDB::ExternalFileWriter, boost::noncopyable > ExternalFileWriter_exposer_t;
        ExternalFileWriter_exposer_t ExternalFileWriter_exposer = ExternalFileWriter_exposer_t( "ExternalFileWriter", "\n Helper allowing intelligent writing of external files (images, shaders, etc.), regarding to a main file (a scene), especially in plugins.\n Goals are:\n   - Enable writing out objects only once (even if referenced multiple times)\n   - Handle duplicates (avoid writing two different objects at the same place, renaming files as needed)\n   - Handle directory creation when paths dont just exist\n   - Generate writing paths which may keep original directory structure (depending on user wishes). Ex:\n       Reading: model.osg and images/img1.jpg\n          Writing with    keepRelativePaths: /somePath/newmodel.osg and /somePath/images/img1.jpg\n          Writing without keepRelativePaths: /somePath/newmodel.osg and /somePath/img1.jpg\nAuthor: Sukender\nTODO Handling of naming constraints (such as 8.3 names in 3DS)\n", bp::init< std::string const &, std::string const &, bool, bp::optional< unsigned int > >(( bp::arg("srcDirectory"), bp::arg("destDirectory"), bp::arg("keepRelativePaths"), bp::arg("allowUpDirs")=(unsigned int)(0) ), "\n Builds the helper class with all options.\n@param srcDirectory: Directory of the initial main file (if any), used as a base when relativising objects names. Not used if keepRelativePaths==false.\n@param destDirectory: Directory where to write the main file.\n@param keepRelativePaths: If true, then relative paths of source objects are kept if possible (ex: If an image is initially imageDir/image.jpg relatively to the source dir, then wed like to get destDir/imageDir/image.jpg). If false, then only the simple file name is used to write the object file.\n@param allowUpDirs: When relativising objects paths, sets the maximum number of directories the objects can be written up the destination directory. Not used if keepRelativePaths==false. Examples: If an image is initially ../image.jpg relatively to the source dir *AND* if we allow one dir level up, then wed like to get destDirParent/destDir/../image.jpg (= destDirParent/image.jpg). If we *DO NOT* allow one dir level up, then wed like to get destDir/image.jpg.\n") );
        bp::scope ExternalFileWriter_scope( ExternalFileWriter_exposer );
        bp::class_< osgDB::ExternalFileWriter::ObjectData >( "ObjectData", bp::init< >() )    
            .def( bp::init< std::string const &, std::string const &, bool >(( bp::arg("absolutePath"), bp::arg("relativePath"), bp::arg("written") )) )    
            .def_readwrite( "absolutePath", &osgDB::ExternalFileWriter::ObjectData::absolutePath )    
            .def_readwrite( "relativePath", &osgDB::ExternalFileWriter::ObjectData::relativePath )    
            .def_readwrite( "written", &osgDB::ExternalFileWriter::ObjectData::written, "\n Says if write succeded or not.\n" );
        ExternalFileWriter_exposer.def( bp::init< std::string const & >(( bp::arg("destDirectory") ), "\n Short constructor used when not relativising objects paths, or when having no initial model file (which is pretty the same here).\n") );
        bp::implicitly_convertible< std::string const &, osgDB::ExternalFileWriter >();
        { //::osgDB::ExternalFileWriter::getObjects
        
            typedef ::std::map< osg::Object const*, osgDB::ExternalFileWriter::ObjectData > const & ( ::osgDB::ExternalFileWriter::*getObjects_function_type )(  ) const;
            
            ExternalFileWriter_exposer.def( 
                "getObjects"
                , getObjects_function_type( &::osgDB::ExternalFileWriter::getObjects )
                , bp::return_internal_reference< >()
                , "\n Returns the written objects.\n" );
        
        }
        { //::osgDB::ExternalFileWriter::write
        
            typedef boost::python::object ( *write_function_type )( ::osgDB::ExternalFileWriter &,::osg::Object &,::osgDB::Options const *,::std::string *,::std::string * );
            
            ExternalFileWriter_exposer.def( 
                "write"
                , write_function_type( &write_450b6356464d3b168ed8fbce635bbd4a )
                , ( bp::arg("inst"), bp::arg("obj"), bp::arg("options"), bp::arg("out_absolutePath")=0l, bp::arg("out_relativePath")=0l )
                , " Writes the current object if not already done.\n@param obj: Object to write, using corresponding osgDB::write method.\n@param options: Writing options to pass to corresponding osgDB::write method.\n@param [out]: out_absolutePath Pointer to a string to be filled with absolute writing path, or NULL.\n@param [out]: out_relativePath Pointer to a string to be filled with write path relative to the destination directory if possible (absolute path if not), or NULL.\nReturn: true on success, false otherwise." );
        
        }
    }

}
Exemple #3
0
void register_File_class(){

    { //::osiris::File
        typedef ::boost::python::class_< File_wrapper, ::boost::python::bases< ::osiris::IStream >, ::boost::noncopyable > File_exposer_t;
        File_exposer_t File_exposer = File_exposer_t( "File", ::boost::python::init< >() );
        ::boost::python::scope File_scope( File_exposer );
        ::boost::python::enum_< ::osiris::File::OpenFlags>("OpenFlags")
            .value("ofRead", ::osiris::File::ofRead)
            .value("ofWrite", ::osiris::File::ofWrite)
            .value("ofReadWrite", ::osiris::File::ofReadWrite)
            .value("ofNoTruncate", ::osiris::File::ofNoTruncate)
            .value("ofBinary", ::osiris::File::ofBinary)
            .value("ofText", ::osiris::File::ofText)
            .export_values()
            ;
        File_exposer.def( ::boost::python::init< ::osiris::String const &, ::osiris::uint32 >(( ::boost::python::arg("filename"), ::boost::python::arg("flags") )) );
        { //::osiris::File::getHandle
        
            typedef boost::python::object ( *getHandle_function_type )( ::osiris::File const & );
            
            File_exposer.def( 
                "getHandle"
                , getHandle_function_type( &File_wrapper::getHandle ) );
        
        }
        { //::osiris::File::open
        
            typedef bool ( ::osiris::File::*open_function_type )( ::osiris::String const &,::osiris::uint32 ) ;
            typedef bool ( File_wrapper::*default_open_function_type )( ::osiris::String const &,::osiris::uint32 ) ;
            
            File_exposer.def( 
                "open"
                , open_function_type(&::osiris::File::open)
                , default_open_function_type(&File_wrapper::default_open)
                , ( ::boost::python::arg("filename"), ::boost::python::arg("flags") ) );
        
        }
        { //::osiris::File::is_open
        
            typedef bool ( ::osiris::File::*is_open_function_type )(  ) const;
            typedef bool ( File_wrapper::*default_is_open_function_type )(  ) const;
            
            File_exposer.def( 
                "is_open"
                , is_open_function_type(&::osiris::File::is_open)
                , default_is_open_function_type(&File_wrapper::default_is_open) );
        
        }
        { //::osiris::File::close
        
            typedef bool ( ::osiris::File::*close_function_type )(  ) ;
            typedef bool ( File_wrapper::*default_close_function_type )(  ) ;
            
            File_exposer.def( 
                "close"
                , close_function_type(&::osiris::File::close)
                , default_close_function_type(&File_wrapper::default_close) );
        
        }
        { //::osiris::File::read
        
            typedef ::osiris::uint32 ( ::osiris::File::*read_function_type )( void *,::osiris::uint32 ) const;
            typedef ::osiris::uint32 ( File_wrapper::*default_read_function_type )( void *,::osiris::uint32 ) const;
            
            File_exposer.def( 
                "read"
                , read_function_type(&::osiris::File::read)
                , default_read_function_type(&File_wrapper::default_read)
                , ( ::boost::python::arg("v"), ::boost::python::arg("size") ) );
        
        }
        { //::osiris::File::write
        
            typedef ::osiris::uint32 ( ::osiris::File::*write_function_type )( void const *,::osiris::uint32 ) ;
            typedef ::osiris::uint32 ( File_wrapper::*default_write_function_type )( void const *,::osiris::uint32 ) ;
            
            File_exposer.def( 
                "write"
                , write_function_type(&::osiris::File::write)
                , default_write_function_type(&File_wrapper::default_write)
                , ( ::boost::python::arg("v"), ::boost::python::arg("size") ) );
        
        }
        { //::osiris::File::seek
        
            typedef bool ( ::osiris::File::*seek_function_type )( ::osiris::uint64,::osiris::SeekPosition ) const;
            typedef bool ( File_wrapper::*default_seek_function_type )( ::osiris::uint64,::osiris::SeekPosition ) const;
            
            File_exposer.def( 
                "seek"
                , seek_function_type(&::osiris::File::seek)
                , default_seek_function_type(&File_wrapper::default_seek)
                , ( ::boost::python::arg("offset"), ::boost::python::arg("from") ) );
        
        }
        { //::osiris::File::position
        
            typedef ::osiris::uint64 ( ::osiris::File::*position_function_type )(  ) const;
            typedef ::osiris::uint64 ( File_wrapper::*default_position_function_type )(  ) const;
            
            File_exposer.def( 
                "position"
                , position_function_type(&::osiris::File::position)
                , default_position_function_type(&File_wrapper::default_position) );
        
        }
        { //::osiris::File::size
        
            typedef ::osiris::uint64 ( ::osiris::File::*size_function_type )(  ) const;
            typedef ::osiris::uint64 ( File_wrapper::*default_size_function_type )(  ) const;
            
            File_exposer.def( 
                "size"
                , size_function_type(&::osiris::File::size)
                , default_size_function_type(&File_wrapper::default_size) );
        
        }
        { //::osiris::File::flush
        
            typedef bool ( ::osiris::File::*flush_function_type )(  ) ;
            typedef bool ( File_wrapper::*default_flush_function_type )(  ) ;
            
            File_exposer.def( 
                "flush"
                , flush_function_type(&::osiris::File::flush)
                , default_flush_function_type(&File_wrapper::default_flush) );
        
        }
        { //::osiris::File::eof
        
            typedef bool ( ::osiris::File::*eof_function_type )(  ) const;
            typedef bool ( File_wrapper::*default_eof_function_type )(  ) const;
            
            File_exposer.def( 
                "eof"
                , eof_function_type(&::osiris::File::eof)
                , default_eof_function_type(&File_wrapper::default_eof) );
        
        }
        { //::osiris::File::getStats
        
            typedef boost::python::object ( *getStats_function_type )( ::osiris::File const &,::boost::posix_time::ptime *,::boost::posix_time::ptime *,::boost::posix_time::ptime * );
            
            File_exposer.def( 
                "getStats"
                , getStats_function_type( &File_wrapper::getStats )
                , ( ::boost::python::arg("inst"), ::boost::python::arg("timeCreation"), ::boost::python::arg("timeLastModify")=(nullptr), ::boost::python::arg("timeLastAccess")=(nullptr) ) );
        
        }
        { //::osiris::IStream::peek
        
            typedef ::osiris::uint32 ( ::osiris::IStream::*peek_function_type )( void *,::osiris::uint32 ) const;
            typedef ::osiris::uint32 ( File_wrapper::*default_peek_function_type )( void *,::osiris::uint32 ) const;
            
            File_exposer.def( 
                "peek"
                , peek_function_type(&::osiris::IStream::peek)
                , default_peek_function_type(&File_wrapper::default_peek)
                , ( ::boost::python::arg("v"), ::boost::python::arg("size") ) );
        
        }
        { //property "handle"[fget=::osiris::File::getHandle]
        
            typedef ::FILE * ( ::osiris::File::*fget )(  ) const;
            
            File_exposer.add_property( 
                "handle"
                , ::boost::python::make_function( 
                      fget( &::osiris::File::getHandle )
                    , bp::return_value_policy< bp::reference_existing_object >() ) 
                , "get property, built on top of \"FILE * osiris::File::getHandle() const [member function]\"" );
        
        }
        ::boost::python::register_ptr_to_python< boost::shared_ptr< ::osiris::File > >();
        ::boost::python::implicitly_convertible< boost::shared_ptr< ::osiris::File >, boost::shared_ptr< ::boost::noncopyable_::noncopyable > >();
        ::boost::python::implicitly_convertible< boost::shared_ptr< ::osiris::File >, boost::shared_ptr< ::osiris::Object > >();
        ::boost::python::implicitly_convertible< boost::shared_ptr< ::osiris::TextFile >, boost::shared_ptr< ::osiris::File > >();
    }

}
Exemple #4
0
 explicit output_stream(write_function_type write_f_ = write_function_type())
     : write_f(write_f_) {}
void register_Alignatum_class(){

    { //::alignlib::Alignatum
        typedef bp::class_< alignlib::Alignatum, bp::bases< alignlib::AlignlibBase >, boost::noncopyable > Alignatum_exposer_t;
        Alignatum_exposer_t Alignatum_exposer = Alignatum_exposer_t( "Alignatum", bp::no_init );
        bp::scope Alignatum_scope( Alignatum_exposer );
        { //::alignlib::Alignatum::addGaps
        
            typedef void ( ::alignlib::Alignatum::*addGaps_function_type )( int,int ) ;
            
            Alignatum_exposer.def( 
                "addGaps"
                , addGaps_function_type( &::alignlib::Alignatum::addGaps )
                , ( bp::arg("front"), bp::arg("back") ) );
        
        }
        { //::alignlib::Alignatum::fillAlignment
        
            typedef void ( ::alignlib::Alignatum::*fillAlignment_function_type )( ::alignlib::HAlignment &,bool const ) const;
            
            Alignatum_exposer.def( 
                "fillAlignment"
                , fillAlignment_function_type( &::alignlib::Alignatum::fillAlignment )
                , ( bp::arg("dest"), bp::arg("invert")=(bool const)(false) ) );
        
        }
        { //::alignlib::Alignatum::getAlignedLength
        
            typedef ::alignlib::Position ( ::alignlib::Alignatum::*getAlignedLength_function_type )(  ) const;
            
            Alignatum_exposer.def( 
                "getAlignedLength"
                , getAlignedLength_function_type( &::alignlib::Alignatum::getAlignedLength ) );
        
        }
        { //::alignlib::Alignatum::getClone
        
            typedef ::alignlib::HAlignatum ( ::alignlib::Alignatum::*getClone_function_type )(  ) const;
            
            Alignatum_exposer.def( 
                "getClone"
                , getClone_function_type( &::alignlib::Alignatum::getClone ) );
        
        }
        { //::alignlib::Alignatum::getFrom
        
            typedef ::alignlib::Position ( ::alignlib::Alignatum::*getFrom_function_type )(  ) const;
            
            Alignatum_exposer.def( 
                "getFrom"
                , getFrom_function_type( &::alignlib::Alignatum::getFrom ) );
        
        }
        { //::alignlib::Alignatum::getFullLength
        
            typedef ::alignlib::Position ( ::alignlib::Alignatum::*getFullLength_function_type )(  ) const;
            
            Alignatum_exposer.def( 
                "getFullLength"
                , getFullLength_function_type( &::alignlib::Alignatum::getFullLength ) );
        
        }
        { //::alignlib::Alignatum::getNew
        
            typedef ::alignlib::HAlignatum ( ::alignlib::Alignatum::*getNew_function_type )(  ) const;
            
            Alignatum_exposer.def( 
                "getNew"
                , getNew_function_type( &::alignlib::Alignatum::getNew ) );
        
        }
        { //::alignlib::Alignatum::getResidueNumber
        
            typedef ::alignlib::Position ( ::alignlib::Alignatum::*getResidueNumber_function_type )( ::alignlib::Position const,::alignlib::SearchType const ) const;
            
            Alignatum_exposer.def( 
                "getResidueNumber"
                , getResidueNumber_function_type( &::alignlib::Alignatum::getResidueNumber )
                , ( bp::arg("pos"), bp::arg("search")=::alignlib::NO_SEARCH ) );
        
        }
        { //::alignlib::Alignatum::getString
        
            typedef ::std::string const & ( ::alignlib::Alignatum::*getString_function_type )(  ) const;
            
            Alignatum_exposer.def( 
                "getString"
                , getString_function_type( &::alignlib::Alignatum::getString )
                , bp::return_value_policy< bp::copy_const_reference >() );
        
        }
        { //::alignlib::Alignatum::getTo
        
            typedef ::alignlib::Position ( ::alignlib::Alignatum::*getTo_function_type )(  ) const;
            
            Alignatum_exposer.def( 
                "getTo"
                , getTo_function_type( &::alignlib::Alignatum::getTo ) );
        
        }
        { //::alignlib::Alignatum::insertGaps
        
            typedef void ( ::alignlib::Alignatum::*insertGaps_function_type )( int,::alignlib::Position ) ;
            
            Alignatum_exposer.def( 
                "insertGaps"
                , insertGaps_function_type( &::alignlib::Alignatum::insertGaps )
                , ( bp::arg("position"), bp::arg("count")=(int)(1) ) );
        
        }
        { //::alignlib::Alignatum::isConsistent
        
            typedef bool ( ::alignlib::Alignatum::*isConsistent_function_type )(  ) const;
            
            Alignatum_exposer.def( 
                "isConsistent"
                , isConsistent_function_type( &::alignlib::Alignatum::isConsistent ) );
        
        }
        { //::alignlib::Alignatum::mapOnAlignment
        
            typedef void ( ::alignlib::Alignatum::*mapOnAlignment_function_type )( ::alignlib::HAlignment const &,::alignlib::Position const,bool const ) ;
            
            Alignatum_exposer.def( 
                "mapOnAlignment"
                , mapOnAlignment_function_type( &::alignlib::Alignatum::mapOnAlignment )
                , ( bp::arg("map_old2new"), bp::arg("new_length")=(int const)(0), bp::arg("unaligned_chars")=(bool const)(false) ) );
        
        }
        { //::alignlib::Alignatum::read
        
            typedef void ( ::alignlib::Alignatum::*read_function_type )( ::std::istream & ) ;
            
            Alignatum_exposer.def( 
                "read"
                , read_function_type( &::alignlib::Alignatum::read )
                , ( bp::arg("input") ) );
        
        }
        { //::alignlib::Alignatum::removeColumns
        
            typedef void ( ::alignlib::Alignatum::*removeColumns_function_type )( int,::alignlib::Position ) ;
            
            Alignatum_exposer.def( 
                "removeColumns"
                , removeColumns_function_type( &::alignlib::Alignatum::removeColumns )
                , ( bp::arg("position"), bp::arg("count")=(int)(1) ) );
        
        }
        { //::alignlib::Alignatum::removeEndGaps
        
            typedef void ( ::alignlib::Alignatum::*removeEndGaps_function_type )(  ) ;
            
            Alignatum_exposer.def( 
                "removeEndGaps"
                , removeEndGaps_function_type( &::alignlib::Alignatum::removeEndGaps ) );
        
        }
        { //::alignlib::Alignatum::write
        
            typedef void ( ::alignlib::Alignatum::*write_function_type )( ::std::ostream & ) const;
            
            Alignatum_exposer.def( 
                "write"
                , write_function_type( &::alignlib::Alignatum::write )
                , ( bp::arg("output") ) );
        
        }
        Alignatum_exposer.def( bp::self_ns::str( bp::self ) );
        bp::register_ptr_to_python< boost::shared_ptr< alignlib::Alignatum > >();
        bp::implicitly_convertible< boost::shared_ptr< alignlib::Alignatum >, boost::shared_ptr< alignlib::AlignlibBase > >();
    }

}