BlendAttrParam Class Reference

Class that encapsulates the params needed by virtual NodeAttribute::Blend(). More...

#include <blendatt.h>

List of all members.

Public Member Functions

 BlendAttrParam ()
 Default constructor.
 ~BlendAttrParam ()
 Destructor This will delete pBlendedNodeAttr and pBlendedAttrVal if these values are not NULL.
BOOL Init (RenderRegion *pThisRenderRegion, NodeAttribute *pThisOtherAttr, double ThisBlendRatio, ColourBlendType ColBlend, CCAttrMap *pStartAttrMap, CCAttrMap *pEndAttrMap, BOOL LastStep=FALSE)
 This inits the object with the given params. Fails if pThisOtherAttr is NULL or ThisBlendRatio is out of range. If ok the following is true - GetRenderRegion will return pThisRenderRegion GetOtherAttr() will return pThisOtherAttr GetBlendRatio() will return ThisBlendRatio GetOtherAttrVal() will return pThisOtherAttr->GetAttributeValue() (can be NULL!!) GetBlendedAttr() will return NULL GetBlendedAttrVal() will return NULL.
BOOL Init (RenderRegion *pThisRenderRegion, NodeAttribute *pThisOtherAttr, double ThisBlendRatio, double thisObjectRatio, BOOL objProcess, ColourBlendType ColBlend, CCAttrMap *pStartAttrMap, CCAttrMap *pEndAttrMap, BOOL LastStep=FALSE)
 This inits the object with the given params.
RenderRegionGetRenderRegion ()
NodeAttributeGetOtherAttr ()
AttributeValueGetOtherAttrVal ()
double GetBlendRatio ()
double GetObjectRatio ()
BOOL GetObjectProfileProcessing ()
ColourBlendType GetColourBlend ()
CCAttrMapGetStartAttrMap ()
CCAttrMapGetEndAttrMap ()
NodeAttributeGetBlendedAttr ()
 When you call this, the pointer passed back becomes your responsibility (if its not NULL). This means that you will have to delete it if you don't want to cause memory leaks. Also, you will get NULL for all subsequent calls, until a new value is set by SetBlendedAttr().
AttributeValueGetBlendedAttrVal ()
 When you call this, the pointer passed back becomes your responsibility (if its not NULL). This means that you will have to delete it if you don't want to cause memory leaks. Also, you will get NULL for all subsequent calls, until a new value is set by SetBlendedAttrVal().
void SetBlendedAttr (NodeAttribute *pAttr)
 When you call this func, the object you pass it becomes the property of the BlendAttrParam object. If it's internal pointer is the same as the entry param, nothing happends If it's internal pointer is not NULL and different to the entry param, the old one is deleted first.
void SetBlendedAttrVal (AttributeValue *pAttrVal)
 When you call this func, the object you pass it becomes the property of the BlendAttrParam object. If it's internal pointer is the same as the entry param, nothing happends If it's internal pointer is not NULL and different to the entry param, the old one is deleted first.
BOOL IsLastBlendStep ()

Private Member Functions

 CC_DECLARE_MEMDUMP (BlendAttrParam)

Private Attributes

RenderRegionpRenderRegion
NodeAttributepOtherNodeAttr
AttributeValuepOtherAttrVal
double BlendRatio
NodeAttributepBlendedNodeAttr
AttributeValuepBlendedAttrVal
CCAttrMappAttrMapStart
CCAttrMappAttrMapEnd
ColourBlendType ColourBlend
BOOL m_bLastStep
double objectRatio
BOOL objectProfileProcessing


Detailed Description

Class that encapsulates the params needed by virtual NodeAttribute::Blend().

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/10/94
NOTE: GCS (27/7/2000): I have ammended this class to allow blends to specify whether blending should affect all attributes data excluding position stuff. The type of blending now done is determined by the slider that is dragged within the blend tool.

This is particularly true of fills - who contain both 'colour' data and position data. When profiling the attributes of the blend, we do not want to alter the position data with respect to the attribute profile.

Definition at line 144 of file blendatt.h.


Constructor & Destructor Documentation

BlendAttrParam::BlendAttrParam  ) 
 

Default constructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 2094 of file attr.cpp.

02095 {
02096     pRenderRegion   = NULL;
02097     pOtherNodeAttr  = NULL;
02098     pOtherAttrVal   = NULL;
02099     BlendRatio      = 0.0;
02100     pBlendedNodeAttr= NULL;
02101     pBlendedAttrVal = NULL;
02102     ColourBlend     = COLOURBLEND_FADE;
02103     objectRatio     = 0.0;
02104     objectProfileProcessing = FALSE;
02105 }

BlendAttrParam::~BlendAttrParam  ) 
 

Destructor This will delete pBlendedNodeAttr and pBlendedAttrVal if these values are not NULL.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 2122 of file attr.cpp.

02123 {
02124     if (pBlendedNodeAttr != NULL) delete pBlendedNodeAttr;
02125     if (pBlendedAttrVal  != NULL) delete pBlendedAttrVal;
02126 }


Member Function Documentation

BlendAttrParam::CC_DECLARE_MEMDUMP BlendAttrParam   )  [private]
 

NodeAttribute * BlendAttrParam::GetBlendedAttr  ) 
 

When you call this, the pointer passed back becomes your responsibility (if its not NULL). This means that you will have to delete it if you don't want to cause memory leaks. Also, you will get NULL for all subsequent calls, until a new value is set by SetBlendedAttr().

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Ptr to NodeAttribute, or NULL if it doesn't have one
I.e. GetBlendedAttr() returns it's internal node attr ptr, then sets it to NULL

Returns:
Errors: In debug builds, it'll error if it returns NULL
See also:
-

Definition at line 2288 of file attr.cpp.

02289 {
02290     ERROR3IF(pBlendedNodeAttr == NULL,"pBlendedNodeAttr is NULL");
02291 
02292     NodeAttribute* p = pBlendedNodeAttr;
02293     pBlendedNodeAttr = NULL;
02294     return (p);
02295 }

AttributeValue * BlendAttrParam::GetBlendedAttrVal  ) 
 

When you call this, the pointer passed back becomes your responsibility (if its not NULL). This means that you will have to delete it if you don't want to cause memory leaks. Also, you will get NULL for all subsequent calls, until a new value is set by SetBlendedAttrVal().

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Ptr to AttributeValue, or NULL if it doesn't have one
I.e. GetBlendedAttrVal() returns it's internal attr value ptr, then sets it to NULL

Returns:
Errors: In debug builds, it'll error if it returns NULL
See also:
-

Definition at line 2316 of file attr.cpp.

02317 {
02318     ERROR3IF(pBlendedAttrVal == NULL,"pBlendedAttrVal is NULL");
02319 
02320     AttributeValue* p = pBlendedAttrVal;
02321     pBlendedAttrVal = NULL;
02322     return (p);
02323 }

double BlendAttrParam::GetBlendRatio  )  [inline]
 

Definition at line 167 of file blendatt.h.

00167 { return BlendRatio; }

ColourBlendType BlendAttrParam::GetColourBlend  )  [inline]
 

Definition at line 170 of file blendatt.h.

00170 { return ColourBlend; }

CCAttrMap* BlendAttrParam::GetEndAttrMap  )  [inline]
 

Definition at line 173 of file blendatt.h.

00173 { return pAttrMapEnd; }

BOOL BlendAttrParam::GetObjectProfileProcessing  )  [inline]
 

Definition at line 169 of file blendatt.h.

00169 { return (objectProfileProcessing); }

double BlendAttrParam::GetObjectRatio  )  [inline]
 

Definition at line 168 of file blendatt.h.

00168 { return objectRatio; }

NodeAttribute* BlendAttrParam::GetOtherAttr  )  [inline]
 

Definition at line 165 of file blendatt.h.

00165 { return pOtherNodeAttr; }

AttributeValue* BlendAttrParam::GetOtherAttrVal  )  [inline]
 

Definition at line 166 of file blendatt.h.

00166 { return pOtherAttrVal; }

RenderRegion* BlendAttrParam::GetRenderRegion  )  [inline]
 

Definition at line 164 of file blendatt.h.

00164 { return pRenderRegion; }

CCAttrMap* BlendAttrParam::GetStartAttrMap  )  [inline]
 

Definition at line 172 of file blendatt.h.

00172 { return pAttrMapStart; }

BOOL BlendAttrParam::Init RenderRegion pThisRenderRegion,
NodeAttribute pThisOtherAttr,
double  ThisBlendRatio,
double  thisObjectRatio,
BOOL  objProcess,
ColourBlendType  ColBlend,
CCAttrMap pStartAttrMap,
CCAttrMap pEndAttrMap,
BOOL  LastStep = FALSE
 

This inits the object with the given params.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/2000
Parameters:
pRenderRegion = the render region we are rendering into (this is currently [INPUTS] used for finding the rendering ColourContext for blending colour) This may be NULL, but if you're rendering you must pass it in, so we separate tints properly as often as possible. pThisOtherAttr = the node attr that you want to blend to ThisBlendRatio = the amount you want to blend by (0.0 < ThisBlendRatio < 1.0) thisObjectRatio = the amount you to to blend object (i.e. position data) by objProcess = whether we are blending with respect to position within attributes ColBlend = the way in which colours should be blended
- [OUTPUTS]
Returns:
TRUE if initialised correctly, FALSE otherwise

Errors: -

See also:
-

Definition at line 2224 of file attr.cpp.

02228 {
02229     // Check that this is the first time it's been called
02230     ERROR3IF(pOtherNodeAttr != NULL,"This has already been initialised");
02231     if (pOtherNodeAttr != NULL) return FALSE;
02232 
02233     // check valid entry params
02234     ERROR3IF(pThisOtherAttr == NULL || (ThisBlendRatio <= 0.0) || (ThisBlendRatio >= 1.0),"Dodgy entry params");
02235     if (pThisOtherAttr == NULL || (ThisBlendRatio <= 0.0) || (ThisBlendRatio >= 1.0)) return FALSE;
02236 
02237     // Remember the render region
02238     pRenderRegion = pThisRenderRegion;
02239 
02240     // Store the other NodeAttribute's ptr
02241     pOtherNodeAttr = pThisOtherAttr;
02242 
02243     // Store the way colours should be blended
02244     ColourBlend = ColBlend;
02245 
02246     // Get pOtherNodeAttr's attr value ptr
02247     // NOTE!!   This can be NULL as not all NodeAttributes implement this function.
02248     //          This is OK as the ones that don't support GetAttributeValue() won't have a Blend() 
02249     //          function either, and if they do have a Blend() func, it will error when it's called
02250     pOtherAttrVal = pThisOtherAttr->GetAttributeValue();
02251 
02252     // Set up the other member vars
02253     BlendRatio      = ThisBlendRatio;
02254     pBlendedNodeAttr= NULL;
02255     pBlendedAttrVal = NULL;
02256 
02257     pAttrMapStart   = pStartAttrMap;    
02258     pAttrMapEnd     = pEndAttrMap;
02259 
02260     m_bLastStep = LastStep;
02261 
02262     objectRatio = thisObjectRatio;
02263     
02264     objectProfileProcessing = objProcess;
02265 
02266     return TRUE;
02267 }

BOOL BlendAttrParam::Init RenderRegion pThisRenderRegion,
NodeAttribute pThisOtherAttr,
double  ThisBlendRatio,
ColourBlendType  ColBlend,
CCAttrMap pStartAttrMap,
CCAttrMap pEndAttrMap,
BOOL  LastStep = FALSE
 

This inits the object with the given params. Fails if pThisOtherAttr is NULL or ThisBlendRatio is out of range. If ok the following is true - GetRenderRegion will return pThisRenderRegion GetOtherAttr() will return pThisOtherAttr GetBlendRatio() will return ThisBlendRatio GetOtherAttrVal() will return pThisOtherAttr->GetAttributeValue() (can be NULL!!) GetBlendedAttr() will return NULL GetBlendedAttrVal() will return NULL.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/94
Parameters:
pRenderRegion = the render region we are rendering into (this is currently [INPUTS] used for finding the rendering ColourContext for blending colour) This may be NULL, but if you're rendering you must pass it in, so we separate tints properly as often as possible. pThisOtherAttr = the node attr that you want to blend to ThisBlendRatio = the amount you want to blend by (0.0 < ThisBlendRatio < 1.0) ColBlend = the way in which colours should be blended
- [OUTPUTS]
Returns:
TRUE if initialised correctly, FALSE otherwise

Errors: -

See also:
-

Definition at line 2159 of file attr.cpp.

02162 {
02163     // Check that this is the first time it's been called
02164     ERROR3IF(pOtherNodeAttr != NULL,"This has already been initialised");
02165     if (pOtherNodeAttr != NULL) return FALSE;
02166 
02167     // check valid entry params
02168     ERROR3IF(pThisOtherAttr == NULL || (ThisBlendRatio <= 0.0) || (ThisBlendRatio >= 1.0),"Dodgy entry params");
02169     if (pThisOtherAttr == NULL || (ThisBlendRatio <= 0.0) || (ThisBlendRatio >= 1.0)) return FALSE;
02170 
02171     // Remember the render region
02172     pRenderRegion = pThisRenderRegion;
02173 
02174     // Store the other NodeAttribute's ptr
02175     pOtherNodeAttr = pThisOtherAttr;
02176 
02177     // Store the way colours should be blended
02178     ColourBlend = ColBlend;
02179 
02180     // Get pOtherNodeAttr's attr value ptr
02181     // NOTE!!   This can be NULL as not all NodeAttributes implement this function.
02182     //          This is OK as the ones that don't support GetAttributeValue() won't have a Blend() 
02183     //          function either, and if they do have a Blend() func, it will error when it's called
02184     pOtherAttrVal = pThisOtherAttr->GetAttributeValue();
02185 
02186     // Set up the other member vars
02187     BlendRatio      = ThisBlendRatio;
02188     pBlendedNodeAttr= NULL;
02189     pBlendedAttrVal = NULL;
02190 
02191     pAttrMapStart   = pStartAttrMap;    
02192     pAttrMapEnd     = pEndAttrMap;
02193 
02194     m_bLastStep = LastStep;
02195 
02196     return TRUE;
02197 }

BOOL BlendAttrParam::IsLastBlendStep  )  [inline]
 

Definition at line 194 of file blendatt.h.

00194 { return m_bLastStep; }

void BlendAttrParam::SetBlendedAttr NodeAttribute pAttr  ) 
 

When you call this func, the object you pass it becomes the property of the BlendAttrParam object. If it's internal pointer is the same as the entry param, nothing happends If it's internal pointer is not NULL and different to the entry param, the old one is deleted first.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/94
Parameters:
pAttr = ptr to a node attr [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 2341 of file attr.cpp.

02342 {
02343     if (pBlendedNodeAttr != pAttr)
02344     {
02345         if (pBlendedNodeAttr != NULL) delete pBlendedNodeAttr;
02346         pBlendedNodeAttr = pAttr;
02347     }
02348 }

void BlendAttrParam::SetBlendedAttrVal AttributeValue pAttrVal  ) 
 

When you call this func, the object you pass it becomes the property of the BlendAttrParam object. If it's internal pointer is the same as the entry param, nothing happends If it's internal pointer is not NULL and different to the entry param, the old one is deleted first.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/94
Parameters:
pAttrVal = ptr to a attr value [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 2366 of file attr.cpp.

02367 {
02368     if (pBlendedAttrVal != pAttrVal)
02369     {
02370         if (pBlendedAttrVal != NULL) delete pBlendedAttrVal;
02371         pBlendedAttrVal = pAttrVal;
02372     }
02373 }


Member Data Documentation

double BlendAttrParam::BlendRatio [private]
 

Definition at line 201 of file blendatt.h.

ColourBlendType BlendAttrParam::ColourBlend [private]
 

Definition at line 209 of file blendatt.h.

BOOL BlendAttrParam::m_bLastStep [private]
 

Definition at line 211 of file blendatt.h.

BOOL BlendAttrParam::objectProfileProcessing [private]
 

Definition at line 217 of file blendatt.h.

double BlendAttrParam::objectRatio [private]
 

Definition at line 215 of file blendatt.h.

CCAttrMap* BlendAttrParam::pAttrMapEnd [private]
 

Definition at line 207 of file blendatt.h.

CCAttrMap* BlendAttrParam::pAttrMapStart [private]
 

Definition at line 206 of file blendatt.h.

AttributeValue* BlendAttrParam::pBlendedAttrVal [private]
 

Definition at line 204 of file blendatt.h.

NodeAttribute* BlendAttrParam::pBlendedNodeAttr [private]
 

Definition at line 203 of file blendatt.h.

AttributeValue* BlendAttrParam::pOtherAttrVal [private]
 

Definition at line 200 of file blendatt.h.

NodeAttribute* BlendAttrParam::pOtherNodeAttr [private]
 

Definition at line 199 of file blendatt.h.

RenderRegion* BlendAttrParam::pRenderRegion [private]
 

Definition at line 197 of file blendatt.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:51:25 2007 for Camelot by  doxygen 1.4.4