Introduction

Getting Started

Programming Guides

API Reference

Additional Resources

BPolyPoly.h
1 // Copyright (c) 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 
63  TK_Status analyze_dimensionality( BStreamFileToolkit & tk );
66  TK_Status figure_num_floats (BStreamFileToolkit & tk);
69  TK_Status validate_primitive_count (BStreamFileToolkit & tk);
72  TK_Status expand_lengths (BStreamFileToolkit & tk);
75  TK_Status mangle (BStreamFileToolkit & tk);
78  TK_Status unmangle (BStreamFileToolkit & tk);
81  TK_Status compute_trivial_points (BStreamFileToolkit & tk);
84  TK_Status process_trivial_points (BStreamFileToolkit & tk);
87  TK_Status compute_line_extend_points (BStreamFileToolkit & tk);
90  TK_Status process_line_extend_points (BStreamFileToolkit & tk);
93  TK_Status write_compressed_points (BStreamFileToolkit & tk);
96  TK_Status read_compressed_points (BStreamFileToolkit & tk);
99  TK_Status write_trivial_leftovers (BStreamFileToolkit & tk);
102  TK_Status read_trivial_leftovers (BStreamFileToolkit & tk);
103 
104  public:
106  TK_PolyPolypoint (unsigned char opcode);
107  ~TK_PolyPolypoint ();
108 
111  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
112 
113  TK_Status ReadAscii (BStreamFileToolkit & tk);
114  TK_Status WriteAscii (BStreamFileToolkit & tk);
115 
116  TK_Status Execute (BStreamFileToolkit & tk); /* non-default for tag processing */
117  void Reset ();
118 
124  TK_Status SetPoints (int point_count, float const points[] = 0);
130  TK_Status SetDPoints (int point_count, double const points[] = 0);
138  TK_Status SetLengths (int primitive_count, int const lengths[] = 0);
139 
142  enum Suboptions {
143  TKPP_COMPRESSED = 0x0001,
144  TKPP_HAS_EXPLICIT_PRIMITIVE_COUNT = 0x0002,
145  TKPP_ONE_PRIMITIVE_ONLY = 0x0004,
146  TKPP_GLOBAL_QUANTIZATION = 0x0008,
147  //break in sequence
148  TKPP_ZERO_X = 0x0100,
149  TKPP_SAME_X = 0x0200,
150  TKPP_PER_PRIMITIVE_X = 0x0300, //multibit
151  TKPP_ZERO_Y = 0x0400,
152  TKPP_SAME_Y = 0x0800,
153  TKPP_PER_PRIMITIVE_Y = 0x0C00, //multibit
154  TKPP_ZERO_Z = 0x1000,
155  TKPP_SAME_Z = 0x2000,
156  TKPP_PER_PRIMITIVE_Z = 0x3000, //multibit
157  TKPP_EXPANDED = 0x8000 //reserved for future use
158  };
159  #define TKPP_X_2D_MASK 0x0300
160  #define TKPP_Y_2D_MASK 0x0C00
161  #define TKPP_Z_2D_MASK 0x3000
162  #define TKPP_ANY_2D_MASK 0x3F00
163  #define TKPP_EXPLICIT_PRIMITIVE_MASK 0x0006
164 };
165 
166 #endif //BPOLYPOLY
167 
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_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:55
TK_Status
Codes which can be either passed to various toolkit functions, or indicate the result of a toolkit fu...
Definition: BStream.h:271
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:217
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:142
virtual TK_Status Write(BStreamFileToolkit &tk)=0