OpenMS
Annotations1DContainer Class Reference

Container for annotations to content of Plot1DCanvas. More...

#include <OpenMS/VISUAL/ANNOTATION/Annotations1DContainer.h>

Inheritance diagram for Annotations1DContainer:
[legend]
Collaboration diagram for Annotations1DContainer:
[legend]

Public Types

using Base = std::list< Annotation1DItem * >
 
using Iterator = Base::iterator
 Iterator for the 1D annotations. More...
 
using ConstIterator = std::list< Annotation1DItem * >::const_iterator
 Const iterator for the 1D annotations. More...
 
using PointType = DPosition< 2 >
 Type of the Points. More...
 
using CoordinateType = double
 Coordinate type. More...
 

Public Member Functions

 Annotations1DContainer ()
 Default constructor. More...
 
 Annotations1DContainer (const Annotations1DContainer &rhs)
 Copy constructor. More...
 
Annotations1DContaineroperator= (const Annotations1DContainer &rhs)
 Assignment operator. More...
 
virtual ~Annotations1DContainer ()
 Destructor. More...
 
Annotation1DItemgetItemAt (const QPoint &pos) const
 Returns a pointer to the item at pos, or 0, if not existent. More...
 
void selectItemAt (const QPoint &pos) const
 Selects the item at pos on the canvas, if it exists. More...
 
void deselectItemAt (const QPoint &pos) const
 Deselects the item at pos on the canvas, if it exists. More...
 
void selectAll ()
 Selects all items. More...
 
void deselectAll ()
 Deselects all items. More...
 
void removeSelectedItems ()
 Removes the selected items. More...
 
std::vector< Annotation1DItem * > getSelectedItems ()
 Returns the selected items. More...
 
void setPen (const QPen &pen)
 Sets the pen_. More...
 
const QPen & getPen () const
 Returns the pen_. More...
 
void setSelectedPen (const QPen &pen)
 Sets the selected_pen_. More...
 
const QPen & getSelectedPen () const
 Returns the selected_pen_. More...
 

Protected Member Functions

void deleteAllItems_ () const
 call delete on all pointers in the container, without modifying the container More...
 

Protected Attributes

QPen pen_
 The pen used to draw items. More...
 
QPen selected_pen_
 The pen used to draw selected items. More...
 

Detailed Description

Container for annotations to content of Plot1DCanvas.

Member Typedef Documentation

◆ Base

using Base = std::list<Annotation1DItem *>

◆ ConstIterator

using ConstIterator = std::list<Annotation1DItem *>::const_iterator

Const iterator for the 1D annotations.

◆ CoordinateType

using CoordinateType = double

Coordinate type.

◆ Iterator

using Iterator = Base::iterator

Iterator for the 1D annotations.

◆ PointType

using PointType = DPosition<2>

Type of the Points.

Constructor & Destructor Documentation

◆ Annotations1DContainer() [1/2]

Default constructor.

◆ Annotations1DContainer() [2/2]

Copy constructor.

◆ ~Annotations1DContainer()

virtual ~Annotations1DContainer ( )
virtual

Destructor.

Member Function Documentation

◆ deleteAllItems_()

void deleteAllItems_ ( ) const
protected

call delete on all pointers in the container, without modifying the container

◆ deselectAll()

void deselectAll ( )

Deselects all items.

◆ deselectItemAt()

void deselectItemAt ( const QPoint &  pos) const

Deselects the item at pos on the canvas, if it exists.

◆ getItemAt()

Annotation1DItem* getItemAt ( const QPoint &  pos) const

Returns a pointer to the item at pos, or 0, if not existent.

If more than one item's bounding box encloses pos , the one in the foreground is returned.

◆ getPen()

const QPen& getPen ( ) const

Returns the pen_.

◆ getSelectedItems()

std::vector<Annotation1DItem*> getSelectedItems ( )

Returns the selected items.

◆ getSelectedPen()

const QPen& getSelectedPen ( ) const

Returns the selected_pen_.

◆ operator=()

Annotations1DContainer& operator= ( const Annotations1DContainer rhs)

Assignment operator.

◆ removeSelectedItems()

void removeSelectedItems ( )

Removes the selected items.

◆ selectAll()

void selectAll ( )

Selects all items.

◆ selectItemAt()

void selectItemAt ( const QPoint &  pos) const

Selects the item at pos on the canvas, if it exists.

◆ setPen()

void setPen ( const QPen &  pen)

Sets the pen_.

◆ setSelectedPen()

void setSelectedPen ( const QPen &  pen)

Sets the selected_pen_.

Member Data Documentation

◆ pen_

QPen pen_
protected

The pen used to draw items.

◆ selected_pen_

QPen selected_pen_
protected

The pen used to draw selected items.