anatomist 6.0.4
3D neuroimaging data viewer
anatomist::MiniPaletteWidget Class Reference

MiniPaletteWidget. More...

#include <anatomist/color/minipalette.h>

Inheritance diagram for anatomist::MiniPaletteWidget:
Collaboration diagram for anatomist::MiniPaletteWidget:

Signals

void rangeChanged (double, double)
 signal emitted when the zoom range has changed (after a mouse wheel event, typically)
 
void paletteClicked ()
 signal emitted when the palete view is clicked, and click_to_edit mode is disabled.
 

Public Member Functions

 MiniPaletteWidget (AObject *object=0, int dim=0, bool allow_edit=true, bool self_parent=true, QWidget *edit_parent=0, bool click_to_edit=true, bool auto_range=false, bool with_view=true)
 Parameters:
 
virtual ~MiniPaletteWidget ()
 
AObjectgetObject ()
 
void setObject (AObject *obj, int dim=0)
 set or change the observed object, dim is the texture dimension observed
 
void allowEdit (bool allow, bool self_parent=true, QWidget *edit_parent=0)
 Enalbes or disable the edition capabilities.
 
void setRange (double min1, double max1)
 set the view range in object values
 
void updateDisplay ()
 redraws the palette view
 
void clear ()
 
void showEditor ()
 pops up the editor, if the edition is allowed
 
void hideEditor ()
 
MiniPaletteGraphicsminiPaletteGraphics ()
 
QGraphicsView * graphicsView ()
 
int observedDimension () const
 
std::pair< double, double > range () const
 

Protected Slots

void gvReleased (QMouseEvent *event)
 
void editorClosed ()
 

Protected Member Functions

void resizeEvent (QResizeEvent *event)
 
void focusInEvent (QFocusEvent *event)
 
void focusOutEvent (QFocusEvent *event)
 
void enterEvent (QEvent *event)
 
void leaveEvent (QEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 
void wheelEvent (QWheelEvent *event)
 

Detailed Description

MiniPaletteWidget.

It provides a small sized palette widget which can be used both to display the palette in a GUI, and to edit the palette range (optionally).

The palette view displayes the palette assigned to an object, and the view may be zoomed to a given values range.

The palatte may be zoomed in/out using the mouse wheel. This action will not change the palette settings, but only the view displayed.

Edition is possible if enabled, either using the allow_edit constructor parameter, or using the method :meth:allow_edit.

Edition is triggered in 2 modes:

  • if click_to_edit is True (the default), a click on the palette will open the editor mode.
  • otherwise a mouse hover will open it, and it will be closed when the mouse leaves the editor, without the need for a user click.

The edition mode opens a popup frameless widget, with sliders.

See also
MiniPaletteWidgetTranscient.

Definition at line 110 of file minipalette.h.

Constructor & Destructor Documentation

◆ MiniPaletteWidget()

anatomist::MiniPaletteWidget::MiniPaletteWidget ( AObject * object = 0,
int dim = 0,
bool allow_edit = true,
bool self_parent = true,
QWidget * edit_parent = 0,
bool click_to_edit = true,
bool auto_range = false,
bool with_view = true )

Parameters:

object: AObject or null object to display or edit the palette for dim: int texture dimension of the object allow_edit: bool if True, an editor will popup, either by clicking on the widget, or by "hovering" it if click_to_edit is False. self_parent: bool if true, the edit parent (see edit_parent) will be the MiniPaletteWidget, this. edit_parent: QWidget or 0 the parent widget passed to the editor widget, if edition is allowed. If in self_parent mode, this valus is not used. click_to_edit: bool if False, the edition widget will popup as soon as the mouse cursor passes over the palette widget, without clicking. If True, only a user click will open the editor window. auto_range: bool For edition mode, allow the auto-zoom mode when palette range is modified. with_view: bool if false, the palette view will not be displayed.

◆ ~MiniPaletteWidget()

virtual anatomist::MiniPaletteWidget::~MiniPaletteWidget ( )
virtual

Member Function Documentation

◆ allowEdit()

void anatomist::MiniPaletteWidget::allowEdit ( bool allow,
bool self_parent = true,
QWidget * edit_parent = 0 )

Enalbes or disable the edition capabilities.

Parameters

allow: bool if True, an editor will popup, either by clicking on the widget, or by "hovering" it if click_to_edit is False. self_parent: bool if true, the edit parent (see edit_parent) will be the MiniPaletteWidget, this. edit_parent: QWidget or 0 the parent widget passed to the editor widget, if edition is allowed. If in self_parent mode, this valus is not used.

◆ clear()

void anatomist::MiniPaletteWidget::clear ( )

◆ editorClosed

void anatomist::MiniPaletteWidget::editorClosed ( )
protectedslot

◆ enterEvent()

void anatomist::MiniPaletteWidget::enterEvent ( QEvent * event)
protected

◆ focusInEvent()

void anatomist::MiniPaletteWidget::focusInEvent ( QFocusEvent * event)
protected

◆ focusOutEvent()

void anatomist::MiniPaletteWidget::focusOutEvent ( QFocusEvent * event)
protected

◆ getObject()

AObject * anatomist::MiniPaletteWidget::getObject ( )

◆ graphicsView()

QGraphicsView * anatomist::MiniPaletteWidget::graphicsView ( )

◆ gvReleased

void anatomist::MiniPaletteWidget::gvReleased ( QMouseEvent * event)
protectedslot

◆ hideEditor()

void anatomist::MiniPaletteWidget::hideEditor ( )

◆ leaveEvent()

void anatomist::MiniPaletteWidget::leaveEvent ( QEvent * event)
protected

◆ miniPaletteGraphics()

MiniPaletteGraphics * anatomist::MiniPaletteWidget::miniPaletteGraphics ( )

◆ mouseReleaseEvent()

void anatomist::MiniPaletteWidget::mouseReleaseEvent ( QMouseEvent * event)
protected

◆ observedDimension()

int anatomist::MiniPaletteWidget::observedDimension ( ) const

◆ paletteClicked

void anatomist::MiniPaletteWidget::paletteClicked ( )
signal

signal emitted when the palete view is clicked, and click_to_edit mode is disabled.

◆ range()

std::pair< double, double > anatomist::MiniPaletteWidget::range ( ) const

◆ rangeChanged

void anatomist::MiniPaletteWidget::rangeChanged ( double ,
double  )
signal

signal emitted when the zoom range has changed (after a mouse wheel event, typically)

◆ resizeEvent()

void anatomist::MiniPaletteWidget::resizeEvent ( QResizeEvent * event)
protected

◆ setObject()

void anatomist::MiniPaletteWidget::setObject ( AObject * obj,
int dim = 0 )

set or change the observed object, dim is the texture dimension observed

◆ setRange()

void anatomist::MiniPaletteWidget::setRange ( double min1,
double max1 )

set the view range in object values

◆ showEditor()

void anatomist::MiniPaletteWidget::showEditor ( )

pops up the editor, if the edition is allowed

◆ updateDisplay()

void anatomist::MiniPaletteWidget::updateDisplay ( )

redraws the palette view

◆ wheelEvent()

void anatomist::MiniPaletteWidget::wheelEvent ( QWheelEvent * event)
protected

The documentation for this class was generated from the following file: