WT_Line_Pattern Class Reference
[Rendition attributes]

#include <linepat.h>

Inheritance diagram for WT_Line_Pattern:

Inheritance graph
[legend]
Collaboration diagram for WT_Line_Pattern:

Collaboration graph
[legend]
List of all members.

Detailed Description

Rendition attribute describing the current line pattern to be applied to subsequent lines and arcs.

Note:
The line pattern setting is overridden by the dash pattern, if set.
Rendering should treat ISO linetypes with care. ISO linetypes specify an exact paper scaled on-off linefont at a specific paper scaled line weight. If the lineweight is changed, the linefont scaling changes proportionally. Doubling the line weight also makes the linefont twice as large. Renderers should consistently stroke these linetypes out as a series of wide lines and gaps. A table of the ISO pattern definitions, for a line weight of 1.0 mm, in pixels (at 200 pixels per inch) is shown below:

IsoLinetypes.png

ISO linetype metrics for a lineweight of 1.0mm at 200 pixels per inch

Given the table values apply to a 1mm line at 200 DPI, we can assume that the table values must double at 400 DPI. Since many DWFs are configured for 400 DPI, both values are mentioned for comparison. At 200 DPI, a 1mm linewidth yields 1X table values; further, a 1mm line width is 1/25.4 inches * 200 DPI = 7.87 pixels thick ~ 8 pixels. At 400 DPI, a 1mm linewidth yields 2X table values; further, a 1mm line width is 15.75 pixels thick ~ 16 pixels. So, the table as written corresponds to a 8-pixel thick line at 200 DPI for the given values.

As line widths scale up or down, we need to scale the pattern lengths. If a line has a weight of 20 WHIP-space units, and given a to-paper scaling value .0025 yielding centimeters, we get: line thickness in millimeters = 10 * (dwfUnitsLineweight * toCentimetersPaperScale). So, .5 millimeters = 10 * (20 * .0025). At 200 DPI, a .5mm linewidth is .5/25.4 inches * 200 = 3.937 pixels thick ~ 4 pixels, and our table scale is .5X table values. At 400 DPI, a .5mm linewidth is 7.87 pixels thick ~ 8 pixels, and our table scale is 1X table values.

To summarize, for a to-paper scaling value which yields centimeters, the table scaling formula is:

For a to-paper scaling value which yields inches, the table scaling formula is:

For example, a table scale of .5 applied to the ISO_Dash_Dot table entry yields a pattern that is 36 pixels wide, with 24,6,0,6 as the values.

See also:
WT_Rendition

WT_Dash_Pattern

Examples:

WhipExamples/LinePattern.cpp.

Definition at line 69 of file linepat.h.

Public Types

enum  WT_Pattern_ID { Illegal , Count, Undefined = -1 }
 Predefined line pattern IDs. More...

Public Member Functions

 WT_Line_Pattern ()
 Constructs a WT_Line_Pattern object.
 WT_Line_Pattern (WT_Pattern_ID id)
 Constructs a WT_Line_Pattern object with the given predefined pattern ID.
 WT_Line_Pattern (WT_Line_Pattern const &pat)
virtual ~WT_Line_Pattern ()
WT_Pattern_ID pattern_id () const
 Returns the line pattern ID (one of enum WT_Pattern_ID).
void set (WT_Pattern_ID i)
 Sets the line pattern ID (one of enum WT_Pattern_ID).
 operator WT_Pattern_ID () const
 Returns the line pattern ID (one of enum WT_Pattern_ID).
virtual WT_Line_Patternoperator= (WT_Pattern_ID i)
 Assignment operator. Sets the line pattern ID (one of enum WT_Pattern_ID).
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.
WT_Boolean operator== (WT_Pattern_ID i) const
 Returns WD_True if the given pattern ID matches this pattern's ID.

Static Public Member Functions

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

Friends

class WT_Rendition
class WT_W2D_Class_Factory
class WT_Opcode


Member Enumeration Documentation

enum WT_Line_Pattern::WT_Pattern_ID
 

Predefined line pattern IDs.

Enumerator:
Illegal  Not a pattern.
Count  Not a pattern, should be the number of patterns + 1
Undefined  Not a pattern.

Definition at line 78 of file linepat.h.


Member Function Documentation

static WT_Result WT_Line_Pattern::default_process WT_Line_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_Line_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_Line_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_Line_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_Line_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_Line_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:20 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5