...
 
Commits (23)
......@@ -16,7 +16,6 @@ set(UI_FORMS
UI/qtArcFunctionControl.ui
UI/qtCMBArcModifierInputDialog.ui
UI/qtCMBApplicationOptions.ui
UI/qtCMBBathymetryDialog.ui
UI/qtCMBConicalSourceDialog.ui
UI/qtCMBCreateSimpleGeometry.ui
UI/qtCMBOptionsDialog.ui
......@@ -163,8 +162,6 @@ add_library(cmbAppCommon
qtCMBApplicationOptions.h
qtCMBApplicationOptionsDialog.cxx
qtCMBApplicationOptionsDialog.h
qtCMBBathymetryDialog.cxx
qtCMBBathymetryDialog.h
qtCMBColorDialog.cxx
qtCMBColorDialog.h
qtCMBConeDialog.cxx
......
......@@ -64,7 +64,6 @@
#include "pqCMBUniformGrid.h"
#include "pqPlanarTextureRegistrationDialog.h"
#include "qtCMBArcWidgetManager.h"
#include "qtCMBBathymetryDialog.h"
#include "qtCMBConeNodeDialog.h"
#include "qtCMBGenerateContoursDialog.h"
#include "qtCMBGroundPlaneDialog.h"
......@@ -111,7 +110,6 @@ pqCMBSceneTree::pqCMBSceneTree(QPixmap* visPixMap, QPixmap* ivisPixMap, QPixmap*
this->SetNodeColorAction = NULL;
this->UnsetNodeColorAction = NULL;
this->ChangeTextureAction = NULL;
this->ApplyBathymetryAction = NULL;
this->VOIAction = NULL;
this->LineAction = NULL;
this->ArcAction = NULL;
......@@ -374,22 +372,6 @@ void pqCMBSceneTree::empty()
{
this->nodesSelected(true);
}
// Need to delete those nodes that depending on other nodes
// For examples, polygons that have bathymetry applied to them.
std::vector<pqCMBSceneNode*> bathymetries;
SceneObjectNodeIterator iter(this->Root);
iter.addObjectTypeFilter(pqCMBSceneObjectBase::Polygon);
iter.addObjectTypeFilter(pqCMBSceneObjectBase::Faceted);
pqCMBSceneNode* node;
while ((node = iter.next()))
{
pqCMBTexturedObject* tobj = dynamic_cast<pqCMBTexturedObject*>(node->getDataObject());
if (tobj && tobj->getBathymetrySource())
{
tobj->unApplyBathymetry();
delete node;
}
}
if (this->Root)
{
......@@ -775,7 +757,6 @@ void pqCMBSceneTree::nodesSelected(bool clearSelection /*=false*/)
this->updateSnapOptions();
this->updateSelectedColorMode();
this->updateTexturedObjectOptions();
this->updateBathymetryOptions();
this->updateTINStitchOptions();
this->updateTINStackOptions();
this->updateGenerateArcsOptions();
......@@ -871,24 +852,6 @@ void pqCMBSceneTree::updateTexturedObjectOptions()
}
}
void pqCMBSceneTree::updateBathymetryOptions()
{
pqCMBTexturedObject* tobj = NULL;
bool enabled0 = false;
if ((this->Selected.size() == 1) && (!this->Selected[0]->isTypeNode()))
{
tobj = dynamic_cast<pqCMBTexturedObject*>(this->Selected[0]->getDataObject());
if (tobj)
{
enabled0 = true;
}
}
if (this->ApplyBathymetryAction)
{
this->ApplyBathymetryAction->setEnabled(enabled0);
}
}
void pqCMBSceneTree::updateDefineVOIOption()
{
if (this->DefineVOIAction)
......@@ -2689,21 +2652,6 @@ void pqCMBSceneTree::setTextureAction(QAction* changeAction)
this->updateTexturedObjectOptions();
}
void pqCMBSceneTree::setApplyBathymetryAction(QAction* changeAction)
{
if (this->ApplyBathymetryAction)
{
this->PropertiesMenu->removeAction(this->ApplyBathymetryAction);
}
this->ApplyBathymetryAction = changeAction;
if (this->ApplyBathymetryAction)
{
this->PropertiesMenu->addAction(this->ApplyBathymetryAction);
QObject::connect(changeAction, SIGNAL(triggered()), this, SLOT(editBathymetry()));
}
this->updateBathymetryOptions();
}
void pqCMBSceneTree::setUndoRedoActions(QAction* undoAction, QAction* redoAction)
{
if (this->UndoAction)
......@@ -3528,24 +3476,6 @@ void pqCMBSceneTree::updateElevation()
}
}
void pqCMBSceneTree::editBathymetry()
{
if ((this->Selected.size() != 1) || (this->Selected[0]->isTypeNode()))
{
return;
}
pqCMBTexturedObject* tobj =
dynamic_cast<pqCMBTexturedObject*>(this->Selected[0]->getDataObject());
if (tobj)
{
if (qtCMBBathymetryDialog::manageBathymetry(this->Selected[0]))
{
this->sceneObjectChanged();
}
}
}
void pqCMBSceneTree::selectLineNode()
{
qtLineWidget* const lineWidget = qobject_cast<qtLineWidget*>(QObject::sender());
......
......@@ -115,7 +115,6 @@ public:
void changeName(pqCMBSceneNode* node, const char* newName);
void setApplyBathymetryAction(QAction* changeAction);
void setArcActions(QAction* edit, QAction* mergeEndNodes, QAction* mergeArcs,
QAction* growArcSelection, QAction* autoConnectArcs);
void setChangeNumberOfPointsLoadedAction(QAction* action);
......@@ -236,8 +235,6 @@ public slots:
void updateSelectedColorMode();
void updateSnapOptions();
void updateTexturedObjectOptions();
void updateBathymetryOptions();
void editBathymetry();
void updateTINStitchOptions();
void updateTINStackOptions();
void updateGenerateArcsOptions();
......@@ -354,7 +351,6 @@ protected:
QAction* SetNodeColorAction;
QAction* UnsetNodeColorAction;
QAction* ChangeTextureAction;
QAction* ApplyBathymetryAction;
QAction* ChangeNumberOfPointsLoadedAction;
QAction* TINStitchAction;
QAction* TINStackAction;
......
......@@ -1059,24 +1059,6 @@ void pqCMBSceneV2Reader::processObject(vtkXMLDataElement* elem)
}
}
e = elem->FindNestedElementWithName("BathymetryInfo");
if (e)
{
int status = this->processBathymetryInfo(e, obj);
if (status == -1)
{
std::string estring = elem->GetAttribute("Name");
estring += " can not have a bathymetry source associated with it";
this->appendStatus(estring);
}
else if (status == -2)
{
std::string estring = elem->GetAttribute("Name");
estring += " does not have a valid bathymetry source associated with it";
this->appendStatus(estring);
}
}
e = elem->FindNestedElementWithName("ShowElevation");
if (e)
{
......@@ -1147,32 +1129,6 @@ int pqCMBSceneV2Reader::processTextureInfo(vtkXMLDataElement* elem, pqCMBSceneOb
return 0;
}
int pqCMBSceneV2Reader::processBathymetryInfo(vtkXMLDataElement* elem, pqCMBSceneObjectBase* obj)
{
pqCMBTexturedObject* tobj = dynamic_cast<pqCMBTexturedObject*>(obj);
if (tobj == NULL)
{
return -1;
}
vtkXMLDataElement* bathyDE = elem->FindNestedElementWithName("BathymetrySource");
if (!bathyDE)
{
return -2;
}
std::string sourceObjName = bathyDE->GetAttribute("Name");
pqCMBSceneNode* node = this->Tree->getSceneNodeByName(sourceObjName.c_str());
if (!node)
{
return -2;
}
double radius;
// NOTE: Other bathymetry parameters (low and high limits) are not saved currently.
int numRead = bathyDE->GetScalarAttribute("ElevationRadius", radius);
radius = numRead > 0 ? radius : 1.0;
tobj->applyBathymetry(node->getDataObject(), radius);
return 0;
}
void pqCMBSceneV2Reader::processConstraints(
vtkXMLDataElement* constraintSection, pqCMBSceneObjectBase* obj)
{
......
......@@ -84,7 +84,6 @@ protected:
pqCMBSceneObjectBase* processUnknownObject(vtkXMLDataElement* elem);
void processConstraints(vtkXMLDataElement*, pqCMBSceneObjectBase*);
int processTextureInfo(vtkXMLDataElement*, pqCMBSceneObjectBase*);
int processBathymetryInfo(vtkXMLDataElement*, pqCMBSceneObjectBase*);
void appendStatus(const std::string& newStatus);
void createContour(vtkSMSourceProxy* proxy);
......
......@@ -922,13 +922,6 @@ void pqCMBSceneV2Writer::processGeometricProperties(pqCMBSceneNode* node, vtkXML
elem->AddNestedElement(ce);
ce->Delete();
}
// Save BathymetryInfo
if (tobj->getBathymetrySource())
{
ce = this->addBathyMetryInfo(tobj);
elem->AddNestedElement(ce);
ce->Delete();
}
// Save Elevation
if (tobj->showingElevation())
{
......@@ -1056,25 +1049,6 @@ vtkXMLDataElement* pqCMBSceneV2Writer::addTextureInfo(pqCMBTexturedObject* obj)
return elem;
}
vtkXMLDataElement* pqCMBSceneV2Writer::addBathyMetryInfo(pqCMBTexturedObject* obj)
{
pqCMBSceneNode* bathynode = this->Tree->getSceneObjectNode(obj->getBathymetrySource());
if (!bathynode)
{
return NULL;
}
vtkXMLDataElement* elem = vtkXMLDataElement::New();
elem->SetName("BathymetryInfo");
vtkXMLDataElement* bathyDE = vtkXMLDataElement::New();
bathyDE->SetName("BathymetrySource");
bathyDE->SetAttribute("Name", bathynode->getName());
// NOTE: Other bathymetry parameters (low and high limits) are not saved currently.
bathyDE->SetDoubleAttribute("ElevationRadius", obj->getBathymetryElevationRadious());
elem->AddNestedElement(bathyDE);
bathyDE->Delete();
return elem;
}
std::string pqCMBSceneV2Writer::getContourFileName(bool packageScene, std::string absoluteFileName)
{
//the scene file only uses relative paths, so we need to query the writer
......
......@@ -53,7 +53,6 @@ protected:
vtkXMLDataElement* getUserDefinedObjectTypes();
vtkXMLDataElement* addConstraints(pqCMBSceneObjectBase* obj);
vtkXMLDataElement* addTextureInfo(pqCMBTexturedObject* obj);
vtkXMLDataElement* addBathyMetryInfo(pqCMBTexturedObject* obj);
void processVOI(pqCMBSceneNode* node, vtkXMLDataElement* elem);
void processLine(pqCMBSceneNode* node, vtkXMLDataElement* elem);
void processContour(pqCMBSceneNode* node, vtkXMLDataElement* elem);
......
......@@ -52,7 +52,6 @@ pqCMBTexturedObject::pqCMBTexturedObject()
: pqCMBSceneObjectBase()
{
this->NumberOfRegistrationPoints = 0;
this->BathymetrySource = NULL;
this->ShowElevation = false;
}
......@@ -62,7 +61,6 @@ pqCMBTexturedObject::pqCMBTexturedObject(
{
this->prepTexturedObject(server, view);
this->NumberOfRegistrationPoints = 0;
this->BathymetrySource = NULL;
this->ShowElevation = false;
}
......@@ -94,16 +92,6 @@ pqCMBTexturedObject::~pqCMBTexturedObject()
builder->destroy(this->RegisterTextureFilter);
this->RegisterTextureFilter = NULL;
}
if (this->BathymetryFilter)
{
builder->destroy(this->BathymetryFilter);
this->BathymetryFilter = NULL;
}
if (this->BathymetrySource)
{
this->BathymetrySource = 0;
}
}
pqPipelineSource* pqCMBTexturedObject::getSelectionSource() const
......@@ -127,7 +115,7 @@ void pqCMBTexturedObject::setSelectionInput(vtkSMSourceProxy* selectionInput)
void pqCMBTexturedObject::getDataBounds(double bounds[6]) const
{
vtkSMSourceProxy::SafeDownCast(this->BathymetryFilter->getProxy())
vtkSMSourceProxy::SafeDownCast(this->ElevationFilter->getProxy())
->GetDataInformation()
->GetBounds(bounds);
}
......@@ -150,20 +138,6 @@ void pqCMBTexturedObject::prepTexturedObject(pqServer* /*server*/, pqRenderView*
pqObjectBuilder* builder = core->getObjectBuilder();
this->Source->getProxy()->UpdateVTKObjects();
// Add in the ApplyBathymetry Filter, by default it is just
// a ShallowCopy (NoOP)
this->BathymetryFilter = builder->createFilter("filters", "CmbApplyBathymetry", this->Source);
vtkSMPropertyHelper(this->BathymetryFilter->getProxy(), "NoOP").Set(1);
this->BathymetryFilter->getProxy()->UpdateVTKObjects();
this->ElevationRadious = 1.0;
// force pipeline update
vtkSMSourceProxy::SafeDownCast(this->BathymetryFilter->getProxy())->UpdatePipeline();
this->RegisterTextureFilter =
builder->createFilter("filters", "RegisterPlanarTextureMapFilter", this->BathymetryFilter);
vtkSMPropertyHelper(this->RegisterTextureFilter->getProxy(), "GenerateCoordinates").Set(0);
this->RegisterTextureFilter->getProxy()->UpdateVTKObjects();
this->ElevationFilter =
builder->createFilter("filters", "LIDARElevationFilter", this->RegisterTextureFilter);
vtkSMPropertyHelper(this->ElevationFilter->getProxy(), "CreateElevation").Set(0);
......@@ -367,58 +341,3 @@ double pqCMBTexturedObject::getTextureIntensityAtPoint(double pt[3])
fproxy->UpdatePropertyInformation();
return vtkSMPropertyHelper(fproxy, "Intensity").GetAsDouble();
}
pqCMBSceneObjectBase* pqCMBTexturedObject::getBathymetrySource()
{
return this->BathymetrySource;
}
void pqCMBTexturedObject::unApplyBathymetry()
{
if (this->BathymetrySource)
{
this->BathymetrySource = 0;
}
vtkSMProxyProperty* pSource =
vtkSMProxyProperty::SafeDownCast(this->BathymetryFilter->getProxy()->GetProperty("Source"));
pSource->RemoveAllProxies();
vtkSMPropertyHelper(this->BathymetryFilter->getProxy(), "NoOP").Set(1);
this->ElevationRadious = 1.0;
this->BathymetryFilter->getProxy()->UpdateVTKObjects();
this->getRepresentation()->getProxy()->UpdateVTKObjects();
}
void pqCMBTexturedObject::applyBathymetry(pqCMBSceneObjectBase* bathymetrySource,
double elevationRadious, bool useHighLimit, double eleHigh, bool useLowLimit, double eleLow)
{
if (this->BathymetrySource && this->BathymetrySource != bathymetrySource)
{
this->unApplyBathymetry();
}
if ((!this->BathymetrySource && bathymetrySource) || this->BathymetrySource)
/* (this->BathymetrySource && this->ElevationRadious != elevationRadious))*/
{
pqWaitCursor cursor;
this->BathymetrySource = bathymetrySource;
vtkSMSourceProxy::SafeDownCast(this->BathymetrySource->getSource()->getProxy())
->UpdatePipeline();
vtkSMSourceProxy* smFilter = vtkSMSourceProxy::SafeDownCast(this->BathymetryFilter->getProxy());
vtkSMProxyProperty* pSource = vtkSMProxyProperty::SafeDownCast(smFilter->GetProperty("Source"));
pSource->RemoveAllProxies();
pSource->AddProxy(this->BathymetrySource->getSource()->getProxy());
vtkSMPropertyHelper(smFilter, "ElevationRadius").Set(elevationRadious);
this->ElevationRadious = elevationRadious;
vtkSMPropertyHelper(smFilter, "HighestZValue").Set(eleHigh);
vtkSMPropertyHelper(smFilter, "UseHighestZValue").Set(useHighLimit);
vtkSMPropertyHelper(smFilter, "LowestZValue").Set(eleLow);
vtkSMPropertyHelper(smFilter, "UseLowestZValue").Set(useLowLimit);
vtkSMPropertyHelper(smFilter, "NoOP").Set(0);
smFilter->UpdateVTKObjects();
smFilter->UpdatePipeline();
this->getRepresentation()->getProxy()->UpdateVTKObjects();
}
}
......@@ -24,7 +24,7 @@ public:
pqCMBTexturedObject(pqPipelineSource* source, pqRenderView* view, pqServer* server);
~pqCMBTexturedObject() override;
/// Returns the Bounds of the data. - Returns the output of the Bathymetry
/// Returns the Bounds of the data. - Returns the output of the Elevation
void getDataBounds(double bounds[6]) const override;
pqPipelineSource* getSelectionSource() const override;
void setSelectionInput(vtkSMSourceProxy* selectionInput) override;
......@@ -44,11 +44,6 @@ public:
void getRegistrationPointPair(int i, double xy[2], double st[2]) const;
double getTextureIntensityAtPoint(double pt[3]);
void applyBathymetry(pqCMBSceneObjectBase* bathymetrySource, double elevationRadious,
bool useHighLimit = false, double eleHigh = 0.0, bool useLowLimit = false, double eleLow = 0.0);
void unApplyBathymetry();
pqCMBSceneObjectBase* getBathymetrySource();
double getBathymetryElevationRadious() { return this->ElevationRadious; }
pqServer* getTextureRegistrationServer(void);
void setTextureMap(const char* filename, int numberOfRegistrationPoints, double* points);
......@@ -63,9 +58,6 @@ protected:
int NumberOfRegistrationPoints;
double RegistrationPoints[12];
QPointer<pqPipelineSource> BathymetryFilter;
pqCMBSceneObjectBase* BathymetrySource;
double ElevationRadious;
bool ShowElevation;
void prepTexturedObject(pqServer* server, pqRenderView* view);
void duplicateInternals(pqCMBSceneObjectBase* obj) override;
......
......@@ -494,13 +494,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Bathymetry Radius</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
......@@ -524,8 +517,8 @@
<item row="1" column="1" colspan="2">
<widget class="QDoubleSpinBox" name="SearchRadius">
<property name="toolTip">
<string>Controls the search radius for the data points used in computing the z value of the grid point.
Larger the radius, the more points used to compute z value. More points result in smoothing
<string>Controls the search radius for the data points used in computing the z value of the grid point.
Larger the radius, the more points used to compute z value. More points result in smoothing
and slower runtimes. Too few points result in gaps in the estimation of change.</string>
</property>
</widget>
......@@ -533,7 +526,7 @@ and slower runtimes. Too few points result in gaps in the estimation of change.
<item row="0" column="1" colspan="2">
<widget class="QDoubleSpinBox" name="SamplingSize">
<property name="toolTip">
<string>The distance between grid points. Smaller spacing results in more points.
<string>The distance between grid points. Smaller spacing results in more points.
This results in more accurate estimation but slower run time.</string>
</property>
</widget>
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>qtCMBBathymetryDialog</class>
<widget class="QDialog" name="qtCMBBathymetryDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>522</width>
<height>246</height>
</rect>
</property>
<property name="windowTitle">
<string>Bathymetry Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="3">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Bathymetry Source</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="BathymetrySources"/>
</item>
<item>
<widget class="QPushButton" name="FileBrowserButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Browse ...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" colspan="3">
<widget class="QGroupBox" name="ParametersGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Parameters</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Radius for Averaging Elevation:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="ElevationRadius"/>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBoxHighLimit">
<property name="text">
<string>Set Highest Elevation</string>
</property>
</widget>
</item>
<item row="1" column="1" rowspan="2">
<widget class="QLineEdit" name="highElevation">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0" rowspan="2">
<widget class="QCheckBox" name="checkBoxLowLimit">
<property name="text">
<string>Set Lowest Elevation</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lowElevation">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="RemoveBathymetryButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Remove Bathymetry</string>
</property>
</widget>
</item>
<item row="4" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>162</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QCheckBox" name="OnlyApplyToVisibleMesh">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Apply bathymetry only to the visible meshes on the model</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>qtCMBBathymetryDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>510</x>
<y>234</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>245</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>qtCMBBathymetryDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>510</x>
<y>234</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>245</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkBoxHighLimit</sender>
<signal>toggled(bool)</signal>
<receiver>highElevation</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>127</x>
<y>116</y>
</hint>
<hint type="destinationlabel">
<x>260</x>
<y>118</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkBoxLowLimit</sender>
<signal>toggled(bool)</signal>
<receiver>lowElevation</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>94</x>
<y>147</y>
</hint>
<hint type="destinationlabel">
<x>239</x>
<y>154</y>
</hint>
</hints>
</connection>
</connections>
</ui>
......@@ -1264,14 +1264,6 @@
<string>Select Surface Cell with Contour Widget (2D Camera Mode)</string>
</property>
</action>
<action name="actionApplyBathymetry">
<property name="text">
<string>Edit Bathymetry</string>
</property>
<property name="toolTip">
<string>Apply or Remove Bathymetry</string>
</property>
</action>
<action name="actionExportSelectedPolygons">
<property name="text">
<string>Export Selected Polygons</string>
......
//=========================================================================
// 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.
//=========================================================================
// .NAME Represents a dialog for texturing objects into SceneGen.
// .SECTION Description
// .SECTION Caveats
#include "qtCMBBathymetryDialog.h"
#include "./Scene/Core/pqCMBSceneNodeIterator.h"
#include "pqCMBSceneNode.h"
#include "pqCMBSceneTree.h"
#include "pqCMBTexturedObject.h"
#include "ui_qtCMBBathymetryDialog.h"
//#include <pqFileDialog.h>
//#include <QFileInfo>
#include "pqPipelineSource.h"
#include "qtCMBSceneObjectImporter.h"
#include <QDoubleValidator>
#include <QLineEdit>
#include <QStackedWidget>
#include <QTreeWidget>
int qtCMBBathymetryDialog::manageBathymetry(pqCMBSceneNode* node)
{
if (!node || node->isTypeNode())
{
return 0;
}
if (dynamic_cast<pqCMBTexturedObject*>(node->getDataObject()) == NULL)
{
return 0;
}
qtCMBBathymetryDialog importer(node);
return importer.exec();
}
qtCMBBathymetryDialog::qtCMBBathymetryDialog(pqCMBSceneTree* sceneTree)
: Status(-1)
, Node(0)
, SceneTree(sceneTree)
{
this->initUI();
}
qtCMBBathymetryDialog::qtCMBBathymetryDialog(pqCMBSceneNode* n)
: Status(-1)
, Node(n)
{
if (!n || !n->getDataObject())
{
return;
}
pqCMBTexturedObject* object = dynamic_cast<pqCMBTexturedObject*>(n->getDataObject());
if (!object)
{
return;
}
this->SceneTree = this->Node->getTree();
this->initUI();
}
qtCMBBathymetryDialog::~qtCMBBathymetryDialog()
{
if (this->BathymetryDialog)
{
delete BathymetryDialog;
}
if (this->MainDialog)
{
delete MainDialog;
}
}
int qtCMBBathymetryDialog::exec()
{
this->MainDialog->setModal(true);
this->MainDialog->show();
this->MainDialog->exec();
return this->Status;
}
void qtCMBBathymetryDialog::accept()
{
if (!this->bathymetrySourceObject())
{
return;
}
if (this->Node)
{
pqCMBTexturedObject* object = dynamic_cast<pqCMBTexturedObject*>(this->Node->getDataObject());
object->applyBathymetry(this->bathymetrySourceObject(),
this->BathymetryDialog->ElevationRadius->text().toDouble(), this->useHighElevationLimit(),
this->highElevationLimit(), this->useLowElevationLimit(), this->lowElevationLimit());
}
else
{
// Whoever using this dialog will get bathymetrySourceObject() and elevationRadius.
}
this->MainDialog->close();
this->Status = 1;
}
void qtCMBBathymetryDialog::cancel()
{
this->Status = 0;
}
void qtCMBBathymetryDialog::displaySourceImporter()
{
bool randomPlacement, translateBasedOnView, useTextureConstraint, useGlyphs;
int count, glyphPlaybackOption;
QMap<pqCMBSceneNode*, int> constraints;
QString glyphPlaybackFilename;
bool enableRandomPlacement = false, enableTextureConstraintPlacement = false;
bool useGlyphPlayback = false;
pqCMBSceneNode* node = qtCMBSceneObjectImporter::importNode(this->SceneTree->getRoot(),
enableRandomPlacement, enableTextureConstraintPlacement, &randomPlacement,
&translateBasedOnView, &count, constraints, useGlyphs, useTextureConstraint, useGlyphPlayback,
glyphPlaybackOption, glyphPlaybackFilename);
if (!node || (node->isTypeNode() && node->getChildren().size() == 0))
{
return;
}
pqCMBSceneObjectBase* sObj =
node->isTypeNode() ? node->getChildren()[0]->getDataObject() : node->getDataObject();
this->BathymetryDialog->BathymetrySources->addItem(node->getName());
QVariant vdata;
vdata.setValue(static_cast<void*>(sObj));
int idx = this->BathymetryDialog->BathymetrySources->count() - 1;
this->BathymetryDialog->BathymetrySources->setCurrentIndex(idx);
this->BathymetryDialog->BathymetrySources->setItemData(idx, vdata);
}
pqCMBSceneObjectBase* qtCMBBathymetryDialog::bathymetrySourceObject() const
{
int n = this->BathymetryDialog->BathymetrySources->currentIndex();
pqCMBSceneObjectBase* sObj = static_cast<pqCMBSceneObjectBase*>(
this->BathymetryDialog->BathymetrySources->itemData(n).value<void*>());
return sObj;
}
double qtCMBBathymetryDialog::elevationRadius()
{
return this->BathymetryDialog->ElevationRadius->text().toDouble();
}
double qtCMBBathymetryDialog::highElevationLimit()
{
return this->BathymetryDialog->highElevation->text().toDouble();
}
double qtCMBBathymetryDialog::lowElevationLimit()
{
return this->BathymetryDialog->lowElevation->text().toDouble();
}
bool qtCMBBathymetryDialog::useHighElevationLimit()
{
return this->BathymetryDialog->checkBoxHighLimit->isChecked();
}
bool qtCMBBathymetryDialog::useLowElevationLimit()
{
return this->BathymetryDialog->checkBoxLowLimit->isChecked();
}
bool qtCMBBathymetryDialog::applyOnlyToVisibleMeshes()
{
return this->BathymetryDialog->OnlyApplyToVisibleMesh->isChecked();
}
void qtCMBBathymetryDialog::removeBathymetry()
{
if (this->Node)
{
pqCMBTexturedObject* object = dynamic_cast<pqCMBTexturedObject*>(this->Node->getDataObject());
object->unApplyBathymetry();
this->Node->getTree()->sceneObjectChanged();
}
else
{
}
this->MainDialog->close();
this->Status = 2;
}
void qtCMBBathymetryDialog::initUI()
{
if (!this->SceneTree)
{
return;
}
if (!this->SceneTree->getRoot())
{
this->SceneTree->createRoot("Scene");
}
this->ModelAndMeshMode = false;
this->MainDialog = new QDialog(this->SceneTree->getWidget());
QDoubleValidator* validator = new QDoubleValidator(this->MainDialog);
this->BathymetryDialog = new Ui::qtCMBBathymetryDialog;
this->BathymetryDialog->setupUi(MainDialog);
// Prep the line edit widgets
//validator->setRange(0.001, VTK_DOUBLE_MAX);
validator->setBottom(0.0);
this->BathymetryDialog->ElevationRadius->setValidator(validator);
this->BathymetryDialog->ElevationRadius->setText("1.0");
pqCMBTexturedObject* tObject =
this->Node ? dynamic_cast<pqCMBTexturedObject*>(this->Node->getDataObject()) : NULL;
pqCMBSceneNode* node;
SceneObjectNodeIterator iter(this->SceneTree->getRoot());
iter.addObjectTypeFilter(pqCMBSceneObjectBase::Points);
iter.addObjectTypeFilter(pqCMBSceneObjectBase::UniformGrid);
iter.addObjectTypeFilter(pqCMBSceneObjectBase::GroundPlane);
iter.addObjectTypeFilter(pqCMBSceneObjectBase::Faceted);
int idx = 0, currentIdx = -1;
while ((node = iter.next()))
{
this->BathymetryDialog->BathymetrySources->addItem(node->getName());
QVariant vdata;
vdata.setValue(static_cast<void*>(node->getDataObject()));
this->BathymetryDialog->BathymetrySources->setItemData(idx, vdata);
if (tObject && currentIdx == -1 && tObject->getBathymetrySource() &&
tObject->getBathymetrySource() == node->getDataObject())
{
currentIdx = idx;
}
idx++;
}
if (currentIdx >= 0)
{
this->BathymetryDialog->BathymetrySources->setCurrentIndex(currentIdx);
}
QDoubleValidator* eleValidator = new QDoubleValidator(this->MainDialog);
this->BathymetryDialog->lowElevation->setValidator(eleValidator);
this->BathymetryDialog->lowElevation->setText("0.0");
this->BathymetryDialog->highElevation->setValidator(eleValidator);
this->BathymetryDialog->highElevation->setText("0.0");
bool enable = (!tObject || (tObject && tObject->getBathymetrySource())) ? true : false;
this->BathymetryDialog->RemoveBathymetryButton->setEnabled(enable);
this->setMeshAndModelMode(this->ModelAndMeshMode);
this->initConnections();
}
void qtCMBBathymetryDialog::initConnections()
{
QObject::connect(this->BathymetryDialog->RemoveBathymetryButton, SIGNAL(clicked()), this,
SLOT(removeBathymetry()));
QObject::connect(this->MainDialog, SIGNAL(accepted()), this, SLOT(accept()));
QObject::connect(this->MainDialog, SIGNAL(rejected()), this, SLOT(cancel()));
QObject::connect(this->BathymetryDialog->FileBrowserButton, SIGNAL(clicked()), this,
SLOT(displaySourceImporter()));
}
void qtCMBBathymetryDialog::setMeshAndModelMode(bool isModel)
{
this->ModelAndMeshMode = isModel;
this->BathymetryDialog->OnlyApplyToVisibleMesh->setVisible(isModel);
}
//=========================================================================
// 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.
//=========================================================================
// .NAME qtCMBBathymetryDialog - manages the node's Bathymetry information.
// .SECTION Description
// .SECTION Caveats
#ifndef __qtCMBBathymetryDialog_h
#define __qtCMBBathymetryDialog_h
#include "cmbAppCommonExport.h"
#include "cmbSystemConfig.h"
#include <QObject>
#include <QStringList>
#include <vector>
class pqCMBSceneNode;
class pqCMBSceneObjectBase;
class QDialog;
class pqServer;
class pqCMBSceneTree;
class qtCMBSceneObjectImporter;
namespace Ui
{
class qtCMBBathymetryDialog;
};
class CMBAPPCOMMON_EXPORT qtCMBBathymetryDialog : public QObject
{
Q_OBJECT
public:
static int manageBathymetry(pqCMBSceneNode* node);
qtCMBBathymetryDialog(pqCMBSceneTree* sceneTree);
~qtCMBBathymetryDialog() override;
pqCMBSceneObjectBase* bathymetrySourceObject() const;
double elevationRadius();
double highElevationLimit();
double lowElevationLimit();
bool useHighElevationLimit();
bool useLowElevationLimit();
bool applyOnlyToVisibleMeshes();
void setMeshAndModelMode(bool);
int exec();
protected slots:
void accept();
void cancel();
void displaySourceImporter();
void removeBathymetry();
protected:
qtCMBBathymetryDialog(pqCMBSceneNode* n);
void initConnections();
void initUI();
int Status; // 0, cancel; 1, accept; 2, reverse/remove
bool ModelAndMeshMode;
Ui::qtCMBBathymetryDialog* BathymetryDialog;
QDialog* MainDialog;
pqCMBSceneNode* Node;
pqCMBSceneTree* SceneTree;
qtCMBSceneObjectImporter* ObjectImporter;
};
#endif /* __qtCMBBathymetryDialog_h */
......@@ -117,13 +117,9 @@ void pqSimBuilderUIManager::setSMTKView(smtk::view::ViewPtr view, QWidget* paren
SLOT(onModelEntityItemCreated(smtk::extension::qtModelEntityItem*)));
// send signal from UIManager to selection manager
QObject::connect(this->m_attUIManager,
SIGNAL(sendSelectionsFromAttributePanelToSelectionManager(const smtk::model::EntityRefs&,
const smtk::mesh::MeshSets&, const smtk::model::DescriptivePhrases&,
const smtk::resource::SelectionAction, const std::string&)),
&smtk::extension::qtUIManager::sendSelectionsFromAttributePanelToSelectionManager,
qtActiveObjects::instance().smtkSelectionManager().get(),
SLOT(updateSelectedItems(const smtk::model::EntityRefs&, const smtk::mesh::MeshSets&,
const smtk::model::DescriptivePhrases&, const smtk::resource::SelectionAction,
const std::string&)));
&smtk::extension::qtSelectionManager::updateSelectedItems);
this->m_attUIManager->setSMTKView(view, parentWidget);
if (!this->topView())
......
......@@ -55,6 +55,8 @@ def verifyExport():
return 0
else:
print("Output not the same!")
print('testfile: %s' % testfile)
print('basefile: %s' % basefile)
return -3
......
......@@ -70,7 +70,6 @@
#include "vtkVariant.h"
#include "qtCMBAboutDialog.h"
#include "qtCMBBathymetryDialog.h"
#include "qtCMBCreateSimpleGeometry.h"
#include "qtCMBHelpDialog.h"
#include "qtCMBTreeWidget.h"
......
......@@ -919,8 +919,6 @@ void pqCMBModelBuilderMainWindowCore::onCloseData(bool modelOnly)
}
// this->getCMBModel()->onCloseData();
// Some scene object source may be used by model bathymetry filter,
// so it should be cleaned after model.
if (!modelOnly)
{
this->clearpqCMBSceneTree();
......
......@@ -217,13 +217,9 @@ void pqSMTKMeshPanel::displayRequirements(const smtk::model::Model& modelToDispl
// send signal from UIManager to selection manager
QObject::connect(this->AttUIManager.get(),
SIGNAL(sendSelectionsFromAttributePanelToSelectionManager(const smtk::model::EntityRefs&,
const smtk::mesh::MeshSets&, const smtk::model::DescriptivePhrases&,
const smtk::resource::SelectionAction, const std::string&)),
&smtk::extension::qtUIManager::sendSelectionsFromAttributePanelToSelectionManager,
qtActiveObjects::instance().smtkSelectionManager().get(),
SLOT(updateSelectedItems(const smtk::model::EntityRefs&, const smtk::mesh::MeshSets&,
const smtk::model::DescriptivePhrases&, const smtk::resource::SelectionAction,
const std::string&)));
&smtk::extension::qtSelectionManager::updateSelectedItems);
// connect signal and slot for qtModelEntityItem
QObject::connect(this->AttUIManager.get(),
SIGNAL(modelEntityItemCreated(smtk::extension::qtModelEntityItem*)), this,
......
......@@ -150,10 +150,10 @@ pqSMTKModelPanel::pqSMTKModelPanel(pqCMBModelManager* mmgr, QWidget* p)
QObject::connect(this,
SIGNAL(sendSelectionsFromRenderWindowToSelectionManager(const smtk::model::EntityRefs&,
const smtk::mesh::MeshSets&, const smtk::model::DescriptivePhrases&,
const smtk::resource::SelectionAction, const std::string&)),
const smtk::view::SelectionAction, const std::string&)),
qtActiveObjects::instance().smtkSelectionManager().get(),
SLOT(updateSelectedItems(const smtk::model::EntityRefs&, const smtk::mesh::MeshSets&,
const smtk::model::DescriptivePhrases&, const smtk::resource::SelectionAction,
const smtk::model::DescriptivePhrases&, const smtk::view::SelectionAction,
const std::string&)));
QObject::connect(qtActiveObjects::instance().smtkSelectionManager().get(),
......@@ -298,10 +298,10 @@ void pqSMTKModelPanel::resetUI()
QObject::connect(this->Internal->ModelPanel->getModelView(),
SIGNAL(sendSelectionsFromModelViewToSelectionManager(const smtk::model::EntityRefs&,
const smtk::mesh::MeshSets&, const smtk::model::DescriptivePhrases&,
const smtk::resource::SelectionAction, const std::string&)),
const smtk::view::SelectionAction, const std::string&)),
qtActiveObjects::instance().smtkSelectionManager().get(),
SLOT(updateSelectedItems(const smtk::model::EntityRefs&, const smtk::mesh::MeshSets&,
const smtk::model::DescriptivePhrases&, const smtk::resource::SelectionAction,
const smtk::model::DescriptivePhrases&, const smtk::view::SelectionAction,
const std::string&)));
// select from attribute Panel
// signal passing into qtSelectionManager is connected in
......@@ -545,7 +545,7 @@ void pqSMTKModelPanel::updateTreeSelection()
// select model entities, meshes and entity properties
// skip render view since it's where the signal comes from
emit sendSelectionsFromRenderWindowToSelectionManager(entityRefs, meshes,
smtk::model::DescriptivePhrases(), smtk::resource::SelectionAction::DEFAULT,
smtk::model::DescriptivePhrases(), smtk::view::SelectionAction::DEFAULT,
this->m_selectionSourceName);
}
......@@ -580,10 +580,10 @@ void pqSMTKModelPanel::onModelEntityItemCreated(smtk::extension::qtModelEntityIt
QObject::connect(entItem,
SIGNAL(sendSelectionFromModelEntityToSelectionManager(const smtk::model::EntityRefs&,
const smtk::mesh::MeshSets&, const smtk::model::DescriptivePhrases&,
const smtk::resource::SelectionAction, const std::string)),
const smtk::view::SelectionAction, const std::string)),
qtActiveObjects::instance().smtkSelectionManager().get(),
SLOT(updateSelectedItems(const smtk::model::EntityRefs&, const smtk::mesh::MeshSets&,
const smtk::model::DescriptivePhrases&, const smtk::resource::SelectionAction,
const smtk::model::DescriptivePhrases&, const smtk::view::SelectionAction,
const std::string)));
}
}
......
......@@ -30,7 +30,7 @@ class vtkPVInformation;
namespace smtk
{
namespace resource
namespace view
{
enum class SelectionAction;
}
......@@ -74,7 +74,7 @@ public:
signals:
void sendSelectionsFromRenderWindowToSelectionManager(const smtk::model::EntityRefs& selEntities,
const smtk::mesh::MeshSets& selMeshes, const smtk::model::DescriptivePhrases& DesPhrases,
const smtk::resource::SelectionAction modifierFlag, const std::string& incomingSelectionSource);
const smtk::view::SelectionAction modifierFlag, const std::string& incomingSelectionSource);
public slots:
/// Called if the user accepts pending modifications
......
......@@ -174,7 +174,6 @@ void pqCMBSceneBuilderMainWindow::initializeApplication()
this->Tree->setTextureAction(this->getMainDialog()->actionEditTextureMap);
this->Tree->setElevationAction(this->getMainDialog()->actionShowElevation);
this->Tree->setApplyBathymetryAction(this->getMainDialog()->actionApplyBathymetry);
this->Tree->setTINStackAction(this->getMainDialog()->actionCreateStackTIN);
this->Tree->setTINStitchAction(this->getMainDialog()->actionCreate_Solid_from_TINs);
......@@ -376,7 +375,6 @@ void pqCMBSceneBuilderMainWindow::setupMenuActions()
propertiesMenu->addAction(this->getMainDialog()->actionChangeObjectsType);
propertiesMenu->addAction(this->getMainDialog()->actionShowElevation);
propertiesMenu->addAction(this->getMainDialog()->actionEditTextureMap);
propertiesMenu->addAction(this->getMainDialog()->actionApplyBathymetry);
this->Internal->EditMenuActions.append(this->getMainDialog()->actionUndo);
this->Internal->EditMenuActions.append(this->getMainDialog()->actionRedo);
......
......@@ -30,7 +30,6 @@ vtkHydroModelMultiBlockSource::~vtkHydroModelMultiBlockSource()
void vtkHydroModelMultiBlockSource::CopyData(vtkMultiBlockDataSet* source)
{
this->Source->ShallowCopy(source);
this->Modified();
}
......
Subproject commit 03e6a8b153290a59fc61cbc4b927a443aede7059
Subproject commit 036a9173c600fe9fd96e658f9a3620cceafcab7f
Subproject commit 07ad8392133158a5bf3ba195fc9a9491d42e1484
Subproject commit dc801999909d2ec556e2420148a880e7523f6561
5.0.0-Develop
6.0.0-develop