Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
vtSOG.h
1 //
2 // vtSOG.h
3 //
4 // header for vtlib implementation of SOG file IO.
5 //
6 
7 #ifndef VTSOGH
8 #define VTSOGH
9 
10 #include <stdio.h>
11 #include "vtdata/SOG.h"
12 #include "vtdata/vtString.h"
13 
20 class InputSOG
21 {
22 public:
23  bool ReadHeader(FILE *fp, int &num_geom);
24  bool ReadContents(FILE *fp, vtGroup *Parent);
25 
26 private:
27  bool Read(FILE *fp, short &token, short &len);
28  bool ReadBool(FILE *fp);
29  vtMaterial *ReadMaterial(FILE *fp);
30  vtMesh *ReadMesh(FILE *fp);
31  vtGeode *ReadGeometry(FILE *fp, vtMaterialArray *pMats);
32 };
33 
40 class OutputSOG
41 {
42 public:
43  void WriteHeader(FILE *fp);
44  void WriteSingleGeometry(FILE *fp, const vtGeode *pGeode);
45  void WriteMultiGeometry(FILE *fp, const vtGroup *pParent);
46 
47 private:
48  void Write(FILE *fp, FileToken ft, RGBf &rgb);
49  void Write(FILE *fp, FileToken ft, RGBAf &rgba);
50  void Write(FILE *fp, FileToken ft, bool &b);
51  void Write(FILE *fp, FileToken ft, vtString &str);
52  void Write(FILE *fp, FileToken ft, short &s1);
53  void Write(FILE *fp, FileToken ft, FPoint3 &p);
54  void Write(FILE *fp, FileToken ft, FPoint2 &p);
55  void WriteToken(FILE *fp, FileToken ft, short length);
56 
57  void WriteGeometry(FILE *fp, const vtGeode *pGeode, short id);
58  void WriteMaterials(FILE *fp, const vtMaterialArray *pMats);
59  void WriteMaterial(FILE *fp, const vtMaterial *pMat);
60  void WriteMesh(FILE *fp, const vtMesh *pMesh);
61 };
62 
63 #endif // VTSOGH
64 
65