ThreeColTranspFillAttribute Class Reference

Specifies a Three colour graduated transparency for an object including the start and end points. More...

#include <fillval.h>

Inheritance diagram for ThreeColTranspFillAttribute:

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

Public Member Functions

 ThreeColTranspFillAttribute ()
 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 AttrThreeColFill node from this graduated fill attribute.
virtual DocCoordGetEndPoint2 ()
virtual void SetEndPoint2 (DocCoord *Pos)
 Sets the End Point of this fill.
virtual DocCoordGetEndPoint3 ()
virtual void SetEndPoint3 (DocCoord *Pos)
 Sets the End Point of this fill.
virtual UINT32GetEndTransp2 ()
virtual void SetEndTransp2 (UINT32 *NewTransp)
 Sets the second colour of this fill.
virtual BOOL IsPerspective ()
virtual void MakePerspective ()
 Make the fill perspectived. This should be called just before it is transformed by the moulder, so it can validate the 4th control point.
virtual void RemovePerspective ()
 Removes perspective from this fill.
virtual BOOL IsAThreeColFill ()
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 BOOL SupportsFillRamps ()
virtual INT32 GetGeometryShape ()

Public Attributes

DocCoord EndPoint2
DocCoord EndPoint3
BOOL IsPersp
UINT32 EndTransp2

Detailed Description

Specifies a Three colour graduated transparency for an object including the start and end points.

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

Definition at line 1533 of file fillval.h.


Constructor & Destructor Documentation

ThreeColTranspFillAttribute::ThreeColTranspFillAttribute  ) 
 

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

07547 {
07548     IsPersp = FALSE;
07549 
07550     EndPoint2 = DocCoord(0,0);
07551     EndTransp2 = 128;
07552 }


Member Function Documentation

virtual DocCoord* ThreeColTranspFillAttribute::GetEndPoint2  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1543 of file fillval.h.

01543 { return &EndPoint2; }

virtual DocCoord* ThreeColTranspFillAttribute::GetEndPoint3  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1545 of file fillval.h.

01545 { return &EndPoint3; }

virtual UINT32* ThreeColTranspFillAttribute::GetEndTransp2  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1548 of file fillval.h.

01548 { return &EndTransp2; }

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

Reimplemented from FillGeometryAttribute.

Reimplemented in FourColTranspFillAttribute.

Definition at line 1560 of file fillval.h.

01560 { return(FILLSHAPE_3POINT); }

virtual BOOL ThreeColTranspFillAttribute::IsAThreeColFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1555 of file fillval.h.

01555 { return TRUE; }

virtual BOOL ThreeColTranspFillAttribute::IsPerspective  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1551 of file fillval.h.

01551 { return IsPersp; }

NodeAttribute * ThreeColTranspFillAttribute::MakeNode  )  [virtual]
 

Make a AttrThreeColFill 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 AttributeValue.

Reimplemented in FourColTranspFillAttribute.

Definition at line 7591 of file fillval.cpp.

07592 {
07593     // Create new attribute node
07594     AttrThreeColTranspFill *pAttr = new AttrThreeColTranspFill;
07595     if (pAttr==NULL)
07596         // error message has already been set by new
07597         return NULL;
07598 
07599     // Copy attribute value into the new node.
07600     pAttr->GetAttributeValue()->SimpleCopy(this);
07601 
07602     // Return the new node
07603     return pAttr;
07604 }

void ThreeColTranspFillAttribute::MakePerspective  )  [virtual]
 

Make the fill perspectived. This should be called just before it is transformed by the moulder, so it can validate the 4th control point.

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

Reimplemented from FillGeometryAttribute.

Definition at line 7681 of file fillval.cpp.

07682 {
07683     IsPersp = TRUE;
07684 
07685     INT32 dx1 = EndPoint.x - StartPoint.x;
07686     INT32 dx2 = EndPoint2.x - StartPoint.x;
07687 
07688     INT32 dy1 = EndPoint.y - StartPoint.y;
07689     INT32 dy2 = EndPoint2.y - StartPoint.y;
07690 
07691     DocCoord Pos3(StartPoint.x + dx1 + dx2, StartPoint.y + dy1 + dy2);
07692     SetEndPoint3(&Pos3);
07693 }

ColourFillAttribute * ThreeColTranspFillAttribute::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 GradTranspFillAttribute.

Reimplemented in FourColTranspFillAttribute.

Definition at line 7732 of file fillval.cpp.

07733 {
07734     UINT32 *pStartTransp = GetStartTransp();
07735     UINT32 *pEndTransp = GetEndTransp();
07736     UINT32 *pEndTransp2 = GetEndTransp2();
07737 
07738     if(pStartTransp == NULL || pEndTransp == NULL || pEndTransp2 == NULL)
07739         return NULL;
07740     
07741     ThreeColFillAttribute *pNewAttr = new ThreeColFillAttribute;    
07742     if (pNewAttr != NULL)
07743     {
07744         pNewAttr->SetStartPoint(GetStartPoint());
07745         pNewAttr->SetEndPoint(GetEndPoint());
07746         pNewAttr->SetEndPoint2(GetEndPoint2());
07747         pNewAttr->SetEndPoint3(GetEndPoint3());
07748 
07749         if(IsPerspective())
07750             pNewAttr->MakePerspective();
07751 
07752         INT32 StartTransparency = 255 - (INT32)(((double)(255 - *pStartTransp)) * TransparencyScale);
07753         INT32 EndTransparency = 255 - (INT32)(((double)(255 - *pEndTransp)) * TransparencyScale);
07754         INT32 EndTransparency2 = 255 - (INT32)(((double)(255 - *pEndTransp2)) * TransparencyScale);
07755 
07756         DocColour       colorStart(StartTransparency, StartTransparency, StartTransparency);
07757         DocColour       colorEnd1(EndTransparency, EndTransparency, EndTransparency);
07758         DocColour       colorEnd2(EndTransparency2, EndTransparency2, EndTransparency2);
07759         pNewAttr->SetStartColour(&colorStart);
07760         pNewAttr->SetEndColour(&colorEnd1);
07761         pNewAttr->SetEndColour2(&colorEnd2);
07762     }
07763 
07764     return(pNewAttr);
07765 }

INT32 ThreeColTranspFillAttribute::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 GradTranspFillAttribute.

Reimplemented in FourColTranspFillAttribute.

Definition at line 7570 of file fillval.cpp.

07571 {
07572     ThreeColTranspFillAttribute* pAttrib = (ThreeColTranspFillAttribute*) &Attrib;
07573     
07574     return(GradTranspFillAttribute::operator==(Attrib) && (EndTransp2 == pAttrib->EndTransp2));
07575 }

void ThreeColTranspFillAttribute::RemovePerspective  )  [virtual]
 

Removes perspective from this fill.

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

Reimplemented from FillGeometryAttribute.

Definition at line 7706 of file fillval.cpp.

07707 {
07708     IsPersp = FALSE;
07709 }

void ThreeColTranspFillAttribute::SetEndPoint2 DocCoord Pos  )  [virtual]
 

Sets the End Point of this fill.

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

Reimplemented from FillGeometryAttribute.

Definition at line 7617 of file fillval.cpp.

07618 {
07619     if (Pos == NULL)
07620         EndPoint2 = MakeLineAtAngle(*GetStartPoint(), *GetEndPoint(), 90);
07621     else
07622         EndPoint2 = *Pos;
07623 }

void ThreeColTranspFillAttribute::SetEndPoint3 DocCoord Pos  )  [virtual]
 

Sets the End Point of this fill.

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

Reimplemented from FillGeometryAttribute.

Definition at line 7637 of file fillval.cpp.

07638 {
07639     if (Pos == NULL)
07640         EndPoint3 = MakeLineAtAngle(*GetEndPoint(), *GetEndPoint2(), 90);
07641     else
07642         EndPoint3 = *Pos;
07643 }

void ThreeColTranspFillAttribute::SetEndTransp2 UINT32 NewTransp  )  [virtual]
 

Sets the second colour of this fill.

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

Reimplemented from FillGeometryAttribute.

Definition at line 7657 of file fillval.cpp.

07658 {
07659     if (NewTransp == NULL)
07660         EndTransp2 = 128;
07661     else
07662         EndTransp2 = *NewTransp;
07663 }

virtual BOOL ThreeColTranspFillAttribute::SupportsFillRamps  )  [inline, virtual]
 

Reimplemented from GradTranspFillAttribute.

Definition at line 1558 of file fillval.h.

01558 { return FALSE; }


Member Data Documentation

DocCoord ThreeColTranspFillAttribute::EndPoint2
 

Definition at line 1563 of file fillval.h.

DocCoord ThreeColTranspFillAttribute::EndPoint3
 

Definition at line 1564 of file fillval.h.

UINT32 ThreeColTranspFillAttribute::EndTransp2
 

Definition at line 1568 of file fillval.h.

BOOL ThreeColTranspFillAttribute::IsPersp
 

Definition at line 1566 of file fillval.h.


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