00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #ifndef INC_BLENDTOOL
00101 #define INC_BLENDTOOL
00102
00103
00104
00105
00106 #include "blendatt.h"
00107
00108 #include "biasgdgt.h"
00109
00110
00111 #include "nodershp.h"
00112
00113
00114
00115 #include "dragtool.h"
00116
00117 class Cursor;
00118 class Spread;
00119 class BlendInfoBarOp;
00120 class Node;
00121 class NodeBlend;
00122 class NodeBlender;
00123 class BlendPath;
00124 class CompoundNodeTreeFactory;
00125
00126 #define OPTOKEN_BLENDNODES _T("BlendNodes")
00127 #define OPTOKEN_REMOVEBLEND _T("RemoveBlend")
00128 #define OPTOKEN_CHANGEBLENDSTEPS _T("ChangeBlendSteps")
00129 #define OPTOKEN_CHANGEBLEND _T("ChangeBlendFlag")
00130 #define OPTOKEN_BLENDONETOONE _T("BlendOneToOne")
00131 #define OPTOKEN_BLENDANTIALIAS _T("BlendAntialias")
00132 #define OPTOKEN_BLENDTANGENTIAL _T("BlendTangential")
00133 #define OPTOKEN_ADDBLENDPATH _T("AddBlendPath")
00134 #define OPTOKEN_DETACHBLENDPATH _T("DetachBlendPath")
00135 #define OPTOKEN_CHANGEBLENDPROFILE _T("ChangeBlendProfile")
00136 #define OPTOKEN_EDITBLENDENDOBJECT _T("EditBlendEndobject")
00137 #define OPTOKEN_CHANGEBLENDDISTANCE _T("EditDistanceBetweenSteps")
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 class CompoundNodeTreeFactoryListItem : public ListItem
00151 {
00152 public:
00153 CompoundNodeTreeFactory * pFactory;
00154 } ;
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166 class CompoundNodeTreeFactoryList : public List
00167 {
00168 public:
00169 ~CompoundNodeTreeFactoryList();
00170
00171 void AddItem(CompoundNodeTreeFactory *pItem);
00172 CompoundNodeTreeFactory * GetItem(INT32 index);
00173 } ;
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189 class BlenderInfoItem: public ListItem
00190 {
00191 CC_DECLARE_MEMDUMP(BlenderInfoItem);
00192 public:
00193 BlenderInfoItem() { pNodeBlender = NULL; pNodeStart = pNodeEnd = NULL; }
00194
00195 NodeBlender* pNodeBlender;
00196 NodeRenderableInk* pNodeStart;
00197 NodeRenderableInk* pNodeEnd;
00198
00199 BlenderInfoItem* SimpleCopy() { BlenderInfoItem *pItem = new BlenderInfoItem;
00200 if (pItem != NULL)
00201 {
00202 pItem->pNodeBlender = pNodeBlender;
00203 pItem->pNodeStart = pNodeStart;
00204 pItem->pNodeEnd = pNodeEnd;
00205 }
00206 return pItem;
00207 }
00208 };
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226 class BlendToolRef : public CC_CLASS_MEMDUMP
00227 {
00228 CC_DECLARE_MEMDUMP(BlendToolRef)
00229
00230 public:
00231 BlendToolRef() { Reset(); }
00232 void Reset() { pNode = NULL;
00233 pNodeBlend = NULL;
00234 pBlendPath = NULL;
00235 pSpread = NULL;
00236 RemapRef = 0;
00237 Index = -1;
00238 }
00239
00240
00241 NodeRenderableInk* pNode;
00242 NodeBlend* pNodeBlend;
00243 BlendPath* pBlendPath;
00244 Spread* pSpread;
00245 UINT32 RemapRef;
00246 INT32 Index;
00247 BOOL AStartNode;
00248 DocCoord PointerPos;
00249 };
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262 class CCAPI BlendTool : public DragTool
00263 {
00264
00265 CC_DECLARE_MEMDUMP(BlendTool);
00266
00267 public:
00268 BlendTool();
00269 ~BlendTool();
00270
00271
00272 BOOL Init();
00273 void Describe(void* InfoPtr);
00274 UINT32 GetID() { return TOOLID_BLEND; };
00275
00276
00277 void SelectChange(BOOL isSelected);
00278 void OnClick( DocCoord, ClickType, ClickModifiers, Spread* );
00279 void OnMouseMove(DocCoord PointerPos,Spread* pSpread,ClickModifiers ClickMods);
00280 void RenderToolBlobs(Spread* pSpread,DocRect* pDocRect);
00281 BOOL GetStatusLineText(String_256* ptext, Spread*, DocCoord, ClickModifiers);
00282 BOOL OnKeyPress(KeyPress* pKeyPress);
00283
00284
00285 static BlendInfoBarOp* GetBlendInfoBarOp() { return pBlendInfoBarOp; }
00286 static BOOL IsCurrent();
00287 static void DisplayStatusBarHelp(UINT32 StatusID);
00288
00289 static BlendToolRef* GetPtrRefStart() { return pRefStart; }
00290 static BlendToolRef* GetPtrRefEnd() { return pRefEnd; }
00291
00292 static void UpdateRef(BlendToolRef* pRef,Spread* pSpread, DocCoord PointerPos,BOOL CheckNodeUnderPoint = TRUE);
00293 static void UpdateCursorAndStatus();
00294 static void CheckNodeRemapping(BlendToolRef* pRefStart, BlendToolRef* pRefEnd);
00295
00296
00297
00298 BOOL EditBlendEndAndUpdateCursor(Spread* pSpread, DocCoord PointerPos);
00299
00300 BOOL EditBlendEnd(Spread* pSpread, DocCoord PointerPos);
00301
00302 BOOL SelectedBlendIsOnCurve();
00303 void UpdateInfobar();
00304 private:
00305
00306
00307 static NodeRenderableInk* FindObject(Spread* pSpread, DocCoord ClickPos);
00308 static BOOL IsPointOverPathBlob(DocCoord* pPointerPos,BlendToolRef* pRef);
00309 static BOOL IsPointOverBlendBlob(DocCoord* pPointerPos,BlendToolRef* pRef);
00310
00311 BOOL CreateCursors();
00312 void DestroyCursors();
00313
00314
00315
00316 ShapeClickEffect DetermineClickEffect(DocCoord PointerPos, Spread* pSpread, NodeRegularShape** ReturnShape);
00317 BOOL RenderSelectInsideBlobs(RenderRegion* pRender, NodeRenderableInk* pNode);
00318
00319
00320 static BlendInfoBarOp* pBlendInfoBarOp;
00321
00322 BOOL m_EditEndObject;
00323
00324
00325 static Cursor* pcNormalCursor;
00326 static Cursor* pcBlendableCursor;
00327 static Cursor* pcBlendableBlobCursor;
00328 static Cursor* pcBlendableRemapCursor;
00329
00330 static Cursor* pcCurrentCursor;
00331 static INT32 CurrentCursorID;
00332
00333
00334 static UINT32 StatusID;
00335
00336
00337 static BlendToolRef *pRefStart;
00338 static BlendToolRef *pRefEnd;
00339
00340
00341 static TCHAR* FamilyName;
00342 static TCHAR* ToolName;
00343 static TCHAR* Purpose;
00344 static TCHAR* Author;
00345 };
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364 class BlendInfoBarOp : public InformationBarOp
00365 {
00366 CC_DECLARE_DYNCREATE( BlendInfoBarOp )
00367
00368 public:
00369 BlendInfoBarOp() { m_DetachBlendPath = FALSE; m_EditBlendSteps = TRUE; m_BlendedOnCurve = FALSE;
00370 m_BlendAntiAlias = TRUE, m_OneToOne = FALSE; m_Tangential = FALSE;
00371 DlgResID = _R(IDD_BLENDTOOLBAR);
00372 };
00373
00374 virtual void UpdateState();
00375 void UpdateInfoBarState();
00376
00377
00378
00379 MsgResult Message(Msg* Msg);
00380
00381
00382 NodeBlend* GetBlendOnCurve();
00383 static BOOL NonBlendsSelected();
00384 void EnableBlendSelectedGadgets(BOOL Enable);
00385 void LoadStringsIntoEffectCombo();
00386 void ShowEffectComboString(ColourBlendType Type);
00387 private:
00388
00389 void ChangeBitmapButtonState(CGadgetID GadgetID, BOOL* CurrentState);
00390
00391 void ChangeProfile(CProfileBiasGain* Profile, CGadgetID GadgetID);
00392 void ChangeProfileOnIdle(CProfileBiasGain* Profile, CGadgetID GadgetID);
00393
00394
00395 void SetBlendStepsEditText(INT32 NumSteps);
00396 void SetBlendDistanceEditText(INT32 NumSteps);
00397
00398 BOOL GetDistanceEntered( double* Distance);
00399 BOOL IsStepDistanceValid (UINT32 MinValue, UINT32 MaxValue, double Distance);
00400
00401 NodeBlender* GetBlender();
00402 NodeBlend* GetNodeBlend();
00403 BOOL GetNumSteps( UINT32 MinValue, UINT32 MaxValue, INT32* NumSteps);
00404 BOOL GetNumStepsFromDistance(UINT32 MinValue, UINT32 MaxValue, INT32* NumSteps);
00405
00406
00407 BOOL GetMeanBlendDistance(double* Distance);
00408 BOOL AllBlendsHaveSameNumSteps();
00409 BOOL AllBlendsHaveSameDistance();
00410
00411 void SetBlendEditState(EditState State);
00412
00413 BOOL CheckSelectionAndSet();
00414
00415 CProfileBiasGain* GetProfileFromSelection(CGadgetID GadgetID, BOOL* bMany, BOOL* bAllSameType);
00416 NodeBlend* GetCurrentNodeBlend();
00417 INT32 AttributeIndexModifier(INT32 CurrentIndex);
00418
00419 BOOL m_DetachBlendPath;
00420 BOOL m_EditBlendSteps;
00421
00422
00423 BOOL m_BlendAntiAlias;
00424 BOOL m_OneToOne;
00425 BOOL m_Tangential;
00426 BOOL m_BlendedOnCurve;
00427
00428 public:
00429
00430 CBiasGainGadget m_BiasGainGadgetPosition;
00431 CBiasGainGadget m_BiasGainGadgetAttribute;
00432
00433 };
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446 class BlendInfoBarOpCreate : public BarCreate
00447 {
00448 public:
00449 DialogBarOp* Create() { return (new BlendInfoBarOp); }
00450 };
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467 enum OpBlendOpType { BLENDOPTYPE_NONE,
00468 BLENDOPTYPE_NEW,
00469 BLENDOPTYPE_REMAP,
00470 BLENDOPTYPE_BLENDANDOBJECT,
00471 BLENDOPTYPE_BLENDANDBLEND,
00472 BLENDOPTYPE_BLENDBLENDONPATH,
00473 };
00474
00475 class OpBlendNodes : public SelOperation
00476 {
00477 CC_DECLARE_DYNCREATE(OpBlendNodes);
00478
00479 public:
00480
00481 OpBlendNodes();
00482 ~OpBlendNodes();
00483
00484
00485 BOOL DoDrag(BlendTool* pBlendTool);
00486 virtual BOOL SnappingDrag() { return FALSE; }
00487
00488
00489 virtual void DragPointerMove( DocCoord PointerPos, ClickModifiers ClickMods, Spread*, BOOL bSolidDrag);
00490 virtual void DragFinished( DocCoord PointerPos,
00491 ClickModifiers ClickMods, Spread*,
00492 BOOL Success, BOOL bSolidDrag);
00493
00494
00495 void RenderMyDragBlobs();
00496 void RenderDragBlobs(DocRect Rect,Spread* pSpread, BOOL bSolidDrag);
00497
00498
00499 static BOOL Declare();
00500 static OpState GetState(String_256* Description, OpDescriptor*);
00501
00502 void GetOpName(String_256* OpName);
00503
00504
00505 virtual BOOL Undo();
00506 virtual BOOL Redo();
00507
00508
00509 BOOL RecordBlenderInfo(List& BlenderList,NodeBlend* pNodeBlend);
00510 void DeinitBlenders(List& BlenderList);
00511 BOOL ReinitBlenders(List& BlenderList);
00512
00513
00514
00515
00516 BOOL GetNodeClosestToPoint(NodeRenderableInk** ppInk, BOOL StartBlend);
00517
00518 private:
00519
00520 BOOL DoBlendObjects();
00521 BOOL DoCreateBlender( NodeRenderableInk* pNodeStart,INT32 IndexStart,
00522 NodeRenderableInk* pNodeEnd,INT32 IndexEnd,
00523 Node* pContextNode, AttachNodeDirection AttachDir);
00524 BOOL DoRemapBlend();
00525 BOOL DoBlendBlendAndObject();
00526 BOOL DoBlendBlendAndBlend();
00527 BOOL DoDeinitBlenders(List& BlenderList);
00528 BOOL DoReinitBlenders(List& BlenderList);
00529
00530 BOOL DeterminBlendObjectsProcessorHit ();
00531
00532
00533 BlendToolRef* pRefStart;
00534 BlendToolRef* pRefEnd;
00535
00536 OpBlendOpType OpType;
00537
00538
00539 NodeBlend* pNodeBlend;
00540 NodeBlend* pNodeBlendStart;
00541 NodeBlend* pNodeBlendEnd;
00542
00543 BlendTool* m_pBlendTool;
00544
00545
00546 BOOL RemoveCompoundNodes(CompoundNodeTreeFactoryList * pList);
00547
00548
00549 BOOL RemoveCompoundNodesFromNode(Node * pNode, Node ** pRetnNode,
00550 CompoundNodeTreeFactoryList * pList);
00551
00552
00553 BOOL DoContourNode(Node * pNode, DocCoord PointerPos, UINT32 Steps);
00554
00555 };
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567 class OpAddBlendPath : public SelOperation
00568 {
00569 CC_DECLARE_DYNCREATE(OpAddBlendPath);
00570
00571 public:
00572
00573 OpAddBlendPath() {}
00574 ~OpAddBlendPath() {}
00575
00576
00577 static BOOL Declare();
00578 static OpState GetState(String_256* Description, OpDescriptor*);
00579
00580
00581 virtual void Do(OpDescriptor*);
00582 virtual void GetOpName(String_256* OpName);
00583
00584
00585
00586 BOOL IsBlendPathOnTopOfBlend(SelRange* pSel);
00587
00588 };
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600 class OpDetachBlendPath : public SelOperation
00601 {
00602 CC_DECLARE_DYNCREATE(OpDetachBlendPath);
00603
00604 public:
00605
00606 OpDetachBlendPath() {}
00607 ~OpDetachBlendPath() {}
00608
00609
00610 static BOOL Declare();
00611 static OpState GetState(String_256* Description, OpDescriptor*);
00612
00613
00614 virtual void Do(OpDescriptor*);
00615 virtual void GetOpName(String_256* OpName);
00616 };
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628 class OpRemoveBlend : public SelOperation
00629 {
00630 CC_DECLARE_DYNCREATE(OpRemoveBlend);
00631
00632 public:
00633
00634 OpRemoveBlend() {}
00635 ~OpRemoveBlend() {}
00636
00637
00638 static BOOL Declare();
00639 static OpState GetState(String_256* Description, OpDescriptor*);
00640
00641
00642 virtual void Do(OpDescriptor*);
00643 virtual void GetOpName(String_256* OpName);
00644 };
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656 class OpChangeBlendSteps : public SelOperation
00657 {
00658 CC_DECLARE_DYNCREATE(OpChangeBlendSteps);
00659
00660 public:
00661
00662 OpChangeBlendSteps() {}
00663 ~OpChangeBlendSteps() {}
00664
00665
00666 static BOOL Declare();
00667 static OpState GetState(String_256* Description, OpDescriptor*);
00668
00669
00670 virtual void DoWithParam(OpDescriptor*,OpParam* pOpParam);
00671 virtual void GetOpName(String_256* OpName);
00672
00673
00674 virtual BOOL MayChangeNodeBounds() const { return FALSE; }
00675
00676 BOOL DeterminBlendObjectsProcessorHit (OpParam* pOpParam, List* nodeList);
00677 };
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693 class ChangeBlendStepsAction : public Action
00694 {
00695
00696 CC_DECLARE_DYNCREATE(ChangeBlendStepsAction)
00697
00698 public:
00699 ChangeBlendStepsAction();
00700 ~ChangeBlendStepsAction();
00701 virtual ActionCode Execute();
00702 static ActionCode Init( Operation* pOp,
00703 ActionList* pActionList,
00704 Node* pThisNodeBlend,
00705 UINT32 NumSteps,
00706 double DistanceEntered,
00707 ChangeBlendStepsAction** NewAction);
00708 protected:
00709 Node* pNodeBlend;
00710 UINT32 OldNumSteps;
00711 double OldDistanceEntered;
00712 };
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726 class RemapBlendAction : public Action
00727 {
00728
00729 CC_DECLARE_DYNCREATE(RemapBlendAction)
00730
00731 public:
00732 RemapBlendAction();
00733 ~RemapBlendAction();
00734 virtual ActionCode Execute();
00735 static ActionCode Init( Operation* pOp,
00736 ActionList* pActionList,
00737 NodeBlend* pNodeBlend,
00738 UINT32 RemapRef,
00739 DocCoord PosStart,
00740 DocCoord PosEnd,
00741 RemapBlendAction** NewAction);
00742 protected:
00743 NodeBlend* pNodeBlend;
00744 UINT32 RemapRef;
00745 DocCoord InvPosStart;
00746 DocCoord InvPosEnd;
00747 };
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761 class InitBlendersAction : public Action
00762 {
00763
00764 CC_DECLARE_DYNCREATE(InitBlendersAction)
00765
00766 public:
00767 InitBlendersAction();
00768 ~InitBlendersAction();
00769 virtual ActionCode Execute();
00770 static ActionCode Init( OpBlendNodes* pOp,
00771 ActionList* pActionList,
00772 List* pBlenderInfoList,
00773 BOOL DeinitState,
00774 InitBlendersAction** NewAction);
00775 protected:
00776 List BlenderInfoList;
00777 BOOL Deinit;
00778 };
00779
00780
00781
00782
00783
00784 enum ChangeBlendType { CHANGEBLEND_NONE,
00785 CHANGEBLEND_ONETOONE,
00786 CHANGEBLEND_ANTIALIAS,
00787 CHANGEBLEND_COLOURBLENDTYPE,
00788 CHANGEBLEND_TANGENTIAL,
00789 CHANGEBLEND_OBJECTPROFILE,
00790 CHANGEBLEND_ATTRPROFILE,
00791 CHANGEBLEND_BLENDONPATH,
00792 CHANGEBLEND_EDITEND };
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804 class OpChangeBlend : public SelOperation
00805 {
00806 CC_DECLARE_DYNCREATE(OpChangeBlend);
00807
00808 public:
00809
00810 OpChangeBlend() { ChangeType = CHANGEBLEND_NONE; }
00811
00812 ~OpChangeBlend() {}
00813
00814
00815 static BOOL Declare();
00816 static OpState GetState(String_256* Description, OpDescriptor*);
00817
00818
00819 virtual void DoWithParam(OpDescriptor*,OpParam* pOpParam);
00820 virtual void GetOpName(String_256* OpName);
00821
00822 ChangeBlendType GetChangeType () { return (ChangeType); }
00823
00824 private:
00825 ChangeBlendType ChangeType;
00826 };
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838 class OpBlendOneToOne : public OpChangeBlend
00839 {
00840 CC_DECLARE_DYNCREATE(OpBlendOneToOne);
00841
00842 public:
00843
00844 OpBlendOneToOne() {}
00845 ~OpBlendOneToOne() {}
00846
00847
00848 static BOOL Declare();
00849 static OpState GetState(String_256* Description, OpDescriptor*);
00850
00851
00852 virtual void Do(OpDescriptor*);
00853 };
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865 class OpBlendAntialias : public OpChangeBlend
00866 {
00867 CC_DECLARE_DYNCREATE(OpBlendAntialias);
00868
00869 public:
00870
00871 OpBlendAntialias() {}
00872 ~OpBlendAntialias() {}
00873
00874
00875 static BOOL Declare();
00876 static OpState GetState(String_256* Description, OpDescriptor*);
00877
00878
00879 virtual void Do(OpDescriptor*);
00880 };
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892 class OpBlendTangential : public OpChangeBlend
00893 {
00894 CC_DECLARE_DYNCREATE(OpBlendTangential);
00895
00896 public:
00897
00898 OpBlendTangential() {}
00899 ~OpBlendTangential() {}
00900
00901
00902 static BOOL Declare();
00903 static OpState GetState(String_256* Description, OpDescriptor*);
00904
00905
00906 virtual void Do(OpDescriptor*);
00907 };
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919 class OpEditBlendEndObject : public SelOperation
00920 {
00921 CC_DECLARE_DYNCREATE(OpEditBlendEndObject);
00922
00923 public:
00924 OpEditBlendEndObject() {}
00925 OpEditBlendEndObject(BlendTool* pBlendTool);
00926 ~OpEditBlendEndObject();
00927
00928
00929 static BOOL Declare();
00930 static OpState GetState(String_256* Description, OpDescriptor*);
00931
00932
00933 virtual void GetOpName(String_256* OpName);
00934
00935
00936 virtual void DragPointerMove( DocCoord PointerPos, ClickModifiers ClickMods, Spread*, BOOL bSolidDrag);
00937 virtual void DragFinished( DocCoord PointerPos,
00938 ClickModifiers ClickMods, Spread*,
00939 BOOL Success, BOOL bSolidDrag);
00940 virtual void DragPointerIdle(DocCoord, ClickModifiers, Spread*, BOOL bSolidDrag);
00941
00942
00943 void RenderDragBlobs(Spread* pSpread, DocCoord CentrePosition, BOOL On);
00944 void RenderSelectedObjectBlobs(Spread* pSpread);
00945
00946 BOOL DoDrag(DocCoord PointerPos, Spread* pSpread);
00947 NodeBlendPath* GetNodeBlendPath();
00948
00949 protected:
00950 BOOL RecalculateBlend(DocCoord PointerPos);
00951
00952 BOOL GetClosestPointOnPath(DocCoord PointerPos, DocCoord* ClosestPoint);
00953 NodeBlender* GetBlenderAndPosition(Node* pNode, BOOL* First);
00954
00955
00956
00957 BOOL InsertChangeEndActions(double NewPathProportion, DocCoord NewPosition,
00958 Node* pNodeToEdit);
00959
00960 BOOL InsertChangeEndActions(double NewPathProportion, DocCoord NewPosition,
00961 double StepDistance, Node* pNodeToEdit);
00962
00963 BOOL CalculateNewNumStepsAndPosition(UINT32 OldNumSteps, double BlendDistance,
00964 double StepDistance, double* FixedDistance,
00965 double* MoveableDistance, UINT32* NewNumSteps);
00966
00967 BOOL InsertChangeProportion(double NewProp, BOOL FirstNode, NodeBlender* pEditBlender);
00968
00969
00970 Matrix* m_pTransMatrix;
00971 DocCoord m_StartCoord;
00972 DocCoord m_LastCoord;
00973 Range* m_pRange;
00974 Range* m_pCopyRange;
00975 NodeBlend* m_pNodeBlend;
00976 SelectionState* m_pSelState;
00977 NodeBlendPath* m_pNodeBlendPath;
00978 BlendTool* m_pBlendTool;
00979 };
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993 class ChangeBlendOpParam : public OpParam
00994 {
00995
00996 CC_DECLARE_MEMDUMP(ChangeBlendOpParam)
00997
00998 public:
00999 ChangeBlendOpParam() { ChangeType = CHANGEBLEND_NONE; }
01000 ~ChangeBlendOpParam() {}
01001
01002 void SetOldValues(NodeRenderableInk* pNodeBlend);
01003 void SetNewValues(NodeRenderableInk* pNodeBlend);
01004 void SwapOldAndNew();
01005 void SwapProfiles(CProfileBiasGain* pOldProfile, CProfileBiasGain* pNewProfile);
01006
01007 ChangeBlendType ChangeType;
01008
01009 BOOL NewAntiAlias;
01010 BOOL OldAntiAlias;
01011
01012 BOOL NewOneToOne;
01013 BOOL OldOneToOne;
01014
01015 ColourBlendType NewColBlendType;
01016 ColourBlendType OldColBlendType;
01017
01018 BOOL NewTangential;
01019 BOOL OldTangential;
01020
01021
01022 BOOL OldBlendedOnCurve;
01023 BOOL NewBlendedOnCurve;
01024
01025 CProfileBiasGain OldObjectProfile;
01026 CProfileBiasGain NewObjectProfile;
01027
01028 CProfileBiasGain OldAttrProfile;
01029 CProfileBiasGain NewAttrProfile;
01030
01031 EndObject OldEndObject;
01032 EndObject NewEndObject;
01033 };
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047 class ChangeBlendAction : public Action
01048 {
01049
01050 CC_DECLARE_DYNCREATE(ChangeBlendAction)
01051
01052 public:
01053 ChangeBlendAction();
01054 ~ChangeBlendAction();
01055 virtual ActionCode Execute();
01056 static ActionCode Init( Operation* pOp,
01057 ActionList* pActionList,
01058 NodeRenderableInk* pThisNodeBlend,
01059 ChangeBlendOpParam* pChangeParam,
01060 ChangeBlendAction** NewAction);
01061
01062 static void ChangeObjectProfileWithNoUndo (CProfileBiasGain &Profile, BOOL regenerateParents = FALSE);
01063 static void ChangeAttributeProfileWithNoUndo (CProfileBiasGain &Profile);
01064 protected:
01065 NodeRenderableInk* pNodeBlend;
01066 ChangeBlendOpParam ChangeParam;
01067 };
01068
01069
01070
01071
01072
01073 enum ChangeBlenderType { CHANGEBLENDER_NONE,
01074 CHANGEBLENDER_ANGLESTART,
01075 CHANGEBLENDER_ANGLEEND,
01076 CHANGEBLENDER_PATHSTART,
01077 CHANGEBLENDER_PATHEND,
01078 CHANGEBLENDER_REGEN,
01079 CHANGEBLENDER_NBPINDEX,
01080 CHANGEBLENDER_BLENDONCURVE,
01081 CHANGEBLENDER_SWAPENDS
01082 };
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095 class ChangeBlenderOpParam : public OpParam
01096 {
01097
01098 CC_DECLARE_MEMDUMP(ChangeBlenderOpParam)
01099
01100 public:
01101 ChangeBlenderOpParam() { m_ChangeType = CHANGEBLENDER_NONE; }
01102 ChangeBlenderOpParam(ChangeBlenderType Type) { m_ChangeType = Type; }
01103 ~ChangeBlenderOpParam() {}
01104
01105 void SetOldValues(NodeBlender* pNodeBlender);
01106 void SetNewValues(NodeBlender* pNodeBlender);
01107 void SwapOldAndNew();
01108
01109 ChangeBlenderType m_ChangeType;
01110
01111 double m_NewAngleStart;
01112 double m_OldAngleStart;
01113 double m_NewAngleEnd;
01114 double m_OldAngleEnd;
01115 double m_OldPathStart;
01116 double m_NewPathStart;
01117 double m_OldPathEnd;
01118 double m_NewPathEnd;
01119 INT32 m_OldNodeBlendPathIndex;
01120 INT32 m_NewNodeBlendPathIndex;
01121 BOOL m_OldBlendedOnCurve;
01122 BOOL m_NewBlendedOnCurve;
01123 INT32 m_OldObjIndexStart;
01124 INT32 m_NewObjIndexStart;
01125 INT32 m_OldObjIndexEnd;
01126 INT32 m_NewObjIndexEnd;
01127 };
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141 class ChangeBlenderAction : public Action
01142 {
01143
01144 CC_DECLARE_DYNCREATE(ChangeBlenderAction)
01145
01146 public:
01147 ChangeBlenderAction();
01148 ~ChangeBlenderAction();
01149 virtual ActionCode Execute();
01150 static ActionCode Init( Operation* pOp,
01151 ActionList* pActionList,
01152 NodeBlender* pNodeBlender,
01153 ChangeBlenderOpParam& ChangeParam);
01154 protected:
01155 NodeBlender* m_pNodeBlender;
01156 ChangeBlenderOpParam m_ChangeParam;
01157 };
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171 class InvalidateBoundsAction : public Action
01172 {
01173
01174 CC_DECLARE_DYNCREATE(InvalidateBoundsAction)
01175
01176 public:
01177 InvalidateBoundsAction();
01178 ~InvalidateBoundsAction();
01179 virtual ActionCode Execute();
01180 static ActionCode Init( Operation* pOp,
01181 ActionList* pActionList,
01182 NodeRenderableBounded* pNode,
01183 BOOL IncludeChildren);
01184 protected:
01185 NodeRenderableBounded* m_pNode;
01186 BOOL m_IncludeChildren;
01187 };
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202 class OpChangeBlendDistance : public SelOperation
01203 {
01204
01205 CC_DECLARE_DYNCREATE(OpChangeBlendDistance)
01206
01207 public:
01208 OpChangeBlendDistance() {}
01209 ~OpChangeBlendDistance() {}
01210
01211
01212 static BOOL Declare();
01213 static OpState GetState(String_256* Description, OpDescriptor*);
01214
01215
01216 virtual void DoWithParam(OpDescriptor*,OpParam* pOpParam);
01217 virtual void GetOpName(String_256* OpName);
01218
01219
01220
01221 protected:
01222 BOOL InsertChangeStepsAction(NodeBlend* pNodeBlend,
01223 double StepDistance,
01224 UINT32* NewNumSteps, double* NewDistances);
01225
01226 BOOL InsertChangePathProportion (NodeBlend* pNodeBlend,
01227 double StartDistance,
01228 double EndDistance);
01229
01230 BOOL InsertChangeLinearBlendActions(NodeBlend* pNodeBlend,
01231 Operation* pOp,
01232 double NewStepDistance);
01233
01234 BOOL CalculateNewNumStepsAndPosition(UINT32 OldNumSteps, double BlendDistance,
01235 double StepDistance, double* FixedDistance,
01236 double* MoveableDistance, UINT32* NewNumSteps);
01237
01238
01239 BOOL InsertTransformNodesAction(NodeBlend* pNodeBlend, double StartDistance, double EndDistance);
01240
01241 };
01242
01243
01244
01245
01246 #endif // INC_BLENDTOOL