HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_IOTranslator Class Referenceabstract

#include <GEO_IOTranslator.h>

+ Inheritance diagram for GEO_IOTranslator:

Public Types

typedef UT_StringMap
< UT_StringHolder
geo_DSODefinitions
 

Public Member Functions

 GEO_IOTranslator ()
 
virtual ~GEO_IOTranslator ()
 
virtual GEO_IOTranslatorduplicate () const =0
 This method is used to create a copy of the sub-class. More...
 
virtual const char * formatName () const =0
 
virtual int checkExtension (const char *name)=0
 
virtual void getFileExtensions (UT_StringArray &extensions) const
 
virtual int checkMagicNumber (unsigned magic)=0
 
virtual bool fileStat (const char *filename, GA_Stat &stat, uint level)
 
virtual GA_Detail::IOStatus fileLoad (GEO_Detail *gdp, UT_IStream &is, bool ate_magic)=0
 
virtual GA_Detail::IOStatus fileSave (const GEO_Detail *gdp, std::ostream &os)=0
 
virtual GA_Detail::IOStatus fileSaveToFile (const GEO_Detail *gdp, const char *filename)
 

Static Public Member Functions

static const geo_DSODefinitionsdsoDefinitions ()
 Return the list of DSO based translators. More...
 

Protected Member Functions

bool statJSONStream (UT_IStream &is, GA_Stat &stat, uint level) const
 Stat a .bgeo JSON stream. More...
 
void eraseDSODefinition ()
 

Detailed Description

Member Typedef Documentation

Define a map where the key is the IOTranslator format name and the value is the DSO file defining the translator. Built-in translators don't appear in this list.

Definition at line 30 of file GEO_IOTranslator.h.

Constructor & Destructor Documentation

GEO_IOTranslator::GEO_IOTranslator ( )
virtual GEO_IOTranslator::~GEO_IOTranslator ( )
virtual

Member Function Documentation

virtual int GEO_IOTranslator::checkExtension ( const char *  name)
pure virtual

Method to check the extension of the name to see if it matches one that we can handle. Returns true if there's a match

Implemented in GEO_IORib, GusdGEO_IOTranslator, GEO_IOBpoly, and GEO_IOTable.

virtual int GEO_IOTranslator::checkMagicNumber ( unsigned  magic)
pure virtual

Method to check if the given magic number matches the magic number. Return true on a match.

Implemented in GEO_IORib, GusdGEO_IOTranslator, GEO_IOBpoly, and GEO_IOTable.

static const geo_DSODefinitions& GEO_IOTranslator::dsoDefinitions ( )
static

Return the list of DSO based translators.

virtual GEO_IOTranslator* GEO_IOTranslator::duplicate ( ) const
pure virtual

This method is used to create a copy of the sub-class.

Implemented in GEO_IORib, GusdGEO_IOTranslator, GEO_IOBpoly, and GEO_IOTable.

void GEO_IOTranslator::eraseDSODefinition ( )
virtual GA_Detail::IOStatus GEO_IOTranslator::fileLoad ( GEO_Detail gdp,
UT_IStream is,
bool  ate_magic 
)
pure virtual

Method to load from a stream. If the ate_magic flag is on, then the library has already read the magic number and the loader should not expect it. If the file format doesn't support reading from streams, it can use UT_IStream::isRandomAccessFile to get the raw name to read from. Return false if this translator doesn't support loading.

Implemented in GEO_IORib, GusdGEO_IOTranslator, GEO_IOBpoly, and GEO_IOTable.

virtual GA_Detail::IOStatus GEO_IOTranslator::fileSave ( const GEO_Detail gdp,
std::ostream &  os 
)
pure virtual

Method to save a gdp to another format. Return false if this translator does not support saving.

Implemented in GusdGEO_IOTranslator, GEO_IORib, GEO_IOBpoly, and GEO_IOTable.

virtual GA_Detail::IOStatus GEO_IOTranslator::fileSaveToFile ( const GEO_Detail gdp,
const char *  filename 
)
virtual

Method to save a gdp to another format via a filename. Return false if this translator does not support saving.

This is an optional method. By default, it will create a stream and call the streaming version of fileSave().

Reimplemented in GEO_IOTable.

virtual bool GEO_IOTranslator::fileStat ( const char *  filename,
GA_Stat stat,
uint  level 
)
virtual

Method to "stat" a file. If possible, stat shouldn't have to load the entire geometry.

Reimplemented in GEO_IOTable.

virtual const char* GEO_IOTranslator::formatName ( ) const
pure virtual

Returns the label for the geometry format that this translator supports.

Implemented in GEO_IORib, GusdGEO_IOTranslator, GEO_IOBpoly, and GEO_IOTable.

virtual void GEO_IOTranslator::getFileExtensions ( UT_StringArray extensions) const
virtual

Method to return a list of the file extensions matched by this translator. The strings should contain the extensions (with dots). For exmple [".eps", ".ai"]. The default method returns nothing.

Reimplemented in GusdGEO_IOTranslator.

bool GEO_IOTranslator::statJSONStream ( UT_IStream is,
GA_Stat stat,
uint  level 
) const
protected

Stat a .bgeo JSON stream.


The documentation for this class was generated from the following file: