#include <strkcomp.h>
Inheritance diagram for StrokeDefinition:
Public Member Functions | |
StrokeDefinition () | |
StrokeDefinition (Node *pStrokeTree, BOOL repeating=FALSE, INT32 repeats=0) | |
Constructor. | |
~StrokeDefinition () | |
Destructor. | |
void | SetStrokeName (StringBase *pName) |
Sets the name text string for this stroke. | |
void | SetStrokeRepeating (BOOL Repeating) |
Sets the repeating flag for this stroke. | |
void | SetNumStrokeRepeats (INT32 NumRepeats) |
Sets the number of repeats for this stroke. | |
void | SetOverrideFill (BOOL Override) |
void | SetOverrideTrans (BOOL Override) |
virtual BOOL | IsDifferent (LineDefinition *pOther) |
Determine if 2 StrokeDefinitions are considered different. Used when adding strokes to the global list, so that like strokes can be merged. | |
Node * | GetStrokeTree (void) |
String_32 * | GetStrokeName (void) |
BOOL | IsRepeating (void) const |
INT32 | NumRepeats (void) const |
BOOL | OverrideFill (void) const |
BOOL | OverrideTrans (void) const |
BOOL | NeedsTransparency (void) const |
Determine if this stroke needs transparency in order to render. | |
void | SetIOStore (UINT32 NewValue) |
UINT32 | ReadIOStore (void) const |
Private Attributes | |
Node * | pStroke |
String_32 | Name |
INT32 | Repeats |
BOOL | Repeating |
BOOL | OverridesFill |
BOOL | OverridesTrans |
BOOL | NeedsTrans |
UINT32 | IOStore |
Definition at line 161 of file strkcomp.h.
|
Definition at line 166 of file strkcomp.h. 00166 { ERROR3("Don't use this constructor"); };
|
|
Constructor.
repeats - The number of times the brush should repeat along the stroke, or zero for 'work the best out at rendertime'
Definition at line 178 of file strkcomp.cpp. 00179 { 00180 ERROR3IF(pStrokeTree == NULL, "Illegal NULL param"); 00181 ERROR3IF(!pStrokeTree->IsSpread(), "StrokeDefinitions must begin with a Spread (for now, at least)"); 00182 ERROR3IF(pStrokeTree->FindParent() != NULL, "Stroke Definition looks like it's linked into a tree!"); 00183 00184 Repeating = repeating; 00185 Repeats = repeats; 00186 pStroke = pStrokeTree; 00187 00188 // Check the subtree to see if it contains any transparency 00189 NeedsTrans = pStroke->ChildrenNeedTransparency(); 00190 00191 IOStore = 0; 00192 00193 Name = TEXT("Custom brush"); 00194 00195 OverridesFill = FALSE; 00196 OverridesTrans = FALSE; 00197 }
|
|
Destructor.
Definition at line 212 of file strkcomp.cpp. 00213 { 00214 if (pStroke != NULL) 00215 { 00216 pStroke->CascadeDelete(); 00217 delete pStroke; 00218 } 00219 }
|
|
Definition at line 185 of file strkcomp.h. 00185 { return(&Name); };
|
|
Definition at line 182 of file strkcomp.h. 00182 { return(pStroke); };
|
|
Determine if 2 StrokeDefinitions are considered different. Used when adding strokes to the global list, so that like strokes can be merged.
Implements LineDefinition. Definition at line 296 of file strkcomp.cpp. 00297 { 00298 ERROR3IF(pTest == NULL, "Illegal NULL param"); 00299 00300 // check to make sure that pOther is in fact a StrokeDef so that 00301 // we can recast it 00302 StrokeDefinition* pOther = NULL; 00303 if (pTest->IS_KIND_OF(StrokeDefinition)) 00304 pOther = (StrokeDefinition*)pTest; 00305 else 00306 { 00307 ERROR3("Parameter is not a stroke definition"); 00308 return TRUE; 00309 } 00310 00311 if (pOther->Repeating != Repeating) 00312 return(TRUE); 00313 00314 if (pOther->Repeats != Repeats) 00315 return(TRUE); 00316 00317 if (!Name.IsIdentical(pOther->Name)) 00318 return(TRUE); 00319 00320 if (pOther->pStroke == NULL || pStroke == NULL) 00321 { 00322 ERROR3("StrokeDefinition has not been properly initialised"); 00323 return(TRUE); 00324 } 00325 00326 // --- Check to see if the brush bounds are equal 00327 DocRect OtherBounds = ((Spread *)(pOther->pStroke))->GetBoundingRect(); 00328 DocRect Bounds = ((Spread *)pStroke)->GetBoundingRect(); 00329 if (Bounds != OtherBounds) 00330 return(TRUE); 00331 00332 // --- Check the subtrees node-for-node to see if they are the same 00333 Node *pCurNode1 = pStroke->FindFirstDepthFirst(); 00334 Node *pCurNode2 = pOther->pStroke->FindFirstDepthFirst(); 00335 00336 while (pCurNode1 != NULL && pCurNode2 != NULL) 00337 { 00338 // See if the nodes are equivalent - if not, we can return immediately 00339 if (pCurNode1->IsDifferent(pCurNode2)) 00340 return(TRUE); 00341 00342 // And go to the next node in both brushes 00343 pCurNode1 = pCurNode1->FindNextDepthFirst(pStroke); 00344 pCurNode2 = pCurNode2->FindNextDepthFirst(pOther->pStroke); 00345 } 00346 00347 // If we did the entire search and both pointers ended up NULL simultaneously, then 00348 // we have an exact match 00349 if (pCurNode1 == NULL && pCurNode2 == NULL) 00350 return(FALSE); 00351 00352 return(TRUE); 00353 }
|
|
Definition at line 187 of file strkcomp.h. 00187 { return(Repeating); };
|
|
Determine if this stroke needs transparency in order to render.
Reimplemented from LineDefinition. Definition at line 370 of file strkcomp.cpp. 00371 { 00372 return(NeedsTrans); 00373 }
|
|
Definition at line 190 of file strkcomp.h. 00190 { return(Repeats); };
|
|
Reimplemented from LineDefinition. Definition at line 193 of file strkcomp.h. 00193 { return(OverridesFill); };
|
|
Reimplemented from LineDefinition. Definition at line 194 of file strkcomp.h. 00194 { return(OverridesTrans); };
|
|
Reimplemented from LineDefinition. Definition at line 201 of file strkcomp.h. 00201 { return(IOStore); };
|
|
Reimplemented from LineDefinition. Definition at line 200 of file strkcomp.h. 00200 { IOStore = NewValue; };
|
|
Sets the number of repeats for this stroke.
Definition at line 271 of file strkcomp.cpp. 00272 { 00273 // Number of times a brush should repeat along a stroke, or zero to just work out the 00274 // optimal value on the fly 00275 Repeats = NumRepeats; 00276 }
|
|
Reimplemented from LineDefinition. Definition at line 175 of file strkcomp.h. 00175 { OverridesFill = Override; };
|
|
Reimplemented from LineDefinition. Definition at line 176 of file strkcomp.h. 00176 { OverridesTrans = Override; };
|
|
Sets the name text string for this stroke.
Definition at line 234 of file strkcomp.cpp. 00235 { 00236 ERROR3IF(pName == NULL, "Illegal NULL param"); 00237 00238 pName->Left(&Name, 31); 00239 }
|
|
Sets the repeating flag for this stroke.
Definition at line 253 of file strkcomp.cpp. 00254 { 00255 // TRUE if the stroke should repeat along the path, FALSE if it should stretch 00256 Repeating = SetMeToTrueIfYouReallyWantMeToBeRepeating; 00257 }
|
|
Reimplemented from LineDefinition. Definition at line 215 of file strkcomp.h. |
|
Definition at line 206 of file strkcomp.h. |
|
Definition at line 213 of file strkcomp.h. |
|
Definition at line 210 of file strkcomp.h. |
|
Definition at line 211 of file strkcomp.h. |
|
Definition at line 201 of file strkcomp.h. |
|
Definition at line 209 of file strkcomp.h. |
|
Definition at line 208 of file strkcomp.h. |