Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

TK_NURBS_Surface Class Reference

Handles the TKE_NURBS_Surface opcode. More...

#include <BOpcodeHandler.h>

Public Member Functions

TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
 
double const * GetDPoints () const
 
double * GetDPoints ()
 
int GetOptions () const
 
float const * GetPoints () const
 
float * GetPoints ()
 
HT_NURBS_TrimGetTrims ()
 
int GetUDegree () const
 
float const * GetUKnots () const
 
float * GetUKnots ()
 
int GetUSize () const
 
int GetVDegree () const
 
float const * GetVKnots () const
 
float * GetVKnots ()
 
int GetVSize () const
 
float const * GetWeights () const
 
float * GetWeights ()
 
HT_NURBS_TrimNewTrim (int type=NS_TRIM_END)
 
TK_Status Read (BStreamFileToolkit &tk)
 
TK_Status ReadAscii (BStreamFileToolkit &tk)
 Deprecated.
 
void Reset ()
 
void SetDSurface (int u_degree, int v_degree, int u_size, int v_size, double const *points=0, float const *weights=0, float const *u_knots=0, float const *v_knots=0)
 
void SetOptions (int o)
 
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)
 
TK_Status Write (BStreamFileToolkit &tk)
 
TK_Status WriteAscii (BStreamFileToolkit &tk)
 Deprecated.
 
- Public Member Functions inherited from BBaseOpcodeHandler
 BBaseOpcodeHandler (int op)
 
virtual TK_Status Execute (BStreamFileToolkit &tk)
 
unsigned char General_Flags () const
 
char const * GetLoggingString () const
 
char * GetLoggingString ()
 
virtual TK_Status Interpret (BStreamFileToolkit &tk, ID_Key key, int variant=0)
 
virtual TK_Status Interpret (BStreamFileToolkit &tk, ID_Key key, char const *special)
 
void LogDebug (BStreamFileToolkit &tk, char const *string=0)
 
virtual bool Match_Instance (BStreamFileToolkit const &tk, Recorded_Instance *instance)
 
virtual bool NeedsContext (BStreamFileToolkit &tk) const
 
bool NeedsTag () const
 
unsigned char Opcode () const
 
int Pass (BStreamFileToolkit &tk) const
 
void Set_General_Flags (int f)
 
void SetLoggingString (char const *segment)
 
void SetLoggingString (int length)
 
void SetNeedsTag (bool n)
 
TK_Status Tag (BStreamFileToolkit &tk, int variant=-1) const
 
bool Tagging (BStreamFileToolkit &tk) const
 
- Public Member Functions inherited from BControlledMemoryObject
void operator delete (void *p)
 force deallocation to happen in the stream toolkit's scope
 
void * operator new (size_t size)
 force allocation to happen in the stream toolkit's scope
 

Protected Attributes

float * m_control_points
 
HT_NURBS_Trimm_current_trim
 
double * m_dcontrol_points
 
unsigned char m_degree [2]
 
unsigned char m_optionals
 
int m_size [2]
 
HT_NURBS_Trimm_trims
 
float * m_u_knots
 
float * m_v_knots
 
float * m_weights
 
- Protected Attributes inherited from BBaseOpcodeHandler
char * m_ascii_buffer
 
int m_ascii_length
 
int m_ascii_progress
 Tracks the amount of data that has been read/written so far by GetAscii functions.
 
int m_ascii_size
 
int m_ascii_stage
 
unsigned char m_byte
 temporary
 
char m_char
 temporary
 
int m_debug_allocated
 
int m_debug_length
 
char * m_debug_string
 
unsigned char m_general_flags
 Basic flags common to many handlers.
 
int m_int
 temporary
 
bool m_needs_tag
 Indicate if this object explicitly needs tagging.
 
unsigned char m_opcode
 The opcode being handled by this particular object.
 
int m_progress
 Tracks the amount of data that has been read/written so far.
 
int m_stage
 The writing stage.
 
unsigned short m_unsigned_short
 temporary
 

Additional Inherited Members

- Protected Member Functions inherited from BBaseOpcodeHandler
void add_segment (BStreamFileToolkit &tk, ID_Key key)
 for internal use only
 
void adjust_written (BStreamFileToolkit &tk, int count)
 for internal use only
 
void bytes_to_floats (unsigned char const *in, float *out, int count) const
 for internal use only
 
void decrease_nesting (BStreamFileToolkit &tk, int amount=1)
 for internal use only
 
bool Find_Instance (BStreamFileToolkit &tk, int val1, int val2, int val3)
 
bool Find_Item (BStreamFileToolkit &tk, ID_Key key) const
 
void fix (int *i, int n)
 for internal use only
 
void fix (short *s, int n)
 for internal use only
 
void fix_in (float *f, int n)
 for internal use only
 
void fix_in (double *d, int n)
 for internal use only
 
void fix_out (float *f, int n)
 for internal use only
 
void fix_out (double *d, int n)
 for internal use only
 
short flip (short s)
 for internal use only
 
int flip (int i)
 for internal use only
 
void floats_to_bytes (float const *in, unsigned char *out, int count) const
 for internal use only
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, int *rInts, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned char &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, char &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned short &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, short &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, int &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, float &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, float *rFloats, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, char *m_string, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned char *m_string, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, int *rInts, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, short *rShorts, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned short *rShorts, unsigned int n)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, unsigned char &value)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, int &value)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, char &value)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, unsigned short &value)
 
TK_Status GetAsciiImageData (BStreamFileToolkit &tk, const char *tag, unsigned char *rValues, unsigned int n)
 
TK_Status GetData (BStreamFileToolkit &tk, char *b, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, short *s, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, int *i, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, float *f, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, double *d, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned char *b, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned short *s, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned int *i, int n)
 
TK_Status GetData (BStreamFileToolkit &tk, char &c)
 
TK_Status GetData (BStreamFileToolkit &tk, short &s)
 
TK_Status GetData (BStreamFileToolkit &tk, int &i)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned char &b)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned short &s)
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned int &i)
 
TK_Status GetData (BStreamFileToolkit &tk, float &f)
 
TK_Status GetData (BStreamFileToolkit &tk, double &d)
 
TK_Status GetGeneral (BStreamFileToolkit &tk)
 
void increase_nesting (BStreamFileToolkit &tk, int amount=1)
 for internal use only
 
ID_Key last_key (BStreamFileToolkit &tk) const
 obsolete
 
void log_opcode (BStreamFileToolkit &tk, unsigned int sequence, unsigned char opcode)
 for internal use only
 
TK_Status LookatData (BStreamFileToolkit &tk, unsigned char &b)
 
BBaseOpcodeHandlerOpcode_Handler (BStreamFileToolkit &tk, unsigned char op) const
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, char const *b, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, short const *s, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, int const *i, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, float const *f, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned char const *b, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned short const *s, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned int const *i, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, char const &c)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, short const &s)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned char const &b)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned short const &s)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned int const &i)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, float const &f)
 
TK_Status PutAsciiFlag (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiHex (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiMask (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiOpcode (BStreamFileToolkit &tk, int adjust=1, bool is_end=false, bool want_newline=true)
 
TK_Status PutData (BStreamFileToolkit &tk, char const *b, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, short const *s, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, int const *i, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, float const *f, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, double const *d, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned char const *b, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned short const *s, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned int const *i, int n)
 
TK_Status PutData (BStreamFileToolkit &tk, char const &c)
 
TK_Status PutData (BStreamFileToolkit &tk, short const &s)
 
TK_Status PutData (BStreamFileToolkit &tk, int const &i)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned char const &b)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned short const &s)
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned int const &i)
 
TK_Status PutData (BStreamFileToolkit &tk, float const &f)
 
TK_Status PutData (BStreamFileToolkit &tk, double const &d)
 
TK_Status PutEndXMLTag (BStreamFileToolkit &tk, char const *tag)
 
TK_Status PutGeneral (BStreamFileToolkit &tk)
 
TK_Status PutOpcode (BStreamFileToolkit &tk, int adjust=1)
 
TK_Status PutStartXMLTag (BStreamFileToolkit &tk, char const *tag)
 
TK_Status Read_Referenced_Segment (BStreamFileToolkit &tk, int &i_progress)
 
TK_Status ReadAsciiLine (BStreamFileToolkit &tk, unsigned int *readSize=0)
 
TK_Status ReadAsciiWord (BStreamFileToolkit &tk, unsigned int *readSize=0)
 
TK_Status ReadEndOpcode (BStreamFileToolkit &tk)
 
void Record_Instance (BStreamFileToolkit &tk, ID_Key key, int variant, int val1, int val2, int val3) const
 
void Remember_Item (BStreamFileToolkit &tk, ID_Key key) const
 
ID_Key remove_segment (BStreamFileToolkit &tk)
 for internal use only
 
bool RemoveAngularBrackets (char *string)
 
bool RemoveQuotes (char *string)
 
void Revisit (BStreamFileToolkit &tk, float priority=0.0f, int variant=0) const
 
void set_last_key (BStreamFileToolkit &tk, ID_Key key)
 sets the given key as "most recent" on the toolkit for the purposes of associating keys with indices
 
TK_Status SkipNewlineAndTabs (BStreamFileToolkit &tk, unsigned int *readSize=0)
 
bool validate_count (int count, int limit=1<< 24) const
 
- Static Protected Member Functions inherited from BBaseOpcodeHandler
static float read_float (char const *cp, char const **newcpp=0)
 
static float read_float (char const *cp, char **newcpp)
 for internal use only
 
static char * write_float (char *buffer, double f)
 for internal use only
 

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

Member Function Documentation

TK_Status TK_NURBS_Surface::Clone ( BStreamFileToolkit tk,
BBaseOpcodeHandler **  handler 
) const
virtual

Copies the opcode handler

Parameters
tkA reference to the BStreamFileToolkit object.
handlerA pointer to the opcode handler object. Passed by reference.
Returns
The result of the function call.

Reimplemented from BBaseOpcodeHandler.

double const* TK_NURBS_Surface::GetDPoints ( ) const
inline

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

double* TK_NURBS_Surface::GetDPoints ( )
inline

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

int TK_NURBS_Surface::GetOptions ( ) 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.

float const* TK_NURBS_Surface::GetPoints ( ) const
inline

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

float* TK_NURBS_Surface::GetPoints ( )
inline

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

HT_NURBS_Trim* TK_NURBS_Surface::GetTrims ( )
inline

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

int TK_NURBS_Surface::GetUDegree ( ) const
inline

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

float const* TK_NURBS_Surface::GetUKnots ( ) 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.

float* TK_NURBS_Surface::GetUKnots ( )
inline

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

int TK_NURBS_Surface::GetUSize ( ) const
inline

gets the number of control points in the U direction

int TK_NURBS_Surface::GetVDegree ( ) 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)

float const* TK_NURBS_Surface::GetVKnots ( ) 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.

float* TK_NURBS_Surface::GetVKnots ( )
inline

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

int TK_NURBS_Surface::GetVSize ( ) const
inline

gets the number of control points in the V direction

float const* TK_NURBS_Surface::GetWeights ( ) const
inline

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

float* TK_NURBS_Surface::GetWeights ( )
inline

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

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
tkA reference to the BStreamFileToolkit object.
Returns
The result of the function call.

Implements BBaseOpcodeHandler.

void TK_NURBS_Surface::Reset ( )
virtual

prepares the handler for reuse during reading or writing

Reimplemented from BBaseOpcodeHandler.

void TK_NURBS_Surface::SetDSurface ( int  u_degree,
int  v_degree,
int  u_size,
int  v_size,
double 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.

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.

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
tkA 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

HT_NURBS_Trim* TK_NURBS_Surface::m_current_trim
protected

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

double* TK_NURBS_Surface::m_dcontrol_points
protected

internal use; array of doubles for control point coordinates

unsigned char TK_NURBS_Surface::m_degree[2]
protected

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

Referenced by HT_NURBS_Trim::GetDegree().

unsigned char TK_NURBS_Surface::m_optionals
protected

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

int TK_NURBS_Surface::m_size[2]
protected

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

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

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.

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.

float* TK_NURBS_Surface::m_weights
protected

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

Referenced by HT_NURBS_Trim::GetWeights().


The documentation for this class was generated from the following file: