HT_NURBS_Trim Class Reference

#include <BOpcodeHandler.h>

Inheritance diagram for HT_NURBS_Trim:

Inheritance graph
[legend]
Collaboration diagram for HT_NURBS_Trim:

Collaboration graph
[legend]
List of all members.

Detailed Description

Does not handle any top level opcodes, but rather only the trim types allowable on nurbs surfaces.

HT_NURBS_Trim is a helper class to handle reading and writing of the nurbs surface trims. Trims may be of type NS_TRIM_POLY, NS_TRIM_CURVE, or NS_TRIM_COLLECTION. In any case, though, all coordinates are specified with respect to the parameterization of the NURBS surface. This parameterization is always from 0 to 1 in each direction. Some solid modelers parameterize with respect to the contents of their knot vectors, meaning that coordinates may need to be rescaled. To do so, the formula is "u = (u - u_knots[u_degree]) / (u_knots[u_control_point_count] - knots[u_degree])". Values coming out of HOOPS will already be properly scaled.

Definition at line 5763 of file BOpcodeHandler.h.

Public Member Functions

void SetPoly (int count, float const *points=0) alter
void SetCurve (int degree, int control_count, float const *points=0, float const *weights=0, float const *knots=0, float start_u=0, float end_u=1) alter
void SetCollection () alter
void SetOptions (int o) alter
void SetList (HT_NURBS_Trim *node) alter
void SetNext (HT_NURBS_Trim *next)
TK_Status Read (BStreamFileToolkit &tk) alter
TK_Status Write (BStreamFileToolkit &tk) alter
HT_NURBS_TrimGetNext (void)
int GetType (void) const
int GetCount (void) const
float const * GetPoints (void) const
float alter * GetPoints (void) alter
int GetDegree (void) const
int GetOptions (void) const
float const * GetWeights (void) const
float alter * GetWeights (void) alter
float const * GetKnots (void) const
float alter * GetKnots (void) alter
HT_NURBS_Trim const * GetList (void) const
HT_NURBS_TrimGetList (void) alter

Protected Member Functions

TK_Status read_collection (BStreamFileToolkit &tk)
TK_Status write_collection (BStreamFileToolkit &tk)

Protected Attributes

int m_substage
HT_NURBS_Trimm_next
unsigned char m_type
int m_count
float * m_points
unsigned char m_degree
unsigned char m_options
float * m_weights
float * m_knots
float m_start_u
float m_end_u
HT_NURBS_Trimm_list
HT_NURBS_Trimm_current_trim

Friends

class TK_NURBS_Surface


Member Function Documentation

int HT_NURBS_Trim::GetCount void   )  const [inline]
 

(relevant to NS_TRIM_CURVE and NS_TRIM_POLY only), gets the number of vertices in the trim.

Definition at line 5815 of file BOpcodeHandler.h.

int HT_NURBS_Trim::GetDegree void   )  const [inline]
 

(relevant to NS_TRIM_CURVE only), returns the degree of the trim curve. Note that this is not necessarily the same as the degree of the surface to be trimmed.

Definition at line 5821 of file BOpcodeHandler.h.

float alter* HT_NURBS_Trim::GetKnots void   )  [inline]
 

(relevant to NS_TRIM_CURVE only), returns a mutable pointer to the trim curve's knots

Definition at line 5831 of file BOpcodeHandler.h.

float const* HT_NURBS_Trim::GetKnots void   )  const [inline]
 

(relevant to NS_TRIM_CURVE only), returns a const pointer to the trim curve's knots

Definition at line 5829 of file BOpcodeHandler.h.

HT_NURBS_Trim* HT_NURBS_Trim::GetList void   )  [inline]
 

(relevant to NS_TRIM_COLLECTION only), returns a mutable pointer the collection's linked list. Note that SetList, not this function, must be used to make the head of the list point somewhere else.

Definition at line 5835 of file BOpcodeHandler.h.

HT_NURBS_Trim const* HT_NURBS_Trim::GetList void   )  const [inline]
 

(relevant to NS_TRIM_COLLECTION only), returns a const pointer the collection's linked list

Definition at line 5833 of file BOpcodeHandler.h.

HT_NURBS_Trim* HT_NURBS_Trim::GetNext void   )  [inline]
 

gets the next trim in the list

Definition at line 5811 of file BOpcodeHandler.h.

int HT_NURBS_Trim::GetOptions void   )  const [inline]
 

(relevant to NS_TRIM_CURVE only), returns the options bit flags to indicate the presence of all of the optional fields

Definition at line 5823 of file BOpcodeHandler.h.

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

(relevant to NS_TRIM_CURVE and NS_TRIM_POLY only), returns a mutable pointer to the vertices

Definition at line 5819 of file BOpcodeHandler.h.

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

(relevant to NS_TRIM_CURVE and NS_TRIM_POLY only), returns a const pointer to the vertices

Definition at line 5817 of file BOpcodeHandler.h.

int HT_NURBS_Trim::GetType void   )  const [inline]
 

gets an identifier for the trim type. Legal values are NS_TRIM_POLY, NS_TRIM_CURVE, and NS_TRIM_COLLECTION

Definition at line 5813 of file BOpcodeHandler.h.

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

(relevant to NS_TRIM_CURVE only), returns a mutable pointer to the control point weights

Definition at line 5827 of file BOpcodeHandler.h.

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

(relevant to NS_TRIM_CURVE only), returns a const pointer to the control point weights

Definition at line 5825 of file BOpcodeHandler.h.

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

TK_Status HT_NURBS_Trim::read_collection BStreamFileToolkit tk  )  [protected]
 

internal use; reads the pieces of a collection

void HT_NURBS_Trim::SetCollection  ) 
 

Configures *this to read or write a trim collection

void HT_NURBS_Trim::SetCurve int  degree,
int  control_count,
float const *  points = 0,
float const *  weights = 0,
float const *  knots = 0,
float  start_u = 0,
float  end_u = 1
 

Configures *this to handle the reading or writing of a trim curve. Also handles initializing the type of this trim to NS_TRIM_CURVE.

void HT_NURBS_Trim::SetList HT_NURBS_Trim node  )  [inline]
 

sets the head of the list of a NS_TRIM_COLLECTION.

Definition at line 5798 of file BOpcodeHandler.h.

void HT_NURBS_Trim::SetNext HT_NURBS_Trim next  )  [inline]
 

sets the next pointer of a trim. Used for linked list management

Definition at line 5799 of file BOpcodeHandler.h.

void HT_NURBS_Trim::SetOptions int  o  )  [inline]
 

sets the options bit flags to indicate the presence of all of the optional fields

Definition at line 5797 of file BOpcodeHandler.h.

void HT_NURBS_Trim::SetPoly int  count,
float const *  points = 0
 

allocates space for the coordinates (polyline vertices or curve control points), and copies values if they were given. Also handles initializing the type of this trim to NS_TRIM_POLY.

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

TK_Status HT_NURBS_Trim::write_collection BStreamFileToolkit tk  )  [protected]
 

internal use; writes the pieces of a collection


Member Data Documentation

int HT_NURBS_Trim::m_count [protected]
 

internal use; (relevant to NS_TRIM_CURVE and NS_TRIM_POLY only), this indicates either the number of points the primitive has

Definition at line 5774 of file BOpcodeHandler.h.

HT_NURBS_Trim* HT_NURBS_Trim::m_current_trim [protected]
 

internal use; (relevant to NS_TRIM_COLLECTION only), tracks progress during the read or write of a trim collection.

Definition at line 5784 of file BOpcodeHandler.h.

unsigned char HT_NURBS_Trim::m_degree [protected]
 

internal use; (relevant to NS_TRIM_CURVE only), indicates the degree of the trim curve. Note that this is not necessarily the same as the degree of the surface it is trimming.

Definition at line 5777 of file BOpcodeHandler.h.

float HT_NURBS_Trim::m_end_u [protected]
 

internal use; (relevant to NS_TRIM_CURVE only), the end point of the trim curve. Parameter is specified in the range of 0 to 1. Valid only if options contains the NS_TRIM_HAS_START bit.

Definition at line 5782 of file BOpcodeHandler.h.

float* HT_NURBS_Trim::m_knots [protected]
 

internal use; (relevant to NS_TRIM_CURVE only), the knots of the trim curve. Present only if options contains the NS_TRIM_HAS_KNOTS bit

Definition at line 5780 of file BOpcodeHandler.h.

HT_NURBS_Trim* HT_NURBS_Trim::m_list [protected]
 

internal use; (relevant to NS_TRIM_COLLECTION only), the linked list of trims that make up the collection

Definition at line 5783 of file BOpcodeHandler.h.

HT_NURBS_Trim* HT_NURBS_Trim::m_next [protected]
 

internal use; the next trim in the list. The linked list is null-terminated, at which point a NS_TRIM_END will be written to the file.

Definition at line 5772 of file BOpcodeHandler.h.

unsigned char HT_NURBS_Trim::m_options [protected]
 

internal use; (relevant to NS_TRIM_CURVE only), a bit field to indicate the presence of the various nurbs curve attributes. Anything not present is assumed to fall back to its default value: 0,1 for start and end, linearly increasing knots, and uniform weights.

Definition at line 5778 of file BOpcodeHandler.h.

float* HT_NURBS_Trim::m_points [protected]
 

internal use; (relevant to NS_TRIM_CURVE and NS_TRIM_POLY only), an array of floats for the points (uv pairs) of a trim curve or polyline. Should be of length 2*m_count.

Definition at line 5775 of file BOpcodeHandler.h.

float HT_NURBS_Trim::m_start_u [protected]
 

internal use; (relevant to NS_TRIM_CURVE only), the start point of the trim curve. Parameter is specified in the range of 0 to 1. Valid only if options contains the NS_TRIM_HAS_START bit.

Definition at line 5781 of file BOpcodeHandler.h.

int HT_NURBS_Trim::m_substage [protected]
 

internal use; tracks progress during reading and writing

Definition at line 5771 of file BOpcodeHandler.h.

unsigned char HT_NURBS_Trim::m_type [protected]
 

internal use; an enumerated type to dictate which sort of trim we are dealing with. Legal values are NS_TRIM_POLY, NS_TRIM_CURVE and NS_TRIM_COLLECTION.

Definition at line 5773 of file BOpcodeHandler.h.

float* HT_NURBS_Trim::m_weights [protected]
 

internal use; (relevant to NS_TRIM_CURVE only), the control point weights of the trim curve. Present only if options contains the NS_TRIM_HAS_WEIGHTS bit

Definition at line 5779 of file BOpcodeHandler.h.


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