AttrLinearTranspFill Class Reference

Linear Graduated Transparency Fill Attribute class. More...

#include <fillattr2.h>

Inheritance diagram for AttrLinearTranspFill:

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

Public Member Functions

 AttrLinearTranspFill ()
 AttrLinearTranspFill (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
void Render (RenderRegion *pRender)
 'Renders' a Linear Fill Colour attribute.
Node * SimpleCopy ()
 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.
virtual CCRuntimeClass * GetAttributeType ()
virtual AttributeValue * GetAttributeValue ()
AttrFillGeometry * ChangeAttrValue (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 linear transparent fill record to the filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)
virtual BOOL IsSeeThrough (BOOL CheckIndirectAttrs)

Protected Attributes

LinearTranspFillAttribute Value

Detailed Description

Linear Graduated Transparency Fill Attribute class.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/8/94
See also:
LinearFillAttribute

Definition at line 808 of file fillattr2.h.


Constructor & Destructor Documentation

AttrLinearTranspFill::AttrLinearTranspFill (   )  [inline]
 

Definition at line 813 of file fillattr2.h.

00813 : AttrLinearFill() {}

AttrLinearTranspFill::AttrLinearTranspFill (  Node *  ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
)  [inline]
 

Definition at line 814 of file fillattr2.h.

00819                                      : 
00820         AttrLinearFill(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}


Member Function Documentation

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

Reimplemented from AttrFillGeometry.

Definition at line 835 of file fillattr2.h.

00835 { return ChangeTransp(pValue); }

virtual CCRuntimeClass* AttrLinearTranspFill::GetAttributeType (   )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 832 of file fillattr2.h.

virtual AttributeValue* AttrLinearTranspFill::GetAttributeValue (   )  [inline, virtual]
 

Implements AttrLinearFill.

Definition at line 833 of file fillattr2.h.

00833 { return &Value; }

UINT32 AttrLinearTranspFill::GetAttrNameID (  void   )  [virtual]
 

Returns a string resource ID describing the attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Returns:
Attribute description ID

Reimplemented from NodeAttribute.

Definition at line 6970 of file fillattr.cpp.

06971 {
06972     return (_R(IDS_LINEARTRANSPFILL)); 
06973 }                                  

void AttrLinearTranspFill::GetDebugDetails (  StringBase *  Str  )  [virtual]
 

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

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/07/94
Parameters:
Str - the string containing details of the attribute. [OUTPUTS]

Reimplemented from NodeRenderable.

Definition at line 6986 of file fillattr.cpp.

06987 {
06988 #ifdef _DEBUG
06989     NodeAttribute::GetDebugDetails( Str );
06990 
06991     String_256 TempStr;
06992 
06993     TempStr._MakeMsg( TEXT("\r\nLinear Graduated Transp:\r\n"));
06994     (*Str) += TempStr;
06995 
06996     TempStr._MakeMsg(TEXT("\r\nStart = #1%u"), *GetStartTransp() );
06997     (*Str) += TempStr;
06998 
06999     TempStr._MakeMsg(TEXT("\r\nEnd = #1%u"), *GetEndTransp() );
07000     (*Str) += TempStr;
07001 
07002     TempStr._MakeMsg(TEXT("\r\nStart point =(#1%ld, #2%ld)"), 
07003                      (*GetStartPoint()).x, (*GetStartPoint()).y);
07004     (*Str) += TempStr;
07005 
07006     TempStr._MakeMsg(TEXT("\r\nEnd point =(#1%ld, #2%ld), "), 
07007                      (*GetEndPoint()).x, (*GetEndPoint()).y);
07008     (*Str) += TempStr;
07009 #endif
07010 }

UINT32 AttrLinearTranspFill::GetNodeSize (   )  const [virtual]
 

For finding the size of the node.

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

Reimplemented from Node.

Definition at line 7025 of file fillattr.cpp.

07026 {     
07027     return sizeof(AttrLinearTranspFill);
07028 }  

BOOL AttrLinearTranspFill::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 7116 of file fillattr.cpp.

07117 {
07118     // Slight bodge - we will assume that the default transparency is fully opaque
07119     if (bAppearance)
07120         return (Value.TranspType==TT_NoTranspType || (Value.TranspType==TT_Mix && Value.Transp == 0 && Value.EndTransp==0));
07121     else
07122         return FALSE;
07123 }

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

00837 { return TRUE; } 

virtual BOOL AttrLinearTranspFill::IsSeeThrough (  BOOL  CheckIndirectAttrs  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 847 of file fillattr2.h.

00847                                                        {
00848         return ((GetStartTransp() != NULL   &&  *GetStartTransp() != 0) ||
00849                 (GetEndTransp() != NULL     &&  *GetEndTransp() != 0));
00850     }

virtual BOOL AttrLinearTranspFill::IsVisible (   )  [inline, virtual]
 

Reimplemented from AttrFillGeometry.

Definition at line 829 of file fillattr2.h.

00829 { return IsTranspMeshVisible(); }

BOOL AttrLinearTranspFill::NeedsTransparency (   )  const [virtual]
 

Called.

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

Errors: -

See also:
Node::AttachNode

Reimplemented from AttrFillGeometry.

Definition at line 20118 of file fillattr.cpp.

20119 {
20120     AttrLinearTranspFill* pNonConst = (AttrLinearTranspFill*) this;
20121     return (    pNonConst->GetTranspType()      != TT_Mix ||
20122                 *(pNonConst->GetStartTransp())  != 0 ||
20123                 *(pNonConst->GetEndTransp())    != 0 );
20124 }

void AttrLinearTranspFill::Render (  RenderRegion *  pRender  )  [virtual]
 

'Renders' a Linear Fill Colour attribute.

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

Reimplemented from NodeAttribute.

Definition at line 6928 of file fillattr.cpp.

06929 {
06930     pRender->SetTranspFillGeometry(&Value, FALSE);
06931 }

void AttrLinearTranspFill::RenderFillBlobs (  RenderRegion *  pRender  )  [virtual]
 

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

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

Reimplemented from AttrLinearFill.

Definition at line 6506 of file fillattr.cpp.

06507 {
06508 #if !defined(EXCLUDE_FROM_RALPH)
06509     if (!IsVisible())
06510         return;     // We're Not in Fill Transparency Mode
06511 
06512     // Don't bother if this fill is being edited as a copy of it
06513     // we be rendered thoughout the drag op
06514     if (IsFillBeingEdited())
06515         return;
06516 
06517     // Ignore this if the mesh is the same as the last one rendered.
06518     if (CheckPreviousFillMesh())
06519         return;
06520 
06521     DocCoord ControlPoints[2];
06522     ControlPoints[0] = (*GetStartPoint());
06523     ControlPoints[1] = (*GetEndPoint());
06524 
06525     // Render a nice pretty Fill Mesh thingy
06526     RenderFillMesh(pRender, ControlPoints, SelectionState, 2);
06527 
06528     // This call was removed by Gerry (2/9/96) as it causes blob problems
06529     // If we are removing blobs then force all blobs to be deselected
06530 //  if ((Camelot.GetBlobManager())->IsRemovingBlobs())
06531 //      DeselectAllNoRedraw();
06532 #endif
06533 }

Node * AttrLinearTranspFill::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:
23/8/94
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 6948 of file fillattr.cpp.

06949 {
06950     AttrLinearTranspFill* NodeCopy = new AttrLinearTranspFill();
06951     if (NodeCopy == NULL)
06952         return NULL;
06953 
06954     CopyNodeContents(NodeCopy);
06955     
06956     return NodeCopy;
06957 }  

BOOL AttrLinearTranspFill::WritePreChildrenNative (  BaseCamelotFilter *  pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 7092 of file fillattr.cpp.

07093 {
07094 #ifdef DO_EXPORT
07095     return WritePreChildrenWeb(pFilter);
07096 #else
07097     return FALSE;
07098 #endif
07099 }

BOOL AttrLinearTranspFill::WritePreChildrenWeb (  BaseCamelotFilter *  pFilter  )  [virtual]
 

Writes the linear transparent fill record to the filter.

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

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/6/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 7045 of file fillattr.cpp.

07046 {
07047 #ifdef DO_EXPORT
07048     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
07049     ERROR3IF(Value.Transp     > 255,"Start transparency level is too high to be stored as a byte");
07050     ERROR3IF(Value.EndTransp  > 255,"End transparency level is too high to be stored as a byte");
07051     ERROR3IF(Value.TranspType > 255,"Transparency type is too high to be stored as a byte");
07052 
07053     BOOL ok = TRUE;
07054 
07055     // If the linear fill points are not perpendicular then we must write
07056     // a new 3-point linear fill record...
07057     BOOL b3PointLinear = (!AreLinesPerpendicular(GetStartPoint(), GetEndPoint(), GetEndPoint2()));
07058 
07059     INT32 tag = TAG_LINEARTRANSPARENTFILL;
07060     UINT32 size = TAG_LINEARTRANSPARENTFILL_SIZE;
07061     if (b3PointLinear)
07062     {
07063         tag = TAG_LINEARTRANSPARENTFILL3POINT;
07064         size = TAG_LINEARTRANSPARENTFILL3POINT_SIZE;
07065     }
07066 
07067     CamelotFileRecord Rec(pFilter, tag, size);
07068 
07069     if (ok) ok = Rec.Init();
07070     if (ok) ok = Rec.WriteCoord(Value.StartPoint);
07071     if (ok) ok = Rec.WriteCoord(Value.EndPoint);
07072     if (ok && b3PointLinear) ok = Rec.WriteCoord(Value.EndPoint2);
07073     if (ok) ok = Rec.WriteBYTE(BYTE(Value.Transp));
07074     if (ok) ok = Rec.WriteBYTE(BYTE(Value.EndTransp));
07075     if (ok) ok = Rec.WriteBYTE(BYTE(Value.TranspType));
07076     if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetBias ());
07077     if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetGain ());
07078     if (ok) ok = pFilter->Write(&Rec);
07079 
07080     if (!ok)
07081         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
07082 
07083     return ok;
07084 #else
07085     return FALSE;
07086 #endif
07087 }


Member Data Documentation

LinearTranspFillAttribute AttrLinearTranspFill::Value [protected]
 

Definition at line 853 of file fillattr2.h.


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