bioformats  5.1.8
NavigationDock2D.h
1 /*
2  * #%L
3  * OME-QTWIDGETS C++ library for display of Bio-Formats pixel data and metadata.
4  * %%
5  * Copyright © 2014 - 2016 Open Microscopy Environment:
6  * - Massachusetts Institute of Technology
7  * - National Institutes of Health
8  * - University of Dundee
9  * - Board of Regents of the University of Wisconsin-Madison
10  * - Glencoe Software, Inc.
11  * %%
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are met:
14  *
15  * 1. Redistributions of source code must retain the above copyright notice,
16  * this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright notice,
18  * this list of conditions and the following disclaimer in the documentation
19  * and/or other materials provided with the distribution.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  * The views and conclusions contained in the software and documentation are
34  * those of the authors and should not be interpreted as representing official
35  * policies, either expressed or implied, of any organization.
36  * #L%
37  */
38 
39 #ifndef OME_QTWIDGETS_NAVIGATIONDOCK2D_H
40 #define OME_QTWIDGETS_NAVIGATIONDOCK2D_H
41 
42 #include <ome/bioformats/FormatReader.h>
43 
44 #include <ome/compat/memory.h>
45 
46 #include <ome/qtwidgets/glm.h>
47 #include <ome/qtwidgets/GLWindow.h>
48 #include <ome/qtwidgets/gl/Image2D.h>
49 #include <ome/qtwidgets/gl/Grid2D.h>
50 #include <ome/qtwidgets/gl/Axis2D.h>
51 
52 #include <QtWidgets/QDockWidget>
53 #include <QtWidgets/QLabel>
54 #include <QtWidgets/QSlider>
55 #include <QtWidgets/QSpinBox>
56 
57 namespace ome
58 {
59  namespace qtwidgets
60  {
61 
68  class NavigationDock2D : public QDockWidget
69  {
70  Q_OBJECT
71 
72  public:
73 
81  NavigationDock2D(QWidget *parent = 0);
82 
85 
93  void
94  setReader(ome::compat::shared_ptr<ome::bioformats::FormatReader> reader,
97 
104  plane() const;
105 
106  public slots:
112  void
114 
115  signals:
121  void
123 
124  private slots:
130  void
131  sliderChangedPlane(int plane);
132 
138  void
139  spinBoxChangedPlane(int plane);
140 
146  void
147  sliderChangedDimension(int dim);
148 
154  void
155  spinBoxChangedDimension(int dim);
156 
157  private:
159  ome::compat::shared_ptr<ome::bioformats::FormatReader> reader;
164 
166  QLabel *labels[7];
168  QSlider *sliders[7];
170  QSpinBox *spinboxes[7];
171  };
172 
173  }
174 }
175 
176 #endif // OME_QTWIDGETS_NAVIGATIONDOCK2D_H
177 
178 /*
179  * Local Variables:
180  * mode:C++
181  * End:
182  */
Memory type substitution.
void spinBoxChangedDimension(int dim)
Update the current plane number (from dimension spinbox).
Definition: NavigationDock2D.cpp:305
NavigationDock2D(QWidget *parent=0)
Create a 2D navigation view.
Definition: NavigationDock2D.cpp:88
void setPlane(ome::bioformats::dimension_size_type plane)
Set the current plane for the series.
Definition: NavigationDock2D.cpp:216
~NavigationDock2D()
Destructor.
Definition: NavigationDock2D.cpp:134
void sliderChangedPlane(int plane)
Update the current plane number (from slider).
Definition: NavigationDock2D.cpp:261
void planeChanged(ome::bioformats::dimension_size_type plane)
Signal change of plane.
ome::bioformats::dimension_size_type currentPlane
The image plane.
Definition: NavigationDock2D.h:163
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40
QSpinBox * spinboxes[7]
Numeric entries [NZTCmZmTmC].
Definition: NavigationDock2D.h:170
QSlider * sliders[7]
Sliders [NZTCmZmTmC].
Definition: NavigationDock2D.h:168
QLabel * labels[7]
Slider labels [NZTCmZmTmC].
Definition: NavigationDock2D.h:166
ome::bioformats::dimension_size_type plane() const
Get the current plane for the series.
Definition: NavigationDock2D.cpp:255
void spinBoxChangedPlane(int plane)
Update the current plane number (from spinbox).
Definition: NavigationDock2D.cpp:267
ome::bioformats::dimension_size_type series
The image series.
Definition: NavigationDock2D.h:161
2D dock widget for plane nagivation.
Definition: NavigationDock2D.h:68
std::size_t dimension_size_type
Size type for image dimensions.
Definition: Types.h:59
ome::compat::shared_ptr< ome::bioformats::FormatReader > reader
The image reader.
Definition: NavigationDock2D.h:159
void setReader(ome::compat::shared_ptr< ome::bioformats::FormatReader > reader, ome::bioformats::dimension_size_type series=0, ome::bioformats::dimension_size_type plane=0)
Set reader, including current series and plane position.
Definition: NavigationDock2D.cpp:139
void sliderChangedDimension(int dim)
Update the current plane number (from dimension slider).
Definition: NavigationDock2D.cpp:273