#include <fillattr2.h>
Inheritance diagram for AttrRadialColourFill:
Public Member Functions | |
AttrRadialColourFill () | |
AttrRadialColourFill (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
void | Render (RenderRegion *pRender) |
'Renders' a Radial Fill Colour attribute. | |
virtual 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 radial fill record to the filter. | |
virtual BOOL | WritePreChildrenNative (BaseCamelotFilter *pFilter) |
virtual BOOL | WriteColourDefinitions (BaseCamelotFilter *pFilter) |
Writes out colour definitions for this fill. | |
virtual BOOL | IsARadialColourFill () const |
virtual BOOL | IsSeeThrough (BOOL CheckIndirectAttrs) |
Protected Attributes | |
RadialFillAttribute | Value |
Definition at line 930 of file fillattr2.h.
|
Definition at line 935 of file fillattr2.h. 00935 : AttrRadialFill() {}
|
|
Definition at line 936 of file fillattr2.h. 00941 : 00942 AttrRadialFill(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}
|
|
Reimplemented from AttrFillGeometry. Definition at line 955 of file fillattr2.h. 00955 { return ChangeColour(pValue); }
|
|
Reimplemented from NodeAttribute. Definition at line 952 of file fillattr2.h. 00952 { return CC_RUNTIME_CLASS(AttrFillGeometry); }
|
|
Implements AttrRadialFill. Definition at line 953 of file fillattr2.h. 00953 { return &Value; }
|
|
Returns a string resource ID describing the attribute.
Reimplemented from NodeAttribute. Definition at line 7915 of file fillattr.cpp. 07916 { 07917 if (IsElliptical ()) 07918 { 07919 return (_R(IDS_ELLIPITICALGRADFILL)); 07920 } 07921 else 07922 { 07923 return (_R(IDS_CIRCULARGRADFILL)); 07924 } 07925 }
|
|
Output details of this attribute to the Camelot debug tree dialog.
Reimplemented from NodeRenderable. Definition at line 7940 of file fillattr.cpp. 07941 { 07942 #ifdef _DEBUG 07943 NodeAttribute::GetDebugDetails( Str ); 07944 07945 String_256 TempStr; 07946 07947 TempStr._MakeMsg( TEXT("\r\nRadial Graduated Fill:\r\n")); 07948 (*Str) += TempStr; 07949 07950 // TempStr._MakeMsg(TEXT("\r\nStart")); 07951 // (*GetStartColour()).GetDebugDetails(&TempStr); 07952 // (*Str) += TempStr; 07953 07954 // TempStr._MakeMsg(TEXT("\r\nEnd")); 07955 // (*GetEndColour()).GetDebugDetails(&TempStr); 07956 // (*Str) += TempStr; 07957 07958 TempStr._MakeMsg(TEXT("\r\nStart point =(#1%ld, #2%ld)"), 07959 (*GetStartPoint()).x, (*GetStartPoint()).y); 07960 (*Str) += TempStr; 07961 07962 TempStr._MakeMsg(TEXT("\r\nEnd point =(#1%ld, #2%ld), "), 07963 (*GetEndPoint()).x, (*GetEndPoint()).y); 07964 (*Str) += TempStr; 07965 07966 TempStr._MakeMsg(TEXT("\r\nEnd point2 = (#1%ld, #2%ld) "), 07967 (*GetEndPoint2()).x, (*GetEndPoint2()).y); 07968 (*Str) += TempStr; 07969 #endif 07970 }
|
|
For finding the size of the node.
Reimplemented from Node. Definition at line 7984 of file fillattr.cpp. 07985 { 07986 return sizeof(AttrRadialColourFill); 07987 }
|
|
Virtual function for determining if the node is a Colour Fill attribute.
Reimplemented from NodeAttribute. Definition at line 957 of file fillattr2.h. 00957 { return TRUE; }
|
|
Reimplemented from AttrFillGeometry. Definition at line 963 of file fillattr2.h. 00963 { return TRUE;}
|
|
Reimplemented from NodeAttribute. Definition at line 968 of file fillattr2.h. 00969 { 00970 return (GetStartColour() != NULL && GetStartColour()->IsTransparent() && 00971 GetEndColour() != NULL && GetEndColour()->IsTransparent()); 00972 }
|
|
'Renders' a Radial Fill Colour attribute.
Reimplemented from NodeAttribute. Definition at line 7873 of file fillattr.cpp. 07874 { 07875 pRender->SetFillGeometry(&Value, FALSE); 07876 }
|
|
Renders the grad fills arrow blob when requested to by its selected parent.
Reimplemented from AttrRadialFill. Definition at line 7750 of file fillattr.cpp. 07751 { 07752 #if !defined(EXCLUDE_FROM_RALPH) 07753 if (!IsVisible()) 07754 return; // We're in Fill Transparency Mode 07755 07756 // Don't bother if this fill is being edited as a copy of it 07757 // we be rendered thoughout the drag op 07758 if (IsFillBeingEdited()) 07759 return; 07760 07761 // Ignore this if the mesh is the same as the last one rendered. 07762 if (CheckPreviousFillMesh()) 07763 return; 07764 07765 DocCoord ControlPoints[5]; 07766 ControlPoints[FILLCONTROL_STARTPOINT] = (*GetStartPoint()); 07767 ControlPoints[FILLCONTROL_ENDPOINT] = (*GetEndPoint()); 07768 ControlPoints[FILLCONTROL_SECONDARYPOINT] = (*GetEndPoint2()); 07769 07770 // Render a nice pretty Fill Mesh thingy 07771 RenderFillMesh(pRender, ControlPoints, SelectionState, 5); 07772 07773 // This call was removed by Gerry (2/9/96) as it causes blob problems 07774 // If we are removing blobs then force all blobs to be deselected 07775 // if ((Camelot.GetBlobManager())->IsRemovingBlobs()) 07776 // DeselectAllNoRedraw(); 07777 #endif 07778 }
|
|
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 7893 of file fillattr.cpp. 07894 { 07895 AttrRadialColourFill* NodeCopy = new AttrRadialColourFill(); 07896 if (NodeCopy == NULL) 07897 return NULL; 07898 07899 CopyNodeContents(NodeCopy); 07900 07901 return NodeCopy; 07902 }
|
|
Writes out colour definitions for this fill. > virtual BOOL AttrRadialColourFill::WriteColourDefinitions (BaseCamelotFilter* pFilter)
Reimplemented from AttrFillGeometry. Definition at line 8167 of file fillattr.cpp. 08168 { 08169 // Must write out the colours first 08170 INT32 StartColRef = pFilter->WriteRecord(&Value.Colour); 08171 INT32 EndColRef = pFilter->WriteRecord(&Value.EndColour); 08172 08173 BOOL ok = ((StartColRef != 0) && (EndColRef != 0)); 08174 08175 if (ok) 08176 { 08177 ColourRamp * pRamp = GetColourRamp(); 08178 if (pRamp) 08179 if (pRamp->GetCount() > 0) 08180 { 08181 ok = pRamp->WriteColourDefinitions (pFilter); 08182 } 08183 } 08184 08185 return (ok); 08186 }
|
|
Reimplemented from Node. Definition at line 8143 of file fillattr.cpp. 08144 { 08145 #ifdef DO_EXPORT 08146 return WritePreChildrenWeb(pFilter); 08147 #else 08148 return FALSE; 08149 #endif 08150 }
|
|
Writes the radial fill record to the filter. > virtual BOOL AttrRadialColourFill::WritePreChildrenWeb(BaseCamelotFilter* pFilter)
Reimplemented from Node. Definition at line 8004 of file fillattr.cpp. 08005 { 08006 #ifdef DO_EXPORT 08007 ERROR2IF(pFilter == NULL,FALSE,"NULL filter param"); 08008 08009 UINT32 Tag = TAG_CIRCULARFILL; 08010 INT32 TagSize = TAG_CIRCULARFILL_SIZE; 08011 08012 if (IsElliptical()) 08013 { 08014 Tag = TAG_ELLIPTICALFILL; 08015 TagSize = TAG_ELLIPTICALFILL_SIZE; 08016 } 08017 08018 // Must write out the colours first 08019 INT32 StartColRef = pFilter->WriteRecord(&Value.Colour); 08020 INT32 EndColRef = pFilter->WriteRecord(&Value.EndColour); 08021 08022 // am I a multistage fill ?? 08023 BOOL bMultistage = FALSE; 08024 08025 // write out the colours for the ramp 08026 ColourRamp * pRamp = GetColourRamp(); 08027 INT32 * pRampColRefs = NULL; 08028 double * pPositions = NULL; 08029 ColRampItem * pItem = NULL; 08030 UINT32 NumRampItems = 0; 08031 08032 if (pRamp) 08033 { 08034 // write out all the colour references 08035 if (pRamp->GetCount() > 0) 08036 { 08037 bMultistage = TRUE; 08038 NumRampItems = pRamp->GetCount(); 08039 08040 pRampColRefs = new INT32[NumRampItems]; 08041 pPositions = new double[NumRampItems]; 08042 08043 pItem = (ColRampItem *)pRamp->GetHead(); 08044 08045 for (UINT32 i = 0 ; i < NumRampItems; i++) 08046 { 08047 if (pItem) 08048 { 08049 pPositions[i] = pItem->GetPosition(); 08050 DocColour tempcolour = pItem->GetColour(); 08051 pRampColRefs[i] = pFilter->WriteRecord(&tempcolour); 08052 } 08053 08054 pItem = (ColRampItem *)pRamp->GetNext(pItem); 08055 } 08056 } 08057 } 08058 08059 // Are the colour references ok? 08060 BOOL ok = ((StartColRef != 0) && (EndColRef != 0)); 08061 08062 if (!bMultistage) 08063 { 08064 if (ok) 08065 { 08066 CamelotFileRecord Rec(pFilter,Tag,TagSize); 08067 08068 if (ok) ok = Rec.Init(); 08069 if (ok) ok = Rec.WriteCoord(Value.StartPoint); 08070 if (ok) ok = Rec.WriteCoord(Value.EndPoint); 08071 08072 if (ok && IsElliptical()) // Write out extra control point in the ellipse case 08073 ok = Rec.WriteCoord(Value.EndPoint2); 08074 08075 if (ok) ok = Rec.WriteReference(StartColRef); 08076 if (ok) ok = Rec.WriteReference(EndColRef); 08077 08078 if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetBias ()); 08079 if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetGain ()); 08080 08081 if (ok) ok = pFilter->Write(&Rec); 08082 } 08083 } 08084 else 08085 { 08086 if (IsElliptical()) 08087 { 08088 Tag = TAG_ELLIPTICALFILLMULTISTAGE; 08089 TagSize = TAG_ELLIPTICALFILLMULTISTAGE_SIZE; 08090 } 08091 else 08092 { 08093 Tag = TAG_CIRCULARFILLMULTISTAGE; 08094 TagSize = TAG_CIRCULARFILLMULTISTAGE_SIZE; 08095 } 08096 08097 if (ok) 08098 { 08099 CamelotFileRecord Rec(pFilter,Tag,TagSize); 08100 08101 if (ok) ok = Rec.Init(); 08102 if (ok) ok = Rec.WriteCoord(Value.StartPoint); 08103 if (ok) ok = Rec.WriteCoord(Value.EndPoint); 08104 08105 if (ok && IsElliptical()) // Write out extra control point in the ellipse case 08106 ok = Rec.WriteCoord(Value.EndPoint2); 08107 08108 if (ok) ok = Rec.WriteReference(StartColRef); 08109 if (ok) ok = Rec.WriteReference(EndColRef); 08110 08111 // now, write out all the colour ramp items 08112 if (ok) ok = Rec.WriteUINT32(NumRampItems); 08113 08114 for (UINT32 i = 0 ; i < NumRampItems; i++) 08115 { 08116 if (ok) ok = Rec.WriteDOUBLE(pPositions[i]); 08117 if (ok) ok = Rec.WriteReference(pRampColRefs[i]); 08118 } 08119 08120 if (ok) ok = pFilter->Write(&Rec); 08121 } 08122 } 08123 08124 if (pRampColRefs) 08125 delete [] pRampColRefs; 08126 08127 if (pPositions) 08128 delete [] pPositions; 08129 08130 08131 if (!ok) 08132 pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 08133 08134 return ok; 08135 #else 08136 return FALSE; 08137 #endif 08138 }
|
|
Definition at line 975 of file fillattr2.h. |