HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  ~GEO_IOTable() override;
37 
38  GEO_IOTranslator *duplicate() const override;
39  const char *formatName() const override;
40 
41  // Method to check the extension of the name to see if it's one of these...
42  int checkExtension(const char *name) override;
43  int checkMagicNumber(unsigned magic) override;
44 
46  bool ate) override;
47  GA_Detail::IOStatus fileSave(const GEO_Detail *, std::ostream &) override;
49  const char *filename) override;
50  bool fileStat(const char *filename,
51  GA_Stat &stat,
52  uint level) override;
53 
54  /// Return the number of extensions which can be written to
55  static int getSaveFormatCount();
56  /// Return the Nth save format
57  static const char *getSaveFormat(int i);
58 
59  /// Return the number of formats loaded from the GEOio table
60  static int getFormatCount();
61  static const char *getFormatDescription(int i);
62  static void getFormatRW(int i, bool &can_read, bool &can_write);
63  static void getFormatExtensions(int i, UT_StringArray &extensions);
64 
65 private:
66  const void *myTranslator;
67  int myMagic;
68 };
69 #endif
virtual GA_Detail::IOStatus fileSaveToFile(const GEO_Detail *gdp, const char *filename)
GT_API const UT_StringHolder filename
GLint level
Definition: glcorearb.h:107
GLuint const GLchar * name
Definition: glcorearb.h:785
GLenum src
Definition: glcorearb.h:1792
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:14
GEO_IOTable(const GEO_IOTable &src)
Definition: GEO_IOTable.h:31
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
unsigned int uint
Definition: SYS_Types.h:45
virtual GA_Detail::IOStatus fileSave(const GEO_Detail *gdp, std::ostream &os)=0