#include <fillval.h>
Inheritance diagram for GradTranspFillAttribute:
Public Member Functions | |
GradTranspFillAttribute () | |
Default Constuctor for fill attribute values. | |
~GradTranspFillAttribute () | |
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 DocCoord * | GetStartPoint () |
virtual DocCoord * | GetEndPoint () |
virtual UINT32 * | GetEndTransp () |
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 | SetEndTransp (UINT32 *NewTransp) |
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. | |
virtual ColourFillAttribute * | MakeSimilarNonTranspFillGeometry (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 BOOL | SupportsFillRamps () |
virtual BOOL | SetTranspRamp (TransparencyRamp *pRamp) |
Sets this transparency ramp from pRamp passed in. If pRamp is NULL on entry this objects ramp will be emptied. | |
virtual TransparencyRamp * | GetTranspRamp () |
TransparencyRamp * | MakeNewTranspRamp () |
Create a blank transparency ramp. | |
BOOL | SameTransparencyRampAs (TransparencyRamp *pOtherRamp) |
Check whether this transparency ramp matches that of the attribute. | |
void | DeleteTranspRamp () |
Public Attributes | |
DocCoord | StartPoint |
DocCoord | EndPoint |
UINT32 | EndTransp |
Protected Attributes | |
TransparencyRamp * | m_pTranspRamp |
Definition at line 1071 of file fillval.h.
|
Default Constuctor for fill attribute values.
Definition at line 4449 of file fillval.cpp. 04450 { 04451 EndTransp = 255; 04452 04453 StartPoint = DocCoord(0,0); 04454 EndPoint = DocCoord(0,0); 04455 04456 m_pTranspRamp = NULL; 04457 }
|
|
Definition at line 4459 of file fillval.cpp. 04460 { 04461 DeleteTranspRamp(); 04462 }
|
|
Blends between two graduated fill attributes. This current calls the general fill blend function. (See FillGeometryAttribute::Blend).
Reimplemented from FillGeometryAttribute. Definition at line 9814 of file fillval.cpp. 09815 { 09816 return FillGeometryAttribute::Blend(pBlendParam); 09817 }
|
|
Definition at line 4464 of file fillval.cpp. 04465 { 04466 if (m_pTranspRamp!=NULL) 04467 { 04468 delete m_pTranspRamp; 04469 m_pTranspRamp=NULL; 04470 } 04471 }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapTranspFillAttribute. Definition at line 1084 of file fillval.h. 01084 { return &EndPoint; }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapTranspFillAttribute. Definition at line 1085 of file fillval.h. 01085 { return &EndTransp; }
|
|
Find the absolute position in geometry coordinate space for the given parameter.
Reimplemented from FillGeometryAttribute. Reimplemented in ConicalTranspFillAttribute. Definition at line 4611 of file fillval.cpp. 04612 { 04613 // This and all derived classes will inherit a linear coordinate space 04614 return DocCoord::PositionPointFromRatio(StartPoint,EndPoint,(double)pos); 04615 }
|
|
Find the parameter for the closest point to c on this geometry.
Reimplemented from FillGeometryAttribute. Reimplemented in ConicalTranspFillAttribute. Definition at line 4631 of file fillval.cpp. 04632 { 04633 // ok we're a linear geometry so find the closest point to a line type of thing. 04634 // use a handy util written by that other fab bloke called Mike. 04635 DocCoord Coords[2]; 04636 Coords[0] = StartPoint; 04637 Coords[1] = EndPoint; 04638 double p; 04639 PathUtil::SqrDistanceToLine(Coords, c, &p); 04640 return (float)p; 04641 }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapTranspFillAttribute. Definition at line 1083 of file fillval.h. 01083 { return &StartPoint; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1107 of file fillval.h. 01107 { return m_pTranspRamp; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1092 of file fillval.h. 01092 { return TRUE; }
|
|
Create a blank transparency ramp.
Definition at line 4655 of file fillval.cpp. 04656 { 04657 DeleteTranspRamp(); 04658 m_pTranspRamp=new TransparencyRamp(); 04659 return m_pTranspRamp; 04660 }
|
|
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).
Reimplemented from TranspFillAttribute. Reimplemented in LinearTranspFillAttribute, RadialTranspFillAttribute, ConicalTranspFillAttribute, SquareTranspFillAttribute, BitmapTranspFillAttribute, NoiseTranspFillAttribute, FractalTranspFillAttribute, ThreeColTranspFillAttribute, and FourColTranspFillAttribute. Definition at line 4760 of file fillval.cpp. 04761 { 04762 UINT32 *pStartTransp = GetStartTransp(); 04763 UINT32 *pEndTransp = GetEndTransp(); 04764 04765 if(pStartTransp == NULL || pEndTransp == NULL) 04766 return NULL; 04767 04768 // This one's a bit dodgy I think 04769 GradFillAttribute *pNewAttr = new GradFillAttribute; 04770 if (pNewAttr != NULL) 04771 { 04772 pNewAttr->SetStartPoint(GetStartPoint()); 04773 pNewAttr->SetEndPoint(GetEndPoint()); 04774 04775 INT32 StartTransparency = 255 - (INT32)(((double)(255 - *pStartTransp)) * TransparencyScale); 04776 INT32 EndTransparency = 255 - (INT32)(((double)(255 - *pEndTransp)) * TransparencyScale); 04777 04778 DocColour colorStart(StartTransparency, StartTransparency, StartTransparency); 04779 DocColour colorEnd(EndTransparency, EndTransparency, EndTransparency); 04780 pNewAttr->SetStartColour(&colorStart); 04781 pNewAttr->SetEndColour(&colorEnd); 04782 04783 // if this transparency has a transparency ramp then make 04784 // a colour ramp version in pNewAttr 04785 if (m_pTranspRamp) 04786 { 04787 ColourRamp* pColRamp = pNewAttr->MakeNewColourRamp(); 04788 if (pColRamp) 04789 { 04790 INT32 Col; 04791 TranspRampItem *pItem = m_pTranspRamp->GetFirstTransp(); 04792 while (pItem!=NULL) 04793 { 04794 Col = 255 - (INT32)(((double)(255 - pItem->GetTransparency())) * TransparencyScale); 04795 DocColour colorEntry(Col,Col,Col); 04796 pColRamp->AddEntry(pItem->GetPosition(), &colorEntry ); 04797 pItem=m_pTranspRamp->GetNextTransp(pItem); 04798 } 04799 } 04800 } 04801 } 04802 04803 return(pNewAttr); 04804 }
|
|
Make the Attribute the same as the other.
Reimplemented from TranspFillAttribute. Reimplemented in RadialTranspFillAttribute, BitmapTranspFillAttribute, NoiseTranspFillAttribute, and FractalTranspFillAttribute. Definition at line 4512 of file fillval.cpp. 04513 { 04514 return TranspFillAttribute::operator=(FillAttrib); 04515 }
|
|
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
Reimplemented from TranspFillAttribute. Reimplemented in RadialTranspFillAttribute, BitmapTranspFillAttribute, NoiseTranspFillAttribute, FractalTranspFillAttribute, ThreeColTranspFillAttribute, and FourColTranspFillAttribute. Definition at line 4533 of file fillval.cpp. 04534 { 04535 if (GetRuntimeClass() != Attrib.GetRuntimeClass()) 04536 return FALSE; 04537 04538 GradTranspFillAttribute* pAttrib = (GradTranspFillAttribute*)&Attrib; 04539 04540 if (IsPerspective()) 04541 { 04542 if (!pAttrib->IsPerspective()) 04543 return FALSE; 04544 04545 if (*GetEndPoint2() != *pAttrib->GetEndPoint2()) 04546 return FALSE; 04547 04548 if (*GetEndPoint3() != *pAttrib->GetEndPoint3()) 04549 return FALSE; 04550 } 04551 04552 // check the transparency ramp matches 04553 if (!SameTransparencyRampAs(pAttrib->GetTranspRamp())) 04554 return FALSE; 04555 04556 // Are the Colours and Control points all the same ? 04557 return ( 04558 04559 Transp == pAttrib->Transp && 04560 EndTransp == pAttrib->EndTransp && 04561 04562 TranspType == pAttrib->TranspType && 04563 04564 StartPoint == pAttrib->StartPoint && 04565 EndPoint == pAttrib->EndPoint 04566 ); 04567 }
|
|
Check whether this transparency ramp matches that of the attribute. BOOL GradTranspFillAttribute::SameTransparencyRampAs(TransparencyRamp *pOtherRamp)
Definition at line 4484 of file fillval.cpp. 04485 { 04486 // Have we got a transparency ramp at the moment? 04487 if (m_pTranspRamp==NULL) 04488 return (pOtherRamp==NULL); 04489 04490 if (pOtherRamp==NULL) 04491 return FALSE; 04492 04493 return (!( m_pTranspRamp->IsDifferentTo(pOtherRamp))); 04494 }
|
|
Sets the End Point of this fill.
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapTranspFillAttribute. Definition at line 4693 of file fillval.cpp. 04694 { 04695 if (Pos == NULL) 04696 EndPoint = DocCoord(0,0); 04697 else 04698 EndPoint = *Pos; 04699 }
|
|
Sets the End Colour of this fill.
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapTranspFillAttribute. Definition at line 4712 of file fillval.cpp. 04713 { 04714 if (NewTransp == NULL) 04715 EndTransp = 255; 04716 else 04717 EndTransp = *NewTransp; 04718 }
|
|
Sets the Start Point of this fill.
Reimplemented from FillGeometryAttribute. Reimplemented in BitmapTranspFillAttribute. Definition at line 4674 of file fillval.cpp. 04675 { 04676 if (Pos == NULL) 04677 StartPoint = DocCoord(0,0); 04678 else 04679 StartPoint = *Pos; 04680 }
|
|
Sets this transparency ramp from pRamp passed in. If pRamp is NULL on entry this objects ramp will be emptied.
Reimplemented from FillGeometryAttribute. Definition at line 4582 of file fillval.cpp. 04583 { 04584 DeleteTranspRamp(); 04585 if (pRamp==NULL) 04586 return TRUE; 04587 04588 m_pTranspRamp = new TransparencyRamp(); 04589 if (m_pTranspRamp==NULL) 04590 return FALSE; 04591 04592 *m_pTranspRamp = *pRamp; 04593 return TRUE; 04594 }
|
|
See AttributeValue::SimpleCopy.
Reimplemented from FillGeometryAttribute. Reimplemented in RadialTranspFillAttribute, BitmapTranspFillAttribute, NoiseTranspFillAttribute, and FractalTranspFillAttribute. Definition at line 4733 of file fillval.cpp. 04734 { 04735 *(this) = *((FillGeometryAttribute*)pValue); 04736 }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in ThreeColTranspFillAttribute. Definition at line 1105 of file fillval.h. 01105 { return TRUE; }
|
|
|
|
|
|
|
|
|