BevelAttributeValueType Class Reference

Sets the indent attribute. More...

#include <attrbev.h>

Inheritance diagram for BevelAttributeValueType:

AttributeValue CCObject SimpleCCObject List of all members.

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 NodeAttributeMakeNode ()
 Make a AttrbValue node from this line width attribute.
virtual NodeAttributeMakeNode (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

KernelBitmapCreateBevelBitmap (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
BevelAttributePathProcessorm_pProc

Detailed Description

Sets the indent attribute.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/98
See also:

Definition at line 413 of file attrbev.h.


Constructor & Destructor Documentation

BevelAttributeValueType::BevelAttributeValueType  ) 
 

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 }

BevelAttributeValueType::~BevelAttributeValueType  ) 
 

Definition at line 1649 of file attrbev.cpp.

01650 {
01651     if (m_pProc)
01652     {
01653         delete m_pProc;
01654         m_pProc = NULL;
01655     }
01656 }

BevelAttributeValueType::BevelAttributeValueType INT32  val  ) 
 

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 }


Member Function Documentation

KernelBitmap * BevelAttributeValueType::CreateBevelBitmap RenderRegion pRegion  )  [private]
 

Creates the bevel bitmap from the region.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/99
Parameters:
pRegion - The render region to use [INPUTS]
Returns:
A new KernelBitmap with the bevel bitmap in it NULL for failure
See also:

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 }

INT32 BevelAttributeValueType::GetContrast  )  [inline]
 

Definition at line 453 of file attrbev.h.

00453 { return m_Contrast; }

MILLIPOINT BevelAttributeValueType::GetIndent  )  [inline]
 

Definition at line 451 of file attrbev.h.

00451 { return m_Indent; }

double BevelAttributeValueType::GetLightAngle  )  [inline]
 

Definition at line 452 of file attrbev.h.

00452 { return m_LightAngle; }

void BevelAttributeValueType::GoingOutOfScope RenderRegion pRegion  )  [virtual]
 

Enables this attribute to remove its path processor when it's restored.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/99
Parameters:
pRegion - the render region to render this attribute into. [INPUTS]
See also:
BevelAttributeValueType; RenderStack; AttributeValue; NodeAttribute; BevelAttributeValueType::Restore; BevelAttributeValueType::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Reimplemented from AttributeValue.

Definition at line 1711 of file attrbev.cpp.

01712 {
01713 }

BOOL BevelAttributeValueType::Init void   )  [static]
 

Registers line width attribute, and provides a default attribute to give 0.25pt lines.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/04/94
Returns:
TRUE - initialised ok; FALSE if not.

Errors: Out of memory.

See also:
AttributeManager

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 }

BOOL BevelAttributeValueType::IsDifferent AttributeValue pAttr  )  [virtual]
 

See base class version.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Returns:
Errors: The two attributes are not of the same type.
See also:
AttributeValue::IsDifferent

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 }

NodeAttribute * BevelAttributeValueType::MakeNode Node pContextNode,
AttachNodeDirection  Direction
[virtual]
 

Make a AttrbValue node from this line width attribute.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/04/94
Returns:
Pointer to the new node, or NULL if out of memory.

Errors: Out of memory

See also:
AttributeValue::MakeNode

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 }

NodeAttribute * BevelAttributeValueType::MakeNode  )  [virtual]
 

Make a AttrbValue node from this line width attribute.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/04/94
Returns:
Pointer to the new node, or NULL if out of memory.

Errors: Out of memory

See also:
AttributeValue::MakeNode

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 }

INT32 BevelAttributeValueType::operator= AttributeValue Attrib  )  [virtual]
 

Equality operator.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
pAttr - pointer to the AttributeValue to copy. [INPUTS]
See also:

Reimplemented from AttributeValue.

Definition at line 1833 of file attrbev.cpp.

01834 {
01835     SimpleCopy(&Attrib);
01836 
01837     return TRUE;
01838 }

INT32 BevelAttributeValueType::operator== AttributeValue Attrib  ) 
 

Equation operator.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Returns:
Pointer to the new node, or NULL if out of memory.

Errors: Out of memory

See also:
AttributeValue::MakeNode

Definition at line 1905 of file attrbev.cpp.

01906 {
01907     if (!IsDifferent(&Attrib))
01908     {
01909         return TRUE;
01910     }
01911 
01912     return FALSE;
01913 }

void BevelAttributeValueType::Render RenderRegion pRegion,
BOOL  Temp = FALSE
[virtual]
 

Sets the line width attribute for the given render region. i.e. all lines drawn will now be drawn with this line width.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/02/94
Parameters:
pRegion - the render region to render this attribute into. [INPUTS]
See also:
BevelAttributeValueType; RenderStack; AttributeValue; NodeAttribute; BevelAttributeValueType::Restore; BevelAttributeValueType::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Implements AttributeValue.

Definition at line 1673 of file attrbev.cpp.

01674 {
01675 }

BOOL BevelAttributeValueType::RenderBitmap RenderRegion pRegion,
KernelBitmap pBitmap,
Path pSrcPath,
Path pRenderPath
[private]
 

Renders the bevel bitmap using the given path.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/99
Parameters:
pRegion - The render region to use [INPUTS] pBitmap - The bitmap to render pSrcPath - The path to be bevelled pRenderPath - The path to use to render the bitmap
Returns:
TRUE for success
See also:

Definition at line 1792 of file attrbev.cpp.

01794 {
01795     return TRUE;
01796 }

void BevelAttributeValueType::Restore RenderRegion pRegion,
BOOL  Temp
[virtual]
 

Restores the line width attribute for the given render region. i.e. all lines drawn will now be drawn with this line width.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/02/94
Parameters:
pRegion - the render region to restore the attribute into. [INPUTS] Temp - TRUE if this is a temporary attribute, FALSE if it is permanent (e.g. it's in a document tree).
See also:
BevelAttributeValueType; RenderStack; AttributeValue; NodeAttribute; BevelAttributeValueType::Render; BevelAttributeValueType::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Implements AttributeValue.

Definition at line 1694 of file attrbev.cpp.

01695 {
01696 }

void BevelAttributeValueType::SetContrast INT32  Contrast  )  [inline]
 

Definition at line 449 of file attrbev.h.

00449 { m_Contrast = Contrast; }

void BevelAttributeValueType::SetIndent MILLIPOINT  Indent  )  [inline]
 

Definition at line 447 of file attrbev.h.

00447 { m_Indent = Indent; }

void BevelAttributeValueType::SetLightAngle double  LightAngle  )  [inline]
 

Definition at line 448 of file attrbev.h.

00448 { m_LightAngle = LightAngle; }

void BevelAttributeValueType::SetPassbackValue BOOL  b  )  [inline]
 

Definition at line 434 of file attrbev.h.

00434 { m_bPassback = b; }

void BevelAttributeValueType::SimpleCopy AttributeValue pValue  )  [virtual]
 

See AttributeValue::SimpleCopy.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/02/94
Parameters:
pAttr - pointer to the AttributeValue to copy. [INPUTS]
See also:
BevelAttributeValueType; RenderStack; AttributeValue; NodeAttribute; BevelAttributeValueType::Render; BevelAttributeValueType::Restore; AttributeValue::Render; AttributeValue::Restore; 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 }


Member Data Documentation

BOOL BevelAttributeValueType::m_bPassback
 

Definition at line 441 of file attrbev.h.

INT32 BevelAttributeValueType::m_Contrast [private]
 

Definition at line 458 of file attrbev.h.

MILLIPOINT BevelAttributeValueType::m_Indent [private]
 

Definition at line 456 of file attrbev.h.

double BevelAttributeValueType::m_LightAngle [private]
 

Definition at line 457 of file attrbev.h.

BevelAttributePathProcessor* BevelAttributeValueType::m_pProc [private]
 

Definition at line 461 of file attrbev.h.

INT32 BevelAttributeValueType::m_Type
 

Definition at line 438 of file attrbev.h.


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