#include <fillval.h>
Inheritance diagram for FlatFillAttribute:
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 NodeAttribute * | MakeNode () |
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 AttributeValue * | MouldIntoStroke (PathStrokerVector *pMoulder, double TransScale=1.0) |
Helper function for the PathStrokerVector class, which "moulds" clipart subtrees to lie along an arbitrary path. |
Definition at line 405 of file fillval.h.
|
Default Constuctor for fill attribute values.
Definition at line 960 of file fillval.cpp.
|
|
Definition at line 410 of file fillval.h. 00410 { SetStartColour(&NewColour); }
|
|
Blends between two flat fill attributes. This current calls the general fill blend function. (See FillGeometryAttribute::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 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 419 of file fillval.h. 00419 { return(FILLSHAPE_FLAT); }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 417 of file fillval.h. 00417 { return TRUE; }
|
|
Make a AttrFlatColourFill node from this flat fill colour attribute.
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 }
|
|
Helper function for the PathStrokerVector class, which "moulds" clipart subtrees to lie along an arbitrary path.
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 }
|
|
Sets the Start colour of this fill.
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 }
|