RadialFillAttribute Class Reference

Specifies a radial fill attribute for an object, including the two vectors that define the ellipse. More...

#include <fillval.h>

Inheritance diagram for RadialFillAttribute:

GradFillAttribute ColourFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 RadialFillAttribute ()
 Default Constuctor for fill attribute values.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.
virtual NodeAttributeMakeNode ()
 Make a AttrRadialFill node from this graduated fill attribute.
virtual FillGeometryAttributeoperator= (FillGeometryAttribute &Attrib)
 A virtual assignment operator.
virtual INT32 operator== (const FillGeometryAttribute &Attrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual BOOL IsAspectLocked ()
virtual void SetAspectLock (BOOL Locked)
void MakeCircular ()
 Forces this radial fill into a circular one.
void MakeElliptical ()
 Forces this radial fill into an elliptical one.
BOOL IsCircular ()
BOOL IsElliptical ()
virtual DocCoordGetEndPoint2 ()
virtual DocCoordGetEndPoint3 ()
virtual void SetEndPoint2 (DocCoord *Pos)
 Sets the End Point of this fill.
virtual void SetEndPoint3 (DocCoord *Pos)
 Sets the End Point 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 IsARadialFill ()
virtual INT32 GetGeometryShape ()
virtual AttributeValueMouldIntoStroke (PathStrokerVector *pMoulder, double TransScale=1.0)
 Helper function for the PathStrokerVector class, which "moulds" clipart subtrees to lie along an arbitrary path.

Public Attributes

DocCoord EndPoint2
DocCoord EndPoint3
BOOL IsPersp

Private Attributes

BOOL Circular

Detailed Description

Specifies a radial fill attribute for an object, including the two vectors that define the ellipse.

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

Definition at line 547 of file fillval.h.


Constructor & Destructor Documentation

RadialFillAttribute::RadialFillAttribute  ) 
 

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

01653 {
01654     Circular = FALSE;
01655     IsPersp = FALSE;
01656 
01657     EndPoint2 = DocCoord(0,0);
01658 }


Member Function Documentation

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

Reimplemented from FillGeometryAttribute.

Definition at line 570 of file fillval.h.

00570 { return &EndPoint2; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 571 of file fillval.h.

00571 { return &EndPoint3; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 580 of file fillval.h.

virtual BOOL RadialFillAttribute::IsARadialFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 579 of file fillval.h.

00579 { return TRUE; }

virtual BOOL RadialFillAttribute::IsAspectLocked  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 559 of file fillval.h.

00559 { return Circular; }

BOOL RadialFillAttribute::IsCircular  )  [inline]
 

Definition at line 567 of file fillval.h.

00567 { return Circular; }

BOOL RadialFillAttribute::IsElliptical  )  [inline]
 

Definition at line 568 of file fillval.h.

00568 { return !Circular; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 575 of file fillval.h.

00575 { return IsPersp; }

void RadialFillAttribute::MakeCircular  ) 
 

Forces this radial fill into a circular one.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/94

Definition at line 1804 of file fillval.cpp.

01805 {
01806     // Set a flag so we can tell we're circular
01807     Circular = TRUE;
01808 
01809     // Make sure the second end point is on the same radius as the other
01810     EndPoint2 = MakeLineAtAngle(StartPoint, EndPoint, 90);
01811 }

void RadialFillAttribute::MakeElliptical  ) 
 

Forces this radial fill into an elliptical one.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/94

Definition at line 1823 of file fillval.cpp.

01824 {
01825     // Just clear the flag, so we don't try and lock the secondary point
01826     Circular = FALSE;
01827 }

NodeAttribute * RadialFillAttribute::MakeNode  )  [virtual]
 

Make a AttrRadialFill node from this graduated fill 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

Reimplemented from AttributeValue.

Definition at line 1673 of file fillval.cpp.

01674 {
01675     // Create new attribute node
01676     AttrRadialFill *pAttr = new AttrRadialColourFill;
01677     if (pAttr==NULL)
01678         // error message has already been set by new
01679         return NULL;
01680 
01681     // Copy attribute value into the new node.
01682     pAttr->GetAttributeValue()->SimpleCopy(this);
01683 
01684     // Return the new node
01685     return pAttr;
01686 }

void RadialFillAttribute::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:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/4/95
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Definition at line 1862 of file fillval.cpp.

01863 {
01864     IsPersp = TRUE;
01865 
01866     INT32 dx1 = EndPoint.x - StartPoint.x;
01867     INT32 dx2 = EndPoint2.x - StartPoint.x;
01868 
01869     INT32 dy1 = EndPoint.y - StartPoint.y;
01870     INT32 dy2 = EndPoint2.y - StartPoint.y;
01871 
01872     DocCoord Pos3(StartPoint.x + dx1 + dx2, StartPoint.y + dy1 + dy2);
01873     SetEndPoint3(&Pos3);
01874 }

AttributeValue * RadialFillAttribute::MouldIntoStroke PathStrokerVector pMoulder,
double  TransScale = 1.0
[virtual]
 

Helper function for the PathStrokerVector class, which "moulds" clipart subtrees to lie along an arbitrary path.

Parameters:
pMoulder - A PathStrokerVector which knows how to translate points to "mould" them [INPUTS] (May be NULL, in which case moulding of points does not occur)
TransScale - A fraction between 0.0 and 1.0, by which any transparency values in this geometry will be scaled, allowing the caller to effectively apply a flat transparency level to everything that is moulded. Use 1.0 to leave transparency unaltered.

Returns:
NULL if the original attribute can be used, else A pointer to a copy of this object, suitably moulded and adjusted for the transparency scaling. The caller must delete the copy when finished with it.
This function is called to mould fill geometries, so that fill endpoints are translated to appropriate positions in the destination envelope, and allows the caller to effectively apply a flat transparency by scaling any transparency values in this geometry by the given fraction.

Reimplemented from FillGeometryAttribute.

Definition at line 1923 of file fillval.cpp.

01924 {
01925 // Taken out of WEBSTER Neville 6/8/97
01926 // Taken out by vector stroking code Neville 2/10/97
01927 #ifdef VECTOR_STROKING
01928     if (pMoulder == NULL)
01929         return(NULL);
01930 
01931     RadialFillAttribute *pCopy = (RadialFillAttribute *) GetRuntimeClass()->CreateObject();
01932     if (pCopy != NULL)
01933     {
01934         // Copy this object's values across
01935         *pCopy = *this;
01936 
01937         // Make sure it's defined as an elliptical fill, to ensure all points are set up correctly
01938         pCopy->MakeElliptical();
01939 
01940         // And mould all of the geometry points across
01941         JCW_MOULDPOINT(pCopy, StartPoint);
01942         JCW_MOULDPOINT(pCopy, EndPoint);
01943         JCW_MOULDPOINT(pCopy, EndPoint2);
01944         JCW_MOULDPOINT(pCopy, EndPoint3);
01945     }
01946     return(pCopy);
01947 #else
01948     return NULL;
01949 #endif // VECTOR_STROKING
01950 }

FillGeometryAttribute & RadialFillAttribute::operator= FillGeometryAttribute Attrib  )  [virtual]
 

A virtual assignment operator.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/8/94
Parameters:
Attrib - the attribute to copy, which must be an AttrFillGeometry [INPUTS]
Returns:
A reference to the copy

Reimplemented from GradFillAttribute.

Definition at line 1719 of file fillval.cpp.

01720 {
01721     return GradFillAttribute::operator=(Attrib);
01722 }

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

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

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
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.

Definition at line 1740 of file fillval.cpp.

01741 {
01742     if (GetRuntimeClass() != Attrib.GetRuntimeClass())
01743         return FALSE;
01744 
01745     RadialFillAttribute* pAttrib = (RadialFillAttribute*)&Attrib;
01746 
01747     if (IsPerspective())
01748     { 
01749         if (!pAttrib->IsPerspective())
01750             return FALSE;
01751 
01752         if (EndPoint3 != pAttrib->EndPoint3)
01753             return FALSE;
01754     }
01755 
01756     // check the colour ramps match
01757     if (!SameColourRampAs(pAttrib->GetColourRamp()))
01758         return FALSE;
01759 
01760     // Are the Colours and Control points all the same ?
01761     return (
01762     
01763         Colour      == pAttrib->Colour      &&
01764         EndColour   == pAttrib->EndColour   &&
01765                        
01766         StartPoint  == pAttrib->StartPoint  &&
01767         EndPoint    == pAttrib->EndPoint    &&
01768         EndPoint2   == pAttrib->EndPoint2   &&
01769 
01770         Circular    == pAttrib->Circular
01771     );
01772 }

void RadialFillAttribute::RemovePerspective  )  [virtual]
 

Removes perspective from this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/4/95
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Definition at line 1887 of file fillval.cpp.

01888 {
01889     IsPersp = FALSE;
01890 }

virtual void RadialFillAttribute::SetAspectLock BOOL  Locked  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 560 of file fillval.h.

00560 { Circular = Locked; }

void RadialFillAttribute::SetEndPoint2 DocCoord Pos  )  [virtual]
 

Sets the End Point of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Definition at line 1699 of file fillval.cpp.

01700 {
01701     if (Pos == NULL)
01702         EndPoint2 = DocCoord(0,0);
01703     else
01704         EndPoint2 = *Pos;
01705 }

void RadialFillAttribute::SetEndPoint3 DocCoord Pos  )  [virtual]
 

Sets the End Point of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Definition at line 1840 of file fillval.cpp.

01841 {
01842     if (Pos == NULL)
01843         EndPoint3 = MakeLineAtAngle(*GetEndPoint(), *GetEndPoint2(), 90);
01844     else
01845         EndPoint3 = *Pos;
01846 }

void RadialFillAttribute::SimpleCopy AttributeValue pValue  )  [virtual]
 

See AttributeValue::SimpleCopy.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pAttr - pointer to the AttributeValue to copy. [INPUTS]
See also:
RadialFillAttribute; RenderStack; AttributeValue; NodeAttribute; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Reimplemented from GradFillAttribute.

Definition at line 1787 of file fillval.cpp.

01788 {
01789     // Base class does most of the work...
01790     GradFillAttribute::SimpleCopy(pValue);
01791 }


Member Data Documentation

BOOL RadialFillAttribute::Circular [private]
 

Definition at line 593 of file fillval.h.

DocCoord RadialFillAttribute::EndPoint2
 

Definition at line 588 of file fillval.h.

DocCoord RadialFillAttribute::EndPoint3
 

Definition at line 589 of file fillval.h.

BOOL RadialFillAttribute::IsPersp
 

Definition at line 590 of file fillval.h.


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