WT_Layer Class Reference
[Rendition attributes]

#include <layer.h>

Inheritance diagram for WT_Layer:

Inheritance graph
[legend]
Collaboration diagram for WT_Layer:

Collaboration graph
[legend]
List of all members.

Detailed Description

Rendition attribute describing a layer - a relation to a group of objects.

See also:
WT_Rendition
Examples:

WhipExamples/Layer.cpp.

Definition at line 39 of file layer.h.

Public Member Functions

 WT_Layer ()
 Constructs a WT_Layer object.
 WT_Layer (WT_File &file, WT_Integer32 layer_num, char const *layer_name=WD_Null)
 Constructs a WT_Layer object wth the given data.
 WT_Layer (WT_File &file, WT_Integer32 layer_num, WT_Unsigned_Integer16 const *layer_name)
 Constructs a WT_Layer object wth the given data.
 WT_Layer (WT_Layer const &layer)
 Constructs a WT_Layer object. Copy constructor.
virtual ~WT_Layer ()
WT_String const & layer_name ()
 Returns the layer name.
WT_Integer32 const & layer_num () const
 Returns the layer number.
WT_Integer32layer_num ()
void set (char const *layer_name, WT_File &file)
 Sets the layer name.
void set (WT_Unsigned_Integer16 const *layer_name, WT_File &file)
 Sets the layer name.
void set (WT_Layer const &layer)
 Sets the layer contents from another (copies its contents.).
void set_visibility (WT_Boolean vis)
 Sets the layer visibility.
WT_Boolean visibility ()
 Returns the layer visibility.
WT_Layer const & operator= (WT_Layer const &layer)
 Assignment operator. Sets the layer contents from another (copies its contents.).
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_Layer &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_Class_Factory
class WT_W2D_Class_Factory
class WT_Opcode
class WT_Layer_List


Constructor & Destructor Documentation

WT_Layer::WT_Layer WT_File file,
WT_Integer32  layer_num,
char const *  layer_name = WD_Null
 

Constructs a WT_Layer object wth the given data.

Parameters:
file  The file being written.
layer_num  The layer number.
layer_name  The optional layer name.

WT_Layer::WT_Layer WT_File file,
WT_Integer32  layer_num,
WT_Unsigned_Integer16 const *  layer_name
 

Constructs a WT_Layer object wth the given data.

Parameters:
file  The file being written.
layer_num  The layer number.
layer_name  The layer name.


Member Function Documentation

static WT_Result WT_Layer::default_process WT_Layer 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_Layer::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_Layer::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_Layer::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.

void WT_Layer::set WT_Unsigned_Integer16 const *  layer_name,
WT_File file
 

Sets the layer name.

Parameters:
layer_name  The new layer name.
file  The file being written.

void WT_Layer::set char const *  layer_name,
WT_File file
 

Sets the layer name.

Parameters:
layer_name  The new layer name.
file  The file being written.

void WT_Layer::set_visibility WT_Boolean  vis  )  [inline]
 

Sets the layer visibility.

Bug:
The layer visibility is neither serialized nor materialized. This option was not part of the original WHIP! spec. Changing at this stage would be prohibitively difficult. Another workaround exists, the layer materialize / serialize code could use the rendition visibility to determine its state; however existing WHIP! data was written assuming that the layer didn't pay attention to the rendition visibility. Were we to start doing so, many legacy drawings would be materialized has having invisible layers, not the author's intention.

Definition at line 123 of file layer.h.

WT_Result WT_Layer::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_Layer::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