#include <fillattr.h>
Inheritance diagram for AttrFillGeometry:
Public Member Functions | |
AttrFillGeometry () | |
Default constructor for a Fill Attribute. Sets default Selection State and Attribute Bounds. | |
~AttrFillGeometry () | |
Destroys a Fill. Currently this function does nothing. | |
AttrFillGeometry (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
virtual INT32 | operator== (const NodeAttribute &NodeAttrib) |
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required. | |
virtual INT32 | operator= (AttrFillGeometry &FillAttrib) |
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required. | |
virtual void | RenderFillBlobs (RenderRegion *pRender) |
virtual void | RenderFillMesh (RenderRegion *, DocCoord *, BOOL *, INT32 NumControlPoints=0) |
virtual void | RenderFillBlobs () |
Force Renders the fill mesh off the screen. | |
void | DisableRampRedraw () |
void | EnableRampRedraw () |
void | DisableBoundsRedraw () |
void | EnableBoundsRedraw () |
virtual void | DrawEndBlobs () |
Draws the blobs on the ends of the fill arrows. | |
virtual DocColour * | GetStartColour () |
virtual DocColour * | GetEndColour () |
virtual DocColour * | GetEndColour2 () |
virtual DocColour * | GetEndColour3 () |
virtual UINT32 * | GetStartTransp () |
virtual UINT32 * | GetEndTransp () |
virtual UINT32 * | GetEndTransp2 () |
virtual UINT32 * | GetEndTransp3 () |
virtual DocCoord * | GetStartPoint () |
virtual DocCoord * | GetEndPoint () |
virtual DocCoord * | GetEndPoint2 () |
virtual DocCoord * | GetEndPoint3 () |
virtual CProfileBiasGain & | GetProfile () |
virtual void | SetStartColour (DocColour *NewCol) |
virtual void | SetEndColour (DocColour *NewCol) |
virtual void | SetEndColour2 (DocColour *NewCol) |
virtual void | SetEndColour3 (DocColour *NewCol) |
virtual void | SetStartTransp (UINT32 *NewTransp) |
virtual void | SetEndTransp (UINT32 *NewTransp) |
virtual void | SetEndTransp2 (UINT32 *NewTransp) |
virtual void | SetEndTransp3 (UINT32 *NewTransp) |
virtual void | SetStartPoint (DocCoord *Pos) |
virtual void | SetEndPoint (DocCoord *Pos) |
virtual void | SetEndPoint2 (DocCoord *Pos) |
virtual void | SetEndPoint3 (DocCoord *Pos) |
virtual void | SetProfile (CProfileBiasGain &SetWith) |
virtual UINT32 | GetTranspType () |
virtual UINT32 | GetDPI () |
virtual UINT32 | GetFractalDPI () |
virtual UINT32 | GetFractalDim () |
virtual INT32 | GetSeed () |
virtual FIXED16 | GetGraininess () |
virtual FIXED16 | GetGravity () |
virtual FIXED16 | GetSquash () |
virtual BOOL | GetTileable () |
virtual double | GetNoiseScale () |
virtual void | SetTranspType (UINT32 NewType) |
virtual BOOL | SetDPI (UINT32 NewDpi) |
virtual BOOL | SetFractalDPI (UINT32 NewDpi) |
virtual void | SetFractalDim (UINT32 NewDim) |
virtual BOOL | SetSeed (INT32 NewSeed) |
virtual BOOL | SetGraininess (FIXED16 NewGrain) |
virtual BOOL | SetGravity (FIXED16 NewGrav) |
virtual BOOL | SetSquash (FIXED16 NewSquash) |
virtual BOOL | SetTileable (BOOL NewTile) |
virtual BOOL | SetNoiseScale (double ns) |
virtual BOOL | RecalcFractal () |
virtual BOOL | Randomise () |
virtual BOOL | AttachBitmap (KernelBitmap *NewBitmap) |
virtual BOOL | DetachBitmap () |
virtual KernelBitmap * | GetBitmap () |
virtual BOOL | CopyBitmap (KernelBitmap *CopyBitmap) |
virtual KernelBitmapRef * | GetBitmapRef () |
virtual INT32 | GetTesselation () |
virtual void | SetTesselation (INT32 NewTess) |
virtual BOOL | IsPerspective () |
virtual ColourRamp * | GetColourRamp () |
virtual TransparencyRamp * | GetTranspRamp () |
virtual void | SetColourRamp (ColourRamp *New) |
virtual void | SetTranspRamp (TransparencyRamp *New) |
virtual void | MakePerspective (UndoableOperation *pUndoOp=NULL) |
virtual void | RemovePerspective (UndoableOperation *pUndoOp=NULL) |
virtual DocColour * | EnumerateColourFields (UINT32 Context) |
See base class. | |
virtual AttributeValue * | GetAttributeValue ()=0 |
virtual DocRect | GetBlobBoundingRect () |
Calculates the bounding rectangle of the attrs blobs.This should always be calculated on the fly as the view scale can change without the attr knowing, giving an incorrect result. | |
virtual ANGLE | GetSecondaryAngle () |
FillRamp * | GetFillRamp () |
Return the fill ramp associated with this fill geometry. Currently this ramp can be either a colour ramp or a transparency ramp. Other ramps might well be added at a later time. | |
DocColour * | GetFirstSelectedColour () |
Get the colour associated with the first selected endpoint. This function tends to be used with GetSelectionCount once you've worked out there's only one end point selected. At least I use it mostly that way. | |
UINT32 * | GetFirstSelectedTransp () |
Get the transparency associated with the first selected endpoint. This function tends to be used with GetSelectionCount once you've worked out there's only one end point selected. At least I use it mostly that way. | |
INT32 | GetFirstSelectedIndex () |
Find the index of the first selected endpoint. If nothing is selected -1 will be returned otherwise a number 0..n-1. | |
DocRect | GetBoundingRect () |
void | SetBoundingRect (DocRect &NewBounds) |
Set the Attributes bounding rectangle, which is used for current attributes and scaling when applying to new ink nodes. This rect is only used for 'Current' Attributes which don't have any parent bounds. It allows us to scale current attributes when they are applied. | |
BOOL | WriteBoundingRect (BaseCamelotFilter *pFilter) |
Write the Attributes bounding rectangle. | |
virtual BOOL | OnClick (DocCoord, ClickType, ClickModifiers, Spread *) |
Allows the fill to respond to clicks by selecting its blobs or starting drags etc. | |
virtual void | GetControlPoints (DocCoord *, INT32) |
Get the positions of fill control points. | |
virtual void | OnControlDrag (DocCoord, FillControl &, ClickModifiers) |
virtual void | SetAspectRatio (double Ratio) |
UINT32 | GetSelectionState (BOOL **) |
Get the current Selection state of the Fill Control Points. | |
BOOL | IsSelected (UINT32 Control) |
Set the Selection state of the Fill Control Points. Determines if a Fill Control Point is selected or not. | |
UINT32 | GetSelectionCount () |
Get the number of Selected Fill Control Points. | |
UINT32 | GetBlobCount (BOOL IncludeRamps=TRUE) |
Return the number of editable points in this fill geometry. | |
virtual void | SetBlobState (FillControl, BOOL) |
Sets the selection state of a particular Control Point. | |
virtual void | ToggleSelection (FillControl) |
Toggle the selection of a Fill Control Point. | |
virtual void | SelectBlob (FillControl) |
Selects a Fill Control Point. | |
virtual void | DeselectBlob (FillControl) |
Deselects a particular Fill Control Point. | |
virtual void | DeselectAll () |
Deselects all of the Fill Control Points for this fill. | |
virtual void | DeselectAllBut (FillControl) |
Deselects all but one of the Fill Control Points. | |
virtual void | DeselectAllNoRedraw () |
Deselects all of the Fill Control Points for this fill, without redawing anything. | |
virtual void | CycleSelection (BOOL Reverse) |
Cycles the selection state of the controls. | |
virtual BOOL | IsVisible () |
virtual BOOL | NeedsTransparency () const |
Called. | |
virtual FillControl | CheckForControlHit (DocCoord &) |
Check to see if a click was on a Fill Control Point. | |
virtual AttrFillGeometry * | Mutate (AttrFillGeometry *, BOOL bOptimise=TRUE) |
Changes a fill in some way. | |
virtual AttrFillGeometry * | ChangeAttrValue (AttrValueChange *) |
virtual void | AttributeChanged () |
Called by someone who has changed something about us that it thinks we should know about. It used by the Attribute manager to make a current attribute validate itself after it has been added to a new object. This functions just calls 'ValidateAttributeValue'. | |
virtual BOOL | Blend (BlendAttrParam *pBlendParam) |
virtual AttrFillGeometry * | DoColourDrop (AttrColourDrop *) |
Changes the colour of a fill. | |
virtual FillControl | TestColourDrop (AttrColourDrop *) |
Check to see which colour will be changed if dropped at this point. | |
virtual BOOL | ChangeControlColour (AttrColourChange *) |
Applies a colour to selected Fill Control Points. | |
virtual BOOL | ChangeControlTransp (AttrTranspChange *) |
Applies a colour to selected Fill Control Points. | |
virtual BOOL | ChangeControlColour (DocColour &, FillControl, AttrColourDrop *pColDrop=NULL) |
Applies a colour to a specific Fill Control Point. | |
virtual BOOL | EditColourFillRamp (AttrColFillRampChange *) |
Applies a ramp change to this fill. See the class AttrColFillRampChange for all the documentation on this. | |
virtual BOOL | EditTranspFillRamp (AttrTranspFillRampChange *) |
Applies a ramp change to this fill. See the class AttrTranspFillRampChange for all the documentation on this. | |
virtual BOOL | IsAFillAttr () const |
virtual void | TransformSelectedControlPoints (TransformBase &, BOOL *isARampBlob=NULL) |
Transform a grad fill attribute by moving the selected control points. | |
virtual void | TransformSelectedFillRampControlPoints (TransformBase &, ClickModifiers ClickMods, BOOL *isARampBlob) |
Transform a grad fill attributes fill ramp by moving the selected control points. | |
virtual void | TransformToNewBounds (DocRect &NewBounds) |
Moves and scales the attribute's bounds to fit NewBounds. This function is used when applying an attribute which has been stored (eg. as a Current attribute) to a new object. | |
virtual BOOL | NeedsForceToSimpleMapping () |
virtual BOOL | IsARadialColourFill () const |
virtual BOOL | CopyComponentData (BaseDocument *SrcDoc, BaseDocument *NodesDoc) |
If the attribute contains any DocColours which are indexed then a copy of the indexed colour is made and added to the NodesDoc ColourListComponent. | |
virtual BOOL | WriteColourDefinitions (BaseCamelotFilter *pFilter) |
virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
Polymorphically copies the contents of this node to another. | |
virtual BOOL | IsTypeExtendible () const |
virtual DocRect | ValidateExtend (const ExtendParams &ExtParams) |
Determine whether applying an extend to this Node is a reversible process. | |
virtual void | Extend (const ExtendParams &ExtParams) |
Perform an extend operation on this fill node. | |
virtual DocCoord | FindExtendCentre () |
virtual void | TransformTranslateObject (const ExtendParams &ExtParams) |
Do an extend (as opposed to stretch) operation on this fill, using ExtParams as the source of the extend data, together with the extend-centre of this path, defined in NodeRenderable::FindExtendCentre() and overridden here also. | |
virtual INT32 | GetNumberOfControlPoints () |
Static Public Member Functions | |
static BOOL | Init () |
Intialise the fill geometry editing operations. | |
static AttrFillGeometry * | FindFirstSelectedAttr (CCRuntimeClass *AttrType=(CCRuntimeClass *) CC_RUNTIME_CLASS(AttrFillGeometry)) |
Scans the selection for fill attributes. | |
static AttrFillGeometry * | FindNextSelectedAttr (CCRuntimeClass *AttrType=(CCRuntimeClass *) CC_RUNTIME_CLASS(AttrFillGeometry)) |
Scans the selection for fill attributes. | |
static UINT32 | CountSelectionControlPoints () |
Get the number of Selected Fill Control Points within the selected objects. | |
static BOOL | CheckAttrClick (DocCoord PointerPos, ClickType Click, ClickModifiers ClickMods, Spread *pSpread) |
Check to see if an Attribute wants to do something with a click. | |
static BOOL | CheckForFillControlHit (DocCoord Pos, UINT32 *Status) |
Check to see if the mouse moves over a fill control point. | |
static FillControl | DoColourDropTest (AttrColourDrop *, NodeRenderableInk **, AttrFillGeometry **FillAttr=NULL) |
static BOOL | IsTranspMeshVisible () |
static BOOL | IsColourMeshVisible () |
static UINT32 | FillSelectionCount () |
static void | SetSelectionCount (UINT32) |
static void | SetTranspMeshesVisible (BOOL) |
Public Attributes | |
BOOL | AllowRampRedraw |
BOOL | AllowBoundsRedraw |
Static Public Attributes | |
static AttrFillGeometry * | EditedFill = NULL |
static AttrFillGeometry * | DraggedFill = NULL |
static List | HitList |
static BOOL | DoFillMeshCheck = TRUE |
static FillGeometryAttribute * | LastRenderedMesh = NULL |
static DocCoord | LastRenderedStartBlob = DocCoord(0,0) |
static DocCoord | LastRenderedEndBlob = DocCoord(0,0) |
static DocCoord | LastRenderedEnd2Blob = DocCoord(0,0) |
static DocCoord | LastRenderedEnd3Blob = DocCoord(0,0) |
static UINT32 | SelectionCount = 0 |
static INT32 | FractalSeed = 63933 |
static double | FractalGraininess = 5 |
static double | FractalGravity = 0 |
static INT32 | FractalDPI = 96 |
static INT32 | MaxFractalSize = 256 |
static BOOL | TranspMeshesVisible = FALSE |
static BOOL | DoCheckOnFillRampMesh = TRUE |
static BOOL | s_bGroupTransparency = TRUE |
Protected Member Functions | |
virtual void | ValidateAttributeValue () |
virtual BOOL | CopyNodeContents (AttrFillGeometry *NodeCopy) |
This method copies the node's contents to the node pointed to by NodeCopy. | |
virtual void | RenderControl (FillControl, BOOL) |
Redraws the Fill Control blobs when the selection changes. | |
void | RenderFillControl (BOOL RenderOn, DocRect *ControlRect, Spread *pSpread, NodeRenderable *pParent) |
void | RenderControlIntoPendingRegions (DocRect *ControlRect, Spread *pSpread, NodeRenderable *pParent) |
AttrFillGeometry * | ChangeColour (AttrValueChange *) |
Changes a fill in some way. | |
AttrFillGeometry * | ChangeTransp (AttrValueChange *) |
Changes a fill in some way. | |
BOOL | CheckPreviousFillMesh () |
BODGE to stop fill meshes eoring each other out. This can be disabled by setting 'DoFillMeshCheck' to '0' in the 'ini' file. | |
BOOL | IsFillBeingEdited () |
Check to see if a fill is being edited, so we can decide whether to render the fill mesh or not. | |
void | SetLastRenderedBlob (FillControl) |
BOOL | IsBlobSame (FillControl) |
void | ChangeBlobState (FillControl, INT32) |
Sets the state of a fill blob. | |
virtual double | FindRampPoint (DocCoord &dc, DocCoord &StartPoint, DocCoord &EndPoint) |
Called. | |
Static Protected Member Functions | |
static BOOL | IsMeshSame (FillGeometryAttribute *, FillGeometryAttribute *) |
Protected Attributes | |
BOOL | SelectionState [5] |
DocRect | AttrBounds |
Static Protected Attributes | |
static FillControl | ControlHit |
static AttrFillGeometry * | FillHit |
static SelectedAttrs | s_SelAttrs |
static CCAttrMap | AttribMap |
Definition at line 206 of file fillattr.h.
|
Default constructor for a Fill Attribute. Sets default Selection State and Attribute Bounds.
Definition at line 1216 of file fillattr.cpp. 01217 { 01218 // Make all the control points deselected 01219 SelectionState[FILLCONTROL_STARTPOINT] = FALSE; 01220 SelectionState[FILLCONTROL_ENDPOINT] = FALSE; 01221 SelectionState[FILLCONTROL_ENDPOINT2] = FALSE; 01222 SelectionState[FILLCONTROL_ENDPOINT3] = FALSE; 01223 SelectionState[FILLCONTROL_SECONDARYPOINT] = FALSE; 01224 01225 // Make the attribute bounds empty. 01226 // Attribute bounds are only used for 'Current Attributes' that do not have 01227 // a parent, so they can be scaled when applied to a new object. 01228 AttrBounds = DocRect(0,0,0,0); 01229 01230 AllowRampRedraw = TRUE; 01231 AllowBoundsRedraw = TRUE; 01232 }
|
|
Destroys a Fill. Currently this function does nothing.
Definition at line 1245 of file fillattr.cpp. 01246 { 01247 LastRenderedMesh = NULL; // this ptr may be pointing to us! 01248 }
|
|
Definition at line 213 of file fillattr.h. 00218 : 00219 NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}
|
|
Definition at line 22803 of file fillattr.cpp. 22803 { return ATTRVALUE()->AttachBitmap(NewBitmap); }
|
|
Called by someone who has changed something about us that it thinks we should know about. It used by the Attribute manager to make a current attribute validate itself after it has been added to a new object. This functions just calls 'ValidateAttributeValue'.
Definition at line 3129 of file fillattr.cpp. 03130 { 03131 ValidateAttributeValue(); 03132 }
|
|
Blending Bits Reimplemented from NodeAttribute. Definition at line 19810 of file fillattr.cpp. 19811 { 19812 // Check entry param isn't NULL 19813 ERROR3IF(pBlendParam == NULL,"NULL entry param"); 19814 if (pBlendParam == NULL) return FALSE; 19815 19816 // Get the Value member to blend to the Value member of the other NodeAttribute. 19817 // If it succeeds, ask the blended Value to make a NodeAttribute out of itself. 19818 19819 if (GetAttributeValue()->Blend(pBlendParam)) 19820 { 19821 // Get the blended attr val. After this call, the ptr is our reponsibility 19822 // so we have to delete it if it's no longer needed 19823 AttributeValue* pBlendedAttrVal = pBlendParam->GetBlendedAttrVal(); 19824 19825 if (pBlendedAttrVal != NULL) 19826 { 19827 // We have a blended attr val, so ask it to make a NodeAttribute out of itself 19828 // and set the pBlendParam's blended NodeAttribute ptr to it 19829 NodeAttribute* pBlendedAttr = pBlendedAttrVal->MakeNode(); 19830 pBlendParam->SetBlendedAttr(pBlendedAttr); 19831 19832 if (pBlendedAttr != NULL) 19833 { 19834 // We were able to make a blended NodeAttribute 19835 // so delete the blended attr val, and return TRUE 19836 delete pBlendedAttrVal; 19837 return TRUE; 19838 } 19839 else 19840 { 19841 // Couldn't make a blended NodeAttribute, so give the blended attr val back 19842 // and return FALSE 19843 pBlendParam->SetBlendedAttrVal(pBlendedAttrVal); 19844 return FALSE; 19845 } 19846 } 19847 } 19848 19849 return FALSE; 19850 }
|
|
Reimplemented in AttrFlatColourFill, AttrFlatTranspFill, AttrLinearColourFill, AttrLinearTranspFill, AttrRadialColourFill, AttrRadialTranspFill, AttrConicalColourFill, AttrConicalTranspFill, AttrSquareColourFill, AttrSquareTranspFill, AttrThreeColColourFill, AttrThreeColTranspFill, AttrFourColColourFill, AttrFourColTranspFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrTextureColourFill, AttrTextureTranspFill, AttrStrokeColour, and AttrStrokeTransp. Definition at line 375 of file fillattr.h. 00375 { return NULL; }
|
|
Sets the state of a fill blob.
Definition at line 2102 of file fillattr.cpp. 02103 { 02104 #if !defined(EXCLUDE_FROM_RALPH) 02105 02106 // check for a ramp index first - Added by Mike 10/3/97 02107 if (ISA_RAMPINDEX(HitControl)) 02108 { 02109 FillRamp *pRamp = GetFillRamp(); 02110 if (pRamp) 02111 { 02112 RenderControl(HitControl,FALSE); 02113 pRamp->SetSelState(HitControl,state); 02114 RenderControl(HitControl,state); 02115 // TODO: NEED TO DO SOMETHING ABOUT - SetLastRenderedBlob(HitControl); 02116 //SetLastRenderedBlob(HitControl); 02117 } 02118 return; 02119 } 02120 02121 // Can't Select DragPoints 02122 if (HitControl >= FILLCONTROL_DRAGPOINT) 02123 return; 02124 02125 // Secondary Point selection state is a mirror of End Point selection 02126 if (HitControl == FILLCONTROL_SECONDARYPOINT) 02127 HitControl = FILLCONTROL_ENDPOINT; 02128 02129 // Save the current state of the blob 02130 BOOL oldstate = SelectionState[HitControl]; 02131 BOOL newstate = oldstate; 02132 02133 // now alter to the new state 02134 switch (state) 02135 { 02136 case BLOBSTATE_OFF: 02137 newstate = FALSE; 02138 break; 02139 case BLOBSTATE_ON: 02140 newstate = TRUE; 02141 break; 02142 case BLOBSTATE_TOGGLE: 02143 newstate = !oldstate; 02144 break; 02145 } 02146 02147 // has the state changed? 02148 if (oldstate != newstate) 02149 { 02150 // Undraw the old blob 02151 RenderControl(HitControl, FALSE); 02152 SelectionState[HitControl] = newstate; 02153 // Redraw the new blob 02154 RenderControl(HitControl, TRUE); 02155 SetLastRenderedBlob(HitControl); 02156 } 02157 #endif 02158 }
|
|
Changes a fill in some way.
Definition at line 3312 of file fillattr.cpp. 03313 { 03314 AttrFillGeometry* NewFill = NULL; 03315 03316 #if !defined(EXCLUDE_FROM_RALPH) 03317 // Make a copy of this Fill and change the copys' control point colours 03318 NewFill = (AttrFillGeometry*)this->SimpleCopy(); 03319 if (NewFill == NULL) 03320 return NULL; 03321 03322 if (Mutator->MutateFill(NewFill)) 03323 return NewFill; 03324 03325 BOOL Changed = NewFill->ChangeControlColour( (AttrColourChange*)Mutator ); 03326 03327 // Did we change any colours ? 03328 if (!Changed) 03329 { 03330 // Only make it a flat fill if there aren't any other fill controls 03331 // selected anywhere else 03332 if (IsVisible() && SelectionCount > 0) 03333 return NewFill; 03334 03335 // No Control points selected, so make a flat fill instead 03336 delete NewFill; 03337 NewFill = new AttrFlatColourFill; 03338 if (NewFill == NULL) 03339 return NULL; 03340 03341 // and use the mutants colour 03342 *(FillGeometryAttribute*)(NewFill->GetAttributeValue()) = *(FillGeometryAttribute*)(Mutator->GetAttributeValue()); 03343 03344 if (GetApplication()->GetBlobManager()->GetCurrentInterest().Fill && IsVisible()) 03345 RenderFillBlobs(); 03346 } 03347 #endif 03348 03349 // Return the Mutated Fill 03350 return NewFill; 03351 }
|
|
Applies a colour to a specific Fill Control Point.
Reimplemented in AttrLinearFill, and AttrBitmapColourFill. Definition at line 5142 of file fillattr.cpp. 05144 { 05145 // DMc for drag n drops onto fill ramp control points 05146 if (ISA_RAMPINDEX(Cntrl)) 05147 { 05148 // we have a drag and drop onto a ramp control point 05149 if (GetColourRamp()) 05150 { 05151 ColourRamp * pRamp = GetColourRamp(); 05152 05153 return pRamp->SetItemColour(Cntrl, &Col); 05154 } 05155 05156 // treat as a normal ramp point 05157 Cntrl = FILLCONTROL_RAMPPOINT; 05158 } 05159 05160 switch (Cntrl) 05161 { 05162 case FILLCONTROL_STARTPOINT: 05163 SetStartColour(&Col); 05164 break; 05165 05166 case FILLCONTROL_ENDPOINT: 05167 SetEndColour(&Col); 05168 break; 05169 05170 case FILLCONTROL_SECONDARYPOINT: 05171 SetEndColour(&Col); 05172 break; 05173 05174 case FILLCONTROL_ENDPOINT2: 05175 SetEndColour2(&Col); 05176 break; 05177 05178 case FILLCONTROL_ENDPOINT3: 05179 SetEndColour3(&Col); 05180 break; 05181 case FILLCONTROL_RAMPPOINT: 05182 if (pColDrop) 05183 { 05184 CProfileBiasGain DefaultBiasGain; 05185 05186 if (!(GetProfile () == DefaultBiasGain)) 05187 { 05188 // Load and build the question text. 05189 String_256 QueryString(_R(IDS_ASKMULTIREPLACEPROFILE)); 05190 05191 // The only way of bringing up a box with a string in it 05192 Error::SetError(0, QueryString, 0); 05193 INT32 DlgResult = InformMessage(0, _R(IDS_YES), _R(IDS_NO)); 05194 Error::ClearError(); 05195 05196 switch (DlgResult) 05197 { 05198 case 1: // YES 05199 SetProfile (DefaultBiasGain); // we MUST revert to 05200 // the default profile 05201 break; 05202 case 2: // NO 05203 return (FALSE); // break out of this stuff! 05204 } 05205 } 05206 05207 DocCoord DropPoint = pColDrop->GetDropPoint(); 05208 05209 double dRampPoint = FindRampPoint(DropPoint, *GetStartPoint(), 05210 *GetEndPoint()); 05211 05212 // make a new colour ramp (if necessary) 05213 if (GetColourRamp() == NULL) 05214 { 05215 FillGeometryAttribute *pAttrValue = ATTRVALUE(); 05216 if (pAttrValue->SupportsFillRamps()) 05217 { 05218 if (pAttrValue->IS_KIND_OF(GradFillAttribute)) 05219 { 05220 ColourRamp * pRamp = ((GradFillAttribute*)pAttrValue)->MakeNewColourRamp(); 05221 pRamp->AddEntry((float)dRampPoint, &Col); 05222 pRamp->Dump(); 05223 } 05224 } 05225 } 05226 else 05227 { 05228 // find out if the drag hit a ramp point 05229 FillRamp * pRamp = GetColourRamp(); 05230 05231 ColRampItem * pItem = (ColRampItem *)pRamp->GetHead(); 05232 05233 while (pItem) 05234 { 05235 if (pItem->GetPosition() == dRampPoint) 05236 { 05237 // set the colour for the entry 05238 pItem->SetColour(&Col); 05239 break; 05240 } 05241 05242 pItem = (ColRampItem *)pRamp->GetNext(pItem); 05243 } 05244 05245 // it hasn't hit a ramp point so add an entry 05246 if (!pItem) 05247 { 05248 GetColourRamp()->AddEntry((float)dRampPoint, &Col); 05249 GetColourRamp()->Dump(); 05250 } 05251 } 05252 } 05253 break; 05254 default: 05255 SetStartColour(&Col); 05256 break; 05257 } 05258 05259 return TRUE;}
|
|
Applies a colour to selected Fill Control Points.
Reimplemented in AttrFlatFill, AttrBitmapFill, AttrBitmapColourFill, and AttrTextureColourFill. Definition at line 3423 of file fillattr.cpp. 03424 { 03425 #if !defined(EXCLUDE_FROM_RALPH) 03426 if (!GetApplication()->GetBlobManager()->GetCurrentInterest().Fill || !IsVisible()) 03427 return FALSE; 03428 03429 BOOL ColChanged = FALSE; 03430 03431 DocColour NewColour = *ColourAttr->GetStartColour(); 03432 03433 // Is the Start Point Selected ? 03434 if (SelectionState[FILLCONTROL_STARTPOINT] /*&& GetStartColour() != NULL*/) 03435 { 03436 // Set the Start Colour 03437 SetStartColour(&NewColour); 03438 ColChanged = TRUE; 03439 } 03440 03441 // Is the End Point Selected ? 03442 if (SelectionState[FILLCONTROL_ENDPOINT] /*&& GetEndColour() != NULL*/) 03443 { 03444 // Set the End Colour 03445 SetEndColour(&NewColour); 03446 ColChanged = TRUE; 03447 } 03448 03449 // Is the End Point Selected ? 03450 if (SelectionState[FILLCONTROL_ENDPOINT2] /*&& GetEndColour2() != NULL*/) 03451 { 03452 // Set the End Colour 03453 SetEndColour2(&NewColour); 03454 ColChanged = TRUE; 03455 } 03456 03457 // Is End Point 3 Selected ? 03458 if (SelectionState[FILLCONTROL_ENDPOINT3] /*&& GetEndColour3() != NULL*/) 03459 { 03460 // Set the Colour 03461 SetEndColour3(&NewColour); 03462 ColChanged = TRUE; 03463 } 03464 03465 // set any selected colours in the colour ramp? 03466 ColourRamp *pRamp = GetColourRamp(); 03467 if (pRamp) 03468 { 03469 // we have a ramp here so set its colours 03470 if (pRamp->SetSelectedColours(&NewColour)>0) 03471 ColChanged=TRUE; 03472 } 03473 03474 // Tell the caller whether we changed anything or not 03475 return (ColChanged); 03476 #else 03477 return FALSE; 03478 #endif 03479 }
|
|
Applies a colour to selected Fill Control Points.
Reimplemented in AttrFlatFill, AttrBitmapFill, AttrBitmapTranspFill, and AttrTextureTranspFill. Definition at line 3494 of file fillattr.cpp. 03495 { 03496 #if !defined(EXCLUDE_FROM_RALPH) 03497 if (!GetApplication()->GetBlobManager()->GetCurrentInterest().Fill || !IsVisible()) 03498 return FALSE; 03499 03500 if (GetStartTransp() == NULL) 03501 return FALSE; 03502 03503 BOOL TranspChanged = FALSE; 03504 03505 // Get the required new transparency 03506 UINT32 NewTransp = *TranspAttr->GetStartTransp(); 03507 03508 // Is the Start Point Selected ? 03509 if (SelectionState[FILLCONTROL_STARTPOINT]) 03510 { 03511 // Set the Start Transp 03512 SetStartTransp(&NewTransp); 03513 TranspChanged = TRUE; 03514 } 03515 03516 // Is the End Point Selected ? 03517 if (SelectionState[FILLCONTROL_ENDPOINT]) 03518 { 03519 // Set the End Transp 03520 SetEndTransp(&NewTransp); 03521 TranspChanged = TRUE; 03522 } 03523 03524 // Is the End Point Selected ? 03525 if (SelectionState[FILLCONTROL_ENDPOINT2]) 03526 { 03527 // Set the End Transp 03528 SetEndTransp2(&NewTransp); 03529 TranspChanged = TRUE; 03530 } 03531 03532 // Is the End Point Selected ? 03533 if (SelectionState[FILLCONTROL_ENDPOINT3]) 03534 { 03535 // Set the End Transp 03536 SetEndTransp3(&NewTransp); 03537 TranspChanged = TRUE; 03538 } 03539 03540 // set any selected colours in the colour ramp? 03541 TransparencyRamp *pRamp = GetTranspRamp(); 03542 if (pRamp) 03543 { 03544 // we have a ramp here so set its colours 03545 if (pRamp->SetSelectedTransp(NewTransp)>0) 03546 TranspChanged=TRUE; 03547 } 03548 03549 // Tell the caller whether we changed anything or not 03550 return TranspChanged; 03551 #else 03552 return FALSE; 03553 #endif 03554 }
|
|
Changes a fill in some way.
Definition at line 3367 of file fillattr.cpp. 03368 { 03369 AttrFillGeometry* NewFill = NULL; 03370 03371 #if !defined(EXCLUDE_FROM_RALPH) 03372 // Make a copy of this Fill and change the copys' control point colours 03373 NewFill = (AttrFillGeometry*)this->SimpleCopy(); 03374 if (NewFill == NULL) 03375 return NULL; 03376 03377 if (Mutator->MutateFill(NewFill)) 03378 return NewFill; 03379 03380 BOOL Changed = NewFill->ChangeControlTransp( (AttrTranspChange*)Mutator ); 03381 03382 // Did we change any colours ? 03383 if (!Changed) 03384 { 03385 // Only make it a flat fill if there aren't any other fill controls 03386 // selected anywhere else 03387 if (IsVisible() && SelectionCount > 0) 03388 return NewFill; 03389 03390 // No Control points selected, so make a flat fill instead 03391 delete NewFill; 03392 NewFill = new AttrFlatTranspFill; 03393 if (NewFill == NULL) 03394 return NULL; 03395 03396 // and use the mutants colour 03397 *(FillGeometryAttribute*)(NewFill->GetAttributeValue()) = *(FillGeometryAttribute*)(Mutator->GetAttributeValue()); 03398 03399 NewFill->SetTranspType(GetTranspType()); 03400 03401 if (GetApplication()->GetBlobManager()->GetCurrentInterest().Fill && IsVisible()) 03402 RenderFillBlobs(); 03403 } 03404 #endif 03405 03406 // Return the Mutated Fill 03407 return NewFill; 03408 }
|
|
Check to see if an Attribute wants to do something with a click.
Definition at line 383 of file fillattr.cpp. 00387 { 00388 #ifdef STANDALONE 00389 return FALSE; 00390 #else 00391 00392 if ( !(((Camelot.GetBlobManager())->GetCurrentInterest()).Fill) ) 00393 return FALSE; // Don't bother if fills blobs aren't displayed at the mo. 00394 00395 // UINT32 SelCount = AttrFillGeometry::SelectionCount; 00396 LastRenderedStartBlob = DocCoord(0,0); 00397 LastRenderedEndBlob = DocCoord(0,0); 00398 LastRenderedEnd2Blob = DocCoord(0,0); 00399 LastRenderedEnd3Blob = DocCoord(0,0); 00400 00401 if (Click == CLICKTYPE_UP) 00402 { 00403 if (!HitList.IsEmpty()) 00404 { 00405 FillHit = NULL; 00406 ControlHit = FILLCONTROL_NULL; 00407 HitList.DeleteAll(); // Make sure the control hit list is empty 00408 return TRUE; 00409 } 00410 } 00411 00412 if (Click == CLICKTYPE_SINGLE) 00413 { 00414 FillHit = NULL; 00415 ControlHit = FILLCONTROL_NULL; 00416 HitList.DeleteAll(); // Make sure the control hit list is empty 00417 00418 // Find a fill attribute in the selection 00419 CCRuntimeClass* FillType = IsColourMeshVisible() ? CC_RUNTIME_CLASS(AttrFillGeometry) 00420 : CC_RUNTIME_CLASS(AttrTranspFillGeometry); 00421 00422 AttrFillGeometry* pAttr = FindFirstSelectedAttr(FillType); 00423 00424 while (pAttr != NULL) 00425 { 00426 // Ask the Attribute if it wan't to do anything with the click 00427 if ( pAttr->OnClick(PointerPos, Click, ClickMods, pSpread) ) 00428 { 00429 if (FillHit == NULL) 00430 { 00431 FillHit = pAttr; 00432 } 00433 00434 BOOL InList = FALSE; 00435 00436 // We may have already hit this attribute if the selection is 00437 // inside a parent and have common attributes, so we need to 00438 // check and make sure this attribute is NOT in the list 00439 // already. 00440 00441 if (!HitList.IsEmpty()) 00442 { 00443 ListItem* pItem = HitList.GetHead(); 00444 00445 while (pItem) 00446 { 00447 NodeAttributePtrItem* NodePtr = (NodeAttributePtrItem*)pItem; 00448 00449 if (NodePtr->NodeAttribPtr == pAttr) 00450 { 00451 // Ignore this one, we've hit it already 00452 InList = TRUE; 00453 break; 00454 } 00455 00456 pItem = HitList.GetNext(pItem); 00457 } 00458 } 00459 00460 if ( !InList && 00461 IsMeshSame((FillGeometryAttribute*)FillHit->GetAttributeValue(), 00462 (FillGeometryAttribute*)pAttr->GetAttributeValue()) ) 00463 { 00464 NodeAttributePtrItem* NodePtr = new NodeAttributePtrItem; 00465 00466 if (NodePtr != NULL) 00467 { 00468 // Add the Attr to the Hit list 00469 NodePtr->NodeAttribPtr = pAttr; 00470 HitList.AddTail(NodePtr); 00471 } 00472 } 00473 00474 } 00475 00476 // Move onto the next. 00477 pAttr = FindNextSelectedAttr(FillType); 00478 } 00479 00480 // Check to see if anyone has deselected their control points 00481 // (The click may not have hit anyone at all, but they still may 00482 // have deselected their points). 00483 // if (!ClickMods.Adjust && HitList.IsEmpty()) 00484 // { 00485 BROADCAST_TO_ALL(SelChangingMsg(SelChangingMsg::COLOURATTCHANGED)); 00486 // } 00487 00488 // if (!HitList.IsEmpty()) 00489 // return TRUE; 00490 } 00491 00492 if (Click == CLICKTYPE_DOUBLE) // check for multi-stage fill blob insertion .... 00493 { 00494 FillHit = NULL; 00495 ControlHit = FILLCONTROL_NULL; 00496 HitList.DeleteAll(); // Make sure the control hit list is empty 00497 00498 // Find a fill attribute in the selection 00499 CCRuntimeClass* FillType = /*IsColourMeshVisible() ?*/ CC_RUNTIME_CLASS(AttrFillGeometry); 00500 //: CC_RUNTIME_CLASS(AttrTranspFillGeometry); 00501 00502 // Use our own selected attrs iterator because OnClick uses the legacy global iterator 00503 SelectedAttrs selattrs; 00504 AttrFillGeometry* pAttr = (AttrFillGeometry*)selattrs.FindFirst(FillType); 00505 00506 BOOL RetVal = FALSE; 00507 00508 // walk the selection list .... 00509 00510 while (pAttr != NULL) 00511 { 00512 // Ask the Attribute if it wan't to do anything with the click 00513 if ( pAttr->OnClick(PointerPos, Click, ClickMods, pSpread) ) 00514 { 00515 // the actual work has been done in the above function call .... 00516 // BUT we do need to select the new blob .... 00517 // which by camelots marvelousness only seems to work from within the 00518 // fill tool .... (take a look at GradFillTool::OnClick ()) 00519 RetVal = TRUE; 00520 } 00521 00522 // Move onto the next. 00523 pAttr = (AttrFillGeometry*)selattrs.FindNext(FillType); 00524 } 00525 00526 BROADCAST_TO_ALL(SelChangingMsg(SelChangingMsg::COLOURATTCHANGED)); 00527 return (RetVal); 00528 } 00529 00530 if (Click == CLICKTYPE_SINGLE && !HitList.IsEmpty()) 00531 { 00532 // We hit one or more fills, and are about to drag them ... 00533 00534 // Is there a Drag Operation already happening ? 00535 if (Operation::GetCurrentDragOp() == NULL) 00536 { 00537 NodeAttributePtrItem* HitFillPtr = 00538 (NodeAttributePtrItem*)AttrFillGeometry::HitList.GetHead(); 00539 00540 AttrFillGeometry* HitFill = (AttrFillGeometry*)HitFillPtr->NodeAttribPtr; 00541 00542 // Need to do a drag on the selected points, 00543 // so we had better start an operation 00544 OpEditFill* pOpEditFill = new OpEditFill; 00545 if (pOpEditFill == NULL) 00546 { 00547 // Failed to get the memory to do the job 00548 TRACEUSER( "Mike", _T("The Graduated Fill Edit Blob Operation failed to start\n") ); 00549 00550 // Inform the user that we are out of memory 00551 // The error message will be set by new 00552 InformError(); 00553 } 00554 else 00555 { 00556 // check for a click on a fill ramp control point 00557 if (ISA_RAMPINDEX(ControlHit)) 00558 { 00559 // if so, select the point in the fill 00560 if (HitFill->GetColourRamp()) 00561 { 00562 HitFill->GetColourRamp()->DeselectAll(); 00563 HitFill->GetColourRamp()->SetSelState(ControlHit, 1); 00564 } 00565 } 00566 00567 // Go drag that Control Point !! 00568 pOpEditFill->DoDrag(PointerPos, pSpread, HitFill, ControlHit); 00569 } 00570 } 00571 00572 return TRUE; 00573 } 00574 00575 // Don't claim the click 00576 return FALSE; 00577 #endif 00578 }
|
|
Check to see if a click was on a Fill Control Point.
Reimplemented in AttrLinearFill, AttrRadialFill, AttrConicalFill, AttrThreeColFill, AttrFourColFill, AttrBitmapFill, AttrTextureColourFill, and AttrTextureTranspFill. Definition at line 2391 of file fillattr.cpp. 02392 { 02393 // Set up a default, that indicates not control points hit 02394 FillControl HitControl = FILLCONTROL_NULL; 02395 DocRect BlobRect; 02396 02397 if (!GetApplication()->GetBlobManager()->GetCurrentInterest().Fill || !IsVisible()) 02398 return FILLCONTROL_NULL; 02399 02400 // Ok see if we've hit a fill ramp blob. 02401 FillRamp *pRamp = GetFillRamp(); 02402 if (pRamp) 02403 { 02404 // have we hit a blob on the fill ramp? 02405 HitControl = pRamp->HitBlob(ATTRVALUE(), ClickPos); 02406 if (!ISA_RAMPINDEX(HitControl)) 02407 { 02408 HitControl=FILLCONTROL_NULL; 02409 } 02410 else 02411 { 02412 // if we hit a fill ramp blob, then we need to stop others points from grabbing the drag! 02413 return (HitControl); 02414 } 02415 } 02416 02417 // otherwise try the geometry points. 02418 if (GetStartPoint() != NULL) 02419 { 02420 // Get the rectangle around the Start Control Point 02421 (Camelot.GetBlobManager())->GetBlobRect(*GetStartPoint(), &BlobRect); 02422 // See if the Click Position is within the rectangle 02423 if ( BlobRect.ContainsCoord(ClickPos) ) 02424 HitControl = FILLCONTROL_STARTPOINT; 02425 } 02426 02427 if (GetEndPoint() != NULL) 02428 { 02429 // Get the rectangle around the end control point 02430 (Camelot.GetBlobManager())->GetBlobRect(*GetEndPoint(), &BlobRect); 02431 // See if the Click Position is within the rectangle 02432 if ( BlobRect.ContainsCoord(ClickPos) ) 02433 HitControl = FILLCONTROL_ENDPOINT; 02434 } 02435 02436 if (GetEndPoint2() != NULL) 02437 { 02438 // Get the rectangle around the secondary control point 02439 (Camelot.GetBlobManager())->GetBlobRect(*GetEndPoint2(), &BlobRect); 02440 // See if the Click Position is within the rectangle 02441 if ( BlobRect.ContainsCoord(ClickPos) ) 02442 HitControl = FILLCONTROL_SECONDARYPOINT; 02443 } 02444 02445 if (DoCheckOnFillRampMesh) 02446 { 02447 // DMc 02448 if (HitControl == FILLCONTROL_NULL) 02449 { 02450 // check for a hit along the linear fill line 02451 // first, get the line 02452 if (GetStartPoint() != NULL && GetEndPoint() != NULL) 02453 { 02454 // check the bounding rect first 02455 DocCoord StartPoint = *(GetStartPoint()); 02456 DocCoord EndPoint = *(GetEndPoint()); 02457 02458 double d = FindRampPoint(ClickPos, StartPoint, EndPoint); 02459 02460 if ( d > 0 && d < 1.0) 02461 { 02462 HitControl = FILLCONTROL_RAMPPOINT; 02463 } 02464 } 02465 } 02466 } 02467 02468 return HitControl; 02469 }
|
|
Check to see if the mouse moves over a fill control point.
Definition at line 823 of file fillattr.cpp. 00824 { 00825 #if !defined(EXCLUDE_FROM_RALPH) 00826 if ( !(((Camelot.GetBlobManager())->GetCurrentInterest()).Fill) ) 00827 return FALSE; // Don't bother if fills blobs aren't displayed at the mo. 00828 00829 BOOL HitAControl = FALSE; 00830 00831 // Find the first attribute to test 00832 CCRuntimeClass* FillType = IsColourMeshVisible() ? CC_RUNTIME_CLASS(AttrFillGeometry) 00833 : CC_RUNTIME_CLASS(AttrTranspFillGeometry); 00834 00835 AttrFillGeometry* pAttr = FindFirstSelectedAttr(FillType); 00836 while (pAttr != NULL) 00837 { 00838 // See if the current pos is over one of this fills controls 00839 FillControl Hit = pAttr->CheckForControlHit(Pos); 00840 00841 if (Hit != FILLCONTROL_NULL) 00842 { 00843 // We'ew over one of this fills controls ... 00844 // So update the Status according to the controls selection state 00845 // and take into account whether other control are selected 00846 00847 if ( AttrFillGeometry::SelectionCount == 0) 00848 { 00849 // No Control points selected 00850 *Status = _R(IDS_FS_CNTRLPNT_SO); 00851 } 00852 00853 if ( AttrFillGeometry::SelectionCount == 1) 00854 { 00855 // Just One Control point selected .... 00856 if ( pAttr->IsSelected(Hit) ) 00857 { 00858 if (!ISA_RAMPINDEX(Hit)) 00859 { 00860 *Status = _R(IDS_FS_CNTRLPNT_DO); // and it must be this one 00861 } 00862 else 00863 { 00864 *Status = _R(IDS_FS_CNTRLPNTMS_DO); // and it must be this one (multi-stage) 00865 } 00866 } 00867 else 00868 *Status = _R(IDS_FS_CNTRLPNT_SM); // and it's not this one 00869 } 00870 00871 if ( AttrFillGeometry::SelectionCount >= 2) 00872 { 00873 // Many Control points selected ... 00874 if ( pAttr->IsSelected(Hit) ) 00875 *Status = _R(IDS_FS_CNTRLPNT_DM); // and this is one of them 00876 else 00877 *Status = _R(IDS_FS_CNTRLPNT_SM); // and this isn't on of them 00878 } 00879 00880 // Signal that we hit something 00881 HitAControl = TRUE; 00882 break; 00883 } 00884 // Move onto the next attr 00885 pAttr = FindNextSelectedAttr(FillType); 00886 } 00887 00888 // Tell the caller whether we hit anything or not 00889 return HitAControl; 00890 #else 00891 return FALSE; 00892 #endif 00893 }
|
|
BODGE to stop fill meshes eoring each other out. This can be disabled by setting 'DoFillMeshCheck' to '0' in the 'ini' file.
Definition at line 906 of file fillattr.cpp. 00907 { 00908 #if !defined(EXCLUDE_FROM_RALPH) 00909 if (AllowRampRedraw) // don't want to do this in certian cases! 00910 { 00911 // Don't bother if disabled by 'ini' file preference 00912 if (!DoFillMeshCheck) 00913 return FALSE; 00914 00915 // Check to see if the Last Rendered Fill Mesh is the same as this one 00916 if (LastRenderedMesh != NULL && IsMeshSame(LastRenderedMesh, (FillGeometryAttribute*)GetAttributeValue()) ) 00917 { 00918 // Yep, they're the same 00919 return TRUE; 00920 } 00921 else 00922 { 00923 // Not the same, so update the 'Last Rendered AttrValue' pointer 00924 LastRenderedMesh = (FillGeometryAttribute*)GetAttributeValue(); 00925 } 00926 // They're not the same 00927 } 00928 #endif 00929 00930 return FALSE; 00931 }
|
|
Definition at line 22806 of file fillattr.cpp. 22806 { return ATTRVALUE()->CopyBitmap(CopyBitmap); }
|
|
If the attribute contains any DocColours which are indexed then a copy of the indexed colour is made and added to the NodesDoc ColourListComponent.
Reimplemented from NodeAttribute. Definition at line 3023 of file fillattr.cpp. 03024 { 03025 // Ask the base class to copy its data 03026 if (!NodeRenderable::CopyComponentData(SrcDoc, NodesDoc)) 03027 { 03028 return FALSE; // Failed 03029 } 03030 // Get the colour list component 03031 ColourListComponent *pComponent = 03032 (ColourListComponent *) NodesDoc->GetDocComponent(CC_RUNTIME_CLASS(ColourListComponent)); 03033 03034 ENSURE (pComponent != NULL, "Could not find ColourListComponent"); 03035 03036 // Copy across all DocColours 03037 03038 DocColour* pDocCol = GetStartColour (); 03039 if (pDocCol) if (pComponent->CopyColourAcross(pDocCol) == CCCOPY_FAILED) { return (FALSE); } 03040 pDocCol = GetEndColour (); 03041 if (pDocCol) if (pComponent->CopyColourAcross(pDocCol) == CCCOPY_FAILED) { return (FALSE); } 03042 pDocCol = GetEndColour2 (); 03043 if (pDocCol) if (pComponent->CopyColourAcross(pDocCol) == CCCOPY_FAILED) { return (FALSE); } 03044 pDocCol = GetEndColour3 (); 03045 if (pDocCol) if (pComponent->CopyColourAcross(pDocCol) == CCCOPY_FAILED) { return (FALSE); } 03046 03047 ColourRamp *pRamp = GetColourRamp(); 03048 03049 if (pRamp) 03050 { 03051 return (pRamp->CopyComponentData (SrcDoc, NodesDoc)); 03052 } 03053 03054 return (TRUE); 03055 }
|
|
This method copies the node's contents to the node pointed to by NodeCopy.
Definition at line 1303 of file fillattr.cpp. 01304 { 01305 // First call the base class copy function 01306 NodeAttribute::CopyNodeContents( NodeCopy ); 01307 01308 // Copy contents specific to derived class here 01309 NodeCopy->AttrBounds = AttrBounds; 01310 01311 // Copy the selection state 01312 for (INT32 i=0; i < FILLCONTROL_SECONDARYPOINT; i++) 01313 { 01314 NodeCopy->SetBlobState(i, IsSelected(i)); 01315 } 01316 01317 // and finally, copy the Colours and Control Points 01318 NodeCopy->GetAttributeValue()->SimpleCopy(GetAttributeValue()); 01319 01320 return TRUE; 01321 }
|
|
Get the number of Selected Fill Control Points within the selected objects.
Definition at line 1932 of file fillattr.cpp. 01933 { 01934 UINT32 Count = 0; 01935 01936 #if !defined(EXCLUDE_FROM_RALPH) 01937 if (!GetApplication()->GetBlobManager()->GetCurrentInterest().Fill) 01938 return 0; 01939 01940 CCRuntimeClass* FillType = IsColourMeshVisible() ? CC_RUNTIME_CLASS(AttrFillGeometry) 01941 : CC_RUNTIME_CLASS(AttrTranspFillGeometry); 01942 01943 // Find the first Fill Attribute in the current Selection 01944 AttrFillGeometry* pAttr = FindFirstSelectedAttr(FillType); 01945 01946 while (pAttr != NULL) 01947 { 01948 // Count this fill selected control points 01949 // and keep a running total 01950 if (pAttr->IsVisible()) 01951 Count += pAttr->GetSelectionCount(); 01952 01953 // Move on to the next Fill 01954 pAttr = FindNextSelectedAttr(FillType); 01955 } 01956 01957 #endif 01958 // Count = Total number of fill control points 01959 // selected within the current Selection 01960 return Count; 01961 }
|
|
Cycles the selection state of the controls.
Reimplemented in AttrThreeColFill, and AttrFourColFill. Definition at line 2172 of file fillattr.cpp. 02173 { 02174 // have we got some sort of colour ramp? 02175 FillRamp *pRamp = GetFillRamp(); 02176 if (pRamp) 02177 { 02178 // ok, we have a ramp involved, so lets cycle 02179 02180 BOOL StartPointSelected, EndPointSelected; 02181 FillControl Result, OldSelectedBlob; //NewSelectedBlob; 02182 02183 if (Reverse) 02184 { 02185 StartPointSelected = IsSelected (FILLCONTROL_STARTPOINT); 02186 EndPointSelected = IsSelected (FILLCONTROL_ENDPOINT); 02187 02188 Result = pRamp->RotateSelLeft (StartPointSelected, EndPointSelected, OldSelectedBlob); 02189 02190 switch (Result) 02191 { 02192 case FILLCONTROL_STARTPOINT: 02193 if (OldSelectedBlob != FILLCONTROL_NULL) 02194 { 02195 SetBlobState (OldSelectedBlob, TRUE); 02196 pRamp->SetSelState (OldSelectedBlob, FALSE); 02197 } 02198 02199 SetBlobState (Result, TRUE); 02200 break; 02201 case FILLCONTROL_ENDPOINT: 02202 ToggleSelection(FILLCONTROL_STARTPOINT); 02203 SetBlobState (Result, TRUE); 02204 break; 02205 default: 02206 if (ISA_RAMPINDEX (Result)) 02207 { 02208 if (StartPointSelected) { SetBlobState (FILLCONTROL_STARTPOINT, FALSE); } 02209 if (EndPointSelected) { SetBlobState (FILLCONTROL_ENDPOINT, FALSE); } 02210 02211 if (OldSelectedBlob != FILLCONTROL_NULL) 02212 { 02213 SetBlobState (OldSelectedBlob, TRUE); 02214 pRamp->SetSelState (OldSelectedBlob, FALSE); 02215 } 02216 SetBlobState (Result, TRUE); 02217 } 02218 02219 // do nothing - since handled in RotateSelRight 02220 return; 02221 } 02222 } 02223 else 02224 { 02225 StartPointSelected = IsSelected (FILLCONTROL_STARTPOINT); 02226 EndPointSelected = IsSelected (FILLCONTROL_ENDPOINT); 02227 02228 Result = pRamp->RotateSelRight (StartPointSelected, EndPointSelected, OldSelectedBlob); 02229 02230 switch (Result) 02231 { 02232 case FILLCONTROL_STARTPOINT: 02233 ToggleSelection(FILLCONTROL_ENDPOINT); 02234 SetBlobState (Result, TRUE); 02235 break; 02236 case FILLCONTROL_ENDPOINT: 02237 if (OldSelectedBlob != FILLCONTROL_NULL) 02238 { 02239 SetBlobState (OldSelectedBlob, TRUE); 02240 pRamp->SetSelState (OldSelectedBlob, FALSE); 02241 } 02242 02243 SetBlobState (Result, TRUE); 02244 break; 02245 default: 02246 if (ISA_RAMPINDEX (Result)) 02247 { 02248 if (StartPointSelected) { SetBlobState (FILLCONTROL_STARTPOINT, FALSE); } 02249 if (EndPointSelected) { SetBlobState (FILLCONTROL_ENDPOINT, FALSE); } 02250 02251 if (OldSelectedBlob != FILLCONTROL_NULL) 02252 { 02253 SetBlobState (OldSelectedBlob, TRUE); 02254 pRamp->SetSelState (OldSelectedBlob, FALSE); 02255 } 02256 SetBlobState (Result, TRUE); 02257 } 02258 02259 // do nothing - since handled in RotateSelRight 02260 return; 02261 } 02262 } 02263 return; 02264 } 02265 else 02266 { 02267 if (GetSelectionCount() == 1) 02268 { 02269 ToggleSelection(FILLCONTROL_STARTPOINT); 02270 ToggleSelection(FILLCONTROL_ENDPOINT); 02271 } 02272 } 02273 }
|
|
Deselects all of the Fill Control Points for this fill.
Definition at line 2313 of file fillattr.cpp. 02314 { 02315 #if !defined(EXCLUDE_FROM_RALPH) 02316 // Force all our control points to be deselected 02317 ChangeBlobState(FILLCONTROL_STARTPOINT,BLOBSTATE_OFF); 02318 ChangeBlobState(FILLCONTROL_ENDPOINT ,BLOBSTATE_OFF); 02319 ChangeBlobState(FILLCONTROL_ENDPOINT2 ,BLOBSTATE_OFF); 02320 ChangeBlobState(FILLCONTROL_ENDPOINT3 ,BLOBSTATE_OFF); 02321 02322 // And all our colour/transparency ramp control points to. 02323 FillRamp *pRamp = GetFillRamp(); 02324 if (pRamp) 02325 { 02326 UINT32 first,last; 02327 if (pRamp->GetIndexRange(&first,&last)) 02328 { 02329 for (UINT32 i=first; i<=last; i++) 02330 ChangeBlobState(i ,BLOBSTATE_OFF); 02331 } 02332 } 02333 #endif 02334 }
|
|
Deselects all but one of the Fill Control Points.
Definition at line 2347 of file fillattr.cpp. 02348 { 02349 #if !defined(EXCLUDE_FROM_RALPH) 02350 // Secondary Point selection state is a mirror of End Point selection 02351 if (HitControl == FILLCONTROL_SECONDARYPOINT) 02352 HitControl = FILLCONTROL_ENDPOINT; 02353 02354 for (INT32 i=0; i<FILLCONTROL_SECONDARYPOINT; i++) 02355 { 02356 if ((HitControl!=i) && SelectionState[i]) 02357 ChangeBlobState(i,BLOBSTATE_OFF); 02358 } 02359 02360 // And all our colour/transparency ramp control points to. 02361 FillRamp *pRamp = GetFillRamp(); 02362 if (pRamp) 02363 { 02364 UINT32 first,last; 02365 UINT32 hc = (UINT32)HitControl; 02366 if (pRamp->GetIndexRange(&first,&last)) 02367 { 02368 for (UINT32 i=first; i<=last; i++) 02369 if (hc!=i) 02370 ChangeBlobState(i ,BLOBSTATE_OFF); 02371 } 02372 } 02373 02374 #endif 02375 }
|
|
Deselects all of the Fill Control Points for this fill, without redawing anything.
Definition at line 2287 of file fillattr.cpp. 02288 { 02289 #if !defined(EXCLUDE_FROM_RALPH) 02290 // Force all our control points to be deselected 02291 SelectionState[FILLCONTROL_STARTPOINT] = FALSE; 02292 SelectionState[FILLCONTROL_ENDPOINT] = FALSE; 02293 SelectionState[FILLCONTROL_ENDPOINT2] = FALSE; 02294 SelectionState[FILLCONTROL_ENDPOINT3] = FALSE; 02295 SelectionState[FILLCONTROL_SECONDARYPOINT] = FALSE; 02296 // And all our colour ramp control points to. 02297 FillRamp *pRamp = GetFillRamp(); 02298 if (pRamp) 02299 pRamp->DeselectAll(); 02300 #endif 02301 }
|
|
Deselects a particular Fill Control Point.
Definition at line 2060 of file fillattr.cpp. 02061 { 02062 #if !defined(EXCLUDE_FROM_RALPH) 02063 ChangeBlobState(HitControl, BLOBSTATE_OFF); 02064 #endif 02065 }
|
|
Definition at line 22804 of file fillattr.cpp. 22804 { return ATTRVALUE()->DetachBitmap(); }
|
|
Definition at line 239 of file fillattr.h. 00239 { AllowBoundsRedraw = FALSE; }
|
|
Definition at line 233 of file fillattr.h. 00233 { AllowRampRedraw = FALSE; }
|
|
Changes the colour of a fill.
Reimplemented in AttrLinearFill, and AttrConicalFill. Definition at line 5051 of file fillattr.cpp. 05052 { 05053 AttrFillGeometry* NewFill; 05054 DocColour DroppedColour = *ColDrop->GetStartColour(); 05055 05056 // First test to see which colour we should change 05057 FillControl ControlHit = TestColourDrop(ColDrop); 05058 05059 if (ControlHit == FILLCONTROL_NULL) 05060 { 05061 // No Control points hit, so make a flat fill instead 05062 NewFill = new AttrFlatColourFill; 05063 if (NewFill == NULL) 05064 return NULL; 05065 05066 // and use the mutants colour 05067 NewFill->SetStartColour(&DroppedColour); 05068 05069 BOOL InSelection = ColDrop->IsObjectSelected(); 05070 05071 if (InSelection && 05072 GetApplication()->GetBlobManager()->GetCurrentInterest().Fill && 05073 IsVisible() 05074 ) 05075 { 05076 BOOL UniqueFill = TRUE; 05077 05078 AttrFillGeometry* pAttr = FindFirstSelectedAttr(); 05079 while (pAttr != NULL) 05080 { 05081 if (pAttr != this && GetAttributeType() == pAttr->GetAttributeType()) 05082 { 05083 if ( IsMeshSame((FillGeometryAttribute*)GetAttributeValue(), 05084 (FillGeometryAttribute*)pAttr->GetAttributeValue()) ) 05085 { 05086 UniqueFill = FALSE; 05087 break; 05088 } 05089 } 05090 05091 // Move onto the next attr 05092 pAttr = FindNextSelectedAttr(); 05093 } 05094 05095 /* 05096 if (UniqueFill) 05097 RenderFillBlobs(); 05098 */ 05099 } 05100 05101 return NewFill; 05102 } 05103 05104 if (FindParent() && FindParent()->IsCompound()) 05105 { 05106 if (ColDrop->GetObjectDroppedOn() && 05107 !(ColDrop->GetObjectDroppedOn()->IsCompound()) && 05108 ColDrop->IsObjectSelected()) 05109 { 05110 // If we are dropping inside a group, then we'll need to remove 05111 // the blobs if this fill is applied to the whole group 05112 // RenderFillBlobs(); 05113 } 05114 } 05115 05116 // Make a copy of this Fill to change 05117 NewFill = (AttrFillGeometry*)this->SimpleCopy(); 05118 if (NewFill == NULL) 05119 return NULL; 05120 05121 if (!NewFill->ChangeControlColour(DroppedColour, ControlHit, ColDrop)) 05122 { 05123 delete NewFill; 05124 return NULL; 05125 } 05126 05127 // Return the Mutated Fill 05128 return NewFill; 05129 }
|
|
Definition at line 4917 of file fillattr.cpp. 04920 { 04921 #if !defined(EXCLUDE_FROM_RALPH) 04922 ERROR2IF(ColDrop == NULL, FILLCONTROL_NULL, "Null ColourDrop passed to DoColourDropTest"); 04923 04924 DocCoord DropPoint = ColDrop->GetDropPoint(); 04925 04926 FillControl ControlHit = FILLCONTROL_NULL; 04927 04928 if ( (((Camelot.GetBlobManager())->GetCurrentInterest()).Fill) ) 04929 { 04930 BOOL HitAControl = FALSE; 04931 HitList.DeleteAll(); 04932 04933 AttrFillGeometry* pAttrFound = NULL; 04934 04935 // Find the first attribute to test 04936 AttrFillGeometry* pAttr = FindFirstSelectedAttr(); 04937 while (pAttr != NULL) 04938 { 04939 // We're only interested in colour fills 04940 if (pAttr->GetAttributeType() == CC_RUNTIME_CLASS(AttrFillGeometry)) 04941 { 04942 // See if the current pos is over one of this fills controls 04943 FillControl Hit = pAttr->CheckForControlHit(DropPoint); 04944 04945 if (Hit != FILLCONTROL_NULL) 04946 { 04947 // Signal that we hit something 04948 HitAControl = TRUE; 04949 04950 if (pAttrFound == NULL) 04951 { 04952 pAttrFound = pAttr; 04953 ControlHit = Hit; 04954 } 04955 04956 BOOL InList = FALSE; 04957 04958 // We may have already hit this attribute if the selection is 04959 // inside a parent and have common attributes, so we need to 04960 // check and make sure this attribute is NOT in the list 04961 // already. 04962 04963 if (!HitList.IsEmpty()) 04964 { 04965 ListItem* pItem = HitList.GetHead(); 04966 04967 while (pItem) 04968 { 04969 NodeAttributePtrItem* NodePtr = (NodeAttributePtrItem*)pItem; 04970 04971 if (NodePtr->NodeAttribPtr == pAttr) 04972 { 04973 // Ignore this one, we've hit it already 04974 InList = TRUE; 04975 break; 04976 } 04977 04978 pItem = HitList.GetNext(pItem); 04979 } 04980 } 04981 04982 if (!InList) 04983 { 04984 NodeAttributePtrItem* NodePtr = new NodeAttributePtrItem; 04985 04986 if (NodePtr != NULL) 04987 { 04988 // Add the Attr to the Hit list 04989 NodePtr->NodeAttribPtr = pAttr; 04990 HitList.AddTail(NodePtr); 04991 } 04992 } 04993 } 04994 } 04995 04996 // Move onto the next attr 04997 pAttr = FindNextSelectedAttr(); 04998 } 04999 05000 if (HitAControl) 05001 { 05002 // We've hit something !! 05003 if (FillAttr != NULL) 05004 *FillAttr = pAttrFound; 05005 05006 if (Object != NULL) 05007 *Object = (NodeRenderableInk*)pAttrFound->FindParent(); 05008 05009 return ControlHit; 05010 } 05011 } 05012 05013 if (*Object == NULL) 05014 { 05015 return FILLCONTROL_NULL; 05016 } 05017 05018 // An object has been specified 05019 Node* pParent = (Node*)*Object; 05020 ColDrop->SetObjectDroppedOn(*Object); 05021 05022 DocRect ParentBounds = ((NodeRenderableBounded*)*Object)->GetBoundingRect(); 05023 05024 AttribMap.RemoveAll(); 05025 BOOL FoundAttrs = ((NodeRenderableInk*)pParent)->FindAppliedAttributes(&AttribMap); 05026 if (FoundAttrs) 05027 { 05028 void *pAttr; 05029 if( AttribMap.Lookup( CC_RUNTIME_CLASS(AttrFillGeometry), pAttr ) ) 05030 { 05031 // Wahay !! We've got one !! 05032 ControlHit = ((AttrFillGeometry*)pAttr)->TestColourDrop(ColDrop); 05033 return ControlHit; 05034 } 05035 } 05036 #endif 05037 return FILLCONTROL_NULL; 05038 }
|
|
Draws the blobs on the ends of the fill arrows.
Reimplemented in AttrBitmapFill. Definition at line 6451 of file fillattr.cpp.
|
|
Applies a ramp change to this fill. See the class AttrColFillRampChange for all the documentation on this.
Definition at line 3570 of file fillattr.cpp. 03571 { 03572 #if !defined(EXCLUDE_FROM_RALPH) 03573 // ok we've been called to alter the fill ramp in this attribute 03574 // there are three things we can do 03575 if (pRampAttr==NULL) 03576 return FALSE; 03577 03578 BOOL Changed = FALSE; 03579 ColourRamp *pCRamp; 03580 03581 switch (pRampAttr->GetAction()) 03582 { 03583 case ACT_DONOTHING: 03584 // well lets do nothing then. Aw go on we've gotta do something! 03585 ERROR3("Someone's forgotten to set the edit action of the RampChange attr"); 03586 break; 03587 03588 case ACT_CREATENEWCOL: 03589 { 03590 pCRamp = GetColourRamp(); 03591 if (!pCRamp) 03592 { 03593 FillGeometryAttribute *pAttrValue = ATTRVALUE(); 03594 if (pAttrValue->SupportsFillRamps()) 03595 { 03596 if (pAttrValue->IS_KIND_OF(GradFillAttribute)) 03597 { 03598 pCRamp = ((GradFillAttribute*)pAttrValue)->MakeNewColourRamp(); 03599 } 03600 } 03601 } 03602 03603 if (pCRamp) 03604 { 03605 ColRampItem *pItem; 03606 pItem = pCRamp->AddEntry(pRampAttr->GetPosition(), pRampAttr->GetStartColour()); 03607 Changed=(pItem!=NULL); 03608 } 03609 } 03610 break; 03611 03612 case ACT_EDITCOLOFITEM: 03613 pCRamp = GetColourRamp(); 03614 if (pCRamp) 03615 { 03616 Changed = pCRamp->SetItemColour(pRampAttr->GetIndex(), pRampAttr->GetStartColour()); 03617 } 03618 break; 03619 03620 case ACT_EDITCOLOFSELECTED: 03621 pCRamp = GetColourRamp(); 03622 if (pCRamp) 03623 { 03624 Changed = (pCRamp->SetSelectedColours(pRampAttr->GetStartColour()))>0; 03625 Changed=TRUE; 03626 } 03627 break; 03628 03629 default: 03630 ERROR3("Unknown action found during AttrFillGeometry::EditColFillRamp"); 03631 break; 03632 } 03633 03634 return Changed; 03635 #else 03636 return FALSE; 03637 #endif 03638 }
|
|
Applies a ramp change to this fill. See the class AttrTranspFillRampChange for all the documentation on this.
Definition at line 3655 of file fillattr.cpp. 03656 { 03657 #if !defined(EXCLUDE_FROM_RALPH) 03658 // ok we've been called to alter the fill ramp in this attribute 03659 // there are three things we can do 03660 if (pRampAttr==NULL) 03661 return FALSE; 03662 03663 BOOL Changed = FALSE; 03664 TransparencyRamp *pTRamp; 03665 03666 UINT32 t, *pt = pRampAttr->GetStartTransp(); 03667 t = ((pt!=NULL) ? (*pt) : 128); 03668 03669 switch (pRampAttr->GetAction()) 03670 { 03671 case ACT_DONOTHING: 03672 // well lets do nothing then. Aw go on we've gotta do something! 03673 ERROR3("Someone's forgotten to set the edit action of the RampChange attr"); 03674 break; 03675 03676 case ACT_CREATENEWTRANSP: 03677 { 03678 pTRamp = GetTranspRamp(); 03679 if (!pTRamp) 03680 { 03681 FillGeometryAttribute *pAttrValue = ATTRVALUE(); 03682 if (pAttrValue->SupportsFillRamps()) 03683 { 03684 if (pAttrValue->IS_KIND_OF(GradTranspFillAttribute)) 03685 { 03686 pTRamp = ((GradTranspFillAttribute*)pAttrValue)->MakeNewTranspRamp(); 03687 } 03688 } 03689 } 03690 if (pTRamp) 03691 { 03692 TranspRampItem *pItem; 03693 pItem = pTRamp->AddEntry(pRampAttr->GetPosition(), t); 03694 Changed=(pItem!=NULL); 03695 } 03696 } 03697 break; 03698 03699 case ACT_EDITTRANSPOFITEM: 03700 pTRamp = GetTranspRamp(); 03701 if (pTRamp) 03702 { 03703 Changed = pTRamp->SetItemTransp(pRampAttr->GetIndex(), t); 03704 } 03705 break; 03706 03707 case ACT_EDITTRANSPOFSELECTED: 03708 pTRamp = GetTranspRamp(); 03709 if (pTRamp) 03710 { 03711 Changed = (pTRamp->SetSelectedTransp(t))>0; 03712 } 03713 break; 03714 03715 default: 03716 ERROR3("Unknown action found during AttrFillGeometry::EditTranspFillRamp"); 03717 break; 03718 } 03719 03720 return Changed; 03721 #else 03722 return FALSE; 03723 #endif 03724 }
|
|
Definition at line 240 of file fillattr.h. 00240 { AllowBoundsRedraw = TRUE; }
|
|
Definition at line 234 of file fillattr.h. 00234 { AllowRampRedraw = TRUE; }
|
|
See base class.
Reimplemented from NodeAttribute. Definition at line 3738 of file fillattr.cpp. 03739 { 03740 #if !defined(EXCLUDE_FROM_RALPH) 03741 // Work out which colour to return. 03742 03743 DocColour * pColour = NULL; 03744 03745 switch (Context) 03746 { 03747 case 0: 03748 pColour = GetStartColour(); 03749 break; 03750 03751 case 1: 03752 pColour = GetEndColour(); 03753 break; 03754 03755 case 2: 03756 pColour = GetEndColour2(); 03757 break; 03758 03759 case 3: 03760 pColour = GetEndColour3(); 03761 break; 03762 } 03763 03764 if (pColour) 03765 { 03766 // was a valid index - just return the pointer to the colour 03767 return (pColour); 03768 } 03769 else 03770 { 03771 // it was out of range, but we still need to check the fillramp .... 03772 03773 ColourRamp *pRamp = GetColourRamp(); 03774 03775 INT32 adjuster = 0; // we need to adjust the offset into the fillramp 03776 03777 // the following four lines of code always get the correct (zero-based) index .... 03778 if (GetStartColour()) { adjuster++; } 03779 if (GetEndColour()) { adjuster++; } 03780 if (GetEndColour2()) { adjuster++; } 03781 if (GetEndColour3()) { adjuster++; } 03782 03783 if (pRamp) 03784 { 03785 // nab it from the ramp .... 03786 return (pRamp->EnumerateColourFields(Context-adjuster)); 03787 } 03788 // um, drop through and return NULL 03789 } 03790 03791 #endif 03792 // No more colours. 03793 return NULL; 03794 }
|
|
Perform an extend operation on this fill node.
Reimplemented from Node. Reimplemented in AttrBitmapFill. Definition at line 19920 of file fillattr.cpp. 19921 { 19922 // quit immediately if we are not a graduated fill. 19923 if (!IsAGradFill()) 19924 return; 19925 19926 // we only need to do the extend operation, as whatever we're applied to 19927 // takes care of translating/stretching us. 19928 Node* pParent = FindParent(); 19929 if (pParent != NULL) 19930 if (pParent->IsNodePath() || pParent->IsCompound()) 19931 TransformTranslateObject(ExtParams); 19932 }
|
|
Definition at line 968 of file fillattr.cpp. 00969 { 00970 return SelectionCount; 00971 }
|
|
Reimplemented from NodeRenderable. Definition at line 449 of file fillattr.h. 00449 { return *GetStartPoint(); }
|
|
Scans the selection for fill attributes.
Definition at line 1397 of file fillattr.cpp. 01398 { 01399 NodeAttribute* pAttr = s_SelAttrs.FindFirst(AttrType); 01400 if (pAttr && pAttr->IsAFillAttr()) 01401 return (AttrFillGeometry*) pAttr; 01402 return NULL; 01403 }
|
|
Scans the selection for fill attributes.
Definition at line 1418 of file fillattr.cpp. 01419 { 01420 NodeAttribute* pAttr = s_SelAttrs.FindNext(AttrType); 01421 if (pAttr && pAttr->IsAFillAttr()) 01422 return (AttrFillGeometry*) pAttr; 01423 return NULL; 01424 }
|
|
Called.
Reimplemented in AttrConicalFill. Definition at line 1081 of file fillattr.cpp. 01082 { 01083 DocCoord ClickPos = dc; 01084 01085 DocRect dr(StartPoint.x, StartPoint.y, StartPoint.x, StartPoint.y); 01086 01087 if (dr.lo.x > EndPoint.x) 01088 { 01089 dr.lo.x = EndPoint.x; 01090 } 01091 01092 if (dr.lo.y > EndPoint.y) 01093 { 01094 dr.lo.y = EndPoint.y; 01095 } 01096 01097 if (dr.hi.x < EndPoint.x) 01098 { 01099 dr.hi.x = EndPoint.x; 01100 } 01101 01102 if (dr.hi.y < EndPoint.y) 01103 { 01104 dr.hi.y = EndPoint.y; 01105 } 01106 01107 // get the blob size 01108 double dBlobSize = (double)(Camelot.GetBlobManager())->GetBlobSize(); 01109 01110 if (dr.Width() < (INT32)(dBlobSize * 2)) 01111 { 01112 // add half a point to the hit test area 01113 dr.hi.x += (INT32)(dBlobSize * 2); 01114 dr.lo.x -= (INT32)(dBlobSize * 2); 01115 } 01116 01117 if (dr.Height() < (INT32)(dBlobSize * 2)) 01118 { 01119 dr.hi.y += (INT32)(dBlobSize * 2); 01120 dr.lo.y -= (INT32)(dBlobSize * 2); 01121 } 01122 01123 if (dr.ContainsCoord(ClickPos)) 01124 { 01125 // find out if the pointer is on the line (or near it) by 01126 // calculating the perpendicular distance between the 01127 // point and the line 01128 double p = 0; 01129 01130 double dPosX = ClickPos.x; 01131 double dPosY = ClickPos.y; 01132 01133 double dX1 = StartPoint.x; 01134 double dY1 = StartPoint.y; 01135 01136 double dX2 = EndPoint.x; 01137 double dY2 = EndPoint.y; 01138 01139 double dTestPosY = 0; 01140 double dTestPosX = 0; 01141 01142 if (fabs(dX2 - dX1) > fabs(dY2 - dY1)) 01143 { 01144 if (dX2 != dX1) 01145 { 01146 p = (dPosX - dX1) / (dX2 - dX1); 01147 01148 dTestPosY = ((dY2 - dY1) * p) + dY1; 01149 01150 // do the hit test on the line 01151 if (fabs(dTestPosY - dPosY) < dBlobSize / 2) 01152 { 01153 return p; 01154 } 01155 } 01156 } 01157 else if (dY2 != dY1) 01158 { 01159 p = (dPosY - dY1) / (dY2 - dY1); 01160 01161 dTestPosX = ((dX2 - dX1) * p) + dX1; 01162 01163 // do the hit test on the line 01164 if (fabs(dTestPosX - dPosX) < dBlobSize / 2) 01165 { 01166 return p; 01167 } 01168 } 01169 } 01170 01171 return -1; 01172 }
|
|
|
Definition at line 22805 of file fillattr.cpp. 22805 { return ATTRVALUE()->GetBitmap(); }
|
|
Definition at line 22808 of file fillattr.cpp. 22808 { return ATTRVALUE()->GetBitmapRef(); }
|
|
Calculates the bounding rectangle of the attrs blobs.This should always be calculated on the fly as the view scale can change without the attr knowing, giving an incorrect result.
Reimplemented from NodeRenderable. Reimplemented in AttrFlatFill, AttrRadialFill, AttrConicalFill, AttrSquareFill, AttrThreeColFill, AttrFourColFill, AttrBitmapFill, AttrStrokeColour, and AttrStrokeTransp. Definition at line 3070 of file fillattr.cpp. 03071 { 03072 #if !defined(EXCLUDE_FROM_RALPH) 03073 // Optimisation. If there is currently no interest in Fill Blobs 03074 // and this fill is not being Dragged (Fill blobs are turned off during 03075 // a fill drag), then we needn't bother doing anything. 03076 if ( (!GetApplication()->GetBlobManager()->GetCurrentInterest(TRUE).Fill || !IsVisible()) && DraggedFill != this ) 03077 return DocRect(0,0, 0,0); 03078 03079 DocCoord StartPoint = DocCoord(0,0); 03080 DocCoord EndPoint = DocCoord(0,0); 03081 03082 // Get the Start and End Points 03083 if (GetStartPoint() != NULL) 03084 StartPoint = *GetStartPoint(); 03085 if (GetEndPoint() != NULL) 03086 EndPoint = *GetEndPoint(); 03087 03088 DocRect StartBlobRect; 03089 DocRect EndBlobRect; 03090 // Make a dummy bounds from just the Start Point 03091 DocRect BoundingRect(StartPoint, StartPoint); 03092 03093 // Get the Bounding rect of Blobs on each of the ends 03094 (Camelot.GetBlobManager())->GetBlobRect(StartPoint, &StartBlobRect); 03095 (Camelot.GetBlobManager())->GetBlobRect(EndPoint, &EndBlobRect); 03096 03097 // Now include the Bottom Left and Top Right of each blob in the Bounds. 03098 // We have to do it like this to make sure that the DocRect's coords 03099 // are valid. ie. The Hi's are Higher than the Lo's. 03100 BoundingRect.IncludePoint(StartBlobRect.lo); 03101 BoundingRect.IncludePoint(StartBlobRect.hi); 03102 BoundingRect.IncludePoint(EndBlobRect.lo); 03103 BoundingRect.IncludePoint(EndBlobRect.hi); 03104 03105 IncludeArrowHead(&BoundingRect, StartPoint, EndPoint); 03106 03107 // and return it 03108 return BoundingRect; 03109 #else 03110 return DocRect(0,0, 0,0); 03111 #endif 03112 }
|
|
Return the number of editable points in this fill geometry.
Definition at line 1693 of file fillattr.cpp. 01694 { 01695 UINT32 count=5; 01696 if (IncludeRamps) 01697 { 01698 FillRamp *pRamp = GetFillRamp(); 01699 if (pRamp) 01700 count+=pRamp->GetCount(); 01701 } 01702 return count; 01703 }
|
|
Definition at line 330 of file fillattr.h. 00330 { return AttrBounds; }
|
|
Definition at line 22813 of file fillattr.cpp. 22813 { return ATTRVALUE()->GetColourRamp(); }
|
|
Get the positions of fill control points.
Definition at line 2758 of file fillattr.cpp. 02759 { 02760 #if !defined(EXCLUDE_FROM_RALPH) 02761 // Make sure nobodys being silly 02762 if (NumControls > NUMCONTROLPOINTS) 02763 NumControls = NUMCONTROLPOINTS; 02764 02765 // Make a tempory copy of the points positions 02766 DocCoord Controls[NUMCONTROLPOINTS]; 02767 02768 if (GetStartPoint() != NULL) 02769 Controls[FILLCONTROL_STARTPOINT] = *GetStartPoint(); 02770 if (GetEndPoint() != NULL) 02771 Controls[FILLCONTROL_ENDPOINT] = *GetEndPoint(); 02772 if (GetEndPoint2() != NULL) 02773 Controls[FILLCONTROL_SECONDARYPOINT] = *GetEndPoint2(); 02774 if (GetEndPoint2() != NULL) 02775 Controls[FILLCONTROL_ENDPOINT2] = *GetEndPoint2(); 02776 if (GetEndPoint3() != NULL) 02777 Controls[FILLCONTROL_ENDPOINT3] = *GetEndPoint3(); 02778 02779 // Copy the positions into the callers array 02780 for (INT32 i=0; i < NumControls; i++) 02781 { 02782 PointArray[i] = Controls [i]; 02783 } 02784 #endif 02785 }
|
|
Reimplemented in AttrBitmapDpiChange. Definition at line 22779 of file fillattr.cpp. 22779 { return ATTRVALUE()->GetDPI(); }
|
|
Definition at line 22751 of file fillattr.cpp. 22751 { return ATTRVALUE()->GetEndColour(); }
|
|
Definition at line 22752 of file fillattr.cpp. 22752 { return ATTRVALUE()->GetEndColour2(); }
|
|
Definition at line 22753 of file fillattr.cpp. 22753 { return ATTRVALUE()->GetEndColour3(); }
|
|
Definition at line 22759 of file fillattr.cpp. 22759 { return ATTRVALUE()->GetEndPoint(); }
|
|
Definition at line 22760 of file fillattr.cpp. 22760 { return ATTRVALUE()->GetEndPoint2(); }
|
|
Definition at line 22761 of file fillattr.cpp. 22761 { return ATTRVALUE()->GetEndPoint3(); }
|
|
Definition at line 22755 of file fillattr.cpp. 22755 { return ATTRVALUE()->GetEndTransp(); }
|
|
Definition at line 22756 of file fillattr.cpp. 22756 { return ATTRVALUE()->GetEndTransp2(); }
|
|
Definition at line 22757 of file fillattr.cpp. 22757 { return ATTRVALUE()->GetEndTransp3(); }
|
|
Return the fill ramp associated with this fill geometry. Currently this ramp can be either a colour ramp or a transparency ramp. Other ramps might well be added at a later time.
Definition at line 1735 of file fillattr.cpp. 01736 { 01737 FillRamp* pRamp = GetColourRamp(); 01738 if (!pRamp) pRamp = GetTranspRamp(); 01739 return pRamp; 01740 }
|
|
Get the colour associated with the first selected endpoint. This function tends to be used with GetSelectionCount once you've worked out there's only one end point selected. At least I use it mostly that way.
Definition at line 1757 of file fillattr.cpp. 01758 { 01759 // Don't bother checking for FILLCONTROL_SECONDARYPOINT as this can never 01760 // be selected. 01761 if (IsSelected(FILLCONTROL_STARTPOINT)) return GetStartColour(); 01762 if (IsSelected(FILLCONTROL_ENDPOINT)) return GetEndColour(); 01763 if (IsSelected(FILLCONTROL_ENDPOINT2)) return GetEndColour2(); 01764 if (IsSelected(FILLCONTROL_ENDPOINT3)) return GetEndColour3(); 01765 01766 // ok is there a colour ramp in this fill? If so check it too. 01767 ColourRamp *pRamp = GetColourRamp(); 01768 if (pRamp) 01769 return pRamp->GetFirstSelectedColour(); 01770 01771 // nothing selected here 01772 return NULL; 01773 }
|
|
Find the index of the first selected endpoint. If nothing is selected -1 will be returned otherwise a number 0..n-1.
Definition at line 1824 of file fillattr.cpp. 01825 { 01826 // is there a selected blob internal to the geometry? 01827 for (INT32 i=0; i<FILLCONTROL_SECONDARYPOINT; i++) 01828 { 01829 if (IsSelected(i)) 01830 return i; 01831 } 01832 01833 // note, all fill geometries either contain a colour ramp 01834 // or a transparency ramp, but not both! 01835 FillRamp *pRamp = GetFillRamp(); 01836 if (pRamp) 01837 return pRamp->GetSelectedIndex(); 01838 01839 // nothing selected 01840 return -1; 01841 }
|
|
Get the transparency associated with the first selected endpoint. This function tends to be used with GetSelectionCount once you've worked out there's only one end point selected. At least I use it mostly that way.
Definition at line 1792 of file fillattr.cpp. 01793 { 01794 if (IsSelected(FILLCONTROL_STARTPOINT)) return GetStartTransp(); 01795 if (IsSelected(FILLCONTROL_ENDPOINT)) return GetEndTransp(); 01796 if (IsSelected(FILLCONTROL_ENDPOINT2)) return GetEndTransp2(); 01797 if (IsSelected(FILLCONTROL_ENDPOINT3)) return GetEndTransp3(); 01798 01799 // ok is there a colour ramp in this fill? If so check it too. 01800 TransparencyRamp *pRamp = GetTranspRamp(); 01801 if (pRamp) 01802 return pRamp->GetFirstSelectedTransp(); 01803 01804 // nothing selected here 01805 return NULL; 01806 }
|
|
Definition at line 22781 of file fillattr.cpp. 22781 { return ATTRVALUE()->GetFractalDim(); }
|
|
Definition at line 22780 of file fillattr.cpp. 22780 { return ATTRVALUE()->GetFractalDPI(); }
|
|
Definition at line 22783 of file fillattr.cpp. 22783 { return ATTRVALUE()->GetGraininess(); }
|
|
Definition at line 22784 of file fillattr.cpp. 22784 { return ATTRVALUE()->GetGravity(); }
|
|
Definition at line 22787 of file fillattr.cpp. 22787 { return ATTRVALUE()->GetNoiseScale(); }
|
|
Reimplemented in AttrLinearFill, AttrRadialFill, AttrConicalFill, AttrSquareFill, AttrThreeColFill, AttrFourColFill, and AttrBitmapFill. Definition at line 457 of file fillattr.h.
|
|
Definition at line 22762 of file fillattr.cpp. 22762 { return ATTRVALUE()->GetProfile (); }
|
|
Reimplemented in AttrRadialFill. Definition at line 320 of file fillattr.h.
|
|
Definition at line 22782 of file fillattr.cpp. 22782 { return ATTRVALUE()->GetSeed(); }
|
|
Get the number of Selected Fill Control Points.
Definition at line 1979 of file fillattr.cpp. 01980 { 01981 UINT32 Count = 0; 01982 #if !defined(EXCLUDE_FROM_RALPH) 01983 // Go though each control point, and increament 01984 // a count if the point is selected. 01985 for (INT32 i=0; i < FILLCONTROL_SECONDARYPOINT; i++) 01986 { 01987 if (IsSelected(i)) Count++; 01988 } 01989 01990 // add in selected blobs on any colour ramp or transparency ramp 01991 FillRamp *pRamp = GetFillRamp(); 01992 if (pRamp) 01993 Count += pRamp->CountSelBlobs(); 01994 01995 #endif 01996 // Number of Selected Fill Control Points 01997 return Count; 01998 }
|
|
Get the current Selection state of the Fill Control Points.
Definition at line 1644 of file fillattr.cpp. 01645 { 01646 // check the output pointer 01647 if (pOutputState==NULL) 01648 return 0; 01649 01650 // assign an output parameter 01651 (*pOutputState=NULL); 01652 01653 // get the total number if blobs in this fill 01654 UINT32 Count = GetBlobCount(); 01655 if (Count==0) 01656 return 0; 01657 01658 // allocate ourselves an array to hold the data. 01659 BOOL* pArray = (BOOL*)malloc(Count*sizeof(BOOL)); 01660 if (pArray==NULL) 01661 return 0; 01662 01663 // Obtain the selection state of each control point 01664 INT32 i; 01665 for( i = 0; i<5; i++) 01666 { 01667 pArray[i] = IsSelected(i); 01668 } 01669 01670 // obtain the selection state of each fill ramp blob 01671 FillRamp *pRamp = GetFillRamp(); 01672 if (pRamp) 01673 pRamp->GetSelectionState(&pArray[i]); 01674 01675 // assign the output 01676 (*pOutputState = pArray); 01677 return Count; 01678 }
|
|
Definition at line 22785 of file fillattr.cpp. 22785 { return ATTRVALUE()->GetSquash(); }
|
|
Definition at line 22750 of file fillattr.cpp. 22750 { return ATTRVALUE()->GetStartColour(); }
|
|
Definition at line 22758 of file fillattr.cpp. 22758 { return ATTRVALUE()->GetStartPoint(); }
|
|
Definition at line 22754 of file fillattr.cpp. 22754 { return ATTRVALUE()->GetStartTransp(); }
|
|
Definition at line 22810 of file fillattr.cpp. 22810 { return ATTRVALUE()->GetTesselation(); }
|
|
Definition at line 22786 of file fillattr.cpp. 22786 { return ATTRVALUE()->GetTileable(); }
|
|
Definition at line 22814 of file fillattr.cpp. 22814 { return ATTRVALUE()->GetTranspRamp(); }
|
|
Definition at line 22778 of file fillattr.cpp. 22778 { return ATTRVALUE()->GetTranspType(); }
|
|
Intialise the fill geometry editing operations.
Reimplemented from SimpleCCObject. Definition at line 317 of file fillattr.cpp. 00318 { 00319 #ifdef STANDALONE 00320 BOOL ok = TRUE; 00321 #else 00322 // Initialise our fill Creation and Editing Operations 00323 BOOL ok = ( OpCreateFill::Init() && OpEditFill::Init() ); 00324 #endif 00325 00326 #if !defined(EXCLUDE_FROM_RALPH) 00327 // Declare out 'Bodge' preference that enables or disables the checking for 00328 // duplicate fill mesh rendering 00329 if (Camelot.DeclareSection(_T("DebugFlags"), 1)) 00330 { 00331 Camelot.DeclarePref( NULL, _T("DoFillMeshCheck"), 00332 &DoFillMeshCheck, FALSE, TRUE ); 00333 } 00334 00335 if (Camelot.DeclareSection(_T("Attributes"), 6)) 00336 { 00337 Camelot.DeclarePref(NULL, _T("FractalDPI"), (UINT32*)&FractalDPI); 00338 Camelot.DeclarePref(NULL, _T("MaxFractalSize"), (UINT32*)&MaxFractalSize); 00339 Camelot.DeclarePref(NULL, _T("FractalSeed"), (UINT32*)&FractalSeed); 00340 Camelot.DeclarePref(NULL, _T("FractalGraininess"), &FractalGraininess); 00341 Camelot.DeclarePref(NULL, _T("FractalGravity"), &FractalGravity); 00342 Camelot.DeclarePref(NULL, _T("GroupTransparency"), &s_bGroupTransparency); 00343 } 00344 #endif 00345 00346 #ifndef STANDALONE 00347 if (Camelot.DeclareSection( _T("Dragging"), 3)) 00348 { 00349 Camelot.DeclarePref(NULL, _T("InteractiveFillEditing"), &OpEditFill::InteractiveDragUpdate); 00350 Camelot.DeclarePref(NULL, _T("ContinuousFillControlUpdate"), &OpEditFill::ContinuousEOR); 00351 Camelot.DeclarePref(NULL, _T("DelayBeforeFillUpdate"), (UINT32*)&OpEditFill::IdleFillDelay); 00352 } 00353 #endif 00354 00355 return ok; 00356 }
|
|
Reimplemented from Node. Definition at line 394 of file fillattr.h. 00394 { return TRUE; }
|
|
Reimplemented in AttrRadialColourFill. Definition at line 405 of file fillattr.h. 00405 { return FALSE;}
|
|
Definition at line 1032 of file fillattr.cpp. 01033 { 01034 #if !defined(EXCLUDE_FROM_RALPH) 01035 switch (Control) 01036 { 01037 case FILLCONTROL_STARTPOINT: 01038 if (GetStartPoint() != NULL) 01039 return (LastRenderedStartBlob == *GetStartPoint()); 01040 break; 01041 01042 case FILLCONTROL_ENDPOINT: 01043 if (GetEndPoint() != NULL) 01044 return (LastRenderedEndBlob == *GetEndPoint()); 01045 break; 01046 01047 case FILLCONTROL_SECONDARYPOINT: 01048 case FILLCONTROL_ENDPOINT2: 01049 if (GetEndPoint2() != NULL) 01050 return (LastRenderedEnd2Blob == *GetEndPoint2()); 01051 break; 01052 01053 case FILLCONTROL_ENDPOINT3: 01054 if ((GetStartPoint() != NULL) && 01055 (GetEndPoint() != NULL) && 01056 (GetEndPoint2() != NULL)) 01057 { 01058 DocCoord EndPoint3 = *GetEndPoint2() + *GetEndPoint() - *GetStartPoint(); 01059 return (LastRenderedEnd3Blob == EndPoint3); 01060 } 01061 } 01062 #endif 01063 return FALSE; 01064 }
|
|
Definition at line 991 of file fillattr.cpp. 00992 { 00993 // if (FindParent() != NULL && !(FindParent()->IsSelected())) 00994 // return FALSE; 00995 00996 return !TranspMeshesVisible; 00997 }
|
|
Check to see if a fill is being edited, so we can decide whether to render the fill mesh or not.
Definition at line 779 of file fillattr.cpp. 00780 { 00781 #if !defined(EXCLUDE_FROM_RALPH) 00782 if (EditedFill == this) 00783 { 00784 return TRUE; 00785 } 00786 00787 if (EditedFill != NULL && OpEditFill::CreateFill) 00788 { 00789 return TRUE; 00790 } 00791 00792 if (EditedFill == NULL || HitList.IsEmpty()) 00793 { 00794 return FALSE; 00795 } 00796 00797 NodeAttributePtrItem* HitFillPtr = (NodeAttributePtrItem*)AttrFillGeometry::HitList.GetHead(); 00798 00799 while (HitFillPtr != NULL) 00800 { 00801 if (HitFillPtr->NodeAttribPtr == this) 00802 { 00803 return TRUE; 00804 } 00805 00806 HitFillPtr = (NodeAttributePtrItem*)AttrFillGeometry::HitList.GetNext(HitFillPtr); 00807 } 00808 #endif 00809 return FALSE; 00810 }
|
|
Definition at line 933 of file fillattr.cpp. 00934 { 00935 #if !defined(EXCLUDE_FROM_RALPH) 00936 BOOL PointsAreSame = FALSE; 00937 00938 if (Fill1->GetStartPoint() != NULL && Fill2->GetStartPoint() != NULL) 00939 { 00940 if (*Fill1->GetStartPoint() != *Fill2->GetStartPoint()) 00941 return FALSE; 00942 00943 PointsAreSame = TRUE; 00944 } 00945 00946 if (Fill1->GetEndPoint() != NULL && Fill2->GetEndPoint() != NULL) 00947 { 00948 if (*Fill1->GetEndPoint() != *Fill2->GetEndPoint()) 00949 return FALSE; 00950 00951 PointsAreSame = TRUE; 00952 } 00953 00954 if (Fill1->GetEndPoint2() != NULL && Fill2->GetEndPoint2() != NULL) 00955 { 00956 if (*Fill1->GetEndPoint2() != *Fill2->GetEndPoint2()) 00957 return FALSE; 00958 00959 PointsAreSame = TRUE; 00960 } 00961 00962 return PointsAreSame; 00963 #else 00964 return FALSE; 00965 #endif 00966 }
|
|
Definition at line 22812 of file fillattr.cpp. 22812 { return ATTRVALUE()->IsPerspective(); }
|
|
Set the Selection state of the Fill Control Points. Determines if a Fill Control Point is selected or not.
Definition at line 1892 of file fillattr.cpp. 01893 { 01894 #if !defined(EXCLUDE_FROM_RALPH) 01895 01896 // check for a fill ramp index first. 01897 if (ISA_RAMPINDEX(Control)) 01898 { 01899 FillRamp *pRamp = GetFillRamp(); 01900 if (pRamp) 01901 return pRamp->IsSelected(Control); 01902 } 01903 01904 ERROR2IF(Control > NUMCONTROLPOINTS, FALSE, "Invalid control point in IsSelected()"); 01905 01906 // Secondary points can never be selected 01907 if (Control == FILLCONTROL_SECONDARYPOINT) 01908 return FALSE; 01909 01910 return SelectionState[Control]; 01911 #else 01912 return FALSE; 01913 #endif 01914 }
|
|
Definition at line 983 of file fillattr.cpp. 00984 { 00985 // if (FindParent() != NULL && !(FindParent()->IsSelected())) 00986 // return FALSE; 00987 00988 return TranspMeshesVisible; 00989 }
|
|
Reimplemented from Node. Reimplemented in AttrBitmapFill. Definition at line 444 of file fillattr.h. 00444 { return TRUE; }
|
|
Reimplemented in AttrFlatTranspFill, AttrLinearTranspFill, AttrRadialTranspFill, AttrConicalTranspFill, AttrSquareTranspFill, AttrThreeColTranspFill, AttrFourColTranspFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrTextureColourFill, and AttrTextureTranspFill. Definition at line 369 of file fillattr.h. 00369 { return IsColourMeshVisible(); }
|
|
Definition at line 3799 of file fillattr.cpp. 03800 { 03801 ((FillGeometryAttribute*)GetAttributeValue())->MakePerspective(); 03802 }
|
|
Changes a fill in some way.
If the Mutator is NOT an 'AttrValueChange' then the fill will return a pointer to a fill of the same type as the Mutator, but with the fills own control points and colours.
Definition at line 3159 of file fillattr.cpp. 03160 { 03161 AttrFillGeometry* NewFill = NULL; 03162 #if !defined(EXCLUDE_FROM_RALPH) 03163 03164 // SelectionCount = CountSelectionControlPoints(); 03165 03166 // Is it a Value Change mutator ? 03167 // and if so does the type match this attribute ? 03168 if ( Mutator->IsAValueChange() && 03169 Mutator->GetAttributeType() == GetAttributeType() ) 03170 { 03171 // We need to change this attribute in some way, depending on the 03172 // mutator. It knows what it wants to do, so we will ask it to 03173 // mutate 'this', and it will return a mutated copy 03174 NewFill = ((AttrValueChange*)Mutator)->MutateFill(this); 03175 if (NewFill == NULL) 03176 return NULL; 03177 } 03178 else 03179 { 03180 // It must be a 'Geometry change' 03181 // We will change this fill into another different type of fill, 03182 // but retain our control points and colours etc. 03183 03184 if (IsPerspective() && 03185 (Mutator->GetRuntimeClass() != GetRuntimeClass())) 03186 return NULL; // Can't mutate to a different fill when perspectivised 03187 03188 // Make new fill with the same type as the Mutant 03189 CCRuntimeClass* ObjectType = Mutator->GetRuntimeClass(); 03190 NewFill = (AttrFillGeometry*)ObjectType->CreateObject(); 03191 if (NewFill == NULL) 03192 return NULL; 03193 03194 // Copy the Attribute Bounds (used for Current Attributes) 03195 NewFill->AttrBounds = AttrBounds; 03196 03197 // and copy our Values into it into the new fill 03198 *((FillGeometryAttribute*)NewFill->GetAttributeValue()) = *((FillGeometryAttribute*)this->GetAttributeValue()); 03199 03200 if ((!NewFill->IsABitmapFill() || NewFill->IsAFractalFill()) && 03201 FindParent() != NULL && FindParent()->IsNodeDocument()) 03202 { 03203 // If it's the default Fill attr, then we need to use Blank instead 03204 // of the default fill colour of 'None' 03205 DocColour DefFillCol; 03206 AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 03207 _R(IDS_BLACKNAME), &DefFillCol); 03208 if (NewFill->IsAFlatFill()) 03209 NewFill->SetStartColour(&DefFillCol); 03210 else 03211 NewFill->SetEndColour(&DefFillCol); 03212 } 03213 03214 // Ensure any aspect lock is taken from the mutator 03215 ((FillGeometryAttribute*)NewFill->GetAttributeValue())-> 03216 SetAspectLock(((FillGeometryAttribute*)Mutator->GetAttributeValue())->IsAspectLocked()); 03217 03218 // Ensure our profile type is retained (i.e. NOT taken from the mutator) 03219 ((FillGeometryAttribute*)NewFill->GetAttributeValue())-> 03220 SetProfile(((FillGeometryAttribute*)this->GetAttributeValue())->GetProfile()); 03221 03222 // Ensure our transparency type is retained (ie. NOT taken from the mutator) 03223 ((FillGeometryAttribute*)NewFill->GetAttributeValue())-> 03224 SetTranspType(((FillGeometryAttribute*)this->GetAttributeValue())->GetTranspType()); 03225 03226 // Check if we're mutating a fractal into a something 03227 if (this->IsAFractalFill() && Mutator->IsAFractalFill()) 03228 { 03229 // if so then retain its graininess 03230 ((FillGeometryAttribute*)NewFill->GetAttributeValue())-> 03231 SetGraininess(((FillGeometryAttribute*)this->GetAttributeValue())->GetGraininess()); 03232 } 03233 03234 if (!OpEditFill::CreateFill) 03235 { 03236 if (Mutator->GetBitmap() == NULL && !this->IsAFractalFill()) 03237 { 03238 // No bitmap has been specified in the mutator, 03239 // so lets make a default one 03240 NewFill->CopyBitmap(KernelBitmap::MakeKernelBitmap()); 03241 } 03242 else 03243 { 03244 // Copy the bitmap from the mutator into the new fill 03245 NewFill->CopyBitmap(Mutator->GetBitmap()); 03246 } 03247 03248 // Get the fractal seed from the Mutator, so we create a new random fractal 03249 ((FillGeometryAttribute*)NewFill->GetAttributeValue())-> 03250 SetSeed(((FillGeometryAttribute*)Mutator->GetAttributeValue())->GetSeed()); 03251 03252 NewFill->RecalcFractal(); 03253 } 03254 else 03255 { 03256 NewFill->SetStartPoint(Mutator->GetStartPoint()); 03257 NewFill->SetEndPoint(Mutator->GetEndPoint()); 03258 NewFill->SetEndPoint2(Mutator->GetEndPoint2()); 03259 } 03260 03261 /* 03262 if (Mutator->GetBitmap() && 03263 !BfxALU::IsGreyscaleBitmap(Mutator->GetBitmap())) 03264 { 03265 // The new bitmap is not Greyscale, so make sure we 03266 // lose any contone colours 03267 03268 NewFill->SetStartColour(NULL); 03269 NewFill->SetEndColour(NULL); 03270 } 03271 */ 03272 03273 NewFill->SetBlobState(FILLCONTROL_ENDPOINT, TRUE); 03274 03275 // Update the mutator's tileable flag, so it can set the 03276 // fill mapping correctly, when the secondary attribute 03277 // is obtained 03278 Mutator->SetTileable(NewFill->GetTileable()); 03279 } 03280 03281 // If the resulting attribute in the tree is the same as the mutator 03282 // Then don't return anything so that the caller knows not to write undo 03283 // info 03284 // BUT: If we're applying an attribute in the knowledge that it will later 03285 // get re-applied many times then we should really apply it, ignoring this 03286 // optimisation 03287 if (NewFill != NULL && *NewFill == *this && bOptimise) 03288 { 03289 // If the mutated fill is the same, then forget about it. 03290 delete NewFill; 03291 return NULL; 03292 } 03293 03294 #endif 03295 // Return the Mutated Fill 03296 return NewFill; 03297 }
|
|
Reimplemented in AttrThreeColFill, AttrFourColFill, and AttrBitmapFill. Definition at line 403 of file fillattr.h. 00403 { return(TRUE); }
|
|
Called.
Reimplemented from Node. Reimplemented in AttrFlatTranspFill, AttrLinearTranspFill, AttrRadialTranspFill, AttrConicalTranspFill, AttrSquareTranspFill, AttrThreeColTranspFill, AttrFourColTranspFill, AttrBitmapTranspFill, AttrTextureTranspFill, and AttrStrokeTransp. Definition at line 1189 of file fillattr.cpp. 01190 { 01191 AttrFillGeometry* pNonConst = (AttrFillGeometry*) this; 01192 01193 if (!pNonConst->IsAFractalFill() && pNonConst->GetBitmap() != NULL && pNonConst->GetBitmap()->GetBPP() <= 8) 01194 { 01195 INT32 TranspIndex; 01196 01197 // If the bitmap has a transparency index then we'll need to force transparency on 01198 if (pNonConst->GetBitmap()->GetTransparencyIndex(&TranspIndex)) 01199 return TRUE; 01200 } 01201 01202 return FALSE; 01203 }
|
|
Allows the fill to respond to clicks by selecting its blobs or starting drags etc.
Reimplemented in AttrFlatFill. Definition at line 597 of file fillattr.cpp. 00599 { 00600 #ifndef STANDALONE 00601 DocView *pDocView = DocView::GetCurrent(); 00602 00603 // Should always be able to get current view 00604 ERROR3IF(pDocView == NULL, "AttrFillGeometry::OnClick: Could not get current DocView"); 00605 if (pDocView==NULL) 00606 return FALSE; 00607 00608 if (!GetApplication()->GetBlobManager()->GetCurrentInterest().Fill || 00609 !IsVisible()) 00610 return FALSE; 00611 00612 // Is it just a single click ? 00613 if ( Click == CLICKTYPE_SINGLE ) 00614 { 00615 // Did the click hit any of our control points ? 00616 FillControl Hit = CheckForControlHit(PointerPos); 00617 if ( Hit != FILLCONTROL_NULL ) 00618 { 00619 // It hit one of our Controls. 00620 00621 // Was it an Adjust Click ? 00622 if (ClickMods.Adjust && !ClickMods.Constrain) 00623 { 00624 if (!(ISA_RAMPINDEX (Hit))) // but not for multi-stage fill blobs! 00625 { 00626 DeselectAllBut(Hit); 00627 // Just toggle the Selection state 00628 ToggleSelection(Hit); 00629 } 00630 else 00631 { 00632 SelectBlob(Hit); 00633 DeselectAllBut(Hit); 00634 } 00635 } 00636 else 00637 { 00638 // It was a Select Click, so we need 00639 // to select this Blob, and deselect 00640 // all the others 00641 SelectBlob(Hit); 00642 DeselectAllBut(Hit); 00643 00644 if (ClickMods.Menu) // was it the right-hand mouse button? 00645 { 00646 if (ISA_RAMPINDEX (Hit)) // if so and ramp, then delete the blob .... 00647 { 00648 OpDescriptor* pOpDelete = OpDescriptor::FindOpDescriptor (CC_RUNTIME_CLASS (OpDelete)); 00649 00650 if (pOpDelete) 00651 { 00652 pOpDelete->Invoke (); 00653 } 00654 } 00655 } 00656 } 00657 00658 if (ControlHit == FILLCONTROL_NULL) 00659 ControlHit = Hit; 00660 00661 if (Hit != ControlHit) 00662 return FALSE; 00663 00664 // Claim the Click, 'cus we did something 00665 return TRUE; 00666 } 00667 else 00668 { 00669 // If it was a select click then we need to 00670 // deselect all out control points 00671 if (!ClickMods.Adjust) 00672 { 00673 DeselectAll(); 00674 } 00675 00676 // Don't claim the click 00677 return FALSE; 00678 } 00679 } 00680 00681 // Is it just a double click ? // check for insertion of multi-stage fill blob .... 00682 if (Click == CLICKTYPE_DOUBLE) 00683 { 00684 // Did the click hit any of our control points ? 00685 FillControl Hit = CheckForControlHit (PointerPos); 00686 00687 if (Hit == FILLCONTROL_RAMPPOINT) 00688 { 00689 DocCoord StartPoint = *(GetStartPoint()); 00690 DocCoord EndPoint = *(GetEndPoint()); 00691 00692 // where on the ramp point? 00693 00694 /*double d =*/ FindRampPoint(PointerPos, StartPoint, EndPoint); 00695 00696 Spread* pSpread = NULL; 00697 NodeRenderableInk* pNode = NULL; 00698 Pixel32bpp Pix; 00699 00700 Document* TheDoc = Document::GetCurrent(); 00701 PORTNOTE("spread", "Multi-spread warning! Should use the passed in spread pointer?") 00702 pSpread = TheDoc->FindFirstSpread (); 00703 00704 if (TheDoc != NULL) 00705 { 00706 // read the colour at that point .... 00708 00709 pNode = (NodeRenderableInk *) this->FindParent (); 00710 00711 NodeRenderableInk::FindColourForNodeRenderableAtPoint (pSpread, PointerPos, Pix, pNode, this); 00712 00713 if (pNode != NULL) 00714 { 00715 // convert and apply the colour as a new fill point .... 00716 00717 const double conversion = 1.0/255.0; 00718 00719 FIXED24 rValF24 = Pix.Red * conversion; 00720 FIXED24 gValF24 = Pix.Green * conversion; 00721 FIXED24 bValF24 = Pix.Blue * conversion; 00722 FIXED24 tValF24 = Pix.Alpha * conversion; 00723 00724 ColourRGBT theColourRGBT; 00725 theColourRGBT.Red = rValF24; 00726 theColourRGBT.Green = gValF24; 00727 theColourRGBT.Blue = bValF24; 00728 theColourRGBT.Transparent = tValF24; 00729 DocColour* ColourToApply = new DOCCOLOUR_RGBT(&theColourRGBT); 00730 00731 if (ColourToApply == NULL) 00732 { 00733 return (FALSE); 00734 } 00735 00736 DocRect pSimpleBounds; 00737 pSimpleBounds = pNode->GetBoundingRect(); 00738 00739 AttrColourDrop* dummyDrop = new AttrColourDrop (PointerPos, pSimpleBounds, *ColourToApply); 00740 00741 if (dummyDrop == NULL) 00742 { 00743 delete (ColourToApply); 00744 return (FALSE); 00745 } 00746 00747 //AttrFillGeometry::DoColourDropTest(dummyDrop, pNode, this); 00748 00749 dummyDrop->SetObjectDroppedOn (pNode); 00750 00751 AttributeManager::ApplyAttribToNode(pNode, dummyDrop); 00752 00753 delete (ColourToApply); 00754 00755 return (TRUE); 00756 } 00757 } 00758 return (FALSE); 00759 } 00760 return FALSE; 00761 } 00762 00763 #endif 00764 return FALSE; 00765 }
|
|
Reimplemented in AttrRadialFill, AttrConicalFill, AttrSquareFill, AttrThreeColFill, AttrFourColFill, AttrBitmapFill, AttrTextureColourFill, and AttrTextureTranspFill. Definition at line 2637 of file fillattr.cpp. 02638 { 02639 #if !defined(EXCLUDE_FROM_RALPH) 02640 02641 // Document * pDoc = Document::GetCurrent(); 02642 02643 if (ISA_RAMPINDEX(DragControl)) 02644 { 02645 // Aha, we're dragging a point on the fill ramp. We need to do all sorts of 02646 // gubbins here. The point being dragged will need to be snapped to the geometry 02647 // of the fill. 02648 // Algorithm is simply 02649 // (1) FindClosestPointInGeometrySpace(InCoord, OutParam) 02650 // (2) pRamp->SetPosition(DragControl, OutParam); 02651 02652 FillRamp *pRamp = GetFillRamp(); 02653 if (pRamp) 02654 { 02655 float t = ATTRVALUE()->GetGeometryParam(Pos); 02656 02657 FillControl NewDragControl = pRamp->SetPosition(DragControl, t); 02658 02659 if (NewDragControl != DragControl) 02660 { 02661 DragControl = NewDragControl; 02662 } 02663 // pRamp->SortRamp (TRUE); 02664 } 02665 return; 02666 } 02667 02668 // Is the Control Point Valid ? 02669 ERROR3IF(DragControl > NUMCONTROLPOINTS, "Invalid control point in OnControlDrag()"); 02670 02671 // Which control is being dragged ? 02672 switch (DragControl) 02673 { 02674 case FILLCONTROL_STARTPOINT: 02675 02676 if (GetStartPoint() != NULL) 02677 { 02678 // They're dragging the Start Point 02679 if (ClickMods.Constrain) 02680 { 02681 // If the Constrain key is down then constrain the Angle of the 02682 // point, relative to the other end. 02683 DocView::ConstrainToAngle(*GetEndPoint(), &Pos); 02684 } 02685 02686 SetStartPoint(&Pos); 02687 DocCoord temp = MakeLineAtAngle(*GetStartPoint(), *GetEndPoint(), 90); 02688 SetEndPoint2(&temp); 02689 } 02690 break; 02691 02692 case FILLCONTROL_ENDPOINT: 02693 02694 if (GetEndPoint() != NULL) 02695 { 02696 // They're dragging the End Point 02697 if (ClickMods.Constrain) 02698 { 02699 // If the Constrain key is down then constrain the Angle of the 02700 // point, relative to the other end. 02701 DocView::ConstrainToAngle(*GetStartPoint(), &Pos); 02702 } 02703 02704 SetEndPoint(&Pos); 02705 DocCoord temp = MakeLineAtAngle(*GetStartPoint(), *GetEndPoint(), 90); 02706 SetEndPoint2(&temp); 02707 } 02708 break; 02709 02710 case FILLCONTROL_SECONDARYPOINT: 02711 02712 if (GetEndPoint2() != NULL) 02713 { 02714 // They're dragging the Secondary Point 02715 if (ClickMods.Constrain) 02716 { 02717 // If the Constrain key is down then constrain the Angle of the 02718 // point, relative to the other end. 02719 DocView::ConstrainToAngle(*GetStartPoint(), &Pos); 02720 } 02721 02722 SetEndPoint2(&Pos); 02723 } 02724 break; 02725 } 02726 #endif 02727 }
|
|
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
Definition at line 1266 of file fillattr.cpp. 01267 { 01268 ERROR3IF(!FillAttrib.IsAFillAttr(), 01269 "Trying to assign two objects with different types"); 01270 01271 // Copy the Attribute bounds 01272 AttrBounds = FillAttrib.AttrBounds; 01273 01274 // Copy the selection state 01275 for (INT32 i=0; i < FILLCONTROL_SECONDARYPOINT; i++) 01276 { 01277 SetBlobState(i, FillAttrib.IsSelected(i)); 01278 } 01279 01280 // Copy the Attribute Value. ie. The Colours and Control Points 01281 *((FillGeometryAttribute*)GetAttributeValue()) = *((FillGeometryAttribute*)FillAttrib.GetAttributeValue()); 01282 01283 // Ensure the control points are valid for this kind of fill 01284 if (GetRuntimeClass() != FillAttrib.GetRuntimeClass()) 01285 ValidateAttributeValue(); 01286 01287 return TRUE; 01288 }
|
|
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
Reimplemented from NodeAttribute. Reimplemented in AttrStrokeColour, and AttrStrokeTransp. Definition at line 1364 of file fillattr.cpp. 01365 { 01366 // First check they are of the same type 01367 if (((NodeAttribute*)&Attrib)->GetAttributeType() != GetAttributeType()) 01368 return FALSE; 01369 01370 // Make a more sensible pointer 01371 AttrFillGeometry* Attr = (AttrFillGeometry*)&Attrib; 01372 01373 // Are the attributes of the same type and are their value the same ? 01374 return (*((FillGeometryAttribute*)Attr->GetAttributeValue()) == *((FillGeometryAttribute*)GetAttributeValue()) ); 01375 }
|
|
Polymorphically copies the contents of this node to another.
Reimplemented from NodeRenderable. Reimplemented in AttrStrokeColour, and AttrStrokeTransp. Definition at line 1337 of file fillattr.cpp. 01338 { 01339 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 01340 ENSURE(pNodeCopy->IsKindOf(CC_RUNTIME_CLASS(AttrFillGeometry)), "PolyCopyNodeContents given wrong dest node type"); 01341 01342 if (pNodeCopy->IsKindOf(CC_RUNTIME_CLASS(AttrFillGeometry))) 01343 CopyNodeContents((AttrFillGeometry*)pNodeCopy); 01344 }
|
|
Definition at line 22801 of file fillattr.cpp. 22801 { return ATTRVALUE()->Randomise(); }
|
|
Definition at line 22800 of file fillattr.cpp. 22800 { return ATTRVALUE()->RecalcFractal(); }
|
|
Definition at line 3804 of file fillattr.cpp. 03805 { 03806 if (IsPerspective() && pUndoOp != NULL) 03807 { 03808 Node* pParent = FindParent(); 03809 if (pParent == NULL) 03810 return; 03811 03812 AttrFillGeometry* AttribClone; 03813 03814 ALLOC_WITH_FAIL(AttribClone ,(AttrFillGeometry*)this->SimpleCopy(), pUndoOp) 03815 if (AttribClone == NULL) 03816 return; 03817 03818 AttribClone->RemovePerspective(); 03819 03820 HideNodeAction* UndoHideNodeAction; 03821 NodeHidden* pNodeHidden; 03822 if(!pUndoOp->DoHideNode(this, FALSE, &pNodeHidden,FALSE)) 03823 return; 03824 03825 AttribClone->AttachNode(pParent, FIRSTCHILD); 03826 03827 // Create an action to hide the attribute when we undo 03828 if ( HideNodeAction::Init(pUndoOp, 03829 pUndoOp->GetUndoActionList(), 03830 AttribClone, 03831 TRUE, // When the attribute gets hidden we 03832 // must include its size 03833 (Action**)(&UndoHideNodeAction)) 03834 == AC_FAIL) 03835 { 03836 AttribClone->CascadeDelete(); 03837 delete (AttribClone); 03838 return; 03839 }; 03840 } 03841 else 03842 { 03843 ((FillGeometryAttribute*)GetAttributeValue())->RemovePerspective(); 03844 } 03845 }
|
|
Redraws the Fill Control blobs when the selection changes.
Reimplemented in AttrConicalFill, AttrThreeColFill, AttrFourColFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrTextureColourFill, and AttrTextureTranspFill. Definition at line 2484 of file fillattr.cpp. 02485 { 02486 #if !defined(EXCLUDE_FROM_RALPH) 02487 DocRect ControlRect; 02488 02489 // Ignore if we're not in the tree yet 02490 // We may be a tempory clone, or something 02491 NodeRenderable* pParent = (NodeRenderable*)FindParent(); 02492 if (pParent == NULL) 02493 return; 02494 02495 if (IsBlobSame(Control)) 02496 return; // Ignore if same as the last blob rendered 02497 02498 Spread* pSpread = this->FindParentSpread(); 02499 02500 if (ISA_RAMPINDEX(Control)) 02501 { 02502 FillRamp* pRamp = GetFillRamp(); 02503 if (pRamp) 02504 { 02505 DocCoord point = pRamp->GetGeometryCoord(ATTRVALUE(), Control); 02506 (Camelot.GetBlobManager())->GetBlobRect(point, &ControlRect, TRUE); 02507 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent); 02508 } 02509 return; 02510 } 02511 02512 switch (Control) 02513 { 02514 case FILLCONTROL_STARTPOINT: 02515 if (GetStartPoint() != NULL) 02516 { 02517 // Redraw the Start Point Blob 02518 (Camelot.GetBlobManager())->GetBlobRect(*GetStartPoint(), &ControlRect); 02519 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent); 02520 } 02521 break; 02522 02523 case FILLCONTROL_ENDPOINT: 02524 case FILLCONTROL_SECONDARYPOINT: 02525 { 02526 if (GetEndPoint() != NULL) 02527 { 02528 // Redraw BOTH End Point Blobs 02529 (Camelot.GetBlobManager())->GetBlobRect(*GetEndPoint(), &ControlRect); 02530 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent); 02531 } 02532 02533 if (GetEndPoint2() != NULL) 02534 { 02535 (Camelot.GetBlobManager())->GetBlobRect(*GetEndPoint2(), &ControlRect); 02536 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent); 02537 } 02538 } 02539 break; 02540 } 02541 #endif 02542 }
|
|
Definition at line 2588 of file fillattr.cpp. 02591 { 02592 #if !defined(EXCLUDE_FROM_RALPH) 02593 RenderRegionList* pRegionList = GetApplication()->GetRegionList(); 02594 02595 if (!pRegionList->IsEmpty()) 02596 { 02597 RenderRegion* pRegion = (RenderRegion*)pRegionList->GetHead(); 02598 02599 while (pRegion) 02600 { 02601 // Check the RenderRegion is for the same spread. 02602 if (pRegion->GetRenderSpread() == pSpread && 02603 (pRegion->IsInkRenderStarted || pRegion->NeedsOSPaper)) 02604 { 02605 // Render the blobs 'clipped' to this Render Region. 02606 DocRect ClipRect = pRegion->GetRegionRect(); 02607 02608 if (ClipRect.IsIntersectedWith(*ControlRect)) 02609 { 02610 ClipRect = ClipRect.Intersection(*ControlRect); 02611 (Camelot.GetBlobManager())->RenderMyBlobs(&ClipRect, pSpread, pParent); 02612 } 02613 } 02614 02615 // Get the Next render region 02616 pRegion = (RenderRegion*)pRegionList->GetNext(pRegion); 02617 } 02618 } 02619 02620 AttrFillGeometry::LastRenderedMesh = NULL; 02621 #endif 02622 }
|
|
Force Renders the fill mesh off the screen.
Definition at line 1552 of file fillattr.cpp. 01553 { 01554 #if !defined(EXCLUDE_FROM_RALPH) 01555 Node *pNode = this; 01556 while ((pNode != NULL) && !pNode->IsKindOf(CC_RUNTIME_CLASS(Spread))) 01557 pNode = pNode->FindParent(); 01558 01559 if (pNode == NULL) 01560 return; // We're not really in the tree 01561 01562 Spread* pSpread = (Spread*)pNode; 01563 01564 DocRect Bounds = GetBlobBoundingRect(); 01565 01566 // EOR on in all the render regions that are still rendering, 01567 // so that the Blob rendering when the region is finished, 01568 // will take them off 01569 RenderRegionList* pRegionList = GetApplication()->GetRegionList(); 01570 01571 if (!pRegionList->IsEmpty()) 01572 { 01573 RenderRegion* pRegion = (RenderRegion*)pRegionList->GetHead(); 01574 01575 while (pRegion) 01576 { 01577 // Check the RenderRegion is for the same spread. 01578 if (pRegion->GetRenderSpread() == pSpread && 01579 (pRegion->IsInkRenderStarted || pRegion->NeedsOSPaper)) 01580 { 01581 // Render the blobs 'clipped' to this Render Region. 01582 DocRect ClipRect = pRegion->GetRegionRect(); 01583 01584 if (ClipRect.IsIntersectedWith(Bounds)) 01585 { 01586 ClipRect = ClipRect.Intersection(Bounds); 01587 RenderRegion* pRegion = DocView::RenderOnTop(&ClipRect, pSpread, UnclippedEOR); 01588 while (pRegion) 01589 { 01590 RenderFillBlobs(pRegion); 01591 LastRenderedMesh = NULL; 01592 01593 // Get the Next render region 01594 pRegion = DocView::GetNextOnTop(&ClipRect); 01595 } 01596 } 01597 } 01598 01599 // Get the Next render region 01600 pRegion = (RenderRegion*)pRegionList->GetNext(pRegion); 01601 } 01602 } 01603 01604 RenderRegion* pRegion = DocView::RenderOnTop(&Bounds, pSpread, UnclippedEOR); 01605 while (pRegion) 01606 { 01607 RenderFillBlobs(pRegion); 01608 LastRenderedMesh = NULL; 01609 01610 // Get the Next render region 01611 pRegion = DocView::GetNextOnTop(&Bounds); 01612 } 01613 01614 // This call was removed by Gerry (2/9/96) as it causes blob problems 01615 // Since we are removing blobs then force all blobs to be deselected 01616 // DeselectAllNoRedraw(); 01617 #endif 01618 }
|
|
Reimplemented from NodeRenderable. Reimplemented in AttrLinearFill, AttrLinearColourFill, AttrLinearTranspFill, AttrRadialFill, AttrRadialColourFill, AttrRadialTranspFill, AttrConicalFill, AttrConicalColourFill, AttrConicalTranspFill, AttrSquareFill, AttrSquareColourFill, AttrSquareTranspFill, AttrThreeColFill, AttrThreeColColourFill, AttrThreeColTranspFill, AttrFourColFill, AttrFourColColourFill, AttrFourColTranspFill, AttrBitmapFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrTextureColourFill, and AttrTextureTranspFill. Definition at line 227 of file fillattr.h.
|
|
Definition at line 2556 of file fillattr.cpp. 02560 { 02561 #if !defined(EXCLUDE_FROM_RALPH) 02562 if (!RenderOn) 02563 { 02564 RenderControlIntoPendingRegions(ControlRect, pSpread, pParent); 02565 } 02566 02567 (Camelot.GetBlobManager())->RenderMyBlobs(ControlRect, pSpread, pParent); 02568 AttrFillGeometry::LastRenderedMesh = NULL; 02569 02570 if (RenderOn) 02571 { 02572 RenderControlIntoPendingRegions(ControlRect, pSpread, pParent); 02573 } 02574 #endif 02575 }
|
|
Reimplemented in AttrLinearFill, AttrRadialFill, AttrConicalFill, AttrSquareFill, AttrThreeColFill, AttrFourColFill, AttrBitmapFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrTextureColourFill, and AttrTextureTranspFill. Definition at line 228 of file fillattr.h.
|
|
Selects a Fill Control Point.
Reimplemented in AttrFlatFill. Definition at line 2038 of file fillattr.cpp. 02039 { 02040 #if !defined(EXCLUDE_FROM_RALPH) 02041 ChangeBlobState(HitControl, BLOBSTATE_ON); 02042 #endif 02043 }
|
|
Reimplemented in AttrBitmapFill, and AttrFractalFill. Definition at line 2729 of file fillattr.cpp. 02730 { 02731 #if !defined(EXCLUDE_FROM_RALPH) 02732 DocCoord Start = *GetStartPoint(); 02733 DocCoord End = *GetEndPoint(); 02734 02735 DocCoord End2 = MakeLineAtAngle(Start, 02736 End, 02737 90, 02738 INT32(Start.Distance(End) * Ratio) 02739 ); 02740 02741 SetEndPoint2(&End2); 02742 #endif 02743 }
|
|
Sets the selection state of a particular Control Point.
Definition at line 2017 of file fillattr.cpp. 02018 { 02019 #if !defined(EXCLUDE_FROM_RALPH) 02020 ChangeBlobState(HitControl, (NewState ? BLOBSTATE_ON : BLOBSTATE_OFF)); 02021 #endif 02022 }
|
|
Set the Attributes bounding rectangle, which is used for current attributes and scaling when applying to new ink nodes. This rect is only used for 'Current' Attributes which don't have any parent bounds. It allows us to scale current attributes when they are applied.
Definition at line 2801 of file fillattr.cpp. 02802 { 02803 // Er.. Update the Bounding Rectangle thingy. 02804 // This rect is only used for 'Current' Attributes which don't have any parent bounds 02805 // It allows us to scale current attributes when they are applied. 02806 AttrBounds = NewBounds; 02807 }
|
|
Definition at line 22815 of file fillattr.cpp. 22815 { ATTRVALUE()->SetColourRamp (New); }
|
|
Definition at line 22790 of file fillattr.cpp. 22790 { return ATTRVALUE()->SetDPI(NewDpi); }
|
|
Definition at line 22765 of file fillattr.cpp. 22765 { ATTRVALUE()->SetEndColour(NewCol); }
|
|
Definition at line 22766 of file fillattr.cpp. 22766 { ATTRVALUE()->SetEndColour2(NewCol); }
|
|
Definition at line 22767 of file fillattr.cpp. 22767 { ATTRVALUE()->SetEndColour3(NewCol); }
|
|
Definition at line 22773 of file fillattr.cpp. 22773 { ATTRVALUE()->SetEndPoint(Pos); }
|
|
Definition at line 22774 of file fillattr.cpp. 22774 { ATTRVALUE()->SetEndPoint2(Pos); }
|
|
Definition at line 22775 of file fillattr.cpp. 22775 { ATTRVALUE()->SetEndPoint3(Pos); }
|
|
Definition at line 22769 of file fillattr.cpp. 22769 { ATTRVALUE()->SetEndTransp(NewTransp); }
|
|
Definition at line 22770 of file fillattr.cpp. 22770 { ATTRVALUE()->SetEndTransp2(NewTransp); }
|
|
Definition at line 22771 of file fillattr.cpp. 22771 { ATTRVALUE()->SetEndTransp3(NewTransp); }
|
|
Definition at line 22792 of file fillattr.cpp. 22792 { ATTRVALUE()->SetFractalDim(NewDim); }
|
|
Definition at line 22791 of file fillattr.cpp. 22791 { return ATTRVALUE()->SetFractalDPI(NewDpi); }
|
|
Definition at line 22794 of file fillattr.cpp. 22794 { return ATTRVALUE()->SetGraininess(NewGrain); }
|
|
Definition at line 22795 of file fillattr.cpp. 22795 { return ATTRVALUE()->SetGravity(NewGrav); }
|
|
Definition at line 999 of file fillattr.cpp. 01000 { 01001 #if !defined(EXCLUDE_FROM_RALPH) 01002 switch (Control) 01003 { 01004 case FILLCONTROL_STARTPOINT: 01005 if (GetStartPoint() != NULL) 01006 LastRenderedStartBlob = *GetStartPoint(); 01007 break; 01008 01009 case FILLCONTROL_ENDPOINT: 01010 if (GetEndPoint() != NULL) 01011 LastRenderedEndBlob = *GetEndPoint(); 01012 break; 01013 01014 case FILLCONTROL_SECONDARYPOINT: 01015 case FILLCONTROL_ENDPOINT2: 01016 if (GetEndPoint2() != NULL) 01017 LastRenderedEnd2Blob = *GetEndPoint2(); 01018 break; 01019 01020 case FILLCONTROL_ENDPOINT3: 01021 if ((GetStartPoint() != NULL) && 01022 (GetEndPoint() != NULL) && 01023 (GetEndPoint2() != NULL)) 01024 { 01025 LastRenderedEnd3Blob = *GetEndPoint2() + *GetEndPoint() - *GetStartPoint(); 01026 } 01027 break; 01028 } 01029 #endif 01030 }
|
|
Definition at line 22798 of file fillattr.cpp. 22798 { return ATTRVALUE()->SetNoiseScale(ns); }
|
|
Definition at line 22776 of file fillattr.cpp. 22776 { ATTRVALUE()->SetProfile(SetWith); }
|
|
Definition at line 22793 of file fillattr.cpp. 22793 { return ATTRVALUE()->SetSeed(NewSeed); }
|
|
Definition at line 973 of file fillattr.cpp. 00974 { 00975 SelectionCount = Count; 00976 }
|
|
Definition at line 22796 of file fillattr.cpp. 22796 { return ATTRVALUE()->SetSquash(NewSquash); }
|
|
Definition at line 22764 of file fillattr.cpp. 22764 { ATTRVALUE()->SetStartColour(NewCol); }
|
|
Definition at line 22772 of file fillattr.cpp. 22772 { ATTRVALUE()->SetStartPoint(Pos); }
|
|
Definition at line 22768 of file fillattr.cpp. 22768 { ATTRVALUE()->SetStartTransp(NewTransp); }
|
|
Definition at line 22811 of file fillattr.cpp. 22811 { ATTRVALUE()->SetTesselation(NewTess); }
|
|
Definition at line 22797 of file fillattr.cpp. 22797 { return ATTRVALUE()->SetTileable(NewTile); }
|
|
Definition at line 978 of file fillattr.cpp. 00979 { 00980 TranspMeshesVisible = Visible; 00981 }
|
|
Definition at line 22816 of file fillattr.cpp. 22816 { ATTRVALUE()->SetTranspRamp(New); }
|
|
Definition at line 22789 of file fillattr.cpp. 22789 { ATTRVALUE()->SetTranspType(NewType); }
|
|
Check to see which colour will be changed if dropped at this point.
Reimplemented in AttrFlatFill, AttrLinearFill, AttrRadialFill, AttrConicalFill, AttrSquareFill, AttrThreeColFill, AttrFourColFill, and AttrBitmapFill. Definition at line 5298 of file fillattr.cpp. 05299 { 05300 #if !defined(EXCLUDE_FROM_RALPH) 05301 // So, where was it dropped (or where will it be dropped) 05302 DocCoord DropPoint = ColDrop->GetDropPoint(); 05303 05304 // Look to see if the DropPoint is over any of the Fill Control Points 05305 return CheckForControlHit(DropPoint); 05306 #else 05307 return FILLCONTROL_NULL; 05308 #endif 05309 }
|
|
Toggle the selection of a Fill Control Point.
Reimplemented in AttrFlatFill. Definition at line 2081 of file fillattr.cpp. 02082 { 02083 #if !defined(EXCLUDE_FROM_RALPH) 02084 ChangeBlobState(HitControl, BLOBSTATE_TOGGLE); 02085 #endif 02086 }
|
|
Transform a grad fill attribute by moving the selected control points.
Reimplemented in AttrConicalFill, AttrThreeColFill, AttrFourColFill, and AttrBitmapFill. Definition at line 2852 of file fillattr.cpp. 02853 { 02854 #if !defined(EXCLUDE_FROM_RALPH) 02855 if ( Trans.TransFills ) 02856 { 02857 ClickModifiers ClickMods; /* = ClickModifiers::GetClickModifiers();*/ 02858 ClickMods.Adjust = TRUE; 02859 02860 if (GetStartPoint() && IsSelected(FILLCONTROL_STARTPOINT)) 02861 { 02862 DocCoord Pos = *GetStartPoint(); 02863 Trans.Transform( &Pos, 1); 02864 02865 FillControl Start = FILLCONTROL_STARTPOINT; 02866 02867 OnControlDrag(Pos, Start, ClickMods); 02868 } 02869 02870 if (GetEndPoint() && IsSelected(FILLCONTROL_ENDPOINT)) 02871 { 02872 DocCoord Pos = *GetEndPoint(); 02873 Trans.Transform( &Pos, 1); 02874 02875 FillControl End = FILLCONTROL_ENDPOINT; 02876 02877 OnControlDrag(Pos, End, ClickMods); 02878 } 02879 02880 // CGS: wo - check the fill ramp as well .... 02881 02882 TransformSelectedFillRampControlPoints (Trans, ClickMods, isARampBlob); 02883 } 02884 #endif 02885 }
|
|
Transform a grad fill attributes fill ramp by moving the selected control points.
Definition at line 2901 of file fillattr.cpp. 02902 { 02903 if (GetFillRamp ()) 02904 { 02905 // there is a fill ramp .... 02906 02907 FillRamp* pRamp = GetFillRamp (); 02908 02909 // NOTE: the following code is written with the assumption 02910 // that there is ONLY EVER one blob selected. If this restriction 02911 // is altered one-day, then the following code will need to be 02912 // revised .... 02913 02914 if (pRamp->CountSelBlobs () > 0) 02915 { 02916 ERROR3IF (pRamp->CountSelBlobs () > 1, "More than one blob is selected! (extras will be ignored)"); 02917 02918 if (isARampBlob) 02919 { 02920 *isARampBlob = TRUE; // cause it is 02921 } 02922 02923 // get the index of the first .... 02924 02925 INT32 sel = pRamp->GetSelectedIndex (); 02926 02927 DocCoord Pos = pRamp->GetGeometryCoord ((FillGeometryAttribute*) GetAttributeValue (), sel); 02928 Trans.Transform( &Pos, 1); 02929 02930 FillControl control = sel; 02931 02932 //DisableBoundsRedraw (); 02933 OnControlDrag(Pos, control, ClickMods); 02934 //EnableBoundsRedraw (); 02935 } 02936 } 02937 }
|
|
Moves and scales the attribute's bounds to fit NewBounds. This function is used when applying an attribute which has been stored (eg. as a Current attribute) to a new object.
Reimplemented from NodeAttribute. Definition at line 2955 of file fillattr.cpp. 02956 { 02957 #if !defined(EXCLUDE_FROM_RALPH) 02958 // We are a funny fill thingy, so we better do some transforming 02959 DocRect AttrBounds = GetBoundingRect(); 02960 02961 // If we have valid Node and Attribute Bounds then make a transform 02962 // that is the scale and offset of the two rectangles. 02963 if (!NewBounds.IsEmpty() && !AttrBounds.IsEmpty()) 02964 { 02965 // Get the Width and Height of the two rectangles 02966 INT32 NodeWidth = NewBounds.Width(); 02967 INT32 NodeHeight = NewBounds.Height(); 02968 INT32 AttrWidth = AttrBounds.Width(); 02969 INT32 AttrHeight = AttrBounds.Height(); 02970 02971 // Find the Centre of each rectangle 02972 NewBounds.Translate(NodeWidth/2, NodeHeight/2); 02973 AttrBounds.Translate(AttrWidth/2, AttrHeight/2); 02974 DocCoord NodeCentre = NewBounds.lo; 02975 DocCoord AttrCentre = AttrBounds.lo; 02976 02977 // And now make a transform for the attribute 02978 // First move the old attribute position to the origin 02979 Matrix AttrTrans = Matrix(-AttrCentre.x, -AttrCentre.y); 02980 02981 // Don't scale for bitmap/fractal fills/transparency. 02982 if (!IS_KIND_OF(AttrBitmapFill)) 02983 { 02984 // Calculate the difference in size between the two rectangles & scale accordingly. 02985 AttrTrans *= Matrix(FIXED16(double(NodeWidth) / double(AttrWidth)), 02986 FIXED16(double(NodeHeight) / double(AttrHeight))); 02987 } 02988 02989 // And finally move it to the new position 02990 AttrTrans *= Matrix(NodeCentre.x, NodeCentre.y); 02991 Trans2DMatrix Trans = Trans2DMatrix(AttrTrans); 02992 02993 // Go transform that Attribute !! 02994 Transform(Trans); 02995 } 02996 #endif 02997 }
|
|
Do an extend (as opposed to stretch) operation on this fill, using ExtParams as the source of the extend data, together with the extend-centre of this path, defined in NodeRenderable::FindExtendCentre() and overridden here also.
This function does nothing unless ExtParams uses X_EXTEND or Y_EXTEND. See also: The Extender class; FindExtendCentre(). Reimplemented from NodeRenderable. Reimplemented in AttrLinearFill, AttrRadialFill, and AttrBitmapFill. Definition at line 19957 of file fillattr.cpp. 19958 { 19959 // construct an array of the fill's handles. 19960 INT32 pointIndex = 0; 19961 DocCoord* doccpHandles[3]; 19962 DocCoord* pDocc = GetStartPoint(); 19963 if (pDocc != NULL) 19964 doccpHandles[pointIndex ++] = pDocc; 19965 19966 pDocc = GetEndPoint(); 19967 if (pDocc != NULL) 19968 doccpHandles[pointIndex ++] = pDocc; 19969 19970 pDocc = GetEndPoint2(); 19971 if (pDocc != NULL) 19972 doccpHandles[pointIndex ++] = pDocc; 19973 19974 INT32 numPoints = GetNumberOfControlPoints(); 19975 19976 // x-extension behaviour. 19977 if (ExtParams.fExtendFlags & X_EXTEND) 19978 { 19979 // if our parent is a group, then it won't have applied any offset parameter to us, 19980 // so we need to do this ourself. 19981 Node* pParent = FindParent(); 19982 if (pParent != NULL && pParent->IsCompound()) 19983 { 19984 Trans2DMatrix baseXoffset(ExtParams.doccOffset.x, 0); 19985 Transform(baseXoffset); 19986 } 19987 19988 for (INT32 i = 0; i < numPoints; i ++) 19989 { 19990 if (doccpHandles[i]->x > ExtParams.doccEndCentre.x + ExtParams.xincExtendBuffer) 19991 doccpHandles[i]->x += ExtParams.xinc; 19992 else if (doccpHandles[i]->x < ExtParams.doccEndCentre.x - ExtParams.xdecExtendBuffer) 19993 doccpHandles[i]->x -= ExtParams.xdec; 19994 } 19995 } 19996 19997 // y-extension behaviour. 19998 if (ExtParams.fExtendFlags & Y_EXTEND) 19999 { 20000 // if our parent is a group, then it won't have applied any offset parameter to us, 20001 // so we need to do this ourself. 20002 Node* pParent = FindParent(); 20003 if (pParent != NULL && pParent->IsCompound()) 20004 { 20005 Trans2DMatrix baseYoffset(0, ExtParams.doccOffset.y); 20006 Transform(baseYoffset); 20007 } 20008 20009 for (INT32 i = 0; i < numPoints; i ++) 20010 { 20011 if (doccpHandles[i]->y > ExtParams.doccEndCentre.y + ExtParams.yincExtendBuffer) 20012 doccpHandles[i]->y += ExtParams.yinc; 20013 else if (doccpHandles[i]->y < ExtParams.doccEndCentre.y - ExtParams.ydecExtendBuffer) 20014 doccpHandles[i]->y -= ExtParams.ydec; 20015 } 20016 } 20017 20018 // doing this should cause the fourth fill point to be reset to a sensible value. 20019 SetEndPoint3(NULL); 20020 }
|
|
Reimplemented in AttrFlatFill, AttrLinearFill, AttrRadialFill, AttrConicalFill, AttrSquareFill, AttrThreeColFill, AttrFourColFill, AttrBitmapFill, and AttrFractalFill. Definition at line 414 of file fillattr.h.
|
|
Determine whether applying an extend to this Node is a reversible process.
Reimplemented from Node. Reimplemented in AttrBitmapFill. Definition at line 19877 of file fillattr.cpp. 19878 { 19879 // quit immediately with all-clear if we are not a graduated fill. 19880 if (!IsAGradFill()) 19881 return DocRect(INT32_MAX, INT32_MAX, INT32_MAX, INT32_MAX); 19882 19883 // construct an array of the fill's handles. 19884 INT32 i = 0; 19885 DocCoord doccHandles[3]; 19886 DocCoord* pDocc = GetStartPoint(); 19887 if (pDocc != NULL) 19888 doccHandles[i ++] = *pDocc; 19889 19890 pDocc = GetEndPoint(); 19891 if (pDocc != NULL) 19892 doccHandles[i ++] = *pDocc; 19893 19894 pDocc = GetEndPoint2(); 19895 if (pDocc != NULL) 19896 doccHandles[i ++] = *pDocc; 19897 19898 // validate our array of fill handles. 19899 // don't bother checking children - attributes don't have any. 19900 INT32 numPoints = GetNumberOfControlPoints(); 19901 return Extender::ValidateControlPoints(numPoints, doccHandles, ExtParams); 19902 }
|
|
Write the Attributes bounding rectangle.
Definition at line 2820 of file fillattr.cpp. 02821 { 02822 BOOL ok = TRUE; 02823 02824 CamelotFileRecord Rec(pFilter, TAG_CURRENTATTRIBUTEBOUNDS, TAG_CURRENTATTRIBUTEBOUNDS_SIZE); 02825 02826 ok = Rec.Init(); 02827 02828 if (ok) ok = Rec.WriteCoord(AttrBounds.lo); // write out low corner details 02829 if (ok) ok = Rec.WriteCoord(AttrBounds.hi); // write out high corner details 02830 02831 // Finally, write the record out to file 02832 // In the process get the record number that this was written out as 02833 INT32 RecordNumber = 0L; 02834 if (ok) RecordNumber = pFilter->Write(&Rec); 02835 02836 // If we have had a problem at any of the stages then return that to the caller 02837 return (ok && RecordNumber > 0); 02838 }
|
|
Reimplemented in AttrFlatColourFill, AttrLinearColourFill, AttrRadialColourFill, AttrConicalColourFill, AttrSquareColourFill, AttrThreeColColourFill, AttrFourColColourFill, AttrBitmapColourFill, AttrFractalColourFill, AttrNoiseColourFill, and AttrStrokeColour. Definition at line 409 of file fillattr.h. 00409 { return (TRUE); }
|
|
Definition at line 238 of file fillattr.h. |
|
Definition at line 232 of file fillattr.h. |
|
Definition at line 501 of file fillattr.h. |
|
Definition at line 498 of file fillattr.h. |
|
Reimplemented in AttrColourDrop. Definition at line 494 of file fillattr.h. |
|
Definition at line 483 of file fillattr.h. |
|
Definition at line 464 of file fillattr.h. |
|
Definition at line 461 of file fillattr.h. |
|
Definition at line 460 of file fillattr.h. |
|
Reimplemented in AttrColourDrop. Definition at line 495 of file fillattr.h. |
|
Definition at line 478 of file fillattr.h. |
|
Definition at line 475 of file fillattr.h. |
|
Definition at line 476 of file fillattr.h. |
|
Definition at line 474 of file fillattr.h. |
|
Definition at line 462 of file fillattr.h. |
|
Definition at line 469 of file fillattr.h. |
|
Definition at line 470 of file fillattr.h. |
|
Definition at line 468 of file fillattr.h. |
|
Definition at line 465 of file fillattr.h. |
|
Definition at line 467 of file fillattr.h. |
|
Definition at line 479 of file fillattr.h. |
|
Definition at line 489 of file fillattr.h. |
|
Definition at line 497 of file fillattr.h. |
|
Definition at line 472 of file fillattr.h. |
|
Definition at line 492 of file fillattr.h. |
|
Definition at line 481 of file fillattr.h. |