AttrClipView Class Reference

#include <clipattr.h>

Inheritance diagram for AttrClipView:

NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrClipView ()
 ~AttrClipView ()
 AttrClipView (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
virtual void Render (RenderRegion *pRender)
 For rendering a node.
virtual AttributeValueGetAttributeValue ()
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 UINT32 GetAttrNameID ()
 Returns back a string resource ID describing the attribute, this base class function returns the resource _R(IDS_ATTRIBUTE).
virtual AttrIndex GetAttributeIndex ()
virtual UINT32 GetNodeSize ()
virtual INT32 operator== (const NodeAttribute &NodeAttrib)
 This function is slightly weird. Unlike most definitions of operator== it's virtual.
virtual BOOL NeedsTransparency () const
 Can be overriden in derived classes to return TRUE, indicating that the user may be prompted concerning transparency mode when such a node is inserted in the tree.
virtual SubtreeRenderState RenderSubtree (RenderRegion *pRender, Node **ppNextNode=NULL, BOOL bClip=TRUE)
 Virtual function - this version always returns TRUE, which indicates to the caller that we always want to render nodes of this type if we have encountered them.
virtual BOOL IsAClipViewAttr () const
virtual BOOL CanBeMultiplyApplied ()
virtual BOOL ShouldBeOptimized ()
virtual void Transform (TransformBase &Trans)
 This is the base class verison of the transform function. This is called to move, scale, rotate etc renderable objects. Each class derived from NodeRenderableInk should write a version of this function that manipulates all the control points in the object and updates its bounding box. See NodePath for an example.
virtual BOOL Blend (BlendAttrParam *pBlendParam)
 This will blend this attribute using the data held in pBlendParam. This base version does this: If the blend ratio <= 50%, this attr is copied If the blend ratio > 50%, the other attr is copied.
virtual BOOL ContainsAttributeValue (AttributeValue *pVal)
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes out a record that represents the node.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
void EnableRendering (BOOL DoEnableRendering=TRUE)
BOOL GetRenderStatus ()
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.

Public Attributes

ClipRegionAttribute Value

Private Member Functions

void CopyNodeContents (NodeAttribute *pCopy)
 This method copies the node's contents to the node pointed to by NodeCopy.

Private Attributes

BOOL m_DoRender

Detailed Description

Definition at line 158 of file clipattr.h.


Constructor & Destructor Documentation

AttrClipView::AttrClipView  ) 
 

Definition at line 339 of file clipattr.cpp.

00340 {
00341     m_DoRender = TRUE;
00342     Value.SetResponsibleForGrouping (TRUE);
00343 }

AttrClipView::~AttrClipView  ) 
 

Definition at line 353 of file clipattr.cpp.

00354 {
00355 }

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

Definition at line 345 of file clipattr.cpp.

00346                                                                                    : 
00347                             NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected)
00348 {
00349     m_DoRender = TRUE;
00350     Value.SetResponsibleForGrouping (TRUE);
00351 }


Member Function Documentation

BOOL AttrClipView::Blend BlendAttrParam pBlendParam  )  [virtual]
 

This will blend this attribute using the data held in pBlendParam. This base version does this: If the blend ratio <= 50%, this attr is copied If the blend ratio > 50%, the other attr is copied.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/10/94
Parameters:
pBlendParam = ptr to a blend attr class object [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 449 of file clipattr.cpp.

00450 {
00451     // Don`t want to blend this attribute at the mo!
00452     return FALSE;
00453 }

virtual BOOL AttrClipView::CanBeMultiplyApplied  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 195 of file clipattr.h.

00195 { return TRUE; }

BOOL AttrClipView::ContainsAttributeValue AttributeValue pVal  )  [virtual]
 

Reimplemented from NodeAttribute.

Definition at line 455 of file clipattr.cpp.

00456 {
00457     if(!pVal->IS_KIND_OF(ClipRegionAttribute))
00458     {
00459         ENSURE(FALSE,"Strange attr value comparison test requested");
00460         return FALSE;
00461     }
00462 
00463     return (pVal == &Value);
00464 }

void AttrClipView::CopyNodeContents NodeAttribute pCopy  )  [private, virtual]
 

This method copies the node's contents to the node pointed to by NodeCopy.

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

Errors: An assertion failure will occur if NodeCopy is NULL

Scope: protected

Reimplemented from NodeAttribute.

Definition at line 423 of file clipattr.cpp.

00424 {
00425     NodeAttribute::CopyNodeContents(pCopy);
00426     ((AttrClipView*)pCopy)->Value.SimpleCopy( &Value );
00427 }

void AttrClipView::EnableRendering BOOL  DoEnableRendering = TRUE  )  [inline]
 

Definition at line 209 of file clipattr.h.

00209 { m_DoRender = DoEnableRendering; }

virtual AttrIndex AttrClipView::GetAttributeIndex  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 183 of file clipattr.h.

00183 { return ATTR_CLIPVIEW; }

virtual AttributeValue* AttrClipView::GetAttributeValue  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 180 of file clipattr.h.

00180 { return &Value; }

virtual UINT32 AttrClipView::GetAttrNameID void   )  [inline, virtual]
 

Returns back a string resource ID describing the attribute, this base class function returns the resource _R(IDS_ATTRIBUTE).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/2/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Attribute description ID

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 182 of file clipattr.h.

00182 { return _R(IDS_CLIPVIEW_ATTR_ID); }

virtual UINT32 AttrClipView::GetNodeSize  )  [inline, virtual]
 

Definition at line 184 of file clipattr.h.

00184 { return sizeof(AttrClipView); }

BOOL AttrClipView::GetRenderStatus  )  [inline]
 

Definition at line 212 of file clipattr.h.

00212 { return m_DoRender; }

virtual BOOL AttrClipView::IsAClipViewAttr  )  const [inline, virtual]
 

Reimplemented from Node.

Definition at line 192 of file clipattr.h.

00192 { return TRUE; }

virtual BOOL AttrClipView::NeedsTransparency  )  const [inline, virtual]
 

Can be overriden in derived classes to return TRUE, indicating that the user may be prompted concerning transparency mode when such a node is inserted in the tree.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this Node requires transparency mode to render properly. By default this returns FALSE.

Errors: -

See also:
Node::AttachNode

Reimplemented from Node.

Definition at line 188 of file clipattr.h.

00188 { return FALSE; }

INT32 AttrClipView::operator== const NodeAttribute NodeAttrib  )  [virtual]
 

This function is slightly weird. Unlike most definitions of operator== it's virtual.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/2/94
Parameters:
Atrib,: The attribute to compare [INPUTS]
- [OUTPUTS]
Returns:
-
To see why it's required, consider the following

NodeAttribute* A,B;

A = X; B = Y;

where X and Y are pointers to instances of derived classes of NodeAttribute.

if X->GetRuntimeClass() == Y->GetRuntimeClass() then we should be able to compare X and Y. But if we had defined a normal operator== fn then we find we cannot do this, because there is no way of casting to a type which is unknown at compile time.

The implementation of operator== in all derived classes of NodeAttribute should look something like this.

INT32 DerivedClass::operator==(const NodeAttribute& Attrib) { DerivedClass* Attr = (DerivedClass*)

Compare member vars with Attr }

Before calling this function you must be sure that the attributes have the same runtime class.

The function needs to be defined in all derived classes of NodeAttribute

Returns:
Errors: If this function is called on an instance of a derived class of NodeAttribute, and the function has not been defined for the derived class, then an ENSURE failure will result.
See also:
-

Reimplemented from NodeAttribute.

Definition at line 429 of file clipattr.cpp.

00430 {
00431     Path* pComparePath = ((ClipRegionAttribute*)&NodeAttrib)->GetClipPath();
00432     Path* pThisPath = Value.GetClipPath();
00433 
00434     if(pComparePath && pThisPath)
00435     {
00436         return pThisPath->ComparePathToPath(pComparePath);
00437     }
00438 
00439     return -1;
00440 }

void AttrClipView::PolyCopyNodeContents NodeRenderable pNodeCopy  )  [virtual]
 

Polymorphically copies the contents of this node to another.

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

Reimplemented from NodeRenderable.

Definition at line 412 of file clipattr.cpp.

00413 {
00414     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
00415     ENSURE(IS_A(pNodeCopy, AttrClipView), "PolyCopyNodeContents given wrong dest node type");
00416 
00417     if (IS_A(pNodeCopy, AttrClipView))
00418         CopyNodeContents((AttrClipView*)pNodeCopy);
00419 }

void AttrClipView::Render RenderRegion pRender  )  [virtual]
 

For rendering a node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/4/93
Parameters:
RendRegion,: Render region to render into [INPUTS]
- [OUTPUTS]
Returns:
-

Reimplemented from NodeAttribute.

Definition at line 357 of file clipattr.cpp.

00358 {
00359     // check the pointer and also make sure that we`re allowed to render
00360     if (!pRender || !m_DoRender)
00361         return;
00362 
00363     // Don`t need to render when hit testing
00364     if(!pRender->IsHitDetect())
00365         Value.Render(pRender);
00366 }

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

Virtual function - this version always returns TRUE, which indicates to the caller that we always want to render nodes of this type if we have encountered them.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/02/94
Parameters:
pRender - A pointer to the current render region [INPUTS]
Returns:
TRUE => This node should be rendered, FALSE => This node does not need to be rendered.
See also:
Node::NeedsToRender

Reimplemented from NodeAttribute.

Definition at line 191 of file clipattr.h.

00191 {return SUBTREE_ROOTONLY; }

virtual BOOL AttrClipView::ShouldBeOptimized  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 196 of file clipattr.h.

00196 { return FALSE; }

Node * AttrClipView::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:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/6/93
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
A copy of the node, or NULL if memory runs 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.

Scope: protected

Reimplemented from NodeAttribute.

Definition at line 389 of file clipattr.cpp.

00390 {
00391     AttrClipView* pAttr = new AttrClipView();
00392     ERRORIF(pAttr==NULL, _R(IDE_NOMORE_MEMORY),NULL);
00393 
00394     CopyNodeContents(pAttr);
00395     return pAttr;
00396 }

void AttrClipView::Transform TransformBase Trans  )  [virtual]
 

This is the base class verison of the transform function. This is called to move, scale, rotate etc renderable objects. Each class derived from NodeRenderableInk should write a version of this function that manipulates all the control points in the object and updates its bounding box. See NodePath for an example.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/10/93
Parameters:
Trans - The transform to apply to the objects [INPUTS]

Reimplemented from NodeRenderable.

Definition at line 442 of file clipattr.cpp.

00443 {
00444 //  static const FIXED16 One(1.0);
00445 
00446 //  FIXED16 ScaleFactor = Trans.GetScaleFactor();
00447 }

BOOL AttrClipView::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 471 of file clipattr.cpp.

00472 {
00473     return TRUE;
00474 }

BOOL AttrClipView::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes out a record that represents the node.

> virtual BOOL Node::WritePreChildrenWeb(BaseCamelotFilter* pFilter)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/5/96
Parameters:
pFilter = ptr to filter to write to [INPUTS]
Returns:
TRUE if the node has written out a record to the filter FALSE otherwise
This function is called before any of the node's children are written to the filter.

If the node writes out a record successfully to the file, it should return TRUE.

If the node chooses not to write itself to the filter (e.g. because it is not appropriate for this filter), then this function should return FALSE.

If an error occurs, the function should call pFilter->GotError(), and return FALSE.

If the node does not want its child nodes to be written automatically, you should make sure you override CanWriteChildrenWeb() so it returns FALSE.

(e.g. this node may choose to save its sub tree itself, so it can choose which of its child nodes should be saved out)

See also:
CanWriteChildrenWeb(), WritePostChildrenWeb()

Reimplemented from Node.

Definition at line 466 of file clipattr.cpp.

00467 {
00468     return TRUE;
00469 }


Member Data Documentation

BOOL AttrClipView::m_DoRender [private]
 

Definition at line 218 of file clipattr.h.

ClipRegionAttribute AttrClipView::Value
 

Definition at line 221 of file clipattr.h.


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