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

Class: File_Therion_Shot

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

Class Overview


Class representing a therion shot object.


Author(s):

Copyright:

  • 2016 Benedikt Hallinger

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 28]
Class representing a therion shot object.

The centreline contains the shots of the survey.



[ Top ]


Class Variables

$_aliases = array(
        'tape'     => 'length',
        'compass'  => 'bearing',
        'clino'    => 'gradient',
        'ceiling'  => 'up',
        'floor'    => 'down'
    )

[line 36]

Known field name aliases
  • Access: protected

Type:   array


[ Top ]

$_data = array(
        'from'      => null, // Station
        'to'        => null, // Station
        'length'    => 0.0,
        'bearing'   => 0.0,
        'gradient'  => 0.0,
        'left'      => null, // possible to have "missing" value for LRUD!
        'right'     => null,
        'up'        => null,
        'down'      => null,
        // more according to thbook
        // Therion book says: station, from, to, tape/length, 
        // [back]compass/[back]bearing, [back]clino/[back]gradient, depth,
        // fromdepth, todepth, depthchange, counter, fromcount, tocount,
        // northing, easting, altitude, up/ceiling, down/floor, left,
        // right, ignore, ignoreall.
    )

[line 89]

Basic normalized data elements.
  • Todo: since the inception of the Unit class, unit-objects could be used as centralised data storage. Changing to this would obsolete setUnit as the unit is implicitely mandatory at the other setters, which then must accept unit objects only. For parsing unspecified units, it would be good to have a "default"(=NULL) type. A change like this would probably break backward compatibility, however...
  • Access: protected

Type:   array


[ Top ]

$_flags = array(
       'surface'     => false,
       'splay'       => false,
       'duplicate'   => false,
       'approximate' => false,
    )

[line 112]

Flags of this shot.
  • Access: protected

Type:   array


[ Top ]

$_order = array(
        'from', 'to', 'length', 'bearing', 'gradient',
        'left', 'right', 'up', 'down'
    )

[line 51]

data definition order for this shot.

This may contain alias names.

  • Access: protected

Type:   array


[ Top ]

$_style =  "normal"

[line 61]

data reading style
  • Access: protected

Type:   string


[ Top ]

$_units = array(
        'length'    => null,
        'bearing'   => null,
        'gradient'  => null,
        'left'      => null,
        'right'     => null,
        'up'        => null,
        'down'      => null
    )

[line 68]

Units definition for normalized fields.
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 140]

File_Therion_Shot __construct( [string|File_Therion_Station $from = null], [string|File_Therion_Station $to = null], [float $length = null], [float $bearing = null], [float $gradient = null])

Create a new therion shot object.

The shot will be initialized with default style, data ordering and units (see $_style, $_order and $_units). If no ordering is specified, the default ordering will be used. If no units are specified, they will remain "unknown", so the system local therion defaults take precedence when generated data is compiled.

You may optionally supply basic shot data using the constructors params. Please refer to the named methods for further information on expected types and formats.

After creating, units, style, ordering and data can be changed/added.

  • Access: public

Parameters:

string|File_Therion_Station   $from   — 
string|File_Therion_Station   $to   — 
float   $length   — 
float   $bearing   — 
float   $gradient   — 

[ Top ]

aliasField   [line 1051]

string aliasField( string $name)

Get alias for normalized field name.
  • Return: alias name
  • Access: public

Parameters:

string   $name   —  alias name

[ Top ]

getAllFlags   [line 323]

array getAllFlags( )

Get all active shot flags.

This returns an associative array of all flags.

  • Access: public

[ Top ]

getBackBearing   [line 962]

float getBackBearing( )

Calculate backwards compass reading.

Result=360 will be reported as 0 (with degrees).

  • Return: between 0 and 360 (when unit is degrees)
  • Todo: implement other units than grad and degree
  • Throws: InvalidArgumentException
  • Access: public

[ Top ]

getBackGradient   [line 998]

float getBackGradient( )

Calculate backwards clino reading.
  • Return: between -90 and 90 (when unit is degrees)
  • Todo: support other units
  • Access: public

[ Top ]

getBearing   [line 537]

int getBearing( )

Get shot compass bearing.
  • Return: between 0 and 360 (when unit is degrees)
  • Access: public

[ Top ]

getDownDimension   [line 611]

float|null getDownDimension( )

Get shot down (height to ground) dimensions.

Returns either float value or NULL for explicitely (ie "-") or implicitely missing data.

  • Access: public

[ Top ]

getFlag   [line 292]

boolean getFlag( string $flag)

Get a shot flag.

Note that the shot is flagged implicitely as splay when one of from- or to-stations name is a dot or dash ('.', '-').

  • Throws: InvalidArgumentException
  • Access: public

Parameters:

string   $flag   —  name of the flag.

[ Top ]

getFrom   [line 507]

File_Therion_Station getFrom( )

Get from (source) station.
  • Return: station object
  • Access: public

[ Top ]

getGradient   [line 547]

float getGradient( )

Get shot gradient.
  • Return: between -90 to 90 (when unit is degrees)
  • Access: public

[ Top ]

getLeftDimension   [line 560]

float|null getLeftDimension( )

Get shot left dimensions.

Returns either float value or NULL for explicitely (ie "-") or implicitely missing data.

  • Access: public

[ Top ]

getLength   [line 527]

float getLength( )

Get shot length.
  • Access: public

[ Top ]

getLRUDdata   [line 1112]

boolean getLRUDdata( )

Get LRUD information compacted.

Returns an array containing LRUD information for all directions.

The array keys are the keywords 'left', 'right', 'up', 'down'.

The value is either:

  • float, if real LRUD is there
  • string "-", if explicite "missing data" was tagged or
  • NULL, if no data was set so far.
This differs to the get*Dimension() methods in that you can query explicitely for "known missing-data" entries.

  • Access: public

[ Top ]

getOrder   [line 371]

array getOrder( [boolean $normalize = false])

Get data definition order of this shot.
  • Return: ordered array with keywords
  • Todo: support diving style
  • Access: public

Parameters:

boolean   $normalize   —  return unaliased field names

[ Top ]

getOrderedData   [line 1064]

array getOrderedData( )

Returns array with data fields ordered by current order.
  • Return: with data elements
  • Access: public

[ Top ]

getRightDimension   [line 577]

float|null getRightDimension( )

Get shot right dimensions.

Returns either float value or NULL for explicitely (ie "-") or implicitely missing data.

  • Access: public

[ Top ]

getStyle   [line 340]

string getStyle( )

Get data definition style of this shot
  • Return: "normal", "diving", etc
  • Access: public

[ Top ]

getTo   [line 517]

File_Therion_Station getTo( )

Get to (targeted) station.
  • Return: station object
  • Access: public

[ Top ]

getUnit   [line 480]

File_Therion_Unit|array getUnit( string $type)

Get current unit for measurement.

Returns the unit definition for this shot field. If it was unset so far, NULL will be returned, indicating that the local therion default should be used for interpreting the data.

  • Return: Unit object or associative array of unit objects
  • Access: public

Parameters:

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

[ Top ]

getUpDimension   [line 594]

float|null getUpDimension( )

Get shot up (height to ceiling) dimensions.

Returns either float value or NULL for explicitely (ie "-") or implicitely missing data.

  • Access: public

[ Top ]

hasSplayStation   [line 1083]

boolean hasSplayStation( )

Tell if this shot is a splay shot due to naming conventions.

If the from-station or to-station are named with a dot or dash, then splay flag is assumed.

  • Access: public

[ Top ]

parse   [line 162]

File_Therion_Shot parse( array $data, array $order, [array $units = array()])

Parse string content into a shot object using ordering information.
  • Return: shot object
  • Todo: implement more fields (currently just basic normal data fields)
  • Throws: InvalidArgumentException
  • Throws: File_Therion_SyntaxException
  • Access: public

Parameters:

array   $data   —  datafields to parse
array   $order   —  therion names of datafields in correct order
array   $units   —  associative unit settings (type=>unit)

[ Top ]

reverse   [line 1015]

void reverse( )

Swap direction of measurement of this shot.

This will swap the from and to stations and adjust bearing and gradient.

  • Access: public

[ Top ]

setBearing   [line 692]

void setBearing( float $bearing)

Set shot compass bearing.
  • Todo: support other units than degrees and grad
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

float   $bearing   —  between 0 and 360 (when unit was grad)

[ Top ]

setDownDimension   [line 831]

void setDownDimension( float|string|null $down)

Set shot down (height to ground) dimensions.

Use "-" to indicate missing value or NULL to clear data.

  • Access: public

Parameters:

float|string|null   $down   —  distance to passage ground

[ Top ]

setFlag   [line 268]

void setFlag( string $flag, [boolean $value = true])

Set shot flag.
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

string   $flag   —  name of the flag.
boolean   $value   —  true/false

[ Top ]

setFrom   [line 635]

void setFrom( string|File_Therion_Station $station)

Set from (source) station.

When station name is "-" or ".", then the splay flag is set implicitely. If the passed argument is string, a new station object will be created.

  • Access: public

Parameters:

string|File_Therion_Station   $station   — 

[ Top ]

setGradient   [line 731]

void setGradient( float $gradient)

Set shot gradient.
  • Todo: support other units than grad
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

float   $gradient   —  between -90 to 90 (when unit was grad)

[ Top ]

setLeftDimension   [line 768]

void setLeftDimension( floats|tring|null $left)

Set shot left dimensions.

Use "-" to indicate missing value.

  • Access: public

Parameters:

floats|tring|null   $left   —  Distance to left wall

[ Top ]

setLength   [line 672]

void setLength( float $length)

Set shot length.
  • Access: public

Parameters:

float   $length   — 

[ Top ]

setOrder   [line 390]

void setOrder( array $order)

Set data definition order of this shot.
  • Todo: support diving style
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

array   $order   —  therion names of datafields in correct order

[ Top ]

setRightDimension   [line 789]

void setRightDimension( float|string|null $right)

Set shot right dimensions.

Use "-" to indicate missing value or NULL to clear data.

  • Access: public

Parameters:

float|string|null   $right   —  distance to right wall

[ Top ]

setStyle   [line 353]

void setStyle( string $style)

Set data definition style of this shot
  • Todo: support other styles besides "normal"
  • Throws: InvalidArgumentException when style is unknown
  • Access: public

Parameters:

string   $style   —  "normal", "diving", etc

[ Top ]

setTo   [line 655]

void setTo( string|File_Therion_Station $station)

Set to (targeted) station.

When station name is "-" or ".", then the splay flag is set implicitely. If the passed argument is string, a new station object will be created.

  • Access: public

Parameters:

string|File_Therion_Station   $station   — 

[ Top ]

setUnit   [line 425]

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

Set unit for measurements of this shot.
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

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

[ Top ]

setUpDimension   [line 810]

void setUpDimension( float|string|null $up)

Set shot up (height to ceiling) dimensions.

Use "-" to indicate missing value or NULL to clear data.

  • Access: public

Parameters:

float|string|null   $up   —  distance to ceiling.

[ Top ]

toLines   [line 858]

File_Therion_Line toLines( [boolean $fsn = false])

Return formatted datafields as Therion Line in current order.

If $fsn is set to true, the full station name will be reported. By default, only the unprefixed name is reported. The reason is, that toLines() is expected to be called in context of a centreline that will take care of reporting valid station-names commands prior exporting a shot.

  • Return: containing data items
  • Access: public

Parameters:

boolean   $fsn   —  switch reporting of sation names

[ Top ]

toLinesDataDef   [line 900]

File_Therion_Line toLinesDataDef( )

Return formatted datadefinition as Therion Line.
  • Return: containing "data normal x y z ..."
  • Access: public

[ Top ]

toLinesUnitsDef   [line 920]

array toLinesUnitsDef( )

Return formatted units definitions for data defintion as Therion Line(s).

In default mode, only units deviating from the therion default are reported. Currently that is meters for lengths and degrees for angles. If no default unit was changed, an empty array is returned. Otherwise (or if $all was selected) Lines will be generated.

  • Return: with File_Therion_Line objects (or empty)
  • Todo: support unit factor: string like "units clino [factor] degrees"
  • Access: public

[ Top ]

unaliasField   [line 1037]

string unaliasField( string $alias)

Resolve field name alias to normalized name.
  • Return: normalized name
  • Access: public

Parameters:

string   $alias   —  alias name

[ Top ]


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