#include <brshattr.h>
Inheritance diagram for AttrBrushType:
Public Member Functions | |
AttrBrushType () | |
Default constructor for AttrBrushType. | |
AttrBrushType (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
Constructs an AttrBrushType Attribute. | |
~AttrBrushType () | |
destructor | |
virtual void | Render (RenderRegion *pRender) |
Renders this attribute (by simply calling the Render function of its contained AttributeValue). | |
virtual void | CopyNodeContents (AttrBrushType *NodeCopy) |
Copies the node's contents to the node pointed to by NodeCopy. | |
virtual INT32 | operator== (const NodeAttribute &NodeAttrib) |
Comparison operator - determines if the AttributeValues of both objects are ==. | |
virtual Node * | SimpleCopy () |
This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes. | |
virtual UINT32 | GetAttrNameID (void) |
Retrieves a string resource ID describing this attribute. | |
virtual void | GetDebugDetails (StringBase *Str) |
Produces debug details about this node. | |
virtual UINT32 | GetNodeSize () const |
For finding the size of the node, in bytes. | |
virtual void | Transform (TransformBase &) |
Currently this simply flushes the cached points map. | |
virtual BOOL | WritePreChildrenWeb (BaseCamelotFilter *pFilter) |
Writes out a record that represents the node, to either Native or Web file format. | |
virtual BOOL | WritePreChildrenNative (BaseCamelotFilter *pFilter) |
virtual AttributeValue * | GetAttributeValue () |
virtual BOOL | NeedsTransparency () const |
Strokes like the airbrush require transparency to be turned on to work. | |
virtual BOOL | Blend (BlendAttrParam *pBlendParam) |
Blends between two brush attributes. In fact at the moment it just blends between the parameters in the two path processors. At some point it should also blend between the ink objects and attributes. | |
virtual SubtreeRenderState | RenderSubtree (RenderRegion *pRender, Node **ppNextNode=NULL, BOOL bClip=TRUE) |
Basically we want to avoid the situation of recursive path processing for brushes. Therefore if there is already a path processor of the same type as this one on the stack then we should not render. | |
BOOL | DoBecomeA (BecomeA *pBecomeA, Node *pParent) |
Its a little unusual for attributes to have their own dobecomea function but the brush requires one because the node that it is applied to will not know anything about it. It is designed to be called by the node that has this brush applied to it. Note that all the real work goes on in the attribute value and path processor. | |
virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
Polymorphically copies the contents of this node to another. | |
virtual BOOL | EffectsParentBounds () |
Virtual function for determining if the node will effect it's parent bounds. eg. ArrowHeads. | |
virtual DocRect | GetAttrBoundingRect (NodeRenderableInk *pParent=NULL, CCAttrMap *pAttribMap=NULL) |
Virtual function for determining the bounding rect of an attribute. Simply calls the brush value which does the calculation. | |
virtual BOOL | IsABrush () const |
For identifying this as a brush attribute. | |
virtual BOOL | ShouldBeOptimized () |
void | NodePathUpdated (Path *pPath) |
interface to the BrushAttrValue, called when a nodepath is updated, either flushes the cache or recalculates the timestamping points distances | |
BOOL | OnReplaceAttribute (AttrBrushType *pOther) |
If we are applying this attribute to a node that already has a brush attribute then we wish to retain certain information,so copy it over before we do the replacing. | |
String_32 | GetBrushName () |
For finding the size of the node, in bytes. | |
BOOL | SetSpacing (MILLIPOINT NewSpacing) |
To set the spacing between brush objects. | |
BOOL | SetScaling (double NewScale) |
To set the brush scaling. | |
BOOL | SetPathOffsetType (PathOffset NewOffsetType) |
to set the offset type for this brush | |
BOOL | SetPathOffsetValue (MILLIPOINT NewOffsetValue) |
to set the offset distance for this brush | |
BOOL | SetTiled (BOOL Tiled) |
When a brush tiles it means that the attribute types:
| |
BOOL | SetRotated (BOOL Rotated) |
as above | |
BOOL | SetRotateAngle (double NewAngle) |
as above | |
PathProcessorBrush * | GetPathProcessor () |
as above | |
BrushDefinition * | GetBrushDefinition () |
interface to the BrushAttrValue | |
BrushHandle | GetBrushHandle (void) |
interface to the BrushAttrValue | |
MILLIPOINT | GetSpacing () |
MILLIPOINT | GetDefaultLineWidth (BOOL IgnorePressure=FALSE) |
convenient interface to the attribute value | |
void | SetUseLocalTransp (BOOL UseTransp) |
interface to the PPB, sets a member | |
void | FlushCache () |
interface to the BrushAttrValue, tells it to flush the cache of its path processor | |
void | SetCache (PointsMap *pMap) |
interface to the BrushAttrValue, sets the cache | |
PointsMap * | GetCache () |
interface to the BrushAttrValue, gets the cache | |
TimeStampList * | GetTimeStampList () |
interface to the BrushAttrValue, gets the cache | |
BOOL | IsTimeStamping () |
interface to the BrushAttrValue | |
void | SetPressureCache (CDistanceSampler *pSamp) |
interface to the BrushAttrValue, sets the cache | |
CDistanceSampler * | GetPressureCache () |
interface to the BrushAttrValue, gets the pressure cache | |
BOOL | ContainsPressureCache () |
interface to the BrushAttrValue, gets the pressure cache | |
BOOL | ReversePressureCache () |
Asks the attribute value to reverse its pressure list See Also: BrushAttrValue::ReversePressureList. | |
BOOL | CanUsePointsCache () |
We are not allowed to use the points cache if this attribute is applied to multiple ink nodes as a part of a group. The reason for this is that the paths of the ink nodes are passed in to the path processor one by one, this means that the points along the first path are cached, and because the cache exists these points are re-used for all subsequent ink objects, meaning that only the first object gets drawn. Further conditions may be added to this at a later date. See also: PathProcessorBrush::GetPointAtDistance. | |
MILLIPOINT | GetAppliedLineWidth () |
as above | |
void | SetValueToScaleTo (MILLIPOINT LineWidth) |
as above | |
DocColour | GetLocalStrokeColour () |
Returns either the blended or local stroke colour. Given that the blended colour is null unless we are in a blend it takes priority when it does exist. | |
void | SetBlendedStrokeColour (DocColour *pCol) |
Tells the attribute that pCol is the stroke colour for the current blend step. | |
UINT32 | GetLocalTranspValue () |
UINT32 | GetLocalTranspType () |
void | ClearCachedRect () |
interface to the BrushAttrValue, wipes the cached bounding rect | |
void | SetFreeHandTool (FreeHandTool *pTool) |
void | InitialiseBrushData () |
retrieves data from the path processor and puts it into our brushdata object | |
BrushData | GetBrushData () |
gets the latest data from our path processor, copies it into our BrushData object which is then returned; | |
void | SetBrushData (BrushData NewData) |
Not quite sure why you would use this, as there is no link from the brush data object to the path processor at the moment. hmm. | |
void | GetMaxScalingFromDefinition () |
Obtains the max scaling value from the brush definition and sets it to the path processor. This is not needed upon brush creation however it is required if you are importing a brush. | |
BOOL | IsParentSelected () |
To find out if this brush belongs to an ink node that is selected. We simpy scan up the tree until we find a selected node or hit the layer. | |
Static Public Member Functions | |
static BOOL | RotateBounds (double Angle, DocRect *pBounds) |
The bounds are updated to contain the rotated version. | |
Protected Member Functions | |
void | FindNearestStrokeColour () |
Locates the nearest stroke colour attribute, takes the colour and stores it in our member variable. Note that it also converts the colour if it is an IndexedColour. | |
void | FindNearestStrokeTransp () |
Finds the local stroke transparency and caches the transparency value and type. | |
Protected Attributes | |
BrushAttrValue | m_Value |
DocColour * | m_pLocalStrokeColour |
DocColour * | m_pBlendedStrokeColour |
BrushData | m_BrushData |
FreeHandTool * | m_pFreeTool |
UINT32 | m_LocalTranspValue |
UINT32 | m_LocalTranspType |
Definition at line 320 of file brshattr.h.
|
Default constructor for AttrBrushType.
Definition at line 2852 of file brshattr.cpp. 02853 { 02854 m_pFreeTool = NULL; 02855 m_pLocalStrokeColour = NULL; 02856 m_pBlendedStrokeColour = NULL; 02857 m_LocalTranspType = 0; 02858 m_LocalTranspValue = 0; 02859 }
|
|
Constructs an AttrBrushType Attribute.
Definition at line 2878 of file brshattr.cpp. 02884 : NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected) 02885 { 02886 m_pFreeTool = NULL; 02887 m_pLocalStrokeColour = NULL; 02888 m_pBlendedStrokeColour = NULL; 02889 m_LocalTranspType = 0; 02890 m_LocalTranspValue = 0; 02891 }
|
|
destructor
Definition at line 2904 of file brshattr.cpp. 02905 { 02906 // if we are a blended attribute then our processor must destroy its blended brushdefinition 02907 /*PathProcessorBrush* pPPB =*/ m_Value.GetPathProcessor(); 02908 02909 // ask our attrval to delete its path processor 02910 m_Value.SetPathProcessor(NULL); 02911 02912 }
|
|
Blends between two brush attributes. In fact at the moment it just blends between the parameters in the two path processors. At some point it should also blend between the ink objects and attributes.
Reimplemented from NodeAttribute. Definition at line 3276 of file brshattr.cpp. 03277 { 03278 // Check entry param isn't NULL 03279 ERROR3IF(pBlendParam == NULL,"NULL entry param"); 03280 if (pBlendParam == NULL) return FALSE; 03281 03282 // Get the Value member to blend to the Value member of the other NodeAttribute. 03283 // If it succeeds, ask the blended Value to make a NodeAttribute out of itself. 03284 03285 if (GetAttributeValue()->Blend(pBlendParam)) 03286 { 03287 // Get the blended attr val. After this call, the ptr is our reponsibility 03288 // so we have to delete it if it's no longer needed 03289 AttributeValue* pBlendedAttrVal = pBlendParam->GetBlendedAttrVal(); 03290 03291 if (pBlendedAttrVal != NULL) 03292 { 03293 // We have a blended attr val, so ask it to make a NodeAttribute out of itself 03294 // and set the pBlendParam's blended NodeAttribute ptr to it 03295 NodeAttribute* pBlendedAttr = pBlendedAttrVal->MakeNode(); 03296 pBlendParam->SetBlendedAttr(pBlendedAttr); 03297 03298 if (pBlendedAttr != NULL) 03299 { 03300 // We were able to make a blended NodeAttribute 03301 // so delete the blended attr val, and return TRUE 03302 ((BrushAttrValue*)pBlendedAttrVal)->SetPathProcessor(NULL); 03303 delete pBlendedAttrVal; 03304 return TRUE; 03305 } 03306 else 03307 { 03308 // Couldn't make a blended NodeAttribute, so give the blended attr val back 03309 // and return FALSE 03310 pBlendParam->SetBlendedAttrVal(pBlendedAttrVal); 03311 return FALSE; 03312 } 03313 } 03314 } 03315 03316 return FALSE; 03317 }
|
|
We are not allowed to use the points cache if this attribute is applied to multiple ink nodes as a part of a group. The reason for this is that the paths of the ink nodes are passed in to the path processor one by one, this means that the points along the first path are cached, and because the cache exists these points are re-used for all subsequent ink objects, meaning that only the first object gets drawn. Further conditions may be added to this at a later date. See also: PathProcessorBrush::GetPointAtDistance.
Definition at line 3960 of file brshattr.cpp. 03961 { 03962 Node* pParent = FindParent(); 03963 if (pParent != NULL) 03964 { 03965 if (pParent->IsCompound() 03966 || pParent->IsABaseTextClass() 03967 || pParent->IsAContour() 03968 ) 03969 return FALSE; 03970 } 03971 03972 return TRUE; 03973 }
|
|
interface to the BrushAttrValue, wipes the cached bounding rect
Definition at line 4390 of file brshattr.cpp. 04391 { 04392 m_Value.SetCachedRect(DocRect(0,0,0,0)); 04393 }
|
|
interface to the BrushAttrValue, gets the pressure cache
Definition at line 4279 of file brshattr.cpp. 04280 { 04281 return (m_Value.GetPressureCache() != NULL); 04282 }
|
|
Copies the node's contents to the node pointed to by NodeCopy.
Definition at line 3077 of file brshattr.cpp. 03078 { 03079 // Let the base class do its bit 03080 NodeAttribute::CopyNodeContents(NodeCopy); 03081 03082 // And then copy our Value 03083 *(NodeCopy->GetAttributeValue()) = *(GetAttributeValue()); 03084 }
|
|
Its a little unusual for attributes to have their own dobecomea function but the brush requires one because the node that it is applied to will not know anything about it. It is designed to be called by the node that has this brush applied to it. Note that all the real work goes on in the attribute value and path processor.
Definition at line 3339 of file brshattr.cpp. 03340 { 03341 ERROR2IF(pBecomeA == NULL, FALSE, "BecomeA pointer is NULL in AttrBrushType::DoBecomeA"); 03342 ERROR2IF(pParent == NULL, FALSE, "Parent node is NULL in AttrBrushType::DoBecomeA"); 03343 PathProcessorBrush* pPPB = m_Value.GetPathProcessor(); 03344 if (pPPB) 03345 pPPB->SetParentAttribute(this); 03346 03347 return m_Value.DoBecomeA(pBecomeA, pParent); 03348 }
|
|
Virtual function for determining if the node will effect it's parent bounds. eg. ArrowHeads.
Reimplemented from NodeAttribute. Definition at line 3011 of file brshattr.cpp. 03012 { 03013 return TRUE; 03014 }
|
|
Locates the nearest stroke colour attribute, takes the colour and stores it in our member variable. Note that it also converts the colour if it is an IndexedColour.
Definition at line 3411 of file brshattr.cpp. 03412 { 03413 NodeRenderableInk* pParent = (NodeRenderableInk*)FindParent(); 03414 if (pParent == NULL) 03415 { 03416 // ERROR3("Wheres my parent?!"); Might be a default, so don't error 03417 return; 03418 } 03419 // if its a controller we want its ink node 03420 if (pParent->IsCompoundClass()) 03421 { 03422 NodeRenderableInk* pInk = ((NodeCompound*)pParent)->GetInkNodeFromController(); 03423 if (pInk) 03424 pParent = pInk; 03425 } 03426 03427 03428 NodeAttribute* pStrokeColour = NULL; 03429 03430 // get the attribute 03431 pParent->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrStrokeColour), &pStrokeColour); 03432 03433 if (pStrokeColour == NULL) 03434 return; 03435 03436 // get the stroke colour 03437 StrokeColourAttribute* pVal = (StrokeColourAttribute*)pStrokeColour->GetAttributeValue(); 03438 if (pVal != NULL) 03439 { 03440 // we're only interested in the actual colour 03441 m_pLocalStrokeColour = &(pVal->Colour); 03442 } 03443 else 03444 TRACEUSER("Diccon", _T("Unable to find local stroke colour\n") ); 03445 03446 }
|
|
Finds the local stroke transparency and caches the transparency value and type.
Definition at line 3459 of file brshattr.cpp. 03460 { 03461 m_LocalTranspValue = 0; 03462 m_LocalTranspType = 0; 03463 03464 NodeRenderableInk* pParent = (NodeRenderableInk*)FindParent(); 03465 if (pParent == NULL || !pParent->IsAnObject()) 03466 { 03467 // ERROR3("Wheres my parent?!"); Might be a default, so don't error 03468 return; 03469 } 03470 03471 // if its a controller we want its ink node 03472 if (pParent->IsCompoundClass()) 03473 { 03474 NodeRenderableInk* pInk = ((NodeCompound*)pParent)->GetInkNodeFromController(); 03475 if (pInk) 03476 pParent = pInk; 03477 } 03478 03479 NodeAttribute* pStrokeTransp = NULL; 03480 03481 // get the attribute 03482 pParent->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrStrokeTransp), &pStrokeTransp, FALSE); 03483 03484 if (pStrokeTransp == NULL) 03485 return; 03486 03487 // get the stroke transparency 03488 StrokeTranspAttribute* pVal = (StrokeTranspAttribute*)pStrokeTransp->GetAttributeValue(); 03489 if (pVal != NULL) 03490 { 03491 // we're only interested in the actual colour 03492 m_LocalTranspValue = *pVal->GetStartTransp(); 03493 m_LocalTranspType = pVal->GetTranspType(); 03494 } 03495 }
|
|
interface to the BrushAttrValue, tells it to flush the cache of its path processor
Definition at line 4127 of file brshattr.cpp. 04128 { 04129 m_Value.FlushCache(); 04130 }
|
|
as above
Definition at line 3988 of file brshattr.cpp. 03989 { 03990 MILLIPOINT ReturnVal = 0; 03991 //first get the parent 03992 NodeRenderableInk* pInk = (NodeRenderableInk*)FindParent(); 03993 03994 // if we're under a nodeshadow controller then we need to ask it for the right ink node 03995 if (pInk != NULL && pInk->IsCompoundClass()) 03996 { 03997 NodeRenderableInk* pInkNode = ((NodeCompound*)pInk)->GetInkNodeFromController(); 03998 if (pInkNode) 03999 pInk = pInkNode; 04000 } 04001 04002 if (pInk != NULL) 04003 { 04004 // find the applied AttrLineWidth 04005 NodeAttribute* pAttr = NULL; 04006 BOOL Found = pInk->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrLineWidth), &pAttr); 04007 if (Found && (pAttr != NULL)) 04008 { 04009 LineWidthAttribute* pVal = (LineWidthAttribute*)((AttrLineWidth*)pAttr)->GetAttributeValue(); 04010 if (pVal != NULL) 04011 ReturnVal = pVal->LineWidth; 04012 } 04013 04014 // double check that we don't have a transparent stroke colour 04015 AttrStrokeColour* pStrokeCol = NULL; 04016 pInk->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrStrokeColour), (NodeAttribute**)&pStrokeCol, FALSE); 04017 if (pStrokeCol) 04018 { 04019 if (pStrokeCol->Value.Colour.IsTransparent()) 04020 ReturnVal = 0; 04021 } 04022 } 04023 04024 return ReturnVal; 04025 }
|
|
Virtual function for determining the bounding rect of an attribute. Simply calls the brush value which does the calculation.
Reimplemented from NodeAttribute. Definition at line 3033 of file brshattr.cpp. 03034 { 03035 ERROR2IF(pParent == NULL, DocRect(0,0,0,0) , "Parent node is NULL in AttrBrushType::GetAttrBoundingRect"); 03036 03037 BrushAttrValue* pVal = (BrushAttrValue*)GetAttributeValue(); 03038 if (pVal == NULL) 03039 return DocRect(0, 0, 0, 0); 03040 else 03041 { 03042 // bit of a hack - the PPB needs to know that we are its parents, and if we have not yet rendered then 03043 // it may not know that yet 03044 PathProcessorBrush* pPPB = pVal->GetPathProcessor(); 03045 if (pPPB != NULL) 03046 { 03047 pPPB->SetParentAttribute(this); 03048 03049 // set the line width 03050 MILLIPOINT Width = GetAppliedLineWidth(); 03051 if (Width > 500) 03052 { 03053 SetValueToScaleTo(Width); 03054 } 03055 else 03056 return DocRect(0, 0, 0, 0); // if its too small then just return as we'll generate infinite objects 03057 } 03058 03059 } 03060 return pVal->GetAttrBoundingRect(pParent); 03061 03062 }
|
|
Reimplemented from NodeAttribute. Definition at line 346 of file brshattr.h. 00346 { return(&m_Value); };
|
|
Retrieves a string resource ID describing this attribute.
Reimplemented from NodeAttribute. Definition at line 3190 of file brshattr.cpp. 03191 { 03192 return(_R(IDS_ATTRBRUSH)); 03193 }
|
|
gets the latest data from our path processor, copies it into our BrushData object which is then returned;
Definition at line 3884 of file brshattr.cpp. 03885 { 03886 InitialiseBrushData(); 03887 return m_BrushData; 03888 }
|
|
interface to the BrushAttrValue
Definition at line 3587 of file brshattr.cpp. 03588 { 03589 return m_Value.GetBrushDefinition(); 03590 }
|
|
interface to the BrushAttrValue
Definition at line 3606 of file brshattr.cpp. 03607 { 03608 return m_Value.GetBrushHandle(); 03609 }
|
|
For finding the size of the node, in bytes.
Definition at line 3382 of file brshattr.cpp. 03383 { 03384 String_32 Name = TEXT(" "); 03385 03386 BrushDefinition* pDef = GetBrushDefinition(); 03387 if (pDef != NULL) 03388 { 03389 String_32* pName = pDef->GetLineName(); 03390 if (pName != NULL) 03391 Name = *pName; 03392 } 03393 return Name; 03394 }
|
|
interface to the BrushAttrValue, gets the cache
Definition at line 4260 of file brshattr.cpp.
|
|
Produces debug details about this node.
Reimplemented from NodeRenderable. Definition at line 3234 of file brshattr.cpp. 03235 { 03236 #ifdef _DEBUG 03237 NodeAttribute::GetDebugDetails(Str); 03238 03239 String_256 TempStr; 03240 TempStr._MakeMsg( _T("\r\nBrush #1%s\r\n"), 03241 (m_Value.GetPathProcessor() == NULL) ? _T("old-style line") : _T("new stroke:") ); 03242 *Str += TempStr; 03243 03244 if (m_Value.GetPathProcessor() != NULL) 03245 { 03246 TempStr._MakeMsg( _T(" #1%s\r\n"), 03247 m_Value.GetPathProcessor()->GetRuntimeClass()->GetClassName() ); 03248 *Str += TempStr; 03249 } 03250 03251 //TempStr._MakeMsg("\r\nNeedsTransparency=#1%s\r\n", NeedsTransparency() ? "TRUE" : "FALSE"); 03252 //*Str += TempStr; 03253 03254 TempStr._MakeMsg( _T("\r\nDefinition Handle=#1%d\r\n"), GetBrushHandle() ); 03255 *Str += TempStr; 03256 #endif 03257 }
|
|
convenient interface to the attribute value
Definition at line 3642 of file brshattr.cpp. 03643 { 03644 return m_Value.GetDefaultLineWidth(IgnorePressure); 03645 }
|
|
Returns either the blended or local stroke colour. Given that the blended colour is null unless we are in a blend it takes priority when it does exist.
Definition at line 3512 of file brshattr.cpp. 03513 { 03514 DocColour Col; 03515 if (m_pBlendedStrokeColour != NULL) 03516 Col = * m_pBlendedStrokeColour; 03517 else if (m_pLocalStrokeColour != NULL) 03518 Col = *m_pLocalStrokeColour; 03519 03520 return Col; 03521 }
|
|
Definition at line 3569 of file brshattr.cpp. 03570 { 03571 return m_LocalTranspType; 03572 }
|
|
Definition at line 3552 of file brshattr.cpp. 03553 { 03554 return m_LocalTranspValue; 03555 }
|
|
Obtains the max scaling value from the brush definition and sets it to the path processor. This is not needed upon brush creation however it is required if you are importing a brush.
Definition at line 3927 of file brshattr.cpp. 03928 { 03929 BrushDefinition* pBrushDef = GetBrushDefinition(); 03930 if (pBrushDef != NULL) 03931 { 03932 double Max = pBrushDef->GetMaxScaling(); 03933 PathProcessorBrush* pPPB = GetPathProcessor(); 03934 if (pPPB != NULL) 03935 pPPB->SetMaxScaling(Max); 03936 } 03937 }
|
|
For finding the size of the node, in bytes.
Reimplemented from Node. Definition at line 3363 of file brshattr.cpp. 03364 { 03365 return(sizeof(AttrBrushType)); 03366 }
|
|
as above
Definition at line 3841 of file brshattr.cpp. 03842 { 03843 return m_Value.GetPathProcessor(); 03844 }
|
|
interface to the BrushAttrValue, gets the pressure cache
Definition at line 4297 of file brshattr.cpp. 04298 { 04299 return m_Value.GetPressureCache(); 04300 }
|
|
Definition at line 3684 of file brshattr.cpp. 03685 { 03686 PathProcessorBrush* pPathProc = m_Value.GetPathProcessor(); 03687 if (pPathProc == NULL) 03688 return -1; 03689 return (MILLIPOINT)pPathProc->GetSpacing(); 03690 }
|
|
interface to the BrushAttrValue, gets the cache
Definition at line 4353 of file brshattr.cpp. 04354 { 04355 return m_Value.GetTimeStampList(); 04356 }
|
|
retrieves data from the path processor and puts it into our brushdata object
Definition at line 3861 of file brshattr.cpp. 03862 { 03863 PathProcessorBrush* pPPB = GetPathProcessor(); 03864 if (pPPB != NULL) 03865 pPPB->CopyBrushData(&m_BrushData); 03866 }
|
|
For identifying this as a brush attribute.
Reimplemented from Node. Definition at line 3623 of file brshattr.cpp. 03624 { 03625 return TRUE; 03626 }
|
|
To find out if this brush belongs to an ink node that is selected. We simpy scan up the tree until we find a selected node or hit the layer.
Definition at line 4213 of file brshattr.cpp. 04214 { 04215 BOOL Retval = FALSE; 04216 Node* pParent = FindParent(); 04217 while (pParent != NULL && !pParent->IsLayer()) 04218 { 04219 if (pParent->IsSelected()) 04220 { 04221 Retval = TRUE; 04222 break; 04223 } 04224 pParent = pParent->FindParent(); 04225 } 04226 return Retval; 04227 }
|
|
interface to the BrushAttrValue
Definition at line 4371 of file brshattr.cpp. 04372 { 04373 return m_Value.IsTimeStamping(); 04374 }
|
|
Strokes like the airbrush require transparency to be turned on to work.
Reimplemented from Node. Definition at line 3207 of file brshattr.cpp. 03208 { 03209 BOOL SoWeDoReallyNeedTransparencyThenDoWe = FALSE; 03210 03211 PathProcessorBrush *pPathProc = m_Value.GetPathProcessor(); 03212 if(pPathProc != NULL) 03213 { 03214 SoWeDoReallyNeedTransparencyThenDoWe = pPathProc->NeedsTransparency(); 03215 } 03216 03217 return SoWeDoReallyNeedTransparencyThenDoWe; 03218 }
|
|
interface to the BrushAttrValue, called when a nodepath is updated, either flushes the cache or recalculates the timestamping points distances
Definition at line 4185 of file brshattr.cpp. 04186 { 04187 // so far as coordinates go, if we are not timestamping then we just flush our cache 04188 if (!IsTimeStamping()) 04189 m_Value.FlushCache(); 04190 else 04191 m_Value.RecalculateTimeStampList(pPath); 04192 04193 04194 // clear our cached bounding rect 04195 m_Value.SetCachedRect(DocRect(0,0,0,0)); 04196 }
|
|
If we are applying this attribute to a node that already has a brush attribute then we wish to retain certain information,so copy it over before we do the replacing.
Definition at line 4147 of file brshattr.cpp. 04148 { 04149 ERROR2IF(pOther == NULL, FALSE, "Null input pointer to AttrBrushType::OnReplaceAttribute"); 04150 04151 PathProcessorBrush* pOldPPB = pOther->GetPathProcessor(); 04152 PathProcessorBrush* pNewPPB = GetPathProcessor(); 04153 if (pOldPPB != NULL && pNewPPB != NULL) 04154 { 04155 pNewPPB->SetUseLocalFillColour(pOldPPB->GetUseLocalFillColour()); 04156 pNewPPB->SetUseNamedColours(pOldPPB->GetUseNamedColours()); 04157 } 04158 04159 // if we have a pressure cache then we want to copy that, also use local colour flags 04160 CDistanceSampler* pPressure = pOther->GetPressureCache(); 04161 if (pPressure) 04162 { 04163 CDistanceSampler* pCopyPressure = pPressure->MakeCopy(); 04164 if (pCopyPressure) 04165 SetPressureCache(pCopyPressure); 04166 } 04167 04168 return TRUE; 04169 }
|
|
Comparison operator - determines if the AttributeValues of both objects are ==.
Reimplemented from NodeAttribute. Definition at line 3125 of file brshattr.cpp. 03126 { 03127 // First check they are of the same type 03128 if (((NodeAttribute*)&NodeAttrib)->GetAttributeType() != GetAttributeType()) 03129 return FALSE; 03130 03131 // Make a more sensible pointer 03132 AttrBrushType *Attr = (AttrBrushType *) &NodeAttrib; 03133 03134 // Now let the AttributeValues compare themselves 03135 return( *((BrushAttrValue *) Attr->GetAttributeValue()) == 03136 *((BrushAttrValue *) GetAttributeValue()) ); 03137 }
|
|
Polymorphically copies the contents of this node to another.
Reimplemented from NodeRenderable. Definition at line 3100 of file brshattr.cpp. 03101 { 03102 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 03103 ENSURE(IS_A(pNodeCopy, AttrBrushType), "PolyCopyNodeContents given wrong dest node type"); 03104 03105 if (IS_A(pNodeCopy, AttrBrushType)) 03106 CopyNodeContents((AttrBrushType*)pNodeCopy); 03107 }
|
|
Renders this attribute (by simply calling the Render function of its contained AttributeValue).
Reimplemented from NodeAttribute. Definition at line 2927 of file brshattr.cpp. 02928 { 02929 02930 // what it says 02931 FindNearestStrokeTransp(); 02932 02933 // tell the processor who it belongs to 02934 PathProcessorBrush* pPPB = m_Value.GetPathProcessor(); 02935 if (pPPB != NULL) 02936 pPPB->SetParentAttribute(this); 02937 02938 if (m_pFreeTool != NULL) 02939 { 02940 String_32 ProgressString = _T("Processing Brush"); 02941 Progress Hourglass(&ProgressString, -1, FALSE); 02942 TRACEUSER("Diccon", _T("About to do first render\n") ); 02943 02944 GetAttributeValue()->Render(pRender); 02945 02946 // if we have pressure then we must invalidate our parent nodepath 02947 Node* pParent = FindParent(); 02948 if (pParent != NULL && pParent->IsNodePath() && ContainsPressureCache()) 02949 { 02950 ((NodeRenderableInk*)pParent)->InvalidateBoundingRect(); 02951 } 02952 m_pFreeTool = NULL; 02953 } 02954 else 02955 { 02956 #ifdef NEWFASTBRUSHES 02957 BrushAttrValue* pAttr = (BrushAttrValue*) GetAttributeValue(); 02958 pAttr->SetBoundsParent (FindParent ()); 02959 #endif 02960 GetAttributeValue()->Render(pRender); 02961 } 02962 }
|
|
Basically we want to avoid the situation of recursive path processing for brushes. Therefore if there is already a path processor of the same type as this one on the stack then we should not render.
Reimplemented from NodeAttribute. Definition at line 2981 of file brshattr.cpp. 02982 { 02983 // BOOL Retval = TRUE; 02984 PathProcessorBrush* pPPB = GetPathProcessor(); 02985 if (pPPB != NULL) 02986 { 02987 // pRender can legally be null, but we don't want to proliferate passing null pointers around 02988 if (pRender != NULL && pPPB->IsThisPathProcessorOnTheStack(pRender)) 02989 return SUBTREE_NORENDER; 02990 } 02991 02992 return SUBTREE_ROOTONLY; 02993 }
|
|
Asks the attribute value to reverse its pressure list See Also: BrushAttrValue::ReversePressureList.
Definition at line 4334 of file brshattr.cpp. 04335 { 04336 CDistanceSampler* pCache = GetPressureCache(); 04337 return pCache->ReverseData(); 04338 }
|
|
The bounds are updated to contain the rotated version.
Definition at line 4416 of file brshattr.cpp. 04417 { 04418 ERROR2IF(pBounds == NULL, FALSE, "DocRect is NULL"); 04419 if (Angle != 0.0) 04420 { 04421 DocCoord BBCentre = pBounds->Centre(); 04422 04423 DocCoord Coords[4]; 04424 Coords[0].x = pBounds->lo.x; Coords[0].y = pBounds->lo.y; 04425 Coords[1].x = pBounds->hi.x; Coords[1].y = pBounds->lo.y; 04426 Coords[2].x = pBounds->hi.x; Coords[2].y = pBounds->hi.y; 04427 Coords[3].x = pBounds->lo.x; Coords[3].y = pBounds->hi.y; 04428 04429 Trans2DMatrix Rotate(BBCentre,Angle); 04430 Rotate.Transform(Coords,4); 04431 04432 pBounds->lo.x = min(min(Coords[0].x,Coords[1].x), min(Coords[2].x,Coords[3].x)); 04433 pBounds->hi.x = max(max(Coords[0].x,Coords[1].x), max(Coords[2].x,Coords[3].x)); 04434 pBounds->lo.y = min(min(Coords[0].y,Coords[1].y), min(Coords[2].y,Coords[3].y)); 04435 pBounds->hi.y = max(max(Coords[0].y,Coords[1].y), max(Coords[2].y,Coords[3].y)); 04436 } 04437 return TRUE; 04438 }
|
|
Tells the attribute that pCol is the stroke colour for the current blend step.
Definition at line 3535 of file brshattr.cpp. 03536 { 03537 m_pBlendedStrokeColour = pCol; 03538 }
|
|
Not quite sure why you would use this, as there is no link from the brush data object to the path processor at the moment. hmm.
Definition at line 3906 of file brshattr.cpp. 03907 { 03908 m_BrushData = Data; 03909 }
|
|
interface to the BrushAttrValue, sets the cache
Definition at line 4242 of file brshattr.cpp.
|
|
Definition at line 4396 of file brshattr.cpp. 04397 { 04398 m_pFreeTool = pTool; 04399 }
|
|
to set the offset type for this brush
Definition at line 3726 of file brshattr.cpp. 03727 { 03728 PathProcessorBrush* pPathProc = m_Value.GetPathProcessor(); 03729 if (pPathProc == NULL) 03730 return FALSE; 03731 pPathProc->SetPathOffsetType(NewOffsetType); 03732 return TRUE; 03733 }
|
|
to set the offset distance for this brush
Definition at line 3746 of file brshattr.cpp. 03747 { 03748 PathProcessorBrush* pPathProc = m_Value.GetPathProcessor(); 03749 if (pPathProc == NULL) 03750 return FALSE; 03751 pPathProc->SetPathOffsetValue(NewValue); 03752 return TRUE; 03753 }
|
|
interface to the BrushAttrValue, sets the cache
Definition at line 4316 of file brshattr.cpp. 04317 { 04318 m_Value.SetPresssureCache(pCache); 04319 }
|
|
as above
Definition at line 3796 of file brshattr.cpp. 03797 { 03798 PathProcessorBrush* pPathProc = m_Value.GetPathProcessor(); 03799 if (pPathProc == NULL) 03800 return FALSE; 03801 return pPathProc->SetRotationAngle(NewAngle); 03802 }
|
|
as above
Definition at line 3818 of file brshattr.cpp. 03819 { 03820 PathProcessorBrush* pPathProc = m_Value.GetPathProcessor(); 03821 if (pPathProc == NULL) 03822 return FALSE; 03823 pPathProc->SetRotated(Rotated); 03824 return TRUE; 03825 }
|
|
To set the brush scaling.
Definition at line 3707 of file brshattr.cpp. 03708 { 03709 PathProcessorBrush* pPPB = m_Value.GetPathProcessor(); 03710 if (pPPB == NULL) 03711 return FALSE; 03712 return pPPB->SetBrushScaling(NewScale); 03713 }
|
|
To set the spacing between brush objects.
Definition at line 3660 of file brshattr.cpp. 03661 { 03662 PathProcessorBrush* pPathProc = m_Value.GetPathProcessor(); 03663 if (pPathProc == NULL) 03664 return FALSE; 03665 03666 03667 return pPathProc->SetSpacing(NewSpacing); 03668 }
|
|
When a brush tiles it means that the attribute types:
Definition at line 3773 of file brshattr.cpp. 03774 { 03775 PathProcessorBrush* pPathProc = m_Value.GetPathProcessor(); 03776 if (pPathProc == NULL) 03777 return FALSE; 03778 pPathProc->SetTiling(Tiled); 03779 return TRUE; 03780 }
|
|
interface to the PPB, sets a member
Definition at line 4059 of file brshattr.cpp. 04060 { 04061 PathProcessorBrush* pPPB = m_Value.GetPathProcessor(); 04062 if (pPPB) 04063 pPPB->SetUseLocalTransp(UseTransp); 04064 }
|
|
as above
Definition at line 4040 of file brshattr.cpp. 04041 { 04042 m_Value.ScaleToLineWidth(Value); 04043 }
|
|
Reimplemented from NodeAttribute. Definition at line 362 of file brshattr.h. 00362 { return TRUE;}
|
|
This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.
Reimplemented from NodeAttribute. Definition at line 3155 of file brshattr.cpp. 03156 { 03157 AttrBrushType* NodeCopy = new AttrBrushType; 03158 if (NodeCopy == NULL) 03159 return(NULL); 03160 03161 // Call the base class 03162 NodeAttribute::CopyNodeContents(NodeCopy); 03163 03164 // And call our AttributeValue to copy itself too 03165 NodeCopy->GetAttributeValue()->SimpleCopy(GetAttributeValue()); 03166 03167 // tell the new path processor who is boss 03168 PathProcessorBrush* pPPB = NodeCopy->GetPathProcessor(); 03169 if (pPPB != NULL) 03170 pPPB->SetParentAttribute(NodeCopy); 03171 03172 return(NodeCopy); 03173 }
|
|
Currently this simply flushes the cached points map.
Reimplemented from NodeRenderable. Definition at line 4079 of file brshattr.cpp. 04080 { 04081 #ifdef NEWFASTBRUSHES 04082 if (m_Value.GetCachedBitmap ()) 04083 { 04084 m_Value.GetCachedBitmap ()->Transform (Trans); 04085 } 04086 // else 04087 // { 04088 #endif 04089 04090 if (!Trans.bSolidDrag) 04091 { 04092 // CGS: my new TransformCache function is three 04093 // times faster than doing it this way! 04094 m_Value.TransformCache(Trans); 04095 m_Value.TransformTimeStampList(Trans); 04096 m_Value.TransformCachedRect(Trans); 04097 } 04098 else 04099 { 04100 // Phil, 10/03/2004 04101 // It may be faster but it doesn't do the job properly during solid dragging. 04102 // The following version works better for solid dragging and ought to be 04103 // reasonably fast because it still uses the cached bounding rect 04104 FlushCache(); 04105 m_Value.TransformCachedRect(Trans); 04106 } 04107 04108 //#ifdef NEWFASTBRUSHES 04109 //} 04110 //#endif 04111 04112 }
|
|
Reimplemented from Node. Definition at line 4480 of file brshattr.cpp. 04481 { 04482 //return TRUE; 04483 04484 ERROR2IF(pFilter == NULL, FALSE, "Illegal NULL param"); 04485 04486 BOOL ok = TRUE; 04487 PathProcessorBrush *pProcessor = m_Value.GetPathProcessor(); 04488 04489 if (pProcessor != NULL) 04490 { 04491 // first try and get the definition stored in the brush component 04492 BrushHandle Handle = pProcessor->GetBrushDefinitionHandle(); 04493 04494 // also check that the definition exists, as we do not want to save out deactivated brushes 04495 BrushDefinition* pDef = BrushComponent::FindBrushDefinition(Handle); 04496 04497 if (Handle != BrushHandle_NoBrush && pDef != NULL) 04498 { 04499 // now get the brush component from the document (bit longwinded this but it 04500 // ensures that each brush only gets written once) 04501 Document* pDoc = Document::GetCurrent(); 04502 ERROR2IF(pDoc == NULL, FALSE, "Er, wheres the document gone?"); 04503 BrushComponent* pBrushComp = (BrushComponent*)pDoc->GetDocComponent(CC_RUNTIME_CLASS(BrushComponent)); 04504 ERROR2IF(pBrushComp == NULL, FALSE, "Couldn't find brush component"); 04505 04506 // finally lets write the definition 04507 ok = pBrushComp->ExportLine(pFilter, Handle); 04508 04509 if (ok) ok = pProcessor->WriteNative(pFilter); 04510 04511 // now write our timestamping and pressure data 04512 if (IsTimeStamping()) 04513 if (ok) ok = m_Value.WriteTimeStampList(pFilter); 04514 04515 if (ContainsPressureCache()) 04516 if (ok) ok = m_Value.WritePressureData(pFilter); 04517 04518 } 04519 } 04520 else 04521 { 04522 //ERROR3("Trying to write empty attribute"); 04523 // return FALSE; 04524 } 04525 04526 return ok; 04527 }
|
|
Writes out a record that represents the node, to either Native or Web file format.
If the AttrBrushType writes out a record successfully to the file, it will return TRUE. If the AttrBrushType chooses not to write itself to the filter (e.g. because it is not appropriate for this filter), then this function will return FALSE. Notes: Simple Brushs (not using fancy bitmap/vector brushes) just write out a 4-byte (UINT32) record containing the stroke type. Defined stroke types at this time are: 0 - Simple variable width stroke
Reimplemented from Node. Definition at line 4475 of file brshattr.cpp. 04476 { 04477 return(WritePreChildrenNative(pFilter)); 04478 }
|
|
Definition at line 437 of file brshattr.h. |
|
Definition at line 442 of file brshattr.h. |
|
Definition at line 441 of file brshattr.h. |
|
Definition at line 436 of file brshattr.h. |
|
Definition at line 439 of file brshattr.h. |
|
Definition at line 435 of file brshattr.h. |
|
Definition at line 433 of file brshattr.h. |