-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SMTK&CMB now has a concept of active model. Loading, switching and closing model(s)/data would reset the active model correspondingly. A singleton class(qtActiveObjects) is used to store active model. subPhraseGenerator would also keep a copy of it. Only active model can be selected by rubber band. And only active model would be expanded in model tree. Attribute panel would only list active model's entities. Check CMB issue #140 for detail.
- Loading branch information
Haocheng Liu
committed
Apr 25, 2017
1 parent
c5bb681
commit bf7b6e1
Showing
22 changed files
with
417 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//========================================================================= | ||
// 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. | ||
//========================================================================= | ||
|
||
#include <smtk/extension/qt/qtActiveObjects.h> | ||
|
||
qtActiveObjects::qtActiveObjects() | ||
{ | ||
this->m_activeModel = smtk::model::Model(); | ||
} | ||
|
||
qtActiveObjects::~qtActiveObjects() | ||
{ | ||
} | ||
|
||
qtActiveObjects& qtActiveObjects::instance() | ||
{ | ||
static qtActiveObjects theInstance; | ||
return theInstance; | ||
} | ||
|
||
void qtActiveObjects::setActiveModel(const smtk::model::Model& inputModel) | ||
{ | ||
this->m_activeModel = inputModel; | ||
emit this->activeModelChanged(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
//========================================================================= | ||
// 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 <QObject> | ||
#include "smtk/PublicPointerDefs.h" | ||
#include "smtk/model/Model.h" //for smtk::model::Model | ||
|
||
namespace smtk { | ||
namespace model { | ||
class Model; | ||
} | ||
} | ||
|
||
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. | ||
*/ | ||
class qtActiveObjects : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
typedef QObject Superclass; | ||
|
||
public: | ||
/// Returns reference to the singleton instance. | ||
static qtActiveObjects& instance(); | ||
|
||
/// Returns the active model. | ||
smtk::model::Model activeModel() const {return this->m_activeModel;} | ||
|
||
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; | ||
|
||
private: | ||
Q_DISABLE_COPY(qtActiveObjects) | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.