NodeRenderableInk Class Reference

This abstract class describes a renderable ink node. A property of Ink nodes is that they should be rendered after their children have been rendered. More...

#include <ink.h>

Inheritance diagram for NodeRenderableInk:

NodeRenderableBounded NodeRenderable Node CCObject SimpleCCObject BaseTextClass NodeBevel NodeBlender NodeBrushMaker NodeClipView NodeCompound NodeContour NodeGuideline NodeMouldBitmap NodePath NodeRegularShape NodeSimpleShape List of all members.

Public Types

enum  SelStateAction { CLEAR, SET, TOGGLE }

Public Member Functions

 NodeRenderableInk ()
 This constructor creates a NodeRenderableInk linked to no other, with all status flags false, and an uninitialised bounding rectangle.
 NodeRenderableInk (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 This method initialises the node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated.
virtual BOOL IsAnObject () const
 For determining quickly if the node is an object.
virtual BOOL IsSetCandidate () const
 Indicates that NodeRenderableInks are candidates for membership of Attribute gallery set.
virtual BOOL IsRenderedAsInk () const
virtual BOOL CanTransform ()
 Determine whether a renderable node can be transformed - if it does not, then no undo information needs to be stored for it.
virtual BOOL ExportRender (RenderRegion *pRender)
 Custom export code for nodes derived from NodeRenderableInk. So far there is only code for the VectorFileRenderRegion (which is a superclass for the EPS, CMX, and Flash render regions) to allow for the export of stroked shapes.
virtual void RenderAppliedFillBlobs (RenderRegion *pRender)
 Draws the Fill blobs of an ink object. It does this by calling all the attributes that are its immediate children and asking them to render their Fill Blobs. If any of them happen to be items such as Graduated fills, then blobs will appear.
virtual void RenderArtisticBlobs (RenderRegion *pRender)
 Draws the Artistic blobs of an ink object. It does this by calling all the attributes that are its immediate children and asking them to render their Artistic Blobs. If any of them happen to be items such as Pressure attributes or some other artistic effect then blobs will appear.
virtual void RenderEorDrag (RenderRegion *)
 Each class derived from NodeRenderableInk should write a version of this member function. In most cases it will be the same as the Render() member function but some of the nodes (such as groups) need to perform special actions. The function is for drawing the object while it is being dragged about by the selector tool. It should do this with an effective wysiwyg level of 0 so that the drawing is fast.
virtual void RenderEffectBlobs (RenderRegion *pRender)
 Draws the Effect blobs of an ink object. It does this by calling all the attributes that are its immediate children and asking them to render their Fill Blobs. If any of them happen to be items such as Graduated fills, then blobs will appear.
virtual void RenderEorDragChildren (RenderRegion *pRender)
 Recursively calls RenderEorDrag for all children of this node, ignoring nodes which have ChildrenAreEorDragRenderedByMe() returning TRUE.
virtual BOOL ChildrenAreEorDragRenderedByMe ()
virtual void ClearSubSelection (BOOL ReDraw)
 Goes through the object and clears the selection state of all its blobs. eg a selected path has blobs and each of these blobs can be selected. This clears the blobs selection BUT not the objects selection!
virtual BOOL CanSelectAsCompoundParent ()
 Ask a node whether or not it's prepared to become selected when one of it's children is clicked on. This function is called in the FindSimple/Compound routines when they are following parent links up the tree from a node which has been "hit". This virtual function should be overridden in derived classes to alter its behaviour.
virtual BOOL CanSelectAsSimple ()
 Ask a node whether or not it's prepared to become selected when one of it's clicked on. This function is called in the FindSimple routines when they have just detected a "hit" on a node. This virtual function should be overridden in derived classes to alter its behaviour.
virtual BOOL OnClick (DocCoord, ClickType, ClickModifiers, Spread *)
 Allows the Node to respond to clicks by selecting its blobs or starting drags etc.
virtual BOOL OnMouseMove (const DocCoord &, Spread *, ClickModifiers)
 Called by the selector tool for the selected object(s) when the mouse is moved.
virtual BOOL GetStatusInfo (String_256 **ppStatusText, Cursor **ppStatusCursor)
 Called by the selector tool if either a previous OnMouseMove or OnClick member function call returns TRUE, indicating that the node has some feedback to display when the mous is at the previously passed point.
virtual BOOL OnBlobPopUp (Spread *, DocCoord, ContextMenu *)
 Allows the Node to respond to popup menu clicks by adding items to the popup menu if required. It also allows the node to prevent the menu appearing at all! This functions should be overridden in the all the NodeRenderableInk classes so that this verion never gets called. Eg the NodePath class might claim the click if it happened over one of its blobs.
virtual BOOL OnNodePopUp (Spread *, DocCoord, ContextMenu *)
 Allows the Node to respond to popup menu clicks by adding items to the popup menu if required. It also allows the node to prevent the menu appearing at all! This functions should be overridden in the all the NodeRenderableInk classes so that this verion never gets called. Eg the NodePath class might claim the click if it happened over one of its blobs.
virtual void SelectInRect (const DocRect &Rect, SelStateAction st)
 Helper method for the static fn SelectAllInRect() used by marquee select. This method changes the selection state of this node according to the given bounding rectangle and sel-state action. Most nodes will want to use the default behaviour, which is to select themselves if their bounds lie within the given bounding rectangle. If you want to do something special with the marquee select, then override this method.
void RedrawObject ()
 Invalidates the Bounding rectangle of the node, causing it to be redrawn.
void ApplyAttributeToObject (NodeAttribute *Attribute, BOOL Redraw)
 Applys Attribute to the selected node and then if Redraw is TRUE it redraws the node.
BOOL ApplyAttributes (CCAttrMap *pAttribMap, BOOL RequiredAttrsOnly=FALSE)
 This generates copies of all the attributes in the map, and applies them to this node.
virtual BOOL RequiresAttrib (CCRuntimeClass *AttribClass, BOOL Search=FALSE)
 To determine if the node requires attribute AttribType to render itself.
virtual BOOL RequiresAttrib (NodeAttribute *pAttrib, BOOL Search=FALSE)
 To determine if the node requires the pAttr to render itself.
virtual BOOL CanAttrBeAppliedToMe (CCRuntimeClass *AttrType)
 This fn is not to be confused with RequiresAttrib, it determines if an attribute of type AttrType can be directly applied to this object. The object is assumed to Require the attribute.
virtual NodeRenderableInkGetObjectToApplyTo (CCRuntimeClass *AttrType)
 Before applying an attribute to an object this function should be called to return the actual object the attribute should be applied to.
virtual CCRuntimeClassGetCurrentAttribGroup ()
 Every Ink object has an associated current attribute group, If an attribute is applied to the object, and it needs to become current then the attribute group specified will get updated.
NodeAttributeGetChildAttrOfType (CCRuntimeClass *ReqdAttrib)
 Scans the child attribute block of the node for an attribute with type ReqdAttrib.
BOOL HasAttrTypesOn (NodeRenderableInk *Object)
 This function returns TRUE if the set of Object's child attribute types are a subset of this objects child attribute types.
BOOL CopyChildrenAsShapes (Node *pDestin)
 This function scans through all children of this object and asks them to convert themselves to shapes. The shapes are placed as children of the destination node. If the routine fails, all children of the destination will automatically be removed.
virtual BOOL ReadPostChildrenWeb (BaseCamelotFilter *pFilter)
 This function is called during the importing of the file.
virtual BOOL ReadPostChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL WriteBeginChildRecordsWeb (BaseCamelotFilter *pFilter)
 Begin to write out you child records, in the web format.
virtual BOOL WriteBeginChildRecordsNative (BaseCamelotFilter *pFilter)
 Begin to write out you child records, in the native format.
virtual BOOL WriteEndChildRecordsWeb (BaseCamelotFilter *pFilter)
 Finished writing out you child records, in the web format.
virtual BOOL WriteEndChildRecordsNative (BaseCamelotFilter *pFilter)
 Finished writing out you child records, in the native format.
virtual BOOL WriteBoundsRecord (BaseCamelotFilter *pFilter)
 Write out a record containing the bounds of this object.
virtual BOOL WillWriteBounds (BaseCamelotFilter *pFilter)
 Determines if the down/up pair need to be written.
virtual BOOL AreYouSafeToRender ()
 This function is used by the progressive rendering system & the new file format to determine whether the node is renderable or not.
AttrBrushTypeGetAppliedBrushAttribute ()
 as above
AttrStrokeTypeGetActiveStroke ()
 We may have a stroke attribute applied to us that does not do anything under certain circumstances (zero line width, no accompanying variable width attribute).
virtual NodePathGetVariableWidthStrokePath ()
 If we have a variable width stroke applied to us then this will get the path generated by that stroke. This base class version returns NULL, overridden versions must supply their own outline path.
virtual NodePathGetSmoothVariableWidthStrokePath ()
virtual BOOL GetAreaDetails (XLONG *pxlArea, XLONG *pXLPerimeter)
virtual BOOL CanSupplyDirectBitmap ()
virtual BOOL GetDirectBitmap (RenderRegion *pRender, LPBITMAPINFO *plpInfo, LPBYTE *plpBits, DocRect *pRect, Matrix *pMat, double *pdRes)
virtual BOOL RenderDirectBitmapState (RenderRegion *pRender)
BOOL FindAppliedAttributes (CCAttrMap *pAttribMap, INT32 nMax=5000, INT32 *nFound=NULL, BOOL ExcludeIndirectlyAppliedGLAs=FALSE, BOOL bStrictEffectStatus=TRUE) const
 Searches for all the attributes which apply to "this" ink-node. This routine does NOT render them! Use RenderAppliedAttributes if you want that functionality.
BOOL FindAppliedAttribute (CCRuntimeClass *AttribType, NodeAttribute **pAttrFound, BOOL bStrict=TRUE)
 Finds the attribute of type 'AttribType' applied to this node.
NodeAttributeFindAppliedAttribute (CCRuntimeClass *AttribType, BOOL bExcludeChildAttrs=FALSE, BOOL bStrict=TRUE)
virtual BOOL IsValidEffectAttr (NodeAttribute *pAttr) const
void DeleteAppliedAttributes ()
 This function deletes all child attributes from the node which have the same type and value as the attributes applied above the child level. It is useful for Attribute optimisation work.
BOOL AddChildAttrTypesToSet (AttrTypeSet *pAttrTypeSet)
 A function to return a set of the attribute types of all attribute children of.
virtual NodeRenderableInkFindNodeAtPointHelper (const Spread *pSpread, const DocCoord dcPoint)
BOOL MakeAttributeComplete (Node *Root=NULL, BOOL CheckForDuplicates=TRUE, AttrTypeSet *pAffectedAttrTypes=NULL, BOOL IncludeDefaults=FALSE, BOOL bIncludeEffectAttrs=FALSE)
 This function should be called on a subtree prior to it being moved, either to a new position in the document, or to another document. It is also used to localise attributes; during an ungroup for example.
void NormaliseAttributes ()
 This function should be called whenever an attribute-complete node is inserted into the tree (whether it's a new node, or a node which has been moved from elsewhere).
BOOL FactorOutCommonChildAttributes (BOOL Global=FALSE, AttrTypeSet *pAffectedAttrTypes=NULL)
 Scope: public.
BOOL LocaliseCommonAttributes (BOOL CheckForDuplicates=FALSE, BOOL Global=FALSE, AttrTypeSet *pAffectedAttrTypes=NULL, BOOL RecursiveDownwards=FALSE)
 This function is the opposite of the FactorOutCommonChildAttributes function it copies all attributes common to the compound to each child object within the compound which requires each attribute. The groups common attributes are deleted.
virtual BOOL BeginBlendStep (BlendNodeParam *pParam)
virtual BOOL EndBlendStep (BlendNodeParam *pParam)
virtual BOOL SetParentLayerAsEdited ()
 Mark parent layer as edited. If an ink object as something done to it which changes its appearance then we need to mark the parent layer as edited. In this class we actually do the work as these are visible objects in the tree.
virtual BOOL IsSeeThrough (BOOL CheckIndirectAttrs)
 Determines whether this node is see through or not. See through in this case does not necessarily mean transparent - eg we could be a no-colour-fill rectangle. This test is useful if you're going to render into a bitmap, which will then be post-processed and plonked on the document (eg Feathering). This way, you can hopefully avoid any performance hit from unnecessary rendering into an alpha-channel bitmap.

Static Public Member Functions

static BOOL Init ()
 Reads preferences for NodeRenderableInk.
static void DeselectAll (BOOL RenderBlobs=TRUE, BOOL InformImmediate=TRUE)
 Deselects all the selected objects in the tree, leaving camelot with nothing selected. It also removes the EORed blobs of the objects that were selected at the time of the call.
static void DeselectAllOnLayer (Layer *Layer)
 Same as DeselectAll except that it only deselects objects on Layer.
static void SelectAllInRect (DocRect, Spread *, SelStateAction st=SET)
 Selects all the objects that are wholly inside the supplied rectangle. It will draw in all the EORed blobs of the objects that it selects/deselects. rewritten by Simon so that objects on locked layers do not get selected also more optimal. (st parameter etc added by JCF 1.11.94).
static NodeRenderableInkFindSimpleAtPoint (Spread *pSpread, DocCoord dcPoint, Node *pHighNode=NULL, Node **ppInterruptNode=NULL)
 Searches the ink-able objects within the given spread for one that lies at or near the given point. The method used to render each candidate object into a small monochrome bitmap, in the reverse order to normal (so that the object normally rendered last is the first to be rendered into the bitmap). The bitmap is examined to see if the object affected the centre or surrounding pixels.
static NodeRenderableInkFindSimpleAtPointForColourPicker (Spread *pSpread, DocCoord dcPoint, Pixel32bpp &Pix, Node *pHighNode=NULL, Node **ppInterruptNode=NULL)
 Firstly, this function serves to find the 'ID' of the item that our colour picker is over - which is used to update our mouse cursor. Secondly, it obtains the TRUE 32-BIT RGB index for the pixel that our mouse cursor is over - enabling us to do colour manager/dialog type things. The first part of this routine simply calls FindSimpleAtPointFor - and the second part actually does colour specific work.
static NodeRenderableInkFindColourForNodeRenderableAtPoint (Spread *pSpread, DocCoord dcPoint, Pixel32bpp &Pix, Node *pThisNode, AttrFillGeometry *pThisFill)
 The function obtains the TRUE 32-BIT RGB index for the pixel that our mouse cursor is over for the supplied node.
static NodeRenderableInkFindCompoundAtPoint (Spread *pSpread, DocCoord dcPoint, Node *pHighNode=NULL)
 This function is similar to NodeRenderableInk::FindSimpleAtPoint, except that.
static NodeRenderableInkFindCompoundFromSimple (NodeRenderableInk *pSimpleNode, Node *pSiblingNode=NULL)
 This function will search up the parent links from the given "simple" node looking for a node whose parent is a layer. This guarantees that the returned node will be a genuinely selectable object, for example the routine will return the group node if the given point is within a grouped object.
static NodeRenderableInkFindInnerCompound (Node *pLowNode, Node *pHighNode)
static void ClearAttribMap ()
 Clears out all entries in the attribute map that is being accumulated as click-detection occurs. This has to be done when going down a child-link because then you are entering a deeper scope where the attributes in the map may not apply. It is called from Node::FindNextHitTest.

Protected Member Functions

BOOL CalculatePathBoundingRect (Path &BoundPath, BOOL DontUseAttrs, DocRect *pRect)
 Calculates the bounding rectangle of a path using GDraw. It will optionally go and find all the attributes that are applied to the path and tell GDraw about these as well (this is the normal way of using it) It can make up sone default attributes if needed as well. This will assume that the path is to be stroked as thin as possible.
virtual NodeSimpleCopy (void)
 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.

Private Member Functions

void RenderAppliedAttributes (RenderRegion *pRegion) const
 Searches for all the attributes which apply to "this" ink-node, rendering them into the given render-region. Private helper function for NodeRenderableInk::FindSimpleAtPoint.
void RenderAppliedClipAttributes (RenderRegion *pRender) const
 Helper method for RenderAppliedAttributes().
BOOL FactorOutCommonChildAttrHelper (BOOL Global, AttrTypeSet *pAffectedAttrTypes)
 This is a helper function for FactorOutCommonChildAttributes. It finds all attributes which are common to all children of this compound object and adds the common attributes to this node. If Global is TRUE then it recursivly tries to factor out the attributes on all parent compounds. This function does not delete the attributes which are factored out, This is left to the calling function.
BOOL LocaliseCommonAttrHelper (BOOL CheckForDuplicates, BOOL Global, AttrTypeSet *pAffectedAttrTypes, BOOL RecursiveDownwards=FALSE)
 This function copies all attributes common to the compound to each child object within the compound which requires each attribute.
void DeleteLocalisedAttributes (BOOL Global=FALSE, AttrTypeSet *pAffectedAttrTypes=NULL)
void DeleteFactoredOutAttribs (BOOL Global=FALSE, AttrTypeSet *pAffectedAttrTypes=NULL)
 Deletes all child attributes of objects within the compound, which are defined in the groups child attribute block. The attributes of objects which discard their child attributes (like the caret) are only deleted if they have the same value Scope: private.
BOOL FindReqdAttribs (List *ReqdAttribList)
void RemoveSuperfluousAttribs ()
BOOL FindCommonAttributesToFactorOut (CommonAttrSet *CommonAttributeSet)
 This fn does not exist.Finds all attributes common to the compound node.

Static Private Member Functions

static NodeFindFirstHitTest (Spread *pStartSpread, const DocRect &drClickRect, CCAttrMap *pAttribMap, BOOL bExcludeLayers, Node *pHighNode=NULL)
 Walks the node tree in the reverse order to rendering, which is the order that nodes should be considered for hit-testing.
static NodeFindNextHitTest (Node *pNode, const DocRect &drClickRect, CCAttrMap *pAttribMap, BOOL bExcludeLayers, BOOL bSkipChildren=FALSE)
 Walks the node tree in the reverse order to rendering, which is the order that nodes should be considered for hit-testing.
static BOOL HitTestChildren (Node *pNode, const DocRect &drClickRect, BOOL bExcludeLayers)
 Private helper function for Node::FindNextHitTest. This function decides whether FindNextHitTest should go down a child link, which it should if (i) there is a child link; AND (ii) this node isn't a locked or invisible layer if such things should be excluded; (iii) if this node has a bounding rectangle it intersects the click rectangle.

Private Attributes

BOOL SafeToRender

Static Private Attributes

static BOOL bUseSmartClicks = TRUE
 If TRUE then click detection is done with rendering, else if FALSE it is done with rectangle intersection. Will be made obsolete once rendering methods are reliable. Defaults to TRUE.
static BOOL AverageHitColour = FALSE
 If TRUE then click detection is done with rendering, else if FALSE it is done with rectangle intersection. Will be made obsolete once rendering methods are reliable. Defaults to TRUE.
static CCAttrMappAttribMap
static INT32 nFoundAttributes
static INT32 nMaxAttributes

Detailed Description

This abstract class describes a renderable ink node. A property of Ink nodes is that they should be rendered after their children have been rendered.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/93 Base Classes: NodeRenderable, Node, CCObject
See the Node class for an important note about producing derived classes of Node.

See also:
NodeRenderable
Returns:
Errors: -

Definition at line 139 of file ink.h.


Member Enumeration Documentation

enum NodeRenderableInk::SelStateAction
 

Enumerator:
CLEAR 
SET 
TOGGLE 

Definition at line 195 of file ink.h.

00195 { CLEAR, SET, TOGGLE };


Constructor & Destructor Documentation

NodeRenderableInk::NodeRenderableInk  ) 
 

This constructor creates a NodeRenderableInk linked to no other, with all status flags false, and an uninitialised bounding rectangle.

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

Errors:

Definition at line 2228 of file noderend.cpp.

02228                                     : NodeRenderableBounded()
02229 {
02230     SafeToRender = FALSE;   // Not safe to progressively render during importing yet (see ReadPostChildren...)
02231     MayBeCached = FALSE;    // Definitely not cached
02232 }

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

This method initialises the node and links it to ContextNode in the direction specified by Direction. All necessary tree links are updated.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/93
Parameters:
ContextNode,: Pointer to a node which this node is to be attached to. [INPUTS]
Direction:

Specifies the direction in which this 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

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 ?

Parameters:
- [OUTPUTS]
Returns:
-

Errors: An assertion error will occur if ContextNode is NULL

Definition at line 2277 of file noderend.cpp.

02283                                      :
02284 NodeRenderableBounded(ContextNode, Direction, Locked, Mangled, Marked,Selected)
02285 {
02286     SafeToRender = FALSE;   // Not safe to progressively render during importing yet (see ReadPostChildren...)
02287     MayBeCached = FALSE;    // Definitely not cached
02288 } 


Member Function Documentation

BOOL NodeRenderableInk::AddChildAttrTypesToSet AttrTypeSet pAttrTypeSet  ) 
 

A function to return a set of the attribute types of all attribute children of.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/6/95
Parameters:
- [INPUTS]
pAttrTypeSet,: The attribute types of all this nodes attributes are added to [OUTPUTS] this set.
Returns:
FALSE if we run out of memory
If you are adding an object, which has localised attributes, to a compound node then this function is useful. The attrTypeSet will contain those attributes that need to be localised on the compound before the object is added, and those that need to be factored out after.

Returns:
Errors: -
See also:
-

Definition at line 4430 of file noderend.cpp.

04431 {
04432     Node* pChild;
04433     // Create a set of the caret's attribute types
04434     for (pChild = FindFirstChild(); 
04435          pChild; 
04436          pChild = pChild->FindNext())
04437     {
04438         if (pChild->IsAnAttribute())
04439         {
04440             // Add the attribute's type to the CaretsAttrTypes set
04441             if (!(pAttrTypeSet->AddToSet(((NodeAttribute*)pChild)->GetAttributeType())))
04442                 return FALSE; // out of mem 
04443         }
04444     }
04445     return TRUE;
04446 } 

BOOL NodeRenderableInk::ApplyAttributes CCAttrMap pAttribMap,
BOOL  RequiredAttrsOnly = FALSE
 

This generates copies of all the attributes in the map, and applies them to this node.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/1/95
Parameters:
pAttribMap = ptr to the attributes to apply to this node [INPUTS] RequiredAttrsOnly = TRUE is attrs should only be applied if object requires them as determined by the func RequiresAttrib()
- [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
If RequiredAttrsOnly is TRUE, then only the attrs in the map that are required by the node are applied. RequiresAttrib() works this out for us.

Definition at line 3927 of file noderend.cpp.

03928 {
03929     if (pAttribMap == NULL) return FALSE;
03930 
03931     BOOL ApplyAttr = TRUE;
03932 
03933     // iterating all (key, value) pairs
03934     for (CMapPtrToPtr::iterator Pos = pAttribMap->GetStartPosition(); Pos!=pAttribMap->GetEndPosition();)
03935     {
03936         CCRuntimeClass* pType;
03937         void* pVal;
03938 
03939         pAttribMap->GetNextAssoc(Pos,pType,pVal);
03940 
03941         NodeAttribute* pNodeAttr = (NodeAttribute *)pVal;
03942 
03943         if (pNodeAttr->CanBeAppliedToObject())
03944         {
03945             if (RequiredAttrsOnly)
03946                 ApplyAttr = RequiresAttrib(pNodeAttr);
03947 
03948             if (ApplyAttr)
03949             {
03950                 Node* pNode = pNodeAttr->SimpleCopy();
03951                 if (pNode != NULL)
03952                 {
03953                     pNode->AttachNode(this,FIRSTCHILD);
03954                     // Ilan
03955                     // Supply nodes geometry to attributes which require it
03956                     ((NodeAttribute*)pNode)->LinkToGeometry(this);
03957                 }
03958             }
03959         }
03960     }
03961 
03962     // This will remove all the redundant attributes that have been attached to the node
03963     NormaliseAttributes();
03964 
03965     return TRUE;
03966 }

void NodeRenderableInk::ApplyAttributeToObject NodeAttribute Attribute,
BOOL  Redraw
 

Applys Attribute to the selected node and then if Redraw is TRUE it redraws the node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/11/93
Parameters:
Attribute,: The Attribute to apply to the object [INPUTS] Redraw: Flag indicating if the object should be redrawn after the attribute is added.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 3901 of file noderend.cpp.

03902 {
03903     Attribute->AttachNode(this, FIRSTCHILD); 
03904     if (Redraw)
03905         RedrawObject(); // Redraw the node
03906 }

BOOL NodeRenderableInk::AreYouSafeToRender  )  [virtual]
 

This function is used by the progressive rendering system & the new file format to determine whether the node is renderable or not.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/9/96
Parameters:
- [INPUTS]
Returns:
TRUE means yes, FALSE means no
The base class assumes that the node IS safe to render, as these are the most common

See also:
CanWriteChildrenWeb(), WritePreChildrenWeb()

Reimplemented from Node.

Reimplemented in NodeGroup.

Definition at line 4570 of file noderend.cpp.

04571 {
04572     return SafeToRender;
04573 }

virtual BOOL NodeRenderableInk::BeginBlendStep BlendNodeParam pParam  )  [inline, virtual]
 

Definition at line 392 of file ink.h.

00392 { return TRUE; }

BOOL NodeRenderableInk::CalculatePathBoundingRect Path BoundPath,
BOOL  DontUseAttrs,
DocRect pRect
[protected]
 

Calculates the bounding rectangle of a path using GDraw. It will optionally go and find all the attributes that are applied to the path and tell GDraw about these as well (this is the normal way of using it) It can make up sone default attributes if needed as well. This will assume that the path is to be stroked as thin as possible.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/9/94
Parameters:
BoundPath - The path to calculate the bounding rectangle of [INPUTS] DontUseAtrrs - TRUE if we do not want to apply the attributes to the path when calculating its bounds
pRect - Will hold the paths bounding rect if everything worked [OUTPUTS]
Returns:
TRUE if it worked, FALSE if it failed

Errors: GDraw can fail when calculating bounding rects, so beware

See also:
NodeRenderableBounded::GetBoundingRect

Definition at line 3431 of file noderend.cpp.

03433 {
03434     // Check and initialise output.
03435     ERROR3IF(pRect == 0, "NodeRenderableInk::CalculatePathBoundingRect: null output");
03436     pRect->MakeEmpty();
03437 
03438     // Something to put the new bounding rect into
03439     DocRect NewBoundingRect;
03440     BOOL    GDrawResult = TRUE;
03441     GDrawContext *GD = GRenderRegion::GetStaticDrawContext();
03442 
03443     if (GD == NULL)
03444         return(FALSE);
03445 
03446     // do we need to use the attrs
03447     if (DontUseAttrs)
03448     {
03449         // here we are not interested in the attributes
03450         // Find out what the paths bounding rect is now
03451         RECT            rectTmp;
03452         GDrawResult = GD->CalcStrokeBBox((POINT*)BoundPath.GetCoordArray(),
03453                                             BoundPath.GetVerbArray(), BoundPath.GetNumCoords(),
03454                                             &rectTmp,
03455                                             BoundPath.IsFilled, 0, CAPS_ROUND, JOIN_ROUND, NULL);
03456         if ( rectTmp.left>rectTmp.right || rectTmp.top>rectTmp.bottom )
03457             return false;
03458         NewBoundingRect = DocRect( rectTmp.left, rectTmp.top, rectTmp.right, rectTmp.bottom );
03459     }
03460     else
03461     {
03462         // First find all attributes applied to this node...
03463         // 30 is a default value - this will grow if it needs more space
03464         CCAttrMap AttribMap(30);
03465         if (FindAppliedAttributes(&AttribMap))
03466         {
03467             void* pLineColour = NULL;
03468             AttribMap.Lookup( CC_RUNTIME_CLASS(AttrStrokeColour),pLineColour);
03469 
03470             if (pLineColour && (*((AttrStrokeColour*)pLineColour)->GetStartColour() == COLOUR_NONE) ||
03471                 !BoundPath.IsStroked)
03472             {
03473                 // This path is not stroked, so we won't bother with any of the attributes
03474                 // applied to it
03475                 RECT    rectTmp;
03476                 GDrawResult = GD->CalcStrokeBBox((POINT*)BoundPath.GetCoordArray(),
03477                                                     BoundPath.GetVerbArray(), BoundPath.GetNumCoords(),
03478                                                     &rectTmp,
03479                                                     BoundPath.IsFilled, 0, CAPS_ROUND, JOIN_ROUND, NULL);
03480                 if ( rectTmp.left>rectTmp.right || rectTmp.top>rectTmp.bottom )
03481                     return false;
03482                 NewBoundingRect = DocRect( rectTmp.left, rectTmp.top, rectTmp.right, rectTmp.bottom );
03483 
03484             }
03485             else
03486             {
03487                 // Extract the info we need from the applied attributes
03488                 void* pLineWidth = NULL;
03489                 AttribMap.Lookup( CC_RUNTIME_CLASS(AttrLineWidth),pLineWidth);
03490                 ENSURE(pLineWidth,"NodePath::GetBoundingRect can't find LineWidth");
03491     
03492                 // if we did not get a line width, fail
03493                 if (!pLineWidth) 
03494                     return FALSE;
03495 
03496                 // The Start cap
03497                 void* pStartCap = NULL;
03498                 AttribMap.Lookup( CC_RUNTIME_CLASS(AttrStartCap),pStartCap);
03499 #ifdef _DEBUG
03500                 if (pStartCap == 0)
03501                     TRACE( _T("NodeRenderableInk::CalculatePathBoundingRect: can't find StartCap\n"));
03502 #endif
03503 
03504                 // The join style
03505                 void* pJoinType = NULL;
03506                 AttribMap.Lookup( CC_RUNTIME_CLASS(AttrJoinType),pJoinType);
03507 #ifdef _DEBUG
03508                 if (pJoinType == 0)
03509                     TRACE( _T("NodeRenderableInk::CalculatePathBoundingRect: can't find JoinType\n"));
03510 #endif
03511                 if(pStartCap != NULL && pJoinType != NULL && pLineWidth != NULL)
03512                 {
03513                     // Now pass those values to Gavin along with the path for a bounds calculation
03514                     RECT rectTmp;
03515                     GDrawResult = GD->CalcStrokeBBox((POINT*)BoundPath.GetCoordArray(),
03516                                             BoundPath.GetVerbArray(), BoundPath.GetNumCoords(),
03517                                             &rectTmp,
03518                                             BoundPath.IsFilled,
03519                                             ((AttrLineWidth*)pLineWidth)->Value.LineWidth,
03520                                             (CapStyles)((AttrStartCap*)pStartCap)->Value.StartCap,
03521                                             (JoinStyles)((AttrJoinType*)pJoinType)->Value.JoinType,
03522                                             NULL //Pointer to dash pattern attribute
03523                                             );
03524                     if ( rectTmp.left>rectTmp.right || rectTmp.top>rectTmp.bottom )
03525                         return false;
03526                     NewBoundingRect = DocRect( rectTmp.left, rectTmp.top, rectTmp.right, rectTmp.bottom );
03527                 }
03528             }
03529         }
03530     }
03531 
03532     // Make sure Gavin did not screw up.
03533     if (!NewBoundingRect.IsValid())
03534         // Set it to TRUE, as this means it went wrong in Gavin Talk.
03535         GDrawResult = TRUE;
03536 
03537     // see if GDraw worked (It returns FALSE when it works!)
03538     if (GDrawResult == FALSE)
03539     {
03540         // update the rectangle
03541         *pRect = NewBoundingRect;
03542         return TRUE;
03543     }
03544 
03545     // to get here, something must have failed
03546     return FALSE;
03547 }

BOOL NodeRenderableInk::CanAttrBeAppliedToMe CCRuntimeClass AttrType  )  [virtual]
 

This fn is not to be confused with RequiresAttrib, it determines if an attribute of type AttrType can be directly applied to this object. The object is assumed to Require the attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/6/95
Parameters:
AttrType,: The type of the attribute. It is a type, rather than an [INPUTS] instance because this function needs to be called from the Localise/Factor out routines which operate on attribute types.
Returns:
TRUE if an attribute of AttrType can be applied to this object, FALSE otherwise.
The base class fn returns TRUE.

Certain attributes cannot be directly applied to specific nodes (even though they require the attribute to render). eg. LineSpacing attributes cannot be applied to text character objects.

This function is called by the GetObjectToApplyTo virtual function.

Returns:
Errors: -
See also:
NodeRenderableInk::GetObjectToApplyTo

Reimplemented in NodeBevel, NodeClipView, and VisibleTextNode.

Definition at line 4064 of file noderend.cpp.

04065 {
04066     return TRUE;
04067 }

BOOL NodeRenderableInk::CanSelectAsCompoundParent  )  [virtual]
 

Ask a node whether or not it's prepared to become selected when one of it's children is clicked on. This function is called in the FindSimple/Compound routines when they are following parent links up the tree from a node which has been "hit". This virtual function should be overridden in derived classes to alter its behaviour.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/01/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node will allow itself to be selected when one of it's children has been "hit" FALSE otherwise

Errors: -

See also:
NodeRenderableInk::FindSimpleAtPoint; NodeRenderableInk::FindCompoundAtPoint

Reimplemented in NodeLiveEffect, and NodeLockedEffect.

Definition at line 978 of file hittest.cpp.

00979 {
00980     // Virtual base-class function returns TRUE always.
00981     // Override this function in your class.
00982     return  TRUE;
00983 }

BOOL NodeRenderableInk::CanSelectAsSimple  )  [virtual]
 

Ask a node whether or not it's prepared to become selected when one of it's clicked on. This function is called in the FindSimple routines when they have just detected a "hit" on a node. This virtual function should be overridden in derived classes to alter its behaviour.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/01/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node will allow itself to be selected when it has been "hit" FALSE otherwise

Errors: -

See also:
NodeRenderableInk::FindSimpleAtPoint; NodeRenderableInk::FindCompoundAtPoint

Reimplemented in NodeBlender.

Definition at line 1007 of file hittest.cpp.

01008 {
01009     // Virtual base-class function returns TRUE always.
01010     // Override this function in your class.
01011     return  TRUE;
01012 }

virtual BOOL NodeRenderableInk::CanSupplyDirectBitmap  )  [inline, virtual]
 

Reimplemented in NodeBitmap, NodeBitmapEffect, NodeLockedEffect, and NodeFeatherEffect.

Definition at line 260 of file ink.h.

00260 {return FALSE;}

BOOL NodeRenderableInk::CanTransform  )  [virtual]
 

Determine whether a renderable node can be transformed - if it does not, then no undo information needs to be stored for it.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/04/94
Returns:
This class's implementation always returns TRUE - i.e. NodeRenderableInks should be transformed by default.
See also:
NodeRenderable::CanTransform

Reimplemented from NodeRenderable.

Definition at line 2343 of file noderend.cpp.

02344 {
02345     return TRUE;
02346 }

virtual BOOL NodeRenderableInk::ChildrenAreEorDragRenderedByMe  )  [inline, virtual]
 

Reimplemented in NodeContourController, NodeClipViewController, and NodeMouldGroup.

Definition at line 179 of file ink.h.

00179 { return FALSE; }

void NodeRenderableInk::ClearAttribMap  )  [static]
 

Clears out all entries in the attribute map that is being accumulated as click-detection occurs. This has to be done when going down a child-link because then you are entering a deeper scope where the attributes in the map may not apply. It is called from Node::FindNextHitTest.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/7/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
Node::FindNextHitTest

Definition at line 1293 of file hittest.cpp.

01294 {
01295     pAttribMap->RemoveAll();
01296     nFoundAttributes = 0;
01297 }

void NodeRenderableInk::ClearSubSelection BOOL  ReDraw  )  [virtual]
 

Goes through the object and clears the selection state of all its blobs. eg a selected path has blobs and each of these blobs can be selected. This clears the blobs selection BUT not the objects selection!

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/11/93
Parameters:
ReDraw - TRUE if the selection should be redrawn [INPUTS]

Definition at line 3117 of file noderend.cpp.

03118 {
03119     // Base class does nothing
03120 }

BOOL NodeRenderableInk::CopyChildrenAsShapes Node pDestin  ) 
 

This function scans through all children of this object and asks them to convert themselves to shapes. The shapes are placed as children of the destination node. If the routine fails, all children of the destination will automatically be removed.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/05/95
Parameters:
pDestin = a pointer to a tree node to place the shapes. [INPUTS]
- [OUTPUTS]
Returns:
TRUE if a copy of the children of this parent has been taken FALSE if failed.

Definition at line 4465 of file noderend.cpp.

04466 {
04467     ERROR2IF(pDestin==NULL,FALSE,"pDestin==NULL in CopyChildrenAsShapes");
04468 
04469     // ok lets get the subtree to become a bunch of nodepaths
04470     CopyBecomeA ParamBecomeA(BECOMEA_PASSBACK, 
04471                              CC_RUNTIME_CLASS(NodePath),
04472                              NULL);
04473     
04474     // Set the context node
04475     ParamBecomeA.SetContextNode(pDestin);
04476 
04477     // now scan the children and get them to do their stuff
04478     Node* pNode = FindFirstChild();
04479     while (pNode!=NULL)
04480     {
04481         if (pNode->CanBecomeA(&ParamBecomeA))
04482         {
04483             if (!pNode->DoBecomeA(&ParamBecomeA))
04484             {
04485                 pDestin->CascadeDelete();
04486                 return FALSE;
04487             }
04488         }
04489 
04490         pNode=pNode->FindNext();
04491     }
04492     
04493     return TRUE;
04494 }

void NodeRenderableInk::DeleteAppliedAttributes  ) 
 

This function deletes all child attributes from the node which have the same type and value as the attributes applied above the child level. It is useful for Attribute optimisation work.

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

Errors: -

See also:
-

Definition at line 4365 of file noderend.cpp.

04366 {
04367     Node* pChild = FindFirstChild();
04368     Node* pFirstChild = pChild;
04369 
04370     // Temporarily unlink the children so that we can easily find applied attributes which
04371     // exclude the child attribs
04372     Child = NULL;
04373     
04374     NodeAttribute* pAppliedAttr;
04375     NodeAttribute* pChildAttr;
04376     while (pChild != NULL)
04377     {
04378         if (pChild->IsAnAttribute())
04379         {
04380             pChildAttr = (NodeAttribute*)pChild;
04381             if (FindAppliedAttribute((pChildAttr->GetAttributeType()), &pAppliedAttr))
04382             {
04383                 if (pAppliedAttr)
04384                 {
04385                     // Test to see if the attributes have the same value
04386                     if ((IS_SAME_CLASS(pAppliedAttr, pChildAttr )))
04387                     {
04388                         if ((*pAppliedAttr)==(*pChildAttr))
04389                         {
04390                             pChildAttr->CascadeDelete();        // Delete the attribute
04391                             delete pChildAttr;
04392                         }
04393                     }
04394                 }
04395 
04396             }
04397         }
04398         pChild = pChild->FindNext(); 
04399     }
04400     // Restore the children
04401     pChild = pFirstChild;           
04402 } 

void NodeRenderableInk::DeleteFactoredOutAttribs BOOL  Global = FALSE,
AttrTypeSet pAffectedAttrTypes = NULL
[private]
 

Deletes all child attributes of objects within the compound, which are defined in the groups child attribute block. The attributes of objects which discard their child attributes (like the caret) are only deleted if they have the same value Scope: private.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/5/95
Parameters:
Global,: TRUE indicates that we should delete the attributes on all [INPUTS] parent compound nodes as well as this node's attributes
pAffectedAttrTypes: An optional set of attribute types. If this is specified then we only consider de