BitmapFillAttribute Class Reference

Specifies a bitmap fill attribute for an object. More...

#include <fillval.h>

Inheritance diagram for BitmapFillAttribute:

GradFillAttribute ColourFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject FractalFillAttribute NoiseFillAttribute List of all members.

Public Member Functions

 BitmapFillAttribute ()
 Default Constuctor for fill attribute values.
 ~BitmapFillAttribute ()
 Destructor for bitmap 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 NodeAttributeMakeNode ()
 Make a AttrFlatColourFill node from this flat fill colour attribute.
virtual BOOL RenderFill (RenderRegion *, Path *)
 Render the fill, if possible - it depends on what kind of render region we have been given.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.
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 KernelBitmapRefGetBitmapRef ()
virtual BOOL AttachBitmap (KernelBitmap *pBitmap)
 Attaches a bitmap to this fill.
virtual BOOL DetachBitmap ()
 Detaches a bitmap from this fill.
virtual KernelBitmapGetBitmap ()
 Get the bitmap referenced by this attribute.
virtual BOOL CopyBitmap (KernelBitmap *)
 Used to copy a bitmap from one fill to another.
virtual DocCoordGetStartPoint ()
virtual DocCoordGetEndPoint ()
virtual DocCoordGetEndPoint2 ()
virtual DocCoordGetEndPoint3 ()
virtual void SetStartPoint (DocCoord *Pos)
 Sets the Start Point of this fill.
virtual void SetEndPoint (DocCoord *Pos)
 Sets the End Point of this fill.
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 void SetStartColour (DocColour *)
 Sets the start colour of this fill.
virtual void SetEndColour (DocColour *)
 Sets the end colour of this fill.
virtual DocColourGetStartColour ()
 Gets the Start colour of this fill.
virtual DocColourGetEndColour ()
 Gets the End colour of this fill.
virtual INT32 GetTesselation ()
virtual void SetTesselation (INT32 NewTess)
virtual BOOL SetDPI (UINT32 NewDpi)
 Sets the DPI of a bitmap.
virtual UINT32 GetDPI ()
 Gets the DPI of a bitmap.
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 IsAKindOfBitmapFill ()
virtual BOOL IsABitmapFill ()
BOOL CanBlurRenderBitmap ()
void SetCanBlurRenderBitmap (BOOL b)
virtual INT32 GetGeometryShape ()

Public Attributes

KernelBitmapRef BitmapRef
DocCoord EndPoint2
DocCoord EndPoint3
INT32 Tesselation
BOOL IsPersp
BOOL m_CanBlurRender

Static Public Attributes

static BOOL m_doBitmapSmoothing = TRUE

Detailed Description

Specifies a bitmap fill attribute for an object.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/9/94
See also:
FillGeometryAttribute

Definition at line 755 of file fillval.h.


Constructor & Destructor Documentation

BitmapFillAttribute::BitmapFillAttribute  ) 
 

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

02212 {
02213     Colour    = DocColour(COLOUR_NONE);
02214     EndColour = DocColour(COLOUR_NONE);
02215 
02216     StartPoint = DocCoord(0,0);
02217     EndPoint   = DocCoord(0,0);
02218     EndPoint2  = DocCoord(0,0);
02219 
02220     Tesselation = RT_Repeating;
02221 
02222     IsPersp = FALSE;
02223 
02224     m_CanBlurRender = TRUE;
02225 }

BitmapFillAttribute::~BitmapFillAttribute  ) 
 

Destructor for bitmap fill attribute values.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/9/94
See also:
AttrFillGeometry::AttrFillGeometry

Definition at line 2238 of file fillval.cpp.

02239 {
02240 }


Member Function Documentation

BOOL BitmapFillAttribute::AttachBitmap KernelBitmap NewBitmap  )  [virtual]
 

Attaches a bitmap to this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/9/94
See also:
BitmapFillAttribute::DetachBitmap()

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2317 of file fillval.cpp.

02318 {
02319     BitmapRef.Attach(NewBitmap);
02320 
02321     return TRUE;
02322 }

BOOL BitmapFillAttribute::CanBlurRenderBitmap  )  [inline]
 

Definition at line 811 of file fillval.h.

00811 { return m_CanBlurRender; }

BOOL BitmapFillAttribute::CopyBitmap KernelBitmap BmpToCopy  )  [virtual]
 

Used to copy a bitmap from one fill to another.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/9/94
See also:
BitmapFillAttribute::AttachBitmap()

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2353 of file fillval.cpp.

02354 {
02355     if (BmpToCopy != NULL)  // Is there a bitmap to copy ?
02356     {
02357         BitmapRef.Detach();
02358 
02359         OILBitmap* Bmp = BmpToCopy->ActualBitmap;
02360         if (Bmp->IsTemp())
02361         {
02362             BitmapRef.SetBitmap(BmpToCopy);
02363             return TRUE;
02364         }
02365 
02366         BitmapRef.Attach(BmpToCopy);
02367     }
02368 
02369     return TRUE;
02370 }

BOOL BitmapFillAttribute::DetachBitmap  )  [virtual]
 

Detaches a bitmap from this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/9/94
See also:
BitmapFillAttribute::AttachBitmap()

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2335 of file fillval.cpp.

02336 {
02337     BitmapRef.Detach();
02338 
02339     return TRUE;
02340 }

KernelBitmap * BitmapFillAttribute::GetBitmap void   )  [virtual]
 

Get the bitmap referenced by this attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/12/94
See also:
BitmapFillAttribute::AttachBitmap()

Reimplemented from FillGeometryAttribute.

Definition at line 2287 of file fillval.cpp.

02288 {
02289     KernelBitmap* pBitmap = BitmapRef.GetBitmap();
02290     
02291     // Check for a deleted bitmap
02292     if (pBitmap && pBitmap->HasBeenDeleted())
02293     {
02294         ERROR2IF(pBitmap->GetParentBitmapList() == NULL, NULL, "Deleted bitmap has no parent list");
02295         
02296         // Use the default bitmap instead
02297         pBitmap = pBitmap->GetParentBitmapList()->FindDefaultBitmap();
02298 
02299         // There should always be a default bitmap in the list
02300         ERROR2IF(pBitmap == NULL, 0L, "Couldn't find the default bitmap");
02301     }
02302 
02303     return pBitmap;
02304 }

KernelBitmapRef * BitmapFillAttribute::GetBitmapRef  )  [virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 2242 of file fillval.cpp.

02243 {
02244     return &BitmapRef;
02245 }

UINT32 BitmapFillAttribute::GetDPI  )  [virtual]
 

Gets the DPI of a bitmap.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/94
Returns:
The current DPI of the bitmap
See also:
FractalFillAttribute::SetDPI

Reimplemented from FillGeometryAttribute.

Definition at line 2785 of file fillval.cpp.

02786 {
02787     UINT32 Dpi = 0;
02788 
02789     if (GetBitmap() == NULL)
02790         return 0;
02791 
02792     OILBitmap *OilBM = GetBitmap()->ActualBitmap;
02793 
02794     if (OilBM != NULL)
02795     {
02796         BitmapInfo Info;
02797         OilBM->GetInfo(&Info);
02798 
02799         INT32 PixWidth  = Info.PixelWidth;
02800         INT32 PixHeight = Info.PixelHeight;
02801 
02802         DocCoord Start = *GetStartPoint();
02803         DocCoord End   = *GetEndPoint();
02804         DocCoord End2  = *GetEndPoint2();
02805 
02806         INT32 Width  = INT32(Start.Distance(End));
02807         INT32 Height = INT32(Start.Distance(End2));
02808 
02809         UINT32 HDpi = 0;
02810         UINT32 VDpi = 0;
02811 
02812         if (Width > 0)
02813             HDpi = (PixWidth*72000)/Width;
02814 
02815         if (Height > 0)
02816             VDpi = (PixHeight*72000)/Height;
02817 
02818         Dpi = HDpi;
02819         if (VDpi < Dpi)
02820             Dpi = VDpi;
02821     }
02822 
02823     return Dpi;
02824 }

DocColour * BitmapFillAttribute::GetEndColour  )  [virtual]
 

Gets the End colour of this fill.

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

Reimplemented from GradFillAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2924 of file fillval.cpp.

02925 {
02926     if (EndColour == COLOUR_NONE)
02927         return NULL;
02928     else
02929         return &EndColour;
02930 }

virtual DocCoord* BitmapFillAttribute::GetEndPoint  )  [inline, virtual]
 

Reimplemented from GradFillAttribute.

Definition at line 782 of file fillval.h.

00782 { return &EndPoint; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 783 of file fillval.h.

00783 { return &EndPoint2; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 784 of file fillval.h.

00784 { return &EndPoint3; }

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

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 814 of file fillval.h.

00814 { return(FILLSHAPE_BITMAP); }

DocColour * BitmapFillAttribute::GetStartColour  )  [virtual]
 

Gets the Start colour of this fill.

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

Reimplemented from ColourFillAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2905 of file fillval.cpp.

02906 {
02907     if (Colour == COLOUR_NONE)
02908         return NULL;
02909     else
02910         return &Colour;
02911 }

virtual DocCoord* BitmapFillAttribute::GetStartPoint  )  [inline, virtual]
 

Reimplemented from GradFillAttribute.

Definition at line 781 of file fillval.h.

00781 { return &StartPoint; }

virtual INT32 BitmapFillAttribute::GetTesselation  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 796 of file fillval.h.

00796 { return Tesselation; }

virtual BOOL BitmapFillAttribute::IsABitmapFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 807 of file fillval.h.

00807 { return TRUE; }

virtual BOOL BitmapFillAttribute::IsAKindOfBitmapFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 806 of file fillval.h.

00806 { return TRUE; }

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

Reimplemented from FillGeometryAttribute.

Definition at line 802 of file fillval.h.

00802 { return IsPersp; }

NodeAttribute * BitmapFillAttribute::MakeNode  )  [virtual]
 

Make a AttrFlatColourFill node from this flat fill colour attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/8/94
Returns:
Pointer to the new node, or NULL if out of memory.

Errors: Out of memory

See also:
AttributeValue::MakeNode; AttrFlatColourFill

Reimplemented from AttributeValue.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2260 of file fillval.cpp.

02261 {
02262     // Create new attribute node
02263     AttrBitmapFill *pAttr = new AttrBitmapColourFill;
02264     if (pAttr==NULL)
02265         // error message has already been set by new
02266         return NULL;
02267 
02268     // Copy attribute value into the new node.
02269     pAttr->GetAttributeValue()->SimpleCopy(this);
02270 
02271     // Return the new node
02272     return pAttr;
02273 }

void BitmapFillAttribute::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:
1/4/94
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Definition at line 2506 of file fillval.cpp.

02507 {
02508     IsPersp = TRUE;
02509 
02510     INT32 dx1 = EndPoint.x - StartPoint.x;
02511     INT32 dx2 = EndPoint2.x - StartPoint.x;
02512 
02513     INT32 dy1 = EndPoint.y - StartPoint.y;
02514     INT32 dy2 = EndPoint2.y - StartPoint.y;
02515 
02516     DocCoord Pos3(StartPoint.x + dx1 + dx2, StartPoint.y + dy1 + dy2);
02517     SetEndPoint3(&Pos3);
02518 }

FillGeometryAttribute & BitmapFillAttribute::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 reference

Reimplemented from GradFillAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2548 of file fillval.cpp.

02549 {
02550     return ColourFillAttribute::operator=(FillAttrib);
02551 }

INT32 BitmapFillAttribute::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.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2569 of file fillval.cpp.

02570 {
02571     if (GetRuntimeClass() != Attrib.GetRuntimeClass())
02572         return FALSE;
02573 
02574     BitmapFillAttribute* pAttrib = (BitmapFillAttribute*)&Attrib;
02575 
02576     if (GetBitmapRef()->GetBitmap() != pAttrib->GetBitmapRef()->GetBitmap())
02577         return FALSE;
02578 
02579     if (IsPerspective())
02580     { 
02581         if (!pAttrib->IsPerspective())
02582             return FALSE;
02583 
02584         if (*GetEndPoint3() != *pAttrib->GetEndPoint3())
02585             return FALSE;
02586     }
02587 
02588     if (GetStartColour() != NULL)
02589     {
02590         if (pAttrib->GetStartColour() == NULL)
02591             return FALSE;
02592 
02593         if (*GetStartColour() != *pAttrib->GetStartColour())
02594             return FALSE;
02595     }
02596     else if (pAttrib->GetStartColour() != NULL)
02597     {
02598         return FALSE;
02599     }
02600 
02601     if (GetEndColour() != NULL)
02602     {
02603         if (pAttrib->GetEndColour() == NULL)
02604             return FALSE;
02605 
02606         if (*GetEndColour() != *pAttrib->GetEndColour())
02607             return FALSE;
02608     }
02609     else if (pAttrib->GetStartColour() != NULL)
02610     {
02611         return FALSE;
02612     }
02613 
02614     // check the colour ramps match
02615     if (!SameColourRampAs(pAttrib->GetColourRamp()))
02616         return FALSE;
02617 
02618     // Are the Colours and Control points all the same ?
02619     return (
02620     
02621         StartPoint  == pAttrib->StartPoint  &&
02622         EndPoint    == pAttrib->EndPoint    &&
02623         EndPoint2   == pAttrib->EndPoint2
02624 
02625     );
02626 }

void BitmapFillAttribute::RemovePerspective  )  [virtual]
 

Removes perspective from this fill.

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

Reimplemented from FillGeometryAttribute.

Definition at line 2531 of file fillval.cpp.

02532 {
02533     IsPersp = FALSE;
02534 }

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

Reimplemented from ColourFillAttribute.

Definition at line 2388 of file fillval.cpp.

02389 {
02390     pRegion->SetFillGeometry(this, Temp);
02391 }

BOOL BitmapFillAttribute::RenderFill RenderRegion pRegion,
Path pPath
[virtual]
 

Render the fill, if possible - it depends on what kind of render region we have been given.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/8/94
Parameters:
pRegion - the render region of interest [INPUTS] pPath - the path to fill.
Returns:
FALSE => let the Render region fill the path, TRUE = we have done it.

Reimplemented from GradFillAttribute.

Definition at line 2661 of file fillval.cpp.

02662 {
02663     if ( pRegion->IsKindOf(CC_RUNTIME_CLASS(GRenderRegion)) )
02664     {
02665         // Safe to cast now
02666         GRenderRegion *gRnd = (GRenderRegion*)pRegion;
02667 
02668         // Do the rendering
02669         return gRnd->RenderBitmapFill(pPath, this);
02670     }
02671     else if ( pRegion->IsKindOf(CC_RUNTIME_CLASS(OSRenderRegion)) )
02672     {
02673         // Safe to cast now
02674         OSRenderRegion *oRnd = (OSRenderRegion*)pRegion;
02675 
02676         // Do the rendering
02677         return oRnd->RenderBitmapFill(pPath, this);
02678     }
02679 
02680     // Can't render this fill with this render region.
02681     return FALSE;
02682 }

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

Reimplemented from ColourFillAttribute.

Definition at line 2410 of file fillval.cpp.

02411 {
02412     pRegion->RestoreFillGeometry(this, Temp);
02413 }

void BitmapFillAttribute::SetCanBlurRenderBitmap BOOL  b  )  [inline]
 

Definition at line 812 of file fillval.h.

00812 { m_CanBlurRender = b; }

BOOL BitmapFillAttribute::SetDPI UINT32  NewDpi  )  [virtual]
 

Sets the DPI of a bitmap.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/94
Parameters:
NewDpi [INPUTS]
See also:
FractalFillAttribute::SetDPI

Reimplemented from FillGeometryAttribute.

Definition at line 2696 of file fillval.cpp.

02697 {
02698     if (IsPerspective())
02699         return FALSE;
02700 
02701     if (NewDpi == 0)
02702         return FALSE;
02703 
02704     if (GetBitmap() == NULL)
02705         return FALSE;
02706 
02707     OILBitmap *OilBM = GetBitmap()->ActualBitmap;
02708 
02709     if (OilBM == NULL)
02710         return FALSE;
02711 
02712     BitmapInfo Info;
02713     OilBM->GetInfo(&Info);
02714 
02715     INT32 PixWidth  = Info.PixelWidth;
02716     INT32 PixHeight = Info.PixelHeight;
02717 
02718     DocCoord Start = *GetStartPoint();
02719     DocCoord End   = *GetEndPoint();
02720     DocCoord End2  = *GetEndPoint2();
02721 
02722     INT32 Width  = INT32(Start.Distance(End));
02723     INT32 Height = INT32(Start.Distance(End2));
02724 
02725     INT32 HDpi = (Width  == 0) ? 0 : (PixWidth*72000)/Width;
02726     INT32 VDpi = (Height == 0) ? 0 : (PixHeight*72000)/Height;
02727 
02728     INT32 OldDpi = HDpi;
02729     if (VDpi < OldDpi)
02730         OldDpi = VDpi;
02731 
02732     TRACEUSER( "Mike", _T("Bitmap Dpi is currently %d\n"),OldDpi);
02733     TRACEUSER( "Mike", _T("Setting Bitmap Dpi to %d\n"),NewDpi);
02734 
02735     FIXED16 Ratio   = FIXED16(double(OldDpi)/double(NewDpi));
02736     Matrix Scale    = Matrix(Ratio, Ratio);
02737 
02738     GetBitmapVirtualPoints(Start, End, End2,
02739                             &Start, &End, &End2);
02740 
02741     DocCoord Centre = Start;
02742 
02743     Start.translate(-Centre.x, -Centre.y);  
02744     Scale.transform(&Start);
02745     Start.translate(Centre.x, Centre.y);    
02746 
02747     End.translate(-Centre.x, -Centre.y);    
02748     Scale.transform(&End);
02749     End.translate(Centre.x, Centre.y);  
02750 
02751     End2.translate(-Centre.x, -Centre.y);   
02752     Scale.transform(&End2);
02753     End2.translate(Centre.x, Centre.y); 
02754 
02755     GetBitmapRealPoints(Start, End, End2,
02756                         &Start, &End, &End2);
02757 
02758     INT32 NewWidth  = INT32(Start.Distance(End));
02759     INT32 NewHeight = INT32(Start.Distance(End2));
02760 
02761     if (NewWidth == 0 || NewHeight == 0)
02762         return FALSE;
02763 
02764     SetStartPoint(&Start);
02765     SetEndPoint(&End);
02766     SetEndPoint2(&End2);
02767 
02768     SetFractalDPI(GetDPI());
02769 
02770     return TRUE;
02771 }

void BitmapFillAttribute::SetEndColour DocColour NewCol  )  [virtual]
 

Sets the end colour of this fill.

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

Reimplemented from GradFillAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2871 of file fillval.cpp.

02872 {
02873     if (NewCol == NULL)
02874         EndColour = COLOUR_NONE;
02875     else
02876         EndColour = *NewCol;
02877 
02878     if (EndColour == COLOUR_NONE)
02879         Colour = COLOUR_NONE;
02880 
02881     if (EndColour != COLOUR_NONE && GetStartColour() == NULL)
02882     {
02883         AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
02884                                             _R(IDS_BLACKNAME), &Colour);
02885 
02886         if (Colour == EndColour)
02887         {
02888             AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
02889                                                 _R(IDS_WHITENAME), &Colour);
02890         }
02891     }
02892 }

void BitmapFillAttribute::SetEndPoint 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 GradFillAttribute.

Definition at line 2445 of file fillval.cpp.

02446 {
02447     if (Pos == NULL)
02448         EndPoint = DocCoord(0,0);
02449     else
02450         EndPoint = *Pos;
02451 }

void BitmapFillAttribute::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 2464 of file fillval.cpp.

02465 {
02466     if (Pos == NULL)
02467         EndPoint2 = MakeLineAtAngle(*GetStartPoint(), *GetEndPoint(), 90);
02468     else
02469         EndPoint2 = *Pos;
02470 }

void BitmapFillAttribute::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 2483 of file fillval.cpp.

02484 {
02485     if (Pos == NULL)
02486         EndPoint3 = MakeLineAtAngle(*GetEndPoint(), *GetEndPoint2(), 90);
02487     else
02488         EndPoint3 = *Pos;
02489 }

void BitmapFillAttribute::SetStartColour DocColour NewCol  )  [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 ColourFillAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2837 of file fillval.cpp.

02838 {
02839     if (NewCol == NULL)
02840         Colour = COLOUR_NONE;
02841     else
02842         Colour = *NewCol;
02843 
02844     if (Colour == COLOUR_NONE)
02845         EndColour = COLOUR_NONE;
02846 
02847     if (Colour != COLOUR_NONE && GetEndColour() == NULL)
02848     {
02849         AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
02850                                             _R(IDS_WHITENAME), &EndColour);
02851 
02852         if (Colour == EndColour)
02853         {
02854             AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
02855                                                 _R(IDS_BLACKNAME), &EndColour);
02856         }
02857     }
02858 }

void BitmapFillAttribute::SetStartPoint DocCoord Pos  )  [virtual]
 

Sets the Start Point of this fill.

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

Reimplemented from GradFillAttribute.

Definition at line 2426 of file fillval.cpp.

02427 {
02428     if (Pos == NULL)
02429         StartPoint = DocCoord(0,0);
02430     else
02431         StartPoint = *Pos;
02432 }

void BitmapFillAttribute::SetTesselation INT32  NewTess  )  [virtual]
 

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2932 of file fillval.cpp.

02933 {
02934     if (NewTess == RT_NoRepeatType)
02935         NewTess = RT_Repeating;
02936 
02937     Tesselation = NewTess;
02938 }

void BitmapFillAttribute::SimpleCopy AttributeValue pValue  )  [virtual]
 

See AttributeValue::SimpleCopy.

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

Reimplemented from GradFillAttribute.

Reimplemented in NoiseFillAttribute, and FractalFillAttribute.

Definition at line 2641 of file fillval.cpp.

02642 {
02643     // Just use the assignment operator
02644     *this = *(FillGeometryAttribute*)pValue;
02645 }


Member Data Documentation

KernelBitmapRef BitmapFillAttribute::BitmapRef
 

Definition at line 772 of file fillval.h.

DocCoord BitmapFillAttribute::EndPoint2
 

Definition at line 817 of file fillval.h.

DocCoord BitmapFillAttribute::EndPoint3
 

Definition at line 818 of file fillval.h.

BOOL BitmapFillAttribute::IsPersp
 

Definition at line 822 of file fillval.h.

BOOL BitmapFillAttribute::m_CanBlurRender
 

Definition at line 824 of file fillval.h.

BOOL BitmapFillAttribute::m_doBitmapSmoothing = TRUE [static]
 

Definition at line 826 of file fillval.h.

INT32 BitmapFillAttribute::Tesselation
 

Definition at line 820 of file fillval.h.


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