Public Member Functions | Protected Attributes | List of all members
TK_Heuristics Class Reference

Handles the TKE_Heuristics opcode. More...

#include <BOpcodeHandler.h>

Public Member Functions

TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
 
int GetCulling () const
 
int GetExtras () const
 
int GetForceDefer () const
 
int GetHardExtent () const
 
int GetInternalPolylineSelectionLimit () const
 
int GetInternalSelectionLimit () const
 
int GetInternalShellSelectionLimit () const
 
int GetMask () const
 
float GetMaxDistance () const
 
int GetMaximumExtent () const
 
int GetMaximumExtentLevel () const
 
int GetMaximumExtentMode () const
 
float GetOrderedWeight (int index) const
 
float const * GetOrderedWeights () const
 
float * GetOrderedWeights ()
 
int GetOrderedWeightsMask () const
 
int GetPixelThreshold () const
 
int GetRelatedSelectionLimit () const
 
int GetSelectionBias () const
 
int GetSelectionCulling () const
 
int GetSelectionLevel () const
 
int GetValue () const
 
float const * GetVector () const
 
float GetVectorTolerance () const
 
float const * GetViewVolume () const
 
TK_Status Read (BStreamFileToolkit &tk)
 
TK_Status ReadAscii (BStreamFileToolkit &tk)
 Deprecated.
 
void SetCulling (int c)
 
void SetExtras (int e)
 
void SetForceDefer (int l)
 
void SetHardExtent (int c)
 
void SetInternalPolylineSelectionLimit (int i)
 
void SetInternalSelectionLimit (int i)
 
void SetInternalShellSelectionLimit (int i)
 
void SetMask (int m)
 
void SetMaxDistance (float m)
 
void SetMaximumExtent (int c)
 
void SetMaximumExtentLevel (int c)
 
void SetMaximumExtentMode (int c)
 
void SetOrderedWeight (int index, float weight)
 
void SetOrderedWeightsMask (int c)
 
void SetPixelThreshold (int c)
 
void SetRelatedSelectionLimit (int r)
 
void SetSelectionBias (int c)
 
void SetSelectionCulling (int c)
 
void SetSelectionLevel (int l)
 
void SetValue (int v)
 
void SetVector (float x, float y, float z)
 
void SetVector (float const v[])
 
void SetVectorTolerance (float tol)
 
void SetViewVolume (float ax, float ay, float az, float bx, float by, float bz)
 
void SetViewVolume (float const v[])
 
 TK_Heuristics ()
 
TK_Status Write (BStreamFileToolkit &tk)
 
TK_Status WriteAscii (BStreamFileToolkit &tk)
 Deprecated.
 
- Public Member Functions inherited from BBaseOpcodeHandler
 BBaseOpcodeHandler (int op)
 
virtual TK_Status Execute (BStreamFileToolkit &tk)
 
unsigned char General_Flags () const
 
char const * GetLoggingString () const
 
char * GetLoggingString ()
 
virtual TK_Status Interpret (BStreamFileToolkit &tk, ID_Key key, int variant=0)
 
virtual TK_Status Interpret (BStreamFileToolkit &tk, ID_Key key, char const *special)
 
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
 
virtual void Reset ()
 
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

int m_culling
 internal use; culling options
 
unsigned char m_extras
 internal use; low bit set == left handed, second bit set == spriting
 
int m_force_defer
 internal use; hard extent
 
int m_hard_extent
 internal use; hard extent
 
int m_internal_polyline
 internal use
 
int m_internal_shell
 internal use
 
int m_mask
 internal use
 
float m_max_distance
 internal use; max distance
 
int m_maximum_extent
 internal use; maximum extent
 
char m_maximum_extent_level
 internal use; maximum extent level
 
int m_maximum_extent_mode
 internal use; maximum extent mode – int! argh...
 
unsigned char m_model_type
 
float m_ordered_weights [TKO_Heur_Order_Count]
 
unsigned char m_ordered_weights_mask
 
int m_pixel_threshold
 internal use; pixel threshold
 
int m_related
 internal use
 
unsigned short m_selection_bias
 internal use; selection bias options
 
int m_selection_culling
 internal use; selection culling options
 
unsigned char m_selection_level
 
int m_value
 internal use
 
float m_vector [3]
 internal use; culling vector
 
float m_vector_tolerance
 internal use; culling vector tolerance
 
float m_view_volume [6]
 internal use; view volume
 
- 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

- 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 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 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
 
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 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 void fix (int *i, int n)
 for internal use only
 
static void fix (short *s, int n)
 for internal use only
 
static void fix_in (float *f, int n)
 for internal use only
 
static void fix_in (double *d, int n)
 for internal use only
 
static void fix_out (float *f, int n)
 for internal use only
 
static void fix_out (double *d, int n)
 for internal use only
 
static short flip (short s)
 for internal use only
 
static int flip (int i)
 for internal use only
 
static TK_Status GetData (BStreamFileToolkit &tk, char *b, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, short *s, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, int *i, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, float *f, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, double *d, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned char *b, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned short *s, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned int *i, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, char &c)
 
static TK_Status GetData (BStreamFileToolkit &tk, short &s)
 
static TK_Status GetData (BStreamFileToolkit &tk, int &i)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned char &b)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned short &s)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned int &i)
 
static TK_Status GetData (BStreamFileToolkit &tk, float &f)
 
static TK_Status GetData (BStreamFileToolkit &tk, double &d)
 
static TK_Status LookatData (BStreamFileToolkit &tk, unsigned char &b)
 
static TK_Status PutData (BStreamFileToolkit &tk, char const *b, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, short const *s, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, int const *i, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, float const *f, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, double const *d, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned char const *b, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned short const *s, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned int const *i, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, char const &c)
 
static TK_Status PutData (BStreamFileToolkit &tk, short const &s)
 
static TK_Status PutData (BStreamFileToolkit &tk, int const &i)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned char const &b)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned short const &s)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned int const &i)
 
static TK_Status PutData (BStreamFileToolkit &tk, float const &f)
 
static TK_Status PutData (BStreamFileToolkit &tk, double const &d)
 
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

Handles the TKE_Heuristics opcode.

TK_Heuristics provides support for writing/reading the TKE_Heuristics opcode object to/from an HSF file.

The HOOPS/3dGS scene-graph supports an attribute called Heuristics which provide instructions about scene-graph optimizations or required calculations

Constructor & Destructor Documentation

TK_Heuristics::TK_Heuristics ( )
inline

constructor

Member Function Documentation

TK_Status TK_Heuristics::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.

int TK_Heuristics::GetCulling ( ) const
inline

Returns the culling mode.

int TK_Heuristics::GetExtras ( ) const
inline

Returns the 'extra' bits.

int TK_Heuristics::GetForceDefer ( ) const
inline

Returns the force defer level.

int TK_Heuristics::GetHardExtent ( ) const
inline

Gets the Hard Extent

int TK_Heuristics::GetInternalPolylineSelectionLimit ( ) const
inline

Returns the internal polyline selection limit

int TK_Heuristics::GetInternalSelectionLimit ( ) const
inline

Returns the internal selection limit

int TK_Heuristics::GetInternalShellSelectionLimit ( ) const
inline

Returns the internal shell selection limit

int TK_Heuristics::GetMask ( ) const
inline

Returns the mask indicating which heuristics have a setting. Options are specified by TKO_Heuristic_Bits.

float TK_Heuristics::GetMaxDistance ( ) const
inline

Gets the Hard Extent

int TK_Heuristics::GetMaximumExtent ( ) const
inline

Gets the Maximum Extent

int TK_Heuristics::GetMaximumExtentLevel ( ) const
inline

Gets the Maximum Extent Level

int TK_Heuristics::GetMaximumExtentMode ( ) const
inline

Gets the Maximum Extent Mode

float TK_Heuristics::GetOrderedWeight ( int  index) const
inline

Return a single drawing order weighting factor

float const* TK_Heuristics::GetOrderedWeights ( ) const
inline

Returns the array of drawing order weighting factors

float* TK_Heuristics::GetOrderedWeights ( )
inline

Returns the array of drawing order weighting factors, which may be modified directly

int TK_Heuristics::GetOrderedWeightsMask ( ) const
inline

Gets the mask of drawing order weight values which are interesting

int TK_Heuristics::GetPixelThreshold ( ) const
inline

Gets the Pixel Threshold

int TK_Heuristics::GetRelatedSelectionLimit ( ) const
inline

Returns the related selection limit

int TK_Heuristics::GetSelectionBias ( ) const
inline

Returns the selection bias mode.

int TK_Heuristics::GetSelectionCulling ( ) const
inline

Returns the culling mode.

int TK_Heuristics::GetSelectionLevel ( ) const
inline

Returns the selection level mode.

int TK_Heuristics::GetValue ( ) const
inline

Returns the mask indicating which heuristics are set on/active. Options are specified by TKO_Heuristic_Bits.

float const* TK_Heuristics::GetVector ( ) const
inline

Gets the Culling Vector

float TK_Heuristics::GetVectorTolerance ( ) const
inline

Gets the Culling Vector Tolerance

float const* TK_Heuristics::GetViewVolume ( ) const
inline

Gets the Culling view volume

TK_Status TK_Heuristics::Read ( BStreamFileToolkit tk)
virtual

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
tkA reference to the BStreamFileToolkit object.
Returns
The result of the function call.

Implements BBaseOpcodeHandler.

void TK_Heuristics::SetCulling ( int  c)
inline

Sets the culling mode. These bits indicate forms of scene culling which may be used.

void TK_Heuristics::SetExtras ( int  e)
inline

Sets the 'extra' bits. These bits are used to indicate an alternate form for some of the options.

void TK_Heuristics::SetForceDefer ( int  l)
inline

Sets the force defer level.

void TK_Heuristics::SetHardExtent ( int  c)
inline

Sets the limit for hard extent culling

void TK_Heuristics::SetInternalPolylineSelectionLimit ( int  i)
inline

Sets the internal polyline selection limit

void TK_Heuristics::SetInternalSelectionLimit ( int  i)
inline

Sets the internal selection limit

void TK_Heuristics::SetInternalShellSelectionLimit ( int  i)
inline

Sets the internal shell selection limit

void TK_Heuristics::SetMask ( int  m)
inline

Sets the mask indicating which heuristics have a setting. Options are specified by TKO_Heuristic_Bits.

References TKO_Heuristic_Extended, and TKO_Heuristic_Extended_Mask.

void TK_Heuristics::SetMaximumExtent ( int  c)
inline

Sets the upper limit for extent culling

void TK_Heuristics::SetMaximumExtentLevel ( int  c)
inline

Sets the Maximum Extent Level

void TK_Heuristics::SetMaximumExtentMode ( int  c)
inline

Sets the Maximum Extent Mode

void TK_Heuristics::SetOrderedWeight ( int  index,
float  weight 
)
inline

Sets a specified drawing order weighting factor

void TK_Heuristics::SetOrderedWeightsMask ( int  c)
inline

Sets the mask of drawing order weight values which are interesting

void TK_Heuristics::SetPixelThreshold ( int  c)
inline

Sets the minimum number of pixels that must be touched under an occlusion culling node for it to be considered for drawing

void TK_Heuristics::SetRelatedSelectionLimit ( int  r)
inline

Sets the related selection limit

void TK_Heuristics::SetSelectionBias ( int  c)
inline

Sets the selection bias mode. These bits indicate items to favor during selection.

void TK_Heuristics::SetSelectionCulling ( int  c)
inline

Sets the selection culling mode. These bits indicate forms of scene culling which may be used.

void TK_Heuristics::SetSelectionLevel ( int  l)
inline

Sets the selection level mode.

void TK_Heuristics::SetValue ( int  v)
inline

Sets the mask indicating which heuristics are set on/active. Options are specified by TKO_Heuristic_Bits.

void TK_Heuristics::SetVector ( float  x,
float  y,
float  z 
)
inline

Sets the Culling Vector using discrete values

void TK_Heuristics::SetVector ( float const  v[])
inline

Sets the Culling Vector using a float array

References SetVector().

Referenced by SetVector().

void TK_Heuristics::SetVectorTolerance ( float  tol)
inline

Sets the Culling Vector Tolerance

void TK_Heuristics::SetViewVolume ( float  ax,
float  ay,
float  az,
float  bx,
float  by,
float  bz 
)
inline

Sets the Culling view volume using discrete values

void TK_Heuristics::SetViewVolume ( float const  v[])
inline

Sets the Culling view volume using a float array

References SetViewVolume().

Referenced by SetViewVolume().

TK_Status TK_Heuristics::Write ( BStreamFileToolkit tk)
virtual

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
tkA reference to the BStreamFileToolkit object.
Returns
The result of the function call.

Implements BBaseOpcodeHandler.


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