Aria  2.8.0
ArMapObjects Class Reference

The collection of map objects that are contained in an Aria map. More...

#include <ArMapComponents.h>

Inherits ArMapObjectsInterface.

Public Member Functions

virtual bool addToFileParser (ArFileParser *fileParser)
 Adds the keyword and handler for the map objects to the given file parser.
 
 ArMapObjects (const char *keyword="Cairn:")
 Constructor. More...
 
 ArMapObjects (const ArMapObjects &other)
 Copy constructor.
 
virtual void clear ()
 Clears the map objects and deletes them.
 
virtual ArMapObjectfindFirstMapObject (const char *name, const char *type, bool isIncludeWithHeading=false)
 
virtual ArMapObjectfindMapObject (const char *name, const char *type=NULL, bool isIncludeWithHeading=false)
 
virtual std::list< ArMapObject * > findMapObjectsOfType (const char *type, bool isIncludeWithHeading=false)
 When the map changes the pointers will no longer be valid... More...
 
virtual std::list< ArMapObject * > * getMapObjects (void)
 
virtual ArTime getTimeChanged () const
 Returns the time at which the map objects were last changed.
 
ArMapObjectsoperator= (const ArMapObjects &other)
 Assignment operator.
 
virtual bool remFromFileParser (ArFileParser *fileParser)
 Removes the keyword and handler for the map objects from the given file parser.
 
virtual void setMapObjects (const std::list< ArMapObject *> *mapObjects, bool isSortedObjects=false, ArMapChangeDetails *changeDetails=NULL)
 
void writeObjectListToFunctor (ArFunctor1< const char *> *functor, const char *endOfLineChars)
 
virtual ~ArMapObjects ()
 Destructor.
 
- Public Member Functions inherited from ArMapObjectsInterface
 ArMapObjectsInterface ()
 Constructor.
 
virtual ~ArMapObjectsInterface ()
 Destructor.
 

Static Public Attributes

static const char * DEFAULT_KEYWORD = "Cairn:"
 Default keyword that prefixes each map object line in the map file.
 

Protected Member Functions

void createMultiSet (ArMapFileLineSet *multiSet)
 Writes the map objects to the given ArMapFileLineSet.
 
bool handleMapObject (ArArgumentBuilder *arg)
 
void logMultiSet (const char *prefix, ArMapFileLineSet *multiSet)
 Writes the given ArMapFileLineSet to the output log with the specified prefix. More...
 
void sortMapObjects (std::list< ArMapObject *> *mapObjects)
 Sorts the given list of map objects in order of increasing object pose.
 

Protected Attributes

bool myIsSortedObjects
 Whether the myMapObjects list has been sorted in increasing (pose) order.
 
std::string myKeyword
 Keyword that prefixes each map object in the map file.
 
ArRetFunctor1C< bool, ArMapObjects, ArArgumentBuilder * > myMapObjectCB
 Callback to parse the map object from the map file.
 
std::list< ArMapObject * > myMapObjects
 List of map objects contained in the Aria map.
 
ArTime myTimeChanged
 Time at which the map objects were last changed.
 

Detailed Description

The collection of map objects that are contained in an Aria map.

ArMapObjects contains a list of objects defined in an Aria map. There are two basic classes of objects: user-defined objects such as goals and forbidden areas; and, special data objects that are usually automatically generated during the scanning process.

Constructor & Destructor Documentation

◆ ArMapObjects()

ArMapObjects::ArMapObjects ( const char *  keyword = "Cairn:")

Constructor.

Parameters
keywordthe char * keyword that prefixes each map object line in the map file

Member Function Documentation

◆ findMapObjectsOfType()

std::list< ArMapObject * > ArMapObjects::findMapObjectsOfType ( const char *  type,
bool  isIncludeWithHeading = false 
)
virtual

When the map changes the pointers will no longer be valid...

this doesn't lock the map while finding, so if you are using it from somewhere other than mapChanged you need to lock it... its probably easiest to just use it from mapChanged though.

Returns
Gets a list of pointers to all the map objects of a given * type... if none match the list will be empty.
Parameters
typeThe type of object to try to find... NULL means find any type
isIncludeWithHeadingalso match "WithHeading" versions of type ("<i>type</i>WithHeading")

Implements ArMapObjectsInterface.

◆ logMultiSet()

void ArMapObjects::logMultiSet ( const char *  prefix,
ArMapFileLineSet multiSet 
)
protected

Writes the given ArMapFileLineSet to the output log with the specified prefix.

ArLog::log(ArLog::Normal, "#%-3i : %s", fileLine.getLineNum(), fileLine.getLineText());


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