HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEO_IOTable.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: Geometry Library (C++)
7  *
8  * COMMENTS:
9  * This is a class used for importing/exporting different geometry
10  * file formats. There is a table of programs which can read
11  * or write different formats based on extension.
12  *
13  */
14 
15 #ifndef __GEO_IOTable_h__
16 #define __GEO_IOTable_h__
17 
18 #include "GEO_API.h"
19 #include "GEO_IOTranslator.h"
20 #include <GA/GA_Detail.h>
21 
22 class GEO_Detail;
23 
25 {
26 public:
29  , myTranslator(NULL)
30  {}
33  , myTranslator(src.myTranslator)
34  , myMagic(src.myMagic)
35  {}
36  virtual ~GEO_IOTable();
37 
38  virtual GEO_IOTranslator *duplicate() const;
39  virtual const char *formatName() const;
40 
41  // Method to check the extension of the name to see if it's one of these...
42  virtual int checkExtension(const char *name);
43  virtual int checkMagicNumber(unsigned magic);
44 
45  virtual GA_Detail::IOStatus fileLoad(GEO_Detail *, UT_IStream &, bool ate);
46  virtual GA_Detail::IOStatus fileSave(const GEO_Detail *, std::ostream &);
47  virtual GA_Detail::IOStatus fileSaveToFile(const GEO_Detail *gdp,
48  const char *filename);
49  virtual bool fileStat(const char *filename,
50  GA_Stat &stat,
51  uint level);
52 
53  /// Return the number of extensions which can be written to
54  static int getSaveFormatCount();
55  /// Return the Nth save format
56  static const char *getSaveFormat(int i);
57 
58  /// Return the number of formats loaded from the GEOio table
59  static int getFormatCount();
60  static const char *getFormatDescription(int i);
61  static void getFormatRW(int i, bool &can_read, bool &can_write);
62  static void getFormatExtensions(int i, UT_StringArray &extensions);
63 
64 private:
65  const void *myTranslator;
66  int myMagic;
67 };
68 #endif
virtual GA_Detail::IOStatus fileSaveToFile(const GEO_Detail *gdp, const char *filename)
GLint level
Definition: glcorearb.h:107
png_uint_32 i
Definition: png.h:2877
virtual GEO_IOTranslator * duplicate() const =0
This method is used to create a copy of the sub-class.
virtual GA_Detail::IOStatus fileLoad(GEO_Detail *gdp, UT_IStream &is, bool ate_magic)=0
#define GEO_API
Definition: GEO_API.h:10
GLuint const GLchar * name
Definition: glcorearb.h:785
GEO_IOTable(const GEO_IOTable &src)
Definition: GEO_IOTable.h:31
unsigned int uint
Definition: SYS_Types.h:39
Class to return information about a GA_Detail.
Definition: GA_Stat.h:50
virtual bool fileStat(const char *filename, GA_Stat &stat, uint level)
virtual const char * formatName() const =0
virtual int checkExtension(const char *name)=0
virtual int checkMagicNumber(unsigned magic)=0
virtual GA_Detail::IOStatus fileSave(const GEO_Detail *gdp, std::ostream &os)=0
GLenum src
Definition: glcorearb.h:1792