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_BLEND
00101 #define INC_BLEND
00102
00103
00104
00105 #include "blendatt.h"
00106
00107
00108 #pragma warning(disable: 4786)
00109 #include <list>
00110 #pragma warning(default: 4786)
00111
00112 class RenderRegion;
00113 class String_32;
00114 class NodeRect;
00115 class BlendPath;
00116 class NodeBlendPath;
00117 class NodeBlender;
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 class NodeBlend: public NodeGroup
00130 {
00131 public:
00132 CC_DECLARE_DYNAMIC( NodeBlend )
00133
00134 NodeBlend();
00135
00136 NodeBlend(Node* ContextNode,
00137 AttachNodeDirection Direction,
00138 BOOL Locked=FALSE,
00139 BOOL Mangled=FALSE,
00140 BOOL Marked=FALSE,
00141 BOOL Selected=FALSE
00142 );
00143
00144
00145 virtual void PreExportRender( RenderRegion* pRender );
00146 virtual BOOL ExportRender( RenderRegion* pRender );
00147 virtual void RenderBlendBlobs(RenderRegion* pRender);
00148 virtual void RenderObjectBlobs(RenderRegion* pRegion);
00149
00150 void RenderBlendOnCurveBlobs(RenderRegion* pRegion);
00151
00152
00153 void InvalidateBlendBoundingRect();
00154 DocRect GetBlobBoundingRect();
00155 BOOL AreBoundsValid() { return IsBoundingRectValid; }
00156 virtual DocRect GetBoundingRect(BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE);
00157
00158
00159 BOOL IsArtWorksEPSCompatible();
00160 INT32 GetNumInkObjects();
00161
00162
00163 virtual String Describe(BOOL Plural, BOOL Verbose);
00164 virtual Node* SimpleCopy();
00165 virtual UINT32 GetNodeSize() const;
00166 virtual BOOL OnNodePopUp(Spread* pSpread, DocCoord PointerPos, ContextMenu* pMenu);
00167 virtual BOOL PostImport();
00168 virtual BOOL IsABlend () { return (TRUE); }
00169
00170
00171 virtual BOOL OnClick( DocCoord, ClickType, ClickModifiers, Spread* );
00172 virtual BOOL HidingNode();
00173 virtual BOOL ShowingNode();
00174
00175
00176 virtual ChangeCode OnChildChange(ObjChangeParam* pParam);
00177 virtual BOOL AllowOp(ObjChangeParam* pParam, BOOL SetOpPermissionState = TRUE,
00178 BOOL DoPreTriggerEdit = TRUE);
00179
00180
00181 BOOL IsPointOverBlob(DocCoord* pPointerPos,
00182 BlendPath** ppBlendPath,
00183 INT32* pIndex,
00184 BOOL* pAStart,
00185 UINT32* pRemapRef);
00186
00187 BOOL Remap(UINT32 RemapRef,DocCoord PosStart,DocCoord PosEnd,DocCoord* pInvPosStart, DocCoord* pInvPosEnd);
00188 UINT32 GetNumBlenders();
00189 NodeBlender* FindFirstBlender();
00190 NodeBlender* FindNextBlender(NodeBlender* pNodeBlender);
00191 NodeBlender* FindLastBlender();
00192 BOOL FindFirstAndLastBlenders(NodeBlender** ppFirstBlender, NodeBlender** ppLastBlender);
00193
00194
00195 BOOL IsOneToOne();
00196 void SetOneToOne(BOOL state);
00197
00198
00199 BOOL IsNotAntialiased();
00200 void SetNotAntialiased(BOOL state);
00201
00202
00203 virtual BOOL DoBecomeA(BecomeA* pBecomeA);
00204
00205
00206 UINT32 GetNumBlendSteps();
00207 void SetNumBlendSteps(UINT32 NumSteps);
00208
00209
00210 ColourBlendType GetColourBlendType();
00211 void SetColourBlendType(ColourBlendType Type);
00212
00213
00214 EditState GetEditState();
00215 void SetEditState(EditState State);
00216
00217 BOOL Reinit(BOOL ProgressBar = TRUE);
00218 void Deinit(BOOL bNodesMayBeChanged = FALSE);
00219
00220 static BOOL GetDefaultAntialias() { return !s_DefaultNotAntialiased; }
00221
00222
00223 virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00224 virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
00225 virtual BOOL WritePreChildren(BaseCamelotFilter* pFilter);
00226 virtual BOOL CanWriteChildrenWeb(BaseCamelotFilter* pFilter);
00227 virtual BOOL CanWriteChildrenNative(BaseCamelotFilter* pFilter);
00228
00229
00230 NodeBlendPath* GetNodeBlendPath(UINT32 Index);
00231 BOOL BlendAlongThisPath(NodePath* pPath,CCAttrMap* pAttrMap,UndoableOperation* pUndoOp, BOOL BlendPathOnTop);
00232 virtual Node* HasEditableChild(CCRuntimeClass *ChildClass, Node* pPrevEditable);
00233 BOOL TransformBlendEndObjects(UndoableOperation* pUndoOp);
00234 BOOL RotateBlendEndObjectsBack(UndoableOperation* pUndoOp);
00235 BOOL TransformNodeToPoint(NodeRenderableInk* pNode,DocCoord* pPoint,UndoableOperation* pUndoOp,double Angle);
00236 BOOL InitBlenderPathProportions(UndoableOperation* pUndoOp);
00237 BOOL DetachNodeBlendPath(Node* pContextNode, AttachNodeDirection AttDir,UndoableOperation* pUndoOp);
00238 BOOL IsTangential();
00239 void SetTangential(BOOL Tangential);
00240 BOOL IsOnACurve();
00241 void SetBlendedOnCurve(BOOL State);
00242
00243
00244 CProfileBiasGain* GetObjectProfile() { return &m_ObjectProfile; }
00245 CProfileBiasGain* GetAttrProfile() { return &m_AttrProfile; }
00246 CProfileBiasGain* GetPositionProfile() { return &m_PositionProfile; }
00247
00248
00249 BOOL GetBlendDistance(BOOL GetFullDistance, double* Distance);
00250
00251
00252 BOOL GetNumStepsFromDistance(double StepDistance, UINT32* NumSteps);
00253
00254 double GetStepDistance();
00255 void UpdateStepDistance();
00256 double GetDistanceEntered();
00257 void SetDistanceEntered(double Distance);
00258
00259 EndObject GetLastEdited();
00260 void SetLastEdited(EndObject ObjectEdited);
00261 BOOL GetStartAndEndProportions(double* StartProp, double* EndProp);
00262 BOOL GetStartAndEndNodes(Node** ppStart, Node** ppEnd);
00263 BOOL IsChildOfGroup();
00264 BOOL HitOnEndDragBlob(DocCoord Point, Node** ppHitNode);
00265
00266
00267 NodeCompound* GetParentController() const;
00268
00269
00270 UINT32 GetNumNodeBlendPaths();
00271 void SetNumNodeBlendPathsInc(BOOL Increase);
00272 void SetNumNodeBlendPaths(INT32 Index);
00273 BOOL HitOnDragBlob(NodeRenderableInk* pInk, DocCoord PointerPos);
00274
00275
00276
00277 NodeBlender* NodeIsPartOfBlender(Node* pNode, BOOL First);
00278
00279
00280
00281 NodeBlender* NodeIsPartOfBlender(Node* pNode, NodeBlender* pBlender, BOOL* First);
00282
00283
00284 BOOL NonLinearObjectProfile();
00285
00286 BOOL ContainsBrushedNode();
00287
00288
00289
00290
00291 void RequestObjectProfileProcessing (BOOL newVal) { objectProfileProcessing = newVal; }
00292 BOOL GetObjectProfileProcessing () { return (objectProfileProcessing); }
00293
00294 virtual INT32 EstimateNodeComplexity (OpParam* details);
00295
00296
00297
00298
00299
00300
00301
00302
00303 BOOL ReinitialiseOnChildChanged(UndoableOperation* pOp, NodeRenderableInk* pOldChild,
00304 NodeRenderableInk* pNewChild);
00305
00306 virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00307
00308
00309
00310
00311
00312
00313 public:
00314 virtual BOOL IsTypeExtendible() const { return TRUE; }
00315 virtual DocRect ValidateExtend(const ExtendParams& ExtParams);
00316 virtual void Extend(const ExtendParams& ExtParams);
00317 protected:
00318 void FindExtendingChildren(std::list<NodeRenderableInk*>&, std::list<NodeBlendPath*>&);
00319
00320 private:
00321 void CopyNodeContents(NodeBlend* pCopyOfNode);
00322 void ResetVars();
00323
00324 BOOL objectProfileProcessing;
00325
00326 String_32 m_BlendName;
00327
00328
00329
00330 UINT32 m_NumBlendSteps;
00331
00332
00333
00334 double m_StepDistance;
00335 double m_DistanceEntered;
00336 EndObject m_LastEdited;
00337
00338
00339
00340
00341 BOOL m_AWEPSCompatible;
00342 BOOL m_AWEPSCompatibleCache;
00343
00344
00345 BOOL m_OneToOne;
00346
00347
00348 BOOL m_NotAntialiased;
00349
00350
00351 ColourBlendType m_ColBlendType;
00352
00353
00354 BOOL m_Tangential;
00355
00356
00357 BOOL m_BlendedOnCurve;
00358
00359
00360 EditState m_Edit;
00361
00362 CProfileBiasGain m_ObjectProfile;
00363 CProfileBiasGain m_AttrProfile;
00364 CProfileBiasGain m_PositionProfile;
00365
00366 static BOOL s_DefaultNotAntialiased;
00367
00368 UINT32 m_NumNodeBlendPaths;
00369 };
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383 enum InitBlendActionType { IBAT_INVALID, IBAT_INIT, IBAT_INITONBLENDER };
00384
00385 class InitBlendAction : public Action
00386 {
00387
00388 CC_DECLARE_DYNCREATE(InitBlendAction)
00389
00390 public:
00391 InitBlendAction();
00392 ~InitBlendAction();
00393 virtual ActionCode Execute();
00394 static ActionCode Init( UndoableOperation* pOp,
00395 ActionList* pActionList,
00396 NodeBlend* pThisNodeBlend,
00397 BOOL StoreStartAndEndNodes=FALSE,
00398
00399 BOOL bReverse = FALSE,
00400
00401 BOOL bNodesMayBeChanged = FALSE
00402 );
00403
00404
00405
00406
00407
00408 static ActionCode InitOnBlender( UndoableOperation* pOp,
00409 ActionList* pActionList,
00410 NodeBlender* pThisNodeBlender,
00411 BOOL StoreStartAndEndNodes=FALSE,
00412
00413 BOOL bReverse = FALSE);
00414
00415
00416 protected:
00417 NodeBlend* m_pNodeBlend;
00418 NodeBlender* m_pNodeBlender;
00419 Node * m_pStartNode;
00420 Node * m_pEndNode;
00421 BOOL m_bReverse;
00422 BOOL m_bStoreStartAndEndNodes;
00423 InitBlendActionType m_enInitType;
00424 BOOL m_bNodesMayBeChanged;
00425 };
00426
00427 #endif