AttrStrokeTransp Class Reference

Stroke Transparency Attribute class. More...

#include <lineattr.h>

Inheritance diagram for AttrStrokeTransp:

AttrFillGeometry NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrStrokeTransp ()
 Default constructor for Line Colour Attribute class.
 AttrStrokeTransp (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a LineColour Attribute.
void Render (RenderRegion *pRender)
 'Renders' a Line Colour attribute.
NodeSimpleCopy ()
 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 INT32 operator== (const NodeAttribute &NodeAttrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual UINT32 GetAttrNameID (void)
 Returns back a string resource ID describing the attribute.
virtual DocRect GetBlobBoundingRect ()
 Calculates the bounding rectangle of the attrs blobs.This should always be calculated on the fly as the view scale can change without the attr knowing, giving an incorrect result.
virtual CCRuntimeClassGetAttributeType ()
virtual AttributeValueGetAttributeValue ()
virtual AttrIndex GetAttributeIndex ()
virtual AttrFillGeometryChangeAttrValue (AttrValueChange *)
 Changes the stroke colour in some way.
virtual BOOL IsAStrokeTransp () const
 Virtual function for determining if the node is an attribute.
void GetDebugDetails (StringBase *Str)
 For obtaining debug information about the Node.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the stroke transparancy record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL NeedsTransparency () const
 Called to determine whether transparency is needed to render properly.

Public Attributes

StrokeTranspAttribute Value

Private Member Functions

void CopyNodeContents (AttrStrokeTransp *NodeCopy)
 This method copies the node's contents to the node pointed to by NodeCopy.

Detailed Description

Stroke Transparency Attribute class.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/11/94

Definition at line 261 of file lineattr.h.


Constructor & Destructor Documentation

AttrStrokeTransp::AttrStrokeTransp  ) 
 

Default constructor for Line Colour Attribute class.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/6/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1199 of file lineattr.cpp.

01200 {
01201 }

AttrStrokeTransp::AttrStrokeTransp Node ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
 

Creates a LineColour Attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/6/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1174 of file lineattr.cpp.

01180              : AttrFillGeometry(ContextNode, Direction, Locked, Mangled, Marked, Selected)   
01181 {                         
01182 } 


Member Function Documentation

AttrFillGeometry * AttrStrokeTransp::ChangeAttrValue AttrValueChange Mutator  )  [virtual]
 

Changes the stroke colour in some way.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Parameters:
The value change attribute [INPUTS]
Returns:
A new stroke colour attr, with the appropriate changes made

Reimplemented from AttrFillGeometry.

Definition at line 1425 of file lineattr.cpp.

01426 {
01427     AttrFillGeometry* NewFill = NULL;
01428 
01429     // Make a copy of this Fill and change the copys' control point colours
01430     NewFill = (AttrFillGeometry*)this->SimpleCopy();
01431     if (NewFill == NULL)
01432         return NULL;
01433 
01434     if (Mutator->MutateFill(NewFill))
01435         return NewFill;
01436 
01437     return NewFill;
01438 }

void AttrStrokeTransp::CopyNodeContents AttrStrokeTransp NodeCopy  )  [private]
 

This method copies the node's contents to the node pointed to by NodeCopy.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
[INPUTS] 
A copy of this node [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if NodeCopy is NULL

Scope: protected

Definition at line 1319 of file lineattr.cpp.

01320 {
01321     NodeAttribute::CopyNodeContents( NodeCopy );
01322     
01323     //Copy contents specific to derived class here 
01324     NodeCopy->Value.Transp = Value.Transp;
01325     NodeCopy->Value.TranspType = Value.TranspType;
01326 } 

virtual AttrIndex AttrStrokeTransp::GetAttributeIndex  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 284 of file lineattr.h.

00284 { return ATTR_STROKETRANSP; }

virtual CCRuntimeClass* AttrStrokeTransp::GetAttributeType  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 282 of file lineattr.h.

virtual AttributeValue* AttrStrokeTransp::GetAttributeValue  )  [inline, virtual]
 

Implements AttrFillGeometry.

Definition at line 283 of file lineattr.h.

00283 { return &Value; }

UINT32 AttrStrokeTransp::GetAttrNameID void   )  [virtual]
 

Returns back a string resource ID describing the attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/2/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Attribute description ID

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 1295 of file lineattr.cpp.

01296 {
01297     return (_R(IDS_LINE_TRANSP)); 
01298 }                                  

virtual DocRect AttrStrokeTransp::GetBlobBoundingRect  )  [inline, virtual]
 

Calculates the bounding rectangle of the attrs blobs.This should always be calculated on the fly as the view scale can change without the attr knowing, giving an incorrect result.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/7/94
Returns:
DocRect - The rectangle that contains all the attrs selection blobs.

Reimplemented from AttrFillGeometry.

Definition at line 280 of file lineattr.h.

00280 { return DocRect(0,0,0,0); }

void AttrStrokeTransp::GetDebugDetails StringBase Str  )  [virtual]
 

For obtaining debug information about the Node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/9/93
Parameters:
Str,: String giving debug info about the node [OUTPUTS]

Reimplemented from NodeRenderable.

Definition at line 1373 of file lineattr.cpp.

01374 {
01375 #ifdef _DEBUG
01376     NodeAttribute::GetDebugDetails( Str );
01377 
01378     String_256 TempStr;
01379 
01380     TempStr._MakeMsg(TEXT("\r\nLine Transparency = #1%ld "), 
01381                      *GetStartTransp());
01382 
01383     (*Str) += TempStr;
01384 
01385     TempStr._MakeMsg(TEXT("\nTransparency Type = #1%ld "), 
01386                      GetTranspType());
01387 
01388     (*Str) += TempStr;
01389 #endif
01390 }

UINT32 AttrStrokeTransp::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size of the node in bytes
See also:
Node::GetSubtreeSize

Reimplemented from Node.

Definition at line 1408 of file lineattr.cpp.

01409 {     
01410     return (sizeof(AttrStrokeTransp)); 
01411 }  

virtual BOOL AttrStrokeTransp::IsAStrokeTransp  )  const [inline, virtual]
 

Virtual function for determining if the node is an attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/2/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node is a NodeAttribute, will return TRUE

Errors:

Reimplemented from NodeAttribute.

Definition at line 288 of file lineattr.h.

00288 { return TRUE; }

BOOL AttrStrokeTransp::NeedsTransparency  )  const [virtual]
 

Called to determine whether transparency is needed to render properly.

> virtual BOOL AttrStrokeTransp::NeedsTransparency() const

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/11/97
Returns:
TRUE if this node requires transparency mode to render properly.

Reimplemented from AttrFillGeometry.

Definition at line 1497 of file lineattr.cpp.

01498 {
01499     AttrStrokeTransp* pNonConst = (AttrStrokeTransp*) this;
01500     return pNonConst->GetTranspType() != TT_Mix || *(pNonConst->GetStartTransp()) != 0;
01501 }

INT32 AttrStrokeTransp::operator== const NodeAttribute Attrib  )  [virtual]
 

A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/2/94
Parameters:
Atrib,: The attribute to compare, which must be an AttrStrokeTransp [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: An ENSURE failure will occur if Attrib does not have a AttrStrokeTransp runtime class.

See also:
NodeAttribute::operator==

Reimplemented from AttrFillGeometry.

Definition at line 1270 of file lineattr.cpp.

01271 {
01272     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrStrokeTransp)), 
01273             "Trying to compare two objects with different types"); 
01274     AttrStrokeTransp* Attr = (AttrStrokeTransp*) &Attrib;
01275     return (Attr->Value.Transp == Value.Transp &&
01276             Attr->Value.TranspType == Value.TranspType ); 
01277 }

void AttrStrokeTransp::PolyCopyNodeContents NodeRenderable pNodeCopy  )  [virtual]
 

Polymorphically copies the contents of this node to another.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/12/2003
Parameters:
- [OUTPUTS]
Returns:
Errors: An assertion failure will occur if NodeCopy is NULL Scope: protected

Reimplemented from AttrFillGeometry.

Definition at line 1342 of file lineattr.cpp.

01343 {
01344     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
01345     ENSURE(IS_A(pNodeCopy, AttrStrokeTransp), "PolyCopyNodeContents given wrong dest node type");
01346 
01347     if (IS_A(pNodeCopy, AttrStrokeTransp))
01348         CopyNodeContents((AttrStrokeTransp*)pNodeCopy);
01349 }

void AttrStrokeTransp::Render RenderRegion pRender  )  [virtual]
 

'Renders' a Line Colour attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/6/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 1218 of file lineattr.cpp.

01219 {
01220     pRender->SetLineTransp((StrokeTranspAttribute *) &Value, FALSE);
01221 }

Node * AttrStrokeTransp::SimpleCopy void   )  [virtual]
 

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.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/6/93
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
A copy of the node, or NULL if memory runs out

Errors: If memory runs out when trying to copy, then ERROR is called with an out of memory error and the function returns NULL.

Scope: protected

Reimplemented from NodeAttribute.

Definition at line 1242 of file lineattr.cpp.

01243 {
01244     AttrStrokeTransp* NodeCopy = new AttrStrokeTransp();
01245     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
01246     CopyNodeContents(NodeCopy);
01247     
01248     return NodeCopy;
01249 }  

BOOL AttrStrokeTransp::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 1477 of file lineattr.cpp.

01478 {
01479 #ifdef DO_EXPORT
01480     return WritePreChildrenWeb(pFilter);
01481 #else
01482     return FALSE;
01483 #endif
01484 }

BOOL AttrStrokeTransp::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the stroke transparancy record to the filter.

> virtual BOOL AttrStrokeTransp::WritePreChildrenWeb(BaseCamelotFilter* pFilter)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/5/96
Parameters:
pFilter = ptr to the filter [INPUTS]
Returns:
TRUE if record is written, FALSE if not
See also:
-

Reimplemented from Node.

Definition at line 1454 of file lineattr.cpp.

01455 {
01456 #ifdef DO_EXPORT
01457     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
01458     ERROR3IF(Value.Transp     > 255,"Transparency level is too high to be stored as a byte");
01459     ERROR3IF(Value.TranspType > 255,"Transparency type is too high to be stored as a byte");
01460 
01461     CamelotFileRecord Rec(pFilter,TAG_LINETRANSPARENCY,TAG_LINETRANSPARENCY_SIZE);
01462 
01463     BOOL ok = Rec.Init();
01464     if (ok) ok = Rec.WriteBYTE(BYTE(Value.Transp));
01465     if (ok) ok = Rec.WriteBYTE(BYTE(Value.TranspType));
01466     if (ok) ok = pFilter->Write(&Rec);
01467 
01468     return ok;
01469 #else
01470     return FALSE;
01471 #endif
01472 }


Member Data Documentation

StrokeTranspAttribute AttrStrokeTransp::Value
 

Definition at line 311 of file lineattr.h.


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