SquareTranspFillAttribute Class Reference

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

#include <fillval.h>

Inheritance diagram for SquareTranspFillAttribute:

GradTranspFillAttribute TranspFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 SquareTranspFillAttribute ()
 Default Constuctor for fill attribute values.
virtual NodeAttributeMakeNode ()
 Make a AttrSquareFill 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 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 IsASquareFill ()
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

DocCoord EndPoint2
DocCoord EndPoint3
BOOL IsPersp

Detailed Description

Specifies a Square 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 1270 of file fillval.h.


Constructor & Destructor Documentation

SquareTranspFillAttribute::SquareTranspFillAttribute  ) 
 

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

07357 {
07358     IsPersp = FALSE;
07359 
07360     EndPoint2 = DocCoord(0,0);
07361 }


Member Function Documentation

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

Reimplemented from FillGeometryAttribute.

Definition at line 1277 of file fillval.h.

01277 { return &EndPoint2; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1279 of file fillval.h.

01279 { return &EndPoint3; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1290 of file fillval.h.

01290 { return(FILLSHAPE_DIAMOND); }

virtual BOOL SquareTranspFillAttribute::IsASquareFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1286 of file fillval.h.

01286 { return TRUE; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1282 of file fillval.h.

01282 { return IsPersp; }

NodeAttribute * SquareTranspFillAttribute::MakeNode  )  [virtual]
 

Make a AttrSquareFill 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.

Definition at line 7376 of file fillval.cpp.

07377 {
07378     // Create new attribute node
07379     AttrSquareTranspFill *pAttr = new AttrSquareTranspFill;
07380     if (pAttr==NULL)
07381         // error message has already been set by new
07382         return NULL;
07383 
07384     // Copy attribute value into the new node.
07385     pAttr->GetAttributeValue()->SimpleCopy(this);
07386 
07387     // Return the new node
07388     return pAttr;
07389 }

void SquareTranspFillAttribute::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 7444 of file fillval.cpp.

07445 {
07446     IsPersp = TRUE;
07447 
07448     INT32 dx1 = EndPoint.x - StartPoint.x;
07449     INT32 dx2 = EndPoint2.x - StartPoint.x;
07450 
07451     INT32 dy1 = EndPoint.y - StartPoint.y;
07452     INT32 dy2 = EndPoint2.y - StartPoint.y;
07453 
07454     DocCoord Pos3(StartPoint.x + dx1 + dx2, StartPoint.y + dy1 + dy2);
07455     SetEndPoint3(&Pos3);
07456 }

ColourFillAttribute * SquareTranspFillAttribute::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 7494 of file fillval.cpp.

07495 {
07496     UINT32 *pStartTransp = GetStartTransp();
07497     UINT32 *pEndTransp = GetEndTransp();
07498 
07499     if(pStartTransp == NULL || pEndTransp == NULL)
07500         return NULL;
07501     
07502     SquareFillAttribute *pNewAttr = new SquareFillAttribute;    
07503     if (pNewAttr != NULL)
07504     {
07505         pNewAttr->SetStartPoint(GetStartPoint());
07506         pNewAttr->SetEndPoint(GetEndPoint());
07507         pNewAttr->SetEndPoint2(GetEndPoint2());
07508         pNewAttr->SetEndPoint3(GetEndPoint3());
07509 
07510         if(IsPerspective())
07511             pNewAttr->MakePerspective();
07512 
07513         pNewAttr->AttachBitmap(GetBitmap());
07514 
07515         INT32 StartTransparency = 255 - (INT32)(((double)(255 - *pStartTransp)) * TransparencyScale);
07516         INT32 EndTransparency = 255 - (INT32)(((double)(255 - *pEndTransp)) * TransparencyScale);
07517 
07518         DocColour       colorStart(StartTransparency, StartTransparency, StartTransparency);
07519         DocColour       colorEnd1(EndTransparency, EndTransparency, EndTransparency);
07520         pNewAttr->SetStartColour(&colorStart);
07521         pNewAttr->SetEndColour(&colorEnd1);
07522     }
07523 
07524     return(pNewAttr);
07525 }

void SquareTranspFillAttribute::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 7469 of file fillval.cpp.

07470 {
07471     IsPersp = FALSE;
07472 }

void SquareTranspFillAttribute::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 7402 of file fillval.cpp.

07403 {
07404     if (Pos == NULL)
07405         EndPoint2 = MakeLineAtAngle(*GetStartPoint(), *GetEndPoint(), 90);
07406     else
07407         EndPoint2 = *Pos;
07408 }

void SquareTranspFillAttribute::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 7422 of file fillval.cpp.

07423 {
07424     if (Pos == NULL)
07425         EndPoint3 = MakeLineAtAngle(*GetEndPoint(), *GetEndPoint2(), 90);
07426     else
07427         EndPoint3 = *Pos;
07428 }


Member Data Documentation

DocCoord SquareTranspFillAttribute::EndPoint2
 

Definition at line 1293 of file fillval.h.

DocCoord SquareTranspFillAttribute::EndPoint3
 

Definition at line 1294 of file fillval.h.

BOOL SquareTranspFillAttribute::IsPersp
 

Definition at line 1296 of file fillval.h.


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