FlatFillAttribute Class Reference

Specifies a flat fill attribute for an object, i.e. it is filled with one solid colour. More...

#include <fillval.h>

Inheritance diagram for FlatFillAttribute:

ColourFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 FlatFillAttribute ()
 Default Constuctor for fill attribute values.
 FlatFillAttribute (DocColour &NewColour)
virtual BOOL Blend (BlendAttrParam *pBlendParam)
 Blends between two flat fill attributes. This current calls the general fill blend function. (See FillGeometryAttribute::Blend).
virtual NodeAttributeMakeNode ()
 Make a AttrFlatColourFill node from this flat fill colour attribute.
virtual void SetStartColour (DocColour *NewCol)
 Sets the Start colour of this fill.
virtual BOOL IsAFlatFill ()
virtual INT32 GetGeometryShape ()
virtual AttributeValueMouldIntoStroke (PathStrokerVector *pMoulder, double TransScale=1.0)
 Helper function for the PathStrokerVector class, which "moulds" clipart subtrees to lie along an arbitrary path.

Detailed Description

Specifies a flat fill attribute for an object, i.e. it is filled with one solid colour.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/07/94
See also:
FillGeometryAttribute

Definition at line 405 of file fillval.h.


Constructor & Destructor Documentation

FlatFillAttribute::FlatFillAttribute  ) 
 

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 960 of file fillval.cpp.

00961 {
00962 }

FlatFillAttribute::FlatFillAttribute DocColour NewColour  )  [inline]
 

Definition at line 410 of file fillval.h.

00410 { SetStartColour(&NewColour); }


Member Function Documentation

BOOL FlatFillAttribute::Blend BlendAttrParam pBlendParam  )  [virtual]
 

Blends between two flat fill attributes. This current calls the general fill blend function. (See FillGeometryAttribute::Blend).

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Returns:
TRUE - Blend went ok, the blended attr val is valid; FALSE if not.

Errors: Out of memory.

See also:
FillGeometryAttribute::Blend; FillGeometryAttribute::BlendFillColours; FillGeometryAttribute::BlendFillTransp; FillGeometryAttribute::BlendControlPoints; GradFillAttribute::Blend

Reimplemented from FillGeometryAttribute.

Definition at line 9584 of file fillval.cpp.

09585 {
09586     // Since this is a flat fill, we will use the other fill's geometry
09587     // (mainly for ArtWorks compatability)
09588 
09589     // First get the fill that we are blending to
09590     FillGeometryAttribute* OtherFill = 
09591                 (FillGeometryAttribute*)pBlendParam->GetOtherAttrVal();
09592 
09593     // Make a new object of the same type
09594     CCRuntimeClass* ObjectType = OtherFill->GetRuntimeClass();
09595     FillGeometryAttribute* pNewAttr = (FillGeometryAttribute*)ObjectType->CreateObject();
09596 
09597     if (pNewAttr == NULL)
09598     {
09599         // Fail if we couldn't create the new fill
09600         pBlendParam->SetBlendedAttrVal(NULL);
09601         return FALSE;
09602     }
09603 
09604     // Make the new fill an exact copy of the other one
09605     pNewAttr->SimpleCopy(OtherFill);
09606 
09607     // and what point along the blend we are at
09608     double Ratio = pBlendParam->GetBlendRatio();
09609     double objectRatio = pBlendParam->GetObjectRatio();
09610 
09611     // Blend the Start and End Colours
09612     DocColour BlendColour;
09613 
09614     DocColour* OtherStartCol    = OtherFill->GetStartColour();
09615     DocColour* OtherEndCol      = OtherFill->GetEndColour();
09616 
09617     DocColour TempOtherStartCol;
09618     DocColour TempOtherEndCol;
09619 
09620     // Check for a Greyscale Bitmap fill with no start or end colours
09621     // and use Black and White instead of 'No Colour'
09622     if (OtherFill->IsABitmapFill() && OtherStartCol == NULL && OtherEndCol == NULL)
09623     {
09624         if (OtherFill->GetBitmapRef() != NULL)
09625         {
09626             if (CheckForGreyscaleBitmapBlend(OtherFill->GetBitmapRef()->GetBitmap(), &TempOtherStartCol, &TempOtherEndCol))
09627             {
09628                 OtherStartCol   = &TempOtherStartCol;
09629                 OtherEndCol     = &TempOtherEndCol;
09630             }
09631         }
09632     }
09633 
09634     if (BlendFillColours(GetStartColour(), OtherStartCol, &BlendColour, Ratio, pBlendParam))
09635         pNewAttr->SetStartColour(&BlendColour);
09636 
09637     if (BlendFillColours(GetStartColour(), OtherEndCol, &BlendColour, Ratio, pBlendParam))
09638         pNewAttr->SetEndColour(&BlendColour);
09639 
09640     // CGS:  don't worry if pNewAttr->GetColourRamp () is NULL, this is handled internally by pNewAttr->GetColourRamp ()->Blend ()
09641     // (even if it is NULL, this code is still perfectly valid:  it means blend a no0n-multi-stage fill to something ....)
09642     pNewAttr->GetColourRamp ()->Blend (pNewAttr, pBlendParam, this/*->GetColourRamp ()*/, TRUE);
09643 
09644     // Blend the Control Points
09645     DocCoord BlendPoint;
09646 
09647     if (!pBlendParam->GetObjectProfileProcessing ())
09648     {
09649         // were not doing object processing - fill positions are affected by attribute ratio ....
09650         if (BlendControlPoints(GetStartPoint(), OtherFill->GetStartPoint(), &BlendPoint, Ratio, pBlendParam))
09651             pNewAttr->SetStartPoint(&BlendPoint);
09652 
09653         if (BlendControlPoints(GetEndPoint(), OtherFill->GetEndPoint(), &BlendPoint, Ratio, pBlendParam))
09654             pNewAttr->SetEndPoint(&BlendPoint);
09655 
09656         if (BlendControlPoints(GetEndPoint2(), OtherFill->GetEndPoint2(), &BlendPoint, Ratio, pBlendParam))
09657             pNewAttr->SetEndPoint2(&BlendPoint);
09658     }
09659     else
09660     {
09661         // were are doing object processing - fill positions are affected by object ratio ....
09662         if (BlendControlPoints(OtherFill->GetStartPoint(), GetStartPoint(), &BlendPoint, objectRatio, pBlendParam, TRUE))
09663             pNewAttr->SetStartPoint(&BlendPoint);
09664 
09665         if (BlendControlPoints(OtherFill->GetEndPoint(), GetEndPoint(), &BlendPoint, objectRatio, pBlendParam, TRUE))
09666             pNewAttr->SetEndPoint(&BlendPoint);
09667 
09668         if (BlendControlPoints(OtherFill->GetEndPoint2(), GetEndPoint2(), &BlendPoint, objectRatio, pBlendParam, TRUE))
09669             pNewAttr->SetEndPoint2(&BlendPoint);
09670     }
09671 
09672     // Set the new fill as the blended attribute
09673     pBlendParam->SetBlendedAttrVal(pNewAttr);
09674 
09675     return TRUE;
09676 }

virtual INT32 FlatFillAttribute::GetGeometryShape  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 419 of file fillval.h.

00419 { return(FILLSHAPE_FLAT); }

virtual BOOL FlatFillAttribute::IsAFlatFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 417 of file fillval.h.

00417 { return TRUE; }

NodeAttribute * FlatFillAttribute::MakeNode  )  [virtual]
 

Make a AttrFlatColourFill node from this flat fill colour attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Returns:
Pointer to the new node, or NULL if out of memory.

Errors: Out of memory

See also:
AttributeValue::MakeNode; AttrFlatColourFill

Reimplemented from AttributeValue.

Definition at line 977 of file fillval.cpp.

00978 {
00979     // Create new attribute node
00980     AttrFlatColourFill *pAttr = new AttrFlatColourFill;
00981     if (pAttr==NULL)
00982         // The error has already been set by new
00983         return NULL;
00984 
00985     // Copy attribute value into the new node.
00986     pAttr->GetAttributeValue()->SimpleCopy(this);
00987 
00988     // Return the new node
00989     return pAttr;
00990 }

AttributeValue * FlatFillAttribute::MouldIntoStroke PathStrokerVector pMoulder,
double  TransScale = 1.0
[virtual]
 

Helper function for the PathStrokerVector class, which "moulds" clipart subtrees to lie along an arbitrary path.

Parameters:
pMoulder - A PathStrokerVector which knows how to translate points to "mould" them [INPUTS] (May be NULL, in which case moulding of points does not occur)
TransScale - A fraction between 0.0 and 1.0, by which any transparency values in this geometry will be scaled, allowing the caller to effectively apply a flat transparency level to everything that is moulded. Use 1.0 to leave transparency unaltered.

Returns:
NULL
This function is called to mould fill geometries, so that fill endpoints are translated to appropriate positions in the destination envelope, and allows the caller to effectively apply a flat transparency by scaling any transparency values in this geometry by the given fraction.

Reimplemented from FillGeometryAttribute.

Definition at line 1041 of file fillval.cpp.

01042 {
01043     // There is no need to mould flat fills at all
01044     return(NULL);
01045 }

void FlatFillAttribute::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 ColourFillAttribute.

Definition at line 1003 of file fillval.cpp.

01004 {
01005     if (NewCol == NULL)
01006     {
01007         AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
01008                                             _R(IDS_BLACKNAME), &Colour);
01009     }
01010     else
01011         Colour = *NewCol;
01012 }


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