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_NODEMOULD
00101 #define INC_NODEMOULD
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 #include "objchge.h"
00112
00113 #define OPTOKEN_NODEMOULD _T("MouldObject")
00114 #define MOULD_EPS_VERSION 100 // v 1.00
00115
00116
00117 class NodeMoulder;
00118 class NodeMouldGroup;
00119 class NodeMouldPath;
00120 class MouldGeometry;
00121 class BaseCamelotFilter;
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 typedef enum MouldSpace {
00134 MOULDSPACE_UNDEFINED,
00135 MOULDSPACE_ENVELOPE,
00136 MOULDSPACE_PERSPECTIVE,
00137 MOULDSPACE_ENVELOPE2X2
00138 };
00139
00140 #define REC_REBUILD 1
00141 #define REC_PATHARRAYS 2
00142 #define REC_BLOBS 4
00143 #define REC_GEOMETRY 8
00144 #define REC_GEOMCONTEXT 16
00145
00146 #define REC_TYPE INT32
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161 class NodeMould: public NodeGroup
00162 {
00163 friend class RecordChangeCodesAction;
00164
00165 CC_DECLARE_DYNAMIC( NodeMould );
00166
00167 public:
00168 NodeMould();
00169 NodeMould(Node* ContextNode,
00170 AttachNodeDirection Direction,
00171 BOOL Locked=FALSE,
00172 BOOL Mangled=FALSE,
00173 BOOL Marked=FALSE,
00174 BOOL Selected=FALSE
00175 );
00176 ~NodeMould();
00177
00178 void InitialiseVars();
00179
00180
00181 virtual void PreExportRender( RenderRegion* pRender );
00182 virtual BOOL ExportRender( RenderRegion* pRender );
00183 virtual BOOL PostImport();
00184
00185 virtual void RenderObjectBlobs(RenderRegion* pRender);
00186 virtual void RenderTinyBlobs(RenderRegion* pRender);
00187 virtual DocRect GetBlobBoundingRect();
00188 virtual void Transform( TransformBase& Trans );
00189
00190
00191 virtual String Describe(BOOL Plural, BOOL Verbose);
00192 virtual Node* SimpleCopy();
00193 virtual UINT32 GetNodeSize() const;
00194 virtual BOOL IsANodeMould() const;
00195
00196
00197 virtual BOOL OnClick( DocCoord, ClickType, ClickModifiers, Spread* );
00198 BOOL OnMouseMove( DocCoord, Spread*, ClickModifiers, INT32*, INT32* );
00199
00200
00201 virtual ChangeCode OnChildChange(ObjChangeParam* pParam);
00202
00203
00204 virtual Node* HasEditableChild(CCRuntimeClass *ChildClass, Node* pPrevEditable);
00205 virtual BOOL OnNodePopUp(Spread* pSpread, DocCoord PointerPos, ContextMenu* pMenu);
00206
00207
00208 virtual BOOL CanBecomeA(BecomeA* pBecomeA);
00209 virtual BOOL DoBecomeA(BecomeA* pBecomeA);
00210
00211 virtual BOOL AllowSelectInside() const { return FALSE; }
00212
00213 #ifdef _DEBUG
00214 void ShowDebugTreeDetails() const;
00215 #endif
00216 void GetDebugDetails( StringBase* Str );
00217
00218
00219 void PreExportCAMEPS(RenderRegion* pRegion);
00220 BOOL PostExportCAMEPS(RenderRegion* pRegion);
00221 void PreExportAWEPS(RenderRegion* pRegion);
00222 BOOL PostExportAWEPS(RenderRegion* pRegion);
00223
00224 void ToggleDetachFlag();
00225 BOOL IsDetached() const { return DetachedGeometry; }
00226
00227
00228 virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00229 virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
00230
00231
00232 static void RemovePerspectiveFills(Node* pParentNode, UndoableOperation* pUndoOp);
00233
00234
00235
00236
00237
00238
00239 public:
00240 virtual BOOL IsTypeExtendible() const { return TRUE; }
00241 virtual DocRect ValidateExtend(const ExtendParams& ExtParams);
00242 virtual void Extend(const ExtendParams& ExtParams);
00243
00244
00245 virtual DocRect GetExtendTargetBounds(const ExtendParams& ExtParams);
00246
00247 virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00248
00249
00250
00251 public:
00252 MouldSpace DescribeGeometry();
00253 MouldGeometry* GetGeometry() const { return pMouldGeometry; }
00254 NodeMouldPath* GetPathShape();
00255 Path* GetPath();
00256 DocRect GetRenderBounds();
00257 DocRect GetChildrensBounds();
00258
00259 void DisableBlobs() { RenderBlobs=FALSE; }
00260 void EnableBlobs() { RenderBlobs=TRUE; }
00261
00262 BOOL CreateGeometry(MouldSpace mSpace);
00263 NodeMoulder* CreateNewMoulder(UndoableOperation*);
00264 NodeMouldPath* CreateNewMouldShape(Path* pPath, DocRect* const pDestin, UndoableOperation* pOp);
00265 NodeMouldGroup* CreateNewMouldGroup(UndoableOperation* pOp);
00266 BOOL CreateAllMoulderObjects(UndoableOperation* pOp);
00267
00268 NodeMoulder* AddNewMoulder(Node*, AttachNodeDirection, UndoableOperation*);
00269 NodeMouldPath* AddNewMouldShape(Path* pPath, DocRect* const pDestin, UndoableOperation* pOp);
00270 NodeMouldGroup* AddNewMouldGroup(UndoableOperation* pOp);
00271
00272 BOOL FillMouldGroup(NodeMouldGroup*, List*, UndoableOperation*);
00273
00274 NodeMoulder* FindFirstMoulder(BOOL errorcheck=TRUE);
00275 NodeMoulder* FindNextMoulder(NodeMoulder* pNodeMoulder);
00276 NodeMouldGroup* FindMouldGroup(BOOL errorcheck=TRUE);
00277 ChangeCode RemouldAll(UndoableOperation* pUndoOp);
00278 ChangeCode StartSaveContext(UndoableOperation* pUndoOp, REC_TYPE);
00279 ChangeCode EndSaveContext(UndoableOperation* pUndoOp, REC_TYPE);
00280 BOOL CreateAttrSetFromChildren(AttrTypeSet& AttSet);
00281
00282
00283 BOOL SetGeometry(MouldGeometry*);
00284 INT32 CountMoulders();
00285
00286
00287 virtual BOOL IsValidEffectAttr(NodeAttribute* pAttr) const {return FALSE;}
00288 virtual BOOL GroupCanTransformCached(TransformBase& Trans) const {return TRUE;}
00289
00290 private:
00291 void RedrawMould();
00292 void CopyNodeContents(NodeMould* pCopyOfNode);
00293 ChangeCode HandleMouldShapeChange(ObjChangePathEdit* pParam);
00294 void IncludeChildrensBoundingRects(DocRect& BoundingRect);
00295 BOOL OverMouldEndPoint(DocCoord coord, Spread* pSpread);
00296 ChangeCode RecordChangeCodes(UndoableOperation* pOp);
00297 ChangeCode ConvertCode(ActionCode Act);
00298
00299 String_32 MouldName;
00300
00301 MouldGeometry* pMouldGeometry;
00302 BOOL DetachedGeometry;
00303
00304 private:
00305
00306 INT32 OnCC_CRC;
00307 INT32 OnCC_Width;
00308 INT32 OnCC_Height;
00309 BOOL RenderBlobs;
00310 };
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324 class RecordChangeCodesAction : public Action
00325 {
00326 CC_DECLARE_DYNCREATE(RecordChangeCodesAction)
00327
00328 public:
00329 RecordChangeCodesAction();
00330 ~RecordChangeCodesAction();
00331 virtual ActionCode Execute();
00332 static ActionCode Init( Operation* pOp,
00333 ActionList* pActionList,
00334 NodeMould* pMould,
00335 Action** NewAction);
00336 private:
00337 NodeMould* pCRCMould;
00338 INT32 CRCcode;
00339 INT32 CRCWidth;
00340 INT32 CRCHeight;
00341 };
00342
00343
00344 #endif