PressureItem Class Reference

to store information about brush objects, including pressure More...

#include <brpress.h>

Inheritance diagram for PressureItem:

CCObject SimpleCCObject List of all members.

Public Member Functions

 PressureItem ()
 PressureItem (const PressureItem &)
 copy constructor
 PressureItem (UINT32 Pressure, double Proportion, MILLIPOINT Distance)
 constructor with initialisation
PressureItem operator= (const PressureItem &Other)
 copy constructor
void WorkOutProportion (MILLIPOINT PathLength)
 calculates how far along the path we are and sets the member variable
BOOL WriteNative (CXaraFileRecord *pRecord)
 Writes out a record of this PressureItem to the record supplied. Note that because PressureItems are generally part of a larger object they do not have their own tag etc. This function is merely a convenience function.

Public Attributes

UINT32 m_Pressure
double m_Proportion
MILLIPOINT m_Distance

Detailed Description

to store information about brush objects, including pressure

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97
Notes:

Definition at line 143 of file brpress.h.


Constructor & Destructor Documentation

PressureItem::PressureItem  )  [inline]
 

Definition at line 148 of file brpress.h.

00148 {m_Pressure = 0; m_Proportion = 0; m_Distance = 0;}

PressureItem::PressureItem const PressureItem Other  ) 
 

copy constructor

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97
Parameters:
Other [INPUTS]
Notes:

Definition at line 142 of file brpress.cpp.

00143 {
00144     m_Pressure = Other.m_Pressure;
00145     m_Proportion = Other.m_Proportion;
00146     m_Distance = Other.m_Distance;
00147 }

PressureItem::PressureItem UINT32  Pressure,
double  Proportion,
MILLIPOINT  Distance
 

constructor with initialisation

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97
Parameters:
Pressure - the pressure value [INPUTS] Proportion - the proportional distance along the path Distance - the absolute distance along the path
Notes:

Definition at line 123 of file brpress.cpp.

00124 {
00125     m_Pressure = Pressure;
00126     m_Proportion = Proportion;
00127     m_Distance = Distance;
00128 }


Member Function Documentation

PressureItem PressureItem::operator= const PressureItem Other  ) 
 

copy constructor

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97
Parameters:
Other [INPUTS]
Notes:

Definition at line 162 of file brpress.cpp.

00163 {
00164     m_Pressure = Other.m_Pressure;
00165     m_Proportion = Other.m_Proportion;
00166     m_Distance = Other.m_Distance;
00167 
00168     return *this;
00169 }

void PressureItem::WorkOutProportion MILLIPOINT  PathLength  ) 
 

calculates how far along the path we are and sets the member variable

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/99
Parameters:
length of the path that this object is on [INPUTS]

Definition at line 184 of file brpress.cpp.

00185 {
00186     if (m_Distance < 0 || m_Distance > PathLength)
00187     {
00188         ERROR3("Attempting to calculate proportional distance with invalid data");
00189         TRACEUSER( "Diccon", _T("Invalid distance: %d, Path Length: %d\n"), m_Distance, PathLength );
00190         m_Proportion = 1.0;
00191         return;
00192     }
00193     m_Proportion = (double)((double)m_Distance / (double)PathLength);
00194     //if (m_Proportion < 0)
00195 //  TRACEUSER( "Diccon", _T("Proportion: %f\n"), m_Proportion);
00196 
00197 }

BOOL PressureItem::WriteNative CXaraFileRecord pRecord  ) 
 

Writes out a record of this PressureItem to the record supplied. Note that because PressureItems are generally part of a larger object they do not have their own tag etc. This function is merely a convenience function.

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

Definition at line 217 of file brpress.cpp.

00218 {
00219     ERROR2IF(pRecord == NULL, FALSE, "Record is NULL in PressureItem::WriteNative");
00220     
00221     BOOL ok = pRecord->WriteINT32((INT32)m_Pressure);
00222     if (ok) ok = pRecord->WriteDOUBLE(m_Proportion);
00223     if (ok) ok = pRecord->WriteINT32(m_Distance);
00224 
00225     return ok;
00226 }


Member Data Documentation

MILLIPOINT PressureItem::m_Distance
 

Definition at line 160 of file brpress.h.

UINT32 PressureItem::m_Pressure
 

Definition at line 158 of file brpress.h.

double PressureItem::m_Proportion
 

Definition at line 159 of file brpress.h.


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