Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

BOpcodeShell.h
1 
2 //
3 // Copyright (c) 2000 by Tech Soft 3D, LLC.
4 // The information contained herein is confidential and proprietary to
5 // Tech Soft 3D, LLC., and considered a trade secret as defined under
6 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
7 // and criminal remedies in the event of unauthorized use or misappropriation
8 // of its trade secrets. Use of this information by anyone other than
9 // authorized employees of Tech Soft 3D, LLC. is granted only under a
10 // written non-disclosure agreement, expressly prescribing the scope and
11 // manner of such use.
12 //
13 // $Id: 322eac7b0a7a1c274b3253926bca39dfb0f8788a $
14 //
15 
16 #ifndef BBINFILETK_SHELL
17 #define BBINFILETK_SHELL
18 
19 #include "BOpcodeHandler.h"
20 #include "BPolyhedron.h"
21 
22 
23 
25 
31 class BBINFILETK_API TK_Shell : public TK_Polyhedron {
32  private:
33  virtual TK_Status read_advanced (BStreamFileToolkit & tk) alter;
34  virtual TK_Status read_uncompressed_points (BStreamFileToolkit & tk) alter;
35  virtual TK_Status read_uncompressed_faces (BStreamFileToolkit & tk) alter;
36  virtual TK_Status read_bounding (BStreamFileToolkit & tk) alter;
37 
38 
39 
40 
41  virtual TK_Status read_advanced_ascii (BStreamFileToolkit & tk) alter;
42  virtual TK_Status read_uncompressed_points_ascii (BStreamFileToolkit & tk) alter;
43  virtual TK_Status read_uncompressed_faces_ascii (BStreamFileToolkit & tk) alter;
44  virtual TK_Status read_bounding_ascii (BStreamFileToolkit & tk) alter;
45 
46 
47  virtual TK_Status compute_advanced (BStreamFileToolkit & tk) alter;
48  virtual TK_Status write_advanced (BStreamFileToolkit & tk) alter;
49  virtual TK_Status write_uncompressed_points (BStreamFileToolkit & tk) alter;
50  virtual TK_Status write_uncompressed_faces (BStreamFileToolkit & tk) alter;
51  virtual TK_Status write_bounding (BStreamFileToolkit & tk) alter;
52  TK_Status write_null (BStreamFileToolkit & tk) alter;
53 
54 
55 
56 
57 
58  virtual TK_Status write_advanced_ascii (BStreamFileToolkit & tk) alter;
59  virtual TK_Status write_uncompressed_points_ascii (BStreamFileToolkit & tk) alter;
60  virtual TK_Status write_uncompressed_faces_ascii (BStreamFileToolkit & tk) alter;
61  virtual TK_Status write_bounding_ascii (BStreamFileToolkit & tk) alter;
62  TK_Status write_null_ascii (BStreamFileToolkit & tk) alter;
63  TK_Status compute_advanced_ascii(BStreamFileToolkit & tk) alter ;
64 
65 
66  protected:
67  int m_substage;
68  unsigned char m_compression_scheme;
69  int m_flistlen;
70  int *m_flist;
71  char m_lodlevel;
110  TK_Status SetFaces( int length, int const *face_list = 0 ) alter;
112  TK_Status SetLodLevel( int level ) alter { m_lodlevel = (char)level; return TK_Normal; };
114  int const *GetFaces() const { return m_flist; };
116  int GetFacesLength() const { return m_flistlen; };
118  int GetLodLevel() const { return m_lodlevel; };
121  TK_Status EnumerateEdges();
122 
123  public:
124  TK_Shell ();
125  ~TK_Shell ();
126 
128  void set_flist (int count, int const * list = 0) alter { SetFaces( count, list ); };
129 
132 
133 
134  TK_Status ReadAscii (BStreamFileToolkit & tk) alter;
135  TK_Status WriteAscii(BStreamFileToolkit & tk) alter;
136 
137  void Reset () alter;
138 }; //end declaration of class TK_Shell
139 
140 
141 
142 /*
143  * SOME UTILITY MACROS
144  */
145 #define SEMI_PROTECT(x) do {x} while (0)
146 
147 //warning: implicitly references the BStreamFileToolkit &, tk
148 #define ENSURE_ALLOCATED(var,type,count) SEMI_PROTECT( \
149  delete [] (var); \
150  (var) = new type[(count)]; \
151  if( (var) == 0 ) \
152  return tk.Error(); \
153 )
154 
155 //warning: implicitly references the BStreamFileToolkit &, tk
156 #define ENSURE_ALLOCATED_CLEAR(var,type,count) SEMI_PROTECT( \
157  delete [] (var); \
158  (var) = new type[(count)]; \
159  if( (var) == 0 ) \
160  return tk.Error(); \
161  memset (var, 0, (count) * sizeof(type)); \
162 )
163 
164 #endif
Handles the TKE_Shell opcode.
Definition: BOpcodeShell.h:31
int m_substage
Definition: BOpcodeShell.h:67
Contains datatypes which are used by BBaseOpcodeHandler.
#define alter
complementary to const, indicates we thought about it instead of a forgotten "const" ...
Definition: BStream.h:225
The BStreamFileToolkit class provides support for importing/exporting HOOPS Stream File information...
Definition: BStreamFileToolkit.h:328
int m_flistlen
Definition: BOpcodeShell.h:69
int * m_flist
Definition: BOpcodeShell.h:70
char m_lodlevel
Definition: BOpcodeShell.h:71
int const * GetFaces() const
Definition: BOpcodeShell.h:114
virtual TK_Status Read(BStreamFileToolkit &tk) alter=0
int GetFacesLength() const
Definition: BOpcodeShell.h:116
Definition: BStream.h:238
int GetLodLevel() const
Definition: BOpcodeShell.h:118
TK_Status
Codes which can be either passed to various toolkit functions, or indicate the result of a toolkit fu...
Definition: BStream.h:237
void set_flist(int count, int const *list=0) alter
obsolete. Provided for compatibility
Definition: BOpcodeShell.h:128
virtual void Reset() alter
Base class for shell and mesh.
Definition: BPolyhedron.h:25
virtual TK_Status Write(BStreamFileToolkit &tk) alter=0
unsigned char m_compression_scheme
Definition: BOpcodeShell.h:68