Commit 5ab37ce5 authored by Haocheng LIU's avatar Haocheng LIU

Restore function evaluation feature in SimpleExpression view

The function evaluation feature in SimpleExpression view relies on VTK.
However, also do we want to be able to preview this view with only Qt
enabled. In order to do so this MR creates a subclass of qtSimpleExpressionView
and it would override the SimpleExpression view constructor at runtime.
That being said now users can preview it with only Qt enabled and do
function evaluation when both Qt and VTK are enabled.
parent 21eea530
Restore function evaluation feature in SimpleExpression view
The function evaluation feature in SimpleExpression view relies on VTK.
However, also do we want to be able to preview this view with only Qt
enabled. In order to do so this MR creates a subclass of qtSimpleExpressionView
and it would override the SimpleExpression view constructor at runtime.
That being said now users can preview it with only Qt enabled and do
function evaluation when both Qt and VTK are enabled.
find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
# smtk views that need vtk support
set(viewSrcs
qtSimpleExpressionEvaluationView.cxx
)
set(viewHdrs
qtSimpleExpressionEvaluationView.h
)
# set up sources to build
set(PQWidgetsSrcs
pqGenerateContoursDialog.cxx
......@@ -12,6 +19,7 @@ set(PQWidgetsSrcs
pqSMTKSplineItemWidget.cxx
qtArcWidget.cxx
qtInteractionWidget.cxx
${viewSrcs}
)
set(PQWidgetsUIs
......@@ -30,6 +38,7 @@ set(PQWidgetsMocHeaders
pqSMTKSplineItemWidget.h
qtArcWidget.h
qtInteractionWidget.h
${viewHdrs}
)
set(PQWidgetsHeaders
......@@ -62,6 +71,7 @@ target_include_directories(smtkPQWidgetsExt PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(smtkPQWidgetsExt LINK_PUBLIC
pqApplicationComponents
vtkPVServerManagerRendering
vtkSMTKWidgetsExt
smtkCore
smtkQtExt
Qt5::Core
......@@ -70,8 +80,21 @@ target_link_libraries(smtkPQWidgetsExt LINK_PUBLIC
smtk_export_header(smtkPQWidgetsExt Exports.h)
#install the library and exports the library when used from a build tree
smtk_install_library(smtkPQWidgetsExt)
set(viewInterfaces)
set(viewSources)
foreach(viewSrc ${viewSrcs})
string(REPLACE ".cxx" "" srcClass ${viewSrc})
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()
set(PQWidgetsPluginHdrs
pqSMTKWidgetsAutoStart.h
......@@ -95,6 +118,7 @@ add_paraview_plugin(
${PLUGIN_AUTOSTART_IFACES}
${PLUGIN_PROXY_IFACES}
${PLUGIN_DOCK_IFACES}
${viewInterfaces}
GUI_SOURCES
${PQWidgetsPluginHdrs}
${PQWidgetsPluginSrcs}
......@@ -103,6 +127,9 @@ add_paraview_plugin(
${PLUGIN_AUTOSTART_IFACE_SRCS}
${PLUGIN_PROXY_IFACE_SRCS}
${PLUGIN_DOCK_IFACES_SRCS}
${viewSources}
CS_KITS
vtkSMTKWidgetsExt
)
set(SMTK_PLUGINS "${SMTK_PLUGINS};smtkPQWidgetsPlugin" CACHE INTERNAL "")
......@@ -113,4 +140,5 @@ target_link_libraries(smtkPQWidgetsPlugin
smtk_export_header(smtkPQWidgetsPlugin PluginExports.h)
#install the library and exports the library when used from a build tree
smtk_install_library(smtkPQWidgetsExt)
smtk_install_library(smtkPQWidgetsPlugin)
......@@ -17,6 +17,7 @@
#include "smtk/extension/paraview/widgets/pqSMTKPointItemWidget.h"
#include "smtk/extension/paraview/widgets/pqSMTKSphereItemWidget.h"
#include "smtk/extension/paraview/widgets/pqSMTKSplineItemWidget.h"
#include "smtk/extension/paraview/widgets/qtSimpleExpressionEvaluationView.h"
#include "smtk/extension/qt/qtSMTKUtilities.h"
......@@ -50,6 +51,8 @@ void pqSMTKWidgetsAutoStart::startup()
"Sphere", pqSMTKSphereItemWidget::createSphereItemWidget);
qtSMTKUtilities::registerItemConstructor(
"Spline", pqSMTKSplineItemWidget::createSplineItemWidget);
qtSMTKUtilities::registerViewConstructor(
"SimpleExpression", qtSimpleExpressionEvaluationView::createViewWidget);
}
void pqSMTKWidgetsAutoStart::shutdown()
......
//=========================================================================
// 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/paraview/widgets/qtSimpleExpressionEvaluationView.h"
#include "smtk/extension/qt/qtAttribute.h"
#include "smtk/extension/qt/qtSimpleExpressionView.h"
#include "smtk/extension/qt/qtTableWidget.h"
#include "smtk/extension/qt/qtUIManager.h"
#include "smtk/extension/vtk/widgets/vtkSBFunctionParser.h"
#include "smtk/attribute/Attribute.h"
#include "smtk/attribute/Definition.h"
#include "smtk/attribute/DoubleItem.h"
#include "smtk/attribute/DoubleItemDefinition.h"
#include "smtk/attribute/GroupItem.h"
#include "smtk/attribute/GroupItemDefinition.h"
#include "smtk/attribute/IntItem.h"
#include "smtk/attribute/IntItemDefinition.h"
#include "smtk/attribute/Resource.h"
#include "smtk/attribute/StringItem.h"
#include "smtk/attribute/StringItemDefinition.h"
#include "smtk/view/View.h"
#include "vtkDoubleArray.h"
#include "vtkNew.h"
#include <QFileDialog>
#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QKeyEvent>
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
#include <QListWidgetItem>
#include <QMessageBox>
#include <QModelIndex>
#include <QModelIndexList>
#include <QPointer>
#include <QPushButton>
#include <QSpinBox>
#include <QSplitter>
#include <QString>
#include <QStringList>
#include <QTextStream>
#include <QVBoxLayout>
#include <QVariant>
#include <sstream>
#define MAX_NUMBEWR_FUNC_POINTS 10000
using namespace smtk::attribute;
using namespace smtk::extension;
qtBaseView* qtSimpleExpressionEvaluationView::createViewWidget(const ViewInfo& info)
{
qtSimpleExpressionEvaluationView* view = new qtSimpleExpressionEvaluationView(info);
view->buildUI();
return view;
}
qtSimpleExpressionEvaluationView::qtSimpleExpressionEvaluationView(const ViewInfo& info)
: qtSimpleExpressionView(info)
{
}
qtSimpleExpressionEvaluationView::~qtSimpleExpressionEvaluationView()
{
}
void qtSimpleExpressionEvaluationView::createWidget()
{
if (!this->getObject())
{
return;
}
// Create a frame to contain all gui components for this object
// Create a list box for the group entries
// Create a table widget
// Add link from the listbox selection to the table widget
// A common add/delete/(copy/paste ??) widget
QSplitter* frame = new QSplitter(this->parentWidget());
QFrame* leftFrame = new QFrame(frame);
QFrame* rightFrame = new QFrame(frame);
//QGridLayout* gridLayout = new QGridLayout(frame);
//gridLayout->setMargin(0);
QVBoxLayout* leftLayout = new QVBoxLayout(leftFrame);
leftLayout->setMargin(0);
QVBoxLayout* rightLayout = new QVBoxLayout(rightFrame);
rightLayout->setMargin(0);
QSizePolicy sizeFixedPolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
// create a list box for all the array entries
this->Internals->FuncList = new QListWidget(frame);
this->Internals->FuncTable = new qtTableWidget(frame);
QSizePolicy tableSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
this->Internals->FuncTable->setSizePolicy(tableSizePolicy);
this->Internals->AddButton = new QPushButton("New", frame);
this->Internals->AddButton->setSizePolicy(sizeFixedPolicy);
this->Internals->NumberBox = new QSpinBox(frame);
this->Internals->NumberBox->setSizePolicy(sizeFixedPolicy);
this->Internals->NumberBox->setRange(1, MAX_NUMBEWR_FUNC_POINTS);
this->Internals->NumberBox->setValue(10);
// Editor UI
QDoubleValidator* validator = new QDoubleValidator(frame);
this->Internals->ExpressionInput = new QLineEdit(frame);
this->Internals->DeltaInput = new QLineEdit(frame);
this->Internals->DeltaInput->setValidator(validator);
this->Internals->InitValueInput = new QLineEdit(frame);
this->Internals->InitValueInput->setValidator(validator);
QGridLayout* editorLayout = new QGridLayout();
editorLayout->addWidget(new QLabel("Initial Value", frame), 0, 0);
editorLayout->addWidget(new QLabel("Delta", frame), 0, 1);
editorLayout->addWidget(new QLabel("Number of Values", frame), 0, 2);
editorLayout->addWidget(this->Internals->InitValueInput, 1, 0);
editorLayout->addWidget(this->Internals->DeltaInput, 1, 1);
editorLayout->addWidget(this->Internals->NumberBox, 1, 2);
this->Internals->InitValueInput->setText("0.0");
this->Internals->DeltaInput->setText("1.0");
this->Internals->EditorGroup = new QGroupBox("Use Function Expression", frame);
this->Internals->EditorGroup->setCheckable(1);
this->Internals->EditorGroup->setChecked(0);
this->Internals->EditorGroup->setToolTip(this->Internals->getFunctionParserDescription());
QVBoxLayout* addLayout = new QVBoxLayout(this->Internals->EditorGroup);
QHBoxLayout* exprLayout = new QHBoxLayout();
exprLayout->addWidget(new QLabel("f(X)=", frame));
exprLayout->addWidget(this->Internals->ExpressionInput);
addLayout->addLayout(exprLayout);
addLayout->addLayout(editorLayout);
QHBoxLayout* copyLayout = new QHBoxLayout();
this->Internals->DeleteButton = new QPushButton("Delete", frame);
this->Internals->DeleteButton->setSizePolicy(sizeFixedPolicy);
this->Internals->CopyButton = new QPushButton("Copy", frame);
this->Internals->CopyButton->setSizePolicy(sizeFixedPolicy);
copyLayout->addWidget(this->Internals->AddButton);
copyLayout->addWidget(this->Internals->CopyButton);
copyLayout->addWidget(this->Internals->DeleteButton);
QHBoxLayout* rowButtonLayout = new QHBoxLayout();
this->Internals->AddValueButton = new QPushButton("Add", frame);
this->Internals->AddValueButton->setSizePolicy(sizeFixedPolicy);
this->Internals->RemoveValueButton = new QPushButton("Remove", frame);
this->Internals->RemoveValueButton->setSizePolicy(sizeFixedPolicy);
this->Internals->LoadCSVButton = new QPushButton("Load CSV", frame);
this->Internals->LoadCSVButton->setSizePolicy(sizeFixedPolicy);
rowButtonLayout->addWidget(this->Internals->LoadCSVButton);
rowButtonLayout->addWidget(this->Internals->AddValueButton);
rowButtonLayout->addWidget(this->Internals->RemoveValueButton);
leftLayout->addLayout(copyLayout); //, 2, 0,1,1);
leftLayout->addWidget(this->Internals->FuncList); //, 0, 0,1,1);
//leftLayout->addWidget(this->Internals->AddButton);
leftLayout->addWidget(this->Internals->EditorGroup); //, 1, 0,1,1);
//leftLayout->addLayout(editorLayout);
rightLayout->addLayout(rowButtonLayout); //, 2, 1,1,1);
rightLayout->addWidget(this->Internals->FuncTable); //, 0, 1, 2, 1);
frame->addWidget(leftFrame);
frame->addWidget(rightFrame);
QObject::connect(this->Internals->FuncList,
SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this,
SLOT(onFuncSelectionChanged(QListWidgetItem*, QListWidgetItem*)));
QObject::connect(this->Internals->FuncList, SIGNAL(itemChanged(QListWidgetItem*)), this,
SLOT(onFuncNameChanged(QListWidgetItem*)));
QObject::connect(this->Internals->AddButton, SIGNAL(clicked()), this, SLOT(onCreateNew()));
QObject::connect(this->Internals->CopyButton, SIGNAL(clicked()), this, SLOT(onCopySelected()));
QObject::connect(
this->Internals->DeleteButton, SIGNAL(clicked()), this, SLOT(onDeleteSelected()));
QObject::connect(this->Internals->AddValueButton, SIGNAL(clicked()), this, SLOT(onAddValue()));
QObject::connect(
this->Internals->RemoveValueButton, SIGNAL(clicked()), this, SLOT(onRemoveSelectedValues()));
QObject::connect(this->Internals->LoadCSVButton, SIGNAL(clicked()), this, SLOT(onCSVLoad()));
QObject::connect(this->Internals->FuncTable, SIGNAL(itemChanged(QTableWidgetItem*)), this,
SLOT(onFuncValueChanged(QTableWidgetItem*)));
QObject::connect(this->Internals->FuncTable, SIGNAL(keyPressed(QKeyEvent*)), this,
SLOT(onFuncTableKeyPress(QKeyEvent*)));
this->Internals->FuncTable->setSelectionBehavior(QAbstractItemView::SelectRows);
this->Internals->FuncList->setSelectionMode(QAbstractItemView::SingleSelection);
this->Widget = frame;
this->initFunctionList();
}
void qtSimpleExpressionEvaluationView::createFunctionWithExpression()
{
QString funcExpr = this->Internals->ExpressionInput->text();
if (funcExpr.isEmpty())
{
funcExpr = "X";
}
this->Internals->ExpressionInput->setText(funcExpr);
double initVal = this->Internals->InitValueInput->text().toDouble();
double deltaVal = this->Internals->DeltaInput->text().toDouble();
int numValues = this->Internals->NumberBox->value();
int errorPos = -1;
std::string errorMsg;
vtkNew<vtkSBFunctionParser> FunctionParser;
FunctionParser->SetFunction(funcExpr.toStdString());
FunctionParser->CheckExpression(errorPos, errorMsg);
if (errorPos != -1 && !errorMsg.empty())
{
this->displayExpressionError(errorMsg, errorPos);
return;
}
FunctionParser->SetNumberOfValues(numValues);
FunctionParser->SetInitialValue(initVal);
FunctionParser->SetDelta(deltaVal);
vtkDoubleArray* result = FunctionParser->GetResult();
if (result)
{
int numberOfComponents = result->GetNumberOfComponents();
std::vector<double> values(numberOfComponents);
QStringList strVals;
for (vtkIdType i = 0, j = 0; i < result->GetNumberOfTuples(); i++, j += numberOfComponents)
{
result->GetTypedTuple(i, &values[0]);
for (int c = 0; c < numberOfComponents - 1; c++)
{
strVals << QString::number(values[c]) << "\t";
}
strVals << QString::number(values[numberOfComponents - 1]);
strVals << LINE_BREAKER_STRING;
}
QString valuesText = strVals.join(" ");
this->buildSimpleExpression(funcExpr, valuesText, numberOfComponents);
}
}
//=========================================================================
// 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 qtSimpleExpressionEvaluationView - UI components for the attribute Expression View
// with function evaluation
// .SECTION Description
// .SECTION See Also
// qtSimpleExpressionView
#ifndef __smtk_extension_qtSimpleExpressionEvaluationView_h
#define __smtk_extension_qtSimpleExpressionEvaluationView_h
#include "smtk/extension/paraview/widgets/Exports.h"
#include "smtk/extension/qt/qtSimpleExpressionView.h"
class SMTKPQWIDGETSEXT_EXPORT qtSimpleExpressionEvaluationView
: public smtk::extension::qtSimpleExpressionView
{
Q_OBJECT
public:
static qtBaseView* createViewWidget(const smtk::extension::ViewInfo& info);
qtSimpleExpressionEvaluationView(const smtk::extension::ViewInfo& info);
virtual ~qtSimpleExpressionEvaluationView();
public slots:
virtual void createFunctionWithExpression() override;
protected:
void createWidget() override;
}; // class
#endif
......@@ -56,63 +56,28 @@
using namespace smtk::attribute;
using namespace smtk::extension;
class qtSimpleExpressionViewInternals
qtSimpleExpressionView::qtSimpleExpressionViewInternals::~qtSimpleExpressionViewInternals()
{
public:
qtSimpleExpressionViewInternals() { this->FunctionParserDescription = 0; }
~qtSimpleExpressionViewInternals()
if (this->FunctionParserDescription)
{
if (this->FunctionParserDescription)
{
delete[] this->FunctionParserDescription;
this->FunctionParserDescription = 0;
}
delete[] this->FunctionParserDescription;
this->FunctionParserDescription = 0;
}
}
const char* getFunctionParserDescription()
const char* qtSimpleExpressionView::qtSimpleExpressionViewInternals::getFunctionParserDescription()
{
if (!this->FunctionParserDescription)
{
if (!this->FunctionParserDescription)
{
std::stringstream ss;
ss << "Example Function: f(X) = cos(X).\n";
ss << "(Note: Use capital X as variable!)\n";
ss << " \n";
ss << "Standard constants available:\n";
ss << " PI = 3.1415926535\n";
ss << " \n";
ss << "Standard operations available:\n";
ss << " + - * / ^\n";
ss << " \n";
ss << "Standard functions available:\n";
ss << " abs acos asin atan ceil cos cosh\n";
ss << " exp floor log mag min max norm\n";
ss << " sign sin sinh sqrt tan tanh\n";
this->FunctionParserDescription = new char[ss.str().length() + 1];
strcpy(this->FunctionParserDescription, ss.str().c_str());
}
return this->FunctionParserDescription;
std::stringstream ss;
ss << "Enable VTK in the build configurations\n";
ss << "to allow custom lambda function\n";
this->FunctionParserDescription = new char[ss.str().length() + 1];
strcpy(this->FunctionParserDescription, ss.str().c_str());
}
qtTableWidget* FuncTable;
QListWidget* FuncList;
QPushButton* AddButton;
QPushButton* DeleteButton;
QPushButton* CopyButton;
QPushButton* LoadCSVButton;
QSpinBox* NumberBox;
QLineEdit* ExpressionInput;
QLineEdit* DeltaInput;
QLineEdit* InitValueInput;
QPushButton* AddValueButton;
QPushButton* RemoveValueButton;
QGroupBox* EditorGroup;
char* FunctionParserDescription;
smtk::attribute::DefinitionPtr m_attDefinition;
};
return this->FunctionParserDescription;
}
qtBaseView* qtSimpleExpressionView::createViewWidget(const ViewInfo& info)
{
......@@ -190,6 +155,8 @@ void qtSimpleExpressionView::createWidget()
this->Internals->EditorGroup = new QGroupBox("Use Function Expression", frame);
this->Internals->EditorGroup->setCheckable(1);
this->Internals->EditorGroup->setChecked(0);
// Without vtk enabled, the parser cannot do anything here
this->Internals->EditorGroup->setDisabled(true);
this->Internals->EditorGroup->setToolTip(this->Internals->getFunctionParserDescription());
QVBoxLayout* addLayout = new QVBoxLayout(this->Internals->EditorGroup);
......@@ -470,16 +437,6 @@ void qtSimpleExpressionView::displayExpressionError(std::string& errorMsg, int e
void qtSimpleExpressionView::createFunctionWithExpression()
{
QString funcExpr = this->Internals->ExpressionInput->text();
if (funcExpr.isEmpty())
{
funcExpr = "X";
}
this->Internals->ExpressionInput->setText(funcExpr);
double initVal = this->Internals->InitValueInput->text().toDouble();
double deltaVal = this->Internals->DeltaInput->text().toDouble();
int numValues = this->Internals->NumberBox->value();
emit this->onCreateFunctionWithExpression(funcExpr, initVal, deltaVal, numValues);
}
void qtSimpleExpressionView::createNewFunction(smtk::attribute::DefinitionPtr attDef)
......
......@@ -8,6 +8,7 @@
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
// .NAME qtSimpleExpressionView - UI components for the attribute Expression View
// without function evaluation
// .SECTION Description
// .SECTION See Also
// qtBaseView
......@@ -20,8 +21,11 @@
#include <vector>
class qtSimpleExpressionViewInternals;
class QLineEdit;
class QListWidget;
class QListWidgetItem;
class QGroupBox;
class QSpinBox;
class QTableWidgetItem;
class QKeyEvent;
......@@ -29,8 +33,36 @@ namespace smtk
{
namespace extension
{
class qtTableWidget;
class SMTKQTEXT_EXPORT qtSimpleExpressionView : public qtBaseView
{
class SMTKQTEXT_EXPORT qtSimpleExpressionViewInternals
{
public:
qtSimpleExpressionViewInternals() { this->FunctionParserDescription = 0; }
~qtSimpleExpressionViewInternals();
const char* getFunctionParserDescription();
smtk::extension::qtTableWidget* FuncTable;
QListWidget* FuncList;
QPushButton* AddButton;
QPushButton* DeleteButton;
QPushButton* CopyButton;
QPushButton* LoadCSVButton;
QSpinBox* NumberBox;
QLineEdit* ExpressionInput;
QLineEdit* DeltaInput;
QLineEdit* InitValueInput;
QPushButton* AddValueButton;
QPushButton* RemoveValueButton;
QGroupBox* EditorGroup;
char* FunctionParserDescription;
smtk::attribute::DefinitionPtr m_attDefinition;
};
Q_OBJECT
public:
......@@ -60,10 +92,6 @@ public slots:
virtual void createFunctionWithExpression();
void onShowCategory() override { this->updateAttributeData(); }
signals:
void onCreateFunctionWithExpression(
QString& expression, double initVal, double deltaVal, int numVals);
protected slots:
void updateAttributeData() override { this->initFunctionList(); }
......@@ -86,7 +114,6 @@ protected:
virtual void clearFuncExpression();
virtual void getAllDefinitions(QList<smtk::attribute::DefinitionPtr>& defs);
private:
qtSimpleExpressionViewInternals* Internals;
}; // class
......
set(VTKLibSrcs
vtkSBFunctionParser.cxx
vtkSMTKArcRepresentation.cxx
)
set(VTKLibHeaders
vtkSBFunctionParser.h
vtkSMTKArcRepresentation.h
)
set (__dependencies)
......
//=========================================================================
// 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 "vtkSBFunctionParser.h"
#include <vtkDoubleArray.h>
#include <vtkFunctionParser.h>
#include <vtkObjectFactory.h>
#include <vtkSmartPointer.h>
#include <algorithm>
#include <map>
#include <sstream> // STL required.
vtkStandardNewMacro(vtkSBFunctionParser);
class vtkSBFunctionParser::vtkInternal
{
public:
vtkInternal()
{
this->Parser = vtkSmartPointer<vtkFunctionParser>::New();
this->DefineConstants();
}
void DefineConstants();
vtkSmartPointer<vtkFunctionParser> Parser;
std::map<std::string, double> Constants;
};
void vtkSBFunctionParser::vtkInternal::DefineConstants()
{
this->Constants["PI"] = 3.1415926535;
}
vtkSBFunctionParser::vtkSBFunctionParser()
: IndependentVariableName("X")
, Function("")
, IsVectorResult(false)
, InitialValue(0.0)
, Delta(0.0)
, NumberOfValues(-1)
, Help(0)
, Result(0)
{
this->Implementation = new vtkInternal();
this->CheckMTime.Modified();
}
vtkSBFunctionParser::~vtkSBFunctionParser()
{
if (this->Help)
{
delete[] this->Help;
this->Help = 0;
}
if (this->Result)
{
this->Result->Delete();
this->Result = 0;
}
if (this->Implementation)
{
delete this->Implementation;
this->Implementation = 0;
}
}
void vtkSBFunctionParser::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "Function: " << this->Function << "\n";
os << indent << "InitialValue: " << this->InitialValue << "\n";
os << indent << "Delta: " << this->Delta << "\n";
os << indent << "NumberOfValues: " << this->NumberOfValues << "\n";
os << indent << "Help: " << (this->Help ? this->Help : "NULL") << "\n";
}
void vtkSBFunctionParser::SetFunction(std::string function)
{
this->Function = function;
this->Modified();
}
std::string vtkSBFunctionParser::GetFunction()