FourColTranspFillAttribute Class Reference

Specifies a FourCol graduated fill for an object, including the start and end points. More...

#include <fillval.h>

Inheritance diagram for FourColTranspFillAttribute:

ThreeColTranspFillAttribute GradTranspFillAttribute TranspFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 FourColTranspFillAttribute ()
 Default Constuctor for fill attribute values.
virtual INT32 operator== (const FillGeometryAttribute &Attrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual NodeAttributeMakeNode ()
 Make a AttrFourColTranspFill node from this graduated fill attribute.
virtual UINT32GetEndTransp3 ()
virtual void SetEndTransp3 (UINT32 *NewTransp)
 Sets the third transparency of this fill.
virtual BOOL IsAFourColFill ()
virtual ColourFillAttributeMakeSimilarNonTranspFillGeometry (double TransparencyScale)
 Creates a non-transparent version of this transparent fill attribute. (The original use of this was so airbrushes could maintain their fill's transparency geometry).
virtual INT32 GetGeometryShape ()

Public Attributes

UINT32 EndTransp3

Detailed Description

Specifies a FourCol graduated fill for an object, including the start and end points.

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

Definition at line 1584 of file fillval.h.


Constructor & Destructor Documentation

FourColTranspFillAttribute::FourColTranspFillAttribute  ) 
 

Default Constuctor for fill attribute values.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
See also:
AttrFillGeometry::AttrFillGeometry

Definition at line 7785 of file fillval.cpp.

07786 {
07787     EndTransp3 = 192;
07788 }


Member Function Documentation

virtual UINT32* FourColTranspFillAttribute::GetEndTransp3  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1594 of file fillval.h.

01594 { return &EndTransp3; }

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

Reimplemented from ThreeColTranspFillAttribute.

Definition at line 1601 of file fillval.h.

01601 { return(FILLSHAPE_4POINT); }

virtual BOOL FourColTranspFillAttribute::IsAFourColFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1597 of file fillval.h.

01597 { return TRUE; }

NodeAttribute * FourColTranspFillAttribute::MakeNode  )  [virtual]
 

Make a AttrFourColTranspFill node from this graduated fill attribute.

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

Errors: Out of memory

See also:
AttributeValue::MakeNode

Reimplemented from ThreeColTranspFillAttribute.

Definition at line 7828 of file fillval.cpp.

07829 {
07830     // Create new attribute node
07831     AttrFourColTranspFill *pAttr = new AttrFourColTranspFill;
07832     if (pAttr==NULL)
07833         // error message has already been set by new
07834         return NULL;
07835 
07836     // Copy attribute value into the new node.
07837     pAttr->GetAttributeValue()->SimpleCopy(this);
07838 
07839     // Return the new node
07840     return pAttr;
07841 }

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

Creates a non-transparent version of this transparent fill attribute. (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
Returns:
Pointer to the new attribute, or NULL if out of memory, problems, etc.
See also:
TranspFillAttribute::MakeSimilarNonTranspFillGeometry; AttrFlatFill FlatTranspFillAttribute::MakeSimilarNonTranspFillGeometry

Reimplemented from ThreeColTranspFillAttribute.

Definition at line 7882 of file fillval.cpp.

07883 {
07884     UINT32 *pStartTransp = GetStartTransp();
07885     UINT32 *pEndTransp = GetEndTransp();
07886     UINT32 *pEndTransp2 = GetEndTransp2();
07887     UINT32 *pEndTransp3 = GetEndTransp3();
07888 
07889     if(pStartTransp == NULL || pEndTransp == NULL || pEndTransp2 == NULL || pEndTransp3 == NULL)
07890         return NULL;
07891     
07892     FourColFillAttribute *pNewAttr = new FourColFillAttribute;  
07893     if (pNewAttr != NULL)
07894     {
07895         pNewAttr->SetStartPoint(GetStartPoint());
07896         pNewAttr->SetEndPoint(GetEndPoint());
07897         pNewAttr->SetEndPoint2(GetEndPoint2());
07898         pNewAttr->SetEndPoint3(GetEndPoint3());
07899 
07900         if(IsPerspective())
07901             pNewAttr->MakePerspective();
07902 
07903         INT32 StartTransparency = 255 - (INT32)(((double)(255 - *pStartTransp)) * TransparencyScale);
07904         INT32 EndTransparency  = 255 - (INT32)(((double)(255 - *pEndTransp)) * TransparencyScale);
07905         INT32 EndTransparency2 = 255 - (INT32)(((double)(255 - *pEndTransp2)) * TransparencyScale);
07906         INT32 EndTransparency3 = 255 - (INT32)(((double)(255 - *pEndTransp3)) * TransparencyScale);
07907 
07908         DocColour       colorStart(StartTransparency, StartTransparency, StartTransparency);
07909         DocColour       colorEnd1(EndTransparency, EndTransparency, EndTransparency);
07910         DocColour       colorEnd2(EndTransparency2, EndTransparency2, EndTransparency2);
07911         DocColour       colorEnd3(EndTransparency3, EndTransparency3, EndTransparency3);
07912         pNewAttr->SetStartColour(&colorStart);
07913         pNewAttr->SetEndColour(&colorEnd1);
07914         pNewAttr->SetEndColour2(&colorEnd2);
07915         pNewAttr->SetEndColour3(&colorEnd3);
07916     }
07917 
07918     return(pNewAttr);
07919 }

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

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

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96
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 ThreeColTranspFillAttribute.

Definition at line 7807 of file fillval.cpp.

07808 {
07809     FourColTranspFillAttribute* pAttrib = (FourColTranspFillAttribute*) &Attrib;
07810     
07811     return(ThreeColTranspFillAttribute::operator==(Attrib) && (EndTransp3 == pAttrib->EndTransp3));
07812 }

void FourColTranspFillAttribute::SetEndTransp3 UINT32 NewTransp  )  [virtual]
 

Sets the third transparency of this fill.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/96
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Definition at line 7854 of file fillval.cpp.

07855 {
07856     if (NewTransp == NULL)
07857         EndTransp3 = 192;
07858     else
07859         EndTransp3 = *NewTransp;
07860 }


Member Data Documentation

UINT32 FourColTranspFillAttribute::EndTransp3
 

Definition at line 1604 of file fillval.h.


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