TK_NURBS_Surface Class Reference

#include <BOpcodeHandler.h>

Inheritance diagram for TK_NURBS_Surface:

Inheritance graph
[legend]
Collaboration diagram for TK_NURBS_Surface:

Collaboration graph
[legend]
List of all members.

Detailed Description

Handles the TKE_NURBS_Surface opcode.

TK_NURBS_Surface provides support for writing/reading the TKE_NURBS_Surface opcode object to/from an HSF file.

The HOOPS/3dGS scene-graph supports NURBS surface primitives

Definition at line 5845 of file BOpcodeHandler.h.

Public Member Functions

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 SetSurface (int u_degree, int v_degree, int u_size, int v_size, float const *points=0, float const *weights=0, float const *u_knots=0, float const *v_knots=0) alter
int GetUDegree (void) const
int GetVDegree (void) const
int GetUSize (void) const
int GetVSize (void) const
float const * GetPoints (void) const
float alter * GetPoints (void) alter
float const * GetWeights (void) const
float alter * GetWeights (void) alter
float const * GetUKnots (void) const
float alter * GetUKnots (void) alter
float const * GetVKnots (void) const
float alter * GetVKnots (void) alter
void SetOptions (int o) alter
int GetOptions (void) const
HT_NURBS_TrimNewTrim (int type=NS_TRIM_END) alter
HT_NURBS_TrimGetTrims (void) alter

Protected Attributes

unsigned char m_optionals
unsigned char m_degree [2]
int m_size [2]
float * m_control_points
float * m_weights
float * m_u_knots
float * m_v_knots
HT_NURBS_Trimm_trims
HT_NURBS_Trimm_current_trim


Member Function Documentation

TK_Status TK_NURBS_Surface::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_NURBS_Surface::GetOptions void   )  const [inline]
 

gets the bit flags to indicate the presence of the various optional values of the NURBS Surface. Currently defined bit values are NS_HAS_WEIGHTS, NS_HAS_KNOTS, and NS_HAS_TRIMS.

Definition at line 5908 of file BOpcodeHandler.h.

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

returns a mutable pointer to the array of floats for control point coordinates

Definition at line 5891 of file BOpcodeHandler.h.

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

returns a const pointer to the array of floats for control point coordinates

Definition at line 5889 of file BOpcodeHandler.h.

HT_NURBS_Trim* TK_NURBS_Surface::GetTrims void   )  [inline]
 

returns a mutable pointer to the head of the linked list of trims

Definition at line 5913 of file BOpcodeHandler.h.

int TK_NURBS_Surface::GetUDegree void   )  const [inline]
 

gets the degree in the U direction of the NURBS Surface.

Definition at line 5881 of file BOpcodeHandler.h.

float alter* TK_NURBS_Surface::GetUKnots void   )  [inline]
 

returns a mutable pointer to the array of floats for the surface knot vector in the u direction. Of length GetUDegree() + GetUSize() + 1.

Definition at line 5899 of file BOpcodeHandler.h.

float const* TK_NURBS_Surface::GetUKnots void   )  const [inline]
 

returns a const pointer to the array of floats for the surface knot vector in the u direction. Of length GetUDegree() + GetUSize() + 1.

Definition at line 5897 of file BOpcodeHandler.h.

int TK_NURBS_Surface::GetUSize void   )  const [inline]
 

gets the number of control points in the U direction

Definition at line 5885 of file BOpcodeHandler.h.

int TK_NURBS_Surface::GetVDegree void   )  const [inline]
 

gets the degree in the V direction of the NURBS Surface. Note that it need not be the same as the U direction (e.g. a cylinder is linear in one direction)

Definition at line 5883 of file BOpcodeHandler.h.

float alter* TK_NURBS_Surface::GetVKnots void   )  [inline]
 

returns a mutable pointer to the array of floats for the surface knot vector in the v direction. Of length GetVDegree() + GetVSize() + 1.

Definition at line 5903 of file BOpcodeHandler.h.

float const* TK_NURBS_Surface::GetVKnots void   )  const [inline]
 

returns a const pointer to the array of floats for the surface knot vector in the v direction. Of length GetVDegree() + GetVSize() + 1.

Definition at line 5901 of file BOpcodeHandler.h.

int TK_NURBS_Surface::GetVSize void   )  const [inline]
 

gets the number of control points in the V direction

Definition at line 5887 of file BOpcodeHandler.h.

float alter* TK_NURBS_Surface::GetWeights void   )  [inline]
 

returns a mutable pointer to the array of weights to apply to the control points

Definition at line 5895 of file BOpcodeHandler.h.

float const* TK_NURBS_Surface::GetWeights void   )  const [inline]
 

returns a const pointer to the array of weights to apply to the control points

Definition at line 5893 of file BOpcodeHandler.h.

HT_NURBS_Trim* TK_NURBS_Surface::NewTrim int  type = NS_TRIM_END  ) 
 

creates a new instance of an HT_NURBS_Trim object to handle trims

TK_Status TK_NURBS_Surface::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_NURBS_Surface::Reset void   )  [virtual]
 

prepares the handler for reuse during reading or writing

Reimplemented from BBaseOpcodeHandler.

void TK_NURBS_Surface::SetOptions int  o  )  [inline]
 

sets the bit flags to indicate the presence of the various optional values of the NURBS Surface. Currently defined bit values are NS_HAS_WEIGHTS, NS_HAS_KNOTS, and NS_HAS_TRIMS.

Definition at line 5906 of file BOpcodeHandler.h.

void TK_NURBS_Surface::SetSurface int  u_degree,
int  v_degree,
int  u_size,
int  v_size,
float const *  points = 0,
float const *  weights = 0,
float const *  u_knots = 0,
float const *  v_knots = 0
 

allocates all of the arrays that could be present in a nurbs surface (even if they are eventually left unused), and copies whatever data is given.

TK_Status TK_NURBS_Surface::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

float* TK_NURBS_Surface::m_control_points [protected]
 

internal use; array of floats for control point coordinates

Definition at line 5854 of file BOpcodeHandler.h.

HT_NURBS_Trim* TK_NURBS_Surface::m_current_trim [protected]
 

internal use; tracks the progress of reading or writing the triming objects

Definition at line 5860 of file BOpcodeHandler.h.

unsigned char TK_NURBS_Surface::m_degree[2] [protected]
 

internal use; degree of the curve (u,v)

Definition at line 5852 of file BOpcodeHandler.h.

unsigned char TK_NURBS_Surface::m_optionals [protected]
 

internal use; bit field to show which optional fields are present

Definition at line 5851 of file BOpcodeHandler.h.

int TK_NURBS_Surface::m_size[2] [protected]
 

internal use; number of control points (u,v)

Definition at line 5853 of file BOpcodeHandler.h.

HT_NURBS_Trim* TK_NURBS_Surface::m_trims [protected]
 

internal use; a linked list of trimming objects. These may be of type NS_TRIM_POLY, NS_TRIM_CURVE or NS_TRIM_COLLECTION

Definition at line 5859 of file BOpcodeHandler.h.

float* TK_NURBS_Surface::m_u_knots [protected]
 

internal use; array of floats for the surface knot vector in the u direction. Of length GetUDegree() + GetUSize() + 1.

Definition at line 5856 of file BOpcodeHandler.h.

float* TK_NURBS_Surface::m_v_knots [protected]
 

internal use; array of floats for the surface knot vector in the v direction. Of length GetVDegree() + GetVSize() + 1.

Definition at line 5857 of file BOpcodeHandler.h.

float* TK_NURBS_Surface::m_weights [protected]
 

internal use; array of weights to apply to the control points

Definition at line 5855 of file BOpcodeHandler.h.


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