DashRec Class Reference

#include <attr.h>

Inheritance diagram for DashRec:

CCObject SimpleCCObject List of all members.

Public Member Functions

 DashRec ()
INT32 operator== (DashRec &)
 Equality operator, checks that the two dash patterns are the same.
INT32 operator== (StockDash)
 Equality operator, checks that the two dash patterns are the same.
DashRecoperator= (DashRec &)
 Equals operator, makes one dash pattern the same as another.
DashRecoperator= (StockDash)
 Equals operator, makes one dash pattern the same as another.
INT32 GetDashID ()
BOOL ShouldScaleWithLineWidth ()
void CheckAndFix ()
 Checks a dash pattern, and fixes it if it's not very nice.
void CheckIfDefaultPattern ()

Static Public Member Functions

static INT32 GetNumStockDashes ()
static String_256 GetStockDashName (StockDash)

Public Attributes

INT32 Elements
INT32 DashStart
DashElementElementData
INT32 LineWidth
BOOL ScaleWithLineWidth
INT32 DashID

Detailed Description

Definition at line 287 of file attr.h.


Constructor & Destructor Documentation

DashRec::DashRec  ) 
 

Definition at line 1040 of file attr.cpp.

01041 {
01042     Elements = 0;
01043     DashStart = 0;
01044     ElementData = NULL;
01045     DashID = 0;
01046     ScaleWithLineWidth = TRUE;
01047 
01048     LineWidth = 72000/4;
01049 }


Member Function Documentation

void DashRec::CheckAndFix  ) 
 

Checks a dash pattern, and fixes it if it's not very nice.

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/07/95
Returns:
Errors: No errors.
See also:
-

Definition at line 1081 of file attr.cpp.

01082 {
01083     // check the dash offset
01084     if(DashStart < 0)
01085         DashStart = 0;
01086 
01087     if(Elements == 0)
01088         return;
01089 
01090     // check the dash pattern elements
01091     INT32 End = 0;
01092     INT32 l;
01093 
01094     for(l = 0; l < Elements; l++)
01095     {
01096 
01097         // is this element OK?
01098         if(ElementData[l] > 0)
01099         {
01100             // element is OK...
01101             if(End != l)
01102             {
01103                 // move it back if something has been deleted before it
01104                 ElementData[End] = ElementData[l];
01105             }
01106             End++;
01107         }
01108     }
01109 
01110     // have we got enough elements?
01111     if(End < 1)
01112     {
01113         // no elements - make it a solid outline
01114         Elements = 0;
01115         DashID = SD_SOLID;
01116     }
01117     else
01118     {
01119         Elements = End;
01120     }
01121 }

void DashRec::CheckIfDefaultPattern  ) 
 

INT32 DashRec::GetDashID  )  [inline]
 

Definition at line 302 of file attr.h.

00302 { return DashID; }

static INT32 DashRec::GetNumStockDashes  )  [inline, static]
 

Definition at line 299 of file attr.h.

00299 { return NUM_STOCK_DASHES; }

String_256 DashRec::GetStockDashName StockDash   )  [static]
 

Definition at line 1051 of file attr.cpp.

01052 {
01053     String_256 DashName;
01054 
01055     switch (DashType)
01056     {
01057         case SD_SOLID:
01058             DashName.Load(_R(IDS_K_ATTR_SOLIDLINE));
01059             break;
01060 
01061         default:
01062             DashName.Load(_R(IDS_K_ATTR_DASHLINE));
01063             break;
01064     }
01065 
01066     return DashName;
01067 }

DashRec & DashRec::operator= StockDash  Other  ) 
 

Equals operator, makes one dash pattern the same as another.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/10/94
Returns:
Errors: -
See also:
-

Definition at line 1501 of file attr.cpp.

01502 {
01503     return *this;
01504 }

DashRec & DashRec::operator= DashRec Other  ) 
 

Equals operator, makes one dash pattern the same as another.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/10/94
Returns:
Errors: -
See also:
-

Definition at line 1444 of file attr.cpp.

01445 {
01446     DashID = Other.DashID;
01447     Elements = Other.Elements;
01448 
01449     if (Elements == 0)
01450         return *this;
01451 
01452     DashStart = Other.DashStart;
01453     LineWidth = Other.LineWidth;
01454     ScaleWithLineWidth = Other.ScaleWithLineWidth;
01455 
01456     if (ElementData != NULL)
01457         delete ElementData;
01458 
01459     ElementData = new INT32[Elements];
01460 
01461     if (ElementData == NULL)
01462         return *this;
01463 
01464     for (INT32 element = 0; element < Elements; element++)
01465     {
01466         ElementData[element] = Other.ElementData[element];
01467     }
01468 
01469     return *this;
01470 }

INT32 DashRec::operator== StockDash  Other  ) 
 

Equality operator, checks that the two dash patterns are the same.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/10/94
Returns:
Errors: -
See also:
-

Definition at line 1484 of file attr.cpp.

01485 {
01486     return DashID == Other;
01487 }

INT32 DashRec::operator== DashRec Other  ) 
 

Equality operator, checks that the two dash patterns are the same.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/10/94
Returns:
Errors: -
See also:
-

Definition at line 1409 of file attr.cpp.

01410 {
01411     if (Elements == 0 && Other.Elements == 0)
01412         return TRUE;
01413 
01414     if (Elements != Other.Elements ||
01415         DashStart != Other.DashStart)
01416         return FALSE;
01417 
01418     if (LineWidth != Other.LineWidth)
01419         return FALSE;
01420 
01421     // They both have the same number of elements and the same dash start
01422     // But are all the elements the same ?
01423     for (INT32 element = 0; element < Elements; element++)
01424     {
01425         if (ElementData[element] != Other.ElementData[element])
01426             return FALSE;
01427     }
01428 
01429     return TRUE;
01430 }

BOOL DashRec::ShouldScaleWithLineWidth  )  [inline]
 

Definition at line 303 of file attr.h.

00303 { return ScaleWithLineWidth; }


Member Data Documentation

INT32 DashRec::DashID
 

Definition at line 315 of file attr.h.

INT32 DashRec::DashStart
 

Definition at line 310 of file attr.h.

DashElement* DashRec::ElementData
 

Definition at line 311 of file attr.h.

INT32 DashRec::Elements
 

Definition at line 309 of file attr.h.

INT32 DashRec::LineWidth
 

Definition at line 313 of file attr.h.

BOOL DashRec::ScaleWithLineWidth
 

Definition at line 314 of file attr.h.


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