Introduction

Getting Started

Programming Guides

API Reference

Additional Resources

TK_Camera Class Reference

Handles the TKE_Camera opcode. More...

#include <BOpcodeHandler.h>

Public Member Functions

TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
 
double const * GetDField () const
 
void GetDField (double f[]) const
 
double const * GetDPosition () const
 
void GetDPosition (double p[]) const
 
double const * GetDTarget () const
 
void GetDTarget (double t[]) const
 
double const * GetDUpVector () const
 
void GetDUpVector (double u[]) const
 
float const * GetField () const
 
void GetField (float f[]) const
 
float GetNearLimit () const
 
float const * GetOblique () const
 
void GetOblique (float o[]) const
 
float const * GetPosition () const
 
void GetPosition (float p[]) const
 
int GetProjection () const
 
float const * GetTarget () const
 
void GetTarget (float t[]) const
 
float const * GetUpVector () const
 
void GetUpVector (float u[]) const
 
char const * GetView () const
 
char * GetView ()
 
TK_Status Read (BStreamFileToolkit &tk)
 
TK_Status ReadAscii (BStreamFileToolkit &tk)
 Deprecated.
 
void SetDField (double w, double h)
 
void SetDField (double const f[])
 
void SetDPosition (double x, double y, double z)
 
void SetDPosition (double const p[])
 
void SetDTarget (double x, double y, double z)
 
void SetDTarget (double const t[])
 
void SetDUpVector (double x, double y, double z)
 
void SetDUpVector (double const u[])
 
void SetField (float w, float h)
 
void SetField (float const f[])
 
void SetNearLimit (float l)
 
void SetOblique (float h, float v)
 
void SetOblique (float const o[])
 
void SetPosition (float x, float y, float z)
 
void SetPosition (float const p[])
 
void SetProjection (int p)
 
void SetTarget (float x, float y, float z)
 
void SetTarget (float const t[])
 
void SetUpVector (float x, float y, float z)
 
void SetUpVector (float const u[])
 
void SetView (char const *name)
 
void SetView (int length)
 
 TK_Camera (unsigned char opcode=TKE_Camera)
 
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)
 
bool IsCollectionPart () const
 
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 SetCollectionPart (bool n)
 
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 Member Functions

void set_name (char const *name)
 internal use
 
void set_name (int length)
 internal use
 
- 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
 

Protected Attributes

float m_details [3]
 
double m_dsettings [14]
 
int m_length
 
char * m_name
 
unsigned char m_projection
 internal use
 
float m_settings [14]
 
- 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
 
bool m_collection_part
 Indicates if this object is part of a LOD collection.
 
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

- 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_Camera opcode.

TK_Camera provides support for writing/reading the TKE_Camera opcode object to/from an HSF file.

The HOOPS/3dGS scene-graph supports a camera, which is a segment attribute defining a specific view of world space.

Constructor & Destructor Documentation

TK_Camera::TK_Camera ( unsigned char  opcode = TKE_Camera)
inline

constructor

Member Function Documentation

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

double const* TK_Camera::GetDField ( ) const
inline

Returns the camera field size as the address of a float pair

void TK_Camera::GetDField ( double  f[]) const
inline

Returns the camera field size to a pre-allocated array

References GetDField().

Referenced by GetDField().

double const* TK_Camera::GetDPosition ( ) const
inline

Returns the position of the camera as the address of a double triplet

void TK_Camera::GetDPosition ( double  p[]) const
inline

Returns the position of the camera to a pre-allocated array

References GetDPosition().

Referenced by GetDPosition().

double const* TK_Camera::GetDTarget ( ) const
inline

Returns the target of the camera as the address of a float triplet

void TK_Camera::GetDTarget ( double  t[]) const
inline

Returns the target of the camera to a pre-allocated array

References GetDTarget().

Referenced by GetDTarget().

double const* TK_Camera::GetDUpVector ( ) const
inline

Returns the up-vector of the camera as the address of a float triplet

void TK_Camera::GetDUpVector ( double  u[]) const
inline

Returns the up-vector of the camera to a pre-allocated array

References GetDUpVector().

Referenced by GetDUpVector().

float const* TK_Camera::GetField ( ) const
inline

Returns the camera field size as the address of a float pair

void TK_Camera::GetField ( float  f[]) const
inline

Returns the camera field size to a pre-allocated array

References GetField().

Referenced by GetField().

float TK_Camera::GetNearLimit ( ) const
inline

Returns the camera field size as the address of a float pair

float const* TK_Camera::GetOblique ( ) const
inline

Returns the camera oblique angles as the address of a float pair

void TK_Camera::GetOblique ( float  o[]) const
inline

Returns the camera oblique angles to a pre-allocated array

References GetOblique().

Referenced by GetOblique().

float const* TK_Camera::GetPosition ( ) const
inline

Returns the position of the camera as the address of a float triplet

void TK_Camera::GetPosition ( float  p[]) const
inline

Returns the position of the camera to a pre-allocated array

References GetPosition().

Referenced by GetPosition().

int TK_Camera::GetProjection ( ) const
inline

Returns the projection type. Projection types are specified by TKO_Camera_Projection.

float const* TK_Camera::GetTarget ( ) const
inline

Returns the target of the camera as the address of a float triplet

void TK_Camera::GetTarget ( float  t[]) const
inline

Returns the target of the camera to a pre-allocated array

References GetTarget().

Referenced by GetTarget().

float const* TK_Camera::GetUpVector ( ) const
inline

Returns the up-vector of the camera as the address of a float triplet

void TK_Camera::GetUpVector ( float  u[]) const
inline

Returns the up-vector of the camera to a pre-allocated array

References GetUpVector().

Referenced by GetUpVector().

char const* TK_Camera::GetView ( ) const
inline

Returns the view name.

char* TK_Camera::GetView ( )
inline

Returns the view name buffer, which may be modified directly

TK_Status TK_Camera::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_Camera::SetDField ( double  w,
double  h 
)
inline

Sets the camera field size using discrete double values

void TK_Camera::SetDField ( double const  f[])
inline

Sets the camera field size using a float pair

References SetDField().

Referenced by SetDField().

void TK_Camera::SetDPosition ( double  x,
double  y,
double  z 
)
inline

Sets the position of the camera using discrete double values

void TK_Camera::SetDPosition ( double const  p[])
inline

Sets the position of the camera using a double triplet

References SetDPosition().

Referenced by SetDPosition().

void TK_Camera::SetDTarget ( double  x,
double  y,
double  z 
)
inline

Sets the target of the camera using discrete double values

void TK_Camera::SetDTarget ( double const  t[])
inline

Sets the target of the camera using a double triplet

References SetDTarget().

Referenced by SetDTarget().

void TK_Camera::SetDUpVector ( double  x,
double  y,
double  z 
)
inline

Sets the up-vector of the camera using discrete double values

void TK_Camera::SetDUpVector ( double const  u[])
inline

Sets the up-vector of the camera using a float triplet

References SetDUpVector().

Referenced by SetDUpVector().

void TK_Camera::SetField ( float  w,
float  h 
)
inline

Sets the camera field size using discrete float values

void TK_Camera::SetField ( float const  f[])
inline

Sets the camera field size using a float pair

References SetField().

Referenced by SetField().

void TK_Camera::SetNearLimit ( float  l)
inline

Sets the camera field size using discrete float values

References TKO_Camera_Near_Limit.

void TK_Camera::SetOblique ( float  h,
float  v 
)
inline

Sets the camera oblique angles (degrees) using discrete float values

References TKO_Camera_Oblique_Mask, and TKO_Camera_Oblique_Y.

void TK_Camera::SetOblique ( float const  o[])
inline

Sets the camera oblique angles (degrees) using a float pair

References SetOblique().

Referenced by SetOblique().

void TK_Camera::SetPosition ( float  x,
float  y,
float  z 
)
inline

Sets the position of the camera using discrete float values

void TK_Camera::SetPosition ( float const  p[])
inline

Sets the position of the camera using a float triplet

References SetPosition().

Referenced by SetPosition().

void TK_Camera::SetProjection ( int  p)
inline

Sets the projection type. Projection types are specified by TKO_Camera_Projection.

void TK_Camera::SetTarget ( float  x,
float  y,
float  z 
)
inline

Sets the target of the camera using discrete float values

void TK_Camera::SetTarget ( float const  t[])
inline

Sets the target of the camera using a float triplet

References SetTarget().

Referenced by SetTarget().

void TK_Camera::SetUpVector ( float  x,
float  y,
float  z 
)
inline

Sets the up-vector of the camera using discrete float values

void TK_Camera::SetUpVector ( float const  u[])
inline

Sets the up-vector of the camera using a float triplet

References SetUpVector().

Referenced by SetUpVector().

void TK_Camera::SetView ( char const *  name)
inline

Sets the view name. Allocates the buffer and copies the string

void TK_Camera::SetView ( int  length)
inline

Sets the view name buffer. Allocates a buffer which can hold a srting of 'length' characters

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

Member Data Documentation

float TK_Camera::m_details[3]
protected

internal use; stored in the following order: oblique(2), near_limit

double TK_Camera::m_dsettings[14]
protected

internal use; same as m_settings for double precision

int TK_Camera::m_length
protected

Length of view name

char* TK_Camera::m_name
protected

View name

float TK_Camera::m_settings[14]
protected

internal use; stored in the following order: position(3), target(3), up(3), width, height Position, target, and up are all object space. Width and height define the span of the minimum area around the target to be visible


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