File_Therion
[ class tree: File_Therion ] [ index: File_Therion ] [ all elements ]

Class: File_Therion_Centreline

Source Location: /File_Therion-0.4.1/File/Therion/Centreline.php

Class Overview

File_Therion_BasicObject
   |
   --File_Therion_Centreline

Class representing a therion centreline object.


Author(s):

Copyright:

  • 2016 Benedikt Hallinger

Variables

Methods


Inherited Variables

Inherited Methods

Class: File_Therion_BasicObject

File_Therion_BasicObject::addComment()
Add a comment.
File_Therion_BasicObject::getData()
Get some simple data of this object.
File_Therion_BasicObject::getOption()
Get option of this object.
File_Therion_BasicObject::getOptionsString()
Generate basic options string.
File_Therion_BasicObject::handleCommonOption()
Handle known options supported by several objects.
File_Therion_BasicObject::setData()
Set some simple data of this object.
File_Therion_BasicObject::setOption()
Set options of this object.
File_Therion_BasicObject::_verify()
Verify basic compliance of item.

Class Details

[line 27]
Class representing a therion centreline object.

The centreline contains the shots of the survey.



[ Top ]


Class Variables

$_data = array(
        'author'      => array(),// 0=year, 1=Person
'copyright'=>array(),// 0=year, 1=string
'title'=>"",'date'=>array(),'explo-date'=>array(),'instrument'=>array(),// assoc: [<quantity>]=<description>
'infer'=>array(),// assoc: [<what>]=<boolean>
'declination'=>array(),// 0=value, 1=unit; eg. (0.0 grad)
'grid-angle'=>array(),// (<value> <units>)
'sd'=>array(),// assoc: [<quantity>]=(<value> <units>)
'cs'=>"",// <coordinate system>
'station-names'=>null,// <prefix> <postfix>; null=leave alone
'grade'=>array(),// grade <grade list>
)

[line 63]

Basic data elements.
  • Access: protected

Type:   array


[ Top ]

$_extend = array()

[line 139]

Extend definitions.

Controls how extended elevation is rendered.

Contains array with associative array:

  • key 'obj': value is relevant object (Shot or Station)
  • key 'spec': value is specification

  • Access: protected

Type:   array


[ Top ]

$_fixedStations = array()

[line 125]

Fixed stations outside of shot data
  • Access: protected

Type:   array


[ Top ]

$_options = array(
        'id' => "",
    )

[line 44]

Centreline options (id, ...).
  • Var: assoc array
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]

$_shotDef = array()

[line 107]

Centreline data definition.

This holds the data definition order of shot elements. (eg "data normal from to length bearing gradient left right up down").

array is associative:

  • key 'style' is "normal", "diving", etc
  • key 'order' is "left", "right", "up", etc.
Index=0 is type, subsequent items define keyword

  • Access: protected

Type:   array


[ Top ]

$_shots = array()

[line 118]

Centreline shot definition.

This holds a associative array containing the shots. Each shot is represented by an individual File_Therion_Shot object. This gives access to extended data fields like flags.

  • Var: with File_Therion_Shot objects.
  • Access: protected

Type:   array


[ Top ]

$_shotTPL =  null

[line 55]

Shot template for initializing units etc

Will be initialized in construtor and updated from setUnit()

  • Access: protected

Type:   File_Therion_Shot


[ Top ]

$_survey =  null

[line 37]

Survey context of this centreline.
  • Access: protected



[ Top ]

$_tripStack = array()

[line 92]

Trips Stack to store date, explo-date, team and explo-team in order.

Each indexed entry contains an associative array with name and value: array( [0] => array ( ['date'] => Date-Obj || array(DateObj, DateObj) ) [1] => array ( ['team'] => array(PersonObj, "role1", "roleN") ) [2] => array( ['explo-date'] => Date-Obj || array(DateObj, DateObj) ) [3] => array ( ['explo-team'] => PersonObj ) [n] => array (...)

  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 149]

File_Therion_Centreline __construct( [array $options = array()])

Create a new therion centreline object.
  • Todo: Restrict naming convention, not all characters are allowed!
  • Access: public

Parameters:

array   $options   —  Optional associative options array

[ Top ]

addDate   [line 779]

void addDate( array|File_Therion_Date $date)

Set survey date.

If a an array with exactly two Date objects is given, this will be threaten as time interval.

  • Throws: InvalidArgumentException
  • Access: public

Parameters:

array|File_Therion_Date   $date   —  therion date or array for date interval

[ Top ]

addExploDate   [line 811]

void addExploDate( File_Therion_Date $date)

Set exploration date.
  • Access: public

Parameters:

File_Therion_Date   $date   —  therion date

[ Top ]

addExploTeam   [line 726]

void addExploTeam( File_Therion_Person $person)

Add a team member which explored.
  • Access: public

Parameters:

File_Therion_Person   $person   —  team member

[ Top ]

addFixedStation   [line 949]

void addFixedStation( File_Therion_Station $station)

Add a fixed station definition.

Note that the usual way to go is, to call File_Therion_Station::setFix() on a existing station from one of the associated centreline shots.

If a station object with the name exists, that station will be fixed. Otherwise the station will be added as uncorrelated to shot data.

Example:

  1.  $station = new File_Therion_Station("1");
  2.  $station->setComment("Small rabbit hole left of tree");
  3.  $station->setFix(123);
  4.  $centreline->addFixedStation($station);

  • Throws: InvalidArgumentException if station is not fixed
  • Access: public

Parameters:

File_Therion_Station   $station   —  Station object to add

[ Top ]

addShot   [line 1106]

void addShot( File_Therion_Shot $shot)

Add a survey shot to this centreline.

If the centreline has an active station-names setting, the stations pre- and postfix (see setStationNames()) will be updated at the added shot stations with the current centreline setting.

This will also update the survey context of the shots from- and to-station with the survey context of the centreline; as a given station could only be part of one centreline.

The shots units declarations will be updated using the current default units settings of the centreline (see setUnit()), but only if the shot does not already have a more specific units setting.

You need to use File_Therion_Station::addEquate() when you want to set stations equal.

  • Todo: test for null pointer exception if a shot has no stations
  • Access: public

Parameters:

File_Therion_Shot   $shot   —  shot object

[ Top ]

addTeam   [line 655]

void addTeam( File_Therion_Person $person, [string|array $roles = array()])

Add a surveying team member.
  • Todo: add parameter checks, especially for roles param
  • Access: public

Parameters:

File_Therion_Person   $person   —  team member
string|array   $roles   —  string with one role or array of strings with roles

[ Top ]

applyStationNames   [line 1213]

void applyStationNames( )

Apply station-names to all stations of shots from this centreline.

This applies the individual station prefix/postfix setting of all stations from all shots of this centreline. This may be handy when you want to avoid station-name commands in generated output or want fully qualified station names everywhere.

Be aware that this will overwrite the station names and resets the prefix/postfix setting. If you just want to enforce a given prefix/postfix softly, use updateShotStationNames() instead.

You also could call updateShotStationNames() prior calling applyStationNames() to enforce homogenous fully qualified station names.

The centrelines prefix/postfix setting will be untouched after this operation. Reset it manually if you don't want that further added stations receive the current prefix/postfix setting (see setStationNames()).

  • Todo: test for nullPointerException in case shot station is invalid
  • Access: public

[ Top ]

clearDate   [line 787]

void clearDate( )

Remove all survey dates.
  • Access: public

[ Top ]

clearExploDate   [line 819]

void clearExploDate( )

Remove all survey exploration dates.
  • Access: public

[ Top ]

clearExploTeam   [line 751]

void clearExploTeam( )

Remove all associated exploring team members.
  • Access: public

[ Top ]

clearExtends   [line 1079]

void clearExtends( )

Clear all extend definitions of centreline.
  • Access: public

[ Top ]

clearFixedStations   [line 979]

void clearFixedStations( )

Remove associated fixed stations.
  • Access: public

[ Top ]

clearShots   [line 1184]

void clearShots( )

Remove all associated shots from this centreline.
  • Access: public

[ Top ]

clearTeam   [line 685]

void clearTeam( )

Remove all associated team members.
  • Access: public

[ Top ]

count   [line 1338]

int count( )

Count number of shots of this centreline (SPL Countable).
  • Return: number of subsurveys
  • Access: public

[ Top ]

getAuthor   [line 1327]

array, getAuthor( )

Return author.
  • Return: 0=year, 1=Person object
  • Access: public

[ Top ]

getCoordinateSystem   [line 1285]

string getCoordinateSystem( )

Returns the coordinate system used for fixing stations.
  • Return: (empty string if not set so far)
  • Access: public

[ Top ]

getCopyright   [line 1306]

array, getCopyright( )

Return copyright.
  • Return: 0=year, 1=text
  • Access: public

[ Top ]

getDate   [line 765]

null|array|File_Therion_Date getDate( )

Get survey date(s).

When no date is set, NULL will be returned. If one date is set, a date object is returned. Otherwise an array containing all date objects is returned.

  • Return: therion date
  • Access: public

[ Top ]

getDeclination   [line 554]

null|array getDeclination( )

Get declination of this centreline.

returns null in case declination was not set.

  • Return: [0]=Declination angle; [1]=unit
  • Access: public

[ Top ]

getExploDate   [line 801]

null|array|File_Therion_Date getExploDate( )

Get exploration date.

When no date is set, NULL will be returned. If one date is set, a date object is returned. Otherwise an array containing all date objects is returned.

  • Return: therion date
  • Access: public

[ Top ]

getExploTeam   [line 736]

array getExploTeam( )

Get all exploring team members.
  • Return: array of File_Therion_Person objects.
  • Access: public

[ Top ]

getExtends   [line 1071]

array getExtends( )

Get extend definitions of centreline.

Returns array with associative array:

  • key 'obj': value is relevant object (Shot or Station)
  • key 'spec': value is specification


[ Top ]

getFixedStations   [line 992]

array getFixedStations( )

Get existing fixed station objects associated outside of shot data.

Associated stations (see addFixedStation()) will be tested so only currently fixed stations will be returned.

  • Return: of fixed File_Therion_Station objects
  • Access: public

[ Top ]

getGrade   [line 1756]

array getGrade( )

Get grade definition(s) of this centreline.
  • Access: public

[ Top ]

getShots   [line 1138]

array getShots( [string $fromStation = null], [ $toStation = null])

Get all shots of this centreline.
  • Return: array of File_Therion_Shot objects.
  • Throws: OutOfBoundsException in case filtering of unset shot requested
  • Access: public

Parameters:

string   $fromStation   —  Optionally filter by to-station
   $toStation   — 

[ Top ]

getStationNames   [line 875]

null|array: getStationNames( )

Get station-names (pre-/postfix).

When no station-names setting is in effect, null is returned.

  • Return: [0]=prefix, [1]=postfix
  • Access: public

[ Top ]

getStations   [line 891]

array getStations( [string|File_Therion_Station $station = null])

Get all station objects.

You may query for a station name in which case either the station is returned or throws an OutOfBoundsException when not found. Use the full stations name when station-names is in effect.

  • Return: of File_Therion_Station objects
  • Throws: OutOfBoundsException if no named station is found.
  • Access: public

Parameters:

string|File_Therion_Station   $station   —  Query for named station (use full name)

[ Top ]

getSurveyContext   [line 1660]

null|File_Therion_Survey getSurveyContext( )

Get survey context of this equate.

This returns the survey context of this equate for name resolution.

  • Access: public

[ Top ]

getTeam   [line 670]

array getTeam( )

Get all surveying team members.
  • Return: array of File_Therion_Person objects.
  • See: getTeamRoles() for querying team roles.
  • Access: public

[ Top ]

getTeamRoles   [line 699]

array getTeamRoles( File_Therion_Person $person)

Get surveying roles of a team member.

Note that exploring team members have no roles.

  • Return: string array with surveying roles of that person.
  • Throws: OutOfBoundsException in case person is no surveying team member.
  • Access: public

Parameters:

File_Therion_Person   $person   —  team member.

[ Top ]

getUnit   [line 1693]

File_Therion_Unit|array getUnit( string $type)

Get current default unit for shots.

See setUnit() for details.


Parameters:

string   $type   —  Measurement type ('clino', 'bearing', ...) or 'all'

[ Top ]

parse   [line 167]

File_Therion_Centreline parse( array $lines)

Parses given Therion_Line-objects into internal data structures.
  • Return: Centreline object
  • Todo: Implement parsing of centreline extending
  • Todo: implement lookup of equated non-local stations
  • Throws: InvalidArgumentException
  • Throws: File_Therion_SyntaxException
  • Throws: OutOfBoundsException when unknown station is referenced
  • Access: public

Parameters:

array   $lines   —  File_Therion_Line objects forming a centreline

[ Top ]

setAuthor   [line 1317]

void setAuthor( int $year, string $text)

Sets author remark.
  • Access: public

Parameters:

int   $year   — 
string   $text   — 

[ Top ]

setCoordinateSystem   [line 1275]

void setCoordinateSystem( string $cs)

Sets the coordinate system that is used for fixing stations.

Fixing stations coordinates is only meaningful defining a coordinate system for the coordinates given.

  • Access: public

Parameters:

string   $cs   — 

[ Top ]

setCopyright   [line 1296]

void setCopyright( int $year, string $text)

Sets copyright remark.
  • Access: public

Parameters:

int   $year   — 
string   $text   — 

[ Top ]

setDeclination   [line 538]

void setDeclination( float $decl, [string $unit = "degrees"])

Set declination of this centreline.

Wehn $decl is set to NULL, an existing declination is erased.

  • Todo: add parameter checks
  • Access: public

Parameters:

float   $decl   —  Declination angle
string   $unit   —  Unit ("degrees" ...)

[ Top ]

setExtend   [line 1026]

void setExtend( null|string $spec, File_Therion_Station|File_Therion_Shot $stationOrShot)

Modify extend definition of centreline.

This controls how the centreline extended elevation will be rendered.

$spec may be one of the following:

  • "normal"/"reverse"
  • "left"/"right"
  • "vertical"
  • "start"
  • "ignore"
  • "hide"
$stationOrShot is a Station or Shot object. If an extend command for a given object already exists, its $spec will be updated, otherwise added.

  • TODO: 'extends': probably its a good idea to hold the specification at the shot and stastion object and not in the centreline. This is maybe more OO like and easier to understand.
  • Access: public

Parameters:

null|string   $spec   — 
File_Therion_Station|File_Therion_Shot   $stationOrShot   — 

[ Top ]

setGrade   [line 1713]

void setGrade( File_Therion_Grade|array|string|null $grade)

Set grade(s) applying to this centreline.

When $grade is a string, a new empty internal Grade object will be created implicitely. use this to reference grade names already built into therion. When passing an array, you can either pass Grade objects or strings to reference the grade definition names. To delete all grade definitions from the centreline, use NULL as $grade (the empty string works too).

  • Throws: InvalidArgumentException
  • Access: public

Parameters:

File_Therion_Grade|array|string|null   $grade   — 

[ Top ]

setStationNames   [line 849]

void setStationNames( string $prefix, [string $postfix = null])

Set station names pre-/postfix for newly added shots/stations.

Newly added shots stations will receive the new setting. Already present shots will NOT be modified (use to update all shots in this centreline). Use null as lone parameter to disable prefix/postfix. Without active setting, newly, be, rather

  • Access: public

Parameters:

string   $prefix   — 
string   $postfix   — 

[ Top ]

setSurveyContext   [line 1642]

void setSurveyContext( File_Therion_Survey $survey)

Set local survey context of this centreline.

The survey context will be passed to newly added stations and shots. All already present shot stations context will be updated.

  • Throws: InvalidArgumentException
  • Access: public

Parameters:

File_Therion_Survey   $survey   — 

[ Top ]

setUnit   [line 1678]

void setUnit( string $type, null|string|File_Therion_Unit $unit)

Set default unit for shots.

The unit will be used to initialize all newly added shots, if the corresponding unit of that shot is not set so far. If the new shot to be added already has an associated unit, that will take precedence. If you want to change that shot, you need to convert the shot ({@see File_Therion_Shot} for details).

  • Throws: InvalidArgumentException
  • Access: public

Parameters:

string   $type   —  Measurement type ('clino', 'bearing', ...)
null|string|File_Therion_Unit   $unit   —  Unit instance

[ Top ]

stripStationNames   [line 1234]

void stripStationNames( )

Strip station-names from all stations of shots from this centreline.

This strips the individual station prefix/postfix setting of all stations from all shots of this centreline.

You also could call updateShotStationNames() prior calling applyStationNames() to enforce homogenous station-names settings throughout all shots.

  • Todo: test for nullPointerException in case shot station is invalid
  • Access: public

[ Top ]

toLines   [line 1354]

array toLines( )

Generate line content from this object.

When no shot of this centerline bears LRUD information, LRUD fields will be ommitted. To produce explicite LRUD output, you may assign a shot with missing data the explicit missing-data sign "-" as LRUD information.

  • Return: File_Therion_Line objects
  • Todo: finish implementation, implement proper escaping, implement proper declination handling etc
  • Access: public

[ Top ]

updateShotStationNames   [line 1257]

void updateShotStationNames( )

Update station-names setting in all shots of this centreline.

This will overwrite the current prefix/postfix setting of all shot stations in this centreline using File_Therion_Station::setStationNames() on each station. The original name of the stations remain intact.

This can be useful to correct the station prefix/postfix to a common centreline wide setting. Use applyStationNames() to permanently apply the setting.

  • Todo: test for nullPointerException in case shot station is invalid
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:09:45 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.