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
00101
00102
00103
00104 #ifndef INC_BLENDATTRPARAM
00105 #define INC_BLENDATTRPARAM
00106
00107 class CCAttrMap;
00108 class NodeAttribute;
00109 class AttributeValue;
00110 class NodeRenderableInk;
00111 class BlendPath;
00112 class NodeBlendPath;
00113 class HandleBecomeA;
00114 class SumAllPathsPathProcessor;
00115 class NodeBlend;
00116
00117 enum ColourBlendType { COLOURBLEND_FADE,
00118 COLOURBLEND_RAINBOW,
00119 COLOURBLEND_ALTRAINBOW,
00120 COLOURBLEND_NONE
00121 };
00122
00123 enum EditState {EDIT_STEPS, EDIT_DISTANCE,};
00124 enum EndObject {NONE, FIRST, LAST};
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144 class BlendAttrParam : public CC_CLASS_MEMDUMP
00145 {
00146 CC_DECLARE_MEMDUMP(BlendAttrParam);
00147 public:
00148 BlendAttrParam();
00149
00150
00151
00152 ~BlendAttrParam();
00153
00154
00155 BOOL Init(RenderRegion *pThisRenderRegion,
00156 NodeAttribute* pThisOtherAttr, double ThisBlendRatio,
00157 ColourBlendType ColBlend, CCAttrMap* pStartAttrMap, CCAttrMap* pEndAttrMap, BOOL LastStep=FALSE);
00158
00159 BOOL Init(RenderRegion *pThisRenderRegion,
00160 NodeAttribute* pThisOtherAttr, double ThisBlendRatio, double thisObjectRatio, BOOL objProcess,
00161 ColourBlendType ColBlend, CCAttrMap* pStartAttrMap, CCAttrMap* pEndAttrMap, BOOL LastStep=FALSE);
00162
00163
00164 RenderRegion* GetRenderRegion() { return pRenderRegion; }
00165 NodeAttribute* GetOtherAttr() { return pOtherNodeAttr; }
00166 AttributeValue* GetOtherAttrVal() { return pOtherAttrVal; }
00167 double GetBlendRatio() { return BlendRatio; }
00168 double GetObjectRatio() { return objectRatio; }
00169 BOOL GetObjectProfileProcessing () { return (objectProfileProcessing); }
00170 ColourBlendType GetColourBlend() { return ColourBlend; }
00171
00172 CCAttrMap* GetStartAttrMap() { return pAttrMapStart; }
00173 CCAttrMap* GetEndAttrMap() { return pAttrMapEnd; }
00174
00175
00176
00177
00178
00179
00180
00181 NodeAttribute* GetBlendedAttr();
00182 AttributeValue* GetBlendedAttrVal();
00183
00184
00185
00186
00187
00188 void SetBlendedAttr(NodeAttribute* pAttr);
00189 void SetBlendedAttrVal(AttributeValue* pAttrVal);
00190
00191
00192
00193
00194 BOOL IsLastBlendStep() { return m_bLastStep; }
00195
00196 private:
00197 RenderRegion* pRenderRegion;
00198
00199 NodeAttribute* pOtherNodeAttr;
00200 AttributeValue* pOtherAttrVal;
00201 double BlendRatio;
00202
00203 NodeAttribute* pBlendedNodeAttr;
00204 AttributeValue* pBlendedAttrVal;
00205
00206 CCAttrMap* pAttrMapStart;
00207 CCAttrMap* pAttrMapEnd;
00208
00209 ColourBlendType ColourBlend;
00210
00211 BOOL m_bLastStep;
00212
00213
00214
00215 double objectRatio;
00216
00217 BOOL objectProfileProcessing;
00218 };
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231 class BlendNodeParam
00232 {
00233 public:
00234 BlendNodeParam()
00235 {
00236 m_pNodeBlend = NULL;
00237 m_pStartPath = NULL;
00238 m_pEndPath = NULL;
00239 m_BlendRatio = 0;
00240 m_AttrBlendRatio = 0;
00241 m_pRegion = NULL;
00242 m_pBlenderPath = NULL;
00243 m_AngleStart = 0;
00244 m_AngleEnd = 0;
00245 m_ObjectRatio = 0;
00246 m_InvObjectRatio = 0;
00247 m_ColourBlendType = COLOURBLEND_FADE;
00248 m_pNodeStart = NULL;
00249 m_pNodeEnd = NULL;
00250 m_bIsOneToOne = FALSE;
00251 m_pHandleBecomeA = NULL;
00252 m_pPathProcessor = NULL;
00253 }
00254
00255 void Init(NodeBlend* pBlender, RenderRegion * pRegion, BlendPath * pStartPath, BlendPath * pEndPath,
00256 double BlendRatio, double AttrBlendRatio,
00257 double AngleStart, double AngleEnd, double ObjectRatio,
00258 double InvObjectRatio, ColourBlendType ColBType,
00259 NodeRenderableInk * pNodeStart,
00260 NodeRenderableInk * pNodeEnd,
00261 BOOL IsOneToOne,
00262 NodeBlendPath * pBlenderPath = NULL,
00263 HandleBecomeA* pHandleBecomeA = NULL,
00264 SumAllPathsPathProcessor* pPathProcessor = NULL)
00265 {
00266 m_pNodeBlend = pBlender;
00267 m_pStartPath = pStartPath;
00268 m_pEndPath = pEndPath;
00269 m_BlendRatio = BlendRatio;
00270 m_pRegion = pRegion;
00271 m_pBlenderPath = pBlenderPath;
00272 m_AngleStart = AngleStart;
00273 m_AngleEnd = AngleEnd;
00274 m_ObjectRatio = ObjectRatio;
00275 m_InvObjectRatio = InvObjectRatio;
00276 m_ColourBlendType = ColBType;
00277 m_pNodeStart = pNodeStart;
00278 m_pNodeEnd = pNodeEnd;
00279 m_bIsOneToOne = IsOneToOne;
00280 m_AttrBlendRatio = AttrBlendRatio;
00281 m_pHandleBecomeA = pHandleBecomeA;
00282 m_pPathProcessor = pPathProcessor;
00283 }
00284
00285
00286
00287 void Init(BlendNodeParam *pParam, BlendPath * pStartPath, BlendPath * pEndPath,
00288 BOOL bInverse = FALSE)
00289 {
00290 m_pNodeBlend = pParam->GetNodeBlend ();
00291 m_pStartPath = pStartPath;
00292 m_pEndPath = pEndPath;
00293
00294 m_pRegion = pParam->GetRenderRegion();
00295 m_pBlenderPath = pParam->GetNodeBlendPath();
00296 m_AngleStart = pParam->GetAngleEnd();
00297 m_AngleEnd = pParam->GetAngleStart();
00298 m_ObjectRatio = pParam->GetObjectRatio();
00299 m_InvObjectRatio = pParam->GetInvertedAttributeRatio();
00300 m_ColourBlendType = pParam->GetColourBlendType();
00301 m_pNodeStart = pParam->GetNodeStart();
00302 m_pNodeEnd = pParam->GetNodeEnd();
00303 m_bIsOneToOne = pParam->GetOneToOne();
00304 m_pHandleBecomeA = pParam->GetHandleBecomeA ();
00305 m_pPathProcessor = pParam->GetPathProcessor ();
00306
00307 if (!bInverse)
00308 {
00309 m_AttrBlendRatio = pParam->GetAttrBlendRatio();
00310 m_BlendRatio = pParam->GetBlendRatio();
00311 }
00312 else
00313 {
00314 m_AttrBlendRatio = 1.0 - pParam->GetAttrBlendRatio();
00315 m_BlendRatio = 1.0 - pParam->GetBlendRatio();
00316 }
00317
00318 }
00319
00320 BlendPath * GetStartBlendPath() { return m_pStartPath; }
00321 BlendPath * GetEndBlendPath() { return m_pEndPath; }
00322 double GetBlendRatio() { return m_BlendRatio; }
00323 double GetAttrBlendRatio() { return m_AttrBlendRatio; }
00324 RenderRegion * GetRenderRegion() { return m_pRegion; }
00325 NodeBlendPath* GetNodeBlendPath() { return m_pBlenderPath; }
00326 double GetAngleStart() { return m_AngleStart; }
00327 double GetAngleEnd() { return m_AngleEnd; }
00328 double GetObjectRatio() { return m_ObjectRatio; }
00329 double GetInvertedAttributeRatio() { return m_InvObjectRatio; }
00330 ColourBlendType GetColourBlendType() { return m_ColourBlendType; }
00331 BOOL GetOneToOne() { return m_bIsOneToOne; }
00332
00333 void SetBlendRatio(double Ratio) { m_BlendRatio = Ratio; }
00334
00335 NodeRenderableInk * GetNodeStart() { return m_pNodeStart; }
00336 NodeRenderableInk * GetNodeEnd() { return m_pNodeEnd; }
00337
00338 HandleBecomeA* GetHandleBecomeA () { return (m_pHandleBecomeA); }
00339
00340
00341
00342 SumAllPathsPathProcessor* GetPathProcessor () { return (m_pPathProcessor); }
00343 void SetPathProcessor (SumAllPathsPathProcessor* proc) { m_pPathProcessor = proc; }
00344
00345 NodeBlend* GetNodeBlend () { return (m_pNodeBlend); }
00346
00347 private:
00348 NodeBlend* m_pNodeBlend;
00349
00350
00351 BlendPath * m_pStartPath;
00352 BlendPath * m_pEndPath;
00353 NodeBlendPath * m_pBlenderPath;
00354 RenderRegion * m_pRegion;
00355 double m_BlendRatio;
00356 double m_AttrBlendRatio;
00357 double m_AngleStart;
00358 double m_AngleEnd;
00359 double m_ObjectRatio;
00360 double m_InvObjectRatio;
00361 ColourBlendType m_ColourBlendType;
00362 NodeRenderableInk * m_pNodeStart;
00363 NodeRenderableInk * m_pNodeEnd;
00364 BOOL m_bIsOneToOne;
00365
00366
00367
00368 HandleBecomeA* m_pHandleBecomeA;
00369
00370
00371 SumAllPathsPathProcessor* m_pPathProcessor;
00372 } ;
00373
00374 #endif // INC_BLENDATTRPARAM
00375
00376