Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

BPolyPoly.h
1 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef BPOLYPOLY
11 #define BPOLYPOLY
12 
13 #ifndef BBINFILETK_TOOLKIT
14  #include "BStreamFileToolkit.h"
15 #endif
16 
18 
37 class BBINFILETK_API TK_PolyPolypoint : public BBaseOpcodeHandler {
38  protected:
41  float * m_points;
42  double * m_dpoints;
47  int * m_lengths;
48  float m_bbox[6];
49  float m_dbbox[6];
50  int m_templen;
51  float m_temprange[2];
52  float m_dtemprange[2];
53  unsigned short m_subop;
54  unsigned char m_compression_scheme;
55  unsigned char * m_workspace;
59  int m_substage;
60  int m_progress;
61 
64  TK_Status analyze_dimensionality( BStreamFileToolkit & tk );
67  TK_Status figure_num_floats (BStreamFileToolkit & tk);
70  TK_Status validate_primitive_count (BStreamFileToolkit & tk);
73  TK_Status expand_lengths (BStreamFileToolkit & tk);
76  TK_Status mangle (BStreamFileToolkit & tk);
79  TK_Status unmangle (BStreamFileToolkit & tk);
82  TK_Status compute_trivial_points (BStreamFileToolkit & tk);
85  TK_Status process_trivial_points (BStreamFileToolkit & tk);
88  TK_Status compute_line_extend_points (BStreamFileToolkit & tk);
91  TK_Status process_line_extend_points (BStreamFileToolkit & tk);
94  TK_Status write_compressed_points (BStreamFileToolkit & tk);
97  TK_Status read_compressed_points (BStreamFileToolkit & tk);
100  TK_Status write_trivial_leftovers (BStreamFileToolkit & tk);
103  TK_Status read_trivial_leftovers (BStreamFileToolkit & tk);
104 
105  public:
107  TK_PolyPolypoint (unsigned char opcode);
108  ~TK_PolyPolypoint ();
109 
112  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
113 
114  TK_Status ReadAscii (BStreamFileToolkit & tk);
115  TK_Status WriteAscii (BStreamFileToolkit & tk);
116 
117  TK_Status Execute (BStreamFileToolkit & tk); /* non-default for tag processing */
118  void Reset ();
119 
125  TK_Status SetPoints (int point_count, float const * points = 0);
131  TK_Status SetDPoints (int point_count, double const * points = 0);
139  TK_Status SetLengths (int primitive_count, int const * lengths = 0);
140 
143  enum Suboptions {
144  TKPP_COMPRESSED = 0x0001,
145  TKPP_HAS_EXPLICIT_PRIMITIVE_COUNT = 0x0002,
146  TKPP_ONE_PRIMITIVE_ONLY = 0x0004,
147  TKPP_GLOBAL_QUANTIZATION = 0x0008,
148  //break in sequence
149  TKPP_ZERO_X = 0x0100,
150  TKPP_SAME_X = 0x0200,
151  TKPP_PER_PRIMITIVE_X = 0x0300, //multibit
152  TKPP_ZERO_Y = 0x0400,
153  TKPP_SAME_Y = 0x0800,
154  TKPP_PER_PRIMITIVE_Y = 0x0C00, //multibit
155  TKPP_ZERO_Z = 0x1000,
156  TKPP_SAME_Z = 0x2000,
157  TKPP_PER_PRIMITIVE_Z = 0x3000, //multibit
158  TKPP_EXPANDED = 0x8000 //reserved for future use
159  };
160  #define TKPP_X_2D_MASK 0x0300
161  #define TKPP_Y_2D_MASK 0x0C00
162  #define TKPP_Z_2D_MASK 0x3000
163  #define TKPP_ANY_2D_MASK 0x3F00
164  #define TKPP_EXPLICIT_PRIMITIVE_MASK 0x0006
165 };
166 
167 #endif //BPOLYPOLY
168 
int m_lengths_allocated
The number of array elements that we have allocated for primitive lengths.
Definition: BPolyPoly.h:46
int m_substage
tracks progress during helper functions
Definition: BPolyPoly.h:59
float * m_points
The points array.
Definition: BPolyPoly.h:41
virtual void Reset()
The BStreamFileToolkit class provides support for importing/exporting HOOPS Stream File information...
Definition: BStreamFileToolkit.h:367
int m_templen
the length of all stragglers left behind (e.g. an array of floats of length m_primitive_count if TKPP...
Definition: BPolyPoly.h:50
virtual TK_Status Read(BStreamFileToolkit &tk)=0
int m_points_num_dimensions
The number of unrestricted dimensions in the points array that must be completely specified...
Definition: BPolyPoly.h:44
unsigned char m_compression_scheme
If the TKPP_COMPRESSED bit is set in m_subop, this variable tracks the specific compression algorithm...
Definition: BPolyPoly.h:54
double * m_dpoints
The points array.
Definition: BPolyPoly.h:42
int m_points_num_floats
The number of independent floating point values required to specify the points array (equals m_point_...
Definition: BPolyPoly.h:43
unsigned char * m_workspace
Raw data after packing.
Definition: BPolyPoly.h:55
int m_progress
tracks progress during special situations
Definition: BPolyPoly.h:60
int m_points_allocated
The number of points for which we have allocated space (to save time, we only reallocate the points a...
Definition: BPolyPoly.h:40
unsigned short m_subop
Suboptions. Among other things, it specifies all 2d restrictions that can be made on the points...
Definition: BPolyPoly.h:53
int m_workspace_used
The amount of workspace area used.
Definition: BPolyPoly.h:56
The BBaseOpcodeHandler abstract class is used as a base for derived classes which manage logical piec...
Definition: BOpcodeHandler.h:53
TK_Status
Codes which can be either passed to various toolkit functions, or indicate the result of a toolkit fu...
Definition: BStream.h:242
int * m_lengths
The length of each primitive.
Definition: BPolyPoly.h:47
int m_point_count
The number of points.
Definition: BPolyPoly.h:39
virtual TK_Status Clone(BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
Definition: BOpcodeHandler.h:205
int m_primitive_count
The number of primitives. Omitted from read/write (it can be deduced from the lengths array) unless T...
Definition: BPolyPoly.h:45
int m_bits_per_sample
the number of bits per sample. Should be tk.GetNumVertexBits()/3
Definition: BPolyPoly.h:58
int m_workspace_allocated
The amount of workspace area allocated.
Definition: BPolyPoly.h:57
virtual TK_Status Execute(BStreamFileToolkit &tk)
Handles the TKE_PolyPolyline opcode.
Definition: BPolyPoly.h:37
Suboptions
Definition: BPolyPoly.h:143
virtual TK_Status Write(BStreamFileToolkit &tk)=0