ColourFillAttribute Class Reference

The base class for a fill geometry attribute, such as flat, linear, radial, conical, etc. This provides the basic interface for fill rendering. More...

#include <fillval.h>

Inheritance diagram for ColourFillAttribute:

FillGeometryAttribute AttributeValue CCObject SimpleCCObject FlatFillAttribute GradFillAttribute StrokeColourAttribute BitmapFillAttribute ConicalFillAttribute LinearFillAttribute RadialFillAttribute SquareFillAttribute ThreeColFillAttribute FractalFillAttribute NoiseFillAttribute FourColFillAttribute List of all members.

Public Member Functions

 ColourFillAttribute ()
 Default Constuctor for fill attribute values.
virtual void Restore (RenderRegion *, BOOL)
 Restores the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.
virtual void Render (RenderRegion *, BOOL Temp=FALSE)
 Sets the fill geometry attribute for the given render region. i.e. all paths filled will now be filled with this fill geometry.
virtual FillGeometryAttributeoperator= (FillGeometryAttribute &Attrib)
 Make the Attribute the same as the other.
virtual INT32 operator== (const FillGeometryAttribute &Attrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual DocColourGetStartColour ()
virtual void SetStartColour (DocColour *NewCol)
 Sets the Start colour of this fill.
virtual BOOL IsAColourFill ()
virtual BOOL ContainsNamedColour ()

Static Public Member Functions

static BOOL Init ()
 Registers fill type attribute, and provides a default attribute to give transparent flat fills, i.e. actually not filled at all.

Public Attributes

DocColour Colour

Detailed Description

The base class for a fill geometry attribute, such as flat, linear, radial, conical, etc. This provides the basic interface for fill rendering.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
See also:
FlatFillAttribute; LinearFillAttribute; RadialFillAttribute; ConicalFillAttribute; BitmapFillAttribute

Definition at line 366 of file fillval.h.


Constructor & Destructor Documentation

ColourFillAttribute::ColourFillAttribute  ) 
 

Default Constuctor for fill attribute values.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/9/94
See also:
AttrFillGeometry::AttrFillGeometry

Definition at line 674 of file fillval.cpp.

00675 {
00676     Colour = DocColour(BLACK);
00677 }


Member Function Documentation

BOOL ColourFillAttribute::ContainsNamedColour  )  [virtual]
 

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/4/2000
Parameters:
- [INPUTS]
Returns:
TRUE if any one of the colours used by this attribute is a named colour of has the reserved flag set that says it was created from a named colour.

Definition at line 911 of file fillval.cpp.

00912 {
00913     // check through all the colours and see if they are named
00914 
00915     DocColour* pColour = GetStartColour();
00916     if (pColour != NULL)
00917     {
00918         if (pColour->IsNamed())
00919             return TRUE;
00920     }
00921     pColour = GetEndColour();
00922     if (pColour != NULL)
00923     {
00924         if (pColour->IsNamed())
00925             return TRUE;
00926     }
00927     pColour = GetEndColour2();
00928     if (pColour != NULL)
00929     {
00930         if (pColour->IsNamed())
00931             return TRUE;
00932     }
00933     pColour = GetEndColour3();
00934     if (pColour != NULL)
00935     {
00936         if (pColour->IsNamed())
00937             return TRUE;
00938     }
00939 
00940     return FALSE;
00941 }

virtual DocColour* ColourFillAttribute::GetStartColour  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Reimplemented in BitmapFillAttribute, NoiseFillAttribute, and FractalFillAttribute.

Definition at line 381 of file fillval.h.

00381 { return &Colour; }

BOOL ColourFillAttribute::Init void   )  [static]
 

Registers fill type attribute, and provides a default attribute to give transparent flat fills, i.e. actually not filled at all.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Returns:
TRUE - initialised ok; FALSE if not.

Errors: Out of memory.

See also:
AttributeManager

Reimplemented from SimpleCCObject.

Reimplemented in StrokeColourAttribute.

Definition at line 693 of file fillval.cpp.

00694 {
00695     // Default to simple transparent fill colour
00696     FlatFillAttribute *pAttr = new FlatFillAttribute;
00697     if (pAttr==NULL)
00698         // just return FALSE, as the error message was set by new
00699         return FALSE;
00700 
00701 //  pAttr->Colour = AttributeManager::DefaultBlack;
00702     pAttr->Colour = DocColour(COLOUR_NONE);
00703     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), 
00704                                                          pAttr);
00705 
00706     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising ColourFillAttribute");
00707     ERROR2IF(ID != ATTR_FILLGEOMETRY, FALSE, "Incorrect ID for ColourFillAttribute");
00708 
00709     return TRUE;
00710 }

virtual BOOL ColourFillAttribute::IsAColourFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 384 of file fillval.h.

00384 { return TRUE; }

FillGeometryAttribute & ColourFillAttribute::operator= FillGeometryAttribute FillAttrib  )  [virtual]
 

Make the Attribute the same as the other.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/8/94
Parameters:
FillAttrib - the attribute to copy, which must be an AttrFillGeometry [INPUTS]
Returns:
Usual semantics for equality.

Errors: An ENSURE failure will occur if Attrib does not have a AttrFlatGeometry runtime class.

Reimplemented from FillGeometryAttribute.

Reimplemented in GradFillAttribute, RadialFillAttribute, BitmapFillAttribute, NoiseFillAttribute, and FractalFillAttribute.

Definition at line 726 of file fillval.cpp.

00727 {
00728     if ( !FillAttrib.IsABitmapFill() && this->IsABitmapFill() )
00729     {
00730         SetStartColour(NULL);
00731         SetEndColour(NULL);
00732     }
00733     else if ( FillAttrib.IsAFlatFill() && this->IsAGradFill() )
00734     {
00735         SetStartColour(NULL);
00736         SetEndColour(FillAttrib.GetStartColour());
00737     }
00738     else if ( FillAttrib.IsAFlatFill() && this->IsAFractalFill() )
00739     {
00740         SetStartColour(NULL);
00741         SetEndColour(FillAttrib.GetStartColour());
00742     }
00743     else if ( FillAttrib.IsAGradFill() && this->IsAFlatFill() )
00744     {
00745         SetStartColour(FillAttrib.GetEndColour());
00746         SetEndColour(NULL);
00747     }
00748     else
00749     {
00750         SetStartColour(FillAttrib.GetStartColour());
00751         SetEndColour(FillAttrib.GetEndColour());
00752         SetEndColour2(FillAttrib.GetEndColour2());
00753         SetEndColour3(FillAttrib.GetEndColour3());
00754     }
00755 
00756     // Copy the fills profile
00757     SetProfile (FillAttrib.GetProfile ());
00758 
00759     // Copy the control points
00760     SetStartPoint(FillAttrib.GetStartPoint());
00761     SetEndPoint(FillAttrib.GetEndPoint());
00762     SetEndPoint2(FillAttrib.GetEndPoint2());
00763 
00764     // Bitmap Virtual points
00765     if ( FillAttrib.IsAKindOfBitmapFill() &&
00766          !this->IsAKindOfBitmapFill() )
00767     {
00768         DocCoord Start = *FillAttrib.GetStartPoint();
00769         DocCoord End   = *FillAttrib.GetEndPoint();
00770         DocCoord End2  = *FillAttrib.GetEndPoint2();
00771 
00772         GetBitmapVirtualPoints( Start, End, End2,
00773                                 GetStartPoint(),  GetEndPoint(),  GetEndPoint2());
00774     }
00775     else if ( !FillAttrib.IsAKindOfBitmapFill() && 
00776               this->IsAKindOfBitmapFill() )
00777     {
00778         GetBitmapRealPoints(*GetStartPoint(), *GetEndPoint(), *GetEndPoint2(),
00779                              GetStartPoint(),  GetEndPoint(),  GetEndPoint2());
00780     }
00781 
00782     if (FillAttrib.IsPerspective())
00783     {
00784         MakePerspective();
00785         SetEndPoint3(FillAttrib.GetEndPoint3());
00786     }
00787     else
00788     {
00789         RemovePerspective();
00790     }
00791 
00792     // are both these fractal fills?
00793     if ( FillAttrib.IsAKindOfBitmapFill() && this->IsAKindOfBitmapFill())
00794     {
00795         // are these bitmap items the same?
00796         if (FillAttrib.GetRuntimeClass() == this->GetRuntimeClass())
00797             CopyBitmap(FillAttrib.GetBitmap());
00798     }
00799     else
00800         CopyBitmap(FillAttrib.GetBitmap());
00801 
00802     SetTesselation(FillAttrib.GetTesselation());
00803     SetAspectLock(FillAttrib.IsAspectLocked());
00804     SetColourRamp(FillAttrib.GetColourRamp());
00805 
00806     return *this;
00807 }

INT32 ColourFillAttribute::operator== const FillGeometryAttribute Attrib  )  [virtual]
 

A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
Attrib - the attribute to compare, which must be an AttrFillGeometry [INPUTS]
Returns:
Usual semantics for equality.

Errors: An ENSURE failure will occur if Attrib does not have a AttrFlatGeometry runtime class.

See also:
NodeAttribute::operator==

Reimplemented from FillGeometryAttribute.

Reimplemented in GradFillAttribute, RadialFillAttribute, ThreeColFillAttribute, FourColFillAttribute, BitmapFillAttribute, NoiseFillAttribute, and FractalFillAttribute.

Definition at line 825 of file fillval.cpp.

00826 {
00827     if (GetRuntimeClass() != Attrib.GetRuntimeClass())
00828         return FALSE;
00829 
00830     return (Colour == ((ColourFillAttribute*)&Attrib)->Colour);
00831 }

void ColourFillAttribute::Render RenderRegion pRegion,
BOOL  Temp = FALSE
[virtual]
 

Sets the fill geometry attribute for the given render region. i.e. all paths filled will now be filled with this fill geometry.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pRegion - the render region to render this attribute into. [INPUTS]
See also:
ColourFillAttribute; RenderStack; AttributeValue; NodeAttribute; ColourFillAttribute::Restore; ColourFillAttribute::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Implements FillGeometryAttribute.

Reimplemented in BitmapFillAttribute, and StrokeColourAttribute.

Definition at line 848 of file fillval.cpp.

00849 {
00850     pRegion->SetFillGeometry(this, Temp);
00851 }

void ColourFillAttribute::Restore RenderRegion pRegion,
BOOL  Temp
[virtual]
 

Restores the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pRegion - the render region to restore the attribute into. [INPUTS] Temp - TRUE if this is a temporary attribute, FALSE if it is permanent (e.g. it's in a document tree).
See also:
ColourFillAttribute; RenderStack; AttributeValue; NodeAttribute; ColourFillAttribute::Render; ColourFillAttribute::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Implements FillGeometryAttribute.

Reimplemented in BitmapFillAttribute, and StrokeColourAttribute.

Definition at line 870 of file fillval.cpp.

00871 {
00872     pRegion->RestoreFillGeometry(this, Temp);
00873 }

void ColourFillAttribute::SetStartColour DocColour NewCol  )  [virtual]
 

Sets the Start colour of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Reimplemented in FlatFillAttribute, BitmapFillAttribute, NoiseFillAttribute, and FractalFillAttribute.

Definition at line 886 of file fillval.cpp.

00887 {
00888     if (NewCol == NULL)
00889     {
00890         AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
00891                                             _R(IDS_WHITENAME), &Colour);
00892     }
00893     else
00894         Colour = *NewCol;
00895 }


Member Data Documentation

DocColour ColourFillAttribute::Colour
 

Definition at line 388 of file fillval.h.


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