WT_Object_Node Class Reference
[Rendition attributes]

#include <object_node.h>

Inheritance diagram for WT_Object_Node:

Inheritance graph
[legend]
Collaboration diagram for WT_Object_Node:

Collaboration graph
[legend]
List of all members.

Detailed Description

Rendition attribute describing the current object node - a relation to a group of objects (similar to objects on the same layer.).

Graphic objects in a W2D file can be assigned to a specific node, which is a grouping of opcodes that can later be referenced from external metadata, or used for a particular selection behavior if desired. For example, in a mechanical drawing, an object node can be used to group multiple primitives belonging to a particular part.

To put it plainly, the node attribute is essentially another layering mechanism (albeit without visibility control). A geometric primitive belongs in a maximum of object node. Primitaves in the same node may reside on different layers.

A node attribute is attached to a specific set of opcodes by surrounding them with a pair of WT_Object_Node opcodes (i.e. 'node on', 'node off') just like is found with WT_Layer opcodes. As with layers, only one object node is current at any given moment during serialization or materialization. If an object node is current in a W2D file stream and a second node is specified, the second node "takes over" and applies to subsequent geometric primitives. Object nodes do not nest, unlike the Kittiwake, which nests primarily between February and August in the various sea cliffs of Scotland.

See also:
WT_Rendition
Examples:

WhipExamples/ObjectNode.cpp.

Definition at line 59 of file object_node.h.

Public Member Functions

 WT_Object_Node ()
 Constructs a WT_Object_Node object.
 WT_Object_Node (WT_File &file, WT_Integer32 object_node_num, char const *object_node_name=WD_Null)
 Constructs a WT_Object_Node object with the given data.
 WT_Object_Node (WT_File &file, WT_Integer32 object_node_num, WT_Unsigned_Integer16 const *object_node_name)
 Constructs a WT_Object_Node object with the given data.
 WT_Object_Node (WT_Object_Node const &object_node)
 Constructs a WT_Object_Node object. Copy constructor.
virtual ~WT_Object_Node ()
WT_Object_Node const & operator= (WT_Object_Node const &object_node)
 Assignment operator. Assigns the given attribute contents to this one.
WT_String const & object_node_name ()
 Returns the object node name.
WT_Integer32 object_node_num ()
 Returns the object node number.
void set (WT_File &file, WT_Integer32 object_node_num, char const *object_node_name)
 Sets the object node with the given data.
void set (WT_File &file, WT_Integer32 object_node_num, WT_Unsigned_Integer16 const *object_node_name)
 Sets the object node with the given data.
void set (WT_File &file, WT_Integer32 object_node_num)
 Sets the object node with the given data - must already exist.
void set (WT_Object_Node const &object_node)
 Sets the object node with the contents of the given object node.
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_Object_Node &item, WT_File &file)
 Provides a default action handler for this object.

Friends

class WT_Rendition
class WT_Class_Factory
class WT_W2D_Class_Factory
class WT_Opcode
class WT_Group_End
class WT_Group_Begin
class WT_Object_Node_List


Constructor & Destructor Documentation

WT_Object_Node::WT_Object_Node WT_File file,
WT_Integer32  object_node_num,
char const *  object_node_name = WD_Null
 

Constructs a WT_Object_Node object with the given data.

Parameters:
file  The file being written.
object_node_num  The unique identifier of the node.
object_node_name  Optional node name string.

WT_Object_Node::WT_Object_Node WT_File file,
WT_Integer32  object_node_num,
WT_Unsigned_Integer16 const *  object_node_name
 

Constructs a WT_Object_Node object with the given data.

Parameters:
file  The file being written.
object_node_num  The unique identifier of the node.
object_node_name  The node name string.


Member Function Documentation

static WT_Result WT_Object_Node::default_process WT_Object_Node 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_Object_Node::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_Object_Node::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_Object_Node::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_Object_Node::set WT_File file,
WT_Integer32  object_node_num
 

Sets the object node with the given data - must already exist.

Parameters:
file  The file being written.
object_node_num  The unique identifier of the node.

void WT_Object_Node::set WT_File file,
WT_Integer32  object_node_num,
WT_Unsigned_Integer16 const *  object_node_name
 

Sets the object node with the given data.

Parameters:
file  The file being written.
object_node_num  The unique identifier of the node.
object_node_name  The node name string.

void WT_Object_Node::set WT_File file,
WT_Integer32  object_node_num,
char const *  object_node_name
 

Sets the object node with the given data.

Parameters:
file  The file being written.
object_node_num  The unique identifier of the node.
object_node_name  The node name string.

WT_Result WT_Object_Node::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_Object_Node::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:23 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5