CStroke Member Functions and Variables

The CStroke class member variables and functions will be used to define and manipulate the data of a stroke and serialize it when the document is serialized. You’ll add the member function definitions in the next topic, Building and Storing Strokes.

The following table lists CStroke’s member variables.

CStroke Data Members

Member Description
m_nPenWidth Stores the width of the pen in effect at the time this stroke was drawn.
m_pointArray Stores an array containing the points that define this stroke. The points are used to redraw the stroke as needed.

The following table lists CStroke’s member functions.

CStroke Member Functions

Member Description
CStroke The class defines two constructors: one protected and one public.
DrawStroke Draws each stroke. When the view object redraws the document’s data, it calls upon each stroke object in the stroke list to draw itself by calling its DrawStroke member function.
Serialize Assists the document in making its data persistent, typically on disk. CStroke overrides the Serialize member function of CObject to define how a single stroke serializes its points and other data. For more information about point serialization, see Serializing the Data later in this lesson.