Aria: ArMapScanInterface Class Reference

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ArMapScanInterface Class Reference

`#include <ArMapInterface.h>`

Inheritance diagram for ArMapScanInterface:

List of all members.

## Detailed Description

Methods related to setting and retrieving the scan-related data in an Aria map.

ArMapScanInterface is an abstract class that defines the methods used to manipulate obstacle data in an Aria map. These generally include the points and lines detected by a particular sensor (a.k.a. scan type).

## Public Member Functions
virtual bool | addToFileParser (ArFileParser *fileParser)=0
| Adds handlers for this scan data's header information to the given file parser.
| ArMapScanInterface ()
| Default constructor.
virtual const char * | getDisplayString (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
virtual ArPose | getLineMaxPose (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
| Returns the upper right point (maximum x and y) of the scan's line segments.
virtual ArPose | getLineMinPose (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
| Returns the lower left point (minimum x and y) of the scan's line segments.
virtual std::vector< ArLineSegment > * | getLines (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
| Returns a pointer to the line segments for the specified scan.
virtual ArPose | getMaxPose (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
| Returns the upper right point (maximum x and y) of the scan's points.
virtual ArPose | getMinPose (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
| Returns the lower left point (minimum x and y) of the scan's points.
virtual int | getNumLines (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
| Returns the number of line segments in the specified scan.
virtual int | getNumPoints (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
| Returns the number of points in the specified scan.
virtual std::vector< ArPose > * | getPoints (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
| Returns a pointer to the map points for the specified scan.
virtual int | getResolution (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
| Gets the resolution (-1 if none specified).
virtual bool | isSortedLines (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE) const =0
| Returns whether the line segment vector for the specified scan is sorted.
virtual bool | isSortedPoints (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE) const =0
| Returns whether the point vector for the specified scan is sorted.
virtual void | loadDataPoint (double x, double y)=0
| Adds the specified data point to the scan data.
virtual void | loadLineSegment (double x1, double y1, double x2, double y2)=0
| Adds the specified line segment to the scan data.
virtual bool | readDataPoint (char *line)=0
| Reads a data point from the given line and adds it to this scan data.
virtual bool | readLineSegment (char *line)=0
| Reads a line segment from the given line and adds it to this scan data.
virtual bool | remFromFileParser (ArFileParser *fileParser)=0
| Removes the handlers for this scan data's header information from the given file parser.
virtual void | setLines (const std::vector< ArLineSegment > *lines, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, bool isSortedLines=false, ArMapChangeDetails *changeDetails=NULL)=0
| Sets the lines (copies those passed in).
virtual void | setPoints (const std::vector< ArPose > *points, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, bool isSortedPoints=false, ArMapChangeDetails *changeDetails=NULL)=0
| Sets the points (copies those passed in).
virtual void | setResolution (int resolution, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, ArMapChangeDetails *changeDetails=NULL)=0
| Sets the resolution (-1 if none specified).
virtual void | writeLinesToFunctor (ArFunctor2< int, std::vector< ArLineSegment > * > *functor, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, ArFunctor1< const char * > *keywordFunctor=NULL)=0
| Writes the map line segments to a functor.
virtual void | writePointsToFunctor (ArFunctor2< int, std::vector< ArPose > * > *functor, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, ArFunctor1< const char * > *keywordFunctor=NULL)=0
| Writes the scan data points to a functor.
virtual void | writeScanToFunctor (ArFunctor1< const char * > *functor, const char *endOfLineChars, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
virtual | ~ArMapScanInterface ()
| Destructor.
## Static Public Member Functions
static bool | isDefaultScanType (const char *scanType)
| Determines whether the given scan type is the default (i.e. no prefix on the map tags).
static bool | isSummaryScanType (const char *scanType)
| Determines whether the given scan type represents the summary of all other scan types.

## Member Function Documentation

virtual bool ArMapScanInterface::addToFileParser | ( | ArFileParser * | fileParser | ) | `[pure virtual]`

Adds handlers for this scan data's header information to the given file parser.

Parameters:

  | fileParser | a pointer to the ArFileParser to which to add the handlers

Returns:
  bool true if the handlers were successfully added; false if an error occurred

virtual ArPose ArMapScanInterface::getLineMaxPose | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | `[pure virtual]`

Returns the upper right point (maximum x and y) of the scan's line segments.

Parameters:

  | scanType | the const char * identifier of the scan type for which to return the maximum line segment pose; if ARMAP_SUMMARY_SCAN_TYPE, then the maximum line segment pose for all scans is returned

virtual ArPose ArMapScanInterface::getLineMinPose | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | `[pure virtual]`

Returns the lower left point (minimum x and y) of the scan's line segments.

Parameters:

  | scanType | the const char * identifier of the scan type for which to return the minimum line segment pose; if ARMAP_SUMMARY_SCAN_TYPE, then the minimum line segment pose for all scans is returned

virtual std::vector<ArLineSegment>* ArMapScanInterface::getLines | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | `[pure virtual]`

Returns a pointer to the line segments for the specified scan.

Note that this returns a pointer to the object's internal vector. The map must be locked before this method is called, and must be unlocked after the caller has finished using the vector.

Parameters:

  | scanType | the const char * identifier of the scan type for which to return the line segments; must be non-NULL

Returns:
  a pointer to the std::vector<ArPose> that contains the specified scan's points; NULL if the scanType is undefined for the map

virtual ArPose ArMapScanInterface::getMaxPose | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | `[pure virtual]`

Returns the upper right point (maximum x and y) of the scan's points.

Parameters:

  | scanType | the const char * identifier of the scan type for which to return the maximum pose; if ARMAP_SUMMARY_SCAN_TYPE, then the maximum pose for all scans is returned

virtual ArPose ArMapScanInterface::getMinPose | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | `[pure virtual]`

Returns the lower left point (minimum x and y) of the scan's points.

Parameters:

  | scanType | the const char * identifier of the scan type for which to return the minimum pose; if ARMAP_SUMMARY_SCAN_TYPE, then the minimum pose for all scans is returned

virtual int ArMapScanInterface::getNumLines | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | `[pure virtual]`

Returns the number of line segments in the specified scan.

Parameters:

  | scanType | the const char * identifier of the scan type for which to return the line segment count; if ARMAP_SUMMARY_SCAN_TYPE, then the line segment count for all scans is returned

virtual int ArMapScanInterface::getNumPoints | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | `[pure virtual]`

Returns the number of points in the specified scan.

Parameters:

  | scanType | the const char * identifier of the scan type for which to return the point count; if ARMAP_SUMMARY_SCAN_TYPE, then the point count for all scans is returned

virtual std::vector<ArPose>* ArMapScanInterface::getPoints | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | `[pure virtual]`

Returns a pointer to the map points for the specified scan.

Note that this returns a pointer to the object's internal vector. The map must be locked before this method is called, and must be unlocked after the caller has finished using the vector.

Parameters:

  | scanType | the const char * identifier of the scan type for which to return the points; must be non-NULL

Returns:
  a pointer to the std::vector<ArPose> that contains the specified scan's points; NULL if the scanType is undefined for the map

virtual int ArMapScanInterface::getResolution | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | `[pure virtual]`

Gets the resolution (-1 if none specified).

Parameters:

  | scanType | the const char * identifier of the scan for which to return the resolution; if ARMAP_SUMMARY_SCAN_TYPE then the lowest resolution (highest numerical value) of all scans is returned

virtual bool ArMapScanInterface::isSortedLines | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | const`[pure virtual]`

Returns whether the line segment vector for the specified scan is sorted.

Note that this method returns the state of the line segment vector when it was read from the file, or after setLines has been called. If the application calls getLines and directly manipulates the line segment vector's contents, then isSortedLines will not necessarily be correct.

Parameters:

  | scanType | the const char * identifier of the scan type for which to return the sorted state; if ARMAP_SUMMARY_SCAN_TYPE, then this method returns true if and only if all scans have sorted line segments

virtual bool ArMapScanInterface::isSortedPoints | ( | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` | ) | const`[pure virtual]`

Returns whether the point vector for the specified scan is sorted.

Note that this method returns the state of the point vector when it was read from the file, or after setPoints has been called. If the application calls getPoints and directly manipulates the point vector's contents, then isSortedPoints will not necessarily be correct.

Parameters:

  | scanType | the const char * identifier of the scan type for which to return the sorted state; if ARMAP_SUMMARY_SCAN_TYPE, then this method returns true if and only if all scans have sorted points

virtual bool ArMapScanInterface::readDataPoint | ( | char * | line | ) | `[pure virtual]`

Reads a data point from the given line and adds it to this scan data.

The data point is expected to be two integers (x y), separated by whitespace.

Parameters:

  | line | the char * text line to be parsed

Returns:
  bool true if the point was successfully read and added to this scan data; false if an error occurred

virtual bool ArMapScanInterface::readLineSegment | ( | char * | line | ) | `[pure virtual]`

Reads a line segment from the given line and adds it to this scan data.

The line segment is expected to be four integers (x1 y1 x2 y2), separated by whitespace

Parameters:

  | line | the char * text line to be parsed

Returns:
  bool true if the line segment was successfully read and added to this scan data; false if an error occurred

virtual bool ArMapScanInterface::remFromFileParser | ( | ArFileParser * | fileParser | ) | `[pure virtual]`

Removes the handlers for this scan data's header information from the given file parser.

Parameters:

  | fileParser | a pointer to the ArFileParser from which to remove the handlers

Returns:
  bool true if the handlers were successfully removed; false if an error occurred

virtual void ArMapScanInterface::setLines | ( | const std::vector< ArLineSegment > * | lines,
|  | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE`,
|  | bool | isSortedLines = `false`,
|  | ArMapChangeDetails * | changeDetails = `NULL` |
| ) |  |  | `[pure virtual]`

Sets the lines (copies those passed in).

This method will sort the given line segments in ascending order (according to the ArLineSegment less-than operator. If the vector is already sorted, then set the isSortedLiens parameter to true in order to improve performance.

Parameters:

  | lines | a pointer to the ArLineSegment vector to be copied to the scan data
  | scanType | the const char * identifier of the scan type for which to set the points; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL
  | isSortedLines | a bool set to true if the line segment vector has already been sorted in ascending order
  | changeDetails | a pointer to the optional ArMapChangeDetails in which to store a description of the changes to the scan data; if NULL then the changes are not tracked.

See also:
  ArMapChangeDetails

virtual void ArMapScanInterface::setPoints | ( | const std::vector< ArPose > * | points,
|  | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE`,
|  | bool | isSortedPoints = `false`,
|  | ArMapChangeDetails * | changeDetails = `NULL` |
| ) |  |  | `[pure virtual]`

Sets the points (copies those passed in).

This method will sort the given points in ascending order (according to the ArPose less-than operator. If the points vector is already sorted, then set the isSortedPoints parameter to true in order to improve performance.

Parameters:

  | points | a pointer to the ArPose vector to be copied to the scan data
  | scanType | the const char * identifier of the scan type for which to set the points; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL
  | isSortedPoints | a bool set to true if the points vector has already been sorted in ascending order
  | changeDetails | a pointer to the optional ArMapChangeDetails in which to store a description of the changes to the scan data; if NULL then the changes are not tracked.

See also:
  ArMapChangeDetails

virtual void ArMapScanInterface::setResolution | ( | int | resolution,
|  | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE`,
|  | ArMapChangeDetails * | changeDetails = `NULL` |
| ) |  |  | `[pure virtual]`

Sets the resolution (-1 if none specified).

Parameters:

  | resolution | the int number of mm between the scan data point readings
  | scanType | the const char * identifier of the scan for which to return the resolution; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL
  | changeDetails | a pointer to the optional ArMapChangeDetails in which to store a description of the changes to the scan data; if NULL then the changes are not tracked.

See also:
  ArMapChangeDetails

virtual void ArMapScanInterface::writeLinesToFunctor | ( | ArFunctor2< int, std::vector< ArLineSegment > * > * | functor,
|  | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE`,
|  | ArFunctor1< const char * > * | keywordFunctor = `NULL` |
| ) |  |  | `[pure virtual]`

Writes the map line segments to a functor.

A pointer to the entire data line segment vector is passed directly to the functor in order to improve performance. The functor must not modify the vector's contents.

Parameters:

  | functor | a pointer to the ArFunctor2 that takes the number of line segments and the vector of ArLineSegments, and writes the information
  | scanType | the const char * identifier of the scan points to be written; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL
  | keywordFunctor | a pointer to an optional ArFunctor1 that writes a text line to introduce the associated ArLineSegments; if NULL, then the header is not written

virtual void ArMapScanInterface::writePointsToFunctor | ( | ArFunctor2< int, std::vector< ArPose > * > * | functor,
|  | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE`,
|  | ArFunctor1< const char * > * | keywordFunctor = `NULL` |
| ) |  |  | `[pure virtual]`

Writes the scan data points to a functor.

A pointer to the entire data point vector is passed directly to the functor in order to improve performance. The functor must not modify the vector's contents.

Parameters:

  | functor | a pointer to the ArFunctor2 that takes the number of points and the vector of ArPoses, and writes the information
  | scanType | the const char * identifier of the scan points to be written; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL
  | keywordFunctor | a pointer to an optional ArFunctor1 that writes a text line to introduce the associated ArPoses; if NULL, then the header is not written

virtual void ArMapScanInterface::writeScanToFunctor | ( | ArFunctor1< const char * > * | functor,
|  | const char * | endOfLineChars,
|  | const char * | scanType = `ARMAP_DEFAULT_SCAN_TYPE` |
| ) |  |  | `[pure virtual]`

This method writes a text line for each of the scan header attributes (such as MinPose, MaxPose, NumPoints). Depending on the scan type, a prefix may be prepended to the keyword (e.g. HokuyuURGMinPose).

Parameters:

  | functor | the ArFunctor1 to which to write the scan header information (as text lines)
  | endOfLineChars | the const char * string to be appended to the end of each text line
  | scanType | the const char * identifier of the scan data to be written to the functor; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL

The documentation for this class was generated from the following file:

- ArMapInterface.h