Class: BoxesFactory

BoxesFactory(viewer)

A class to create and to manage rectangular boxes in the 2D part of YAFITS. A box is basically defined by a pair of opposite corners. Boxes are created and manipulated with the OpenLayers API. In particular the DragBox and Feature classes are used. Boxes style is defined in ShapesFactory
  • Boxes have their side parallels to the image sides (No rotation possible).
  • A method is provided to obtain measurements associated to the collection of pixels contained in a box.

Constructor

new BoxesFactory(viewer)

Creates an instance.
Parameters:
Name Type Description
viewer Viewer instance of the Viewer class that will host the boxes.
Source:

Extends

Members

mode

A mutator defining the kind of subclass.
Overrides:
Source:

Methods

close()

Close this factory. Disable its interaction processor.
Overrides:
Source:

getButtonObject()

Utility. Returns the toolbox button that will activate this instance.
Source:
Returns:
a button

hide()

Hide all the objects created by one subclass. (e.g. all the markers)
Overrides:
Source:

measure(feature, addFeature)

Calculates some measurements associated to the box described in feature. The measurements are stored in an entry "measurements" of feature "properties" property. > The measurements are calculated remotely by the YAFITSS server.
Parameters:
Name Type Default Description
feature Feature the OpenLayers feature expected to represent a box.
addFeature boolean true Deprecated, don't use it.
Source:

open(interaction, cursor)

Behaviour when an instance is activated.
Parameters:
Name Type Description
interaction Interaction
cursor cursor
Overrides:
Source:
See:

prepareBox(iRA0, iRA1, iDEC0, iDEC1) → {Feature}

Creates an OpenLayers feature that describres a box given bottom left and upper right coordinates. A label is automatically generated that will be displayed beside the box.
Parameters:
Name Type Description
iRA0 number lower 1st coordinate
iRA1 * upper 1st coordinate
iDEC0 * lower 2nd coordinate
iDEC1 * upper 2nd coordinate
Source:
Returns:
Type
Feature

remove(feature)

Remove one object created by a subclass.
Parameters:
Name Type Description
feature * the object to remove.
Overrides:
Source:

selected(box)

Behaviour when a box is selected.
Parameters:
Name Type Description
box Feature
Overrides:
Source:

show()

Make visible all the objects created by one subclass. (e.g. all the markers)
Overrides:
Source:

unselected(feature)

Modify the look of feature to show that it's been unselected. ( e.g. display it normally )
Parameters:
Name Type Description
feature an instance created by a subclass.
Overrides:
Source: