9 #include "../tools/errorhandler.hpp" 26 for (FieldSegmentedPoints::const_iterator p =
m_points.begin(); p !=
m_points.end(); ++p)
28 double endDist = p->getEndDist();
30 if (!::
isNaN(endDist))
35 double startDist = p->getStartDist();
36 double angle = p->getAngle();
38 if (::
isNaN(startDist) ==
false)
44 if (startPoints.empty())
51 for (Polygon2D::const_reverse_iterator r = startPoints.rbegin(); r != startPoints.rend(); ++r)
105 return m_refPointAngle;
110 return m_refPointDist;
128 if (length < 0.00001)
131 printError(
"FieldRectangle::setLength: Length must not be 0 or negative - aborting!");
135 this->m_length = length;
140 this->m_refPointAngle = refPointAngle;
145 this->m_refPointDist = refPointDist;
154 if ((rotAngle < -
PI) || (rotAngle >
PI))
157 printWarning(
"FieldRectangle::setRotAngle: rotAngle is outside of the limit [-PI, PI], did you forget deg-2-rad conversion?");
159 this->m_rotAngle = rotAngle;
168 printError(
"FieldRectangle::setWidth: Width must not be 0 or negative - aborting!");
172 this->m_width = width;
181 printError(
"FieldRadial::computePolygon: The MRS does not support radial fields.");
207 this->m_firstAngle = firstAngle;
212 this->m_lastAngle = lastAngle;
217 this->m_maxDist = maxDist;
222 this->m_minDist = minDist;
242 this->m_maxLength = maxLength;
247 this->m_speedMax = speedMax;
256 FieldVector::const_iterator f;
257 for (f = m_fields.begin(); f != m_fields.end(); ++f)
266 if (f == m_fields.end())
268 dieWithError(
"Fields::getField(): No field available with the given number.");
280 m_fields.push_back(field);
285 UINT32 sum =
sizeof(*this);
286 FieldVector::const_iterator iter;
287 for (iter = m_fields.begin(); iter != m_fields.end(); iter++)
301 FieldVector::iterator iter;
302 for (iter = m_fields.begin(); iter != m_fields.end(); iter++)
304 if ((*iter)->getFieldNumber() != 0)
void printError(std::string message)
UINT16 getLastAngle() const
FieldSegmentedPoints getPoints()
double getMaxLength() const
void setMaxLength(double maxLength)
const FieldParameter & getField(UINT16 fieldNumber) const
const UINT32 getUsedMemory() const
UINT16 getNumberOfValidFields()
double getRefPointDist() const
UINT32 getMaxDist() const
const UINT16 getFieldNumber() const
double getRotAngle() const
double getRefPointAngle() const
void setLastAngle(UINT16 m_lastAngle)
static Point2D fromPolar(value_type dist, value_type angle)
void dieWithError(std::string errorMessage)
void setRefPointDist(double refPointDist)
FieldSegmentedPoints m_points
double getSpeedMax() const
void setMaxDist(UINT32 m_maxDist)
std::vector< FieldSegmentedPoint > FieldSegmentedPoints
void setRotAngle(double rotAngle)
void setWidth(double width)
UINT32 getMinDist() const
void setSpeedMax(double speedMax)
UINT32 getNumberOfPoints()
void setFirstAngle(UINT16 m_firstAngle)
void setMinDist(UINT32 m_minDist)
void add(FieldParameter *field)
UINT16 getFirstAngle() const
void setRefPointAngle(double refPointAngle)
void computePolygon()
fills the polygon clockwise
void printWarning(std::string message)
void setLength(double length)
void computePolygon()
fills the polygon clockwise