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

Class: File_Therion_ScrapArea

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

Class Overview

File_Therion_BasicObject
   |
   --File_Therion_ScrapArea

Class representing a scrap area definition 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 28]
Class representing a scrap area definition object.

This is a vector graphic element that is used to form a renderable cavemap. Scrap lines may form the borders of an area in the map.



[ Top ]


Class Variables

$_data = array(
        'type'       => "",
        'place'      => "",
        'clip'       => "",
        'visibility' => ""
    )

[line 46]

Basic data elements.
  • Access: protected

Type:   array


[ Top ]

$_lines = array()

[line 58]

Line references forming this area borders.
  • Var: of strings
  • Access: protected

Type:   array


[ Top ]

$_options = array(
        // NO OPTIONS SUPPORT FOR AREA BY THERION!
    )

[line 37]

Object options (title, ...).
  • Var: assoc array
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]



Method Detail

__construct (Constructor)   [line 68]

File_Therion_ScrapArea __construct( string $type, [array $lines = array()])

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

Parameters:

string   $type   —  Area type
array   $lines   —  Ordered array of strings|File_Therion_ScrapLine objects

[ Top ]

addLine   [line 234]

void addLine( string|File_Therion_ScrapLine $line, [int $index = -1], [bool $replace = false])

Add a scrap line reference to this area.

The optional index parameter allows to adjust the insertion point; the line will be inserted at the index, pushing already present content one line down (-1=end, 0=start, ...). When replacing, the selected index will be replaced.

Instead of $index 0 and -1 you can use the strings 'start'/'end', this will make your code more readable. Using

  1. addLine(...$lln - 1)
will use logical line number instead of the index (logical = index+1).

When adding a File_Therion_ScrapLine object, the scraps -id option will be used as reference. To resolve the line objects using a given scrap object, use dereferenceLines().

Note that for therion line ordering matters. See the therion documentation for more details.

  • Throws: OutOfBoundsException when requested index is not available
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

string|File_Therion_ScrapLine   $line   —  ScrapLine to reference
int   $index   —  At which logical position to add (-1=end, 0=first line, ...)
bool   $replace   —  when true, the target line will be overwritten

[ Top ]

clearLines   [line 330]

void clearLines( )

Clear referenced lines from this area.
  • Access: public

[ Top ]

dereferenceLines   [line 346]

array dereferenceLines( File_Therion_Scrap $scrap)

Dereference line reference using given scrap.

This will try to get the line objects by reference out of the scrap provided.

  • Return: of File_Therion_ScrapLine objects
  • Todo: Implement me please
  • Access: public

Parameters:

File_Therion_Scrap   $scrap   —  Scrap used for lookup of line references

[ Top ]

getLines   [line 321]

array getLines( )

Get referenced lines.
  • Return: of string-referenced object id's
  • Access: public

[ Top ]

getOption   [line 373]

Always getOption( $option)

Options with area objects are not supported by therion.
  • Return: throws File_Therion_SyntaxException when called.
  • Throws: File_Therion_SyntaxException because options are not allowed.
  • Access: public

Overrides File_Therion_BasicObject::getOption() (Get option of this object.)

Parameters:

   $option   — 

[ Top ]

getType   [line 201]

string getType( )

Get area type.
  • Access: public

[ Top ]

parse   [line 90]

File_Therion_ScrapArea parse( array $lines)

Parses given Therion_Line-objects into internal data structures.

Note that this will create new File_Therion_ScrapLine-objects that are not the same as in the associated scrap.

  • Return: ScrapArea object
  • Throws: InvalidArgumentException
  • Throws: File_Therion_SyntaxException
  • Access: public

Parameters:

array   $lines   —  File_Therion_Line objects forming this object

[ Top ]

setOption   [line 362]

Always setOption( $option, [ $value = null])

Options with area objects are not supported by therion.
  • Return: throws File_Therion_SyntaxException when called.
  • Throws: File_Therion_SyntaxException because options are not allowed.
  • Access: public

Overrides File_Therion_BasicObject::setOption() (Set options of this object.)

Parameters:

   $option   — 
   $value   — 

[ Top ]

setType   [line 191]

void setType( string $type)

Set type of area.
  • Access: public

Parameters:

string   $type   — 

[ Top ]


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