AttrConicalColourFill Class Reference

Conical Graduated Colour Fill Attribute class. More...

#include <fillattr2.h>

Inheritance diagram for AttrConicalColourFill:

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

Public Member Functions

 AttrConicalColourFill ()
 AttrConicalColourFill (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
void Render (RenderRegion *pRender)
 'Renders' a Conical 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 conical fill record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL WriteColourDefinitions (BaseCamelotFilter *pFilter)
 Writes out colour definitions for this fill.
virtual BOOL IsSeeThrough (BOOL CheckIndirectAttrs)

Protected Attributes

ConicalFillAttribute Value

Detailed Description

Conical Graduated Colour Fill Attribute class.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/8/94
See also:
ConicalFillAttribute

Definition at line 1149 of file fillattr2.h.


Constructor & Destructor Documentation

AttrConicalColourFill::AttrConicalColourFill  )  [inline]
 

Definition at line 1154 of file fillattr2.h.

01154 : AttrConicalFill() {}

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

Definition at line 1155 of file fillattr2.h.

01160                                      : 
01161         AttrConicalFill(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}


Member Function Documentation

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

Reimplemented from AttrFillGeometry.

Definition at line 1174 of file fillattr2.h.

01174 { return ChangeColour(pValue); }

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

Reimplemented from NodeAttribute.

Definition at line 1171 of file fillattr2.h.

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

Implements AttrConicalFill.

Definition at line 1172 of file fillattr2.h.

01172 { return &Value; }

UINT32 AttrConicalColourFill::GetAttrNameID void   )  [virtual]
 

Returns a string resource ID describing the attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Returns:
Attribute description ID

Reimplemented from NodeAttribute.

Definition at line 9374 of file fillattr.cpp.

09375 {
09376     return (_R(IDS_CONICALGRADFILL)); 
09377 }                                  

void AttrConicalColourFill::GetDebugDetails StringBase Str  )  [virtual]
 

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

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/07/94
Parameters:
Str - the string containing details of the attribute. [OUTPUTS]

Reimplemented from NodeRenderable.

Definition at line 9390 of file fillattr.cpp.

09391 {
09392 #ifdef _DEBUG
09393     NodeAttribute::GetDebugDetails( Str );
09394 
09395     String_256 TempStr;
09396 
09397     TempStr._MakeMsg( TEXT("\r\nConical Graduated Fill:\r\n"));
09398     (*Str) += TempStr;
09399 
09400 //  TempStr._MakeMsg(TEXT("\r\nStart"));
09401 //  (*GetStartColour()).GetDebugDetails(&TempStr);
09402 //  (*Str) += TempStr;
09403 
09404 //  TempStr._MakeMsg(TEXT("\r\nEnd"));
09405 //  (*GetEndColour()).GetDebugDetails(&TempStr);
09406 //  (*Str) += TempStr;
09407 
09408     TempStr._MakeMsg(TEXT("\r\nStart point =(#1%ld, #2%ld)"), 
09409                      (*GetStartPoint()).x, (*GetStartPoint()).y);
09410     (*Str) += TempStr;
09411 
09412     TempStr._MakeMsg(TEXT("\r\nEnd point =(#1%ld, #2%ld), "), 
09413                      (*GetEndPoint()).x, (*GetEndPoint()).y);
09414     (*Str) += TempStr;
09415 #endif
09416 }

UINT32 AttrConicalColourFill::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

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

Reimplemented from Node.

Definition at line 9430 of file fillattr.cpp.

09431 {     
09432     return sizeof(AttrConicalColourFill);
09433 }  

virtual BOOL AttrConicalColourFill::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 1176 of file fillattr2.h.

01176 { return TRUE; }

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

Reimplemented from NodeAttribute.

Definition at line 1186 of file fillattr2.h.

01187     {
01188         return (GetStartColour() != NULL    &&  GetStartColour()->IsTransparent() &&
01189                 GetEndColour() != NULL      &&  GetEndColour()->IsTransparent());
01190     }

void AttrConicalColourFill::Render RenderRegion pRender  )  [virtual]
 

'Renders' a Conical Fill Colour attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94

Reimplemented from NodeAttribute.

Definition at line 9332 of file fillattr.cpp.

09333 {
09334     pRender->SetFillGeometry(&Value, FALSE);
09335 }

void AttrConicalColourFill::RenderFillBlobs RenderRegion pRender  )  [virtual]
 

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

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/94
Parameters:
pRender - The region to render the blobs to. [INPUTS]

Reimplemented from AttrConicalFill.

Definition at line 9247 of file fillattr.cpp.

09248 {
09249 #if !defined(EXCLUDE_FROM_RALPH)
09250     if (!IsVisible())
09251         return;     // We're in Fill Transparency Mode
09252 
09253     // Don't bother if this fill is being edited as a copy of it
09254     // we be rendered thoughout the drag op
09255     if (IsFillBeingEdited())
09256         return;
09257 
09258     // Ignore this if the mesh is the same as the last one rendered.
09259     if (CheckPreviousFillMesh())
09260         return;
09261 
09262     DocCoord ControlPoints[2];
09263     ControlPoints[0] = (*GetStartPoint());
09264     ControlPoints[1] = (*GetEndPoint());
09265 
09266     // Render a nice pretty Fill Mesh thingy
09267     RenderFillMesh(pRender, ControlPoints, SelectionState, 2);
09268 
09269     // This call was removed by Gerry (2/9/96) as it causes blob problems
09270     // If we are removing blobs then force all blobs to be deselected
09271 //  if ((Camelot.GetBlobManager())->IsRemovingBlobs())
09272 //      DeselectAllNoRedraw();
09273 #endif
09274 }

Node * AttrConicalColourFill::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:
23/8/94
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 9352 of file fillattr.cpp.

09353 {
09354     AttrConicalColourFill* NodeCopy = new AttrConicalColourFill();
09355     if (NodeCopy == NULL)
09356         return NULL;
09357 
09358     CopyNodeContents(NodeCopy);
09359     
09360     return NodeCopy;
09361 }  

BOOL AttrConicalColourFill::WriteColourDefinitions BaseCamelotFilter pFilter  )  [virtual]
 

Writes out colour definitions for this fill.

> virtual BOOL AttrConicalColourFill::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 9579 of file fillattr.cpp.

09580 {
09581     // Must write out the colours first
09582     INT32 StartColRef = pFilter->WriteRecord(&Value.Colour);
09583     INT32 EndColRef  = pFilter->WriteRecord(&Value.EndColour);
09584 
09585     BOOL ok = ((StartColRef != 0) && (EndColRef != 0));
09586 
09587     if (ok)
09588     {
09589         ColourRamp * pRamp = GetColourRamp();
09590         if (pRamp)
09591         if (pRamp->GetCount() > 0)
09592         {
09593             ok = pRamp->WriteColourDefinitions (pFilter);
09594         }
09595     }
09596     
09597     return (ok);
09598 }

BOOL AttrConicalColourFill::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 9555 of file fillattr.cpp.

09556 {
09557 #ifdef DO_EXPORT
09558     return WritePreChildrenWeb(pFilter);
09559 #else
09560     return FALSE;
09561 #endif
09562 }

BOOL AttrConicalColourFill::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the conical fill record to the filter.

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

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/6/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 9450 of file fillattr.cpp.

09451 {
09452 #ifdef DO_EXPORT
09453     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
09454 
09455     // Must write out the colours first
09456     INT32 StartColRef = pFilter->WriteRecord(&Value.Colour);
09457     INT32 EndColRef  = pFilter->WriteRecord(&Value.EndColour);
09458 
09459     // am I a multistage fill ??
09460     BOOL bMultistage = FALSE;
09461 
09462     ColourRamp * pRamp = GetColourRamp();
09463     INT32 * pRampColRefs = NULL;
09464     double * pPositions = NULL;
09465     ColRampItem * pItem = NULL;
09466     UINT32 NumRampItems = 0;
09467 
09468     if (pRamp)
09469     {
09470         // write out all the colour references
09471         if (pRamp->GetCount() > 0)
09472         {
09473             bMultistage = TRUE;
09474             NumRampItems = pRamp->GetCount();
09475 
09476             pRampColRefs = new INT32[NumRampItems];
09477             pPositions   = new double[NumRampItems];
09478 
09479             pItem = (ColRampItem *)pRamp->GetHead();
09480 
09481             for (UINT32 i = 0 ; i < NumRampItems; i++)
09482             {
09483                 if (pItem)
09484                 {
09485                     pPositions[i]   = pItem->GetPosition();
09486                     DocColour tempcolour = pItem->GetColour();
09487                     pRampColRefs[i] = pFilter->WriteRecord(&tempcolour);
09488                 }
09489 
09490                 pItem = (ColRampItem *)pRamp->GetNext(pItem);
09491             }
09492         }
09493     }
09494 
09495     // Are the colour references ok?
09496     BOOL ok = ((StartColRef != 0) && (EndColRef != 0));
09497         
09498     if (ok)
09499     {
09500         if (!bMultistage)
09501         {
09502             CamelotFileRecord Rec(pFilter,TAG_CONICALFILL,TAG_CONICALFILL_SIZE);
09503 
09504             if (ok) ok = Rec.Init();
09505             if (ok) ok = Rec.WriteCoord(Value.StartPoint);
09506             if (ok) ok = Rec.WriteCoord(Value.EndPoint);
09507             if (ok) ok = Rec.WriteReference(StartColRef);
09508             if (ok) ok = Rec.WriteReference(EndColRef);
09509             if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetBias ());
09510             if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetGain ());
09511             if (ok) ok = pFilter->Write(&Rec);
09512         }
09513         else
09514         {
09515             CamelotFileRecord Rec(pFilter,TAG_CONICALFILLMULTISTAGE,
09516                 TAG_CONICALFILLMULTISTAGE_SIZE);
09517 
09518             if (ok) ok = Rec.Init();
09519             if (ok) ok = Rec.WriteCoord(Value.StartPoint);
09520             if (ok) ok = Rec.WriteCoord(Value.EndPoint);
09521             if (ok) ok = Rec.WriteReference(StartColRef);
09522             if (ok) ok = Rec.WriteReference(EndColRef);
09523 
09524             // now, write out all the colour ramp items
09525             if (ok) ok = Rec.WriteUINT32(NumRampItems);
09526 
09527             for (UINT32 i = 0 ; i < NumRampItems; i++)
09528             {
09529                 if (ok) ok = Rec.WriteDOUBLE(pPositions[i]);
09530                 if (ok) ok = Rec.WriteReference(pRampColRefs[i]);
09531             }
09532 
09533             if (ok) ok = pFilter->Write(&Rec);
09534         }
09535     }
09536 
09537     if (pPositions)
09538         delete [] pPositions;
09539 
09540     if (pRampColRefs)
09541         delete [] pRampColRefs;
09542 
09543     if (!ok)
09544         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
09545 
09546     return ok;
09547 #else
09548     return FALSE;
09549 #endif
09550 }


Member Data Documentation

ConicalFillAttribute AttrConicalColourFill::Value [protected]
 

Definition at line 1193 of file fillattr2.h.


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