...
 
Commits (80)
......@@ -135,8 +135,6 @@ add_library(cmbAppCommon
pqCMBCommonMainWindowCore.h
pqCMBPreviewDialog.cxx
pqCMBPreviewDialog.h
pqCMBProcessWidget.cxx
pqCMBProcessWidget.h
pqCMBRubberBandHelper.cxx
pqCMBRubberBandHelper.h
pqCMBRulerDialog.cxx
......
......@@ -879,6 +879,11 @@
<string>Load Simulation Template</string>
</property>
</action>
<action name="actionImport_Python_Operator">
<property name="text">
<string>Import Python Operator</string>
</property>
</action>
<action name="actionChangeObjectsType">
<property name="text">
<string>Change Object's Type</string>
......
......@@ -55,7 +55,6 @@
#include "pqObjectBuilder.h"
#include "pqOptions.h"
#include "pqOutputPort.h"
#include "pqOutputWindow.h"
#include "pqParaViewBehaviors.h"
#include "pqPipelineContextMenuBehavior.h"
#include "pqPipelineFilter.h"
......@@ -98,7 +97,7 @@
#include "pqCMBFileDialogEventPlayer.h"
#include "pqCMBFileDialogEventTranslator.h"
#include <QVTKWidget.h>
#include <QVTKOpenGLWidget.h>
#include "vtkCamera.h"
#include "vtkDoubleArray.h"
......@@ -118,7 +117,6 @@
#include "vtkStringArray.h"
#include "vtkWidgetEvent.h"
#include "vtkWidgetEventTranslator.h"
#include <vtkPVDisplayInformation.h>
#include <vtkPVOptions.h>
#include <vtkPVXMLElement.h>
#include <vtkPVXMLParser.h>
......@@ -148,10 +146,9 @@
#include <vtksys/Process.h>
#include <vtksys/SystemTools.hxx>
#include "QVTKWidget.h"
#include "QVTKOpenGLWidget.h"
#include "pqCMBDisplayProxyEditor.h"
#include "pqCMBPreviewDialog.h"
#include "pqCMBProcessWidget.h"
#include "pqImageUtil.h"
#include "qtCMBApplicationOptions.h"
#include "qtCMBContextMenuBehavior.h"
......@@ -892,7 +889,7 @@ void pqCMBCommonMainWindowCore::onServerCreationFinished(pqServer* server)
bool pqCMBCommonMainWindowCore::eventFilter(QObject* caller, QEvent* e)
{
if (qobject_cast<QVTKWidget*>(caller) && e->type() == QEvent::Resize)
if (qobject_cast<QVTKOpenGLWidget*>(caller) && e->type() == QEvent::Resize)
{
// Update ViewPosition and GUISize properties on all view modules.
this->updateViewPositions();
......
......@@ -46,6 +46,7 @@
#include <vtksys/SystemTools.hxx>
#include "smtk/extension/vtk/widgets/vtkSMTKArcRepresentation.h"
#include "vtkCommand.h"
#include "vtkContourWidget.h"
#include "vtkNew.h"
#include "vtkSMPropertyHelper.h"
......@@ -67,7 +68,6 @@
#include "pqRepresentationHelperFunctions.h"
#include <QVTKWidget.h>
#include <vtkActor.h>
#include <vtkGlyph3D.h>
#include <vtkPoints.h>
......
//=========================================================================
// 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 "pqCMBProcessWidget.h"
#include "pqOutputWindow.h"
#include <QApplication>
#include <QGridLayout>
#include <QLabel>
#include <QToolButton>
pqCMBProcessWidget::pqCMBProcessWidget(QWidget* _parent /*=0*/)
: QWidget(_parent)
{
QGridLayout* gridLayout = new QGridLayout(this);
gridLayout->setSpacing(4);
gridLayout->setMargin(0);
gridLayout->setObjectName("gridLayout");
this->OutputButton = new QToolButton(this);
this->OutputButton->setObjectName("OutputButton");
this->OutputButton->setText("Process Output");
QObject::connect(this->OutputButton, SIGNAL(pressed()), this, SLOT(showOutputWindow()));
this->Message = new QLabel;
this->Message->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
this->AbortButton = new QToolButton(this);
this->AbortButton->setObjectName("AbortButton");
this->AbortButton->setIcon(QIcon(QString::fromUtf8(":/QtWidgets/Icons/pqDelete16.png")));
this->AbortButton->setIconSize(QSize(12, 12));
this->AbortButton->setToolTip(QApplication::translate("Form", "Abort", 0
#if QT_VERSION < 0x050000
,
QApplication::UnicodeUTF8
#endif
));
this->AbortButton->setEnabled(false);
QObject::connect(this->AbortButton, SIGNAL(pressed()), this, SIGNAL(abortPressed()));
gridLayout->addWidget(this->Message, 0, 0);
gridLayout->addWidget(this->AbortButton, 0, 1);
gridLayout->addWidget(this->OutputButton, 0, 2);
// hmmm... set minimum width or setFixedWidth on the message?
gridLayout->setColumnMinimumWidth(0, 300);
this->OutputWindow = new pqOutputWindow(0);
this->OutputWindow->setAttribute(Qt::WA_QuitOnClose, false);
this->OutputWindow->setObjectName("processOutputDialog");
this->OutputWindow->setWindowTitle(tr("Process Output"));
// this->OutputWindow->setShowOutput(false);
}
pqCMBProcessWidget::~pqCMBProcessWidget()
{
delete this->Message;
delete this->AbortButton;
delete this->OutputButton;
delete this->OutputWindow;
}
void pqCMBProcessWidget::setMessage(const QString& message)
{
this->Message->setText(message);
}
void pqCMBProcessWidget::appendToOutput(const QString& message)
{
this->OutputWindow->onDisplayText(message);
}
void pqCMBProcessWidget::showOutputWindow()
{
this->OutputWindow->show();
}
void pqCMBProcessWidget::enableAbort(bool enabled)
{
this->AbortButton->setEnabled(enabled);
}
//=========================================================================
// 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 __pqCMBProcessWidget_h
#define __pqCMBProcessWidget_h
#include "cmbAppCommonExport.h"
#include "cmbSystemConfig.h"
#include <QWidget>
class QLabel;
class QToolButton;
class pqOutputWindow;
class CMBAPPCOMMON_EXPORT pqCMBProcessWidget : public QWidget
{
Q_OBJECT
public:
pqCMBProcessWidget(QWidget* parent = 0);
~pqCMBProcessWidget() override;
QToolButton* getAbortButton() const { return this->AbortButton; }
QToolButton* getOutputButton() const { return this->OutputButton; }
void appendToOutput(const QString& message);
public slots:
/// Set the message.
void setMessage(const QString& message);
/// Enable/Disable the abort button.
void enableAbort(bool enabled);
/// Enable/Disable the abort button.
void showOutputWindow();
signals:
void abortPressed();
void outputPressed();
protected:
QLabel* Message;
QToolButton* AbortButton;
QToolButton* OutputButton;
pqOutputWindow* OutputWindow;
private:
pqCMBProcessWidget(const pqCMBProcessWidget&); // Not implemented.
void operator=(const pqCMBProcessWidget&); // Not implemented.
};
#endif
......@@ -49,4 +49,4 @@ protected:
void setWeightFunction();
};
#endif
\ No newline at end of file
#endif
......@@ -29,7 +29,7 @@
</widget>
</item>
<item row="0" column="0">
<widget class="QVTKWidget" name="qvtkWidget" native="true">
<widget class="QVTKOpenGLWidget" name="qvtkWidget" native="true">
<property name="baseSize">
<size>
<width>0</width>
......@@ -279,9 +279,9 @@
</widget>
<customwidgets>
<customwidget>
<class>QVTKWidget</class>
<class>QVTKOpenGLWidget</class>
<extends>QWidget</extends>
<header>QVTKWidget.h</header>
<header>QVTKOpenGLWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
......
......@@ -74,13 +74,11 @@
#include "vtkDataArray.h"
#include "vtkDataSet.h"
#include "vtkEventQtSlotConnect.h"
#include "vtkFacesConnectivityFilter.h"
#include "vtkHydroModelPolySource.h"
#include "vtkIdList.h"
#include "vtkIdTypeArray.h"
#include "vtkIntArray.h"
#include "vtkMapper.h"
#include "vtkMergeFacesFilter.h"
#include "vtkMultiBlockDataSet.h"
#include "vtkObjectFactory.h"
#include "vtkPVDataSetAttributesInformation.h"
......
......@@ -13,7 +13,6 @@
#include "pqCMBDisplayProxyEditor.h"
#include "pqCMBPreviewDialog.h"
#include "pqCMBProcessWidget.h"
#include "qtCMBApplicationOptions.h"
#include "qtCMBProgressWidget.h"
......@@ -57,7 +56,6 @@
#include "pqFileDialogModel.h"
#include "pqLinksManager.h"
#include "pqObjectBuilder.h"
#include "pqOutputWindow.h"
#include "pqPVApplicationCore.h"
#include "pqCMBRubberBandHelper.h"
......@@ -91,8 +89,6 @@
#include <pqUndoStack.h>
#include <pqWaitCursor.h>
#include <QVTKWidget.h>
#include "vtkBoxWidget2.h"
#include "vtkEvent.h"
#include "vtkPVCompositeDataInformation.h"
......@@ -111,7 +107,6 @@
#include <vtkIdTypeArray.h>
#include <vtkImageData.h>
#include <vtkMultiBlockWrapper.h>
#include <vtkPVDisplayInformation.h>
#include <vtkPVOptions.h>
#include <vtkPVXMLElement.h>
#include <vtkPVXMLParser.h>
......@@ -153,7 +148,6 @@
#include "vtkEventQtSlotConnect.h"
#include "vtkGenericDataObjectWriter.h"
#include "vtkHydroModelPolySource.h"
#include "vtkOmicronMeshInputFilter.h"
#include "vtkOmicronMeshInputWriter.h"
#include "vtkOmicronModelInputReader.h"
#include "vtkRenderer.h"
......
......@@ -348,21 +348,6 @@ if(BUILD_TESTING)
set(TEST_PYTHON ${ModelBuilder_SOURCE_DIR}/Testing/Python)
set(TEST_IMAGE ${CMB_TEST_DATA_ROOT}/data/baseline/cmb_application)
# Need path to python executable
find_package(PythonInterp)
if (PYTHONINTERP_FOUND)
set(PYTHON_DEFINES
CMAKE_PYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}"
CMAKE_PYTHON_VERSION="${PYTHON_VERSION_STRING}"
)
set_property(
SOURCE export.cxx
APPEND PROPERTY COMPILE_DEFINITIONS ${PYTHON_DEFINES}
)
endif()
#Tests that don't work on Apple
set (APPLE_EXCLUDE_TESTS
......@@ -463,6 +448,7 @@ endif()
AuxGeoTif
AuxGeoDEM
DeleteAuxGeom
ZoomToImage
ZoomToSelectionCMB
${CGM_SESSION_TESTS}
${SMTK_VXL_TESTS}
......
......@@ -34,13 +34,13 @@
#include "../pqCMBModelBuilderOptions.h"
#include "pqCMBRecentlyUsedResourceLoaderImplementatation.h"
#include "smtk/common/ResourceSet.h"
#include "smtk/extension/qt/qtUIManager.h"
#include "smtk/io/AttributeReader.h"
#include "smtk/io/AttributeWriter.h"
#include "smtk/io/Logger.h"
#include "smtk/io/ResourceSetReader.h"
#include "smtk/io/ResourceSetWriter.h"
#include "smtk/resource/Set.h"
#include "pqSimBuilderUIManager.h"
......@@ -238,7 +238,7 @@ int SimBuilderCore::LoadSimulation(pqPipelineSource* reader, pqCMBSceneTree* /*s
}
// Lets get the toplevel view
smtk::common::ViewPtr topView = this->uiManager()->attributeCollection()->findTopLevelView();
smtk::view::ViewPtr topView = this->uiManager()->attributeCollection()->findTopLevelView();
if (!topView)
{
vtkGenericWarningMacro("There is no TopLevel View in " << info->GetFileName());
......@@ -338,12 +338,12 @@ int SimBuilderCore::SaveSimulation(const char* filename, bool /*writeScenario*/)
if ("crf" == finfo.suffix().toLower())
{
// Initialize ResourceSet
smtk::common::ResourceSet resources;
smtk::resource::Set resources;
smtk::attribute::CollectionPtr simCollection = this->uiManager()->attributeCollection();
resources.addResource(simCollection, "simbuilder", "", smtk::common::ResourceSet::INSTANCE);
resources.add(simCollection, "simbuilder", "", smtk::resource::Set::INSTANCE);
smtk::attribute::CollectionPtr expCollection =
this->ExportDialog->exportAttCollection(true); // use baseline atts
resources.addResource(expCollection, "export", "", smtk::common::ResourceSet::TEMPLATE);
resources.add(expCollection, "export", "", smtk::resource::Set::TEMPLATE);
// Serialize ResourceSet
smtk::io::ResourceSetWriter resourceWriter;
......@@ -440,13 +440,13 @@ int SimBuilderCore::LoadResources(pqPipelineSource* reader, pqCMBSceneTree* /*sc
}
// Instantiate and initialize ResourceSet
smtk::common::ResourceSet resources;
smtk::resource::Set resources;
std::string linkStartDir = finfo.absoluteDir().path().toStdString();
resources.setLinkStartPath(linkStartDir);
// Instantiate reader and std::map for current attribute collections
smtk::io::ResourceSetReader resourceReader;
std::map<std::string, smtk::common::ResourcePtr> resourceMap;
std::map<std::string, smtk::resource::ResourcePtr> resourceMap;
resourceMap["simbuilder"] = this->uiManager()->attributeCollection();
//resourceMap["export"] = this->GetExportPanel()->uiManager()->attributeCollection();
......@@ -463,7 +463,7 @@ int SimBuilderCore::LoadResources(pqPipelineSource* reader, pqCMBSceneTree* /*sc
}
// Lets get the toplevel view
smtk::common::ViewPtr topView = this->uiManager()->attributeCollection()->findTopLevelView();
smtk::view::ViewPtr topView = this->uiManager()->attributeCollection()->findTopLevelView();
if (!topView)
{
vtkGenericWarningMacro("There is no TopLevel View in " << info->GetFileName());
......@@ -481,11 +481,10 @@ int SimBuilderCore::LoadResources(pqPipelineSource* reader, pqCMBSceneTree* /*sc
//std::cout << "Number of resources loaded: " << numResources << std::endl;
// If simulation attributes loaded, update ExportDialog
smtk::common::Resource::Type simType;
smtk::common::ResourceSet::ResourceRole simRole;
smtk::common::ResourceSet::ResourceState simState;
smtk::resource::Set::Role simRole;
smtk::resource::Set::State simState;
std::string simLink;
if (resources.resourceInfo("simbuilder", simType, simRole, simState, simLink))
if (resources.resourceInfo("simbuilder", simRole, simState, simLink))
{
this->ExportDialog->setSimAttCollection(this->uiManager()->attributeCollection());
this->IsSimModelLoaded = true;
......@@ -493,13 +492,12 @@ int SimBuilderCore::LoadResources(pqPipelineSource* reader, pqCMBSceneTree* /*sc
}
// Check if export resource loaded, and if not, load default template
smtk::common::Resource::Type exportType;
smtk::common::ResourceSet::ResourceRole exportRole;
smtk::common::ResourceSet::ResourceState exportState;
smtk::resource::Set::Role exportRole;
smtk::resource::Set::State exportState;
std::string exportLink;
if (resources.resourceInfo("export", exportType, exportRole, exportState, exportLink))
if (resources.resourceInfo("export", exportRole, exportState, exportLink))
{
smtk::common::ResourcePtr expResource;
smtk::resource::ResourcePtr expResource;
resources.get("export", expResource);
smtk::attribute::CollectionPtr expCollection =
smtk::dynamic_pointer_cast<smtk::attribute::Collection>(expResource);
......
......@@ -21,12 +21,12 @@
#include "smtk/attribute/Item.h"
#include "smtk/attribute/ItemDefinition.h"
#include "smtk/attribute/StringItem.h"
#include "smtk/common/View.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtUIManager.h"
#include "smtk/io/AttributeReader.h"
#include "smtk/io/AttributeWriter.h"
#include "smtk/io/Logger.h"
#include "smtk/view/View.h"
#include "pqApplicationCore.h"
#include "pqServer.h"
......@@ -391,7 +391,7 @@ void SimBuilderExportDialog::updatePanel()
}
// Get toplevel view
smtk::common::ViewPtr topView = this->ExportUIManager->attributeCollection()->findTopLevelView();
smtk::view::ViewPtr topView = this->ExportUIManager->attributeCollection()->findTopLevelView();
if (!topView)
{
QMessageBox::critical(NULL, "Export Error", "There is no TopLevel View in Export Script!");
......@@ -701,11 +701,11 @@ std::string SimBuilderExportDialog::findInstancedAttName(const std::string& attT
// <Att Name= Type=>
std::string thisAttName;
std::string thisAttType;
const std::map<std::string, smtk::common::ViewPtr>& views = this->ExportAttCollection->views();
std::map<std::string, smtk::common::ViewPtr>::const_iterator viewIter = views.cbegin();
const std::map<std::string, smtk::view::ViewPtr>& views = this->ExportAttCollection->views();
std::map<std::string, smtk::view::ViewPtr>::const_iterator viewIter = views.cbegin();
for (; viewIter != views.cend(); ++viewIter)
{
const smtk::common::ViewPtr view = viewIter->second;
const smtk::view::ViewPtr view = viewIter->second;
if (view->type() != "Instanced")
{
continue; // skip non-instance view
......@@ -718,13 +718,13 @@ std::string SimBuilderExportDialog::findInstancedAttName(const std::string& attT
qWarning() << "Instanced View missing InstancedAttributes";
continue;
}
smtk::common::View::Component& instancedAttsComp = view->details().child(index);
smtk::view::View::Component& instancedAttsComp = view->details().child(index);
// Traverse <Att> elements
std::size_t i, n = instancedAttsComp.numberOfChildren();
for (i = 0; i < n; ++i)
{
smtk::common::View::Component& attComp = instancedAttsComp.child(i);
smtk::view::View::Component& attComp = instancedAttsComp.child(i);
if (attComp.name() != "Att")
{
continue;
......
......@@ -100,7 +100,7 @@ void pqSimBuilderUIManager::setModelPanel(pqSMTKModelPanel* panel)
this->m_ModelPanel = panel;
}
void pqSimBuilderUIManager::setSMTKView(smtk::common::ViewPtr view, QWidget* parentWidget)
void pqSimBuilderUIManager::setSMTKView(smtk::view::ViewPtr view, QWidget* parentWidget)
{
if (!view)
{
......@@ -119,10 +119,10 @@ void pqSimBuilderUIManager::setSMTKView(smtk::common::ViewPtr view, QWidget* par
QObject::connect(this->m_attUIManager,
SIGNAL(sendSelectionsFromAttributePanelToSelectionManager(const smtk::model::EntityRefs&,
const smtk::mesh::MeshSets&, const smtk::model::DescriptivePhrases&,
const smtk::extension::SelectionModifier, const std::string&)),
const smtk::resource::SelectionAction, const std::string&)),
qtActiveObjects::instance().smtkSelectionManager().get(),
SLOT(updateSelectedItems(const smtk::model::EntityRefs&, const smtk::mesh::MeshSets&,
const smtk::model::DescriptivePhrases&, const smtk::extension::SelectionModifier,
const smtk::model::DescriptivePhrases&, const smtk::resource::SelectionAction,
const std::string&)));
this->m_attUIManager->setSMTKView(view, parentWidget);
......
......@@ -50,7 +50,7 @@ public:
pqRenderView* renderView() { return this->RenderView; }
smtk::extension::qtBaseView* topView();
void setSMTKView(smtk::common::ViewPtr topView, QWidget* parentWidget);
void setSMTKView(smtk::view::ViewPtr topView, QWidget* parentWidget);
smtk::model::ManagerPtr attModelManager() const;
void setModelManager(smtk::model::ManagerPtr);
void setModelPanel(pqSMTKModelPanel*);
......
......@@ -29,4 +29,5 @@
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/OpViewFrame/1QFrame0/1QFrame0/1QFrame0/1smtk::extension::qtModelEntityItemCombo0/privateEntityComboViewContainer/1QComboBoxListView0" command="mouseRelease" arguments="1,0,0,104,5,/1:0" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/OpViewFrame/1QFrame0/1QFrame0/1QFrame0/1smtk::extension::qtModelEntityItemCombo0" command="hidePopup" arguments="" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/OpViewFrame/OpViewApplyButton" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/ClearSelection" command="activate" arguments="" />
</pqevents>
......@@ -15,15 +15,15 @@
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/OpViewFrame/OpViewApplyButton" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QComboBox0" command="activated" arguments="Edge - Create from Image Surfaces" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/1QFrame0/surfaceExtractorView" command="activate" arguments="" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mousePress" arguments="1,1,0,585,348" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mouseMove" arguments="1,0,0,575,397" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mouseRelease" arguments="1,0,0,575,397" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mousePress" arguments="(0.608142,0.433548,1,1,0)" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mouseMove" arguments="(0.601494,0.463226,1,0,0)" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mouseRelease" arguments="(0.601494,0.463226,1,0,0)" />
<pqevent object="imageFeatureExtractor/verticalWidget/DrawMode" command="activated" arguments="Land" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mousePress" arguments="1,1,0,229,218" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mouseMove" arguments="1,0,0,627,257" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mouseRelease" arguments="1,0,0,627,257" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mousePress" arguments="(0.404732,0.285161,1,1,0)" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mouseMove" arguments="(0.782067,0.322581,1,0,0)" />
<pqevent object="imageFeatureExtractor/qvtkWidget" command="mouseRelease" arguments="(0.782067,0.322581,1,0,0)" />
<pqevent object="imageFeatureExtractor/verticalWidget/Run" command="activate" arguments="" />
<pqevent object="imageFeatureExtractor/verticalWidget/Accept" command="activate" arguments="" />
<pqevent object="imageFeatureExtractor/Accept" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QComboBox0" command="activated" arguments="Faces - Create All" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/OpViewFrame/OpViewApplyButton" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="expand" arguments="0.0.0.0.0.0" />
......@@ -35,8 +35,8 @@
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseRelease" arguments="1,0,0,13,154" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0.0.0.0.0.4.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="toggleVisibility" arguments="/0:0/0:0/0:0/4:0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0.0.0.0.0.5.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="toggleVisibility" arguments="/0:0/0:0/0:0/5:0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0.0.0.0.0.3.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="toggleVisibility" arguments="/0:0/0:0/0:0/3:0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/qt_scrollarea_vcontainer/1QScrollBar0" command="mousePress" arguments="1,1,0,12,134" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseMove" arguments="1,0,0,13,150" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseRelease" arguments="1,0,0,13,150" />
......
......@@ -59,18 +59,25 @@
<pqevent object="qtCMBMainWindow/Viewport" command="mouseRelease" arguments="(0.596667,0.183333,1,0,0)" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/1QFrame0/smtkArcWidget/frame_2/Closed" command="set_boolean" arguments="true" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/1QFrame0/smtkArcWidget/Finished" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QComboBox0" command="activated" arguments="Geometry - Clean" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0.0.0.0.0.0.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/qt_scrollarea_viewport" command="contextMenu" arguments="" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="showContextMenu" arguments="/0:0/0:0/0:0/0:0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/1QMenu0" command="activate" arguments="Geometry - Clean" />
<pqevent object="qtCMBMainWindow/action_Select" command="set_boolean" arguments="true" />
<pqevent object="qtCMBMainWindow/Viewport" command="mousePress" arguments="(0.0533333,0.0766667,1,1,0)" />
<pqevent object="qtCMBMainWindow/Viewport" command="mouseMove" arguments="(0.943333,0.856667,1,0,0)" />
<pqevent object="qtCMBMainWindow/Viewport" command="mouseRelease" arguments="(0.943333,0.856667,1,0,0)" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/OpViewFrame/OpViewApplyButton" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QComboBox0" command="activated" arguments="Faces - Create All" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0.0.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/qt_scrollarea_viewport" command="contextMenu" arguments="" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="showContextMenu" arguments="/0:0/0:0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/1QMenu0" command="activate" arguments="Faces - Create All" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/OpViewFrame/OpViewApplyButton" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/qt_dockwidget_closebutton" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="expand" arguments="0.0.0.0.0.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0.0.0.0.0.1.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="toggleVisibility" arguments="/0:0/0:0/0:0/1:0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0.0.0.0.0.3.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="toggleVisibility" arguments="/0:0/0:0/0:0/3:0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0.0.0.0.0.0.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="toggleVisibility" arguments="/0:0/0:0/0:0/0:0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseWheel" arguments="-120,0,0,108,105" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseWheel" arguments="-120,0,0,109,105" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0.0.0.0.0.5.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="toggleVisibility" arguments="/0:0/0:0/0:0/5:0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/ClearSelection" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/actionReset_Camera" command="activate" arguments="" />
</pqevents>
<?xml version="1.0" ?>
<pqevents>
<pqevent object="qtCMBMainWindow/menubar" command="activate" arguments="menu_Tools" />
<pqevent object="qtCMBMainWindow/menubar/menu_Tools" command="activate" arguments="actionLock_View_Size" />
<pqevent object="qtCMBMainWindow/menubar" command="activate" arguments="menu_File" />
<pqevent object="qtCMBMainWindow/menubar/menu_File/menu_newsession" command="activate" arguments="polygon" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/qt_scrollarea_viewport" command="contextMenu" arguments="" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="showContextMenu" arguments="/0:0" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0/0QMenu0" command="activate" arguments="Model - Add Image" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/OpViewFrame/1QFrame0/1QFrame0/1QFrame1/1QFrame0/1QPushButton0" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/OpViewFrame/1QFrame0/1QFrame0/1QFrame1/SimBuilder Select File Dialog" command="filesSelected" arguments="$PARAVIEW_DATA_ROOT/ThirdParty/SMTK/data/dem/ChesapeakeBay100x100.vti" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0" command="mouseMove" arguments="1,0,0,99,25" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0" command="mouseRelease" arguments="1,0,0,99,25" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/scrollArea/qt_scrollarea_viewport/modelOperationWidget/1QSplitter0/1QWidget0/1QFrame0/topLevelScrollArea/qt_scrollarea_viewport/OpViewFrame/OpViewApplyButton" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/operatorsDockWidget/qt_dockwidget_closebutton" command="activate" arguments="" />
<pqevent object="qtCMBMainWindow/Viewport" command="mousePress" arguments="(0.495111,0.581132,1,1,0)" />
<pqevent object="qtCMBMainWindow/Viewport" command="mouseMove" arguments="(0.863111,0.149686,1,0,0)" />
<pqevent object="qtCMBMainWindow/Viewport" command="mouseRelease" arguments="(0.863111,0.149686,1,0,0)" />
<pqevent object="qtCMBMainWindow/smtkModelDockWidget/qtModelPanel/1smtk::extension::qtModelView0" command="setCurrent" arguments="0.0.0.0.0.0" />
<pqevent object="qtCMBMainWindow/actionZoomToSelection" command="activate" arguments="" />
</pqevents>
......@@ -36,8 +36,8 @@
#include "smtk/attribute/IntItem.h"
#include "smtk/attribute/ModelEntityItemDefinition.h"
#include "smtk/attribute/StringItem.h"
#include "smtk/mesh/Collection.h"
#include "smtk/mesh/Manager.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Manager.h"
#include "smtk/model/Face.h"
#include "smtk/model/Group.h"
#include "smtk/model/Manager.h"
......@@ -141,17 +141,17 @@ bool pqCMBContextMenuHelper::getValidEntityColor(
if (entref.isFace())
{
color = smtk::extension::QEntityItemModel::defaultEntityColor("Face");
return true;
return color.isValid() ? true : false;
}
else if (entref.isEdge())
{
color = smtk::extension::QEntityItemModel::defaultEntityColor("Edge");
return true;
return color.isValid() ? true : false;
}
else if (entref.isVertex())
{
color = smtk::extension::QEntityItemModel::defaultEntityColor("Vertex");
return true;
return color.isValid() ? true : false;
}
}
return false;
......
......@@ -13,7 +13,7 @@
#include "cmbSystemConfig.h"
#include "smtk/PublicPointerDefs.h"
#include "smtk/mesh/MeshSet.h"
#include "smtk/mesh/core/MeshSet.h"
#include "smtk/model/EntityRef.h"
#include "vtkType.h"
#include <QColor>
......
......@@ -274,7 +274,7 @@ bool pqCMBModelBuilderMainWindow::eventFilter(QObject* watched, QEvent* event)
{
if (mouseEvent->button() == Qt::LeftButton)
{
this->getThisCore()->smtkSelectionManager()->setSelectionModifierToSubtraction();
this->getThisCore()->smtkSelectionManager()->setSelectionActionToSubtraction();
this->getMainDialog()->action_Select->setChecked(true);
this->onSurfaceRubberBandSelect(true);
}
......@@ -287,7 +287,7 @@ bool pqCMBModelBuilderMainWindow::eventFilter(QObject* watched, QEvent* event)
{
if (mouseEvent->button() == Qt::LeftButton)
{
this->getThisCore()->smtkSelectionManager()->setSelectionModifierToAddition();
this->getThisCore()->smtkSelectionManager()->setSelectionActionToAddition();
this->getMainDialog()->action_Select->setChecked(true);
this->onSurfaceRubberBandSelect(true);
}
......@@ -345,6 +345,9 @@ void pqCMBModelBuilderMainWindow::initializeApplication()
this->getThisCore(), SLOT(onExportSimFile()));
this->getMainDialog()->actionExport_Simulation_File->setEnabled(false);
QObject::connect(this->getMainDialog()->actionImport_Python_Operator, SIGNAL(triggered()), this,
SLOT(importPythonOperator()));
QObject::connect(this->getMainDialog()->action_Select, SIGNAL(triggered(bool)), this,
SLOT(onSurfaceRubberBandSelect(bool)));
......@@ -605,6 +608,11 @@ void pqCMBModelBuilderMainWindow::setupMenuActions()
this->getMainDialog()->menu_File->insertSeparator(this->getMainDialog()->action_Exit);
this->getMainDialog()->menu_File->insertAction(
this->getMainDialog()->action_Exit, this->getMainDialog()->actionImport_Python_Operator);
this->getMainDialog()->menu_File->insertSeparator(this->getMainDialog()->action_Exit);
this->getMainDialog()->menu_File->insertAction(
this->getMainDialog()->action_Exit, this->getMainDialog()->actionSave_Simulation);
this->getMainDialog()->menu_File->insertAction(
......@@ -1109,6 +1117,11 @@ void pqCMBModelBuilderMainWindow::saveSimulationScenario()
this->getThisCore()->onSaveScenario();
}
void pqCMBModelBuilderMainWindow::importPythonOperator()
{
this->getThisCore()->onImportPythonOperator();
}
void pqCMBModelBuilderMainWindow::onSimFileLoaded(const char* vtkNotUsed(filename))
{
// if there is a SimBuilder model loaded, the left panel needs to be updated.
......
......@@ -127,6 +127,10 @@ protected slots:
void saveSimulationScenario();
void onSimFileLoaded(const char* filename);
// Description
// Loading operators
void importPythonOperator();
protected:
using pqCMBCommonMainWindow::updateEnableState;
// Description
......
......@@ -18,7 +18,6 @@
#include "pqObjectBuilder.h"
#include "pqOptions.h"
#include "pqOutputPort.h"
#include "pqOutputWindow.h"
#include "pqPVApplicationCore.h"
#include "pqPipelineFilter.h"
#include "pqProgressManager.h"
......@@ -61,7 +60,6 @@
#include "pqCMBModelBuilderOptions.h"
#include "pqCMBModelManager.h"
#include "pqCMBPreviewDialog.h"
#include "pqCMBProcessWidget.h"
#include "pqCMBRecentlyUsedResourceLoaderImplementatation.h"
#include "pqCMBRubberBandHelper.h"
#include "pqCMBSceneReader.h"
......@@ -83,6 +81,9 @@
#include "smtk/attribute/IntItem.h"
#include "smtk/attribute/MeshItem.h"
#include "smtk/attribute/StringItem.h"
#include "smtk/attribute/VoidItem.h"
#include "smtk/common/Paths.h"
#include "smtk/common/PythonInterpreter.h"
#include "smtk/extension/paraview/appcomponents/pqPluginSMTKViewBehavior.h"
#include "smtk/extension/paraview/operators/smtkExportModelView.h"
#include "smtk/extension/paraview/operators/smtkSaveModelView.h"
......@@ -92,8 +93,8 @@
#include "smtk/extension/qt/qtModelView.h"
#include "smtk/extension/qt/qtSelectionManager.h"
#include "smtk/extension/vtk/source/vtkModelMultiBlockSource.h"
#include "smtk/mesh/Collection.h"
#include "smtk/mesh/Manager.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Manager.h"
#include "smtk/model/AuxiliaryGeometry.h"
#include "smtk/model/Entity.h"
#include "smtk/model/EntityIterator.h"
......@@ -275,6 +276,8 @@ pqCMBModelBuilderMainWindowCore::pqCMBModelBuilderMainWindowCore(QWidget* parent
core->setUndoStack(NULL);
this->Internal->smtkViewBehavior = new pqPluginSMTKViewBehavior(this);
this->initializeSMTKPythonEnvironment();
}
pqCMBModelBuilderMainWindowCore::~pqCMBModelBuilderMainWindowCore()
......@@ -436,7 +439,7 @@ bool pqCMBModelBuilderMainWindowCore::zoomToSelection()
vtkSMRenderViewProxy* rm = this->activeRenderView()->getRenderViewProxy();
rm->ResetCamera(
finalBBox[0], finalBBox[1], finalBBox[2], finalBBox[3], finalBBox[4], finalBBox[5]);
this->activeRenderView()->render();
this->activeRenderView()->forceRender();
return true;
}
......@@ -691,6 +694,98 @@ void pqCMBModelBuilderMainWindowCore::onExportSimFile()
this->getSimBuilder()->ExportSimFile(this->modelManager()->managerProxy());
}
void pqCMBModelBuilderMainWindowCore::onImportPythonOperator()
{
// Open a file dialog for python files
pqFileDialog file_dialog(
this->getActiveServer(), NULL, tr("Open Python File:"), QString(), "Python Files (*.py)");
file_dialog.setObjectName("FileOpenDialog");
file_dialog.setFileMode(pqFileDialog::ExistingFile);
if (file_dialog.exec() == QDialog::Accepted)
{
QStringList files = file_dialog.getSelectedFiles();
smtk::extension::qtModelView* mv = this->modelPanel()->modelView();
smtk::model::ManagerPtr modelMgr = this->modelManager()->managerProxy()->modelManager();
smtk::model::SessionRefs sessions = modelMgr->sessions();
// For each python file selected...
for (std::size_t i = 0; i < files.size(); i++)
{
// ...if there are no sessions, we only need to read the python file
// TODO: this code breaks client/server separation!
if (sessions.empty())
{
bool success = smtk::common::PythonInterpreter::instance().loadPythonSourceFile(
files[i].toLatin1().constData());
if (success)
{
std::stringstream s;
s << "Loaded Python source file \"" << files[i].toLatin1().constData() << "\".";
vtkOutputWindowDisplayText(s.str().c_str());
}
else
{
std::stringstream s;
s << "Could not read Python source file \"" << files[i].toLatin1().constData() << "\".";
vtkGenericWarningMacro(<< s.str().c_str());
}
}
else
{
// if there are open sessions, then we try to import the python
// operator in each session. The import operator reads the python
// file on the server, and also updates the active session to
// incorporate the new operator into its operator list.
smtk::extension::qtModelOperationWidget* mow =
this->Internal->ModelDock->modelView()->operatorsWidget();
bool success = false;
for (auto& sref : sessions)
{
smtk::model::OperatorPtr opPtr = sref.session()->op("import python operator");
opPtr->findFile("filename")->setValue(files[i].toLatin1().constData());
smtk::model::OperatorResult opResult = opPtr->operate();
if (opResult->findInt("outcome")->value() ==
smtk::operation::Operator::OPERATION_SUCCEEDED)
{
success = true;
}
// Now that the operator is loaded and active on the server, we need
// to update the client-side manager.
this->modelManager()->managerProxy()->refreshSessionOperators(sref.entity());
// Additionally, we must manually update the ModelOperationWidget to
// reflect the potential changes in the operator list.
if (sref.session())
{
mow->refreshOperatorList();
}
}
if (success)
{
std::stringstream s;
s << "Loaded Python source file \"" << files[i].toLatin1().constData()
<< "\" into active sessions.";
vtkOutputWindowDisplayText(s.str().c_str());
}
else
{
std::stringstream s;
s << "Could not read Python source file \"" << files[i].toLatin1().constData()
<< "\" into any active sessions.";
vtkGenericWarningMacro(<< s.str().c_str());
}
}
}
}
}
void pqCMBModelBuilderMainWindowCore::zoomOnSelection()
{
}
......@@ -1449,7 +1544,6 @@ void pqCMBModelBuilderMainWindowCore::processModifiedEntities(
if (colorEntities.count() > 0 && isAssigningColors)
{
this->modelPanel()->changeSelEntitiesBlockVisibility(false);
qtActiveObjects::instance().smtkSelectionManager()->clearAllSelections();
}
// update auxiliary visibility
......@@ -1578,7 +1672,7 @@ bool pqCMBModelBuilderMainWindowCore::processOperatorResult(
const smtk::model::OperatorResult& result, const smtk::model::SessionRef& sref, bool hasNewModels,
bool bModelGeometryChanged, bool hasNewMeshes)
{
if (result->findInt("outcome")->value() != smtk::model::OPERATION_SUCCEEDED)
if (result->findInt("outcome")->value() != smtk::operation::Operator::OPERATION_SUCCEEDED)
{
return false;
}
......@@ -1665,6 +1759,14 @@ bool pqCMBModelBuilderMainWindowCore::processOperatorResult(
}
}
}
// Clear all selection when an operation finishes if needed
// For now only face - grow operator needs to show selection
smtk::attribute::VoidItemPtr showSelection = result->findVoid("show selection");
if (!showSelection)
{
qtActiveObjects::instance().smtkSelectionManager()->clearAllSelections();
}
return true;
}
......@@ -1866,3 +1968,29 @@ void pqCMBModelBuilderMainWindowCore::setSimBuilderModelManager()
QObject::connect(this->getSimBuilder()->uiManager(), SIGNAL(attAssociationChanged()), this,
SLOT(onColorByAttribute()));
}
void pqCMBModelBuilderMainWindowCore::initializeSMTKPythonEnvironment()
{
// Set up smtk::common::PythonInterpreter's path for ModelBuilder to find SMTK.
{
std::string smtkLibDir = smtk::common::Paths::pathToThisLibrary();
// We first look for SMTK as run from the build tree.
bool smtkFound = smtk::common::PythonInterpreter::instance().addPathToBuildTree(
smtkLibDir + "/../ThirdParty/SMTK", "smtk");
// If we don't find it, then we look for SMTK as an installed module.
if (!smtkFound)
{
smtkFound =
smtk::common::PythonInterpreter::instance().addPathToInstalledModule(smtkLibDir, "smtk");
}
// If we don't find it, then we look for SMTK as a packaged module.
if (!smtkFound)
{
smtkFound =
smtk::common::PythonInterpreter::instance().addPathToPackagedModule(smtkLibDir, "smtk");
}
}
}
......@@ -147,6 +147,8 @@ public slots:
void clearpqCMBSceneTree();
void onLoadScene();
void onImportPythonOperator();
// Resets the center of rotation to the center of the active
// source in the active view.
void resetCenterOfRotationToCenterOfCurrentData() override;
......@@ -239,6 +241,8 @@ protected:
bool abortActionForUnsavedWork(
const std::string& action, const smtk::model::SessionRef& sref = smtk::model::SessionRef());
void initializeSMTKPythonEnvironment();
private:
// Description:
// On successful completion of volume mesher, preview the mesh
......
......@@ -60,8 +60,8 @@
#include "smtk/io/LoadJSON.h"
#include "smtk/io/Logger.h"
#include "smtk/io/SaveJSON.h"
#include "smtk/mesh/Collection.h"
#include "smtk/mesh/Manager.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Manager.h"
#include "smtk/model/AuxiliaryGeometry.h"
#include "smtk/model/CellEntity.h"
#include "smtk/model/Events.h"
......@@ -1655,17 +1655,17 @@ void pqCMBModelManager::colorRepresentationByAttribute(pqDataRepresentation* rep
// Figure out which variant of the item to use, if it exists
if (!attItemName.isEmpty() && (attitem = (*itAtt)->find(attItemName.toStdString())))
{
if (attitem->type() == smtk::attribute::Item::DOUBLE)
if (attitem->type() == smtk::attribute::Item::DoubleType)
{
stritemval =
smtk::dynamic_pointer_cast<smtk::attribute::DoubleItem>(attitem)->valueAsString();
}
else if (attitem->type() == smtk::attribute::Item::INT)
else if (attitem->type() == smtk::attribute::Item::IntType)
{
stritemval =
smtk::dynamic_pointer_cast<smtk::attribute::IntItem>(attitem)->valueAsString();
}
else if (attitem->type() == smtk::attribute::Item::STRING)
else if (attitem->type() == smtk::attribute::Item::StringType)
{
stritemval = smtk::dynamic_pointer_cast<smtk::attribute::StringItem>(attitem)->value();
}
......@@ -1862,7 +1862,7 @@ bool pqCMBModelManager::startOperation(const smtk::model::OperatorPtr& brOp)
return false;
}
if (result->findInt("outcome")->value() != smtk::model::OPERATION_SUCCEEDED)
if (result->findInt("outcome")->value() != smtk::operation::Operator::OPERATION_SUCCEEDED)
{
std::cerr << "operator failed: " << brOp->name() << "\n";
smtk::io::Logger log;
......@@ -1948,7 +1948,7 @@ bool pqCMBModelManager::handleOperationResult(const smtk::model::OperatorResult&
smtk::io::SaveJSON::forOperatorResult(result, json);
std::cout << "Result " << cJSON_Print(json) << "\n";
*/
if (result->findInt("outcome")->value() != smtk::model::OPERATION_SUCCEEDED)
if (result->findInt("outcome")->value() != smtk::operation::Operator::OPERATION_SUCCEEDED)
{
std::cerr << "operator failed\n";
return false;
......
......@@ -15,7 +15,7 @@
#include "cmbSystemConfig.h"
#include "smtk/PublicPointerDefs.h"
#include "smtk/mesh/MeshSet.h"
#include "smtk/mesh/core/MeshSet.h"
#include "smtk/model/StringData.h"
#include "vtkNew.h"
#include "vtkSmartPointer.h"
......
......@@ -31,7 +31,7 @@
#include "pqUndoStack.h"
#include "smtk/extension/vtk/source/vtkModelMultiBlockSource.h"
#include "smtk/mesh/Collection.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/model/Group.h"
#include "vtkNew.h"
#include "vtkPVCompositeDataInformation.h"
......
......@@ -12,7 +12,7 @@
#define __pqModelBuilderViewContextMenuBehavior_h
#include "smtk/PublicPointerDefs.h"
#include "smtk/mesh/MeshSet.h"
#include "smtk/mesh/core/MeshSet.h"
#include "vtkType.h"
#include <QColor>
#include <QList>
......
......@@ -54,9 +54,9 @@
// SMTK includes
#include "smtk/extension/qt/qtActiveObjects.h"
#include "smtk/extension/qt/qtSelectionManager.h"
#include "smtk/mesh/Collection.h"
#include "smtk/mesh/DimensionTypes.h"
#include "smtk/mesh/Manager.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/DimensionTypes.h"
#include "smtk/mesh/core/Manager.h"
#include "smtk/model/CellEntity.h"
#include <array>
......
......@@ -16,7 +16,7 @@
#include "smtk/PublicPointerDefs.h"
#include "smtk/extension/qt/qtMeshSelectionItem.h"
#include "smtk/mesh/MeshSet.h"
#include "smtk/mesh/core/MeshSet.h"
#include "smtk/model/DescriptivePhrase.h"
#include "smtk/model/EntityRef.h"
......
......@@ -30,8 +30,8 @@
#include "vtkSMSourceProxy.h"
#include "smtk/common/UUID.h"
#include "smtk/mesh/Collection.h"
#include "smtk/mesh/Manager.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Manager.h"
#include "smtk/model/Group.h"
#include "smtk/model/IntegerData.h"
#include "smtk/model/Manager.h"
......
......@@ -27,10 +27,10 @@
#include "smtk/io/Logger.h"
#include "smtk/io/SaveJSON.h"
#include "smtk/common/View.h"
#include "smtk/extension/qt/qtActiveObjects.h"
#include "smtk/extension/qt/qtCollapsibleGroupWidget.h"
#include "smtk/extension/qt/qtUIManager.h"
#include "smtk/view/View.h"
#include "smtk/AutoInit.h" // for smtkComponentInitMacro
......@@ -207,7 +207,7 @@ void pqSMTKMeshPanel::displayRequirements(const smtk::model::Model& modelToDispl
this->AttCollection, reqs.requirements(), reqs.requirementsSize(), inputLogger);
}
smtk::common::ViewPtr root = this->AttCollection->findTopLevelView();
smtk::view::ViewPtr root = this->AttCollection->findTopLevelView();
const bool useInternalFileBrowser = true;
this->AttUIManager.reset(new smtk::extension::qtUIManager(this->AttCollection));
this->AttUIManager->setSMTKView(root, this->RequirementsWidget.data(), useInternalFileBrowser);
......@@ -219,10 +219,10 @@ void pqSMTKMeshPanel::displayRequirements(const smtk::model::Model& modelToDispl
QObject::connect(this->AttUIManager.get(),
SIGNAL(sendSelectionsFromAttributePanelToSelectionManager(const smtk::model::EntityRefs&,
const smtk::mesh::