~ubuntu-branches/ubuntu/trusty/guiqwt/trusty

« back to all changes in this revision

Viewing changes to guiqwt/interfaces.py

  • Committer: Bazaar Package Importer
  • Author(s): Picca Frédéric-Emmanuel
  • Date: 2011-04-07 22:41:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110407224150-kkhppnq7rp2c8b3c
Tags: 2.1.0-1
* Imported Upstream version 2.1.0
* debian/patches/
  - 0001-features-01_bts614083.patch (delete)
  - 0001-feature-fix-the-documentation-build.patch (new)
* add and install the sift desktop file
* recommends python-dicom (Closes: #621421)
  thanks Junqian Gordon Xu for the report

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    pass
46
46
 
47
47
class IVoiImageItemType(IItemType):
48
 
    """An image with with set_lut_range, get_lut_range"""
 
48
    """An image with set_lut_range, get_lut_range"""
49
49
    def set_lut_range(self, lut_range):
50
50
        pass
51
51
 
61
61
        """Get maximum range for this dataset"""
62
62
        return 0.,255.
63
63
 
 
64
class IColormapImageItemType(IItemType):
 
65
    """An image with an associated colormap"""
 
66
    pass
 
67
 
 
68
class IExportROIImageItemType(IItemType):
 
69
    """An image with export_roi"""
 
70
    def export_roi(self, src_rect, dst_rect, dst_image, apply_lut=False):
 
71
        pass
 
72
 
 
73
class IStatsImageItemType(IItemType):
 
74
    """An image supporting stats computations"""
 
75
    def get_stats(self, x0, y0, x1, y1):
 
76
        """Return formatted string with stats on image rectangular area
 
77
        (output should be compatible with AnnotatedShape.get_infos)"""
 
78
        return dict()
 
79
 
64
80
class ICSImageItemType(IItemType):
65
 
    """An image with cross section methods implemented"""
 
81
    """An image supporting X/Y cross sections"""
66
82
    def get_xsection(self, y0, apply_lut=False):
67
83
        """Return cross section along x-axis at y=y0"""
68
84
        assert isinstance(y0, (float, int))
81
97
        """Return average cross section along y-axis"""
82
98
        return np.array([])
83
99
 
84
 
class IColormapImageItemType(IItemType):
85
 
    """An image with an associated colormap"""
86
 
    pass
87
 
 
88
100
class IShapeItemType(IItemType):
89
101
    """A shape (annotation)"""
90
102
    pass
101
113
class IBasePlotItem(object):
102
114
    """
103
115
    This is the interface that QwtPlotItem objects must implement
104
 
    to be handled by *EnhancedQwtPlot* widgets
 
116
    to be handled by *BasePlot* widgets
105
117
    """
106
118
    selected = False # True if this item is selected
107
119
    _readonly = False
 
120
    _private = False
108
121
    _can_select = True # Indicate this item can be selected
109
122
    _can_move = True
110
123
    _can_resize = True
133
146
    def is_readonly(self):
134
147
        """Return object readonly state"""
135
148
        return self._readonly
 
149
        
 
150
    def set_private(self, state):
 
151
        """Set object as private"""
 
152
        self._private = state
 
153
        
 
154
    def is_private(self):
 
155
        """Return True if object is private"""
 
156
        return self._private
136
157
 
137
158
    def select(self):
138
159
        """
181
202
        """
182
203
        pass
183
204
    
184
 
    def move_local_point_to(self, handle, pos ):
185
 
        """Move a handle as returned by hit_test to the new position pos"""
 
205
    def move_local_point_to(self, handle, pos, ctrl=None):
 
206
        """Move a handle as returned by hit_test to the new position pos
 
207
        ctrl: True if <Ctrl> button is being pressed, False otherwise"""
186
208
        pass
187
209
 
188
210
    def move_local_shape(self, old_pos, new_pos):
192
214
        """
193
215
        pass
194
216
        
195
 
    def move_with_selection(self, dx, dy):
 
217
    def move_with_selection(self, delta_x, delta_y):
196
218
        """
197
219
        Translate the shape together with other selected items
198
 
        dx, dy: translation in plot coordinates
 
220
        delta_x, delta_y: translation in plot coordinates
199
221
        """
200
222
        pass
201
223
 
222
244
        
223
245
class IPlotManager(object):
224
246
    """A 'controller' that organizes relations between
225
 
    plots (EnhancedQwtPlot), panels, tools (GuiTool) and toolbar
 
247
    plots (BasePlot), panels, tools (GuiTool) and toolbar
226
248
    """
227
249
    def add_plot(self, plot, plot_id="default"):
228
250
        assert id not in self.plots
229
 
        assert isinstance(plot, EnhancedQwtPlot)
 
251
        assert isinstance(plot, BasePlot)
230
252
 
231
253
    def add_panel(self, panel):
232
254
        assert id not in self.panels
251
273
    def register_panel(self, manager):
252
274
        """Register panel to plot manager"""
253
275
        pass
 
276
    
 
277
    def configure_panel(self):
 
278
        """Configure panel"""
 
279
        pass