#include <BOpcodeHandler.h>
Public Types | |
enum | Capping_Options { TKCYL_NORMAL_FIRST = 0x04, TKCYL_NORMAL_SECOND = 0x08, TKCYL_OPTIONALS = 0x10 } |
Public Member Functions | |
TK_Status | Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const |
int | GetCaps () const |
int | GetCount () const |
float const * | GetEndNormal (int index) const |
float alter * | GetPoints () alter |
float const * | GetPoints () const |
float alter * | GetRadii () alter |
float const * | GetRadii () const |
int | GetRadiusCount () const |
TK_Status | Read (BStreamFileToolkit &tk) alter |
TK_Status | ReadAscii (BStreamFileToolkit &tk) alter |
Deprecated. | |
void | Reset () alter |
void | SetCaps (int f) alter |
void | SetEndNormal (int index, float const *normal=0) alter |
void | SetPoints (int count, float const *points=0) alter |
void | SetRadii (int count, float const *radii=0) alter |
void | SetRadius (float radius) alter |
TK_PolyCylinder () | |
TK_Status | Write (BStreamFileToolkit &tk) alter |
TK_Status | WriteAscii (BStreamFileToolkit &tk) alter |
Deprecated. | |
Protected Attributes | |
int | m_count |
unsigned char | m_flags |
float | m_normals [6] |
float * | m_points |
float * | m_radii |
int | m_radius_count |
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'.
TK_PolyCylinder::TK_PolyCylinder | ( | ) | [inline] |
constructor
TK_Status TK_PolyCylinder::Clone | ( | BStreamFileToolkit & | tk, | |
BBaseOpcodeHandler ** | handler | |||
) | const [virtual] |
Copies the opcode handler
tk | A reference to the BStreamFileToolkit object. | |
handler | A pointer to the opcode handler object. Passed by reference. |
Reimplemented from BBaseOpcodeHandler.
Reimplemented in HTK_PolyCylinder.
int TK_PolyCylinder::GetCaps | ( | ) | const [inline] |
Returns the capping options of the cylinder
int TK_PolyCylinder::GetCount | ( | ) | const [inline] |
Returns the number of points in the buffer
float const* TK_PolyCylinder::GetEndNormal | ( | int | index | ) | const [inline] |
Returns the normal associated with an end of the polycylinder (0 if none)
float alter* TK_PolyCylinder::GetPoints | ( | ) | [inline] |
Returns the address of the point buffer, which may be modified directly
Reimplemented from TK_Polyhedron.
float const* TK_PolyCylinder::GetPoints | ( | ) | const [inline] |
Returns the address of the point buffer
Reimplemented from TK_Polyhedron.
float alter* TK_PolyCylinder::GetRadii | ( | ) | [inline] |
Returns the address of the point buffer, which may be modified directly
float const* TK_PolyCylinder::GetRadii | ( | ) | const [inline] |
Returns the address of the point buffer
int TK_PolyCylinder::GetRadiusCount | ( | ) | const [inline] |
Returns the number of points in the buffer
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.
tk | A reference to the BStreamFileToolkit object. |
Implements BBaseOpcodeHandler.
void TK_PolyCylinder::Reset | ( | ) | [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
void TK_PolyCylinder::SetEndNormal | ( | int | index, | |
float const * | normal = 0 | |||
) | [inline] |
Sets (or clears) the normal associated with an end of the polycylinder
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
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.
tk | A reference to the BStreamFileToolkit object. |
Implements BBaseOpcodeHandler.
int TK_PolyCylinder::m_count [protected] |
internal use; Number of 3D points that define this polycylinder object
unsigned char TK_PolyCylinder::m_flags [protected] |
internal use; Caps, normals, colors
float TK_PolyCylinder::m_normals[6] [protected] |
internal use; Normals of end caps
float* TK_PolyCylinder::m_points [protected] |
internal use; Array of floats which denote the point coordinates.
float* TK_PolyCylinder::m_radii [protected] |
internal use; Array of floats which denote the radii.
int TK_PolyCylinder::m_radius_count [protected] |
internal use; Number of radii associated with the points