arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

SliceView.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     6-20-03
00005 //                   ________    ____   ___ 
00006 //                  |        \  /    | /  /
00007 //                  +---+     \/     |/  /
00008 //                  +--+|  |\    /|     < 
00009 //                  |  ||  | \  / |  |\  \ 
00010 //                  |      |  \/  |  | \  \ 
00011 //                   \_____|      |__|  \__\
00012 //                       Copyright  2003 
00013 //                      Joe Michael Kniss
00014 //                   <<< jmk@cs.utah.edu >>>
00015 //               "All Your Base are Belong to Us"
00016 //-------------------------------------------------------------------------
00017 
00018 
00019 ///SliceView.h
00020 ///  simianUI
00021 
00022 
00023 #ifndef __SIMIAN_SLICE_VIEW_DOT_H
00024 #define __SIMIAN_SLICE_VIEW_DOT_H
00025 
00026 #include <qcanvas.h>
00027 #include <mathGutz.h>
00028 
00029 class SliceView : public QCanvasView {
00030    Q_OBJECT
00031 public:
00032    SliceView(QCanvas *canvas, QWidget *parent=0, const char *name=0, WFlags f=0);
00033    virtual ~SliceView();
00034 
00035    void  setZoom(float zoom) { _zoom = zoom; }
00036    float getZoom() const { return _zoom; }
00037    
00038    void        setPos(gutz::vec2f pos) { _pos = pos; }
00039    gutz::vec2f getPos() const { return _pos; }
00040 
00041    gutz::vec2f getAspect() const;
00042 
00043    /// need these cuz scroll bars messup estimates
00044    int getWidth()  const { return width()  - 26; }
00045    int getHeight() const { return height() - 26; }
00046 
00047 signals:
00048    /// these are pixel positions! in the view,
00049    /// you gota do the transformation yourself
00050    virtual void pickPosChanged(int xp, int yp);
00051 
00052 protected:
00053    void contentsMousePressEvent(QMouseEvent*);
00054    void contentsMouseMoveEvent(QMouseEvent*);
00055    float _zoom;
00056    gutz::vec2f _pos;
00057 };
00058 
00059 #endif
00060 

Send questions, comments, and bug reports to:
jmk