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 NCNTRCNT_H
00100 #define NCNTRCNT_H
00101
00102 #include "blendatt.h"
00103 #include "pathpcs.h"
00104
00105
00106
00107 #include "qualattr.h"
00108
00109
00110
00111 class NodeContour;
00112 class CCAttrMap;
00113 class ExtendParams;
00114 class BlendNodeParam;
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125 class InsetPathPathProcessor : public PathProcessor
00126 {
00127 CC_DECLARE_DYNAMIC(InsetPathPathProcessor);
00128 public:
00129 InsetPathPathProcessor();
00130 ~InsetPathPathProcessor();
00131
00132 virtual void ProcessPath(Path *pPath,
00133 RenderRegion *pRender,
00134 PathShape ShapePath = PATHSHAPE_PATH);
00135
00136 void SetActive(BOOL b) { m_bActive = b; }
00137 private:
00138 BOOL m_bActive;
00139 } ;
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153 class NodeContourController : public NodeGroup
00154 {
00155
00156 CC_DECLARE_DYNCREATE(NodeContourController);
00157
00158 public:
00159 NodeContourController();
00160
00161 NodeContourController(Node* ContextNode,
00162 AttachNodeDirection Direction,
00163 BOOL Locked = FALSE,
00164 BOOL Mangled = FALSE,
00165 BOOL Marked = FALSE,
00166 BOOL Selected = FALSE
00167 ) ;
00168
00169 ~NodeContourController();
00170
00171
00172 virtual Node* SimpleCopy();
00173 void CopyNodeContents(NodeContourController* pNewNode);
00174 virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00175
00176
00177 virtual DocRect GetBoundingRect(BOOL DontUseAttrs = FALSE, BOOL HitTest = FALSE);
00178 virtual DocRect GetBlobBoundingRect();
00179
00180
00181 virtual void SelectInRect(const DocRect& Rect, SelStateAction st);
00182
00183 virtual void PreExportRender( RenderRegion* pRender );
00184 virtual BOOL ExportRender( RenderRegion* pRender );
00185 virtual void Render(RenderRegion* pRender);
00186
00187 virtual void RenderTinyBlobs(RenderRegion* pRender);
00188
00189 virtual BOOL DoBecomeA(BecomeA* pBecomeA);
00190 virtual BOOL CanBecomeA(BecomeA* pBecomeA);
00191
00192 virtual NodeRenderableInk * CreateTreeFromNodeToBlend(NodeRenderableInk * pNode,
00193 CCAttrMap * pAttrMap);
00194
00195
00196 virtual BOOL RegenerateNode(UndoableOperation * pOp = NULL,
00197 BOOL bCacheRender = FALSE, BOOL bInformParents = TRUE);
00198
00199 virtual ChangeCode OnChildChange(ObjChangeParam* pParam);
00200
00201
00202
00203 virtual BOOL PromoteHitTestOnChildrenToMe() const { return FALSE; }
00204
00205
00206 virtual BOOL ShouldITransformWithChildren() const { return TRUE; }
00207
00208
00209 NodeContour * GetContourNode();
00210
00211 void SetNumberOfSteps(UINT32 Steps) { m_Steps = Steps; }
00212 void SetWidth(INT32 Width) { m_Width = Width; }
00213
00214 void SetColourBlendType(ColourBlendType Type) { m_BlendType = Type; }
00215 ColourBlendType GetColourBlendType() { return m_BlendType; }
00216
00217 UINT32 GetNumberOfSteps() { return m_Steps; }
00218 INT32 GetWidth() { return m_Width; }
00219
00220 virtual String Describe(BOOL Plural, BOOL Verbose);
00221
00222 void Transform(TransformBase &Trans);
00223
00224
00225 virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00226 virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
00227
00228 virtual BOOL PostImport();
00229
00230
00231 BOOL AreOpenPathsInChildren();
00232
00233 virtual BOOL AllowOp(ObjChangeParam *pParam, BOOL SetOpPermissionState = TRUE,
00234 BOOL DoPreTriggerEdit = TRUE);
00235
00236 virtual BOOL RegenerateForPrinting() { return FALSE; }
00237
00238 virtual void RenderEorDrag( RenderRegion* pRender );
00239 virtual BOOL ChildrenAreEorDragRenderedByMe() { return TRUE; }
00240
00241 INT32 ComplexHide(UndoableOperation* pOp, Node* pNextInRange);
00242
00243 void SetObjectProfile( const CProfileBiasGain &Profile ) { m_ObjBiasGain = Profile; }
00244 void SetAttrProfile( const CProfileBiasGain &Profile ) { m_AttrBiasGain = Profile; }
00245 CProfileBiasGain GetObjectProfile() { return m_ObjBiasGain; }
00246 CProfileBiasGain GetAttrProfile() { return m_AttrBiasGain; }
00247 CProfileBiasGain* GetObjectProfilePtr() { return &m_ObjBiasGain; }
00248 CProfileBiasGain* GetAttrProfilePtr() { return &m_AttrBiasGain; }
00249
00250 virtual BOOL IsController() { return TRUE;}
00251 virtual BOOL IsAContourController() const { return TRUE;}
00252
00253 virtual BOOL EndBlendStep(BlendNodeParam * pParam);
00254
00255 BOOL IsContourAnOuterContour() { return (m_Width < 0); }
00256
00257
00258
00259 BOOL GetInsetPathFlag() { return m_bInsetPath; }
00260 void SetInsetPathFlag(BOOL b) { m_bInsetPath = b; }
00261
00262 public:
00263 virtual BOOL IsTypeExtendible() const { return TRUE; }
00264 virtual DocRect ValidateExtend(const ExtendParams& ExtParams);
00265 virtual void Extend(const ExtendParams& ExtParams);
00266
00267 public:
00268
00269 virtual SubtreeRenderState RenderSubtree(RenderRegion* pRender, Node** ppNextNode = NULL, BOOL bClip = TRUE);
00270
00271
00272 void DisableInsetPathPathProcessor();
00273 void EnableInsetPathPathProcessor();
00274
00275 virtual BOOL PromoteAttributeApplicationToMe(CCRuntimeClass *pAttrClass) const;
00276
00277 NodeContour* GetContour ();
00278
00279
00280 virtual NodeRenderableInk* GetInkNodeFromController() const;
00281 virtual BOOL GroupCanTransformCached(TransformBase& Trans) const {return Trans.IsTranslation();}
00282
00283 protected:
00284 BOOL DealWithJoinTypeChange(UndoableOperation * pOp);
00285
00286
00287 private:
00288 BOOL BlendParameters (NodeContourController * pStart, NodeContourController * pEnd, double Scale);
00289 BOOL BlendParameters(NodeContourController * pStart, double Scale);
00290
00291 protected:
00292 UINT32 m_Steps;
00293 INT32 m_Width;
00294 ColourBlendType m_BlendType;
00295
00296 CProfileBiasGain m_AttrBiasGain;
00297 CProfileBiasGain m_ObjBiasGain;
00298
00299 BOOL m_bInsetPath;
00300 BOOL m_PerformedExtend;
00301
00302 InsetPathPathProcessor* m_pPathProc;
00303 } ;
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314 class ContourNodeTreeFactory : public CompoundNodeTreeFactory
00315 {
00316 CC_DECLARE_DYNCREATE(ContourNodeTreeFactory);
00317
00318 public:
00319 ContourNodeTreeFactory();
00320 ~ContourNodeTreeFactory();
00321
00322 NodeCompound * CreateNode(List * pList, UndoableOperation * pOp = NULL);
00323
00324 void SetNumberOfSteps(UINT32 Steps) { m_Steps = Steps; }
00325 void SetWidth(UINT32 Width) { m_Width = Width; }
00326 UINT32 GetNumberOfSteps() { return m_Steps; }
00327 UINT32 GetWidth() { return m_Width; }
00328 void SetAttributeMap(CCAttrMap * pMap) { m_pMap = pMap; }
00329 void SetInsetPathFlag(BOOL b) { m_bInsetPath = b; }
00330 protected:
00331 UINT32 m_Steps;
00332 UINT32 m_Width;
00333 CCAttrMap * m_pMap;
00334 BOOL m_bInsetPath;
00335 } ;
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346 class ContourNodePathProcessor : public PathProcessor
00347 {
00348 CC_DECLARE_DYNCREATE(ContourNodePathProcessor);
00349 public:
00350 ContourNodePathProcessor();
00351 ~ContourNodePathProcessor();
00352
00353 virtual void ProcessPath(Path * pPath,
00354 RenderRegion * pRegion,
00355 PathShape ShapePath = PATHSHAPE_PATH);
00356
00357 void SetActive(BOOL bActive) { m_bActive = bActive; }
00358
00359 void SetIsPrinting(BOOL bPrinting) { m_bPrinting = bPrinting; }
00360
00361
00362
00363 void TestLineWidth(BOOL bLineWidth) { m_bLineWidthTest = bLineWidth; }
00364
00365
00366 static MILLIPOINT GetMaxInnerContourWidth(NodeCompound * pNode);
00367
00368 private:
00369 BOOL m_bActive;
00370 BOOL m_bLineWidthTest;
00371 BOOL m_bPrinting;
00372 BOOL m_bRespectJoinType;
00373 } ;
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386 class ContourRecordHandler : public CamelotRecordHandler
00387 {
00388
00389 CC_DECLARE_DYNCREATE(ContourRecordHandler)
00390
00391 public:
00392
00393 ContourRecordHandler();
00394 ~ContourRecordHandler();
00395 virtual UINT32* GetTagList();
00396 virtual BOOL HandleRecord(CXaraFileRecord* pCXaraFileRecord);
00397 } ;
00398
00399
00400 #endif
00401
00402
00403
00404
00405
00406