CSampleItem Class Reference

Brush sample data item class, records position, distance along the path and pressure at the point when it is recorded. More...

#include <samplist.h>

Inheritance diagram for CSampleItem:

CCObject SimpleCCObject List of all members.

Public Member Functions

 CSampleItem ()
 default constructor
 CSampleItem (DocCoord Coord, MILLIPOINT Distance, UINT32 Pressure)
 constructor with initialisation
 CSampleItem (const CSampleItem &Other)
 copy constructor
 ~CSampleItem ()
CSampleItem operator= (const CSampleItem &Other)
 assignment operator
BOOL operator== (const CSampleItem &Other)
 equality operator
CSampleItem InterpolateItems (CSampleItem &Other, double Proportion)
 equality operator
BOOL WriteNative (CXaraFileRecord *pRecord)
 Writes this sampledata item to a record.

Public Attributes

DocCoord m_Coord
MILLIPOINT m_Distance
UINT32 m_Pressure

Detailed Description

Brush sample data item class, records position, distance along the path and pressure at the point when it is recorded.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/5/2000
Notes:

Definition at line 121 of file samplist.h.


Constructor & Destructor Documentation

CSampleItem::CSampleItem  ) 
 

default constructor

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/5/2000
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
this object
Notes:

Definition at line 135 of file samplist.cpp.

00136 {
00137     m_Distance = 0;
00138     m_Coord.x = m_Coord.y = 0;
00139     m_Pressure = 0;
00140 }

CSampleItem::CSampleItem DocCoord  Coord,
MILLIPOINT  Distance,
UINT32  Pressure
 

constructor with initialisation

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/5/2000
Parameters:
Coord - the position of this sample [INPUTS] Distance - the distance along the path of this sample
- [OUTPUTS]
Returns:
this object
Notes:

Definition at line 158 of file samplist.cpp.

00159 {
00160     m_Coord = Coord;
00161     m_Distance = Distance;
00162     m_Pressure = Pressure;
00163 
00164 }

CSampleItem::CSampleItem const CSampleItem Other  ) 
 

copy constructor

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/5/2000
Parameters:
Other - another CSampleItem [INPUTS]
- [OUTPUTS]
Returns:
this object
Notes:

Definition at line 181 of file samplist.cpp.

00182 {
00183     m_Distance = Other.m_Distance;
00184     m_Coord    = Other.m_Coord;
00185     m_Pressure = Other.m_Pressure;
00186 
00187 }

CSampleItem::~CSampleItem  )  [inline]
 

Definition at line 129 of file samplist.h.

00129 {};


Member Function Documentation

CSampleItem CSampleItem::InterpolateItems CSampleItem Other,
double  Proportion
 

equality operator

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/5/2000
Parameters:
Other - another CSampleItem [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the objects are identical, FALSE if they are not
Notes:

Definition at line 251 of file samplist.cpp.

00252 {
00253     CSampleItem NewItem;
00254 
00255     if (Proportion < 0.0 || Proportion > 1.0)
00256     {
00257         ERROR3("Invalid proportion value in CSampleItem::InterpolateItems");
00258         return NewItem;
00259     }
00260 
00261     NewItem.m_Distance = (INT32)(((double)m_Distance * Proportion) + ((double)Other.m_Distance * (1-Proportion)));
00262     MILLIPOINT XVal = (INT32)((m_Coord.x * Proportion) + (Other.m_Coord.x * (1 - Proportion)));
00263     MILLIPOINT YVal = (INT32)((m_Coord.y * Proportion) + (Other.m_Coord.y * (1 - Proportion)));
00264     
00265     NewItem.m_Coord.x = XVal;
00266     NewItem.m_Coord.y = YVal;
00267     
00268     NewItem.m_Pressure = (UINT32)((m_Pressure * Proportion) + (Other.m_Pressure * (1-Proportion)));
00269 
00270     return NewItem;
00271 }

CSampleItem CSampleItem::operator= const CSampleItem Other  ) 
 

assignment operator

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/5/2000
Parameters:
Other - another CSampleItem [INPUTS]
- [OUTPUTS]
Returns:
this object
Notes:

Definition at line 205 of file samplist.cpp.

00206 {
00207     m_Coord    = Other.m_Coord;
00208     m_Distance = Other.m_Distance;
00209     m_Pressure = Other.m_Pressure;
00210     return *this;
00211 }

BOOL CSampleItem::operator== const CSampleItem Other  ) 
 

equality operator

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/5/2000
Parameters:
Other - another CSampleItem [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the objects are identical, FALSE if they are not
Notes:

Definition at line 229 of file samplist.cpp.

00230 {
00231     BOOL bDiff =  (m_Coord != Other.m_Coord || 
00232                    m_Distance != Other.m_Distance ||
00233                    m_Pressure != Other.m_Pressure);
00234     return bDiff;
00235 }

BOOL CSampleItem::WriteNative CXaraFileRecord pRecord  ) 
 

Writes this sampledata item to a record.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
pRecord - the record to write to [INPUTS]
Returns:
TRUE if the Node has written out a record to the filter
See also:
CSampleData::WriteNative

Definition at line 288 of file samplist.cpp.

00289 {
00290     ERROR2IF(pRecord == NULL, FALSE, "Record is NULL in CSampleItem::WriteNative");
00291     
00292     BOOL ok = pRecord->WriteINT32((INT32)m_Pressure);
00293     if (ok) ok = pRecord->WriteCoord(m_Coord);
00294     if (ok) ok = pRecord->WriteINT32(m_Distance);
00295 
00296     return ok;
00297 }


Member Data Documentation

DocCoord CSampleItem::m_Coord
 

Definition at line 141 of file samplist.h.

MILLIPOINT CSampleItem::m_Distance
 

Definition at line 142 of file samplist.h.

UINT32 CSampleItem::m_Pressure
 

Definition at line 143 of file samplist.h.


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