AttrThreeColTranspFill Class Reference

ThreeCol Graduated Transparency Fill Attribute class. More...

#include <fillattr2.h>

Inheritance diagram for AttrThreeColTranspFill:

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

Public Member Functions

 AttrThreeColTranspFill ()
 AttrThreeColTranspFill (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
void Render (RenderRegion *pRender)
 'Renders' a ThreeCol 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 ThreeCol transparent fill record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
 Writes the ThreeCol transparent fill record to the filter.
virtual BOOL IsSeeThrough (BOOL CheckIndirectAttrs)

Protected Attributes

ThreeColTranspFillAttribute Value

Detailed Description

ThreeCol Graduated Transparency Fill Attribute class.

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

Definition at line 1555 of file fillattr2.h.


Constructor & Destructor Documentation

AttrThreeColTranspFill::AttrThreeColTranspFill  )  [inline]
 

Definition at line 1560 of file fillattr2.h.

01560 : AttrThreeColFill() {}

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

Definition at line 1561 of file fillattr2.h.

01566                                      : 
01567         AttrThreeColFill(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}


Member Function Documentation

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

Reimplemented from AttrFillGeometry.

Definition at line 1583 of file fillattr2.h.

01583 { return ChangeTransp(pValue); }

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

Reimplemented from NodeAttribute.

Definition at line 1580 of file fillattr2.h.

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

Implements AttrThreeColFill.

Definition at line 1581 of file fillattr2.h.

01581 { return &Value; }

UINT32 AttrThreeColTranspFill::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 12148 of file fillattr.cpp.

12149 {
12150     return (_R(IDS_THREECOLTRANSPFILL)); 
12151 }                                  

void AttrThreeColTranspFill::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 12166 of file fillattr.cpp.

12167 {
12168 #ifdef _DEBUG
12169     NodeAttribute::GetDebugDetails( Str );
12170 
12171     String_256 TempStr;
12172 
12173     TempStr._MakeMsg( TEXT("\r\nThreeCol Graduated Fill:\r\n"));
12174     (*Str) += TempStr;
12175 
12176     TempStr._MakeMsg(TEXT("\r\nStart"));
12177     (*Str) += TempStr;
12178 
12179     TempStr._MakeMsg(TEXT("\r\nEnd"));
12180     (*Str) += TempStr;
12181 
12182     TempStr._MakeMsg(TEXT("\r\nStart = (#1%ld, #2%ld)"), 
12183                      (*GetStartPoint()).x, (*GetStartPoint()).y);
12184     (*Str) += TempStr;
12185 
12186     TempStr._MakeMsg(TEXT("\r\nEnd = (#1%ld, #2%ld) "), 
12187                      (*GetEndPoint()).x, (*GetEndPoint()).y);
12188     (*Str) += TempStr;
12189 
12190     TempStr._MakeMsg(TEXT("\r\n3rd = (#1%ld, #2%ld) "), 
12191                      (*GetEndPoint2()).x, (*GetEndPoint2()).y);
12192     (*Str) += TempStr;
12193 #endif
12194 }

UINT32 AttrThreeColTranspFill::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 12210 of file fillattr.cpp.

12211 {     
12212     return sizeof(AttrThreeColTranspFill);
12213 }  

BOOL AttrThreeColTranspFill::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 12303 of file fillattr.cpp.

12304 {
12305     // Slight bodge - we will assume that the default transparency is fully opaque
12306     if (bAppearance)
12307         return (Value.TranspType==TT_NoTranspType || (Value.TranspType==TT_Mix && Value.Transp == 0 && Value.EndTransp==0 && Value.EndTransp2==0));
12308     else
12309         return FALSE;
12310 }

virtual BOOL AttrThreeColTranspFill::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 1585 of file fillattr2.h.

01585 { return TRUE; } 

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

Reimplemented from NodeAttribute.

Definition at line 1595 of file fillattr2.h.

01595                                                        {
01596         return ((GetStartTransp() != NULL   &&  *GetStartTransp() != 0) ||
01597                 (GetEndTransp() != NULL     &&  *GetEndTransp() != 0)   ||
01598                 (GetEndTransp2() != NULL    &&  *GetEndTransp2() != 0));
01599     }

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

Reimplemented from AttrFillGeometry.

Definition at line 1577 of file fillattr2.h.

01577 { return IsTranspMeshVisible(); }

BOOL AttrThreeColTranspFill::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 12055 of file fillattr.cpp.

12056 {
12057     AttrThreeColTranspFill* pNonConst = (AttrThreeColTranspFill*) this;
12058     return (    pNonConst->GetTranspType()      != TT_Mix ||
12059                 *(pNonConst->GetStartTransp())  != 0 ||
12060                 *(pNonConst->GetEndTransp())    != 0 ||
12061                 *(pNonConst->GetEndTransp2())   != 0 );
12062 }

void AttrThreeColTranspFill::Render RenderRegion pRender  )  [virtual]
 

'Renders' a ThreeCol Fill Colour attribute.

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

Reimplemented from NodeAttribute.

Definition at line 12035 of file fillattr.cpp.

12036 {
12037     pRender->SetTranspFillGeometry(&Value, FALSE);
12038 }

void AttrThreeColTranspFill::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 AttrThreeColFill.

Definition at line 12105 of file fillattr.cpp.

12106 {
12107 #if !defined(EXCLUDE_FROM_RALPH)
12108     if (!IsVisible())
12109         return;     // We're in Fill Transparency Mode
12110 
12111     // Don't bother if this fill is being edited as a copy of it
12112     // we be rendered thoughout the drag op
12113     if (IsFillBeingEdited())
12114         return;
12115 
12116     // Ignore this if the mesh is the same as the last one rendered.
12117     if (CheckPreviousFillMesh())
12118         return;
12119 
12120     DocCoord ControlPoints[3];
12121     ControlPoints[FILLCONTROL_STARTPOINT] = (*GetStartPoint());
12122     ControlPoints[FILLCONTROL_ENDPOINT] = (*GetEndPoint());
12123     ControlPoints[FILLCONTROL_ENDPOINT2] = (*GetEndPoint2());
12124 
12125     // Render a nice pretty Fill Mesh thingy
12126     RenderFillMesh(pRender, ControlPoints, SelectionState, 3);
12127 
12128     // This call was removed by Gerry (2/9/96) as it causes blob problems
12129     // If we are removing blobs then force all blobs to be deselected
12130 //  if ((Camelot.GetBlobManager())->IsRemovingBlobs())
12131 //      DeselectAllNoRedraw();
12132 #endif
12133 }

Node * AttrThreeColTranspFill::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 12081 of file fillattr.cpp.

12082 {
12083     AttrThreeColTranspFill* NodeCopy = new AttrThreeColTranspFill();
12084     if (NodeCopy == NULL)
12085         return NULL;
12086 
12087     CopyNodeContents(NodeCopy);
12088     
12089     return NodeCopy;
12090 }  

BOOL AttrThreeColTranspFill::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Writes the ThreeCol transparent fill record to the filter.

> virtual BOOL AttrThreeColTranspFill::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 12277 of file fillattr.cpp.

12278 {
12279 #ifdef DO_EXPORT
12280     return WritePreChildrenWeb(pFilter);
12281 #else
12282     return FALSE;
12283 #endif
12284 }

BOOL AttrThreeColTranspFill::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the ThreeCol transparent fill record to the filter.

> virtual BOOL AttrThreeColTranspFill::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 12230 of file fillattr.cpp.

12231 {
12232 #ifdef DO_EXPORT
12233     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
12234     ERROR3IF(Value.Transp     > 255,"Start transparency level is too high to be stored as a byte");
12235     ERROR3IF(Value.EndTransp  > 255,"End transparency level is too high to be stored as a byte");
12236     ERROR3IF(Value.EndTransp2 > 255,"End transparency2 level is too high to be stored as a byte");
12237     ERROR3IF(Value.TranspType > 255,"Transparency type is too high to be stored as a byte");
12238 
12239     BOOL ok = TRUE;
12240 
12241     CamelotFileRecord Rec(pFilter,TAG_THREECOLTRANSPARENTFILL,TAG_THREECOLTRANSPARENTFILL_SIZE);
12242 
12243     if (ok) ok = Rec.Init();
12244     if (ok) ok = Rec.WriteCoord(Value.StartPoint);
12245     if (ok) ok = Rec.WriteCoord(Value.EndPoint);
12246     if (ok) ok = Rec.WriteCoord(Value.EndPoint2);
12247     if (ok) ok = Rec.WriteBYTE(BYTE(Value.Transp));
12248     if (ok) ok = Rec.WriteBYTE(BYTE(Value.EndTransp));
12249     if (ok) ok = Rec.WriteBYTE(BYTE(Value.EndTransp2));
12250     if (ok) ok = Rec.WriteBYTE(BYTE(Value.TranspType));
12251     if (ok) ok = pFilter->Write(&Rec);
12252 
12253     if (!ok)
12254         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
12255 
12256     return ok;
12257 #else
12258     return FALSE;
12259 #endif
12260 }


Member Data Documentation

ThreeColTranspFillAttribute AttrThreeColTranspFill::Value [protected]
 

Definition at line 1602 of file fillattr2.h.


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