FlatTranspFillAttribute 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 FlatTranspFillAttribute:

TranspFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 FlatTranspFillAttribute ()
 Default Constuctor for fill attribute values.
 FlatTranspFillAttribute (UINT32 NewTransp)
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 BOOL IsAFlatFill ()
virtual ColourFillAttributeMakeSimilarNonTranspFillGeometry (double TransparencyScale)
 Creates a non-transparent version of this transparent fill attribute. For Flat fills we just return a FlatFillAttribute whose start colour is set to a greyscale version of the intensity of the transparency. (The original use of this was so airbrushes could maintain their fill's transparency geometry).
virtual INT32 GetGeometryShape ()

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:
23/8/94
See also:
FillGeometryAttribute

Definition at line 1039 of file fillval.h.


Constructor & Destructor Documentation

FlatTranspFillAttribute::FlatTranspFillAttribute  ) 
 

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

04358 {
04359 }

FlatTranspFillAttribute::FlatTranspFillAttribute UINT32  NewTransp  )  [inline]
 

Definition at line 1044 of file fillval.h.

01044 { SetStartTransp(&NewTransp); }


Member Function Documentation

BOOL FlatTranspFillAttribute::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 9698 of file fillval.cpp.

09699 {
09700     // Since this is a flat fill, we will use the other fill's geometry
09701     // (mainly for ArtWorks compatability)
09702 
09703     // First get the fill that we are blending to
09704     FillGeometryAttribute* OtherFill = 
09705                 (FillGeometryAttribute*)pBlendParam->GetOtherAttrVal();
09706 
09707     // Make a new object of the same type
09708     CCRuntimeClass* ObjectType = OtherFill->GetRuntimeClass();
09709     FillGeometryAttribute* pNewAttr = (FillGeometryAttribute*)ObjectType->CreateObject();
09710 
09711     if (pNewAttr == NULL)
09712     {
09713         // Fail if we couldn't create the new fill
09714         pBlendParam->SetBlendedAttrVal(NULL);
09715         return FALSE;
09716     }
09717 
09718     // Make the new fill an exact copy of the other one
09719     pNewAttr->SimpleCopy(OtherFill);
09720 
09721     // and what point along the blend we are at
09722     double Ratio = pBlendParam->GetBlendRatio();
09723     double objectRatio = pBlendParam->GetObjectRatio();
09724 
09725     // Blend the Start and End Transparencies
09726     UINT32 BlendTransp;
09727 
09728     if (BlendFillTransp(GetStartTransp(), OtherFill->GetStartTransp(), &BlendTransp, Ratio, pBlendParam))
09729         pNewAttr->SetStartTransp(&BlendTransp);
09730 
09731     if (BlendFillTransp(GetStartTransp(), OtherFill->GetEndTransp(), &BlendTransp, Ratio, pBlendParam))
09732         pNewAttr->SetEndTransp(&BlendTransp);
09733 
09734 
09735     // Blend the Control Points
09736     DocCoord BlendPoint;
09737 
09738     if (!pBlendParam->GetObjectProfileProcessing ())
09739     {
09740         // were not doing object processing - fill positions are affected by attribute ratio ....
09741         if (BlendControlPoints(GetStartPoint(), OtherFill->GetStartPoint(), &BlendPoint, Ratio, pBlendParam))
09742             pNewAttr->SetStartPoint(&BlendPoint);
09743 
09744         if (BlendControlPoints(GetEndPoint(), OtherFill->GetEndPoint(), &BlendPoint, Ratio, pBlendParam))
09745             pNewAttr->SetEndPoint(&BlendPoint);
09746 
09747         if (BlendControlPoints(GetEndPoint2(), OtherFill->GetEndPoint2(), &BlendPoint, Ratio, pBlendParam))
09748             pNewAttr->SetEndPoint2(&BlendPoint);
09749     }
09750     else
09751     {
09752         // were are doing object processing - fill positions are affected by object ratio ....
09753         if (BlendControlPoints(GetStartPoint(), OtherFill->GetStartPoint(), &BlendPoint, objectRatio, pBlendParam))
09754             pNewAttr->SetStartPoint(&BlendPoint);
09755 
09756         if (BlendControlPoints(GetEndPoint(), OtherFill->GetEndPoint(), &BlendPoint, objectRatio, pBlendParam))
09757             pNewAttr->SetEndPoint(&BlendPoint);
09758 
09759         if (BlendControlPoints(GetEndPoint2(), OtherFill->GetEndPoint2(), &BlendPoint, objectRatio, pBlendParam))
09760             pNewAttr->SetEndPoint2(&BlendPoint);
09761     }
09762 
09763     // Set the new fill as the blended attribute
09764     pBlendParam->SetBlendedAttrVal(pNewAttr);
09765 
09766     return TRUE;
09767 }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1054 of file fillval.h.

01054 { return(FILLSHAPE_FLAT); }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1050 of file fillval.h.

01050 { return TRUE; }

NodeAttribute * FlatTranspFillAttribute::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; AttrFlatFill

Reimplemented from AttributeValue.

Definition at line 4374 of file fillval.cpp.

04375 {
04376     // Create new attribute node
04377     AttrFlatTranspFill *pAttr = new AttrFlatTranspFill;
04378     if (pAttr==NULL)
04379         // error message has already been set by new
04380         return NULL;
04381 
04382     // Copy attribute value into the new node.
04383     pAttr->GetAttributeValue()->SimpleCopy(this);
04384 
04385     // Return the new node
04386     return pAttr;
04387 }

ColourFillAttribute * FlatTranspFillAttribute::MakeSimilarNonTranspFillGeometry double  TransparencyScale  )  [virtual]
 

Creates a non-transparent version of this transparent fill attribute. For Flat fills we just return a FlatFillAttribute whose start colour is set to a greyscale version of the intensity of the transparency. (The original use of this was so airbrushes could maintain their fill's transparency geometry).

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/02/97
Parameters:
TransparencyScale - Value between 0.0 and 1.0 which denotes by how much [INPUTS] the function will scale the transparency. 0 means totally transparent.
Returns:
Pointer to the new attribute, or NULL if out of memory, problems, etc.
See also:
TranspFillAttribute::MakeSimilarNonTranspFillGeometry; AttrFlatFill

Reimplemented from TranspFillAttribute.

Definition at line 4413 of file fillval.cpp.

04414 {
04415     UINT32 *pStartTransparency = GetStartTransp();
04416     if(pStartTransparency == NULL)
04417         return NULL;
04418 
04419     FlatFillAttribute *pNewAttr = new FlatFillAttribute;
04420     if (pNewAttr != NULL)
04421     {
04422         INT32 Transparency = 255 - (INT32)(((double)(255 - *pStartTransparency)) * TransparencyScale);
04423         DocColour       color(Transparency, Transparency, Transparency);
04424         pNewAttr->SetStartColour( &color );
04425     }
04426 
04427     return(pNewAttr);
04428 }


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