TK_PolyPolypoint
Types
Suboptions |
Fields
TKPP_COMPRESSED |
|
TKPP_HAS_EXPLICIT_PRIMITIVE_COUNT |
|
TKPP_ONE_PRIMITIVE_ONLY |
|
TKPP_GLOBAL_QUANTIZATION |
|
TKPP_ZERO_X |
|
TKPP_SAME_X |
|
TKPP_PER_PRIMITIVE_X |
|
TKPP_ZERO_Y |
|
TKPP_SAME_Y |
|
TKPP_PER_PRIMITIVE_Y |
|
TKPP_ZERO_Z |
|
TKPP_SAME_Z |
|
TKPP_PER_PRIMITIVE_Z |
|
TKPP_EXPANDED |
Functions
Detailed Description
-
class
TK_PolyPolypoint
: public BBaseOpcodeHandler Handles the TKE_PolyPolyline opcode.
TK_Polypoint provides support for writing/reading the TKE_PolyPolyline opcode objects to/from an HSF file.
TKE_PolyPolyline is an alternative to TKE_Polyline and TKE_Line. It is a more compressed way of handling large numbers of polylines and lines. The idea is that by grouping primitives together, better compression algorithms can be run for them. This class utilizes some of the same compression schemes that are implemented in TK_Shell.
This class is especially optimal for dealing with 2d data. With all of the 12 combinations (“zero”, “constant”, “per-primitive” or “unrestricted” along any of the 3 standard axes X, Y and/or Z), we leverage the restrictions that we can make to compress as deeply as possible. There is no provision for point data that is “mostly” 2d, however, so such data will be encoded as 3d. For this reason, performance will improve if all 2d lines and polylines can be put in a segment or segments that are separate from any 3d line data.
The HOOPS/3dGS scene-graph supports ‘polyline’ and ‘polygon’ primitives which are both defined by a point count and points array.
Public Types
-
enum
Suboptions
a few control values, and a lot of bits to indicate degenerate dimensions (which can be either omitted completely or only partially specified).
Values:
-
enumerator
TKPP_COMPRESSED
-
enumerator
TKPP_HAS_EXPLICIT_PRIMITIVE_COUNT
-
enumerator
TKPP_ONE_PRIMITIVE_ONLY
-
enumerator
TKPP_GLOBAL_QUANTIZATION
-
enumerator
TKPP_ZERO_X
-
enumerator
TKPP_SAME_X
-
enumerator
TKPP_PER_PRIMITIVE_X
-
enumerator
TKPP_ZERO_Y
-
enumerator
TKPP_SAME_Y
-
enumerator
TKPP_PER_PRIMITIVE_Y
-
enumerator
TKPP_ZERO_Z
-
enumerator
TKPP_SAME_Z
-
enumerator
TKPP_PER_PRIMITIVE_Z
-
enumerator
TKPP_EXPANDED
-
enumerator
Public Functions
-
TK_PolyPolypoint
(unsigned char opcode) constructor
-
~TK_PolyPolypoint
()
-
virtual TK_Status
Read
(BStreamFileToolkit &tk) Reads data from the toolkit buffer, decodes/decompresses it, and maps it to the opcode handlers data members. User-defined classes which need to write out custom data should utilize one of the available GetData() methods.
Parameters: tk – A reference to the BStreamFileToolkit object. Returns: The result of the function call.
-
virtual TK_Status
Write
(BStreamFileToolkit &tk) Encodes/compresses data and writes data to the toolkit buffer. User-defined classes which need to write out custom data should utilize one of the available PutData() methods, and first write out the opcode associated with the group of binary data followed by the data itself.
Parameters: tk – A reference to the BStreamFileToolkit object. Returns: The result of the function call.
-
virtual TK_Status
Clone
(BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const Copies the opcode handler
Parameters: - tk – A reference to the BStreamFileToolkit object.
- handler – A pointer to the opcode handler object. Passed by reference.
Returns: The result of the function call.
-
TK_Status
ReadAscii
(BStreamFileToolkit &tk)
-
TK_Status
WriteAscii
(BStreamFileToolkit &tk)
-
virtual TK_Status
Execute
(BStreamFileToolkit &tk) Processes the binary data that has been read for the current object, which involves passing the data to application-specific data structures.
Parameters: tk – A reference to the BStreamFileToolkit object. Returns: The result of the function call.
-
virtual void
Reset
() Resets the current opcode handler. This is called by the toolkit when it is done processing an opcode. This method reinitializes any opcode handler variables and frees up temporary data.
-
TK_Status
SetPoints
(int point_count, float const points[] = 0) Sets the point array. Allocates a buffer which will hold ‘point_count’ float triplets, and if specified, copies the ‘points’ into the buffer
Parameters: - point_count – the aggregate total number of points in this instance of the opcode.
- points – if provided, the actual floating-point values of the vertices.
Returns: a status value to indicate success or failure.
-
TK_Status
SetDPoints
(int point_count, double const points[] = 0) Sets the double-precision point array. Allocates a buffer which will hold ‘point_count’ double triplets, and if specified, copies the ‘points’ into the buffer
Parameters: - point_count – the aggregate total number of points in this instance of the opcode.
- points – if provided, the actual double-precision floating-point values of the vertices.
Returns: a status value to indicate success or failure.
-
TK_Status
SetLengths
(int primitive_count, int const lengths[] = 0) Sets the lengths array. Allocates a buffer which will hold ‘primitive_count’ integers, and if specified, copies the ‘lengths’ into the buffer.
Parameters: - primitive_count – the number of polylines that this instance of the opcode handler contains.
- lengths – if provided, an array with point_count values to provide the length (number of vertices) of each polyline. If not provided, all lengths are initialized to zero (just assume that they will be set at some other time.
Returns: a status value to indicate success or failure.
-
enum