HT_NURBS_Trim
Functions
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
HT_NURBS_Trim const * |
|
int |
|
int |
|
float const * |
|
float * |
|
int |
|
float |
|
float |
|
int |
|
float const * |
|
float * |
|
float const * |
|
float * |
|
HT_NURBS_Trim const * |
|
Detailed Description
-
class HT_NURBS_Trim : public BBaseOpcodeHandler
Does not handle any top level opcodes, but rather only the trim types allowable on nurbs surfaces.
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.
Public Functions
-
~HT_NURBS_Trim()
-
void 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.
-
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)
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 SetCollection()
Configures *this to read or write a trim collection
-
HT_NURBS_Trim *PrependCollection()
Prepends a trim to the internal trim collection
-
inline void SetOptions(int o)
sets the options bit flags to indicate the presence of all of the optional fields
-
inline void SetList(HT_NURBS_Trim *node)
sets the head of the list of a NS_TRIM_COLLECTION.
-
inline void SetNext(HT_NURBS_Trim *next)
sets the next pointer of a trim. Used for linked list management
-
inline void SetStart(float start)
-
inline void SetEnd(float end)
-
virtual TK_Status Read(BStreamFileToolkit &tk)
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.
-
virtual TK_Status Write(BStreamFileToolkit &tk)
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.
-
TK_Status ReadAscii(BStreamFileToolkit &tk)
Deprecated.
-
TK_Status WriteAscii(BStreamFileToolkit &tk)
Deprecated.
-
TK_Status read_collection_ascii(BStreamFileToolkit &tk)
-
TK_Status write_collection_ascii(BStreamFileToolkit &tk)
-
inline HT_NURBS_Trim *GetNext(void)
gets the next trim in the list
-
inline HT_NURBS_Trim const *GetNext(void) const
-
inline int GetType() const
gets an identifier for the trim type. Legal values are NS_TRIM_POLY, NS_TRIM_CURVE, and NS_TRIM_COLLECTION
-
inline int GetCount() const
(relevant to NS_TRIM_CURVE and NS_TRIM_POLY only), gets the number of vertices in the trim.
-
inline float const *GetPoints() const
(relevant to NS_TRIM_CURVE and NS_TRIM_POLY only), returns a const pointer to the vertices
-
inline float *GetPoints()
(relevant to NS_TRIM_CURVE and NS_TRIM_POLY only), returns a mutable pointer to the vertices
-
inline int GetDegree() const
(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. (relevant to NS_TRIM_CURVE only), the start point of the trim curve. Parameter is specified in the range of 0 to 1.
-
inline float GetStart() const
(relevant to NS_TRIM_CURVE only), the end point of the trim curve. Parameter is specified in the range of 0 to 1.
-
inline float GetEnd() const
-
inline int GetOptions() const
(relevant to NS_TRIM_CURVE only), returns the options bit flags to indicate the presence of all of the optional fields
-
inline float const *GetWeights() const
(relevant to NS_TRIM_CURVE only), returns a const pointer to the control point weights
-
inline float *GetWeights()
(relevant to NS_TRIM_CURVE only), returns a mutable pointer to the control point weights
-
inline float const *GetKnots() const
(relevant to NS_TRIM_CURVE only), returns a const pointer to the trim curve’s knots
-
inline float *GetKnots()
(relevant to NS_TRIM_CURVE only), returns a mutable pointer to the trim curve’s knots
-
inline HT_NURBS_Trim const *GetList() const
(relevant to NS_TRIM_COLLECTION only), returns a const pointer the collection’s linked list
-
inline HT_NURBS_Trim *GetList()
(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.
-
~HT_NURBS_Trim()