AttrFourColTranspFill Class Reference

Four point graduated transparency Fill Attribute class. More...

#include <fillattr2.h>

Inheritance diagram for AttrFourColTranspFill:

AttrFourColFill AttrFillGeometry NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrFourColTranspFill ()
 AttrFourColTranspFill (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
void Render (RenderRegion *pRender)
 'Renders' a FourCol Fill 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 UINT32 GetAttrNameID (void)
 Returns a string resource ID describing the attribute.
void GetDebugDetails (StringBase *Str)
 Output details of this attribute to the Camelot debug tree dialog.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual void RenderFillBlobs (RenderRegion *pRender)
 Renders the grad fills arrow blob when requested to by its selected parent.
virtual BOOL IsVisible ()
virtual BOOL NeedsTransparency () const
 Called to determine whether transparency is needed to render properly.
virtual CCRuntimeClassGetAttributeType ()
virtual AttributeValueGetAttributeValue ()
AttrFillGeometryChangeAttrValue (AttrValueChange *pValue)
virtual BOOL IsATranspFill () const
 Virtual function for determining if the node is an attribute.
virtual BOOL HasEquivalentDefaultValue (BOOL bAppearance=FALSE)
 Determine whether this attribute has the default value or not.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes the FourCol transparent fill record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
 Writes the FourCol transparent fill record to the filter.
virtual BOOL IsSeeThrough (BOOL CheckIndirectAttrs)

Protected Attributes

FourColTranspFillAttribute Value

Detailed Description

Four point graduated transparency Fill Attribute class.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
See also:
FourColFillAttribute

Definition at line 1739 of file fillattr2.h.


Constructor & Destructor Documentation

AttrFourColTranspFill::AttrFourColTranspFill  )  [inline]
 

Definition at line 1744 of file fillattr2.h.

01744 : AttrFourColFill() {}

AttrFourColTranspFill::AttrFourColTranspFill Node ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
[inline]
 

Definition at line 1745 of file fillattr2.h.

01750                                      : 
01751         AttrFourColFill(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}


Member Function Documentation

AttrFillGeometry* AttrFourColTranspFill::ChangeAttrValue AttrValueChange pValue  )  [inline, virtual]
 

Reimplemented from AttrFillGeometry.

Definition at line 1767 of file fillattr2.h.

01767 { return ChangeTransp(pValue); }

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

Reimplemented from NodeAttribute.

Definition at line 1764 of file fillattr2.h.

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

Implements AttrFourColFill.

Definition at line 1765 of file fillattr2.h.

01765 { return &Value; }

UINT32 AttrFourColTranspFill::GetAttrNameID void   )  [virtual]
 

Returns a string resource ID describing the attribute.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Returns:
Attribute description ID

Reimplemented from NodeAttribute.

Definition at line 13597 of file fillattr.cpp.

13598 {
13599     return (_R(IDS_FOURCOLTRANSPFILL)); 
13600 }                                  

void AttrFourColTranspFill::GetDebugDetails StringBase Str  )  [virtual]
 

Output details of this attribute to the Camelot debug tree dialog.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Parameters:
Str - the string containing details of the attribute. [OUTPUTS]

Reimplemented from NodeRenderable.

Definition at line 13615 of file fillattr.cpp.

13616 {
13617 #ifdef _DEBUG
13618     NodeAttribute::GetDebugDetails( Str );
13619 
13620     String_256 TempStr;
13621 
13622     TempStr._MakeMsg( TEXT("\r\nFourCol Graduated Fill:\r\n"));
13623     (*Str) += TempStr;
13624 
13625     TempStr._MakeMsg(TEXT("\r\nStart"));
13626     (*Str) += TempStr;
13627 
13628     TempStr._MakeMsg(TEXT("\r\nEnd"));
13629     (*Str) += TempStr;
13630 
13631     TempStr._MakeMsg(TEXT("\r\nStart = (#1%ld, #2%ld)"), 
13632                      (*GetStartPoint()).x, (*GetStartPoint()).y);
13633     (*Str) += TempStr;
13634 
13635     TempStr._MakeMsg(TEXT("\r\nEnd = (#1%ld, #2%ld) "), 
13636                      (*GetEndPoint()).x, (*GetEndPoint()).y);
13637     (*Str) += TempStr;
13638 
13639     TempStr._MakeMsg(TEXT("\r\n3rd = (#1%ld, #2%ld) "), 
13640                      (*GetEndPoint2()).x, (*GetEndPoint2()).y);
13641     (*Str) += TempStr;
13642 #endif
13643 }

UINT32 AttrFourColTranspFill::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Returns:
The size of the node in bytes
See also:
Node::GetSubtreeSize

Reimplemented from Node.

Definition at line 13659 of file fillattr.cpp.

13660 {     
13661     return sizeof(AttrFourColTranspFill);
13662 }  

BOOL AttrFourColTranspFill::HasEquivalentDefaultValue BOOL  bAppearance = FALSE  )  [virtual]
 

Determine whether this attribute has the default value or not.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/05/2005
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this node has a value equivalent to the relevant FALSE otherwise

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 13754 of file fillattr.cpp.

13755 {
13756     // Slight bodge - we will assume that the default transparency is fully opaque
13757     if (bAppearance)
13758         return (Value.TranspType==TT_NoTranspType || (Value.TranspType==TT_Mix && Value.Transp == 0 && Value.EndTransp==0 && Value.EndTransp2==0 && Value.EndTransp3==0));
13759     else
13760         return FALSE;
13761 }

virtual BOOL AttrFourColTranspFill::IsATranspFill  )  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 1769 of file fillattr2.h.

01769 { return TRUE; } 

virtual BOOL AttrFourColTranspFill::IsSeeThrough BOOL  CheckIndirectAttrs  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 1779 of file fillattr2.h.

01779                                                        {
01780         return ((GetStartTransp() != NULL   &&  *GetStartTransp() != 0) ||
01781                 (GetEndTransp() != NULL     &&  *GetEndTransp() != 0)   ||
01782                 (GetEndTransp2() != NULL    &&  *GetEndTransp2() != 0)  ||
01783                 (GetEndTransp3() != NULL    &&  *GetEndTransp3() != 0));
01784     }

virtual BOOL AttrFourColTranspFill::IsVisible  )  [inline, virtual]
 

Reimplemented from AttrFillGeometry.

Definition at line 1761 of file fillattr2.h.

01761 { return IsTranspMeshVisible(); }

BOOL AttrFourColTranspFill::NeedsTransparency  )  const [virtual]
 

Called to determine whether transparency is needed to render properly.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this node requires transparency mode to render properly.

Errors: -

Reimplemented from AttrFillGeometry.

Definition at line 13496 of file fillattr.cpp.

13497 {
13498     AttrFourColTranspFill* pNonConst = (AttrFourColTranspFill*) this;
13499     return (    pNonConst->GetTranspType()      != TT_Mix || 
13500                 *(pNonConst->GetStartTransp())  != 0 ||
13501                 *(pNonConst->GetEndTransp())    != 0 ||
13502                 *(pNonConst->GetEndTransp2())   != 0 ||
13503                 *(pNonConst->GetEndTransp3())   != 0 );
13504 }

void AttrFourColTranspFill::Render RenderRegion pRender  )  [virtual]
 

'Renders' a FourCol Fill Colour attribute.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96

Reimplemented from NodeAttribute.

Definition at line 13476 of file fillattr.cpp.

13477 {
13478     pRender->SetTranspFillGeometry(&Value, FALSE);
13479 }

void AttrFourColTranspFill::RenderFillBlobs RenderRegion pRender  )  [virtual]
 

Renders the grad fills arrow blob when requested to by its selected parent.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Parameters:
pRender - The region to render the blobs to. [INPUTS]

Reimplemented from AttrFourColFill.

Definition at line 13547 of file fillattr.cpp.

13548 {
13549 #if !defined(EXCLUDE_FROM_RALPH)
13550     if (!IsVisible())
13551         return;     // We're in Fill Transparency Mode
13552 
13553     // Don't bother if this fill is being edited as a copy of it
13554     // we be rendered thoughout the drag op
13555     if (IsFillBeingEdited())
13556         return;
13557 
13558     // Ignore this if the mesh is the same as the last one rendered.
13559     if (CheckPreviousFillMesh())
13560         return;
13561 
13562     // Get the control points
13563     DocCoord StartPoint = *GetStartPoint();
13564     DocCoord EndPoint = *GetEndPoint();
13565     DocCoord EndPoint2 = *GetEndPoint2();
13566     DocCoord EndPoint3 = EndPoint2 + EndPoint - StartPoint;
13567 
13568     DocCoord ControlPoints[4];
13569     ControlPoints[FILLCONTROL_STARTPOINT] = StartPoint;
13570     ControlPoints[FILLCONTROL_ENDPOINT] = EndPoint;
13571     ControlPoints[FILLCONTROL_ENDPOINT2] = EndPoint2;
13572     ControlPoints[FILLCONTROL_ENDPOINT3] = EndPoint3;
13573 
13574     // Render a nice pretty Fill Mesh thingy
13575     RenderFillMesh(pRender, ControlPoints, SelectionState, 4);
13576 
13577     // This call was removed by Gerry (2/9/96) as it causes blob problems
13578     // If we are removing blobs then force all blobs to be deselected
13579 //  if ((Camelot.GetBlobManager())->IsRemovingBlobs())
13580 //      DeselectAllNoRedraw();
13581 #endif
13582 }

Node * AttrFourColTranspFill::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:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
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 13523 of file fillattr.cpp.

13524 {
13525     AttrFourColTranspFill* NodeCopy = new AttrFourColTranspFill();
13526     if (NodeCopy == NULL)
13527         return NULL;
13528 
13529     CopyNodeContents(NodeCopy);
13530     
13531     return NodeCopy;
13532 }  

BOOL AttrFourColTranspFill::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Writes the FourCol transparent fill record to the filter.

> virtual BOOL AttrFourColTranspFill::WritePreChildrenNative(BaseCamelotFilter* pFilter)

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/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 13728 of file fillattr.cpp.

13729 {
13730 #ifdef DO_EXPORT
13731     return WritePreChildrenWeb(pFilter);
13732 #else
13733     return FALSE;
13734 #endif
13735 }

BOOL AttrFourColTranspFill::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the FourCol transparent fill record to the filter.

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

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/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 13679 of file fillattr.cpp.

13680 {
13681 #ifdef DO_EXPORT
13682     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
13683     ERROR3IF(Value.Transp     > 255,"Start transparency level is too high to be stored as a byte");
13684     ERROR3IF(Value.EndTransp  > 255,"End transparency level is too high to be stored as a byte");
13685     ERROR3IF(Value.EndTransp2 > 255,"End transparency2 level is too high to be stored as a byte");
13686     ERROR3IF(Value.EndTransp3 > 255,"End transparency3 level is too high to be stored as a byte");
13687     ERROR3IF(Value.TranspType > 255,"Transparency type is too high to be stored as a byte");
13688 
13689     BOOL ok = TRUE;
13690 
13691     CamelotFileRecord Rec(pFilter,TAG_FOURCOLTRANSPARENTFILL,TAG_FOURCOLTRANSPARENTFILL_SIZE);
13692 
13693     if (ok) ok = Rec.Init();
13694     if (ok) ok = Rec.WriteCoord(Value.StartPoint);
13695     if (ok) ok = Rec.WriteCoord(Value.EndPoint);
13696     if (ok) ok = Rec.WriteCoord(Value.EndPoint2);
13697     if (ok) ok = Rec.WriteBYTE(BYTE(Value.Transp));
13698     if (ok) ok = Rec.WriteBYTE(BYTE(Value.EndTransp));
13699     if (ok) ok = Rec.WriteBYTE(BYTE(Value.EndTransp2));
13700     if (ok) ok = Rec.WriteBYTE(BYTE(Value.EndTransp3));
13701     if (ok) ok = Rec.WriteBYTE(BYTE(Value.TranspType));
13702     if (ok) ok = pFilter->Write(&Rec);
13703 
13704     if (!ok)
13705         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
13706 
13707     return ok;
13708 #else
13709     return FALSE;
13710 #endif
13711 }


Member Data Documentation

FourColTranspFillAttribute AttrFourColTranspFill::Value [protected]
 

Definition at line 1787 of file fillattr2.h.


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