WT_Contour_Set Class Reference
[Drawable objects]

#include <contour_set.h>

Inheritance diagram for WT_Contour_Set:

Inheritance graph
[legend]
Collaboration diagram for WT_Contour_Set:

Collaboration graph
[legend]
List of all members.

Detailed Description

A drawable describing a set of contours (containing positive and negative filled regions.).

Clockwise-wound contours indicate positive (filled) spaces. Counterclockwise-wound contours indicate negative spaces (holes).

ContourSet.png

Contour set positive/negative windings details

Examples:

WhipExamples/ContourSet.cpp, and WhipExamples/Viewport.cpp.

Definition at line 41 of file contour_set.h.

Public Member Functions

 WT_Contour_Set ()
 Constructs a WT_Contour_Set object.
 WT_Contour_Set (WT_File &file, WT_Integer32 contours, WT_Integer32 const *counts, WT_Integer32 point_count, WT_Logical_Point const *points, WT_Boolean copy) throw (WT_Result)
 Constructs a WT_Contour_Set object with the given data.
 WT_Contour_Set (WT_File &file, WT_Integer32 point_count, WT_Logical_Point const *points) throw (WT_Result)
 Constructs a WT_Contour_Set object with the given data for one countour (i.e. a polygon). Copies the points locally.
 WT_Contour_Set (WT_Contour_Set const &source, WT_Boolean copy=WD_True) throw (WT_Result)
 Constructs a WT_Contour_Set object with the given data. Can be used as a copy constructor.
virtual ~WT_Contour_Set ()
 Destroys a WT_Contour_Set object.
virtual WT_Contour_Setcopy (WT_Boolean copy=WD_True) const
 Virtual abstract copy. Copies a WT_Contour_Set object.
WT_Integer32 const & contours () const
 Returns the number of contours in the set.
WT_Integer32contours ()
WT_Integer32counts () const
 The array of counts (each array item indicates the number of points in the respective contour.).
WT_Logical_Point const * points () const
 The array of points used by the contours.
WT_Integer32 const & total_points () const
 The total number of points in the contour set.
WT_Integer32total_points ()
virtual WT_Result de_relativize (WT_File &file)
 Returns the points to absolute values based on their relative position to last materialized point.
virtual WT_Result relativize (WT_File &file)
 Relativizes the points in the set to the last serialized point.
WT_Result set (WT_Unsigned_Integer32 incarnation, WT_Integer32 contours, WT_Integer32 const *counts, WT_Integer32 point_count, WT_Logical_Point const *points, WT_Boolean copy)
 Replaces the contents of the contour set with the given data.
WT_Result transform (WT_Transform const &transform)
 Applies the given transform to the point set.
WT_Contour_Set const & operator= (WT_Contour_Set const &source) throw (WT_Result)
 Assignment operator. Assigns the given list contents to this one.
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_Contour_Set const &other) const
 Equality operator. Returns WD_True if the given list's contents is equal to this one.
WT_Result materialize (WT_Opcode const &opcode, WT_File &file)
 Materializes the contents of the object from the file and the given opcode.
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 materialize_32_bit (WT_File &file)
 Materializes the point set from the file as a set of WT_Logical_Point32 objects.
WT_ID object_id () const
 Returns the WT_ID for this object.
WT_Result process (WT_File &file)
 Calls the configured action handler for this object (passes in the file reference.).
WT_Result serialize (WT_File &file) const
 Causes the serialization of the object to the file.
WT_Result serialize (WT_File &file, WT_Boolean embeded_in_another_opcode) const
 Causes the serialization of the object to the file.
WT_Result skip_operand (WT_File &file)
 Causes the file reading to proceed to the end of this object.
WT_Result skip_operand (WT_Opcode const &opcode, WT_File &file)
 Causes the file reading to proceed to the end of this object.
WT_Result skip_operand_16_bit (WT_File &file)
 Causes the file reading to proceed to the end of this object.
virtual void update_bounds (WT_File *file)
 Forces the drawable bounds to be updated.

Static Public Member Functions

static WT_Result default_process (WT_Contour_Set &item, WT_File &file)
 Provides a default action handler for this object.

Protected Types

enum  WT_Materialize_Stage
 Materialization stage.

Protected Attributes

WT_Unsigned_Integer32 m_incarnation
 Rendition incarnation.
WT_Integer32 m_num_contours
 The number of contours in the set (size of counts_list.).
WT_Integer32m_counts_list
 The array of counts (each array item indicates the number of points in the respective contour.).
WT_Integer32 m_total_point_count
 The total number of points in the contour set.
WT_Boolean m_local_copy
 WD_True if the points in the set were allocated locally (instead of being referenced directly from an external data pool.).
WT_Boolean m_local_copy_counts
 WD_True if the m_counts_list in the set were allocated locally (instead of being referenced directly from an external data pool.).
WT_Logical_Pointm_points
 The array of points used by the contours.
WT_Boolean m_transformed
 WD_True if the points have been transformed.
WT_Boolean m_relativized
 WD_True if the points have been relativized.
enum WT_Contour_Set::WT_Materialize_Stage m_stage
 Materialization stage.
WT_Integer32 m_stage_item_counter
 Used during materialization as a contour counter.

Friends

class WT_W2D_Class_Factory
class WT_Viewport
class WT_Opcode


Constructor & Destructor Documentation

WT_Contour_Set::WT_Contour_Set WT_File file,
WT_Integer32  contours,
WT_Integer32 const *  counts,
WT_Integer32  point_count,
WT_Logical_Point const *  points,
WT_Boolean  copy
throw (WT_Result)
 

Constructs a WT_Contour_Set object with the given data.

Parameters:
file  The current file (used for its incarnation value.)
contours  The number of contours in the set (size of the counts array.)
counts  The array of counts (each array item indicates the number of points in the respective contour.)
point_count  The total number of points in the contour set (should equal the sum of the counts.)
points  The array of points used by the contours.
copy  Whether the points should be copied or if their addresses should be used directly from the array.

WT_Contour_Set::WT_Contour_Set WT_File file,
WT_Integer32  point_count,
WT_Logical_Point const *  points
throw (WT_Result)
 

Constructs a WT_Contour_Set object with the given data for one countour (i.e. a polygon). Copies the points locally.

Parameters:
file  The current file (used for its incarnation value.)
point_count  The total number of points in the contour set (should equal the sum of the counts.)
points  The array of points used by the contours.

WT_Contour_Set::WT_Contour_Set WT_Contour_Set const &  source,
WT_Boolean  copy = WD_True
throw (WT_Result)
 

Constructs a WT_Contour_Set object with the given data. Can be used as a copy constructor.

Parameters:
source  The contour set from which to copy.
copy  Whether the points should be copied or if their addresses should be used directly from the array.


Member Function Documentation

virtual WT_Contour_Set* WT_Contour_Set::copy WT_Boolean  copy = WD_True  )  const [virtual]
 

Virtual abstract copy. Copies a WT_Contour_Set object.

Parameters:
copy  Whether the points should be copied or if their addresses should be used directly from the array.

static WT_Result WT_Contour_Set::default_process WT_Contour_Set item,
WT_File file
[static]
 

Provides a default action handler for this object.

Warning:
This is used by the framework and should not be called by client code.
Parameters:
item  The object to process.
file  The file being read.

WT_Result WT_Contour_Set::materialize WT_Opcode const &  opcode,
WT_File file
[virtual]
 

Materializes the contents of the object from the file and the given opcode.

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::Opcode_Not_Valid_For_This_Object The object does not support the opcode type.
WT_Result::Internal_Error Something went very wrong.

Implements WT_Object.

WT_Result WT_Contour_Set::materialize_16_bit WT_File file  ) 
 

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.

WT_Result WT_Contour_Set::materialize_32_bit WT_File file  ) 
 

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.

WT_Result WT_Contour_Set::process WT_File file  )  [virtual]
 

Calls the configured action handler for this object (passes in the file reference.).

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

Implements WT_Object.

WT_Result WT_Contour_Set::serialize WT_File file,
WT_Boolean  embeded_in_another_opcode
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.
embeded_in_another_opcode  WD_True if this object is used as a sub-object of another object.

WT_Result WT_Contour_Set::serialize WT_File file  )  const [inline, virtual]
 

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.

Implements WT_Object.

Examples:
WhipExamples/ContourSet.cpp.

Definition at line 180 of file contour_set.h.

WT_Result WT_Contour_Set::set WT_Unsigned_Integer32  incarnation,
WT_Integer32  contours,
WT_Integer32 const *  counts,
WT_Integer32  point_count,
WT_Logical_Point const *  points,
WT_Boolean  copy
 

Replaces the contents of the contour set with the given data.

Parameters:
incarnation  Rendition incarnation.
contours  The number of contours in the set (size of the counts array.)
counts  The array of counts (each array item indicates the number of points in the respective contour.)
point_count  The total number of points in the contour set (should equal the sum of the counts.)
points  The array of points used by the contours.
copy  Whether the points should be copied or if their addresses should be used directly from the array.

WT_Result WT_Contour_Set::skip_operand WT_Opcode const &  opcode,
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.
Bug:
Not all objects perform skip_operand() correctly; this is a known problem. For best results, if client code must use WT_File::get_next_object_shell() manually, it should also call the corresponding WT_Object::materialize() method to avoid this problem.
See also:
WT_File::get_next_object_shell(), WT_File_Heuristics::set_deferred_delete().

Reimplemented from WT_Object.

WT_Result WT_Contour_Set::skip_operand WT_File file  ) 
 

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.

WT_Result WT_Contour_Set::skip_operand_16_bit WT_File file  ) 
 

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.


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