#include <attrbev.h>
Inheritance diagram for BevelAttributeValueType:
Public Member Functions | |
BevelAttributeValueType () | |
~BevelAttributeValueType () | |
BevelAttributeValueType (INT32 val) | |
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 AttrbValue node from this line width attribute. | |
virtual NodeAttribute * | MakeNode (Node *pNode, AttachNodeDirection Direction) |
Make a AttrbValue node from this line width attribute. | |
BOOL | IsDifferent (AttributeValue *pAttr) |
See base class version. | |
virtual void | SimpleCopy (AttributeValue *) |
See AttributeValue::SimpleCopy. | |
INT32 | operator= (AttributeValue &Attrib) |
Equality operator. | |
INT32 | operator== (AttributeValue &Attrib) |
Equation operator. | |
void | GoingOutOfScope (RenderRegion *pRegion) |
Enables this attribute to remove its path processor when it's restored. | |
void | SetPassbackValue (BOOL b) |
void | SetIndent (MILLIPOINT Indent) |
void | SetLightAngle (double LightAngle) |
void | SetContrast (INT32 Contrast) |
MILLIPOINT | GetIndent () |
double | GetLightAngle () |
INT32 | GetContrast () |
Static Public Member Functions | |
static BOOL | Init () |
Registers line width attribute, and provides a default attribute to give 0.25pt lines. | |
Public Attributes | |
INT32 | m_Type |
BOOL | m_bPassback |
Private Member Functions | |
KernelBitmap * | CreateBevelBitmap (RenderRegion *pRegion) |
Creates the bevel bitmap from the region. | |
BOOL | RenderBitmap (RenderRegion *pRegion, KernelBitmap *pBitmap, Path *pSrcPath, Path *pRenderPath) |
Renders the bevel bitmap using the given path. | |
Private Attributes | |
MILLIPOINT | m_Indent |
double | m_LightAngle |
INT32 | m_Contrast |
BevelAttributePathProcessor * | m_pProc |
Definition at line 413 of file attrbev.h.
|
Definition at line 1627 of file attrbev.cpp. 01628 { 01629 m_Type = -1; 01630 m_bPassback = FALSE; 01631 m_pProc = NULL; 01632 01633 m_Indent = 0; 01634 m_LightAngle = 0; 01635 m_Contrast = 0; 01636 }
|
|
Definition at line 1649 of file attrbev.cpp.
|
|
Definition at line 1638 of file attrbev.cpp. 01639 { 01640 m_Type = Val; 01641 m_bPassback = FALSE; 01642 m_pProc = NULL; 01643 01644 m_Indent = 0; 01645 m_LightAngle = 0; 01646 m_Contrast = 0; 01647 }
|
|
Creates the bevel bitmap from the region.
Definition at line 1728 of file attrbev.cpp. 01729 { 01730 // get all the necessary variables out of the render region 01731 // set up the outer flag 01732 BOOL bOuter = FALSE; 01733 01734 if (m_Indent < 0) 01735 bOuter = TRUE; 01736 01737 // calculate the width & height of the bitmap necessary 01738 DocRect dr = m_pProc->GetSummedPath()->GetBoundingRect(); 01739 01740 if (bOuter) 01741 { 01742 dr.lo.x -= abs(m_Indent); 01743 dr.lo.y -= abs(m_Indent); 01744 dr.hi.x += abs(m_Indent); 01745 dr.hi.y += abs(m_Indent); 01746 } 01747 01748 double lWidth = ((double)dr.Width()) / 750.0; 01749 double lHeight = ((double)dr.Height()) / 750.0; 01750 01751 INT32 Width = (INT32)lWidth; 01752 INT32 Height = (INT32)lHeight; 01753 01754 // calculate the light angle vector 01755 double angle = m_LightAngle; 01756 01757 angle = (3.142 * angle) / 180; 01758 01759 NormCoord LightAngle; 01760 01761 LightAngle.x = cos(angle); 01762 LightAngle.y = sin(angle); 01763 01764 // calculate the light vector from the light angle attribute 01765 01766 // ok, build the bitmap for the bevel 01767 CBeveler Beveler(m_pProc->GetSummedPath()); 01768 Beveler.SetBevelAngle(m_LightAngle); 01769 Beveler.SetBevelType(m_Type); 01770 BOOL Ok = Beveler.SetUpBeveler(abs(m_Indent), RoundJoin, &LightAngle, bOuter, 100, NULL, 200); 01771 Ok = Beveler.SetBevelerSize(Width,Height); 01772 01773 return NULL; 01774 }
|
|
Definition at line 453 of file attrbev.h. 00453 { return m_Contrast; }
|
|
Definition at line 451 of file attrbev.h. 00451 { return m_Indent; }
|
|
Definition at line 452 of file attrbev.h. 00452 { return m_LightAngle; }
|
|
Enables this attribute to remove its path processor when it's restored.
Reimplemented from AttributeValue. Definition at line 1711 of file attrbev.cpp.
|
|
Registers line width attribute, and provides a default attribute to give 0.25pt lines.
Reimplemented from SimpleCCObject. Definition at line 1854 of file attrbev.cpp. 01855 { 01856 BevelAttributeValueType *pAttr = new BevelAttributeValueType; 01857 if (pAttr == NULL) 01858 return FALSE; 01859 01860 UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), 01861 pAttr); 01862 if (ID == ATTR_BAD_ID) 01863 return FALSE; 01864 ENSURE(ID == ATTR_BEVELTYPE, "Incorrect ID for attribute!"); 01865 return TRUE; 01866 }
|
|
See base class version.
Reimplemented from AttributeValue. Definition at line 1954 of file attrbev.cpp. 01955 { 01956 ENSURE(GetRuntimeClass() == pAttr->GetRuntimeClass(), 01957 "Different attribute types in AttributeValue::IsDifferent()"); 01958 01959 if (((BevelAttributeValueType *) pAttr)->m_bPassback != 01960 m_bPassback) 01961 return TRUE; 01962 01963 if (m_bPassback) 01964 { 01965 if (((BevelAttributeValueType *) pAttr)->m_Type != m_Type || 01966 ((BevelAttributeValueType *) pAttr)->m_LightAngle != m_LightAngle || 01967 ((BevelAttributeValueType *) pAttr)->m_Contrast != m_Contrast || 01968 ((BevelAttributeValueType *) pAttr)->m_Indent != m_Indent) 01969 return TRUE; 01970 else 01971 return FALSE; 01972 } 01973 01974 return ((BevelAttributeValueType *) pAttr)->m_Type != m_Type; 01975 }
|
|
Make a AttrbValue node from this line width attribute.
Reimplemented from AttributeValue. Definition at line 1928 of file attrbev.cpp. 01930 { 01931 NodeAttribute * pAttr = MakeNode(); 01932 01933 if (!pAttr) 01934 return NULL; 01935 01936 pAttr->AttachNode(pContextNode, Direction); 01937 01938 return pAttr; 01939 }
|
|
Make a AttrbValue node from this line width attribute.
Reimplemented from AttributeValue. Definition at line 1881 of file attrbev.cpp. 01882 { 01883 // Create new attribute node 01884 AttrBevelType *pAttr = new AttrBevelType(); 01885 01886 // Copy attribute value into the new node. 01887 pAttr->Value.SimpleCopy(this); 01888 01889 // Return the new node 01890 return pAttr; 01891 }
|
|
Equality operator.
Reimplemented from AttributeValue. Definition at line 1833 of file attrbev.cpp. 01834 { 01835 SimpleCopy(&Attrib); 01836 01837 return TRUE; 01838 }
|
|
Equation operator.
Definition at line 1905 of file attrbev.cpp. 01906 { 01907 if (!IsDifferent(&Attrib)) 01908 { 01909 return TRUE; 01910 } 01911 01912 return FALSE; 01913 }
|
|
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 1673 of file attrbev.cpp.
|
|
Renders the bevel bitmap using the given path.
Definition at line 1792 of file attrbev.cpp. 01794 { 01795 return TRUE; 01796 }
|
|
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 1694 of file attrbev.cpp.
|
|
Definition at line 449 of file attrbev.h. 00449 { m_Contrast = Contrast; }
|
|
Definition at line 447 of file attrbev.h. 00447 { m_Indent = Indent; }
|
|
Definition at line 448 of file attrbev.h. 00448 { m_LightAngle = LightAngle; }
|
|
Definition at line 434 of file attrbev.h. 00434 { m_bPassback = b; }
|
|
See AttributeValue::SimpleCopy.
Implements AttributeValue. Definition at line 1812 of file attrbev.cpp. 01813 { 01814 m_Type = ((BevelAttributeValueType *) pValue)->m_Type; 01815 m_bPassback = ((BevelAttributeValueType *) pValue)->m_bPassback; 01816 m_Indent = ((BevelAttributeValueType *) pValue)->m_Indent; 01817 m_LightAngle = ((BevelAttributeValueType *) pValue)->m_LightAngle; 01818 m_Contrast = ((BevelAttributeValueType *) pValue)->m_Contrast; 01819 }
|
|
|
|
|
|
|
|
|
|
|
|
|