TK_PolyCylinder Class Reference

#include <BOpcodeHandler.h>

Inheritance diagram for TK_PolyCylinder:

Inheritance graph
[legend]
Collaboration diagram for TK_PolyCylinder:

Collaboration graph
[legend]
List of all members.

Detailed Description

Handles the TKE_PolyCylinder opcode.

TK_PolyCylinder provides support for writing/reading the TKE_PolyCylinder opcode object to/from an HSF file.

The HOOPS/3dGS scene-graph can contain 'polycylinder' primitives which are defined by a series of points representing the centerline, radius at each point, and flags indicating which ends are 'capped'.

Definition at line 6446 of file BOpcodeHandler.h.

Public Types

enum  Capping_Options { TKCYL_NORMAL_FIRST = 0x04, TKCYL_NORMAL_SECOND = 0x08, TKCYL_OPTIONALS = 0x10 }

Public Member Functions

 TK_PolyCylinder ()
TK_Status Read (BStreamFileToolkit &tk) alter
TK_Status Write (BStreamFileToolkit &tk) alter
TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
void Reset (void) alter
void SetPoints (int count, float const *points=0) alter
float const * GetPoints (void) const
float alter * GetPoints (void) alter
int GetCount (void) const
void SetRadii (int count, float const *radii=0) alter
void SetRadius (float radius) alter
float const * GetRadii (void) const
float alter * GetRadii (void) alter
int GetRadiusCount (void) const
void SetCaps (int f) alter
int GetCaps (void) const
void SetEndNormal (int index, float const *normal=0) alter
float const * GetEndNormal (int index) const

Protected Attributes

int m_count
float * m_points
int m_radius_count
float * m_radii
unsigned char m_flags
float m_normals [6]


Member Enumeration Documentation

enum TK_PolyCylinder::Capping_Options
 

Cylinder capping options

Enumerator:
TKCYL_NORMAL_FIRST  cap 'first' side
TKCYL_NORMAL_SECOND  cap 'second' side
TKCYL_OPTIONALS  has optionals

Definition at line 6477 of file BOpcodeHandler.h.


Constructor & Destructor Documentation

TK_PolyCylinder::TK_PolyCylinder  )  [inline]
 

constructor

Definition at line 6461 of file BOpcodeHandler.h.


Member Function Documentation

TK_Status TK_PolyCylinder::Clone BStreamFileToolkit tk,
BBaseOpcodeHandler **  handler
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.

Reimplemented from BBaseOpcodeHandler.

int TK_PolyCylinder::GetCaps void   )  const [inline]
 

Returns the capping options of the cylinder

Definition at line 6514 of file BOpcodeHandler.h.

int TK_PolyCylinder::GetCount void   )  const [inline]
 

Returns the number of points in the buffer

Definition at line 6493 of file BOpcodeHandler.h.

float const* TK_PolyCylinder::GetEndNormal int  index  )  const [inline]
 

Returns the normal associated with an end of the polycylinder (0 if none)

Definition at line 6529 of file BOpcodeHandler.h.

float alter* TK_PolyCylinder::GetPoints void   )  [inline]
 

Returns the address of the point buffer, which may be modified directly

Reimplemented from TK_Polyhedron.

Definition at line 6491 of file BOpcodeHandler.h.

float const* TK_PolyCylinder::GetPoints void   )  const [inline]
 

Returns the address of the point buffer

Reimplemented from TK_Polyhedron.

Definition at line 6489 of file BOpcodeHandler.h.

float alter* TK_PolyCylinder::GetRadii void   )  [inline]
 

Returns the address of the point buffer, which may be modified directly

Definition at line 6506 of file BOpcodeHandler.h.

float const* TK_PolyCylinder::GetRadii void   )  const [inline]
 

Returns the address of the point buffer

Definition at line 6504 of file BOpcodeHandler.h.

int TK_PolyCylinder::GetRadiusCount void   )  const [inline]
 

Returns the number of points in the buffer

Definition at line 6508 of file BOpcodeHandler.h.

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

Implements BBaseOpcodeHandler.

void TK_PolyCylinder::Reset void   )  [virtual]
 

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.

void TK_PolyCylinder::SetCaps int  f  )  [inline]
 

Sets the capping options of the cylinder

Definition at line 6512 of file BOpcodeHandler.h.

void TK_PolyCylinder::SetEndNormal int  index,
float const *  normal = 0
[inline]
 

Sets (or clears) the normal associated with an end of the polycylinder

Definition at line 6517 of file BOpcodeHandler.h.

void TK_PolyCylinder::SetPoints int  count,
float const *  points = 0
 

Sets the point array. Allocates a buffer which will hold 'count' float triplets, and if specified, copies the 'points' into the buffer

Reimplemented from TK_Polyhedron.

void TK_PolyCylinder::SetRadii int  count,
float const *  radii = 0
 

Sets the radius array. Allocates a buffer which will hold 'count' floats, and if specified, copies the 'radii' into the buffer

void TK_PolyCylinder::SetRadius float  radius  )  [inline]
 

Convenience function to set a single radius

Definition at line 6502 of file BOpcodeHandler.h.

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

Implements BBaseOpcodeHandler.


Member Data Documentation

int TK_PolyCylinder::m_count [protected]
 

internal use; Number of 3D points that define this polycylinder object

Definition at line 6452 of file BOpcodeHandler.h.

unsigned char TK_PolyCylinder::m_flags [protected]
 

internal use; Caps, normals, colors

Definition at line 6456 of file BOpcodeHandler.h.

float TK_PolyCylinder::m_normals[6] [protected]
 

internal use; Normals of end caps

Definition at line 6457 of file BOpcodeHandler.h.

float* TK_PolyCylinder::m_points [protected]
 

internal use; Array of floats which denote the point coordinates.

Definition at line 6453 of file BOpcodeHandler.h.

float* TK_PolyCylinder::m_radii [protected]
 

internal use; Array of floats which denote the radii.

Definition at line 6455 of file BOpcodeHandler.h.

int TK_PolyCylinder::m_radius_count [protected]
 

internal use; Number of radii associated with the points

Definition at line 6454 of file BOpcodeHandler.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:41:45 2009 for Autodesk DWF 3D Toolkit by  doxygen 1.4.5