ThreeColFillAttribute Class Reference

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

#include <fillval.h>

Inheritance diagram for ThreeColFillAttribute:

GradFillAttribute ColourFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject FourColFillAttribute List of all members.

Public Member Functions

 ThreeColFillAttribute ()
 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 DocColourGetEndColour2 ()
virtual void SetEndColour2 (DocColour *NewCol)
 Sets the third colour of this fill (defaults to Red).
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 BOOL SupportsFillRamps ()
virtual INT32 GetGeometryShape ()

Public Attributes

DocCoord EndPoint2
DocCoord EndPoint3
BOOL IsPersp
DocColour EndColour2

Detailed Description

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

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

Definition at line 674 of file fillval.h.


Constructor & Destructor Documentation

ThreeColFillAttribute::ThreeColFillAttribute  ) 
 

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

03838 {
03839     IsPersp = FALSE;
03840 
03841     EndPoint2 = DocCoord(0,0);
03842     AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
03843                                         _R(IDS_REDNAME), &EndColour2);
03844 }


Member Function Documentation

virtual DocColour* ThreeColFillAttribute::GetEndColour2  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 689 of file fillval.h.

00689 { return &EndColour2; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 684 of file fillval.h.

00684 { return &EndPoint2; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 686 of file fillval.h.

00686 { return &EndPoint3; }

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

Reimplemented from FillGeometryAttribute.

Reimplemented in FourColFillAttribute.

Definition at line 698 of file fillval.h.

00698 { return(FILLSHAPE_3POINT); }

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

Reimplemented from FillGeometryAttribute.

Definition at line 696 of file fillval.h.

00696 { return TRUE; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 692 of file fillval.h.

00692 { return IsPersp; }

NodeAttribute * ThreeColFillAttribute::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 FourColFillAttribute.

Definition at line 3887 of file fillval.cpp.

03888 {
03889     // Create new attribute node
03890     AttrThreeColFill *pAttr = new AttrThreeColColourFill;
03891     if (pAttr==NULL)
03892         // error message has already been set by new
03893         return NULL;
03894 
03895     // Copy attribute value into the new node.
03896     pAttr->GetAttributeValue()->SimpleCopy(this);
03897 
03898     // Return the new node
03899     return pAttr;
03900 }

void ThreeColFillAttribute::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 3956 of file fillval.cpp.

03957 {
03958     IsPersp = TRUE;
03959 
03960     INT32 dx1 = EndPoint.x - StartPoint.x;
03961     INT32 dx2 = EndPoint2.x - StartPoint.x;
03962 
03963     INT32 dy1 = EndPoint.y - StartPoint.y;
03964     INT32 dy2 = EndPoint2.y - StartPoint.y;
03965 
03966     DocCoord Pos3(StartPoint.x + dx1 + dx2, StartPoint.y + dy1 + dy2);
03967     SetEndPoint3(&Pos3);
03968 }

INT32 ThreeColFillAttribute::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 GradFillAttribute.

Reimplemented in FourColFillAttribute.

Definition at line 3863 of file fillval.cpp.

03864 {
03865     ThreeColFillAttribute* pAttrib = (ThreeColFillAttribute*) &Attrib;
03866     
03867     return(GradFillAttribute::operator==(Attrib) && 
03868             (EndColour2 == pAttrib->EndColour2) &&
03869             (EndPoint2 == pAttrib->EndPoint2) );
03870 }

void ThreeColFillAttribute::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 3981 of file fillval.cpp.

03982 {
03983     IsPersp = FALSE;
03984 }

void ThreeColFillAttribute::SetEndColour2 DocColour NewCol  )  [virtual]
 

Sets the third colour of this fill (defaults to Red).

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

Reimplemented from FillGeometryAttribute.

Definition at line 3998 of file fillval.cpp.

03999 {
04000     if (NewCol == NULL)
04001     {
04002         AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
04003                                             _R(IDS_REDNAME), &EndColour2);
04004     }
04005     else
04006         EndColour2 = *NewCol;
04007 }

void ThreeColFillAttribute::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 3914 of file fillval.cpp.

03915 {
03916     if (Pos == NULL)
03917         EndPoint2 = MakeLineAtAngle(*GetStartPoint(), *GetEndPoint(), 90);
03918     else
03919         EndPoint2 = *Pos;
03920 }

void ThreeColFillAttribute::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 3934 of file fillval.cpp.

03935 {
03936     if (Pos == NULL)
03937         EndPoint3 = MakeLineAtAngle(*GetEndPoint(), *GetEndPoint2(), 90);
03938     else
03939         EndPoint3 = *Pos;
03940 }

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

Reimplemented from GradFillAttribute.

Definition at line 697 of file fillval.h.

00697 { return FALSE; }


Member Data Documentation

DocColour ThreeColFillAttribute::EndColour2
 

Definition at line 706 of file fillval.h.

DocCoord ThreeColFillAttribute::EndPoint2
 

Definition at line 701 of file fillval.h.

DocCoord ThreeColFillAttribute::EndPoint3
 

Definition at line 702 of file fillval.h.

BOOL ThreeColFillAttribute::IsPersp
 

Definition at line 704 of file fillval.h.


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