-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMPI_BasicStroke.cpp
More file actions
36 lines (28 loc) · 893 Bytes
/
Copy pathMPI_BasicStroke.cpp
File metadata and controls
36 lines (28 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// MPI_BasicStroke.cpp
//
#include "MPI_BasicStroke.h"
#include "MPI_PolyLinePoint.h"
#include "MPI_PolyLinePointListIterator.h"
#include "MPI_IteratorPtr.h"
#include "MPI_PolyLineVisitor.h"
MPI_BasicStroke::~MPI_BasicStroke()
{
// free allocated points
MPI_IteratorPtr<MPI_PointListIterator> curpoint( allocatePointListIterator() );
for ( curpoint->first(); !curpoint->isDone(); curpoint->next() )
delete curpoint->getPoint();
}
MPI_PointListIterator* MPI_BasicStroke::allocatePointListIterator( void ) const
{
return new MPI_PolyLinePointListIterator( pointList_ );
}
void MPI_BasicStroke::acceptVisitor( MPI_PolyLineVisitor const& visitor )
{
visitor.visitBasicStroke( *this );
}
void MPI_BasicStroke::allocatePointAndAddToList( MPI_Point2D const &point )
{
pointList_.push_back( new MPI_PolyLinePoint( *this, point ) );
}
// vim:sw=4:et:cindent: