FillMappingAttribute Class Reference

Specifies how a fill graduation behaves, e.g. linear, sinusoidal and so on. More...

#include <fillval.h>

Inheritance diagram for FillMappingAttribute:

AttributeValue CCObject SimpleCCObject FillMappingLinearAttribute FillMappingSinAttribute List of all members.

Public Member Functions

 FillMappingAttribute ()
 Constructor for mapping attributes.
virtual void Restore (RenderRegion *, BOOL)
 Restores the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.
virtual void Render (RenderRegion *, BOOL Temp=FALSE)
 Sets the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.
virtual BOOL IsDifferent (AttributeValue *)
 Compare two AttributeValue objects. The base class version always returns TRUE - derived classes should override this function to provide functionality.
virtual FillMappingAttributeoperator= (FillMappingAttribute &Attrib)
virtual INT32 operator== (const FillMappingAttribute &Attrib)

Static Public Member Functions

static BOOL Init ()
 Registers fill mapping attribute, and provides a default attribute to give linear graduations.

Public Attributes

INT32 Repeat

Detailed Description

Specifies how a fill graduation behaves, e.g. linear, sinusoidal and so on.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/07/94
See also:
FillFunctionLinearAttribute; FillFunctionSinAttribute

Definition at line 1621 of file fillval.h.


Constructor & Destructor Documentation

FillMappingAttribute::FillMappingAttribute  ) 
 

Constructor for mapping attributes.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/11/94
See also:
FillMappingAttribute; RenderStack; AttributeValue; NodeAttribute; FillMappingAttribute::Restore; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Definition at line 7942 of file fillval.cpp.

07943 {
07944     Repeat = 2;
07945 }


Member Function Documentation

BOOL FillMappingAttribute::Init void   )  [static]
 

Registers fill mapping attribute, and provides a default attribute to give linear graduations.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Returns:
TRUE - initialised ok; FALSE if not.

Errors: Out of memory.

See also:
AttributeManager

Reimplemented from SimpleCCObject.

Definition at line 7961 of file fillval.cpp.

07962 {
07963     // Default to simple linear mapping (ignored for flat fills, obviously)
07964     FillMappingAttribute *pAttr = new FillMappingLinearAttribute;
07965     if (pAttr==NULL)
07966         // error message has already been set by new
07967         return FALSE;
07968 
07969     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), 
07970                                                          pAttr);
07971 
07972     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising FillMappingAttribute");
07973     ERROR2IF(ID != ATTR_FILLMAPPING, FALSE, "Incorrect ID for FillMappingAttribute");
07974 
07975     return TRUE;
07976 }

BOOL FillMappingAttribute::IsDifferent AttributeValue pVal  )  [virtual]
 

Compare two AttributeValue objects. The base class version always returns TRUE - derived classes should override this function to provide functionality.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the attribute to compare against this one. [INPUTS]
Returns:
TRUE if objects represent different attributes (e.g. one is red and the other is blue); FALSE otherwise (i.e. they represent the same attribute, e.g. both represent 0.25pt lines).
See also:
AttributeManager::ApplyBasedOnDefaults

Reimplemented from AttributeValue.

Definition at line 8036 of file fillval.cpp.

08037 {
08038     if (pVal->GetRuntimeClass() != GetRuntimeClass())
08039         return TRUE;
08040 
08041     return (Repeat != ((FillMappingAttribute*)pVal)->Repeat);
08042 }

FillMappingAttribute & FillMappingAttribute::operator= FillMappingAttribute Attrib  )  [virtual]
 

Definition at line 8044 of file fillval.cpp.

08045 {
08046     Repeat = Attrib.Repeat;
08047 
08048     return *this;
08049 }

INT32 FillMappingAttribute::operator== const FillMappingAttribute Attrib  )  [virtual]
 

Definition at line 8051 of file fillval.cpp.

08052 {
08053     if (Attrib.GetRuntimeClass() != GetRuntimeClass())
08054         return FALSE;
08055 
08056     return (Repeat == Attrib.Repeat);
08057 }

void FillMappingAttribute::Render RenderRegion pRegion,
BOOL  Temp = FALSE
[virtual]
 

Sets the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pRegion - the render region to render this attribute into. [INPUTS]
See also:
FillMappingAttribute; RenderStack; AttributeValue; NodeAttribute; FillMappingAttribute::Restore; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Implements AttributeValue.

Definition at line 8009 of file fillval.cpp.

08010 {
08011     pRegion->SetFillMapping(this, Temp);
08012 }

void FillMappingAttribute::Restore RenderRegion pRegion,
BOOL  Temp
[virtual]
 

Restores the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pRegion - the render region to restore the attribute into. [INPUTS] Temp - TRUE if this is a temporary attribute, FALSE if it is permanent (e.g. it's in a document tree).
See also:
FillMappingAttribute; RenderStack; AttributeValue; NodeAttribute; FillMappingAttribute::Render; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Implements AttributeValue.

Definition at line 8031 of file fillval.cpp.

08032 {
08033     pRegion->RestoreFillMapping(this, Temp);
08034 }

void FillMappingAttribute::SimpleCopy AttributeValue pValue  )  [virtual]
 

See AttributeValue::SimpleCopy.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/11/94
Parameters:
pAttr - pointer to the AttributeValue to copy. [INPUTS]

Implements AttributeValue.

Definition at line 7989 of file fillval.cpp.

07990 {
07991     Repeat = ((FillMappingAttribute *) pValue)->Repeat;
07992 }


Member Data Documentation

INT32 FillMappingAttribute::Repeat
 

Definition at line 1636 of file fillval.h.


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