TK_Camera

class TK_Camera

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.

Inherits from: BBaseOpcodeHandler

Methods

void TK_Camera::set_name(char const *name)

protected

internal use

void TK_Camera::set_name(int length)

protected

internal use

TK_Camera::TK_Camera(unsigned char opcode = TKE_Camera)

constructor

TK_Camera::~TK_Camera()
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

tk: A reference to the BStreamFileToolkit object.

Returns

The result of the function call.
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

tk: A reference to the BStreamFileToolkit object.

Returns

The result of the function call.
TK_Status TK_Camera::Clone(BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const

const virtual

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 TK_Camera::ReadAscii(BStreamFileToolkit &tk)

Deprecated.

TK_Status TK_Camera::WriteAscii(BStreamFileToolkit &tk)

Deprecated.

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

Sets the position of the camera using discrete float values

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

Sets the position of the camera using a float triplet

float const *TK_Camera::GetPosition() const

const

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

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

const

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

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

Sets the position of the camera using discrete double values

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

Sets the position of the camera using a double triplet

double const *TK_Camera::GetDPosition() const

const

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

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

const

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

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

Sets the target of the camera using discrete float values

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

Sets the target of the camera using a float triplet

float const *TK_Camera::GetTarget() const

const

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

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

const

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

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

Sets the target of the camera using discrete double values

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

Sets the target of the camera using a double triplet

double const *TK_Camera::GetDTarget() const

const

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

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

const

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

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

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

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

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

float const *TK_Camera::GetUpVector() const

const

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

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

const

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

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

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

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

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

double const *TK_Camera::GetDUpVector() const

const

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

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

const

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

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

Sets the camera field size using discrete float values

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

Sets the camera field size using a float pair

float const *TK_Camera::GetField() const

const

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

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

const

Returns the camera field size to a pre-allocated array

void TK_Camera::SetDField(double w, double h)

Sets the camera field size using discrete double values

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

Sets the camera field size using a float pair

double const *TK_Camera::GetDField() const

const

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

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

const

Returns the camera field size to a pre-allocated array

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

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

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

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

float const *TK_Camera::GetOblique() const

const

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

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

const

Returns the camera oblique angles to a pre-allocated array

void TK_Camera::SetNearLimit(float l)

Sets the camera field size using discrete float values

float TK_Camera::GetNearLimit() const

const

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

void TK_Camera::SetProjection(int p)

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

int TK_Camera::GetProjection() const

const

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

void TK_Camera::SetView(char const *name)

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

void TK_Camera::SetView(int length)

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

char const *TK_Camera::GetView() const

const

Returns the view name.

char *TK_Camera::GetView()

Returns the view name buffer, which may be modified directly

Variables

float TK_Camera::m_settings[14]

protected

float

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

double TK_Camera::m_dsettings[14]

protected

double

internal use; same as m_settings for double precision

float TK_Camera::m_details[3]

protected

float

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

unsigned char TK_Camera::m_projection

protected

unsigned char

internal use

int TK_Camera::m_length

protected

int

Length of view name

char *TK_Camera::m_name

protected

char

View name