#include <fillval.h>
Inheritance diagram for GradFillAttribute:
Public Member Functions | |
GradFillAttribute () | |
Default Constuctor for fill attribute values. | |
~GradFillAttribute () | |
All new destructor used to delete a colour ramp. | |
virtual FillGeometryAttribute & | operator= (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 void | SimpleCopy (AttributeValue *) |
See AttributeValue::SimpleCopy. | |
virtual BOOL | RenderFill (RenderRegion *, Path *) |
Render the fill, if poss. (override to do something different). | |
virtual DocCoord * | GetStartPoint () |
virtual DocCoord * | GetEndPoint () |
virtual DocColour * | GetEndColour () |
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 | SetEndColour (DocColour *NewCol) |
Sets the End Colour of this fill. | |
virtual BOOL | Blend (BlendAttrParam *pBlendParam) |
Blends between two graduated fill attributes. This current calls the general fill blend function. (See FillGeometryAttribute::Blend). | |
virtual BOOL | IsAGradFill () |
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. | |
ColourRamp * | GetColourRamp () |
virtual BOOL | SupportsFillRamps () |
virtual BOOL | SetColourRamp (ColourRamp *pRamp) |
Set this colour ramp to the version passed in. If pRamp is NULL, the colour ramp in this object will be emptied. | |
ColourRamp * | MakeNewColourRamp () |
Set this colour ramp to the version passed in. If pRamp is NULL, the colour ramp in this object will be emptied. | |
BOOL | SameColourRampAs (ColourRamp *pOtherRamp) |
Check whether this colour ramp matches that pointed to by pOtherRamp. | |
void | DeleteColourRamp () |
Function to remove the colour ramp from this grad fill. | |
Public Attributes | |
DocColour | EndColour |
DocCoord | StartPoint |
DocCoord | EndPoint |
Protected Attributes | |
ColourRamp * | m_pColourRamp |
Definition at line 442 of file fillval.h.
|
Default Constuctor for fill attribute values.
Definition at line 1066 of file fillval.cpp. 01067 { 01068 // AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 01069 // _R(IDS_WHITENAME), &EndColour); 01070 AttributeManager::FindDefaultColour(NULL, 01071 _R(IDS_WHITENAME), &EndColour); 01072 01073 StartPoint = DocCoord(0,0); 01074 EndPoint = DocCoord(0,0); 01075 01076 m_pColourRamp = NULL; 01077 }
|
|
All new destructor used to delete a colour ramp.
Definition at line 1089 of file fillval.cpp. 01090 { 01091 DeleteColourRamp(); 01092 }
|
|
Blends between two graduated fill attributes. This current calls the general fill blend function. (See FillGeometryAttribute::Blend).
Reimplemented from FillGeometryAttribute. Definition at line 9789 of file fillval.cpp. 09790 { 09791 return FillGeometryAttribute::Blend(pBlendParam); 09792 }
|
|
Function to remove the colour ramp from this grad fill.
Definition at line 1105 of file fillval.cpp. 01106 { 01107 if (m_pColourRamp!=NULL) 01108 { 01109 delete m_pColourRamp; 01110 m_pColourRamp=NULL; 01111 } 01112 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 470 of file fillval.h. 00470 { return m_pColourRamp; }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapFillAttribute, NoiseFillAttribute, and FractalFillAttribute. Definition at line 458 of file fillval.h. 00458 { return &EndColour; }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapFillAttribute. Definition at line 457 of file fillval.h. 00457 { return &EndPoint; }
|
|
Find the absolute position in geometry coordinate space for the given parameter.
Reimplemented from FillGeometryAttribute. Reimplemented in ConicalFillAttribute. Definition at line 1203 of file fillval.cpp. 01204 { 01205 // This and all derived classes will inherit a linear coordinate space 01206 return DocCoord::PositionPointFromRatio(StartPoint,EndPoint,(double)pos); 01207 }
|
|
Find the parameter for the closest point to c on this geometry.
Reimplemented from FillGeometryAttribute. Reimplemented in ConicalFillAttribute. Definition at line 1223 of file fillval.cpp. 01224 { 01225 // ok we're a linear geometry so find the closest point to a line type of thing. 01226 // use a handy util written by that other fab bloke called Mike. 01227 DocCoord Coords[2]; 01228 Coords[0] = StartPoint; 01229 Coords[1] = EndPoint; 01230 double p; 01231 PathUtil::SqrDistanceToLine(Coords, c, &p); 01232 return (float)p; 01233 }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapFillAttribute. Definition at line 456 of file fillval.h. 00456 { return &StartPoint; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 466 of file fillval.h. 00466 { return TRUE; }
|
|
Set this colour ramp to the version passed in. If pRamp is NULL, the colour ramp in this object will be emptied.
Definition at line 1180 of file fillval.cpp. 01181 { 01182 DeleteColourRamp(); 01183 m_pColourRamp = new ColourRamp(); 01184 return m_pColourRamp; 01185 }
|
|
Make the Attribute the same as the other.
Reimplemented from ColourFillAttribute. Reimplemented in RadialFillAttribute, BitmapFillAttribute, NoiseFillAttribute, and FractalFillAttribute. Definition at line 1251 of file fillval.cpp. 01252 { 01253 return ColourFillAttribute::operator=(FillAttrib); 01254 }
|
|
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
Reimplemented from ColourFillAttribute. Reimplemented in RadialFillAttribute, ThreeColFillAttribute, FourColFillAttribute, BitmapFillAttribute, NoiseFillAttribute, and FractalFillAttribute. Definition at line 1272 of file fillval.cpp. 01273 { 01274 if (GetRuntimeClass() != Attrib.GetRuntimeClass()) 01275 return FALSE; 01276 01277 GradFillAttribute* pAttrib = (GradFillAttribute*)&Attrib; 01278 01279 if (IsPerspective()) 01280 { 01281 if (!pAttrib->IsPerspective()) 01282 return FALSE; 01283 01284 if (*GetEndPoint2() != *pAttrib->GetEndPoint2()) 01285 return FALSE; 01286 01287 if (*GetEndPoint3() != *pAttrib->GetEndPoint3()) 01288 return FALSE; 01289 } 01290 01291 // check the colour ramps match 01292 if (!SameColourRampAs(pAttrib->GetColourRamp())) 01293 return FALSE; 01294 01295 // Are the Colours and Control points all the same ? 01296 return ( 01297 01298 Colour == pAttrib->Colour && 01299 EndColour == pAttrib->EndColour && 01300 01301 StartPoint == pAttrib->StartPoint && 01302 EndPoint == pAttrib->EndPoint 01303 ); 01304 }
|
|
Render the fill, if poss. (override to do something different).
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapFillAttribute. Definition at line 1322 of file fillval.cpp. 01323 { 01324 if ( pRegion->IsKindOf(CC_RUNTIME_CLASS(GRenderRegion)) ) 01325 { 01326 // Safe to cast now 01327 GRenderRegion *gRnd = (GRenderRegion*)pRegion; 01328 01329 // Do the rendering 01330 return gRnd->RenderGradFillPath(pPath, this); 01331 } 01332 else if ( pRegion->IsKindOf(CC_RUNTIME_CLASS(OSRenderRegion)) ) 01333 { 01334 // Safe to cast now 01335 OSRenderRegion *oRnd = (OSRenderRegion*)pRegion; 01336 01337 // Do the rendering 01338 return oRnd->RenderGradFillPath(pPath, this); 01339 } 01340 return FALSE; 01341 }
|
|
Check whether this colour ramp matches that pointed to by pOtherRamp.
Definition at line 1127 of file fillval.cpp. 01128 { 01129 // Have we got a transparency ramp at the moment? 01130 if (m_pColourRamp==NULL) 01131 return (pOtherRamp==NULL); 01132 01133 if (pOtherRamp==NULL) 01134 return FALSE; 01135 01136 return (!(m_pColourRamp->IsDifferentTo(pOtherRamp))); 01137 }
|
|
Set this colour ramp to the version passed in. If pRamp is NULL, the colour ramp in this object will be emptied.
Reimplemented from FillGeometryAttribute. Definition at line 1152 of file fillval.cpp. 01153 { 01154 DeleteColourRamp(); 01155 if (pRamp==NULL) 01156 return TRUE; 01157 01158 m_pColourRamp = new ColourRamp(); 01159 if (m_pColourRamp==NULL) 01160 return FALSE; 01161 01162 *m_pColourRamp = *pRamp; 01163 return TRUE; 01164 }
|
|
Sets the End Colour of this fill.
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapFillAttribute, NoiseFillAttribute, and FractalFillAttribute. Definition at line 1393 of file fillval.cpp. 01394 { 01395 if (NewCol == NULL) 01396 { 01397 AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 01398 _R(IDS_BLACKNAME), &EndColour); 01399 } 01400 else 01401 EndColour = *NewCol; 01402 }
|
|
Sets the End Point of this fill.
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapFillAttribute. Definition at line 1374 of file fillval.cpp. 01375 { 01376 if (Pos == NULL) 01377 EndPoint = DocCoord(0,0); 01378 else 01379 EndPoint = *Pos; 01380 }
|
|
Sets the Start Point of this fill.
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapFillAttribute. Definition at line 1355 of file fillval.cpp. 01356 { 01357 if (Pos == NULL) 01358 StartPoint = DocCoord(0,0); 01359 else 01360 StartPoint = *Pos; 01361 }
|
|
See AttributeValue::SimpleCopy.
Reimplemented from FillGeometryAttribute. Reimplemented in RadialFillAttribute, BitmapFillAttribute, NoiseFillAttribute, and FractalFillAttribute. Definition at line 1417 of file fillval.cpp. 01418 { 01419 *(this) = *((FillGeometryAttribute*)pValue); 01420 }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in ThreeColFillAttribute. Definition at line 480 of file fillval.h. 00480 { return TRUE; }
|
|
|
|
|
|
|
|
|