00001 #ifndef BOUNDARY_1_H
00002 #define BOUNDARY_1_H
00003 #include "afltypes.h"
00004 #include "boundary.h"
00005
00006 #include <iostream>
00007 #include <list>
00008
00009 namespace afl
00010 {
00014 class Boundary_1
00015 {
00019 public:
00032 Boundary_1( );
00033
00040 Boundary_1( const Point& from, const Point& to, bool colour = black );
00041
00046 Boundary_1( const Boundary_1& toCopy );
00047
00051 virtual ~Boundary_1( ) { }
00069 virtual data_t intersect( const Point& p, const Point& v ) const;
00070
00081 virtual void addSegment( const Point& from, const Point& to );
00082
00093 virtual void addSegment( const Field* field );
00094
00103 virtual void toXML( std::ostream& doc,
00104 const std::string& componentsDir,
00105 const std::string& baseURI ) const;
00106
00110
00111
00120 data_t getFrom ( ) const;
00121
00122
00127 void setFrom ( data_t value );
00128
00129
00135 data_t getTo ( ) const;
00136
00137
00142 void setTo ( data_t value );
00143
00144
00151 bool getColour ( ) const;
00152
00153
00158 void setColour ( bool value );
00159
00160
00167 virtual Point getStart( ) const;
00168
00169
00176 virtual Point getEnd( ) const;
00177
00186 int whereIs( const Point& p ) const;
00187
00193 Point findNearest( const Point& p ) const;
00194
00202
00203
00207 private:
00214 data_t _from;
00218 data_t _to;
00222 bool _colour;
00226 std::list<Boundary_1> _segments;
00227
00231 };
00232
00233 }
00234
00235 #endif //BOUNDARY_1_H
00236