AttrTranspChange Class Reference

Change Fill colour Attribute class. This Attribute never exists in the Tree. It is used for changing the Transp of an existing Fill Geometry. More...

#include <fillattr2.h>

Inheritance diagram for AttrTranspChange:

AttrValueChange AttrFillGeometry NodeAttribute NodeRenderable Node CCObject SimpleCCObject AttrMakeFlatTransp AttrRemoveTransp AttrTranspTypeChange List of all members.

Public Member Functions

 AttrTranspChange ()
 Constructor for an attribute value change.
virtual UINT32 GetAttrNameID (void)
 Returns a string resource ID describing the attribute.
virtual AttributeValueGetAttributeValue ()
virtual CCRuntimeClassGetAttributeType ()
 Determines the scope of the value change.
virtual AttrFillGeometryMutateFill (AttrFillGeometry *FillToMutate)
 Changes the colour of a fill.
virtual NodeAttributeGetOtherAttrToApply (BOOL *IsMutate)
 Some attributes require a secondary atribute to be changed when they are changed. This routine obtains a pointer to the secondary attribute to apply.

Protected Attributes

FlatTranspFillAttribute Value

Detailed Description

Change Fill colour Attribute class. This Attribute never exists in the Tree. It is used for changing the Transp of an existing Fill Geometry.

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

Definition at line 366 of file fillattr2.h.


Constructor & Destructor Documentation

AttrTranspChange::AttrTranspChange  ) 
 

Constructor for an attribute value change.

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

Definition at line 3933 of file fillattr.cpp.

03934 {
03935     Transp = TRUE;
03936     Colour = !Transp;
03937 }


Member Function Documentation

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

Determines the scope of the value change.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/94
Returns:
A CC_RUNTIME_CLASS depending on whether this should change colour or transparency attribute.

Reimplemented from AttrValueChange.

Definition at line 376 of file fillattr2.h.

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

Implements AttrValueChange.

Definition at line 375 of file fillattr2.h.

00375 { return &Value; }

UINT32 AttrTranspChange::GetAttrNameID void   )  [virtual]
 

Returns a string resource ID describing the attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/01/95
Returns:
Attribute description ID

Reimplemented from AttrValueChange.

Reimplemented in AttrTranspTypeChange.

Definition at line 4485 of file fillattr.cpp.

04486 {
04487     return (_R(IDS_TRANSP_CHANGE));     //_R(IDS_FLATTRANSPFILL));
04488 }                                  

NodeAttribute * AttrTranspChange::GetOtherAttrToApply BOOL *  IsMutate  )  [virtual]
 

Some attributes require a secondary atribute to be changed when they are changed. This routine obtains a pointer to the secondary attribute to apply.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/8/95
Returns:
The secondary attribute to apply, or NULL if none to apply

Reimplemented from NodeAttribute.

Reimplemented in AttrTranspTypeChange, AttrRemoveTransp, and AttrMakeFlatTransp.

Definition at line 3952 of file fillattr.cpp.

03953 {
03954     ERROR3IF(IsMutate == NULL, "NULL flag pointer passed to GetOtherAttrToApply");
03955 
03956     // A transparency change also needs to set the Stroke Transparency
03957 
03958     if (AttrFillGeometry::FillSelectionCount() > 0)
03959         return NULL;    // Only set line transparency if no control
03960                         // points are selected
03961 
03962     NodeAttribute* OtherAttr = new AttrStrokeTranspChange;
03963     if (OtherAttr == NULL)
03964         return NULL;
03965 
03966     UINT32 Transp = *GetStartTransp();
03967 
03968     ((AttrStrokeTranspChange *)OtherAttr)->SetStartTransp(&Transp);
03969 
03970     *IsMutate = TRUE;
03971 
03972     return OtherAttr;
03973 }

AttrFillGeometry * AttrTranspChange::MutateFill AttrFillGeometry FillToMutate  )  [virtual]
 

Changes the colour of a fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/94
Parameters:
The fill that is to be changed. [INPUTS]

Reimplemented from AttrValueChange.

Reimplemented in AttrTranspTypeChange, AttrRemoveTransp, and AttrMakeFlatTransp.

Definition at line 4053 of file fillattr.cpp.

04054 { 
04055 #if !defined(EXCLUDE_FROM_RALPH)
04056     if (FillToMutate->IsVisible() && 
04057         FillToMutate->GetSelectionCount() == 0 &&
04058         SelectionCount > 0)
04059         return NULL;
04060 
04061     // Make a copy of this Fill to change
04062     AttrFillGeometry* NewFill = (AttrFillGeometry*)FillToMutate->SimpleCopy();
04063     if (NewFill == NULL)
04064         return NULL;
04065 
04066     BOOL Changed = NewFill->ChangeControlTransp(this);
04067 
04068     // Did we change any colours ?
04069     if (!Changed)
04070     {
04071         // No Control points selected, so make a flat fill instead
04072         delete NewFill;
04073 
04074         NewFill = new AttrFlatTranspFill;
04075         if (NewFill == NULL)
04076             return NULL;
04077 
04078         // and use the mutants colour
04079         *(FillGeometryAttribute*)(NewFill->GetAttributeValue()) = *(FillGeometryAttribute*)(this->GetAttributeValue());
04080 
04081         NewFill->SetTranspType(FillToMutate->GetTranspType());
04082 
04083         if (GetApplication()->GetBlobManager()->GetCurrentInterest().Fill && 
04084             FillToMutate->IsVisible() &&
04085             FillToMutate->FindParent() &&
04086             FillToMutate->FindParent()->IsSelected())
04087         {
04088             FillToMutate->RenderFillBlobs();
04089         }
04090     }
04091 
04092     // Return the Mutated Fill
04093     return NewFill;
04094 #else
04095     return NULL;
04096 #endif
04097 }


Member Data Documentation

FlatTranspFillAttribute AttrTranspChange::Value [protected]
 

Definition at line 385 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