AttrSquareColourFill Class Reference

Square Graduated Colour Fill Attribute class. More...

#include <fillattr2.h>

Inheritance diagram for AttrSquareColourFill:

AttrSquareFill AttrFillGeometry NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrSquareColourFill ()
 AttrSquareColourFill (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
void Render (RenderRegion *pRender)
 'Renders' a Square Fill Colour attribute.
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 (void)
 Returns a string resource ID describing the attribute.
void GetDebugDetails (StringBase *Str)
 Output details of this attribute to the Camelot debug tree dialog.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual void RenderFillBlobs (RenderRegion *pRender)
 Renders the grad fills arrow blob when requested to by its selected parent.
virtual CCRuntimeClassGetAttributeType ()
virtual AttributeValueGetAttributeValue ()
AttrFillGeometryChangeAttrValue (AttrValueChange *pValue)
virtual BOOL IsAColourFill () const
 Virtual function for determining if the node is a Colour Fill attribute.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the Square fill record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
 Writes the Square fill record to the filter.
virtual BOOL WriteColourDefinitions (BaseCamelotFilter *pFilter)
 Writes out colour definitions for this fill.
virtual BOOL IsSeeThrough (BOOL CheckIndirectAttrs)

Protected Attributes

SquareFillAttribute Value

Detailed Description

Square Graduated Colour Fill Attribute class.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
See also:
SquareFillAttribute

Definition at line 1317 of file fillattr2.h.


Constructor & Destructor Documentation

AttrSquareColourFill::AttrSquareColourFill  )  [inline]
 

Definition at line 1322 of file fillattr2.h.

01322 : AttrSquareFill() {}

AttrSquareColourFill::AttrSquareColourFill Node ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
[inline]
 

Definition at line 1323 of file fillattr2.h.

01328                                      : 
01329         AttrSquareFill(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}


Member Function Documentation

AttrFillGeometry* AttrSquareColourFill::ChangeAttrValue AttrValueChange pValue  )  [inline, virtual]
 

Reimplemented from AttrFillGeometry.

Definition at line 1342 of file fillattr2.h.

01342 { return ChangeColour(pValue); }

virtual CCRuntimeClass* AttrSquareColourFill::GetAttributeType  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 1339 of file fillattr2.h.

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

Implements AttrSquareFill.

Definition at line 1340 of file fillattr2.h.

01340 { return &Value; }

UINT32 AttrSquareColourFill::GetAttrNameID void   )  [virtual]
 

Returns a string resource ID describing the attribute.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Returns:
Attribute description ID

Reimplemented from NodeAttribute.

Definition at line 10486 of file fillattr.cpp.

10487 {
10488     return (_R(IDS_SQUAREGRADFILL)); 
10489 }                                  

void AttrSquareColourFill::GetDebugDetails StringBase Str  )  [virtual]
 

Output details of this attribute to the Camelot debug tree dialog.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Parameters:
Str - the string containing details of the attribute. [OUTPUTS]

Reimplemented from NodeRenderable.

Definition at line 10504 of file fillattr.cpp.

10505 {
10506 #ifdef _DEBUG
10507     NodeAttribute::GetDebugDetails( Str );
10508 
10509     String_256 TempStr;
10510 
10511     TempStr._MakeMsg( TEXT("\r\nDiamond Graduated Fill:\r\n"));
10512     (*Str) += TempStr;
10513 
10514 //  TempStr._MakeMsg(TEXT("\r\nStart"));
10515 //  (*GetStartColour()).GetDebugDetails(&TempStr);
10516 //  (*Str) += TempStr;
10517 
10518 //  TempStr._MakeMsg(TEXT("\r\nEnd"));
10519 //  (*GetEndColour()).GetDebugDetails(&TempStr);
10520 //  (*Str) += TempStr;
10521 
10522     TempStr._MakeMsg(TEXT("\r\nStart = (#1%ld, #2%ld)"), 
10523                      (*GetStartPoint()).x, (*GetStartPoint()).y);
10524     (*Str) += TempStr;
10525 
10526     TempStr._MakeMsg(TEXT("\r\nEnd = (#1%ld, #2%ld) "), 
10527                      (*GetEndPoint()).x, (*GetEndPoint()).y);
10528     (*Str) += TempStr;
10529 
10530     TempStr._MakeMsg(TEXT("\r\n3rd = (#1%ld, #2%ld) "), 
10531                      (*GetEndPoint2()).x, (*GetEndPoint2()).y);
10532     (*Str) += TempStr;
10533 #endif
10534 }

UINT32 AttrSquareColourFill::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Returns:
The size of the node in bytes
See also:
Node::GetSubtreeSize

Reimplemented from Node.

Definition at line 10550 of file fillattr.cpp.

10551 {     
10552     return sizeof(AttrSquareColourFill);
10553 }  

virtual BOOL AttrSquareColourFill::IsAColourFill  )  const [inline, virtual]
 

Virtual function for determining if the node is a Colour Fill attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/2/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node is a AttrColourFill, will return TRUE

Errors:

Reimplemented from NodeAttribute.

Definition at line 1344 of file fillattr2.h.

01344 { return TRUE; }

virtual BOOL AttrSquareColourFill::IsSeeThrough BOOL  CheckIndirectAttrs  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 1354 of file fillattr2.h.

01355     {
01356         return (GetStartColour() != NULL    &&  GetStartColour()->IsTransparent() &&
01357                 GetEndColour() != NULL      &&  GetEndColour()->IsTransparent());
01358     }

void AttrSquareColourFill::Render RenderRegion pRender  )  [virtual]
 

'Renders' a Square Fill Colour attribute.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96

Reimplemented from NodeAttribute.

Definition at line 10397 of file fillattr.cpp.

10398 {
10399     pRender->SetFillGeometry(&Value, FALSE);
10400 }

void AttrSquareColourFill::RenderFillBlobs RenderRegion pRender  )  [virtual]
 

Renders the grad fills arrow blob when requested to by its selected parent.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Parameters:
pRender - The region to render the blobs to. [INPUTS]

Reimplemented from AttrSquareFill.

Definition at line 10443 of file fillattr.cpp.

10444 {
10445 #if !defined(EXCLUDE_FROM_RALPH)
10446     if (!IsVisible())
10447         return;     // We're in Fill Transparency Mode
10448 
10449     // Don't bother if this fill is being edited as a copy of it
10450     // we be rendered thoughout the drag op
10451     if (IsFillBeingEdited())
10452         return;
10453 
10454     // Ignore this if the mesh is the same as the last one rendered.
10455     if (CheckPreviousFillMesh())
10456         return;
10457 
10458     DocCoord ControlPoints[5];
10459     ControlPoints[FILLCONTROL_STARTPOINT] = (*GetStartPoint());
10460     ControlPoints[FILLCONTROL_ENDPOINT] = (*GetEndPoint());
10461     ControlPoints[FILLCONTROL_SECONDARYPOINT] = (*GetEndPoint2());
10462 
10463     // Render a nice pretty Fill Mesh thingy
10464     RenderFillMesh(pRender, ControlPoints, SelectionState, 5);
10465 
10466     // This call was removed by Gerry (2/9/96) as it causes blob problems
10467     // If we are removing blobs then force all blobs to be deselected
10468 //  if ((Camelot.GetBlobManager())->IsRemovingBlobs())
10469 //      DeselectAllNoRedraw();
10470 #endif
10471 }

Node * AttrSquareColourFill::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:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
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 10419 of file fillattr.cpp.

10420 {
10421     AttrSquareColourFill* NodeCopy = new AttrSquareColourFill();
10422     if (NodeCopy == NULL)
10423         return NULL;
10424 
10425     CopyNodeContents(NodeCopy);
10426     
10427     return NodeCopy;
10428 }  

BOOL AttrSquareColourFill::WriteColourDefinitions BaseCamelotFilter pFilter  )  [virtual]
 

Writes out colour definitions for this fill.

> virtual BOOL AttrSquareColourFill::WriteColourDefinitions (BaseCamelotFilter* pFilter)

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/9/2000
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
See also:
BaseCamelotFilter::WriteRemainingAtomicTagDefinitions () Layer::WriteAtomicNodesColourRefs ()

Reimplemented from AttrFillGeometry.

Definition at line 10713 of file fillattr.cpp.

10714 {
10715     // Must write out the colours first
10716     INT32 StartColRef = pFilter->WriteRecord(&Value.Colour);
10717     INT32 EndColRef  = pFilter->WriteRecord(&Value.EndColour);
10718 
10719     BOOL ok = ((StartColRef != 0) && (EndColRef != 0));
10720 
10721     if (ok)
10722     {
10723         ColourRamp * pRamp = GetColourRamp();
10724         if (pRamp)
10725         if (pRamp->GetCount() > 0)
10726         {
10727             ok = pRamp->WriteColourDefinitions (pFilter);
10728         }
10729     }
10730     
10731     return (ok);
10732 }

BOOL AttrSquareColourFill::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Writes the Square fill record to the filter.

> virtual BOOL AttrSquareColourFill::WritePreChildrenNative(BaseCamelotFilter* pFilter)

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Parameters:
pFilter - ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
See also:
-

Reimplemented from Node.

Definition at line 10689 of file fillattr.cpp.

10690 {
10691 #ifdef DO_EXPORT
10692     return WritePreChildrenWeb(pFilter);
10693 #else
10694     return FALSE;
10695 #endif
10696 }

BOOL AttrSquareColourFill::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the Square fill record to the filter.

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

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
See also:
-

Reimplemented from Node.

Definition at line 10570 of file fillattr.cpp.

10571 {
10572 #ifdef DO_EXPORT
10573     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
10574 
10575     // Must write out the colours first
10576     INT32 StartColRef = pFilter->WriteRecord(&Value.Colour);
10577     INT32 EndColRef  = pFilter->WriteRecord(&Value.EndColour);
10578 
10579     // am I a multistage fill ??
10580     BOOL bMultistage = FALSE;
10581 
10582     ColourRamp * pRamp = GetColourRamp();
10583     INT32 * pRampColRefs = NULL;
10584     double * pPositions = NULL;
10585     ColRampItem * pItem = NULL;
10586     UINT32 NumRampItems = 0;
10587 
10588     if (pRamp)
10589     {
10590         // write out all the colour references
10591         if (pRamp->GetCount() > 0)
10592         {
10593             bMultistage = TRUE;
10594             NumRampItems = pRamp->GetCount();
10595 
10596             pRampColRefs = new INT32[NumRampItems];
10597             pPositions   = new double[NumRampItems];
10598 
10599             pItem = (ColRampItem *)pRamp->GetHead();
10600 
10601             for (UINT32 i = 0 ; i < NumRampItems; i++)
10602             {
10603                 if (pItem)
10604                 {
10605                     pPositions[i]   = pItem->GetPosition();
10606                     DocColour tempcolour = pItem->GetColour();
10607                     pRampColRefs[i] = pFilter->WriteRecord(&tempcolour);
10608                 }
10609 
10610                 pItem = (ColRampItem *)pRamp->GetNext(pItem);
10611             }
10612         }
10613     }
10614 
10615     // Are the colour references ok?
10616     BOOL ok = ((StartColRef != 0) && (EndColRef != 0));
10617         
10618     if (ok)
10619     {
10620         if (!bMultistage)
10621         {
10622             CamelotFileRecord Rec(pFilter,TAG_SQUAREFILL,TAG_SQUAREFILL_SIZE);
10623 
10624             if (ok) ok = Rec.Init();
10625             if (ok) ok = Rec.WriteCoord(Value.StartPoint);
10626             if (ok) ok = Rec.WriteCoord(Value.EndPoint);
10627             if (ok) ok = Rec.WriteCoord(Value.EndPoint2);
10628             if (ok) ok = Rec.WriteReference(StartColRef);
10629             if (ok) ok = Rec.WriteReference(EndColRef);
10630             if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetBias ());
10631             if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetGain ());
10632             if (ok) ok = pFilter->Write(&Rec);
10633         }
10634         else
10635         {
10636             CamelotFileRecord Rec(pFilter,TAG_SQUAREFILLMULTISTAGE,
10637                 TAG_SQUAREFILLMULTISTAGE_SIZE);
10638 
10639             if (ok) ok = Rec.Init();
10640             if (ok) ok = Rec.WriteCoord(Value.StartPoint);
10641             if (ok) ok = Rec.WriteCoord(Value.EndPoint);
10642             if (ok) ok = Rec.WriteCoord(Value.EndPoint2);
10643             if (ok) ok = Rec.WriteReference(StartColRef);
10644             if (ok) ok = Rec.WriteReference(EndColRef);
10645 
10646             // now, write out all the colour ramp items
10647             if (ok) ok = Rec.WriteUINT32(NumRampItems);
10648 
10649             for (UINT32 i = 0 ; i < NumRampItems; i++)
10650             {
10651                 if (ok) ok = Rec.WriteDOUBLE(pPositions[i]);
10652                 if (ok) ok = Rec.WriteReference(pRampColRefs[i]);
10653             }
10654 
10655             if (ok) ok = pFilter->Write(&Rec);
10656         }
10657     }
10658 
10659     if (pPositions)
10660         delete [] pPositions;
10661 
10662     if (pRampColRefs)
10663         delete [] pRampColRefs;
10664 
10665     if (!ok)
10666         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
10667 
10668     return ok;
10669 #else
10670     return FALSE;
10671 #endif
10672 }


Member Data Documentation

SquareFillAttribute AttrSquareColourFill::Value [protected]
 

Definition at line 1361 of file fillattr2.h.


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