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 NODECNTR_H
00100 #define NODECNTR_H
00101
00102
00103
00104
00105 class ExtendParams;
00106 class NodeContourController;
00107 class AttrBrushType;
00108 class SumAllPathsElem;
00109 class NodeCompound;
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 class NodeContour : public NodeRenderableInk
00122 {
00123
00124 CC_DECLARE_DYNCREATE(NodeContour);
00125
00126 public:
00127 NodeContour();
00128
00129 NodeContour(Node* ContextNode,
00130 AttachNodeDirection Direction,
00131 BOOL Locked = FALSE,
00132 BOOL Mangled = FALSE,
00133 BOOL Marked = FALSE,
00134 BOOL Selected = FALSE
00135 ) ;
00136
00137 ~NodeContour();
00138
00139
00140 virtual Node* SimpleCopy();
00141 void CopyNodeContents(NodeContour* pNewNode);
00142 virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00143
00144
00145 virtual DocRect GetBoundingRect(BOOL DontUseAttrs = FALSE, BOOL HitTest = FALSE);
00146 virtual DocRect GetBlobBoundingRect();
00147
00148 virtual void RenderTinyBlobs(RenderRegion * pRegion);
00149
00150 virtual void Render(RenderRegion* pRender);
00151
00152 virtual BOOL DoBecomeA(BecomeA* pBecomeA);
00153 virtual BOOL CanBecomeA(BecomeA* pBecomeA);
00154
00155 virtual BOOL NeedsParent(Node* pClassNode) const;
00156 virtual NodeCompound* GetParentController() const;
00157
00158 virtual String Describe(BOOL Plural, BOOL Verbose);
00159
00160 virtual BOOL IsAContour() const { return TRUE;}
00161 BOOL GenerateContour(List * pList = NULL, CCAttrMap * pAttrMap = NULL);
00162
00163 void DeleteCache();
00164
00165 void Transform(TransformBase &Trans);
00166
00167 void RenderEorDrag(RenderRegion * pRender);
00168
00169
00170 virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00171 virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
00172
00173 virtual BOOL AllowOp(ObjChangeParam *pParam, BOOL SetOpPermissionState = TRUE,
00174 BOOL DoPreTriggerEdit = TRUE);
00175
00176
00177
00178 public:
00179 virtual BOOL IsTypeExtendible() const { return TRUE; }
00180 virtual DocRect ValidateExtend(const ExtendParams& ExtParams);
00181 virtual void Extend(const ExtendParams& ExtParams);
00182
00183
00184 static BOOL SmoothPath(Path * pPath);
00185
00186 virtual BOOL OnNodePopUp(Spread* pSpread, DocCoord PointerPos, ContextMenu* pMenu);
00187
00188 static BOOL GenerateContourPathForNode( Path* pDestPath,
00189 Node* pSourceNode,
00190 const List* pSourceList,
00191 const MILLIPOINT nWidth,
00192 const BOOL fOuterContour = TRUE,
00193 const JointType jt = RoundJoin,
00194 const MILLIPOINT nFlatness = -1,
00195 const BOOL fUseLineWidths = TRUE,
00196 const BOOL fIncludeShadows = FALSE );
00197
00198 virtual INT32 EstimateNodeComplexity (OpParam* details);
00199
00200 protected:
00201
00202 BOOL BlendAttributes(RenderRegion * pRender, CCAttrMap * pAttrMapStart,
00203 CCAttrMap * pEndAttrMap, CCAttrMap * pBlendedAttrMap,
00204 double BlendRatio);
00205
00206
00207 BOOL CopyAttributes(NodeRenderableInk * pNode, CCAttrMap * pAttrMap);
00208
00209
00210 BOOL SmoothPaths();
00211
00212
00213 NodeRenderableInk * FindNodeToContour(NodeRenderableInk * pInk);
00214
00215 protected:
00216
00217 Path m_SourcePath;
00218
00219
00220 Path * m_pPathList;
00221 INT32 m_NumPaths;
00222
00223 BOOL m_FirstRender;
00224
00225 } ;
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237 class ContourBecomeA : public BecomeA
00238 {
00239 public:
00240 ContourBecomeA( BecomeAReason Reason,
00241 CCRuntimeClass* pClass,
00242 UndoableOperation* pOp,
00243 BOOL Sel,
00244 Path * pPathList,
00245 Path * pSummedPath,
00246 INT32 Width,
00247 INT32 NumSteps,
00248 BOOL bOuter,
00249 CProfileBiasGain &Profile,
00250 JointType jt = RoundJoin,
00251 double Flatness = 200.0,
00252 BOOL bIncludeLineWidths = TRUE) : BecomeA(Reason, pClass, pOp, Sel)
00253 {
00254 m_pPathList = pPathList;
00255 m_bNodeIsPath = FALSE;
00256 m_Width = Width;
00257 m_NumSteps = NumSteps;
00258 m_pSummedPath = pSummedPath;
00259 m_bOuter = bOuter;
00260 m_Profile = Profile;
00261 m_Join = jt;
00262 m_Flatness = Flatness;
00263 m_bIncludeLineWidths = bIncludeLineWidths;
00264
00265
00266 fSilhouette = TRUE;
00267
00268 m_bContourBrush = FALSE;
00269 }
00270
00271
00272
00273 void SetNodeIsPath(BOOL b) { m_bNodeIsPath = b; }
00274
00275
00276 virtual BOOL PassBack(NodeRenderableInk* pNewNode,NodeRenderableInk* pCreatedByNode,CCAttrMap* pAttrMap);
00277
00278
00279 BOOL GenerateContourPaths(Path* pPathToContour, Path* pPathList, JointType jt, bool Outer = true,
00280 bool UseContourMode = true, LineCapType ct = LineCapRound);
00281
00282 void SetContourBrush(BOOL Set);
00283 protected:
00284
00285 BOOL PassbackBrush(NodeRenderableInk* pCreatedByNode, NodeRenderableInk** ppNewNode);
00286
00287 private:
00288 Path * m_pPathList;
00289
00290
00291 Path * m_pSummedPath;
00292 INT32 m_NumSteps;
00293 INT32 m_Width;
00294 BOOL m_bNodeIsPath;
00295 BOOL m_bOuter;
00296 BOOL m_bIncludeLineWidths;
00297
00298 CProfileBiasGain m_Profile;
00299
00300 JointType m_Join;
00301
00302 double m_Flatness;
00303
00304 BOOL m_bContourBrush;
00305
00306 };
00307
00308 #endif // NODECNTR_H
00309
00310
00311
00312
00313
00314