Layer Class Reference

Services to adjust characteristics of layers. More...

#include <Layer.h>

Inheritance diagram for Layer:

Inheritance graph

List of all members.

Public Member Functions

virtual std::list
< ContextMenuAction
getContextMenuActions () const =0
virtual LayerType getLayerType () const =0
virtual DataElementgetDataElement () const =0
virtual bool hasUniqueElement () const =0
virtual ViewgetView () const =0
virtual bool linkLayer (Layer *pLayer)=0
virtual void getLinkedLayers (std::vector< Layer * > &linkedLayers) const =0
virtual bool isLayerLinked (Layer *pLayer) const =0
virtual bool unlinkLayer (Layer *pLayer)=0
virtual Layercopy (const std::string &layerName=std::string(), bool bCopyElement=false, DataElement *pElement=NULL) const =0
virtual bool getExtents (double &minX, double &minY, double &maxX, double &maxY)=0
virtual void setXScaleFactor (double xScaleFactor)=0
virtual double getXScaleFactor () const =0
virtual void setYScaleFactor (double yScaleFactor)=0
virtual double getYScaleFactor () const =0
virtual double getXOffset () const =0
virtual void setXOffset (double xOffset)=0
virtual double getYOffset () const =0
virtual void setYOffset (double yOffset)=0
virtual void translateWorldToData (double worldX, double worldY, double &dataX, double &dataY) const =0
virtual void translateDataToWorld (double dataX, double dataY, double &worldX, double &worldY) const =0
virtual void translateScreenToData (double screenX, double screenY, double &dataX, double &dataY) const =0
virtual void translateDataToScreen (double dataX, double dataY, double &screenX, double &screenY) const =0
virtual void isFlipped (const LocationType &dataLowerLeft, const LocationType &dataUpperRight, bool &bHorizontalFlip, bool &bVerticalFlip) const =0
virtual bool rename (const std::string &newName)=0

Static Public Member Functions

static const std::string & signalNameChanged ()
static const std::string & signalExtentsModified ()

Protected Member Functions

virtual ~Layer ()


Detailed Description

Services to adjust characteristics of layers.

This abstract base class provides access to properties for all layers that can be displayed in a layer list. This class contains accessor methods to set and get the layer name, and each subclass contains accessor methods specific to the layer type.

This subclass of Subject will notify upon the following conditions:

See also:
LayerList

Definition at line 42 of file Layer.h.


Constructor & Destructor Documentation

virtual Layer::~Layer (  )  [protected, virtual]

This should be destroyed by calling SpatialDataView::deleteLayer.

Definition at line 386 of file Layer.h.


Member Function Documentation

static const std::string& Layer::signalNameChanged (  )  [static]

Emitted with any<std::string> when the layer name changes.

Definition at line 48 of file Layer.h.

static const std::string& Layer::signalExtentsModified (  )  [static]

Emitted when the layer extents change.

Definition at line 53 of file Layer.h.

virtual std::list<ContextMenuAction> Layer::getContextMenuActions (  )  const [pure virtual]

Returns the context menu actions available for this session item.

Returns:
The list of context menu actions that should be displayed when the user right-clicks on a widget displaying or containing the session item.
See also:
ContextMenuAction

Default Implementation:
The default implementation returns the context menu actions listed here.

Implements SessionItem.

Implemented in RasterLayer.

virtual LayerType Layer::getLayerType (  )  const [pure virtual]

Returns the layer type.

Returns:
The layer type.

virtual DataElement* Layer::getDataElement (  )  const [pure virtual]

Returns the associated data element.

Returns:
The data element upon which the layer is based.

virtual bool Layer::hasUniqueElement (  )  const [pure virtual]

Determine if the DataElement within the Layer is unique to all layers.

Returns:
True if this is the only layer with the given DataElement, false otherwise.

virtual View* Layer::getView (  )  const [pure virtual]

Returns the view in which the layer is displayed.

Returns:
A pointer to the view in which the layer is displayed. NULL is returned if the layer is not displayed in a view.

virtual bool Layer::linkLayer ( Layer pLayer  )  [pure virtual]

Links a layer with this layer.

This method establishes a link between this layer and another layer. Linked layers are linked by action. Setting properties in a layer sets the same property values in linked layers.

Parameters:
pLayer The layer to link with this layer. Cannot be NULL and must be of the same layer type as this layer.
Returns:
true if the layer was successfully linked with this layer, otherwise false.

virtual void Layer::getLinkedLayers ( std::vector< Layer * > &  linkedLayers  )  const [pure virtual]

Retrieves layers linked with this layer.

Parameters:
linkedLayers A reference to a vector that is populated with pointers to layers linked with this layer. If no layers are linked, the vector is emptied.

virtual bool Layer::isLayerLinked ( Layer pLayer  )  const [pure virtual]

Queries whether a layer is linked with this layer.

Parameters:
pLayer The layer to query for linkage with this layer.
Returns:
true if the layer is linked with this layer; otherwise false.

virtual bool Layer::unlinkLayer ( Layer pLayer  )  [pure virtual]

Breaks the link between this layer and a given layer.

Parameters:
pLayer The layer to unlink with this layer. Cannot be NULL.
Returns:
true if the layer was successfully unlinked with this layer; otherwise false.

virtual Layer* Layer::copy ( const std::string &  layerName = std::string(),
bool  bCopyElement = false,
DataElement pElement = NULL 
) const [pure virtual]

Creates a new layer with the same settings and properties as this layer.

Parameters:
layerName The name for the new layer. If an empty string is passed in the name of this layer is used for the new layer.
bCopyElement Set this value to true to make a copy of this layer's element. Set this value to false to use this layer's element in the new layer.
pElement If the element is also copied, this is the parent of the new element. If the element is not being copied, this parameter is ignored.
Warning:
When copying Annotation and AOI layers, the data element is always copied so a new layer name or a parent element should be passed in. If the layer name is empty and an Annotation or AOI element cannot be created because one already exists, the element will be created with a GUID as a name. The layer name will be the name of this layer.
Returns:
A pointer to the new layer. NULL is returned if an error occurs.

virtual bool Layer::getExtents ( double &  minX,
double &  minY,
double &  maxX,
double &  maxY 
) [pure virtual]

Retrieves the layer extents in world coordinates.

Layer extents are defined as the pixel coordinate range of all data in the data element being displayed by the layer. The populated extent coordinates already account for layer scaling and offset values.

Parameters:
minX The minimum coordinate value of the layer in the X dimension.
minY The minimum coordinate value of the layer in the Y dimension.
maxX The maximum coordinate value of the layer in the X dimension.
maxY The maximum coordinate value of the layer in the Y dimension.
Returns:
Returns true if the extents of the layer were successfully retrieved; otherwise returns false.
See also:
View::getExtents()

virtual void Layer::setXScaleFactor ( double  xScaleFactor  )  [pure virtual]

Sets the X-dimension scale factor when drawing.

Any scaling is applied before the offset is applied.

Parameters:
xScaleFactor The factor by which the pixels in the X-dimension are scaled while drawing. If this value is negative or zero, this method does nothing.
Subject Notifications:
This method will notify signalExtentsModified() if the scale factor value changes.

virtual double Layer::getXScaleFactor (  )  const [pure virtual]

Returns the X-dimension scale factor when drawing.

Any scaling is applied before the offset is applied.

Returns:
The factor by which the pixels in the X-dimension are scaled while drawing.

virtual void Layer::setYScaleFactor ( double  yScaleFactor  )  [pure virtual]

Sets the Y-dimension scale factor when drawing.

Any scaling is applied before the offset is applied.

Parameters:
yScaleFactor The factor by which the pixels in the Y-dimension are scaled while drawing. If this value is negative or zero, this method does nothing.
Subject Notifications:
This method will notify signalExtentsModified() if the scale factor value changes.

virtual double Layer::getYScaleFactor (  )  const [pure virtual]

Returns the Y-dimension scale factor when drawing.

Any scaling is applied before the offset is applied.

Returns:
The factor by which the pixels in the Y-dimension are scaled while drawing.

virtual double Layer::getXOffset (  )  const [pure virtual]

Get the X-coordinate offset from the view's coordinate system.

Offsets are applied after scale factors.

Returns:
The X offset.

virtual void Layer::setXOffset ( double  xOffset  )  [pure virtual]

Set the X-coordinate offset from the view's coordinate system.

Offsets are applied after scale factors.

Parameters:
xOffset The X offset.
Subject Notifications:
This method will notify signalExtentsModified.

virtual double Layer::getYOffset (  )  const [pure virtual]

Get the Y-coordinate offset from the view's coordinate system.

Offsets are applied after scale factors.

Returns:
The Y offset.

virtual void Layer::setYOffset ( double  yOffset  )  [pure virtual]

Set the Y-coordinate offset from the view's coordinate system.

Offsets are applied after scale factors.

Parameters:
yOffset The Y offset.
Subject Notifications:
This method will notify signalExtentsModified.

virtual void Layer::translateWorldToData ( double  worldX,
double  worldY,
double &  dataX,
double &  dataY 
) const [pure virtual]

Translate from world coordinates to data coordinates for this layer.

Parameters:
worldX The x-coordinate to translate from.
worldY The y-coordinate to translate from.
dataX The x-coordinate to translate to.
dataY The y-coordinate to translate to.

virtual void Layer::translateDataToWorld ( double  dataX,
double  dataY,
double &  worldX,
double &  worldY 
) const [pure virtual]

Translate from data coordinates to world coordinates for this layer.

Parameters:
dataX The x-coordinate to translate from.
dataY The y-coordinate to translate from.
worldX The x-coordinate to translate to.
worldY The y-coordinate to translate to.

virtual void Layer::translateScreenToData ( double  screenX,
double  screenY,
double &  dataX,
double &  dataY 
) const [pure virtual]

Translate from screen coordinates to data coordinates for this layer.

Parameters:
screenX The x-coordinate to translate from.
screenY The y-coordinate to translate from.
dataX The x-coordinate to translate to.
dataY The y-coordinate to translate to.
See also:
View::translateScreenToWorld, translateWorldToData

virtual void Layer::translateDataToScreen ( double  dataX,
double  dataY,
double &  screenX,
double &  screenY 
) const [pure virtual]

Translate from data coordinates to screen coordinates for this layer.

Parameters:
dataX The x-coordinate to translate from.
dataY The y-coordinate to translate from.
screenX The x-coordinate to translate to.
screenY The y-coordinate to translate to.
See also:
translateDataToWorld, View::translateWorldToScreen

virtual void Layer::isFlipped ( const LocationType dataLowerLeft,
const LocationType dataUpperRight,
bool &  bHorizontalFlip,
bool &  bVerticalFlip 
) const [pure virtual]

Queries whether the layer's data coordinate system is flipped from the screen coordinate system.

Parameters:
dataLowerLeft A lower left data coordinate for which to perform the data-to-screen transformation.
dataUpperRight An upper right data coordinate for which to perform the data-to-screen transformation.
bHorizontalFlip This parameter is set to true if the data coordinate system is flipped about the y-axis relative to the screen coordinate system; otherwise the parameter is set to false.
bVerticalFlip This parameter is set to true if the data coordinate system is flipped about the x-axis relative to the screen coordinate system; otherwise the parameter is set to false.
See also:
translateDataToScreen()

virtual bool Layer::rename ( const std::string &  newName  )  [pure virtual]

Renames the layer to a given name.

Parameters:
newName The new name for the layer, which must be unique within the layer list for the layer type. This method does nothing and returns false if an empty string is passed in.
Returns:
Returns true if the layer was successfully renamed. Returns false if another layer of the same type in the layer list already has the given name.
See also:
LayerList::renameLayer()


Software Development Kit - Opticks 4.9.0 Build 16218