TranspFillAttribute Class Reference

The base class for a fill geometry attribute, such as flat, linear, radial, conical, etc. This provides the basic interface for fill rendering. More...

#include <fillval.h>

Inheritance diagram for TranspFillAttribute:

FillGeometryAttribute AttributeValue CCObject SimpleCCObject FlatTranspFillAttribute GradTranspFillAttribute StrokeTranspAttribute BitmapTranspFillAttribute ConicalTranspFillAttribute LinearTranspFillAttribute RadialTranspFillAttribute SquareTranspFillAttribute ThreeColTranspFillAttribute FractalTranspFillAttribute NoiseTranspFillAttribute FourColTranspFillAttribute List of all members.

Public Member Functions

 TranspFillAttribute ()
 Default Constuctor for fill attribute values.
virtual void Restore (RenderRegion *, BOOL)
 Restores the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.
virtual void Render (RenderRegion *, BOOL Temp=FALSE)
 Sets the fill geometry attribute for the given render region. i.e. all paths filled will now be filled with this fill geometry.
virtual FillGeometryAttributeoperator= (FillGeometryAttribute &Attrib)
 Make the Attribute the same as the other.
virtual INT32 operator== (const FillGeometryAttribute &Attrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual UINT32GetStartTransp ()
virtual void SetStartTransp (UINT32 *NewTransp)
 Sets the Start colour of this fill.
UINT32 GetTranspType ()
void SetTranspType (UINT32 NewType)
 Sets the Transparency type of this fill.
virtual BOOL IsATranspFill ()
virtual ColourFillAttributeMakeSimilarNonTranspFillGeometry (double TransparencyScale)

Static Public Member Functions

static BOOL Init ()
 Registers fill type attribute, and provides a default attribute to give transparent flat fills, i.e. actually not filled at all.

Public Attributes

UINT32 TranspType
UINT32 Transp

Detailed Description

The base class for a fill geometry attribute, such as flat, linear, radial, conical, etc. This provides the basic interface for fill rendering.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
See also:
FlatFillAttribute; LinearFillAttribute; RadialFillAttribute; ConicalFillAttribute; BitmapFillAttribute

Definition at line 998 of file fillval.h.


Constructor & Destructor Documentation

TranspFillAttribute::TranspFillAttribute  ) 
 

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

04129 {
04130     Transp = 0;
04131     TranspType = TT_Mix;
04132 }


Member Function Documentation

virtual UINT32* TranspFillAttribute::GetStartTransp  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Reimplemented in BitmapTranspFillAttribute.

Definition at line 1013 of file fillval.h.

01013 { return &Transp; }

UINT32 TranspFillAttribute::GetTranspType  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1016 of file fillval.h.

01016 { return TranspType; }

BOOL TranspFillAttribute::Init void   )  [static]
 

Registers fill type attribute, and provides a default attribute to give transparent flat fills, i.e. actually not filled at all.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Returns:
TRUE - initialised ok; FALSE if not.

Errors: Out of memory.

See also:
AttributeManager

Reimplemented from SimpleCCObject.

Reimplemented in StrokeTranspAttribute.

Definition at line 4320 of file fillval.cpp.

04321 {
04322     // Default to simple transparent fill colour
04323     FlatTranspFillAttribute *pAttr = new FlatTranspFillAttribute;
04324     if (pAttr==NULL)
04325         // error message has already been set by new
04326         return FALSE;
04327 
04328     pAttr->Transp    = 0;
04329     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), 
04330                                                          pAttr);
04331 
04332     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising TranspFillAttribute");
04333     ERROR2IF(ID != ATTR_TRANSPFILLGEOMETRY, FALSE, "Incorrect ID for TranspFillAttribute");
04334 
04335     return TRUE;
04336 }

virtual BOOL TranspFillAttribute::IsATranspFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1019 of file fillval.h.

01019 { return TRUE; }

virtual ColourFillAttribute* TranspFillAttribute::MakeSimilarNonTranspFillGeometry double  TransparencyScale  )  [inline, virtual]
 

Reimplemented in FlatTranspFillAttribute, GradTranspFillAttribute, LinearTranspFillAttribute, RadialTranspFillAttribute, ConicalTranspFillAttribute, SquareTranspFillAttribute, BitmapTranspFillAttribute, NoiseTranspFillAttribute, FractalTranspFillAttribute, ThreeColTranspFillAttribute, and FourColTranspFillAttribute.

Definition at line 1020 of file fillval.h.

01020 {return NULL;}

FillGeometryAttribute & TranspFillAttribute::operator= FillGeometryAttribute FillAttrib  )  [virtual]
 

Make the Attribute the same as the other.

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

Errors: An ENSURE failure will occur if Attrib does not have a AttrFlatGeometry runtime class.

Reimplemented from FillGeometryAttribute.

Reimplemented in GradTranspFillAttribute, RadialTranspFillAttribute, BitmapTranspFillAttribute, NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 4186 of file fillval.cpp.

04187 {
04188     SetStartTransp(FillAttrib.GetStartTransp());
04189     SetEndTransp(FillAttrib.GetEndTransp());
04190     SetEndTransp2(FillAttrib.GetEndTransp2());
04191     SetEndTransp3(FillAttrib.GetEndTransp3());
04192 
04193     SetTranspType(FillAttrib.GetTranspType());
04194 
04195     // Copy the fills profile
04196     SetProfile (FillAttrib.GetProfile ());
04197 
04198     // Copy the control points
04199     SetStartPoint(FillAttrib.GetStartPoint());
04200     SetEndPoint(FillAttrib.GetEndPoint());
04201     SetEndPoint2(FillAttrib.GetEndPoint2());
04202 
04203     // Bitmap Virtual point stuff
04204     if ( FillAttrib.IsAKindOfBitmapFill() &&
04205          !this->IsAKindOfBitmapFill() )
04206     {
04207         DocCoord Start = *FillAttrib.GetStartPoint();
04208         DocCoord End   = *FillAttrib.GetEndPoint();
04209         DocCoord End2  = *FillAttrib.GetEndPoint2();
04210 
04211         GetBitmapVirtualPoints( Start, End, End2,
04212                                 GetStartPoint(),  GetEndPoint(),  GetEndPoint2());
04213     }
04214     else if ( !FillAttrib.IsAKindOfBitmapFill() &&
04215          this->IsAKindOfBitmapFill() )
04216     {
04217         GetBitmapRealPoints(*GetStartPoint(), *GetEndPoint(), *GetEndPoint2(),
04218                              GetStartPoint(),  GetEndPoint(),  GetEndPoint2());
04219     }
04220 
04221     if (FillAttrib.IsPerspective())
04222     {
04223         MakePerspective();
04224         SetEndPoint3(FillAttrib.GetEndPoint3());
04225     }
04226     else
04227     {
04228         RemovePerspective();
04229     }
04230 
04231     CopyBitmap(FillAttrib.GetBitmap());
04232     SetTesselation(FillAttrib.GetTesselation());
04233     SetAspectLock(FillAttrib.IsAspectLocked());
04234     SetTranspRamp(FillAttrib.GetTranspRamp());
04235 
04236     return *this;
04237 }

INT32 TranspFillAttribute::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 FillGeometryAttribute.

Reimplemented in GradTranspFillAttribute, RadialTranspFillAttribute, BitmapTranspFillAttribute, NoiseTranspFillAttribute, FractalTranspFillAttribute, ThreeColTranspFillAttribute, and FourColTranspFillAttribute.

Definition at line 4255 of file fillval.cpp.

04256 {
04257     if (GetRuntimeClass() != Attrib.GetRuntimeClass())
04258         return FALSE;
04259 
04260     return ((Transp == ((TranspFillAttribute*)&Attrib)->Transp) && 
04261             (TranspType == ((TranspFillAttribute*)&Attrib)->TranspType) );
04262 }

void TranspFillAttribute::Render RenderRegion pRegion,
BOOL  Temp = FALSE
[virtual]
 

Sets the fill geometry attribute for the given render region. i.e. all paths filled will now be filled with this fill geometry.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pRegion - the render region to render this attribute into. [INPUTS]
See also:
TranspFillAttribute; RenderStack; AttributeValue; NodeAttribute; TranspFillAttribute::Restore; TranspFillAttribute::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Implements FillGeometryAttribute.

Reimplemented in BitmapTranspFillAttribute, and StrokeTranspAttribute.

Definition at line 4279 of file fillval.cpp.

04280 {
04281     pRegion->SetTranspFillGeometry(this, Temp);
04282 }

void TranspFillAttribute::Restore RenderRegion pRegion,
BOOL  Temp
[virtual]
 

Restores the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pRegion - the render region to restore the attribute into. [INPUTS] Temp - TRUE if this is a temporary attribute, FALSE if it is permanent (e.g. it's in a document tree).
See also:
TranspFillAttribute; RenderStack; AttributeValue; NodeAttribute; TranspFillAttribute::Render; TranspFillAttribute::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Implements FillGeometryAttribute.

Reimplemented in BitmapTranspFillAttribute, and StrokeTranspAttribute.

Definition at line 4301 of file fillval.cpp.

04302 {
04303     pRegion->RestoreTranspFillGeometry(this, Temp);
04304 }

void TranspFillAttribute::SetStartTransp UINT32 NewTransp  )  [virtual]
 

Sets the Start colour of this fill.

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

Reimplemented from FillGeometryAttribute.

Reimplemented in BitmapTranspFillAttribute.

Definition at line 4164 of file fillval.cpp.

04165 {
04166     if (NewTransp == NULL)
04167         Transp = 0;
04168     else
04169         Transp = *NewTransp;
04170 }

void TranspFillAttribute::SetTranspType UINT32  NewType  )  [virtual]
 

Sets the Transparency type of this fill.

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

Reimplemented from FillGeometryAttribute.

Definition at line 4145 of file fillval.cpp.

04146 {
04147     if (NewType == TT_NoTranspType)
04148         NewType = TT_Mix;
04149 
04150     TranspType = NewType;
04151 }


Member Data Documentation

UINT32 TranspFillAttribute::Transp
 

Definition at line 1024 of file fillval.h.

UINT32 TranspFillAttribute::TranspType
 

Definition at line 1023 of file fillval.h.


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