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 #ifndef INC_NODEBEVELCONTROLLER
00100 #define INC_NODEBEVELCONTROLLER
00101
00102 #ifdef BUILDSHADOWS
00103
00104
00105
00106
00107 #include "clipattr.h"
00108
00109 class ContextMenu;
00110 class ExtendParams;
00111 class BlendNodeParam;
00112 class AttrClipView;
00113 class NodeBevel;
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125 class NodeBevelController : public NodeGroup
00126 {
00127 CC_DECLARE_DYNAMIC( NodeBevelController )
00128 public:
00129 NodeBevelController();
00130 NodeBevelController(Node* ContextNode,
00131 AttachNodeDirection Direction,
00132 BOOL Locked = FALSE,
00133 BOOL Mangled = FALSE,
00134 BOOL Marked = FALSE,
00135 BOOL Selected = FALSE
00136 ) ;
00137
00138 ~NodeBevelController();
00139
00140 NodeBevel * GetBevelNode();
00141
00142
00143 void CreateBevel();
00144
00145
00146 virtual Node* SimpleCopy();
00147 void CopyNodeContents(NodeBevelController* pNewNode);
00148 virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00149
00150
00151 virtual void PreExportRender( RenderRegion* pRender );
00152 virtual SubtreeRenderState RenderSubtree(RenderRegion* pRender, Node** ppNextNode = NULL, BOOL bClip = TRUE);
00153
00154
00155 virtual BOOL ExportRender( RenderRegion* pRender );
00156
00157 virtual void RenderTinyBlobs(RenderRegion* pRender);
00158
00159 virtual void Render(RenderRegion* pRender);
00160 virtual BOOL HidingNode();
00161 virtual BOOL ShowingNode();
00162
00163
00164 static BOOL SelectionHasBevelNode();
00165
00166
00167 static BOOL SelectionHasBevelInkNode();
00168
00169
00170 static NodeBevelController * GetSelectionBevelNode(INT32 num = 0);
00171 static NodeBevel * GetSelectionBevelInkNode(INT32 num = 0);
00172
00173 virtual void Transform( TransformBase& Trans );
00174
00175 DocRect GetBoundingRect(BOOL DontUseAttrs, BOOL HitTest);
00176 DocRect GetBlobBoundingRect();
00177
00178
00179 virtual void SelectInRect(const DocRect& Rect, SelStateAction st);
00180
00181
00182 BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
00183
00184
00185 BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00186
00187 BOOL WritePostChildrenNative(BaseCamelotFilter* pFilter);
00188 BOOL WritePostChildrenWeb(BaseCamelotFilter* pFilter);
00189
00190 BOOL LoadBevelFromRecord(CXaraFileRecord* pCXaraFileRecord);
00191
00192
00193 virtual ChangeCode OnChildChange(ObjChangeParam* pParam);
00194
00195 virtual BOOL AllowOp(ObjChangeParam *pParam, BOOL SetOpPermissionState = TRUE,
00196 BOOL DoPreTriggerEdit = TRUE);
00197
00198
00199 virtual BOOL RequiresAttrib(CCRuntimeClass* pAttribClass, BOOL Search = FALSE);
00200 virtual BOOL RequiresAttrib(NodeAttribute* pAttr, BOOL Search = FALSE);
00201 virtual BOOL CanAttrBeAppliedToMe(CCRuntimeClass* pAttribClass);
00202
00203
00204 BOOL PostImport();
00205
00206
00207 void DeleteCache();
00208
00209
00210 void RenderMyBlobs(RenderRegion * pRender);
00211
00212 DocRect GetBlobRect() { return m_BlobDocRect; }
00213
00214 virtual String Describe(BOOL Plural, BOOL Verbose);
00215
00216 virtual BOOL OnNodePopUp(Spread*, DocCoord, ContextMenu*);
00217
00218 BOOL DoBecomeA(BecomeA* pBecomeA);
00219 BOOL CanBecomeA(BecomeA* pBecomeA);
00220
00221
00222 BOOL PromoteHitTestOnChildrenToMe() const { return FALSE; }
00223
00224 BOOL ShouldITransformWithChildren() const { return TRUE; }
00225
00226 BOOL PostDuplicate(UndoableOperation* pOp);
00227
00228 void RenderEorDrag(RenderRegion * pRegion);
00229 virtual BOOL ChildrenAreEorDragRenderedByMe() { return TRUE; }
00230
00231 virtual BOOL NeedsTransparency() const {return TRUE;}
00232
00233
00234 void ReRenderBevelBitmap(double LightAngle);
00235
00236 virtual NodeRenderableInk * CreateTreeFromNodeToBlend(NodeRenderableInk * pNode,
00237 CCAttrMap * pAttrMap);
00238
00239
00240 virtual BOOL EndBlendStep(BlendNodeParam * pParam);
00241
00242 virtual BOOL PromoteAttributeApplicationToMe(CCRuntimeClass *pAttrClass) const;
00243
00244 BOOL AmDragging() { return m_bDrag; }
00245
00246 BOOL RegenerateNode(UndoableOperation * pOp, BOOL bCacheRender = FALSE,
00247 BOOL bInformParents = TRUE);
00248
00249
00250 BOOL RegenerateBevelBitmap(UndoableOperation * pOp, BOOL bInformParents = TRUE);
00251
00252 INT32 ComplexHide(UndoableOperation* pOp, Node* pNextInRange);
00253
00254
00255 virtual BOOL IsController() { return TRUE;}
00256 virtual BOOL IsABevelController() const { return TRUE;}
00257 virtual BOOL GroupCanTransformCached(TransformBase& Trans) const {return Trans.IsTranslation();}
00258
00259
00260 virtual NodeRenderableInk* GetInkNodeFromController() const;
00261
00262
00263
00264 virtual BOOL IsTypeExtendible() const { return TRUE; }
00265 virtual DocRect ValidateExtend(const ExtendParams& ExtParams);
00266 virtual void Extend(const ExtendParams& ExtParams);
00267
00268 void GetDebugDetails(StringBase* Str);
00269
00270 public:
00271
00272
00273 INT32 m_BevelType;
00274 INT32 m_Indent;
00275 LineCapType m_LType;
00276
00277 double m_LightAngle;
00278 BOOL m_bOuter;
00279 INT32 m_Contrast;
00280 double m_Tilt;
00281
00282
00283 BOOL m_bIncludeBlobsInBoundingRect;
00284
00285
00286 DocCoord m_BMPCentre;
00287 DocCoord m_BMPPoint1;
00288 DocCoord m_BMPPoint2;
00289
00290
00291 DocRect m_SelectedRect;
00292
00293 protected:
00294 void ApplyRelevantAttributes (CCAttrMap* ptrBevelMap, CCAttrMap* oldPathMap,
00295 CCAttrMap* newPathMap, CCAttrMap* pMap,
00296 CCAttrMap* pSingleMap);
00297
00298
00299 BOOL PreApplyClipViewNode(RenderRegion* pRender);
00300
00301 protected:
00302 DocRect m_BlobDocRect;
00303 DocCoord m_BlobCentre;
00304
00305
00306 BOOL m_bDrag;
00307
00308 BOOL m_HaveDoneApplyTest;
00309
00310
00311
00312 BOOL m_bBoundingRectIsForTool;
00313
00314 FIXED16 m_LastZoom;
00315
00316 BOOL m_PerformedExtend;
00317
00318 BOOL m_LastColoursTransparency;
00319
00320
00321 AttrClipView* m_pClipViewAttribute;
00322
00323 Path m_PathToClipVeiw;
00324 NodeBevel* m_pBevel;
00325
00326 double m_LastClipZoom;
00327
00328 } ;
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339 class BevelNodeTreeFactory : public CompoundNodeTreeFactory
00340 {
00341 CC_DECLARE_DYNCREATE(BevelNodeTreeFactory);
00342
00343 public:
00344
00345 BevelNodeTreeFactory(NodeBevelController * pController);
00346 ~BevelNodeTreeFactory();
00347
00348
00349 virtual NodeCompound * CreateNode(List *pList, UndoableOperation * pOp = NULL);
00350
00351 void SetBevelType(INT32 Type) { m_BevelType = Type; }
00352 void SetBevelLightAngle(INT32 Angle) { m_BevelLightAngle = Angle; }
00353 void SetBevelIndent(INT32 Indent) { m_BevelIndent = Indent; }
00354 void SetBevelContrast(INT32 Contrast) { m_BevelContrast = Contrast; }
00355
00356 private:
00357 List m_ControllerAttributeList;
00358 List m_BevelNodeAttributeList;
00359
00360 INT32 m_BevelType;
00361 INT32 m_BevelLightAngle;
00362 INT32 m_BevelIndent;
00363 INT32 m_BevelContrast;
00364 } ;
00365
00366
00367 #endif
00368 #endif