Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

HTK_PolyPolypoint Class Reference

Provides HOOPS/3dGS-specific handling of the TKE_Polyline and TKE_Line opcodes. More...

#include <HPolyPoly.h>

Public Member Functions

TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
 
TK_Status Execute (BStreamFileToolkit &tk)
 
 HTK_PolyPolypoint (unsigned char op)
 
TK_Status Interpret (BStreamFileToolkit &tk, ID_Key key, int variant=-1)
 
TK_Status Interpret (BStreamFileToolkit &tk, ID_Key key, char const *special)
 
void Reset ()
 
- Public Member Functions inherited from TK_PolyPolypoint
TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
 
TK_Status Execute (BStreamFileToolkit &tk)
 
TK_Status Read (BStreamFileToolkit &tk)
 
TK_Status ReadAscii (BStreamFileToolkit &tk)
 
void Reset ()
 
TK_Status SetDPoints (int point_count, double const *points=0)
 
TK_Status SetLengths (int primitive_count, int const *lengths=0)
 
TK_Status SetPoints (int point_count, float const *points=0)
 
 TK_PolyPolypoint (unsigned char opcode)
 
TK_Status Write (BStreamFileToolkit &tk)
 
TK_Status WriteAscii (BStreamFileToolkit &tk)
 
- Public Member Functions inherited from BBaseOpcodeHandler
 BBaseOpcodeHandler (int op)
 
unsigned char General_Flags () const
 
char const * GetLoggingString () const
 
char * GetLoggingString ()
 
void LogDebug (BStreamFileToolkit &tk, char const *string=0)
 
virtual bool Match_Instance (BStreamFileToolkit const &tk, Recorded_Instance *instance)
 
virtual bool NeedsContext (BStreamFileToolkit &tk) const
 
bool NeedsTag () const
 
unsigned char Opcode () const
 
int Pass (BStreamFileToolkit &tk) const
 
void Set_General_Flags (int f)
 
void SetLoggingString (char const *segment)
 
void SetLoggingString (int length)
 
void SetNeedsTag (bool n)
 
TK_Status Tag (BStreamFileToolkit &tk, int variant=-1) const
 
bool Tagging (BStreamFileToolkit &tk) const
 
- Public Member Functions inherited from BControlledMemoryObject
void operator delete (void *p)
 force deallocation to happen in the stream toolkit's scope
 
void * operator new (size_t size)
 force allocation to happen in the stream toolkit's scope
 

Protected Attributes

HC_KEYm_keys
 list of entities keys
 
- Protected Attributes inherited from TK_PolyPolypoint
float m_bbox [6]
 A bounding box around the unrestricted dimensions. If the data is 2d, only the first 4 values are used, and it becomes a bounding rectangle.
 
int m_bits_per_sample
 the number of bits per sample. Should be tk.GetNumVertexBits()/3
 
unsigned char m_compression_scheme
 If the TKPP_COMPRESSED bit is set in m_subop, this variable tracks the specific compression algorithm used.
 
float m_dbbox [6]
 A bounding box around the unrestricted dimensions. If the data is 2d, only the first 4 values are used, and it becomes a bounding rectangle.
 
double * m_dpoints
 The points array.
 
float m_dtemprange [2]
 1d bounds of the stragglers
 
int * m_lengths
 The length of each primitive.
 
int m_lengths_allocated
 The number of array elements that we have allocated for primitive lengths.
 
int m_point_count
 The number of points.
 
float * m_points
 The points array.
 
int m_points_allocated
 The number of points for which we have allocated space (to save time, we only reallocate the points array if it needs to be expanded, not on every call to Reset()).
 
int m_points_num_dimensions
 The number of unrestricted dimensions in the points array that must be completely specified.
 
int m_points_num_floats
 The number of independent floating point values required to specify the points array (equals m_point_count*3 for 3d data, but less for 2d)
 
int m_primitive_count
 The number of primitives. Omitted from read/write (it can be deduced from the lengths array) unless TKPP_HAS_EXPLICIT_PRIMITIVE_COUNT bit is set.
 
int m_progress
 tracks progress during special situations
 
unsigned short m_subop
 Suboptions. Among other things, it specifies all 2d restrictions that can be made on the points. Be careful when testing for the 2d bits, because some have multiple bits set. For this reason, you should use the form if((m_subop & mask) == value) instead of if(m_subop & bit)
 
int m_substage
 tracks progress during helper functions
 
int m_templen
 the length of all stragglers left behind (e.g. an array of floats of length m_primitive_count if TKPP_PER_PRIMITIVE_X subop bit is set)
 
float m_temprange [2]
 1d bounds of the stragglers
 
unsigned char * m_workspace
 Raw data after packing.
 
int m_workspace_allocated
 The amount of workspace area allocated.
 
int m_workspace_used
 The amount of workspace area used.
 
- Protected Attributes inherited from BBaseOpcodeHandler
char * m_ascii_buffer
 
int m_ascii_length
 
int m_ascii_progress
 Tracks the amount of data that has been read/written so far by GetAscii functions.
 
int m_ascii_size
 
int m_ascii_stage
 
unsigned char m_byte
 temporary
 
char m_char
 temporary
 
int m_debug_allocated
 
int m_debug_length
 
char * m_debug_string
 
unsigned char m_general_flags
 Basic flags common to many handlers.
 
int m_int
 temporary
 
bool m_needs_tag
 Indicate if this object explicitly needs tagging.
 
unsigned char m_opcode
 The opcode being handled by this particular object.
 
int m_progress
 Tracks the amount of data that has been read/written so far.
 
int m_stage
 The writing stage.
 
unsigned short m_unsigned_short
 temporary
 

Additional Inherited Members

- Public Types inherited from TK_PolyPolypoint
enum  Suboptions {
  TKPP_COMPRESSED = 0x0001, TKPP_HAS_EXPLICIT_PRIMITIVE_COUNT = 0x0002, TKPP_ONE_PRIMITIVE_ONLY = 0x0004, TKPP_GLOBAL_QUANTIZATION = 0x0008,
  TKPP_ZERO_X = 0x0100, TKPP_SAME_X = 0x0200, TKPP_PER_PRIMITIVE_X = 0x0300, TKPP_ZERO_Y = 0x0400,
  TKPP_SAME_Y = 0x0800, TKPP_PER_PRIMITIVE_Y = 0x0C00, TKPP_ZERO_Z = 0x1000, TKPP_SAME_Z = 0x2000,
  TKPP_PER_PRIMITIVE_Z = 0x3000, TKPP_EXPANDED = 0x8000
}
 
- Protected Member Functions inherited from TK_PolyPolypoint
TK_Status analyze_dimensionality (BStreamFileToolkit &tk)
 
TK_Status compute_line_extend_points (BStreamFileToolkit &tk)
 
TK_Status compute_trivial_points (BStreamFileToolkit &tk)
 
TK_Status expand_lengths (BStreamFileToolkit &tk)
 
TK_Status figure_num_floats (BStreamFileToolkit &tk)
 
TK_Status mangle (BStreamFileToolkit &tk)
 
TK_Status process_line_extend_points (BStreamFileToolkit &tk)
 
TK_Status process_trivial_points (BStreamFileToolkit &tk)
 
TK_Status read_compressed_points (BStreamFileToolkit &tk)
 
TK_Status read_trivial_leftovers (BStreamFileToolkit &tk)
 
TK_Status unmangle (BStreamFileToolkit &tk)
 
TK_Status validate_primitive_count (BStreamFileToolkit &tk)
 
TK_Status write_compressed_points (BStreamFileToolkit &tk)
 
TK_Status write_trivial_leftovers (BStreamFileToolkit &tk)
 
- Protected Member Functions inherited from BBaseOpcodeHandler
void add_segment (BStreamFileToolkit &tk, ID_Key key)
 for internal use only
 
void adjust_written (BStreamFileToolkit &tk, int count)
 for internal use only
 
void bytes_to_floats (unsigned char const *in, float *out, int count) const
 for internal use only
 
void decrease_nesting (BStreamFileToolkit &tk, int amount=1)
 for internal use only
 
bool Find_Instance (BStreamFileToolkit &tk, int val1, int val2, int val3)
 
bool Find_Item (BStreamFileToolkit &tk, ID_Key key) const
 
void fix (int *i, int n)
 for internal use only
 
void fix (short *s, int n)
 for internal use only
 
void fix_in (float *f, int n)
 for internal use only
 
void fix_in (double *d, int n)
 for internal use only
 
void fix_out (float *f, int n)
 for internal use only
 
void fix_out (double *d, int n)
 for internal use only
 
short flip (short s)
 for internal use only
 
int flip (int i)
 for internal use only
 
void floats_to_bytes (float const *in, unsigned char *out, int count) const
 for internal use only
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, int *rInts, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned char &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, char &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned short &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, short &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, int &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, float &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, float *rFloats, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, char *m_string, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned char *m_string, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, int *rInts, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, short *rShorts, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned short *rShorts, unsigned int n)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, unsigned char &value)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, int &value)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, char &value)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, unsigned short &value)
 
TK_Status GetAsciiImageData (BStreamFileToolkit &tk, const char *tag, unsigned char *rValues, unsigned int n)
 
TK_Status GetData (BStreamFileToolkit &tk, char *b, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, short *s, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, int *i, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, float *f, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, double *d, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned char *b, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned short *s, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned int *i, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, char &c)
 
TK_Status GetData (BStreamFileToolkit &tk, short &s)
 
TK_Status GetData (BStreamFileToolkit &tk, int &i)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned char &b)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned short &s)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned int &i)
 
TK_Status GetData (BStreamFileToolkit &tk, float &f)
 
TK_Status GetData (BStreamFileToolkit &tk, double &d)
 
TK_Status GetGeneral (BStreamFileToolkit &tk)
 
void increase_nesting (BStreamFileToolkit &tk, int amount=1)
 for internal use only
 
ID_Key last_key (BStreamFileToolkit &tk) const
 obsolete
 
void log_opcode (BStreamFileToolkit &tk, unsigned int sequence, unsigned char opcode)
 for internal use only
 
TK_Status LookatData (BStreamFileToolkit &tk, unsigned char &b)
 
BBaseOpcodeHandlerOpcode_Handler (BStreamFileToolkit &tk, unsigned char op) const
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, char const *b, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, short const *s, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, int const *i, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, float const *f, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned char const *b, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned short const *s, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned int const *i, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, char const &c)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, short const &s)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned char const &b)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned short const &s)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned int const &i)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, float const &f)
 
TK_Status PutAsciiFlag (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiHex (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiMask (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiOpcode (BStreamFileToolkit &tk, int adjust=1, bool is_end=false, bool want_newline=true)
 
TK_Status PutData (BStreamFileToolkit &tk, char const *b, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, short const *s, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, int const *i, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, float const *f, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, double const *d, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned char const *b, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned short const *s, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned int const *i, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, char const &c)
 
TK_Status PutData (BStreamFileToolkit &tk, short const &s)
 
TK_Status PutData (BStreamFileToolkit &tk, int const &i)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned char const &b)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned short const &s)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned int const &i)
 
TK_Status PutData (BStreamFileToolkit &tk, float const &f)
 
TK_Status PutData (BStreamFileToolkit &tk, double const &d)
 
TK_Status PutEndXMLTag (BStreamFileToolkit &tk, char const *tag)
 
TK_Status PutGeneral (BStreamFileToolkit &tk)
 
TK_Status PutOpcode (BStreamFileToolkit &tk, int adjust=1)
 
TK_Status PutStartXMLTag (BStreamFileToolkit &tk, char const *tag)
 
TK_Status Read_Referenced_Segment (BStreamFileToolkit &tk, int &i_progress)
 
TK_Status ReadAsciiLine (BStreamFileToolkit &tk, unsigned int *readSize=0)
 
TK_Status ReadAsciiWord (BStreamFileToolkit &tk, unsigned int *readSize=0)
 
TK_Status ReadEndOpcode (BStreamFileToolkit &tk)
 
void Record_Instance (BStreamFileToolkit &tk, ID_Key key, int variant, int val1, int val2, int val3) const
 
void Remember_Item (BStreamFileToolkit &tk, ID_Key key) const
 
ID_Key remove_segment (BStreamFileToolkit &tk)
 for internal use only
 
bool RemoveAngularBrackets (char *string)
 
bool RemoveQuotes (char *string)
 
void Revisit (BStreamFileToolkit &tk, float priority=0.0f, int variant=0) const
 
void set_last_key (BStreamFileToolkit &tk, ID_Key key)
 sets the given key as "most recent" on the toolkit for the purposes of associating keys with indices
 
TK_Status SkipNewlineAndTabs (BStreamFileToolkit &tk, unsigned int *readSize=0)
 
bool validate_count (int count, int limit=1<< 24) const
 
- Static Protected Member Functions inherited from BBaseOpcodeHandler
static float read_float (char const *cp, char const **newcpp=0)
 
static float read_float (char const *cp, char **newcpp)
 for internal use only
 
static char * write_float (char *buffer, double f)
 for internal use only
 

Detailed Description

Provides HOOPS/3dGS-specific handling of the TKE_Polyline and TKE_Line opcodes.

This class complements the read/write functionality implemented in the base class by overloading the Interpret and Execute methods to provide HOOPS/3dGS-specific opcode handling.

The Interpret phase of this opcode is a little unusual. Since we are dealing with multiple primitives, instead of just one, Interpret operates on all of the geometry in the currently open segment, rather than what is specified as part of its "key" parameter. The "key" that is currently passed into interpret refers to the first line or polyline that was encountered by the segment tree traversal, but we need to get all of the lines and polylines in the segment.

Writing: The HOOPS/3dGS database is queried in the Interpret method, and this data is then written to the HSF file by the Write method Reading: The data is read from the HSF file by the Read method, and is mapped to the HOOPS/3dGS scene-graph within the Execute method.

Export/import of additional user-data (which is associated with this HSF object) would typically be done by overloading the Write and Read methods.

Constructor & Destructor Documentation

HTK_PolyPolypoint::HTK_PolyPolypoint ( unsigned char  op)
inline

constructor

Member Function Documentation

TK_Status HTK_PolyPolypoint::Clone ( BStreamFileToolkit tk,
BBaseOpcodeHandler **  handler 
) const
virtual

Copies the opcode handler

Parameters
tkA reference to the BStreamFileToolkit object.
handlerA pointer to the opcode handler object. Passed by reference.
Returns
The result of the function call.

Reimplemented from BBaseOpcodeHandler.

TK_Status HTK_PolyPolypoint::Execute ( BStreamFileToolkit tk)
virtual

Processes the binary data that has been read for the current object, which involves passing the data to application-specific data structures.

Parameters
tkA reference to the BStreamFileToolkit object.
Returns
The result of the function call.

Reimplemented from BBaseOpcodeHandler.

TK_Status HTK_PolyPolypoint::Interpret ( BStreamFileToolkit tk,
ID_Key  key,
int  variant = -1 
)
virtual

Extracts graphics data (typically from the application's scene-graph) and maps it to the opcode handler's data members in preparation for writing out an object to the file.

Parameters
tkA reference to the BStreamFileToolkit object.
keyAn identifier to the object (for example, the HOOPS key of a geometry item)
variantoptional specification of an alternate form, such as a Level-of-Detail representation
Returns
The result of the function call.

Reimplemented from BBaseOpcodeHandler.

TK_Status HTK_PolyPolypoint::Interpret ( BStreamFileToolkit tk,
ID_Key  key,
char const *  special 
)
inlinevirtual

Extracts graphics data (typically from the application's scene-graph) and maps it to the opcode handler's data members in preparation for writing out an object to the file.

Parameters
tkA reference to the BStreamFileToolkit object.
keyAn identifier to the object (for example, the HOOPS key of a geometry item)
specialA string value of particular data
Returns
The result of the function call.

Reimplemented from BBaseOpcodeHandler.

References BBaseOpcodeHandler::Interpret().

void HTK_PolyPolypoint::Reset ( )
inlinevirtual

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.

Reimplemented from BBaseOpcodeHandler.

References TK_PolyPolypoint::Reset().


The documentation for this class was generated from the following file: