WT_Pen_Pattern Class Reference
[Rendition attributes]

#include <penpat.h>

Inheritance diagram for WT_Pen_Pattern:

Inheritance graph
[legend]
Collaboration diagram for WT_Pen_Pattern:

Collaboration graph
[legend]
List of all members.

Detailed Description

Rendition attribute describing the current pen pattern.

This specifies the pen set or the pen pattern type to be used by a rendering application before rendering WHIP! drawables. The WHIP! Toolkit defines 105 face patterns and 5 screening pen sets, the latter specified with an associated screening percentage value. Screening percentage values are not applied to the face patterns.

The pen pattern attribute should be applied to wide and thick lines, filled solids, texts, polylines and polytriangles. In the absence of a color map, rendering applications viewers should choose foreground and background colors from the rendition to represent an opaque pattern.

See also:
WT_Rendition

Definition at line 48 of file penpat.h.

Public Types

enum  WT_Pattern_ID {
  Illegal, Screening_Black, Screening_Alternate, Screening_Block,
  Screening_Dots, Screening_Big_Dots , Count, Undefined = -1
}
 Predefined screening pen sets and pen patterns. More...

Public Member Functions

 WT_Pen_Pattern ()
 Constructs a WT_Pen_Pattern object.
 WT_Pen_Pattern (WT_Pattern_ID pattern_id)
 Constructs a WT_Pen_Pattern object with the given predefined pattern ID.
 WT_Pen_Pattern (WT_Pattern_ID pattern_id, WT_Unsigned_Integer32 screening_percentage, WT_Boolean colormap_flag, WT_Color_Map const *color_map, WT_Boolean copy) throw (WT_Result)
 Constructs a WT_Pen_Pattern object with the given data.
 WT_Pen_Pattern (WT_Pen_Pattern const &pattern) throw (WT_Result)
 Constructs a WT_Pen_Pattern object. Copy constructor.
virtual ~WT_Pen_Pattern ()
 Destroys a a WT_Pen_Pattern object.
WT_Boolean is_local_color_map_copy () const
WT_Color_Map const * color_map () const
 Returns the color map used for this pen pattern (may be NULL.).
WT_Pattern_ID pen_pattern () const
 Returns WD_True if the color map has valid content.
WT_Unsigned_Integer32 screening_percentage () const
 Returns the screening percentage, if using a pen set (as opposed to a face pattern.).
void set_pen_pattern (WT_Pattern_ID pattern_id)
 Sets the pen pattern to a predefined pattern ID, one of enum WT_Pattern_ID.
void set_screening_percentage (const WT_Unsigned_Integer32 screening_percentage)
 Sets the screening percentage, if using a pen set (as opposed to a face pattern.).
virtual WT_Pen_Patternoperator= (WT_Pattern_ID const &id)
 Assignment operator. Sets the pen pattern ID to a predefined pattern ID, one of enum WT_Pattern_ID.
virtual WT_Pen_Patternoperator= (const WT_Pen_Pattern &pen_pattern) throw (WT_Result)
 Assignment operator. Copies the given pattern object contents to this one.
WT_Boolean operator!= (WT_Pen_Pattern const &pattern) const
 Returns WD_True if the given pattern is NOT equal to this one.
WT_Boolean operator== (WT_Pattern_ID const &id) const
 Returns WD_True if the given pattern ID is equal to this one.
WT_ID object_id () const
 Returns the WT_ID for this object.
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 process (WT_File &file)
 Calls the configured action handler for this object (passes in the file reference.).
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 serialize (WT_File &file) const
 Forces the serialization of the object to the file.
WT_Result sync (WT_File &file) const
 Serializes the attribute out to the file, if necessary.
WT_Boolean operator== (WT_Attribute const &attrib) const
 Returns WD_True if the attributes are equal.

Static Public Member Functions

static WT_Result default_process (WT_Pen_Pattern &item, WT_File &file)
 Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).

Protected Types

enum  

Protected Attributes

WT_Pattern_ID m_id
WT_Unsigned_Integer32 m_screening_percentage
WT_Color_Mapm_color_map
WT_Boolean m_local_color_map_copy
WT_Opcode m_colormap_opcode

Friends

class WT_Rendition
class WT_W2D_Class_Factory
class WT_Opcode


Member Enumeration Documentation

enum WT_Pen_Pattern::WT_Pattern_ID
 

Predefined screening pen sets and pen patterns.

Enumerator:
Illegal  Not a pattern.
Screening_Black  Screening pen set, use with a screening percentage.
Screening_Alternate  Screening pen set, use with a screening percentage.
Screening_Block  Screening pen set, use with a screening percentage.
Screening_Dots  Screening pen set, use with a screening percentage.
Screening_Big_Dots  Screening pen set, use with a screening percentage.
Count  Not a pattern. Should be the number of patterns + 1.
Undefined  Not a pattern.

Definition at line 56 of file penpat.h.


Member Function Documentation

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

Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).

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

WT_Result WT_Pen_Pattern::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_Pen_Pattern::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_Pen_Pattern::serialize WT_File file  )  const [virtual]
 

Forces the serialization of the object to the file.

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

Implements WT_Attribute.

WT_Result WT_Pen_Pattern::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_Pen_Pattern::sync WT_File file  )  const [virtual]
 

Serializes the attribute out to the file, if necessary.

Only outputs relevant desired rendition changes to the file.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
See also:
WT_File::desired_rendition().

Implements WT_Attribute.


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