#include <attrval.h>
Inheritance diagram for LineWidthAttribute:
Public Member Functions | |
LineWidthAttribute () | |
LineWidthAttribute (MILLIPOINT NewLineWidth) | |
virtual void | Restore (RenderRegion *, BOOL) |
Restores the line width attribute for the given render region. i.e. all lines drawn will now be drawn with this line width. | |
virtual void | Render (RenderRegion *, BOOL Temp=FALSE) |
Sets the line width attribute for the given render region. i.e. all lines drawn will now be drawn with this line width. | |
virtual NodeAttribute * | MakeNode () |
Make a AttrLineWidth node from this line width attribute. | |
BOOL | IsDifferent (AttributeValue *pAttr) |
See base class version. | |
virtual void | SimpleCopy (AttributeValue *) |
See AttributeValue::SimpleCopy. | |
virtual BOOL | Blend (BlendAttrParam *pBlendParam) |
Blends this attr val with the attr val held in pBlendParam. | |
virtual BOOL | RenderStroke (RenderRegion *, Path *) |
virtual AttributeValue * | MouldIntoStroke (PathStrokerVector *pMoulder, double TransScale=1.0) |
Helper function for the PathStrokerVector class, which "moulds" clipart subtrees to lie along an arbitrary path. | |
Static Public Member Functions | |
static BOOL | Init () |
Registers line width attribute, and provides a default attribute to give 0.25pt lines. | |
Public Attributes | |
MILLIPOINT | LineWidth |
Definition at line 193 of file attrval.h.
|
Definition at line 386 of file attr.cpp. 00387 { 00388 LineWidth = 500 + 1; // BODGE The 1 added by Simon 25/10/95, so that the default attr 00389 // is different from the current attr. That way line scaling at 00390 // least works in simple cases. 00391 }
|
|
Definition at line 198 of file attrval.h. 00198 { LineWidth = NewLineWidth; }
|
|
Blends this attr val with the attr val held in pBlendParam.
Reimplemented from AttributeValue. Definition at line 542 of file attr.cpp. 00543 { 00544 // Check entry param 00545 ERROR3IF(pBlendParam == NULL,"NULL entry param"); 00546 if (pBlendParam == NULL) return FALSE; 00547 00548 LineWidthAttribute* pOtherLineAttr = (LineWidthAttribute*) pBlendParam->GetOtherAttrVal(); 00549 00550 // Check that the other line attr val is not NULL, and is a LineWidthAttribute 00551 ERROR3IF(pOtherLineAttr == NULL,"NULL other attr val"); 00552 ERROR3IF(!IS_A(pOtherLineAttr,LineWidthAttribute),"other attr val not a line width attr"); 00553 if (pOtherLineAttr == NULL || !IS_A(pOtherLineAttr,LineWidthAttribute)) return FALSE; 00554 00555 // Get a new LineWidthAttribute to hold the blended version, (return FALSE if this fails) 00556 LineWidthAttribute* pBlendedLineAttr = new LineWidthAttribute; 00557 if (pBlendedLineAttr == NULL) return FALSE; 00558 00559 // The blended line width is done by linearly tending the start line width to the 00560 // end line width, proportionally to the blend ration (0.0 to 1.0) 00561 00562 // DeltaWidth is the amount to subtract from this LineWidth, and is proportional to BlendRatio 00563 MILLIPOINT DeltaWidth = INT32((LineWidth - pOtherLineAttr->LineWidth) * pBlendParam->GetBlendRatio()); 00564 00565 pBlendedLineAttr->LineWidth = LineWidth - DeltaWidth; 00566 00567 // Store the ptr to the new blended line width attr val 00568 pBlendParam->SetBlendedAttrVal(pBlendedLineAttr); 00569 00570 return TRUE; 00571 }
|
|
Registers line width attribute, and provides a default attribute to give 0.25pt lines.
Reimplemented from SimpleCCObject. Definition at line 468 of file attr.cpp. 00469 { 00470 // Default to 0.25pt lines 00471 LineWidthAttribute *pAttr = new LineWidthAttribute; 00472 if (pAttr == NULL) 00473 return FALSE; 00474 00475 UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), 00476 pAttr); 00477 if (ID == ATTR_BAD_ID) 00478 return FALSE; 00479 ENSURE(ID == ATTR_LINEWIDTH, "Incorrect ID for attribute!"); 00480 return TRUE; 00481 }
|
|
See base class version.
Reimplemented from AttributeValue. Definition at line 520 of file attr.cpp. 00521 { 00522 ENSURE(GetRuntimeClass() == pAttr->GetRuntimeClass(), 00523 "Different attribute types in AttributeValue::IsDifferent()"); 00524 return ((LineWidthAttribute *) pAttr)->LineWidth != LineWidth; 00525 }
|
|
Make a AttrLineWidth node from this line width attribute.
Reimplemented from AttributeValue. Definition at line 496 of file attr.cpp. 00497 { 00498 // Create new attribute node 00499 AttrLineWidth *pAttr = new AttrLineWidth(); 00500 00501 // Copy attribute value into the new node. 00502 pAttr->Value.SimpleCopy(this); 00503 00504 // Return the new node 00505 return pAttr; 00506 }
|
|
Helper function for the PathStrokerVector class, which "moulds" clipart subtrees to lie along an arbitrary path.
Notes: The base class does nothing (it returns NULL - by default, attrs assume that they will work OK when moulded without being changed) Reimplemented from AttributeValue. Definition at line 608 of file attr.cpp. 00609 { 00610 #ifdef VECTOR_STROKING // Neville 6/8/97 00611 LineWidthAttribute* pMouldedAttr = new LineWidthAttribute; 00612 if (pMouldedAttr != NULL) 00613 { 00614 double ScaledWidth = pMoulder->GetScaleFactor() * (double)LineWidth; 00615 if (ScaledWidth < 1.0) 00616 ScaledWidth = 1.0; 00617 else if (pMouldedAttr->LineWidth > 1000000.0) 00618 ScaledWidth = 1000000.0; 00619 pMouldedAttr->LineWidth = (INT32)ScaledWidth; 00620 } 00621 00622 return(pMouldedAttr); 00623 #else 00624 return NULL; 00625 #endif 00626 }
|
|
Sets the line width attribute for the given render region. i.e. all lines drawn will now be drawn with this line width.
Implements AttributeValue. Definition at line 408 of file attr.cpp. 00409 { 00410 pRegion->SetLineWidth(this, Temp); 00411 }
|
|
Definition at line 209 of file attrval.h. 00209 { return FALSE; }
|
|
Restores the line width attribute for the given render region. i.e. all lines drawn will now be drawn with this line width.
Implements AttributeValue. Definition at line 430 of file attr.cpp. 00431 { 00432 pRegion->RestoreLineWidth(this, Temp); 00433 }
|
|
See AttributeValue::SimpleCopy.
Implements AttributeValue. Definition at line 449 of file attr.cpp. 00450 { 00451 LineWidth = ((LineWidthAttribute *) pValue)->LineWidth; 00452 }
|
|
|