#include <fillattr2.h>
Inheritance diagram for AttrBitmapColourFill:
Public Member Functions | |
AttrBitmapColourFill () | |
AttrBitmapColourFill (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
void | Render (RenderRegion *pRender) |
'Renders' a Bitmap 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 | RenderFillMesh (RenderRegion *, DocCoord *, BOOL *, INT32 NumControlPoints=0) |
virtual void | RenderFillBlobs (RenderRegion *pRender) |
Renders the grad fills arrow blob when requested to by its selected parent. | |
virtual BOOL | IsVisible () |
virtual CCRuntimeClass * | GetAttributeType () |
virtual AttributeValue * | GetAttributeValue () |
virtual BOOL | ChangeControlColour (AttrColourChange *NewCol) |
Alter the colour of a selected fill handle. | |
virtual BOOL | ChangeControlColour (DocColour &Col, FillControl Cntrl, AttrColourDrop *pColDrop=NULL) |
Applies a colour to a specific Fill Control Point. | |
AttrFillGeometry * | ChangeAttrValue (AttrValueChange *pValue) |
virtual BOOL | IsAColourFill () const |
Virtual function for determining if the node is a Colour Fill attribute. | |
virtual BOOL | IsABitmapFill () const |
Virtual function for determining if the node is an attribute. | |
virtual BOOL | IsABitmapColourFill () const |
virtual BOOL | WritePreChildrenWeb (BaseCamelotFilter *pFilter) |
Writes the bitmap 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 Member Functions | |
virtual void | RenderControl (FillControl, BOOL) |
Redraws the Fill Control blobs when the selection changes. | |
Protected Attributes | |
BitmapFillAttribute | Value |
Definition at line 1891 of file fillattr2.h.
|
Definition at line 1896 of file fillattr2.h. 01896 : AttrBitmapFill() {}
|
|
Definition at line 1897 of file fillattr2.h. 01902 : 01903 AttrBitmapFill(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}
|
|
Reimplemented from AttrFillGeometry. Definition at line 1921 of file fillattr2.h. 01921 { return ChangeColour(pValue); }
|
|
Applies a colour to a specific Fill Control Point.
Reimplemented from AttrFillGeometry. Definition at line 5271 of file fillattr.cpp. 05273 { 05274 #if !defined(EXCLUDE_FROM_RALPH) 05275 // Do contone stuff here .... 05276 KernelBitmap* pBitmap = GetBitmap(); 05277 KernelBitmap* pGreyBmp = NodeBitmap::CheckGreyscaleBitmap(pBitmap, _R(IDS_MAKEGREY), _R(IDS_DOGREY)); 05278 05279 if (pGreyBmp == NULL) 05280 return FALSE; // Failed in some way (or the user cancelled) 05281 05282 return AttrFillGeometry::ChangeControlColour(Col, Cntrl); 05283 #else 05284 return FALSE; 05285 #endif 05286 }
|
|
Alter the colour of a selected fill handle.
Reimplemented from AttrBitmapFill. Definition at line 15212 of file fillattr.cpp. 15213 { 15214 #if !defined(EXCLUDE_FROM_RALPH) 15215 // Do contone stuff here .... 15216 if (SelectionState[FILLCONTROL_STARTPOINT] || 15217 SelectionState[FILLCONTROL_ENDPOINT]) 15218 { 15219 if (GetApplication()->GetBlobManager()->GetCurrentInterest().Fill && IsVisible()) 15220 { 15221 KernelBitmap* pBitmap = GetBitmap(); 15222 KernelBitmap* pGreyBmp = NodeBitmap::CheckGreyscaleBitmap(pBitmap, _R(IDS_MAKEGREY), _R(IDS_DOGREY)); 15223 15224 if (pGreyBmp == NULL) 15225 return FALSE; // Failed in some way (or the user cancelled) 15226 } 15227 } 15228 15229 return AttrFillGeometry::ChangeControlColour(NewCol); 15230 #else 15231 return FALSE; 15232 #endif 15233 }
|
|
Reimplemented from NodeAttribute. Definition at line 1915 of file fillattr2.h. 01915 { return CC_RUNTIME_CLASS(AttrFillGeometry); }
|
|
Implements AttrBitmapFill. Definition at line 1916 of file fillattr2.h. 01916 { return &Value; }
|
|
Returns a string resource ID describing the attribute.
Reimplemented from NodeAttribute. Definition at line 14834 of file fillattr.cpp. 14835 { 14836 return (_R(IDS_BITMAPFILL)); 14837 }
|
|
Output details of this attribute to the Camelot debug tree dialog.
Reimplemented from NodeRenderable. Definition at line 14850 of file fillattr.cpp. 14851 { 14852 #ifdef _DEBUG 14853 NodeAttribute::GetDebugDetails( Str ); 14854 14855 String_256 TempStr; 14856 14857 TempStr._MakeMsg( TEXT("\r\nBitmap Fill:\r\n")); 14858 (*Str) += TempStr; 14859 14860 TempStr._MakeMsg(TEXT("\r\nStart = (#1%ld, #2%ld)"), 14861 (*GetStartPoint()).x, (*GetStartPoint()).y); 14862 (*Str) += TempStr; 14863 14864 TempStr._MakeMsg(TEXT("\r\nEnd = (#1%ld, #2%ld) "), 14865 (*GetEndPoint()).x, (*GetEndPoint()).y); 14866 (*Str) += TempStr; 14867 14868 TempStr._MakeMsg(TEXT("\r\n3rd = (#1%ld, #2%ld) "), 14869 (*GetEndPoint2()).x, (*GetEndPoint2()).y); 14870 (*Str) += TempStr; 14871 14872 BitmapInfo Info; 14873 KernelBitmap* KerBmp = ((BitmapFillAttribute*)GetAttributeValue())->GetBitmap(); 14874 14875 if (KerBmp && KerBmp->ActualBitmap && KerBmp->ActualBitmap->GetInfo( &Info ) ) 14876 { 14877 TempStr._MakeMsg( _T("\r\nBits = (#1%ux#2%ux#3%u) "), Info.PixelWidth, 14878 Info.PixelHeight, 14879 Info.PixelDepth 14880 ); 14881 (*Str) += TempStr; 14882 } 14883 #endif 14884 }
|
|
For finding the size of the node.
Reimplemented from Node. Definition at line 14898 of file fillattr.cpp. 14899 { 14900 return sizeof(AttrBitmapColourFill); 14901 }
|
|
Reimplemented from Node. Definition at line 1925 of file fillattr2.h. 01925 { return TRUE; }
|
|
Virtual function for determining if the node is an attribute.
Reimplemented from AttrBitmapFill. Definition at line 1924 of file fillattr2.h. 01924 { return TRUE; }
|
|
Virtual function for determining if the node is a Colour Fill attribute.
Reimplemented from NodeAttribute. Definition at line 1923 of file fillattr2.h. 01923 { return TRUE; }
|
|
Reimplemented from NodeAttribute. Definition at line 1938 of file fillattr2.h. 01938 { 01939 KernelBitmap* pBmp = GetBitmap(); 01940 return (pBmp == NULL || pBmp->GetBPP() != 24); 01941 }
|
|
Reimplemented from AttrFillGeometry. Definition at line 1913 of file fillattr2.h. 01913 { return IsColourMeshVisible(); }
|
|
'Renders' a Bitmap Fill Colour attribute.
Reimplemented from NodeAttribute. Definition at line 14792 of file fillattr.cpp. 14793 { 14794 pRender->SetFillGeometry(&Value, FALSE); 14795 }
|
|
Redraws the Fill Control blobs when the selection changes.
Reimplemented from AttrFillGeometry. Definition at line 15125 of file fillattr.cpp. 15126 { 15127 #if !defined(EXCLUDE_FROM_RALPH) 15128 DocRect ControlRect; 15129 15130 // Ignore if we're not in the tree yet 15131 // We may be a tempory clone, or something 15132 NodeRenderable* pParent = (NodeRenderable*)FindParent(); 15133 15134 if (pParent == NULL) 15135 return; 15136 15137 if (IsBlobSame(Control)) 15138 return; // Ignore if same as the last blob rendered 15139 15140 Spread* pSpread = this->FindParentSpread(); 15141 15142 DocCoord StartPoint = *GetStartPoint(); 15143 DocCoord EndPoint = *GetEndPoint(); 15144 DocCoord EndPoint2 = *GetEndPoint2(); 15145 15146 DocCoord CentrePoint; 15147 DocCoord Drag2Blob; 15148 DocCoord Drag3Blob; 15149 15150 GetBitmapVirtualPoints(StartPoint, EndPoint, EndPoint2, 15151 &CentrePoint, &Drag2Blob, &Drag3Blob); 15152 15153 switch (Control) 15154 { 15155 case FILLCONTROL_STARTPOINT: 15156 15157 if (GetStartPoint() != NULL) 15158 { 15159 // Redraw the Start Point Blob 15160 (Camelot.GetBlobManager())->GetBlobRect(CentrePoint, &ControlRect); 15161 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent); 15162 } 15163 break; 15164 15165 case FILLCONTROL_ENDPOINT: 15166 15167 if (GetEndPoint() != NULL) 15168 { 15169 // Redraw BOTH End Point Blobs 15170 (Camelot.GetBlobManager())->GetBlobRect(Drag2Blob, &ControlRect); 15171 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent); 15172 } 15173 15174 if (GetEndPoint2() != NULL) 15175 { 15176 (Camelot.GetBlobManager())->GetBlobRect(Drag3Blob, &ControlRect); 15177 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent); 15178 } 15179 break; 15180 15181 case FILLCONTROL_SECONDARYPOINT: 15182 15183 if (GetEndPoint2() != NULL) 15184 { 15185 // Redraw BOTH End Point Blobs 15186 (Camelot.GetBlobManager())->GetBlobRect(Drag2Blob, &ControlRect); 15187 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent); 15188 } 15189 15190 if (GetEndPoint2() != NULL) 15191 { 15192 (Camelot.GetBlobManager())->GetBlobRect(Drag3Blob, &ControlRect); 15193 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent); 15194 } 15195 break; 15196 } 15197 #endif 15198 }
|
|
Renders the grad fills arrow blob when requested to by its selected parent.
Reimplemented from AttrBitmapFill. Definition at line 14914 of file fillattr.cpp. 14915 { 14916 #if !defined(EXCLUDE_FROM_RALPH) 14917 if (!IsVisible()) 14918 return; // We're in Fill Transparency Mode 14919 14920 // Don't bother if this fill is being edited as a copy of it 14921 // we be rendered thoughout the drag op 14922 if (IsFillBeingEdited()) 14923 return; 14924 14925 // Ignore this if the mesh is the same as the last one rendered. 14926 if (CheckPreviousFillMesh()) 14927 return; 14928 14929 DocCoord ControlPoints[5]; 14930 ControlPoints[FILLCONTROL_STARTPOINT] = (*GetStartPoint()); 14931 ControlPoints[FILLCONTROL_ENDPOINT] = (*GetEndPoint()); 14932 ControlPoints[FILLCONTROL_SECONDARYPOINT] = (*GetEndPoint2()); 14933 14934 /* 14935 TRACEUSER( "Mike", _T("Start=%d,%d; End=%d,%d; End2=%d,%d\n"),ControlPoints[0].x, ControlPoints[0].y, 14936 ControlPoints[1].x, ControlPoints[1].y, 14937 ControlPoints[2].x, ControlPoints[2].y); 14938 14939 DocRect ClipRect = pRender->GetClipRect(); 14940 14941 if (DraggedFill == NULL) 14942 { 14943 DocColour RandCol = DocColour(ColourValue(rand()>>7), ColourValue(rand()>>7), ColourValue(rand()>>7)); 14944 14945 pRender->SetFillColour(RandCol); 14946 pRender->SetLineColour(COLOUR_NONE); 14947 pRender->DrawRect(&ClipRect); 14948 } 14949 14950 TRACEUSER( "Mike", _T("ClipRect=%d,%d, %d,%d\n"),ClipRect.lox,ClipRect.loy,ClipRect.hix,ClipRect.hiy); 14951 */ 14952 14953 // Render a nice pretty Fill Mesh thingy 14954 RenderFillMesh(pRender, ControlPoints, SelectionState, 5); 14955 14956 // This call was removed by Gerry (2/9/96) as it causes blob problems 14957 // If we are removing blobs then force all blobs to be deselected 14958 // if ((Camelot.GetBlobManager())->IsRemovingBlobs()) 14959 // DeselectAllNoRedraw(); 14960 #endif 14961 }
|
|
Reimplemented from AttrBitmapFill. Definition at line 14980 of file fillattr.cpp. 14983 { 14984 #if !defined(EXCLUDE_FROM_RALPH) 14985 DocCoord StartPoint = ControlPoints[FILLCONTROL_STARTPOINT]; 14986 DocCoord EndPoint = ControlPoints[FILLCONTROL_ENDPOINT]; 14987 14988 if (StartPoint == EndPoint) 14989 return; 14990 14991 if (SelState == NULL) 14992 { 14993 // If no selection state passed in, then assume 14994 // all the points are deselected 14995 BOOL Selected[NUMCONTROLPOINTS]; 14996 for (INT32 i=0; i< NumControlPoints; i++) 14997 { 14998 Selected[i] = FALSE; 14999 } 15000 SelState = Selected; 15001 } 15002 15003 DocCoord EndPoint2 = ControlPoints[FILLCONTROL_SECONDARYPOINT]; 15004 15005 DocCoord Start; 15006 DocCoord End; 15007 DocCoord End2; 15008 15009 // Work out the Virtual positions of the Bitmap Controls 15010 GetBitmapVirtualPoints(StartPoint, EndPoint, EndPoint2, 15011 &Start, &End, &End2); 15012 15013 // Remember what attributes were here before 15014 pRender->SaveContext(); 15015 15016 // Get the current blob size in Doc Units 15017 INT32 BlobSize = (Camelot.GetBlobManager())->GetBlobSize(); 15018 15019 // Calculate the Arrow on the End of the Line 15020 Path ArrowPath; 15021 ArrowPath.Initialise(); 15022 DocCoord LineEnd; 15023 MakeMeshArrow(&ArrowPath, Start, End, &LineEnd); 15024 15025 // Calculate the Arrow on the End of the Line2 15026 Path ArrowPath2; 15027 ArrowPath2.Initialise(); 15028 DocCoord LineEnd2; 15029 MakeMeshArrow(&ArrowPath2, Start, End2, &LineEnd2); 15030 15031 // Set the line colours etc as we need them 15032 pRender->SetLineWidth(0); 15033 pRender->SetLineColour(COLOUR_UNSELECTEDBLOB); 15034 pRender->SetFillColour(COLOUR_UNSELECTEDBLOB); 15035 15036 // First Draw the Line 15037 pRender->SetLineWidth(BlobSize/4); 15038 pRender->DrawLine(Start, LineEnd); 15039 15040 // Draw the secondary line 15041 pRender->DrawLine(Start, LineEnd2); 15042 15043 // Render an Arrow at the end of the line 15044 pRender->SetLineWidth(0); 15045 pRender->SetLineColour(COLOUR_NONE); 15046 pRender->DrawPath(&ArrowPath); 15047 15048 // and on the end of the secondary line 15049 pRender->DrawPath(&ArrowPath2); 15050 15051 if (DraggedFill == this) 15052 { 15053 // If we are being dragged then draw a Parallelgram to 15054 // show the shape of the bitmap 15055 pRender->SetLineColour(COLOUR_SELECTEDBLOB); 15056 pRender->SetFillColour(COLOUR_NONE); 15057 15058 Path ParaPath; 15059 ParaPath.Initialise(); 15060 MakeMeshParallelagram(&ParaPath, Start, End, End2); 15061 15062 // Draw the parallelagram 15063 pRender->DrawPath(&ParaPath); 15064 } 15065 15066 // Now Render the blobs on the path 15067 // if (GetBitmap()->GetBPP() <= 8) 15068 // { 15069 // Draw a blob at the start point 15070 if (SelState[FILLCONTROL_STARTPOINT]) 15071 { 15072 // Draw Selected Blob 15073 // pRender->SetLineColour(COLOUR_SELECTEDBLOB); 15074 pRender->SetLineColour(COLOUR_NONE); 15075 pRender->SetFillColour(COLOUR_SELECTEDBLOB); 15076 pRender->DrawBlob(Start, BT_SELECTED); 15077 } 15078 else 15079 { 15080 // Draw Unselected Blob 15081 // pRender->SetLineColour(COLOUR_UNSELECTEDBLOB); 15082 pRender->SetLineColour(COLOUR_NONE); 15083 pRender->SetFillColour(COLOUR_UNSELECTEDBLOB); 15084 pRender->DrawBlob(Start, BT_UNSELECTED); 15085 } 15086 15087 // Draw a blob at the end point 15088 if (SelState[FILLCONTROL_ENDPOINT]) 15089 { 15090 // Draw Selected Blob 15091 // pRender->SetLineColour(COLOUR_SELECTEDBLOB); 15092 pRender->SetLineColour(COLOUR_NONE); 15093 pRender->SetFillColour(COLOUR_SELECTEDBLOB); 15094 pRender->DrawBlob(End, BT_SELECTED); 15095 pRender->DrawBlob(End2,BT_SELECTED); 15096 } 15097 else 15098 { 15099 // Draw Unselected Blob 15100 // pRender->SetLineColour(COLOUR_UNSELECTEDBLOB); 15101 pRender->SetLineColour(COLOUR_NONE); 15102 pRender->SetFillColour(COLOUR_UNSELECTEDBLOB); 15103 pRender->DrawBlob(End, BT_UNSELECTED); 15104 pRender->DrawBlob(End2,BT_UNSELECTED); 15105 } 15106 // } 15107 15108 // Put all the old attributes back 15109 pRender->RestoreContext(); 15110 #endif 15111 }
|
|
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 14812 of file fillattr.cpp. 14813 { 14814 AttrBitmapColourFill* NodeCopy = new AttrBitmapColourFill(); 14815 if (NodeCopy == NULL) 14816 return NULL; 14817 14818 CopyNodeContents(NodeCopy); 14819 14820 return NodeCopy; 14821 }
|
|
Writes out colour definitions for this fill. > virtual BOOL AttrBitmapColourFill::WriteColourDefinitions (BaseCamelotFilter* pFilter)
Reimplemented from AttrFillGeometry. Definition at line 15344 of file fillattr.cpp. 15345 { 15346 // Contone? 15347 DocColour* pStartCol= Value.GetStartColour(); 15348 DocColour* pEndCol = Value.GetEndColour(); 15349 INT32 StartColRef, EndColRef; 15350 15351 if (pStartCol != NULL && pEndCol != NULL) 15352 { 15353 // It's a contone bmp if it has both a start & an end colour. 15354 StartColRef = pFilter->WriteRecord(pStartCol); 15355 EndColRef = pFilter->WriteRecord(pEndCol); 15356 15357 // Are the colour references ok? 15358 BOOL ok = ((StartColRef != 0) && (EndColRef != 0)); 15359 15360 return (ok); 15361 } 15362 15363 return (TRUE); 15364 }
|
|
Reimplemented from Node. Definition at line 15320 of file fillattr.cpp. 15321 { 15322 #ifdef DO_EXPORT 15323 return WritePreChildrenWeb(pFilter); 15324 #else 15325 return FALSE; 15326 #endif 15327 }
|
|
Writes the bitmap fill record to the filter. > virtual BOOL AttrBitmapColourFill::WritePreChildrenWeb(BaseCamelotFilter* pFilter)
Reimplemented from Node. Definition at line 15250 of file fillattr.cpp. 15251 { 15252 #ifdef DO_EXPORT 15253 ERROR2IF(pFilter == NULL,FALSE,"NULL filter param"); 15254 15255 BOOL ok = TRUE; 15256 15257 // Find the kernel bmp 15258 KernelBitmap *pBmp = Value.GetBitmap(); 15259 ERROR2IF(pBmp == NULL,FALSE,"CXaraFileNodeBitmap::WriteNodeBitmap pBmp is NULL"); 15260 15261 // Must write out the bitmap first 15262 INT32 BitmapRecordRef = pFilter->WriteRecord(pBmp); 15263 ERROR2IF(BitmapRecordRef == 0,FALSE,"CXaraFileNodeBitmap::WriteNodeBitmap BitmapRecordRef is 0"); 15264 15265 UINT32 Tag = TAG_BITMAPFILL; 15266 UINT32 TagSize = TAG_BITMAPFILL_SIZE; 15267 15268 // Contone? 15269 DocColour* pStartCol= Value.GetStartColour(); 15270 DocColour* pEndCol = Value.GetEndColour(); 15271 INT32 StartColRef=0; 15272 INT32 EndColRef=0; 15273 15274 if (pStartCol != NULL && pEndCol != NULL) 15275 { 15276 // It's a contone bmp if it has both a start & an end colour. 15277 StartColRef = pFilter->WriteRecord(pStartCol); 15278 EndColRef = pFilter->WriteRecord(pEndCol); 15279 15280 Tag = TAG_CONTONEBITMAPFILL; 15281 TagSize = TAG_CONTONEBITMAPFILL_SIZE; 15282 15283 // Are the colour refs ok? 15284 ok = (StartColRef != 0) && (EndColRef != 0); 15285 } 15286 15287 // Is the bmp reference ok? 15288 if (ok) ok = (BitmapRecordRef != 0); 15289 15290 CamelotFileRecord Rec(pFilter,Tag,TagSize); 15291 15292 if (ok) ok = Rec.Init(); 15293 if (ok) ok = Rec.WriteCoord(Value.StartPoint); 15294 if (ok) ok = Rec.WriteCoord(Value.EndPoint); 15295 if (ok) ok = Rec.WriteCoord(Value.EndPoint2); 15296 15297 if (Tag == TAG_CONTONEBITMAPFILL) 15298 { 15299 if (ok) ok = Rec.WriteReference(StartColRef); 15300 if (ok) ok = Rec.WriteReference(EndColRef); 15301 } 15302 15303 if (ok) ok = Rec.WriteReference(BitmapRecordRef); 15304 if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetBias ()); 15305 if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetGain ()); 15306 if (ok) ok = pFilter->Write(&Rec); 15307 15308 if (!ok) 15309 pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 15310 15311 return ok; 15312 #else 15313 return FALSE; 15314 #endif 15315 }
|
|
Definition at line 1944 of file fillattr2.h. |