AttrSquareTranspFill Class Reference

Square Graduated Transparency Fill Attribute class. More...

#include <fillattr2.h>

Inheritance diagram for AttrSquareTranspFill:

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

Public Member Functions

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

Protected Attributes

SquareTranspFillAttribute Value

Detailed Description

Square Graduated Transparency Fill Attribute class.

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

Definition at line 1375 of file fillattr2.h.


Constructor & Destructor Documentation

AttrSquareTranspFill::AttrSquareTranspFill  )  [inline]
 

Definition at line 1380 of file fillattr2.h.

01380 : AttrSquareFill() {}

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

Definition at line 1381 of file fillattr2.h.

01386                                      : 
01387         AttrSquareFill(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}


Member Function Documentation

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

Reimplemented from AttrFillGeometry.

Definition at line 1403 of file fillattr2.h.

01403 { return ChangeTransp(pValue); }

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

Reimplemented from NodeAttribute.

Definition at line 1400 of file fillattr2.h.

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

Implements AttrSquareFill.

Definition at line 1401 of file fillattr2.h.

01401 { return &Value; }

UINT32 AttrSquareTranspFill::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 10862 of file fillattr.cpp.

10863 {
10864     return (_R(IDS_SQUARETRANSPFILL));
10865 }                                  

void AttrSquareTranspFill::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 10880 of file fillattr.cpp.

10881 {
10882 #ifdef _DEBUG
10883     NodeAttribute::GetDebugDetails( Str );
10884 
10885     String_256 TempStr;
10886 
10887     TempStr._MakeMsg( TEXT("\r\nSquare Graduated Fill:\r\n"));
10888     (*Str) += TempStr;
10889 
10890     TempStr._MakeMsg(TEXT("\r\nStart"));
10891     (*Str) += TempStr;
10892 
10893     TempStr._MakeMsg(TEXT("\r\nEnd"));
10894     (*Str) += TempStr;
10895 
10896     TempStr._MakeMsg(TEXT("\r\nStart = (#1%ld, #2%ld)"), 
10897                      (*GetStartPoint()).x, (*GetStartPoint()).y);
10898     (*Str) += TempStr;
10899 
10900     TempStr._MakeMsg(TEXT("\r\nEnd = (#1%ld, #2%ld) "), 
10901                      (*GetEndPoint()).x, (*GetEndPoint()).y);
10902     (*Str) += TempStr;
10903 
10904     TempStr._MakeMsg(TEXT("\r\n3rd = (#1%ld, #2%ld) "), 
10905                      (*GetEndPoint2()).x, (*GetEndPoint2()).y);
10906     (*Str) += TempStr;
10907 #endif
10908 }

UINT32 AttrSquareTranspFill::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 10924 of file fillattr.cpp.

10925 {     
10926     return sizeof(AttrSquareTranspFill);
10927 }  

BOOL AttrSquareTranspFill::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 11018 of file fillattr.cpp.

11019 {
11020     // Slight bodge - we will assume that the default transparency is fully opaque
11021     if (bAppearance)
11022         return (Value.TranspType==TT_NoTranspType || (Value.TranspType==TT_Mix && Value.Transp == 0 && Value.EndTransp==0));
11023     else
11024         return FALSE;
11025 }

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

01405 { return TRUE; } 

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

Reimplemented from NodeAttribute.

Definition at line 1415 of file fillattr2.h.

01415                                                        {
01416         return ((GetStartTransp() != NULL   &&  *GetStartTransp() != 0) ||
01417                 (GetEndTransp() != NULL     &&  *GetEndTransp() != 0));
01418     }

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

Reimplemented from AttrFillGeometry.

Definition at line 1397 of file fillattr2.h.

01397 { return IsTranspMeshVisible(); }

BOOL AttrSquareTranspFill::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 10770 of file fillattr.cpp.

10771 {
10772     AttrSquareTranspFill* pNonConst = (AttrSquareTranspFill*) this;
10773     return (    pNonConst->GetTranspType()      != TT_Mix ||
10774                 *(pNonConst->GetStartTransp())  != 0 ||
10775                 *(pNonConst->GetEndTransp())    != 0 );
10776 }

void AttrSquareTranspFill::Render RenderRegion pRender  )  [virtual]
 

'Renders' a Square Fill Colour attribute.

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

Reimplemented from NodeAttribute.

Definition at line 10750 of file fillattr.cpp.

10751 {
10752     pRender->SetTranspFillGeometry(&Value, FALSE);
10753 }

void AttrSquareTranspFill::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 AttrSquareFill.

Definition at line 10819 of file fillattr.cpp.

10820 {
10821 #if !defined(EXCLUDE_FROM_RALPH)
10822     if (!IsVisible())
10823         return;     // We're in Fill Transparency Mode
10824 
10825     // Don't bother if this fill is being edited as a copy of it
10826     // we be rendered thoughout the drag op
10827     if (IsFillBeingEdited())
10828         return;
10829 
10830     // Ignore this if the mesh is the same as the last one rendered.
10831     if (CheckPreviousFillMesh())
10832         return;
10833 
10834     DocCoord ControlPoints[5];
10835     ControlPoints[FILLCONTROL_STARTPOINT] = (*GetStartPoint());
10836     ControlPoints[FILLCONTROL_ENDPOINT] = (*GetEndPoint());
10837     ControlPoints[FILLCONTROL_SECONDARYPOINT] = (*GetEndPoint2());
10838 
10839     // Render a nice pretty Fill Mesh thingy
10840     RenderFillMesh(pRender, ControlPoints, SelectionState, 5);
10841 
10842     // This call was removed by Gerry (2/9/96) as it causes blob problems
10843     // If we are removing blobs then force all blobs to be deselected
10844 //  if ((Camelot.GetBlobManager())->IsRemovingBlobs())
10845 //      DeselectAllNoRedraw();
10846 #endif
10847 }

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

10796 {
10797     AttrSquareTranspFill* NodeCopy = new AttrSquareTranspFill();
10798     if (NodeCopy == NULL)
10799         return NULL;
10800 
10801     CopyNodeContents(NodeCopy);
10802     
10803     return NodeCopy;
10804 }  

BOOL AttrSquareTranspFill::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Writes the Square transparent fill record to the filter.

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

10992 {
10993 #ifdef DO_EXPORT
10994     return WritePreChildrenWeb(pFilter);
10995 #else
10996     return FALSE;
10997 #endif
10998 }

BOOL AttrSquareTranspFill::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes the Square transparent fill record to the filter.

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

10945 {
10946 #ifdef DO_EXPORT
10947     ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
10948     ERROR3IF(Value.Transp     > 255,"Start transparency level is too high to be stored as a byte");
10949     ERROR3IF(Value.EndTransp  > 255,"End transparency level is too high to be stored as a byte");
10950     ERROR3IF(Value.TranspType > 255,"Transparency type is too high to be stored as a byte");
10951 
10952     BOOL ok = TRUE;
10953 
10954     CamelotFileRecord Rec(pFilter,TAG_SQUARETRANSPARENTFILL,TAG_SQUARETRANSPARENTFILL_SIZE);
10955 
10956     if (ok) ok = Rec.Init();
10957     if (ok) ok = Rec.WriteCoord(Value.StartPoint);
10958     if (ok) ok = Rec.WriteCoord(Value.EndPoint);
10959     if (ok) ok = Rec.WriteCoord(Value.EndPoint2);
10960     if (ok) ok = Rec.WriteBYTE(BYTE(Value.Transp));
10961     if (ok) ok = Rec.WriteBYTE(BYTE(Value.EndTransp));
10962     if (ok) ok = Rec.WriteBYTE(BYTE(Value.TranspType));
10963     if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetBias ());
10964     if (ok) ok = Rec.WriteDOUBLE ((double) GetProfile ().GetGain ());
10965     if (ok) ok = pFilter->Write(&Rec);
10966 
10967     if (!ok)
10968         pFilter->GotError(_R(IDE_FILE_WRITE_ERROR));
10969 
10970     return ok;
10971 #else
10972     return FALSE;
10973 #endif
10974 }


Member Data Documentation

SquareTranspFillAttribute AttrSquareTranspFill::Value [protected]
 

Definition at line 1421 of file fillattr2.h.


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