NodeEffect Class Reference

Encapsulates everything to do with post processor nodes PostProcessor nodes are compound nodes which take the rendered output of their children and change it in some way. They are compound nodes so that they have a user-controlled position in the rendering order. More...

#include <nodepostpro.h>

Inheritance diagram for NodeEffect:

NodeCompound NodeRenderableInk NodeRenderableBounded NodeRenderable Node CCObject SimpleCCObject NodeBitmapEffect NodeLiveEffect NodeLockedEffect NodeFeatherEffect List of all members.

Public Member Functions

 NodeEffect ()
 Note:.
 ~NodeEffect ()
 Destructor Note:.
 NodeEffect (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 This constructor initialises the nodes flags and links it to ContextNode in the direction specified by Direction. All neccesary tree links are updated. Note: SetUpShape() must be called before the NodeRegularShape is in a state in which it can be used.
virtual SubtreeRenderState RenderSubtree (RenderRegion *pRender, Node **ppNextNode=NULL, BOOL bClip=TRUE)
 Do clever stuff on the way into a subtree, possibly modifying rendering behaviour.
virtual void RenderAfterSubtree (RenderRegion *pRender)
 Capture the group as a cached bitmap.
virtual NodeSimpleCopy ()
 This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL IsEffect () const
virtual BOOL IsController ()
virtual BOOL IsValidEffectAttr (NodeAttribute *pAttr) const
 Determine whether this type of attribute can be an effect attribute On this node at this time.Determine whether this attribute instance can be an effect attribute On this node at this time.
virtual BOOL IsLockedEffect ()
virtual BOOL CompareState (NodeEffect *pPPNode)
virtual String_256 GetPostProcessorID () const
virtual void SetPostProcessorID (String_256 strNewID)
virtual BOOL IsFeatherEffect ()
virtual BOOL IsPassThroughEffect () const
virtual BOOL CanBeUnlocked () const
void CopyNodeContents (NodeEffect *pCopyOfNode)
 Copies the data from this node to pCopyOfNode by first calling the base class to get it to copy its stuff, and then copying its own stuff Scope: protected.

Protected Attributes

String_256 m_strPostProID

Private Member Functions

 CC_DECLARE_DYNCREATE (NodeEffect)

Detailed Description

Encapsulates everything to do with post processor nodes PostProcessor nodes are compound nodes which take the rendered output of their children and change it in some way. They are compound nodes so that they have a user-controlled position in the rendering order.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/09/2004

Definition at line 130 of file nodepostpro.h.


Constructor & Destructor Documentation

NodeEffect::NodeEffect  ) 
 

Note:.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/09/2004
See also:

Definition at line 184 of file nodepostpro.cpp.

00184                        : NodeCompound()
00185 {
00186     m_strPostProID = String(_T(""));
00187 }

NodeEffect::~NodeEffect  ) 
 

Destructor Note:.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/09/2004
See also:

Definition at line 200 of file nodepostpro.cpp.

00201 {
00202 }

NodeEffect::NodeEffect Node ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
 

This constructor initialises the nodes flags and links it to ContextNode in the direction specified by Direction. All neccesary tree links are updated. Note: SetUpShape() must be called before the NodeRegularShape is in a state in which it can be used.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/09/2004
Parameters:
ContextNode,: Pointer to a node which this node is to be attached to. [INPUTS] MonoOn Direction: MonoOff Specifies the direction in which the node is to be attached to the ContextNode. The values this variable can take are as follows:
PREV : Attach node as a previous sibling of the context node NEXT : Attach node as a next sibling of the context node FIRSTCHILD: Attach node as the first child of the context node LASTCHILD : Attach node as a last child of the context node

BoundingRect: Bounding rectangle

The remaining inputs specify the status of the node:

Locked: Is node locked ? Mangled: Is node mangled ? Marked: Is node marked ? Selected: Is node selected ?

See also:
NodeRegularShape::SetUpShape
Returns:
Errors: An ENSURE will occur if ContextNode is NULL

Definition at line 162 of file nodepostpro.cpp.

00168                 : NodeCompound(ContextNode, Direction, Locked, Mangled, Marked, Selected )
00169 {                         
00170     m_strPostProID = String(_T(""));
00171 }                        


Member Function Documentation

virtual BOOL NodeEffect::CanBeUnlocked  )  const [inline, virtual]
 

Reimplemented in NodeLockedEffect.

Definition at line 165 of file nodepostpro.h.

00165 {return TRUE;}

NodeEffect::CC_DECLARE_DYNCREATE NodeEffect   )  [private]
 

virtual BOOL NodeEffect::CompareState NodeEffect pPPNode  )  [inline, virtual]
 

Reimplemented in NodeBitmapEffect, and NodeFeatherEffect.

Definition at line 160 of file nodepostpro.h.

00160 {return FALSE;}

void NodeEffect::CopyNodeContents NodeEffect pCopyOfNode  ) 
 

Copies the data from this node to pCopyOfNode by first calling the base class to get it to copy its stuff, and then copying its own stuff Scope: protected.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/09/2004
Parameters:
pCopyOfNode - The node to copy data to [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
NodeGroup::CopyNodeContents

Definition at line 311 of file nodepostpro.cpp.

00312 {
00313     NodeCompound::CopyNodeContents(pCopyOfNode);
00314 
00315     // Copy member vars here
00316     pCopyOfNode->m_strPostProID = m_strPostProID;
00317 }

virtual String_256 NodeEffect::GetPostProcessorID  )  const [inline, virtual]
 

Definition at line 161 of file nodepostpro.h.

00161 {return m_strPostProID;}

virtual BOOL NodeEffect::IsController  )  [inline, virtual]
 

Reimplemented from Node.

Definition at line 153 of file nodepostpro.h.

00153 {return TRUE;}

virtual BOOL NodeEffect::IsEffect  )  const [inline, virtual]
 

Reimplemented from Node.

Definition at line 152 of file nodepostpro.h.

00152 {return TRUE;}

virtual BOOL NodeEffect::IsFeatherEffect  )  [inline, virtual]
 

Reimplemented in NodeFeatherEffect.

Definition at line 163 of file nodepostpro.h.

00163 {return FALSE;}

virtual BOOL NodeEffect::IsLockedEffect  )  [inline, virtual]
 

Reimplemented in NodeBitmapEffect, NodeLiveEffect, and NodeLockedEffect.

Definition at line 159 of file nodepostpro.h.

00159 {return FALSE;}

virtual BOOL NodeEffect::IsPassThroughEffect  )  const [inline, virtual]
 

Definition at line 164 of file nodepostpro.h.

00164 {return FALSE;} // User can NOT see original object through effects by default

BOOL NodeEffect::IsValidEffectAttr NodeAttribute pAttr  )  const [virtual]
 

Determine whether this type of attribute can be an effect attribute On this node at this time.Determine whether this attribute instance can be an effect attribute On this node at this time.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/2005
Parameters:
Attribute [INPUTS]
Returns:
TRUE if the attr is a valid effect attr

Reimplemented from NodeRenderableInk.

Definition at line 385 of file nodepostpro.cpp.

00386 {
00387     CCRuntimeClass* pAttrType = pAttr->GetAttributeType();
00388 
00389     return (pAttr->IsATranspFill() ||
00390             pAttrType == CC_RUNTIME_CLASS(AttrTranspFillGeometry) || //->IsKindOf(CC_RUNTIME_CLASS(AttrTranspChange)) ||
00391             pAttrType == CC_RUNTIME_CLASS(AttrStrokeTransp) || //pAttr->IsKindOf(CC_RUNTIME_CLASS(AttrStrokeTranspChange)) ||
00392             pAttrType == CC_RUNTIME_CLASS(AttrTranspFillMapping)
00393             );
00394 }

void NodeEffect::PolyCopyNodeContents NodeRenderable pNodeCopy  )  [virtual]
 

Polymorphically copies the contents of this node to another.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/09/2004
Parameters:
- [OUTPUTS]
Returns:
Errors: An assertion failure will occur if NodeCopy is NULL Scope: protected

Reimplemented from NodeRenderableBounded.

Reimplemented in NodeLiveEffect, NodeLockedEffect, and NodeFeatherEffect.

Definition at line 334 of file nodepostpro.cpp.

00335 {
00336     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
00337     ENSURE(IS_A(pNodeCopy, NodeEffect), "PolyCopyNodeContents given wrong dest node type");
00338 
00339     if (IS_A(pNodeCopy, NodeEffect))
00340         CopyNodeContents((NodeEffect*)pNodeCopy);
00341 }

void NodeEffect::RenderAfterSubtree RenderRegion pRegion  )  [virtual]
 

Capture the group as a cached bitmap.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/09/2004
Parameters:
pRender - The region to render into [INPUTS]

Reimplemented from Node.

Reimplemented in NodeBitmapEffect.

Definition at line 256 of file nodepostpro.cpp.

00257 {
00258     // Deal with group transparency capture
00259     // Call Helper function to run all my cacheing functionality for me...
00260 //  CaptureCached(pRegion);
00261 }

SubtreeRenderState NodeEffect::RenderSubtree RenderRegion pRender,
Node **  ppNextNode = NULL,
BOOL  bClip = TRUE
[virtual]
 

Do clever stuff on the way into a subtree, possibly modifying rendering behaviour.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/09/2004
Parameters:
pRender - The region render into (or use as context for decisions about subtree) [INPUTS] ppNextNode - Address of node pointer for next node to render or run to after this bClip - flag indicating whether to clip or not

Reimplemented from NodeRenderableBounded.

Reimplemented in NodeLiveEffect, and NodeLockedEffect.

Definition at line 221 of file nodepostpro.cpp.

00222 {
00223     if (pRender == NULL)                            // If no render region supplied, assume we need to be rendered
00224         return SUBTREE_ROOTANDCHILDREN;
00225 
00226     // Go find out about my bounding rectangle
00227     DocRect BoundingRect = GetBoundingRect();
00228     DocRect ClipRect = pRender->GetClipRect();
00229 
00230     if (bClip && !ClipRect.IsIntersectedWith(BoundingRect)) // If not within the clipping rect then
00231         return SUBTREE_NORENDER;                    // Don't render us or our children
00232 
00233     // Ask Helper function to set up cacheing for me...
00234 // AMB wonders whethere this was commented out during porting - 20051212
00235 //  if (RenderCached(pRender))                      // If we can find a cached bitmap for this node and render it
00236 //  {
00237 //      return SUBTREE_NORENDER;                    // Then tell the renderer to move on without doing any more...
00238 //  }
00239 
00240     return SUBTREE_ROOTANDCHILDREN;                 // Else we must render ourselves and our children
00241 }

virtual void NodeEffect::SetPostProcessorID String_256  strNewID  )  [inline, virtual]
 

Definition at line 162 of file nodepostpro.h.

00162 {m_strPostProID = strNewID;}

Node * NodeEffect::SimpleCopy void   )  [virtual]
 

This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/09/2004
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
A copy of the node, or NULL if memory has run out

Errors: If memory runs out when trying to copy, then ERROR is called with an out of memory error and the function returns NULL.

Reimplemented from NodeRenderableInk.

Reimplemented in NodeLiveEffect, NodeLockedEffect, and NodeFeatherEffect.

Definition at line 283 of file nodepostpro.cpp.

00284 {
00285     NodeEffect* NodeCopy; 
00286     NodeCopy = new NodeEffect();
00287     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
00288     CopyNodeContents(NodeCopy);         
00289     return (NodeCopy);
00290 }   


Member Data Documentation

String_256 NodeEffect::m_strPostProID [protected]
 

Definition at line 170 of file nodepostpro.h.


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