#include <fillattr2.h>
Inheritance diagram for AttrLinearColourFill:
Public Member Functions | |
AttrLinearColourFill () | |
AttrLinearColourFill (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
void | Render (RenderRegion *pRender) |
'Renders' a Linear Fill Colour attribute. | |
Node * | SimpleCopy () |
This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes. | |
virtual UINT32 | GetAttrNameID (void) |
Returns a string resource ID describing the attribute. | |
void | GetDebugDetails (StringBase *Str) |
Output details of this attribute to the Camelot debug tree dialog. | |
virtual UINT32 | GetNodeSize () const |
For finding the size of the node. | |
virtual void | RenderFillBlobs (RenderRegion *pRender) |
Renders the grad fills arrow blob when requested to by its selected parent. | |
virtual CCRuntimeClass * | GetAttributeType () |
virtual AttributeValue * | GetAttributeValue () |
AttrFillGeometry * | ChangeAttrValue (AttrValueChange *pValue) |
virtual BOOL | IsAColourFill () const |
Virtual function for determining if the node is a Colour Fill attribute. | |
virtual BOOL | WritePreChildrenWeb (BaseCamelotFilter *pFilter) |
Writes the linear fill record to the filter. | |
virtual BOOL | WritePreChildrenNative (BaseCamelotFilter *pFilter) |
virtual BOOL | WriteColourDefinitions (BaseCamelotFilter *pFilter) |
Writes out colour definitions for this fill. | |
virtual BOOL | IsSeeThrough (BOOL CheckIndirectAttrs) |
Protected Attributes | |
LinearFillAttribute | Value |
Definition at line 749 of file fillattr2.h.
|
Definition at line 754 of file fillattr2.h. 00754 : AttrLinearFill() {}
|
|
Definition at line 755 of file fillattr2.h. 00760 : 00761 AttrLinearFill(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}
|
|
Reimplemented from AttrFillGeometry. Definition at line 774 of file fillattr2.h. 00774 { return ChangeColour(pValue); }
|
|
Reimplemented from NodeAttribute. Definition at line 771 of file fillattr2.h. 00771 { return CC_RUNTIME_CLASS(AttrFillGeometry); }
|
|
Implements AttrLinearFill. Definition at line 772 of file fillattr2.h. 00772 { return &Value; }
|
|
Returns a string resource ID describing the attribute.
Reimplemented from NodeAttribute. Definition at line 6657 of file fillattr.cpp. 06658 { 06659 return (_R(IDS_LINEARGRADFILL)); 06660 }
|
|
Output details of this attribute to the Camelot debug tree dialog.
Reimplemented from NodeRenderable. Definition at line 6673 of file fillattr.cpp. 06674 { 06675 #ifdef _DEBUG 06676 NodeAttribute::GetDebugDetails( Str ); 06677 06678 String_256 TempStr; 06679 06680 TempStr._MakeMsg( TEXT("\r\nLinear Graduated Fill:\r\n")); 06681 (*Str) += TempStr; 06682 06683 // TempStr._MakeMsg(TEXT("\r\nStart")); 06684 // (*GetStartColour()).GetDebugDetails(&TempStr); 06685 // (*Str) += TempStr; 06686 06687 // TempStr._MakeMsg(TEXT("\r\nEnd")); 06688 // (*GetEndColour()).GetDebugDetails(&TempStr); 06689 // (*Str) += TempStr; 06690 06691 TempStr._MakeMsg(TEXT("\r\nStart point =(#1%ld, #2%ld)"), 06692 (*GetStartPoint()).x, (*GetStartPoint()).y); 06693 (*Str) += TempStr; 06694 06695 TempStr._MakeMsg(TEXT("\r\nEnd point =(#1%ld, #2%ld), "), 06696 (*GetEndPoint()).x, (*GetEndPoint()).y); 06697 (*Str) += TempStr; 06698 06699 for (INT32 i=0; i<5; i++) 06700 { 06701 TempStr._MakeMsg(TEXT("\r\nControl #1%ld = #2%ld"), 06702 i, SelectionState[i]); 06703 (*Str) += TempStr; 06704 } 06705 #endif 06706 }
|
|
For finding the size of the node.
Reimplemented from Node. Definition at line 6721 of file fillattr.cpp. 06722 { 06723 return sizeof(AttrLinearColourFill); 06724 }
|
|
Virtual function for determining if the node is a Colour Fill attribute.
Reimplemented from NodeAttribute. Definition at line 776 of file fillattr2.h. 00776 { return TRUE; }
|
|
Reimplemented from NodeAttribute. Definition at line 786 of file fillattr2.h. 00787 { 00788 return (GetStartColour() != NULL && GetStartColour()->IsTransparent() && 00789 GetEndColour() != NULL && GetEndColour()->IsTransparent()); 00790 }
|
|
'Renders' a Linear Fill Colour attribute. void AttrLinearColourFill::Render( RenderRegion* pRender)
Reimplemented from NodeAttribute. Definition at line 6615 of file fillattr.cpp. 06616 { 06617 pRender->SetFillGeometry(&Value, FALSE); 06618 }
|
|
Renders the grad fills arrow blob when requested to by its selected parent.
Reimplemented from AttrLinearFill. Definition at line 6466 of file fillattr.cpp. 06467 { 06468 #if !defined(EXCLUDE_FROM_RALPH) 06469 if (!IsVisible()) 06470 return; // We're in Fill Transparency Mode 06471 06472 // Don't bother if this fill is being edited as a copy of it 06473 // we be rendered thoughout the drag op 06474 if (IsFillBeingEdited()) 06475 return; 06476 06477 // Ignore this if the mesh is the same as the last one rendered. 06478 if (CheckPreviousFillMesh()) 06479 return; 06480 06481 DocCoord ControlPoints[2]; 06482 ControlPoints[0] = (*GetStartPoint()); 06483 ControlPoints[1] = (*GetEndPoint()); 06484 06485 // Render a nice pretty Fill Mesh thingy 06486 RenderFillMesh(pRender, ControlPoints, SelectionState, 2); 06487 06488 // This call was removed by Gerry (2/9/96) as it causes blob problems 06489 // If we are removing blobs then force all blobs to be deselected 06490 // if ((Camelot.GetBlobManager())->IsRemovingBlobs()) 06491 // DeselectAllNoRedraw(); 06492 #endif 06493 }
|
|
This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.
Reimplemented from NodeAttribute. Definition at line 6635 of file fillattr.cpp. 06636 { 06637 AttrLinearColourFill* NodeCopy = new AttrLinearColourFill(); 06638 if (NodeCopy == NULL) 06639 return NULL; 06640 06641 CopyNodeContents(NodeCopy); 06642 06643 return NodeCopy; 06644 }
|
|
Writes out colour definitions for this fill. > virtual BOOL AttrLinearColourFill::WriteColourDefinitions (BaseCamelotFilter* pFilter)
Reimplemented from AttrFillGeometry. Definition at line 6891 of file fillattr.cpp. 06892 { 06893 // Must write out the colours first 06894 INT32 StartColRef = pFilter->WriteRecord(&Value.Colour); 06895 INT32 EndColRef = pFilter->WriteRecord(&Value.EndColour); 06896 06897 BOOL ok = ((StartColRef != 0) && (EndColRef != 0)); 06898 06899 if (ok) 06900 { 06901 ColourRamp * pRamp = GetColourRamp(); 06902 if (pRamp) 06903 if (pRamp->GetCount() > 0) 06904 { 06905 ok = pRamp->WriteColourDefinitions (pFilter); 06906 } 06907 } 06908 06909 return (ok); 06910 }
|
|
Reimplemented from Node. Definition at line 6867 of file fillattr.cpp. 06868 { 06869 #ifdef DO_EXPORT 06870 return WritePreChildrenWeb(pFilter); 06871 #else 06872 return FALSE; 06873 #endif 06874 }
|
|
Writes the linear fill record to the filter. > virtual BOOL AttrLinearColourFill::WritePreChildrenWeb(BaseCamelotFilter* pFilter)
Reimplemented from Node. Definition at line 6741 of file fillattr.cpp. 06742 { 06743 #ifdef DO_EXPORT 06744 ERROR2IF(pFilter == NULL,FALSE,"NULL filter param"); 06745 06746 // Must write out the colours first 06747 INT32 StartColRef = pFilter->WriteRecord(&Value.Colour); 06748 INT32 EndColRef = pFilter->WriteRecord(&Value.EndColour); 06749 06750 // am I a multistage fill ?? 06751 BOOL bMultistage = FALSE; 06752 06753 ColourRamp * pRamp = GetColourRamp(); 06754 INT32 * pRampColRefs = NULL; 06755 double * pPositions = NULL; 06756 ColRampItem * pItem = NULL; 06757 UINT32 NumRampItems = 0; 06758 06759 if (pRamp) 06760 { 06761 // write out all the colour references 06762 if (pRamp->GetCount() > 0) 06763 { 06764 bMultistage = TRUE; 06765 NumRampItems = pRamp->GetCount(); 06766 06767 pRampColRefs = new INT32[NumRampItems]; 06768 pPositions = new double[NumRampItems]; 06769 06770 pItem = (ColRampItem *)pRamp->GetHead(); 06771 06772 for (UINT32 i = 0 ; i < NumRampItems; i++) 06773 { 06774 if (pItem) 06775 { 06776 pPositions[i] = pItem->GetPosition(); 06777 DocColour tempcolour = pItem->GetColour(); 06778 pRampColRefs[i] = pFilter->WriteRecord(&tempcolour); 06779 } 06780 06781 pItem = (ColRampItem *)pRamp->GetNext(pItem); 06782 } 06783 } 06784 } 06785 06786 // Are the colour references ok? 06787 BOOL ok = ((StartColRef != 0) && (EndColRef != 0)); 06788 06789 // If the linear fill points are not perpendicular then we must write 06790 // a new 3-point linear fill record... 06791 BOOL b3PointLinear = (!AreLinesPerpendicular(GetStartPoint(), GetEndPoint(), GetEndPoint2())); 06792 06793 if (ok) 06794 { 06795 if (!bMultistage) 06796 { 06797 INT32 tag = TAG_LINEARFILL; 06798 UINT32 size = TAG_LINEARFILL_SIZE; 06799 if (b3PointLinear) 06800 { 06801 tag = TAG_LINEARFILL3POINT; 06802 size = TAG_LINEARFILL3POINT_SIZE; 06803 } 06804 06805 CamelotFileRecord Rec(pFilter, tag, size); 06806 06807 if (ok) ok = Rec.Init(); 06808 if (ok) ok = Rec.WriteCoord(Value.StartPoint); 06809 if (ok) ok = Rec.WriteCoord(Value.EndPoint); 06810 if (ok && b3PointLinear) ok = Rec.WriteCoord(Value.EndPoint2); 06811 if (ok) ok = Rec.WriteReference(StartColRef); 06812 if (ok) ok = Rec.WriteReference(EndColRef); 06813 if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetBias ()); 06814 if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetGain ()); 06815 if (ok) ok = pFilter->Write(&Rec); 06816 } 06817 else 06818 { 06819 INT32 tag = TAG_LINEARFILLMULTISTAGE; 06820 INT32 size = TAG_LINEARFILLMULTISTAGE_SIZE; 06821 if (b3PointLinear) 06822 { 06823 tag = TAG_LINEARFILLMULTISTAGE3POINT; 06824 size = TAG_LINEARFILLMULTISTAGE3POINT_SIZE; 06825 } 06826 06827 CamelotFileRecord Rec(pFilter, tag, size); 06828 06829 if (ok) ok = Rec.Init(); 06830 if (ok) ok = Rec.WriteCoord(Value.StartPoint); 06831 if (ok) ok = Rec.WriteCoord(Value.EndPoint); 06832 if (ok && b3PointLinear) ok = Rec.WriteCoord(Value.EndPoint2); 06833 if (ok) ok = Rec.WriteReference(StartColRef); 06834 if (ok) ok = Rec.WriteReference(EndColRef); 06835 06836 // now, write out all the colour ramp items 06837 if (ok) ok = Rec.WriteUINT32(NumRampItems); 06838 06839 for (UINT32 i = 0 ; i < NumRampItems; i++) 06840 { 06841 if (ok) ok = Rec.WriteDOUBLE(pPositions[i]); 06842 if (ok) ok = Rec.WriteReference(pRampColRefs[i]); 06843 } 06844 06845 if (ok) ok = pFilter->Write(&Rec); 06846 } 06847 } 06848 06849 if (pRampColRefs) 06850 delete [] pRampColRefs; 06851 06852 if (pPositions) 06853 delete [] pPositions; 06854 06855 if (!ok) 06856 pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 06857 06858 return ok; 06859 #else 06860 return FALSE; 06861 #endif 06862 }
|
|
Definition at line 793 of file fillattr2.h. |