ICAROUS
All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Modules Pages
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
larcfm::PolyReader Class Reference

#include <PolyReader.h>

Inheritance diagram for larcfm::PolyReader:
larcfm::PlanReader larcfm::ErrorReporter larcfm::ParameterReader larcfm::ParameterProvider

Public Member Functions

 PolyReader ()
 
virtual void open (const std::string &filename)
 
virtual void open (std::istream *input)
 
int planSize () const
 
int polySize () const
 
int containmentSize () const
 
Plan getPlan (int i) const
 
PolyPath getPolyPath (int i) const
 
PolyPath getContainmentPolygon (int i) const
 
int combinedSize () const
 
Plan getCombinedPlan (int i) const
 
- Public Member Functions inherited from larcfm::PlanReader
 PlanReader ()
 
int planSize () const
 
int polySize () const
 
int containmentSize () const
 
int size () const
 
Plan getPlan (int i) const
 
PolyPath getPolyPath (int i) const
 
PolyPath getContainmentPolygon (int i) const
 
int combinedSize () const
 
Plan getCombinedPlan (int i) const
 
ParameterData getParameters () const
 
void updateParameterData (ParameterData &p) const
 
ParameterDatagetParametersRef ()
 
bool hasError () const
 
bool hasMessage () const
 
std::string getMessage ()
 
std::string getMessageNoClear () const
 

Protected Member Functions

int pathNameIndex (const std::string &name) const
 
int containmentNameIndex (const std::string &name) const
 
- Protected Member Functions inherited from larcfm::PlanReader
int pathNameIndex (const std::string &name) const
 
int containmentNameIndex (const std::string &name) const
 
int planNameIndex (const std::string &name) const
 
int altHeadings (const std::string &s1, const std::string &s2, const std::string &s3, const std::string &s4) const
 
int altHeadings (const std::string &s1, const std::string &s2, const std::string &s3) const
 
int altHeadings (const std::string &s1, const std::string &s2) const
 
double getClock (const std::string &s) const
 

Private Types

enum  {
  NAME , LAT_SX , LON_SY , SZ ,
  TIME , LABEL , TYPE , TCP_TRK ,
  TCP_GS , TCP_VS , ACC_TRK , ACC_GS ,
  ACC_VS , TRK , GS , VS ,
  SRC_LAT_SX , SRC_LON_SY , SRC_ALT , SRC_TIME ,
  RADIUS , SZ2 , ENDTIME
}
 
enum  { POLY , UNKNOWN , PLAN }
 

Private Member Functions

int altHeadings5 (const std::string &s1, const std::string &s2, const std::string &s3, const std::string &s4, const std::string &s5) const
 
virtual void loadfile ()
 

Private Attributes

std::vector< PolyPathpaths
 
std::vector< PolyPathcontainment
 

Additional Inherited Members

- Protected Attributes inherited from larcfm::PlanReader
ErrorLog error
 
SeparatedInput input
 
std::vector< Planplans
 
bool clock
 
std::vector< int > head
 
bool OLD_COLUMN_HEADERS
 

Detailed Description

This reads in and stores both Plans and PolyPaths (and parameters) from a file

Plan files consist of comma or space-separated values, with one point per line. Required columns include either: Aircraft name, x-position [nmi], y-position [nmi], z-position [ft], time [s] or Aircraft name, latitude [deg], longitude [deg], altitude [ft], time [s]

Polygon files also include a required second altitude column ft.

Any given line may contain either type of information, but all lines describing a single entity (either aircraft or polygon) must be located together, and without time decreasing – new entities are detected by a change in the name field or if (time of entry n) < (time of entry n+1). The type of the entry is defined by the presence or lack of a second altitude column value (polys have it, plans don't).

Optional columns include point mutability and point label, both with [unspecified] units. Even if these columns are defined, these two values are optional for any given line. Columns without values may be left blank (if comma-delimited) or indicated by a single dash (-).

It is necessary to include a header line that defines the column ordering. The column definitions are not case sensitive. There is also an optional header line, immediately following the column definition, that defines the unit type for each column (the defaults are listed above).

If points are consecutive for the same aircraft, subsequent name fields may be replaced with a double quotation mark ("). The aircraft name is case sensitive, so US54A != Us54a != us54a. Any empty line or any line starting with a hash sign (#) is ignored. Files may also include parameter definitions prior to other data. Parameter definitions are of the form <key> = <value>, one per line, where <key> is a case-insensitive alphanumeric word and <value> is either a numeral or string. The <value> may include a unit, such as "dist = 50 [m]". Note that parameters require a space on either side of the equals sign. Parameters can be interpreted as double values, strings, or Boolean values, and the user is required to know which parameter is interpreted as which type. If the optional parameter "filetype" is specified, its value must be "plan", "trajectory", "poly", or "plan+poly" (no quotes) for this reader to accept the file without error. Plan "note" information is to be stored with a parameter named ID_note, where ID is the name of the plan in question.

Constructor & Destructor Documentation

◆ PolyReader()

larcfm::PolyReader::PolyReader ( )

Create a new PolyReader.

Member Function Documentation

◆ combinedSize()

int larcfm::PolyReader::combinedSize ( ) const

Returns the total number of both plans and paths.

◆ containmentSize()

int larcfm::PolyReader::containmentSize ( ) const

Return the number of containment areas in the file

◆ getCombinedPlan()

Plan larcfm::PolyReader::getCombinedPlan ( int  i) const

Returns a plan or the plan corresponding to a path. Real plans occur first in the list. This should only be used if approximating plans by variable-sized traffic.

Parameters
i
Returns

◆ getContainmentPolygon()

PolyPath larcfm::PolyReader::getContainmentPolygon ( int  i) const

Returns the i-th containment polygon in the file

◆ getPlan()

Plan larcfm::PolyReader::getPlan ( int  i) const

Returns the i-th plan in the file

◆ getPolyPath()

PolyPath larcfm::PolyReader::getPolyPath ( int  i) const

Returns the i-th path in the file

◆ loadfile()

virtual void larcfm::PolyReader::loadfile ( )
privatevirtual

Reimplemented from larcfm::PlanReader.

◆ open() [1/2]

virtual void larcfm::PolyReader::open ( const std::string &  filename)
virtual

Reimplemented from larcfm::PlanReader.

◆ open() [2/2]

virtual void larcfm::PolyReader::open ( std::istream *  input)
virtual

Reimplemented from larcfm::PlanReader.

◆ planSize()

int larcfm::PolyReader::planSize ( ) const

Return the number of plans in the file

◆ polySize()

int larcfm::PolyReader::polySize ( ) const

Return the number of paths in the file


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