示例#1
0
void MemoryAdapter::write( Dataset* dataset )
{
    if ( requiresWrite() ) {
        writeImplementation( dataset );
        mNeedsUpdate = false;
    }
}
void BaseClassWriter::writeServer(bool skipDateCheck)
{
    QString baseClassName = mClassName + "ServerBase";
    if (skipDateCheck || needsGeneration(baseClassName)) {
        writeHeader(baseClassName, false);
        writeImplementation(baseClassName, false);
    } else {
        qWarning() << "Server source and header is newer than definition "
                      "file; omiting file generation";
    }
}
示例#3
0
 virtual WriteResult writeObject( const osg::Object& obj, const std::string& file, const Options* options ) const
 {
     std::string ext = osgDB::getFileExtension(file);
     if ( !acceptsExtension(ext) ) return WriteResult::FILE_NOT_HANDLED;
     
     struct WriteObjectOperator : public WriteOperator
     {
         virtual WriteResult write( osgDB::ReaderWriter* rw, const osg::Object* obj, std::stringstream& out, const Options* opt ) const
         {
             return obj ? rw->writeObject(*obj, out, opt) : WriteResult::FILE_NOT_HANDLED;
         }
     };
     osg::ref_ptr<osgDB::Options> realOptions = createOptionsFromName(file, options);
     return writeImplementation(&obj, file, realOptions.get(), WriteObjectOperator());
 }
示例#4
0
 virtual WriteResult writeHeightField( const osg::HeightField& hf, const std::string& file, const Options* options ) const
 {
     std::string ext = osgDB::getFileExtension(file);
     if ( !acceptsExtension(ext) ) return WriteResult::FILE_NOT_HANDLED;
     
     struct WriteHeightFieldOperator : public WriteOperator
     {
         virtual WriteResult write( osgDB::ReaderWriter* rw, const osg::Object* obj, std::stringstream& out, const Options* opt ) const
         {
             const osg::HeightField* hf = dynamic_cast<const osg::HeightField*>(obj);
             return hf ? rw->writeHeightField(*hf, out, opt) : WriteResult::FILE_NOT_HANDLED;
         }
     };
     osg::ref_ptr<osgDB::Options> realOptions = createOptionsFromName(file, options);
     return writeImplementation(&hf, file, realOptions.get(), WriteHeightFieldOperator());
 }