ConicalTranspFillAttribute Class Reference

Specifies a conical fill attribute for an object, including the vector that defines the centre of the cone, and the angle of the fill. More...

#include <fillval.h>

Inheritance diagram for ConicalTranspFillAttribute:

GradTranspFillAttribute TranspFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 ConicalTranspFillAttribute ()
 Default Constuctor for fill attribute values.
virtual NodeAttributeMakeNode ()
 Make a AttrConicalFill node from this graduated fill attribute.
virtual BOOL IsAConicalFill ()
virtual DocCoord GetGeometryCoord (float pos) const
 Find the absolute position in geometry coordinate space for the given parameter.
virtual float GetGeometryParam (const DocCoord &c) const
 Find the parameter for the closest point to c on this geometry.
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 ()

Detailed Description

Specifies a conical fill attribute for an object, including the vector that defines the centre of the cone, and the angle of the fill.

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

Definition at line 1241 of file fillval.h.


Constructor & Destructor Documentation

ConicalTranspFillAttribute::ConicalTranspFillAttribute  ) 
 

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

05482 {
05483 }


Member Function Documentation

DocCoord ConicalTranspFillAttribute::GetGeometryCoord float  pos  )  const [virtual]
 

Find the absolute position in geometry coordinate space for the given parameter.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/3/97
Parameters:
pos = a parameter between 0 and 1 [INPUTS]
Returns:
A coordinate which relates the input parameter to a coordinate space on this geometry. For instance a linear fill would have a linear parameter space, 0 at the start coordinate, increasing to 1 at the end coordinate

Reimplemented from GradTranspFillAttribute.

Definition at line 5528 of file fillval.cpp.

05529 {
05530     // Here we calculate a circular coordinate space
05531     return PathUtil::PointOnSemiCircle(StartPoint,EndPoint,(double)pos);
05532 }

float ConicalTranspFillAttribute::GetGeometryParam const DocCoord c  )  const [virtual]
 

Find the parameter for the closest point to c on this geometry.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/3/97
Parameters:
c = a coordinate [INPUTS]
Returns:
A parameter p, 0<=p<=1, such that GetGeometryCoord(p) is the closest coordinate in the geometry to the input c.

Reimplemented from GradTranspFillAttribute.

Definition at line 5549 of file fillval.cpp.

05550 {
05551     // ok we're a linear geometry so find the closest point to a line type of thing.
05552     // use a handy util written by that other fab bloke called Mike.
05553     DocCoord Coords[2];
05554     Coords[0] = StartPoint;
05555     Coords[1] = EndPoint;
05556     double p;
05557     PathUtil::SqrDistanceToSemiCircle(Coords, c, &p);
05558     return (float)p;
05559 }

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

Reimplemented from FillGeometryAttribute.

Definition at line 1254 of file fillval.h.

01254 { return(FILLSHAPE_CONICAL); }

virtual BOOL ConicalTranspFillAttribute::IsAConicalFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1248 of file fillval.h.

01248 { return TRUE; }

NodeAttribute * ConicalTranspFillAttribute::MakeNode  )  [virtual]
 

Make a AttrConicalFill 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 5498 of file fillval.cpp.

05499 {
05500     // Create new attribute node
05501     AttrConicalTranspFill *pAttr = new AttrConicalTranspFill;
05502     if (pAttr==NULL)
05503         // error message has already been set by new
05504         return NULL;
05505 
05506     // Copy attribute value into the new node.
05507     pAttr->GetAttributeValue()->SimpleCopy(this);
05508 
05509     // Return the new node
05510     return pAttr;
05511 }

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

05582 {
05583     UINT32 *pStartTransp = GetStartTransp();
05584     UINT32 *pEndTransp = GetEndTransp();
05585 
05586     if(pStartTransp == NULL || pEndTransp == NULL)
05587         return NULL;
05588     
05589     ConicalFillAttribute *pNewAttr = new ConicalFillAttribute;  
05590     if (pNewAttr != NULL)
05591     {
05592         pNewAttr->SetStartPoint(GetStartPoint());
05593         pNewAttr->SetEndPoint(GetEndPoint());
05594 
05595         INT32 StartTransparency = 255 - (INT32)(((double)(255 - *pStartTransp)) * TransparencyScale);
05596         INT32 EndTransparency = 255 - (INT32)(((double)(255 - *pEndTransp)) * TransparencyScale);
05597 
05598         DocColour       colorStart(StartTransparency, StartTransparency, StartTransparency);
05599         DocColour       colorEnd1(EndTransparency, EndTransparency, EndTransparency);
05600         pNewAttr->SetStartColour(&colorStart);
05601         pNewAttr->SetEndColour(&colorEnd1);
05602     }
05603 
05604     return(pNewAttr);
05605 }


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