Aria  2.8.0
ArMapScanInterface Class Referenceabstract

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

#include <ArMapInterface.h>

Inherited by ArMapInterface, and ArMapScan.

Public Member Functions

virtual bool addToFileParser (ArFileParser *fileParser)=0
 Adds handlers for this scan data's header information to the given file parser. More...
 
 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. More...
 
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. More...
 
virtual std::vector< ArLineSegment > * getLines (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
 Returns a pointer to the line segments for the specified scan. More...
 
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. More...
 
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. More...
 
virtual int getNumLines (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
 Returns the number of line segments in the specified scan. More...
 
virtual int getNumPoints (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
 Returns the number of points in the specified scan. More...
 
virtual std::vector< ArPose > * getPoints (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
 Returns a pointer to the map points for the specified scan. More...
 
virtual int getResolution (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
 Gets the resolution (-1 if none specified) More...
 
virtual bool isSortedLines (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE) const =0
 Returns whether the line segment vector for the specified scan is sorted. More...
 
virtual bool isSortedPoints (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE) const =0
 Returns whether the point vector for the specified scan is sorted. More...
 
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. More...
 
virtual bool readLineSegment (char *line)=0
 Reads a line segment from the given line and adds it to this scan data. More...
 
virtual bool remFromFileParser (ArFileParser *fileParser)=0
 Removes the handlers for this scan data's header information from the given file parser. More...
 
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) More...
 
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) More...
 
virtual void setResolution (int resolution, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, ArMapChangeDetails *changeDetails=NULL)=0
 Sets the resolution (-1 if none specified) More...
 
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. More...
 
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. More...
 
virtual void writeScanToFunctor (ArFunctor1< const char *> *functor, const char *endOfLineChars, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0
 This method writes a text line for each of the scan header attributes (such as MinPose, MaxPose, NumPoints). More...
 
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.
 

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).

Member Function Documentation

◆ addToFileParser()

virtual bool ArMapScanInterface::addToFileParser ( ArFileParser fileParser)
pure virtual

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

Parameters
fileParsera pointer to the ArFileParser to which to add the handlers
Returns
bool true if the handlers were successfully added; false if an error occurred

◆ getLineMaxPose()

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
scanTypethe 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

◆ getLineMinPose()

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
scanTypethe 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

◆ getLines()

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
scanTypethe 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

◆ getMaxPose()

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
scanTypethe 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

◆ getMinPose()

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
scanTypethe 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

◆ getNumLines()

virtual int ArMapScanInterface::getNumLines ( const char *  scanType = ARMAP_DEFAULT_SCAN_TYPE)
pure virtual

Returns the number of line segments in the specified scan.

Parameters
scanTypethe 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

◆ getNumPoints()

virtual int ArMapScanInterface::getNumPoints ( const char *  scanType = ARMAP_DEFAULT_SCAN_TYPE)
pure virtual

Returns the number of points in the specified scan.

Parameters
scanTypethe 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

◆ getPoints()

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
scanTypethe 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

◆ getResolution()

virtual int ArMapScanInterface::getResolution ( const char *  scanType = ARMAP_DEFAULT_SCAN_TYPE)
pure virtual

Gets the resolution (-1 if none specified)

Parameters
scanTypethe 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

◆ isSortedLines()

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
scanTypethe 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

◆ isSortedPoints()

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
scanTypethe 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

◆ readDataPoint()

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
linethe 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

◆ readLineSegment()

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
linethe 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

◆ remFromFileParser()

virtual bool ArMapScanInterface::remFromFileParser ( ArFileParser fileParser)
pure virtual

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

Parameters
fileParsera pointer to the ArFileParser from which to remove the handlers
Returns
bool true if the handlers were successfully removed; false if an error occurred

◆ setLines()

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
linesa pointer to the ArLineSegment vector to be copied to the scan data
scanTypethe const char * identifier of the scan type for which to set the points; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL
isSortedLinesa bool set to true if the line segment vector has already been sorted in ascending order
changeDetailsa 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

◆ setPoints()

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
pointsa pointer to the ArPose vector to be copied to the scan data
scanTypethe const char * identifier of the scan type for which to set the points; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL
isSortedPointsa bool set to true if the points vector has already been sorted in ascending order
changeDetailsa 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

◆ setResolution()

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
resolutionthe int number of mm between the scan data point readings
scanTypethe const char * identifier of the scan for which to return the resolution; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL
changeDetailsa 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

◆ writeLinesToFunctor()

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
functora pointer to the ArFunctor2 that takes the number of line segments and the vector of ArLineSegments, and writes the information
scanTypethe const char * identifier of the scan points to be written; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL
keywordFunctora pointer to an optional ArFunctor1 that writes a text line to introduce the associated ArLineSegments; if NULL, then the header is not written

◆ writePointsToFunctor()

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
functora pointer to the ArFunctor2 that takes the number of points and the vector of ArPoses, and writes the information
scanTypethe const char * identifier of the scan points to be written; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL
keywordFunctora pointer to an optional ArFunctor1 that writes a text line to introduce the associated ArPoses; if NULL, then the header is not written

◆ writeScanToFunctor()

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. HokuyoURGMinPose).

Parameters
functorthe ArFunctor1 to which to write the scan header information (as text lines)
endOfLineCharsthe const char * string to be appended to the end of each text line
scanTypethe 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 files: