NodeHidden Class Reference

Nodes are generally never deleted from the tree, instead they are hidden. To hide a node a NodeHidden is inserted into the tree at the old position of the hidden node, the HiddenNode holds a pointer to the hidden node. The static ShowNode function of NodeHidden will delete the NodeHidden and relink the hidden node into the tree. More...

#include <node.h>

Inheritance diagram for NodeHidden:

Node CCObject SimpleCCObject List of all members.

Public Member Functions

 NodeHidden (Node *HiddenNode)
 NodeHidden constructor which hides HiddenNode.
NodeShowNode ()
 This static method will relink the hidden node into the tree. this will be deleted.
virtual NodeSimpleCopy ()
 Causes an ENSURE failure. A hidden node should never be copied.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual BOOL IsNodeHidden () const
 Determine if a node is *derived* from the NodeHidden class.
virtual BOOL IsOrHidesAnAttribute () const
 Enables to determine if this node is an Attribute or is hiding an attribute.
virtual BOOL IsTypeExtendible () const
virtual DocRect ValidateExtend (const ExtendParams &ExtParams)
 Tests the reversibility of an Extend operation applied to this node.
virtual void Extend (const ExtendParams &ExtParams)
 Perform an Extend operation on this Node, and its children if appropriate. Default implementation just calls Extend() on its children.

Public Attributes

NodeHiddenNd

Detailed Description

Nodes are generally never deleted from the tree, instead they are hidden. To hide a node a NodeHidden is inserted into the tree at the old position of the hidden node, the HiddenNode holds a pointer to the hidden node. The static ShowNode function of NodeHidden will delete the NodeHidden and relink the hidden node into the tree.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/9/93
See also:
-

Definition at line 1475 of file node.h.


Constructor & Destructor Documentation

NodeHidden::NodeHidden Node HiddenNode  ) 
 

NodeHidden constructor which hides HiddenNode.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/9/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 4776 of file noderend.cpp.

04776                                       : Node()
04777 {  
04778     ENSURE(HiddenNode != NULL, "Trying to hide a NULL node"); 
04779     HiddenNd = HiddenNode;              // Point to the node which is to be hidden    
04780     HiddenNode->IncHiddenCnt();         // Increase the count of the number of NodeHidden nodes which point 
04781                                         // to the node being hidden. 
04782 
04783     TAG tag = HiddenNd->GetTag();       // Copy tag so we can preserve it after the unlink from tree
04784 
04785     AttachNode(HiddenNode, NEXT); 
04786     HiddenNode->UnlinkNodeFromTree();   // Hide the node
04787 
04788     // Alert !
04789     // This is a bit scary but when doing things like complex deletions we need to find
04790     // the  parent of the hidden node when trying to factor out. I hope that this  
04791     // doesn't break to much !. 
04792     //HiddenNode->Parent = this;  
04793 
04794     HiddenNd->Tag = tag;                // Ensure the unlinked node has a preserved tag
04795 }


Member Function Documentation

virtual void NodeHidden::Extend const ExtendParams ExtParams  )  [inline, virtual]
 

Perform an Extend operation on this Node, and its children if appropriate. Default implementation just calls Extend() on its children.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/11/1999
Parameters:
ExtParams description parameters for the extension. [INPUTS]
This node and some of its children may have their dimensions altered. [OUTPUTS]
Returns:

Errors: See also:

Reimplemented from Node.

Definition at line 1504 of file node.h.

01504 {}

UINT32 NodeHidden::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size of the node in bytes (this is the size of the NodeHidden only, it does not include the size of the hidden subtree).
See also:
Node::GetSubtreeSize

Reimplemented from Node.

Definition at line 4870 of file noderend.cpp.

04871 {     
04872     return (sizeof(NodeHidden)); 
04873 }  

BOOL NodeHidden::IsNodeHidden  )  const [virtual]
 

Determine if a node is *derived* from the NodeHidden class.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/02/95
Returns:
TRUE => This node is an instance of NodeHidden or a derived class. FALSE => otherwise.

Reimplemented from Node.

Definition at line 4887 of file noderend.cpp.

04888 {
04889     return TRUE;
04890 }

BOOL NodeHidden::IsOrHidesAnAttribute  )  const [virtual]
 

Enables to determine if this node is an Attribute or is hiding an attribute.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/6/95
Returns:
TRUE if this Hidden Node hides an Attribute, FALSE otherwise

Reimplemented from Node.

Definition at line 4904 of file noderend.cpp.

04905 {
04906     // if it is NULL, then its not an attribute
04907     if (HiddenNd==NULL)
04908         return FALSE;
04909 
04910     // see if it is an attribute
04911     return (HiddenNd->IsAnAttribute());
04912 }

virtual BOOL NodeHidden::IsTypeExtendible  )  const [inline, virtual]
 

Reimplemented from Node.

Definition at line 1499 of file node.h.

01499 { return FALSE; }

Node * NodeHidden::ShowNode  ) 
 

This static method will relink the hidden node into the tree. this will be deleted.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/9/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A pointer to the unhidden node

Errors: -

See also:
-

Definition at line 4814 of file noderend.cpp.

04815 {
04816     Node* ShowNode = HiddenNd; // Pointer to hidden node 
04817                    
04818     //----------------------------------------------------------------------------
04819     // Relink the hidden node into the tree at the same position as the NodeHidden
04820 
04821     TAG tag = ShowNode->GetTag();       // Get the original tag
04822     ShowNode->AttachNode(this, NEXT);    
04823     ShowNode->Tag = tag;                // Restore tag value after relinking node into the tree
04824 
04825     ShowNode->DecHiddenCnt();         // this hidden node no longer reffers to the node. 
04826     CascadeDelete();                  // Unlinks only the HideNode (It never has any children)
04827     delete (this); 
04828     return ShowNode; 
04829 } 

Node * NodeHidden::SimpleCopy void   )  [virtual]
 

Causes an ENSURE failure. A hidden node should never be copied.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
-

Errors:

Reimplemented from Node.

Definition at line 4846 of file noderend.cpp.

04847 {
04848     ENSURE(FALSE, "NodeHidden invalid SimpleCopy called"); 
04849     return NULL; 
04850 }   

virtual DocRect NodeHidden::ValidateExtend const ExtendParams ExtParams  )  [inline, virtual]
 

Tests the reversibility of an Extend operation applied to this node.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/11/1999
Parameters:
ExtParams description parameters for the extension. [INPUTS]
[OUTPUTS] 
Returns:
TRUE if extending this Node would be a valid operation, ie by passing appropriate inverse extend parameters, the Node could be un-extended back to its original state. FALSE if the operation would be irreversible.
Note that where appropriate, this function asks the Node's children if they may validly extend, only returning TRUE if the extension is completely ok with everyone.

Also note that if a node is of a non-extending type, it should normally consider itself a 'valid extender', as doing nothing is completely reversible (it should of course still check its children).

Returns:
Errors: See also: Node::IsTypeExtendible(), Node::Extend().

Reimplemented from Node.

Definition at line 1500 of file node.h.

01501             {
01502                 return DocRect(INT32_MAX, INT32_MAX, INT32_MAX, INT32_MAX);
01503             }


Member Data Documentation

Node* NodeHidden::HiddenNd
 

Definition at line 1481 of file node.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:56:55 2007 for Camelot by  doxygen 1.4.4