Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

WT_Point_Set Class Reference

#include <pointset.h>

Inheritance diagram for WT_Point_Set:

Inheritance graph
[legend]
Collaboration diagram for WT_Point_Set:

Collaboration graph
[legend]
List of all members.

Detailed Description

A base class for a set of WT_Logical_Point objects.

Definition at line 26 of file pointset.h.

Public Member Functions

Construction / destruction
 WT_Point_Set ()
 Constructs a WT_Point_Set object.
 WT_Point_Set (int count, WT_Logical_Point const *points, WT_Boolean copy)
 Constructs a WT_Point_Set object from a given array of points.
virtual ~WT_Point_Set ()
 Destroys a WT_Point_Set object, and deletes the points if they had been copied in the constructor.
Get methods
WT_Logical_Pointpoints () const
 Returns a pointer to the array of points.
Status methods
int allocated () const
 Returns the number of allocated points (zero if the points were directly referenced in the constructor.).
void clear ()
 Clears the list of points, and deletes the points if they had been copied in the constructor.
int count () const
 Returns the number of points in the set.
WT_Boolean first_point_fits_in_16_bits () const
 Returns WD_True if the first point in the set can be expressed using a WT_Logical_Point16 object.
WT_Boolean remaining_points_fit_in_16_bits () const
 Returns WD_True if the remaining points in the set (beyond the first) can be expressed using a WT_Logical_Point16 object.
WT_Boolean operator== (WT_Point_Set const &set) const
 Equality operator. Returns WD_True if the given point set matches this one.
Materialization / serialization methods
virtual WT_Result materialize (WT_File &file)
 Materializes the point set from the file as a set of WT_Logical_Point32 objects.
virtual WT_Result materialize_ascii (WT_File &file)
 Materializes the point set from the file as ASCII-serialized points.
virtual WT_Result materialize_16_bit (WT_File &file)
 Materializes the point set from the file as a set of WT_Logical_Point16 objects.
WT_Result serialize (WT_File &file, WT_Byte opcode_ascii, WT_Byte opcode_32bit, WT_Byte opcode_16bit) const
 Causes the serialization of the object to the file.
virtual WT_Result skip_operand (WT_File &file)
 Causes the file reading to proceed to the end of this object.
virtual WT_Result skip_operand_ascii (WT_File &file)
 Causes the file reading to proceed to the end of this object.
virtual WT_Result skip_operand_16_bit (WT_File &file)
 Causes the file reading to proceed to the end of this object.
Manipulation methods
void de_relativize (WT_File &file)
 Returns the points to absolute values based on their relative position to last materialized point.
void relativize (WT_File &file)
 Relativizes the points in the set to the last serialized point.
WT_Point_Set const & set (int count, WT_Logical_Point const *points, WT_Boolean copy)
 Sets the current point set with other contents (deletes the current set if allocated.).
void transform (WT_Transform const &transform)
 Applies the given transform to the point set.

Protected Attributes

WT_Integer32 m_count
 The number of points in the set.
WT_Integer32 m_allocated
 The number of allocated points.
WT_Logical_Pointm_points
 The arrray of points.
WT_Boolean m_transformed
 WD_True if the points have been transformed.
WT_Boolean m_relativized
 WD_True if the points have been relativized.
int m_points_materialized
 The number of points materialized.


Constructor & Destructor Documentation

WT_Point_Set::WT_Point_Set int  count,
WT_Logical_Point const *  points,
WT_Boolean  copy
 

Constructs a WT_Point_Set object from a given array of points.

Warning:
Be careful when using the copy parameter. If the points are not copied, and they get deallocated, trouble will ensue. It's usually always safe to create copies of the points, but it may not always be a desirable choice due to performance. To help provide a means to mitigate the performance hit taken due to allocation and deallocation, the option is available to refer to the points directly.
Parameters:
count  The number of points in the array.
points  Pointer to the array of points.
copy  Whether the points should be copied or if their addresses should be used directly from the array.


Member Function Documentation

virtual WT_Result WT_Point_Set::materialize WT_File file  )  [virtual]
 

Materializes the point set from the file as a set of WT_Logical_Point32 objects.

Reads in the object data and causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
WT_Result::Out_Of_Memory_Error Could not allocate the points.

Reimplemented in WT_Gouraud_Point_Set.

virtual WT_Result WT_Point_Set::materialize_16_bit WT_File file  )  [virtual]
 

Materializes the point set from the file as a set of WT_Logical_Point16 objects.

Reads in the object data and causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
WT_Result::Out_Of_Memory_Error Could not allocate the points.

Reimplemented in WT_Gouraud_Point_Set.

virtual WT_Result WT_Point_Set::materialize_ascii WT_File file  )  [virtual]
 

Materializes the point set from the file as ASCII-serialized points.

Reads in the object data and causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
WT_Result::Corrupt_File_Error No points in the set.
WT_Result::Out_Of_Memory_Error Could not allocate the points.

Reimplemented in WT_Gouraud_Point_Set.

WT_Result WT_Point_Set::serialize WT_File file,
WT_Byte  opcode_ascii,
WT_Byte  opcode_32bit,
WT_Byte  opcode_16bit
const
 

Causes the serialization of the object to the file.

If this is a WT_Drawable derived object, this method may cause the object to be delayed (in case a coincident like-object follows) and/or merged (in case a coincident like-object preceeded) so as to optimize the output.

Return values:
WT_Result::Success The operation was successful.
Parameters:
file  The file being written.
opcode_ascii  The opcode to use if writing ASCII.
opcode_32bit  The opcode to use for a point set utilizing WT_Logical_Point32 objects.
opcode_16bit  The opcode to use for a point set utilizing WT_Logical_Point16 objects.

WT_Point_Set const& WT_Point_Set::set int  count,
WT_Logical_Point const *  points,
WT_Boolean  copy
 

Sets the current point set with other contents (deletes the current set if allocated.).

Parameters:
count  The number of points in the array.
points  Pointer to the array of points.
copy  Whether the points should be copied or if their addresses should be used directly from the array.

virtual WT_Result WT_Point_Set::skip_operand WT_File file  )  [virtual]
 

Causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.

Reimplemented in WT_Gouraud_Point_Set.

virtual WT_Result WT_Point_Set::skip_operand_16_bit WT_File file  )  [virtual]
 

Causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.

Reimplemented in WT_Gouraud_Point_Set.

virtual WT_Result WT_Point_Set::skip_operand_ascii WT_File file  )  [virtual]
 

Causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.

Reimplemented in WT_Gouraud_Point_Set.


The documentation for this class was generated from the following file:
Generated on Tue May 17 12:08:03 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1