Skip to content
Snippets Groups Projects
Commit 4805a86c authored by Haocheng LIU's avatar Haocheng LIU
Browse files

FEATURE: Create UI part of terrain extraction operator

This MR creates the UI components for the terrain extraction(TE)
operator. A custom view as smtkTerrianExtractionView is added and
a new extension VXL is introduced.
parent e77972c5
Branches master
No related merge requests found
Pipeline #
Showing
with 891 additions and 8 deletions
......@@ -11,7 +11,7 @@
# - Do not pass a version number. That will not be processed correctly. The
# version number is determined by this macro itself.
# - Do not use COMPONENTS or OPTIONAL_COMPONENTS instead, use QT4_COMPONENTS,
# QT4_OPTIONAL_COMPONENTS and QT5_COMPONENTS, QT5_COMPONENTS to separately
# QT4_OPTIONAL_COMPONENTS and QT5_COMPONENTS, QT5_OPTIONAL_COMPONENTS to separately
# specify the components to use for Qt4 and Qt5.
macro(smtk_find_package_qt out_targets_var)
if(NOT DEFINED SMTK_QT_VERSION)
......
......@@ -110,6 +110,10 @@ mark_as_advanced(SMTK_INSTALL_PYTHON_TO_SITE_PACKAGES)
option(SMTK_ENABLE_QT_SUPPORT "Build Qt GUI" OFF)
cmake_dependent_option(SMTK_ENABLE_APPLICATIONS "Build Qt-enabled applications" ON SMTK_ENABLE_QT_SUPPORT OFF)
option(SMTK_ENABLE_VTK_SUPPORT "Build VTK component" ON)
# SMTK uses vxl library for terrain extraction. It also depends on VTK and ParaView.
option(SMTK_ENABLE_VXL_SUPPORT "Build VXL component" ON)
cmake_dependent_option(SMTK_ENABLE_VXLSUPPORT "Build VXL component" ON
"SMTK_ENABLE_VTK_SUPPORT;SMTK_ENABLE_PARAVIEW_SUPPORT" OFF)
option(SMTK_ENABLE_REMUS_SUPPORT "Build Remus components" OFF)
cmake_dependent_option(SMTK_ENABLE_PARAVIEW_SUPPORT "Build paraview plugins for model sessions" OFF
SMTK_ENABLE_VTK_SUPPORT OFF)
......
......@@ -102,3 +102,8 @@ if (SMTK_USE_PYBIND11)
add_subdirectory(pybind11)
endif()
if (SMTK_ENABLE_VXL_SUPPORT AND SMTK_ENABLE_QT_SUPPORT)
find_package(VXL REQUIRED)
add_subdirectory(vxl)
endif()
......@@ -42,7 +42,7 @@ add_library(smtkPQOperatorViewsExt
${uisrc}
)
#we need to add the location of the moc files to the include dir for smtkPWWidgetExt
#we need to add the location of the moc files to the include dir for smtkPQWidgetExt
target_include_directories(smtkPQOperatorViewsExt PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
#qt4_use_modules(smtkPQOperatorViewsExt LINK_PUBLIC Core Gui)
......@@ -52,7 +52,7 @@ target_link_libraries(smtkPQOperatorViewsExt
pqApplicationComponents
smtkQtExt
smtkCore
${QT_QTCORE_LIBRARY}
${QT_QTCORE_LIBRARY} # It seems it's empty
${Boost_LIBRARIES}
vtkjsoncpp
)
......
......@@ -13,10 +13,10 @@
#ifndef __smtk_extension_qtBaseView_h
#define __smtk_extension_qtBaseView_h
#include <QLayout>
#include <QList>
#include <QObject>
#include <QPointer>
#include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QPointer>
#include <QtWidgets/QLayout>
#include "smtk/PublicPointerDefs.h"
#include "smtk/extension/qt/Exports.h"
......
......@@ -15,7 +15,7 @@
#include "smtk/PublicPointerDefs.h"
#include "smtk/extension/qt/Exports.h"
#include <QDialog>
#include <QtWidgets/QDialog>
namespace Ui
{
......
################################################################################
# Build vxl
################################################################################
if (PARAVIEW_BUILD_QT_GUI)
add_subdirectory(operators)
# add_subdirectory(vtk)
#add_subdirectory(widgets)
endif()
#include(${PARAVIEW_USE_FILE})
#include(ParaViewPlugins)
# set up sources to build
set(srcs
smtkTerrainExtractionView.cxx
)
set(hdrs
smtkTerrainExtractionView.h
)
set(qtui
smtkTerrainExtractionParameters.ui
)
#install the headers
smtk_public_headers(${hdrs})
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
qt5_wrap_cpp(mocs ${hdrs})
qt5_wrap_ui(uisrc ${qtui})
else()
qt4_wrap_cpp(mocs ${hdrs})
qt4_wrap_ui(uisrc ${qtui})
endif()
source_group("Qt_Source" FILES ${srcs} )
source_group("Qt_Generated" FILES ${mocs} ${uisrc})
source_group("Qt_Header" FILES ${hdrs})
add_library(smtkVXLOperatorViewsExt
${srcs}
${mocs}
${uisrc}
)
#we need to add the location of the moc files to the include dir for smtkVXLWidgetExt
target_include_directories(smtkVXLOperatorViewsExt PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
#set smtkVXLOperatorViewsExt to publicly link to smtkCore
target_link_libraries(smtkVXLOperatorViewsExt
LINK_PUBLIC
smtkQtExt
pqApplicationComponents
smtkCore
LINK_PRIVATE
smtkPQWidgetsExt
#${QT_QTCORE_LIBRARY} # it seems that it's deprecated
${Boost_LIBRARIES}
vtkjsoncpp
)
# if (SMTK_ENABLE_TESTING)
# target_link_libraries(TestBuild_smtk_extension_paraview_operators
# LINK_PUBLIC
# smtkVXLOperatorViewsExt
# )
# endif()
smtk_export_header(smtkVXLOperatorViewsExt Exports.h)
# Generate the ParaView plugin code for each view class
# added to the smtkVXLOperatorViewsExt library above:
set(viewInterfaces)
set(viewSources)
foreach(src ${srcs})
string(REPLACE ".cxx" "" srcClass ${src})
set(vitmp)
set(vstmp)
add_smtk_ui_view(
vitmp
vstmp
CLASS_NAME ${srcClass}
VIEW_NAME ${srcClass}
)
list(APPEND viewInterfaces ${vitmp})
list(APPEND viewSources ${vstmp})
endforeach()
add_paraview_plugin(
smtkVXLOperatorViewsPlugin "1.0"
#SERVER_MANAGER_XML smconfig.xml
#SERVER_SOURCES sessionInit.cxx # do I need it here?
GUI_INTERFACES ${viewInterfaces}
GUI_SOURCES ${viewSources}
CS_KITS
vtkSMTKWidgetsExt
# TBDadd other libraries in vxl
)
target_link_libraries(smtkVXLOperatorViewsPlugin
LINK_PUBLIC
smtkVXLOperatorViewsExt
)
#install the library and exports the library when used from a build tree
smtk_install_library(smtkVXLOperatorViewsExt)
smtk_install_library(smtkVXLOperatorViewsPlugin)
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TerrainExtractionParameters</class>
<widget class="QWidget" name="TerrainExtractionParameters">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>550</width>
<height>422</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="ResolutionGroup">
<property name="title">
<string>Output Point Spacing</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string>Spacing</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="resolutionEdit"/>
</item>
<item>
<widget class="QLabel" name="scaleNumPointsLabel">
<property name="text">
<string> will generate ? points. </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="detailedResolutionButton">
<property name="toolTip">
<string>Compute suggested minimum spacing from all the input points</string>
</property>
<property name="text">
<string>Compute Minimum Spacing</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="_2">
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="toolTip">
<string>At 0, all samples are used thus more robust to noise (but slower), while increasing towards 1 tends towards a more even sampling (faster, but may not work well if the data is anisotropic)</string>
</property>
<property name="whatsThis">
<string>At 0, all samples are used thus more robust to noise (but slower), while increasing towards 1 tends towards a more even sampling (faster, but may not work well if the data is anisotropic)</string>
</property>
<property name="text">
<string>Mask Size</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="MaskSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>At 0, all samples are used thus more robust to noise (but slower), while increasing towards 1 tends towards a more even sampling (faster, but may not work well if the data is anisotropic)</string>
</property>
<property name="whatsThis">
<string>At 0, all samples are used thus more robust to noise (but slower), while increasing towards 1 tends towards a more even sampling (faster, but may not work well if the data is anisotropic)</string>
</property>
<property name="text">
<string>1.0</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="cacheGroup">
<property name="title">
<string>Temporary Storage Directory</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="cacheDirectoryButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string> Directory</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="CacheDirectoryLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="saveRefinedCheckBox">
<property name="text">
<string>Save Refine Results</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="autoSaveExtractionGroup">
<property name="title">
<string>Output</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="3">
<widget class="QPushButton" name="autoSaveFileButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>File</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="previewOnCompletionCheckBox">
<property name="text">
<string>Preview Output Upon Completion</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="computeColor">
<property name="toolTip">
<string>Determine color for extracted terrain points based on input point colors (if present)</string>
</property>
<property name="text">
<string>Compute Output Point Colors</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="autoSaveLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="processFullExtraction">
<property name="text">
<string>Extract Terrain</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
//=========================================================================
// 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/vxl/operators/smtkTerrainExtractionView.h"
#include "smtk/extension/vxl/operators/ui_smtkTerrainExtractionParameters.h"
#include "smtk/model/Operator.h"
#include "smtk/attribute/Attribute.h"
#include "smtk/attribute/DoubleItem.h"
#include "smtk/attribute/IntItem.h"
#include "smtk/attribute/StringItem.h"
#include "smtk/common/View.h"
#include "smtk/extension/qt/qtAttribute.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtModelOperationWidget.h"
#include "smtk/extension/qt/qtModelView.h"
#include "smtk/extension/qt/qtUIManager.h"
using namespace smtk::extension;
class smtkTerrainExtractionViewInternals : public Ui::TerrainExtractionParameters
{
public:
smtkTerrainExtractionViewInternals() {}
~smtkTerrainExtractionViewInternals()
{
if (CurrentAtt)
{
delete CurrentAtt;
}
}
qtAttribute* createAttUI(smtk::attribute::AttributePtr att, QWidget* pw, qtBaseView* view)
{
if (att && att->numberOfItems() > 0)
{
qtAttribute* attInstance = new qtAttribute(att, pw, view);
if (attInstance && attInstance->widget())
{
//Without any additional info lets use a basic layout with model associations
// if any exists
attInstance->createBasicLayout(true);
attInstance->widget()->setObjectName("terrainExtractionEditor");
QVBoxLayout* parentlayout = static_cast<QVBoxLayout*>(pw->layout());
parentlayout->insertWidget(0, attInstance->widget());
}
return attInstance;
}
return NULL;
}
QPointer<qtAttribute> CurrentAtt;
smtk::weak_ptr<smtk::model::Operator> CurrentOp;
};
smtkTerrainExtractionView::smtkTerrainExtractionView(const smtk::extension::ViewInfo& info)
: qtBaseView(info)
{
this->Internals = new smtkTerrainExtractionViewInternals;
}
smtkTerrainExtractionView::~smtkTerrainExtractionView()
{
delete this->Internals;
}
qtBaseView* smtkTerrainExtractionView::createViewWidget(const smtk::extension::ViewInfo& info)
{
smtkTerrainExtractionView* view = new smtkTerrainExtractionView(info);
view->buildUI();
return view;
}
void smtkTerrainExtractionView::attributeModified()
{
// Always enable the apply button here
// Question: Do I need it?
}
void smtkTerrainExtractionView::createWidget()
{
smtk::common::ViewPtr view = this->getObject();
if (!view)
{
return;
}
QVBoxLayout* parentlayout = static_cast<QVBoxLayout*>(this->parentWidget()->layout());
// Delete any pre-existing widget
if (this->Widget)
{
if (parentlayout)
{
parentlayout->removeWidget(this->Widget);
}
delete this->Widget;
}
// Create a new frame and lay it out
this->Widget = new QFrame(this->parentWidget());
QVBoxLayout* layout = new QVBoxLayout(this->Widget);
layout->setMargin(0);
this->Widget->setLayout(layout);
this->Widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
this->updateAttributeData();
QWidget* wtmp = new QWidget;
this->Internals->setupUi(wtmp);
layout->addWidget(wtmp); // ui must have a default layout other wise it would not work
// Signals and slots
}
void smtkTerrainExtractionView::updateAttributeData()
{
smtk::common::ViewPtr view = this->getObject();
if (!view || !this->Widget)
{
return;
}
if (this->Internals->CurrentAtt)
{
delete this->Internals->CurrentAtt;
}
int i = view->details().findChild("AttributeTypes");
if (i < 0)
{
return;
}
smtk::common::View::Component& comp = view->details().child(i);
std::string defName;
for (std::size_t ci = 0; ci < comp.numberOfChildren(); ++ci)
{
smtk::common::View::Component& attComp = comp.child(ci);
std::cout << " component " << attComp.name() << "\n";
if (attComp.name() != "Att")
{
continue;
}
std::string optype;
if (attComp.attribute("Type", optype) && !optype.empty())
{
std::cout << " component type " << optype << "\n";
if (optype == "terrain extraction")
{
defName = optype;
std::cout << "match terrain extraction!" << std::endl;
break;
}
}
}
if (defName.empty())
{
return;
}
smtk::model::OperatorPtr terrainExtractionOp =
this->uiManager()->activeModelView()->operatorsWidget()->existingOperator(defName);
this->Internals->CurrentOp = terrainExtractionOp;
// expecting only 1 instance of the op?
smtk::attribute::AttributePtr att = terrainExtractionOp->specification();
this->Internals->CurrentAtt = this->Internals->createAttUI(att, this->Widget, this);
}
void smtkTerrainExtractionView::requestOperation(const smtk::model::OperatorPtr& op)
{
if (!op || !op->specification())
{
return;
}
this->uiManager()->activeModelView()->requestOperation(op, false);
}
void smtkTerrainExtractionView::cancelOperation(const smtk::model::OperatorPtr& op)
{
if (!op || !this->Widget || !this->Internals->CurrentAtt)
{
return;
}
// Reset widgets here
}
void smtkTerrainExtractionView::valueChanged(smtk::attribute::ItemPtr /*valItem*/)
{
this->requestOperation(this->Internals->CurrentOp.lock());
}
void smtkTerrainExtractionView::requestModelEntityAssociation()
{
this->updateAttributeData();
}
void smtkTerrainExtractionView::setInfoToBeDisplayed()
{
this->m_infoDialog->displayInfo(this->getObject());
}
//=========================================================================
// 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 smtkAssignColorsView - UI component for extract terrain out of point clouds
// .SECTION Description
// .SECTION See Also
// qtSection
#ifndef smtkTerrainExtractionView_h
#define smtkTerrainExtractionView_h
#include "Exports.h"
#include "smtk/extension/qt/qtBaseView.h"
#include <vtk_jsoncpp.h> // for Json::Value; must be in header due to VTK mangling
#include <QtCore/QObject>
#include <QtWidgets/QLayout>
class smtkTerrainExtractionViewInternals;
/// A view for exporting SMTK "packages" (SMTK files with data saved to the same directory).
class SMTKVXLOPERATORVIEWSEXT_EXPORT smtkTerrainExtractionView : public smtk::extension::qtBaseView
{
Q_OBJECT
public:
static smtk::extension::qtBaseView* createViewWidget(const smtk::extension::ViewInfo& info);
smtkTerrainExtractionView(const smtk::extension::ViewInfo& info);
virtual ~smtkTerrainExtractionView();
// virtual bool displayItem(smtk::attribute::ItemPtr);
public slots:
virtual void updateUI() {} // NB: Subclass implementation causes crashes.
virtual void requestModelEntityAssociation();
virtual void onShowCategory() { this->updateAttributeData(); }
// This will be triggered by selecting different type
// of construction method in create-edge op.
virtual void valueChanged(smtk::attribute::ItemPtr optype);
protected slots:
virtual void requestOperation(const smtk::model::OperatorPtr& op);
virtual void cancelOperation(const smtk::model::OperatorPtr&);
// This slot is used to indicate that the underlying attribute
// for the operation should be checked for validity
virtual void attributeModified();
virtual void updateAttributeData();
protected:
virtual void createWidget();
virtual void setInfoToBeDisplayed() override;
private:
smtkTerrainExtractionViewInternals* Internals;
};
#endif // smtkTerrainExtractionView_h
smtk_find_package_qt(qt_targets REQUIRED
QT4_COMPONENTS QtCore QtGui
QT5_COMPONENTS Core Gui Widgets)
find_package( VTK REQUIRED )
include_directories(${VTK_INCLUDE_DIRS})
set(VXLWidgetsHeaders
bar.h
)
set(VXLWidgetsSrcs
bar.cxx
)
set(VXLWidgetsUI
)
#install the headers
smtk_public_headers(${VXLWidgetsHeaders})
smtk_qt_wrap_cpp(MOC_BUILT_SOURCES ${VXLWidgetsHeaders})
smtk_qt_wrap_ui(UI_BUILT_SOURCES ${VXLWidgetsUI})
source_group("Qt_Source" FILES ${VXLWidgetsSrcs} ${VXLWidgetsUI})
source_group("Qt_Generated" FILES ${MOC_BUILT_SOURCES} ${UI_BUILT_SOURCES} ${RCS_RESOURCES})
source_group("Qt_Header" FILES ${VXLWidgetsMocHeaders})
add_library(smtkVXLWidgetsExt
${VXLWidgetsSrcs}
${MOC_BUILT_SOURCES}
${UI_BUILT_SOURCES}
${RCS_RESOURCES}
)
target_include_directories(smtkVXLWidgetsExt PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(smtkVXLWidgetsExt LINK_PUBLIC
pqApplicationComponents
smtkCore
smtkPQWidgetsExt
vtkSMTKSourceExt
${qt_targets}
LINK_PRIVATE
${VTK_LIBRARIES}
)
smtk_export_header(smtkVXLWidgetsExt Exports.h)
#install the library and exports the library when used from a build tree
smtk_install_library(smtkVXLWidgetsExt)
#if (SMTK_ENABLE_TESTING)
# # Link *everything* in this directory to VTK modules
# # This is required for the TestBuild targets.
# # We must test whether each of the targets below exist
# # because they are required when built into VTK but
# # may not be present, especially since the OpenGL2
# # backend became available.
# set(SMTK_VTK_TARGET_LIST)
# foreach(target
# vtkInteractionStyle
# vtkRenderingFreeType
# vtkRenderingOpenGL2
# ${qt_targets}
# )
# if (TARGET ${target})
# list(APPEND SMTK_VTK_TARGET_LIST ${target})
# endif()
# endforeach()
#
# target_link_libraries(TestBuild_smtk_extension_opencv_qt PUBLIC ${SMTK_VTK_TARGET_LIST}
# smtkQtExt)
#endif()
......@@ -12,6 +12,7 @@ set(modelOps
LoadSMTKModel
SaveSMTKModel
SetProperty
TerrainExtraction
)
set(modelSrcs
......
//=========================================================================
// 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/model/operators/TerrainExtraction.h"
#include "smtk/model/EntityRef.h"
#include "smtk/common/Color.h"
#include "smtk/attribute/Attribute.h"
#include "smtk/attribute/ModelEntityItem.h"
#include "smtk/attribute/StringItem.h"
#include <cstddef> // for size_t
using smtk::attribute::StringItem;
namespace smtk
{
namespace model
{
smtk::model::OperatorResult TerrainExtraction::operateInternal()
{
}
} //namespace model
} // namespace smtk
#include "smtk/model/TerrainExtraction_xml.h"
smtkImplementsModelOperator(SMTKCORE_EXPORT, smtk::model::TerrainExtraction, terrain_extraction,
"terrain extraction", TerrainExtraction_xml, smtk::model::Session);
//=========================================================================
// 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 __smtk_model_TerrainExtraction_h
#define __smtk_model_TerrainExtraction_h
#include "smtk/model/Operator.h"
namespace smtk
{
namespace model
{
class SMTKCORE_EXPORT TerrainExtraction : public Operator
{
public:
smtkTypeMacro(TerrainExtraction);
smtkCreateMacro(TerrainExtraction);
smtkSharedFromThisMacro(Operator);
smtkDeclareModelOperator();
protected:
virtual smtk::model::OperatorResult operateInternal();
};
} //namespace model
} // namespace smtk
#endif // __smtk_model_TerrainExtraction_h
<?xml version="1.0" encoding="utf-8" ?>
<!-- Description of the model "TerrainExtraction" Operator -->
<SMTK_AttributeSystem Version="2">
<Definitions>
<!-- Operator -->
<AttDef Type="terrain extraction" Label="Model - Terrain Extraction" BaseType="operator">
<AssociationsDef Name="Image" NumberOfRequiredValues="1" AdvanceLevel="0">
<MembershipMask>aux_geom</MembershipMask>
</AssociationsDef>
<BriefDescription>
Extract terrain from a point cloud.
</BriefDescription>
<DetailedDescription>
Extract terrain from a point cloud.
</DetailedDescription>
: </AttDef>
<!-- Result -->
<AttDef Type="result(assign colors)" BaseType="result"/>
</Definitions>
<Views>
<!--
The customized view "Type" needs to match the plugin's VIEW_NAME:
add_smtk_ui_view(... VIEW_NAME smtkTerrainExtractionView ...)
-->
<View Type="smtkTerrainExtractionView" Title="Terrain Extraction">
<Description>
Extract terrain from a point cloud.
</Description>
<AttributeTypes>
<Att Type="terrain extraction"/>
</AttributeTypes>
</View>
</Views>
</SMTK_AttributeSystem>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment