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

GradTranspFillAttribute TranspFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 RadialTranspFillAttribute ()
 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 comparison operator. See NodeAttribute::operator== for a description of why it's required.
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 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 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 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 ()
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:
23/8/94
See also:
GradFillAttribute

Definition at line 1178 of file fillval.h.


Constructor & Destructor Documentation

RadialTranspFillAttribute::RadialTranspFillAttribute  ) 
 

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

05093 {
05094     Circular = FALSE;
05095     IsPersp = FALSE;
05096 
05097     EndPoint2 = DocCoord(0,0);
05098 }


Member Function Documentation

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

Reimplemented from FillGeometryAttribute.

Definition at line 1200 of file fillval.h.

01200 { return &EndPoint2; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1202 of file fillval.h.

01202 { return &EndPoint3; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1213 of file fillval.h.

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

Reimplemented from FillGeometryAttribute.

Definition at line 1209 of file fillval.h.

01209 { return TRUE; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1189 of file fillval.h.

01189 { return Circular; }

BOOL RadialTranspFillAttribute::IsCircular  )  [inline]
 

Definition at line 1197 of file fillval.h.

01197 { return Circular; }

BOOL RadialTranspFillAttribute::IsElliptical  )  [inline]
 

Definition at line 1198 of file fillval.h.

01198 { return !Circular; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1205 of file fillval.h.

01205 { return IsPersp; }

void RadialTranspFillAttribute::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 5250 of file fillval.cpp.

05251 {
05252     // Set a flag so we can tell we're circular
05253     Circular = TRUE;
05254 
05255     // Make sure the second end point is on the same radius as the other
05256     EndPoint2 = MakeLineAtAngle(StartPoint, EndPoint, 90);
05257 }

void RadialTranspFillAttribute::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 5269 of file fillval.cpp.

05270 {
05271     // Just clear the flag, so we don't try and lock the secondary point
05272     Circular = FALSE;
05273 }

NodeAttribute * RadialTranspFillAttribute::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 5205 of file fillval.cpp.

05206 {
05207     // Create new attribute node
05208     AttrRadialTranspFill *pAttr = new AttrRadialTranspFill;
05209     if (pAttr==NULL)
05210         // error message has already been set by new
05211         return NULL;
05212 
05213     // Copy attribute value into the new node.
05214     pAttr->GetAttributeValue()->SimpleCopy(this);
05215 
05216     // Return the new node
05217     return pAttr;
05218 }

void RadialTranspFillAttribute::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 5308 of file fillval.cpp.

05309 {
05310     IsPersp = TRUE;
05311 
05312     INT32 dx1 = EndPoint.x - StartPoint.x;
05313     INT32 dx2 = EndPoint2.x - StartPoint.x;
05314 
05315     INT32 dy1 = EndPoint.y - StartPoint.y;
05316     INT32 dy2 = EndPoint2.y - StartPoint.y;
05317 
05318     DocCoord Pos3(StartPoint.x + dx1 + dx2, StartPoint.y + dy1 + dy2);
05319     SetEndPoint3(&Pos3);
05320 }

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

Definition at line 5358 of file fillval.cpp.

05359 {
05360     UINT32 *pStartTransp = GetStartTransp();
05361     UINT32 *pEndTransp = GetEndTransp();
05362 
05363     if(pStartTransp == NULL || pEndTransp == NULL)
05364         return NULL;
05365     
05366     RadialFillAttribute *pNewAttr = new RadialFillAttribute;    
05367     if (pNewAttr != NULL)
05368     {
05369         pNewAttr->SetStartPoint(GetStartPoint());
05370         pNewAttr->SetEndPoint(GetEndPoint());
05371         pNewAttr->SetEndPoint2(GetEndPoint2());
05372         pNewAttr->SetEndPoint3(GetEndPoint3());
05373 
05374         if(IsCircular())
05375             pNewAttr->MakeCircular();
05376         else
05377             pNewAttr->MakeElliptical();
05378 
05379         if(IsPerspective())
05380             pNewAttr->MakePerspective();
05381 
05382         INT32 StartTransparency = 255 - (INT32)(((double)(255 - *pStartTransp)) * TransparencyScale);
05383         INT32 EndTransparency = 255 - (INT32)(((double)(255 - *pEndTransp)) * TransparencyScale);
05384 
05385         DocColour       colorStart(StartTransparency, StartTransparency, StartTransparency);
05386         DocColour       colorEnd1(EndTransparency, EndTransparency, EndTransparency);
05387         pNewAttr->SetStartColour(&colorStart);
05388         pNewAttr->SetEndColour(&colorEnd1);
05389     }
05390 
05391     return(pNewAttr);
05392 }

AttributeValue * RadialTranspFillAttribute::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 5426 of file fillval.cpp.

05427 {
05428 // Taken out of WEBSTER Neville 6/8/97
05429 // Taken out by vector stroking code Neville 2/10/97
05430 #ifdef VECTOR_STROKING
05431     if (pMoulder == NULL)
05432         return(NULL);
05433 
05434     RadialFillAttribute *pCopy = (RadialFillAttribute *) GetRuntimeClass()->CreateObject();
05435     if (pCopy != NULL)
05436     {
05437         // Copy this object's values across
05438         *pCopy = *this;
05439 
05440         // Make sure it's defined as an elliptical fill, to ensure all points are set up correctly
05441         pCopy->MakeElliptical();
05442 
05443         // And mould all of the geometry points across
05444         JCW_MOULDPOINT(pCopy, StartPoint);
05445         JCW_MOULDPOINT(pCopy, EndPoint);
05446         JCW_MOULDPOINT(pCopy, EndPoint2);
05447         JCW_MOULDPOINT(pCopy, EndPoint3);
05448 
05449         ERROR3IF(TransScale < 0.0 || TransScale > 1.0, "Out of range TransScale parameter");
05450         if (TransScale >= 0.0 && TransScale < 1.0)
05451         {
05452             JCW_MOULDTRANS(pCopy, StartTransp);
05453             JCW_MOULDTRANS(pCopy, EndTransp);
05454         }
05455     }
05456     return(pCopy);
05457 #else
05458     return NULL;
05459 #endif // VECTOR_STROKING
05460 }

FillGeometryAttribute & RadialTranspFillAttribute::operator= 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:
8/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 GradTranspFillAttribute.

Definition at line 5135 of file fillval.cpp.

05136 {
05137     return GradTranspFillAttribute::operator=(Attrib);
05138 }

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

Definition at line 5156 of file fillval.cpp.

05157 {
05158     if (GetRuntimeClass() != Attrib.GetRuntimeClass())
05159         return FALSE;
05160 
05161     RadialTranspFillAttribute* pAttrib = (RadialTranspFillAttribute*)&Attrib;
05162 
05163     if (IsPerspective())
05164     { 
05165         if (!pAttrib->IsPerspective())
05166             return FALSE;
05167 
05168         if (*GetEndPoint3() != *pAttrib->GetEndPoint3())
05169             return FALSE;
05170     }
05171 
05172     // check the transparency ramp matches
05173     if (!SameTransparencyRampAs(pAttrib->GetTranspRamp()))
05174         return FALSE;
05175 
05176     // Are the Colours and Control points all the same ?
05177     return (
05178     
05179         Transp      == pAttrib->Transp      &&
05180         EndTransp   == pAttrib->EndTransp   &&
05181 
05182         TranspType  == pAttrib->TranspType  &&
05183                        
05184         StartPoint  == pAttrib->StartPoint  &&
05185         EndPoint    == pAttrib->EndPoint    &&
05186         EndPoint2   == pAttrib->EndPoint2   &&
05187 
05188         Circular    == pAttrib->Circular
05189     );
05190 }

void RadialTranspFillAttribute::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 5333 of file fillval.cpp.

05334 {
05335     IsPersp = FALSE;
05336 }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1190 of file fillval.h.

01190 { Circular = Locked; }

void RadialTranspFillAttribute::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 5111 of file fillval.cpp.

05112 {
05113     if (Pos == NULL)
05114         EndPoint2 = DocCoord(0,0);
05115     else
05116         EndPoint2 = *Pos;
05117 }

void RadialTranspFillAttribute::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 5286 of file fillval.cpp.

05287 {
05288     if (Pos == NULL)
05289         EndPoint3 = MakeLineAtAngle(*GetEndPoint(), *GetEndPoint2(), 90);
05290     else
05291         EndPoint3 = *Pos;
05292 }

void RadialTranspFillAttribute::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:
RadialTranspFillAttribute; RenderStack; AttributeValue; NodeAttribute; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Reimplemented from GradTranspFillAttribute.

Definition at line 5234 of file fillval.cpp.

05235 {
05236     // Base class does most of the work...
05237     GradTranspFillAttribute::SimpleCopy(pValue);
05238 }


Member Data Documentation

BOOL RadialTranspFillAttribute::Circular [private]
 

Definition at line 1226 of file fillval.h.

DocCoord RadialTranspFillAttribute::EndPoint2
 

Definition at line 1221 of file fillval.h.

DocCoord RadialTranspFillAttribute::EndPoint3
 

Definition at line 1222 of file fillval.h.

BOOL RadialTranspFillAttribute::IsPersp
 

Definition at line 1223 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