bioformats  5.1.0
NavigationDock2D.h
1 /*
2  * #%L
3  * OME-QTWIDGETS C++ library for display of Bio-Formats pixel data and metadata.
4  * %%
5  * Copyright © 2014 - 2015 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/GLWindow.h>
47 #include <ome/qtwidgets/gl/Image2D.h>
48 #include <ome/qtwidgets/gl/Grid2D.h>
49 #include <ome/qtwidgets/gl/Axis2D.h>
50 
51 #include <QtWidgets/QDockWidget>
52 #include <QtWidgets/QLabel>
53 #include <QtWidgets/QSlider>
54 #include <QtWidgets/QSpinBox>
55 
56 #include <glm/glm.hpp>
57 
58 namespace ome
59 {
60  namespace qtwidgets
61  {
62 
69  class NavigationDock2D : public QDockWidget
70  {
71  Q_OBJECT
72 
73  public:
74 
82  NavigationDock2D(QWidget *parent = 0);
83 
86 
94  void
95  setReader(ome::compat::shared_ptr<ome::bioformats::FormatReader> reader,
98 
105  plane() const;
106 
107  public slots:
113  void
115 
116  signals:
122  void
124 
125  private slots:
131  void
132  sliderChangedPlane(int plane);
133 
139  void
140  spinBoxChangedPlane(int plane);
141 
147  void
148  sliderChangedDimension(int dim);
149 
155  void
156  spinBoxChangedDimension(int dim);
157 
158  private:
160  ome::compat::shared_ptr<ome::bioformats::FormatReader> reader;
165 
167  QLabel *labels[7];
169  QSlider *sliders[7];
171  QSpinBox *spinboxes[7];
172  };
173 
174  }
175 }
176 
177 #endif // OME_QTWIDGETS_NAVIGATIONDOCK2D_H
178 
179 /*
180  * Local Variables:
181  * mode:C++
182  * End:
183  */
Memory type substitution.
void spinBoxChangedDimension(int dim)
Update the current plane number (from dimension spinbox).
Definition: NavigationDock2D.cpp:310
NavigationDock2D(QWidget *parent=0)
Create a 2D navigation view.
Definition: NavigationDock2D.cpp:93
void setPlane(ome::bioformats::dimension_size_type plane)
Set the current plane for the series.
Definition: NavigationDock2D.cpp:221
~NavigationDock2D()
Destructor.
Definition: NavigationDock2D.cpp:139
void sliderChangedPlane(int plane)
Update the current plane number (from slider).
Definition: NavigationDock2D.cpp:266
void planeChanged(ome::bioformats::dimension_size_type plane)
Signal change of plane.
ome::bioformats::dimension_size_type currentPlane
The image plane.
Definition: NavigationDock2D.h:164
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40
QSpinBox * spinboxes[7]
Numeric entries [NZTCmZmTmC].
Definition: NavigationDock2D.h:171
QSlider * sliders[7]
Sliders [NZTCmZmTmC].
Definition: NavigationDock2D.h:169
QLabel * labels[7]
Slider labels [NZTCmZmTmC].
Definition: NavigationDock2D.h:167
ome::bioformats::dimension_size_type plane() const
Get the current plane for the series.
Definition: NavigationDock2D.cpp:260
void spinBoxChangedPlane(int plane)
Update the current plane number (from spinbox).
Definition: NavigationDock2D.cpp:272
ome::bioformats::dimension_size_type series
The image series.
Definition: NavigationDock2D.h:162
2D dock widget for plane nagivation.
Definition: NavigationDock2D.h:69
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:160
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:144
void sliderChangedDimension(int dim)
Update the current plane number (from dimension slider).
Definition: NavigationDock2D.cpp:278