qtActiveObjects.h 1.64 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
//=========================================================================
//  Copyright (c) Kitware, Inc.
//  All rights reserved.
//  See LICENSE.txt for details.
//
//  This software is distributed WITHOUT ANY WARRANTY; without even
//  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
//  PURPOSE.  See the above copyright notice for more information.
//=========================================================================
#ifndef qtActiveObjects_h
#define qtActiveObjects_h

#include "smtk/PublicPointerDefs.h"
14
#include "smtk/extension/qt/Exports.h"
15
#include "smtk/model/Model.h" //for smtk::model::Model
16

17
#include <QObject>
18

19 20
#include <memory>

21 22 23 24 25 26
namespace smtk
{
namespace model
{
class Model;
}
27 28 29 30 31 32 33 34 35 36 37
}

class pqView;
class vtkSMSessionProxyManager;
class vtkSMViewProxy;

/**
  qtActiveObjects keeps track of active objects.
  This is similar to pqActiveObjects in ParaView, however it tracks objects
  relevant to SMTK and CMB.
*/
38
class SMTKQTEXT_EXPORT qtActiveObjects : public QObject
39 40 41 42 43 44 45 46 47 48
{
  Q_OBJECT

  typedef QObject Superclass;

public:
  /// Returns reference to the singleton instance.
  static qtActiveObjects& instance();

  /// Returns the active model.
49
  smtk::model::Model activeModel() const { return m_activeModel; }
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65

public slots:
  /// Set the active module.
  void setActiveModel(const smtk::model::Model& inputModel);

signals:
  /// Fire when activeModel changes.
  void activeModelChanged();

private slots:

protected:
  qtActiveObjects();
  virtual ~qtActiveObjects();

  smtk::model::Model m_activeModel;
66
  std::weak_ptr<smtk::extension::qtSelectionManager> m_selectionMgr;
67 68 69 70 71 72

private:
  Q_DISABLE_COPY(qtActiveObjects)
};

#endif