FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
qt_view_controller.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** FougTools
3 ** Copyright Fougue (30 Mar. 2015)
4 ** contact@fougue.pro
5 **
6 ** This software is a computer program whose purpose is to provide utility
7 ** tools for the C++ language and the Qt toolkit.
8 **
9 ** This software is governed by the CeCILL-C license under French law and
10 ** abiding by the rules of distribution of free software. You can use,
11 ** modify and/ or redistribute the software under the terms of the CeCILL-C
12 ** license as circulated by CEA, CNRS and INRIA at the following URL
13 ** "http://www.cecill.info".
14 ****************************************************************************/
15 
16 #pragma once
17 
18 #include "occtools.h"
19 #include <Handle_AIS_InteractiveContext.hxx>
20 #include <Handle_V3d_View.hxx>
21 #include <QtCore/QObject>
22 #include <QtCore/QRect>
23 class QPoint;
24 class QRubberBand;
25 
26 namespace occ {
27 
28 class QtView;
29 class ViewControllerDelegate;
30 
31 class OCCTOOLS_EXPORT QtViewController : public QObject
32 {
33  Q_OBJECT
34 
35 public:
36  friend class ViewControllerDelegate;
37 
38  QtViewController(QtView* view);
39 
40  bool eventFilter(QObject* object, QEvent* event);
41 
42 signals:
43  void contextSelectionChanged();
44  void escaped();
45 
46 protected:
47  virtual void beginRubberBandDraw(const QPoint& startPos);
48  virtual void updateRubberBandDraw(const QPoint& currPos);
49  virtual void endRubberBandDraw();
50 
51  void notifyContextSelectionChanged();
52  void notifyEscaped();
53 
54 public:
55  Handle_V3d_View internalOccView() const;
56  Handle_AIS_InteractiveContext context() const;
57  QtView* view() const;
58 
59 protected:
60  const QRect rubberBandGeometry() const;
61 
62 private:
63  void createRubberBand();
64 
65  QtView* m_view;
66  QPoint m_startRubberBandPos;
67  QRubberBand* m_rubberBand;
68 };
69 
70 } // namespace occ
Qt wrapper around the V3d_View class.
Definition: qt_view.h:33
#define OCCTOOLS_EXPORT
Definition: occtools.h:27
Definition: ais_text.cpp:31
Definition: qt_view_controller.h:31