FEM Post: Add warp vector filter
This commit is contained in:
parent
2f9e70af09
commit
d0e371b3e1
|
@ -157,6 +157,7 @@ PyMODINIT_FUNC initFem()
|
|||
Fem::FemPostFilter ::init();
|
||||
Fem::FemPostClipFilter ::init();
|
||||
Fem::FemPostScalarClipFilter ::init();
|
||||
Fem::FemPostWarpVectorFilter ::init();
|
||||
Fem::FemPostFunction ::init();
|
||||
Fem::FemPostFunctionProvider ::init();
|
||||
Fem::FemPostPlaneFunction ::init();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<<<<<<< 387862dfe753cf0cb062032e97840353b14dcbae
|
||||
<<<<<<< c8cde18ac8aa317da00f6668e9a156fcbe0b2975
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2008 Jürgen Riegel (juergen.riegel@web.de) *
|
||||
* *
|
||||
|
@ -157,9 +157,11 @@ PyMODINIT_FUNC initFem()
|
|||
Fem::FemPostPipeline ::init();
|
||||
Fem::FemPostFilter ::init();
|
||||
Fem::FemPostClipFilter ::init();
|
||||
Fem::FemPostScalarClipFilter ::init();
|
||||
Fem::FemPostFunction ::init();
|
||||
Fem::FemPostFunctionProvider ::init();
|
||||
Fem::FemPostPlaneFunction ::init();
|
||||
Fem::FemPostSphereFunction ::init();
|
||||
#endif
|
||||
}
|
||||
=======
|
||||
|
@ -322,10 +324,11 @@ PyMODINIT_FUNC initFem()
|
|||
Fem::FemPostFilter ::init();
|
||||
Fem::FemPostClipFilter ::init();
|
||||
Fem::FemPostScalarClipFilter ::init();
|
||||
Fem::FemPostWarpVectorFilter ::init();
|
||||
Fem::FemPostFunction ::init();
|
||||
Fem::FemPostFunctionProvider ::init();
|
||||
Fem::FemPostPlaneFunction ::init();
|
||||
Fem::FemPostSphereFunction ::init();
|
||||
#endif
|
||||
}
|
||||
>>>>>>> Detail filter infrastructure
|
||||
>>>>>>> Add warp vector filter
|
||||
|
|
|
@ -341,3 +341,83 @@ void FemPostScalarClipFilter::setConstraintForField() {
|
|||
}
|
||||
|
||||
|
||||
PROPERTY_SOURCE(Fem::FemPostWarpVectorFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostWarpVectorFilter::FemPostWarpVectorFilter(void): FemPostFilter() {
|
||||
|
||||
ADD_PROPERTY_TYPE(Factor, (0), "Warp", App::Prop_None, "The scalar value used to clip the selected field");
|
||||
ADD_PROPERTY_TYPE(Vector, (long(0)), "Warp", App::Prop_None, "The field used to clip");
|
||||
|
||||
polyDataSource = vtkGeometryFilter::New();
|
||||
|
||||
FilterPipeline warp;
|
||||
m_warp = vtkWarpVector::New();
|
||||
warp.source = m_warp;
|
||||
warp.target = m_warp;
|
||||
warp.visualisation = m_warp;
|
||||
addFilterPipeline(warp, "warp");
|
||||
setActiveFilterPipeline("warp");
|
||||
}
|
||||
|
||||
FemPostWarpVectorFilter::~FemPostWarpVectorFilter() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
DocumentObjectExecReturn* FemPostWarpVectorFilter::execute(void) {
|
||||
|
||||
//update the available fields and set the correct input field data for clipping
|
||||
if(!isConnected())
|
||||
return StdReturn;
|
||||
|
||||
std::string val;
|
||||
if(m_vectorFields.getEnums() && Vector.getValue() >= 0)
|
||||
val = Vector.getValueAsString();
|
||||
|
||||
std::vector<std::string> array;
|
||||
|
||||
vtkDataObject* data;
|
||||
if(hasInputAlgorithmConnected()) {
|
||||
getConnectedInputAlgorithm()->Update();
|
||||
data = getConnectedInputAlgorithm()->GetOutputDataObject(0);
|
||||
}
|
||||
else
|
||||
data = getConnectedInputData();
|
||||
|
||||
vtkDataSet* dset = dynamic_cast<vtkDataSet*>(data);
|
||||
if(!dset)
|
||||
return StdReturn;
|
||||
|
||||
vtkPointData* pd = dset->GetPointData();
|
||||
|
||||
for(int i=0; i<pd->GetNumberOfArrays(); ++i) {
|
||||
if(pd->GetArray(i)->GetNumberOfComponents()==3)
|
||||
array.push_back(pd->GetArrayName(i));
|
||||
}
|
||||
|
||||
App::Enumeration empty;
|
||||
Vector.setValue(empty);
|
||||
m_vectorFields.setEnums(array);
|
||||
Vector.setValue(m_vectorFields);
|
||||
|
||||
std::vector<std::string>::iterator it = std::find(array.begin(), array.end(), val);
|
||||
if(!val.empty() && it != array.end())
|
||||
Vector.setValue(val.c_str());
|
||||
|
||||
//recalculate the filter
|
||||
return Fem::FemPostFilter::execute();
|
||||
}
|
||||
|
||||
|
||||
void FemPostWarpVectorFilter::onChanged(const Property* prop) {
|
||||
|
||||
if(prop == &Factor) {
|
||||
m_warp->SetScaleFactor(Factor.getValue());
|
||||
}
|
||||
else if(prop == &Vector && (Vector.getValue() >= 0)) {
|
||||
m_warp->SetInputArrayToProcess(0, 0, 0,
|
||||
vtkDataObject::FIELD_ASSOCIATION_POINTS, Vector.getValueAsString() );
|
||||
}
|
||||
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
|
@ -33,6 +33,7 @@
|
|||
#include <vtkGeometryFilter.h>
|
||||
#include <vtkPassThrough.h>
|
||||
#include <vtkPlane.h>
|
||||
#include <vtkWarpVector.h>
|
||||
|
||||
namespace Fem
|
||||
{
|
||||
|
@ -132,11 +133,35 @@ protected:
|
|||
void setConstraintForField();
|
||||
|
||||
private:
|
||||
vtkSmartPointer<vtkTableBasedClipDataSet> m_clipper;
|
||||
vtkSmartPointer<vtkTableBasedClipDataSet> m_clipper;
|
||||
App::Enumeration m_scalarFields;
|
||||
App::PropertyFloatConstraint::Constraints m_constraints;
|
||||
};
|
||||
|
||||
class AppFemExport FemPostWarpVectorFilter : public FemPostFilter {
|
||||
|
||||
PROPERTY_HEADER(Fem::FemPostWarpVectorFilter);
|
||||
|
||||
public:
|
||||
FemPostWarpVectorFilter(void);
|
||||
virtual ~FemPostWarpVectorFilter();
|
||||
|
||||
App::PropertyFloat Factor;
|
||||
App::PropertyEnumeration Vector;
|
||||
|
||||
virtual const char* getViewProviderName(void) const {
|
||||
return "FemGui::ViewProviderFemPostWarpVector";
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual App::DocumentObjectExecReturn* execute(void);
|
||||
virtual void onChanged(const App::Property* prop);
|
||||
|
||||
private:
|
||||
vtkSmartPointer<vtkWarpVector> m_warp;
|
||||
App::Enumeration m_vectorFields;
|
||||
};
|
||||
|
||||
} //namespace Fem
|
||||
|
||||
|
||||
|
|
|
@ -130,6 +130,7 @@ PyMODINIT_FUNC initFemGui()
|
|||
FemGui::ViewProviderFemPostSphereFunction ::init();
|
||||
FemGui::ViewProviderFemPostClip ::init();
|
||||
FemGui::ViewProviderFemPostScalarClip ::init();
|
||||
FemGui::ViewProviderFemPostWarpVector ::init();
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -97,6 +97,7 @@ if(BUILD_FEM_VTK)
|
|||
TaskPostDisplay.ui
|
||||
TaskPostClip.ui
|
||||
TaskPostScalarClip.ui
|
||||
TaskPostWarpVector.ui
|
||||
PlaneWidget.ui
|
||||
SphereWidget.ui
|
||||
)
|
||||
|
@ -204,6 +205,7 @@ if(BUILD_FEM_VTK)
|
|||
TaskPostClip.ui
|
||||
TaskPostScalarClip.ui
|
||||
TaskPostDisplay.ui
|
||||
TaskPostWarpVector.ui
|
||||
TaskPostBoxes.h
|
||||
TaskPostBoxes.cpp
|
||||
)
|
||||
|
|
|
@ -857,6 +857,52 @@ bool CmdFemPostCreateScalarClipFilter::isActive(void)
|
|||
return hasActiveDocument();
|
||||
}
|
||||
|
||||
|
||||
|
||||
DEF_STD_CMD_A(CmdFemPostWarpVectorFilter);
|
||||
|
||||
CmdFemPostWarpVectorFilter::CmdFemPostWarpVectorFilter()
|
||||
: Command("Fem_PostCreateWarpVectorFilter")
|
||||
{
|
||||
sAppModule = "Fem";
|
||||
sGroup = QT_TR_NOOP("Fem");
|
||||
sMenuText = QT_TR_NOOP("Warp the geometry along a vector field by a certain factor");
|
||||
sToolTipText = QT_TR_NOOP("Warp the geometry along a vector field by a certain factor");
|
||||
sWhatsThis = "Fem_PostCreateWarpVectorFilter";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "fem-fem-mesh-create-node-by-poly";
|
||||
}
|
||||
|
||||
void CmdFemPostWarpVectorFilter::activated(int iMsg)
|
||||
{
|
||||
std::vector<Fem::FemPostPipeline*> pipelines = App::GetApplication().getActiveDocument()->getObjectsOfType<Fem::FemPostPipeline>();
|
||||
if (!pipelines.empty()) {
|
||||
Fem::FemPostPipeline *pipeline = pipelines.front();
|
||||
|
||||
std::string FeatName = getUniqueObjectName("WarpVector");
|
||||
|
||||
openCommand("Create warp vector filter");
|
||||
doCommand(Doc,"App.activeDocument().addObject('Fem::FemPostWarpVectorFilter','%s')",FeatName.c_str());
|
||||
doCommand(Doc,"__list__ = App.ActiveDocument.%s.Filter", pipeline->getNameInDocument());
|
||||
doCommand(Doc,"__list__.append(App.ActiveDocument.%s)", FeatName.c_str());
|
||||
doCommand(Doc,"App.ActiveDocument.%s.Filter = __list__", pipeline->getNameInDocument());
|
||||
doCommand(Doc,"del __list__");
|
||||
|
||||
this->updateActive();
|
||||
doCommand(Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str());
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(Gui::getMainWindow(),
|
||||
qApp->translate("CmdFemPostCreateWarpVectorFilter", "Wrong selection"),
|
||||
qApp->translate("CmdFemPostCreateWarpVectorFilter", "Select a pipeline, please."));
|
||||
}
|
||||
}
|
||||
|
||||
bool CmdFemPostWarpVectorFilter::isActive(void)
|
||||
{
|
||||
return hasActiveDocument();
|
||||
}
|
||||
|
||||
// #####################################################################################################
|
||||
|
||||
|
||||
|
@ -1092,6 +1138,7 @@ void CreateFemCommands(void)
|
|||
#ifdef FC_USE_VTK
|
||||
rcCmdMgr.addCommand(new CmdFemPostCreateClipFilter);
|
||||
rcCmdMgr.addCommand(new CmdFemPostCreateScalarClipFilter);
|
||||
rcCmdMgr.addCommand(new CmdFemPostWarpVectorFilter);
|
||||
rcCmdMgr.addCommand(new CmdFemPostFunctions);
|
||||
rcCmdMgr.addCommand(new CmdFemPostApllyChanges);
|
||||
rcCmdMgr.addCommand(new CmdFemPostPipelineFromResult);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<<<<<<< 146d87b88ef2e7376f2633828c2341a44c146220
|
||||
<<<<<<< c8cde18ac8aa317da00f6668e9a156fcbe0b2975
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2008 Jürgen Riegel (juergen.riegel@web.de) *
|
||||
* *
|
||||
|
@ -1024,6 +1024,53 @@ Gui::Action * CmdFemPostApllyChanges::createAction(void)
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
DEF_STD_CMD_A(CmdFemPostPipelineFromResult);
|
||||
|
||||
CmdFemPostPipelineFromResult::CmdFemPostPipelineFromResult()
|
||||
: Command("Fem_PostPipelineFromResult")
|
||||
{
|
||||
sAppModule = "Fem";
|
||||
sGroup = QT_TR_NOOP("Fem");
|
||||
sMenuText = QT_TR_NOOP("Creates a post processing pipeline from a result object");
|
||||
sToolTipText = QT_TR_NOOP("Creates a post processing pipeline from a result object");
|
||||
sWhatsThis = "Fem_PostPipelineFromResult";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "fem-fem-mesh-create-node-by-poly";
|
||||
}
|
||||
|
||||
void CmdFemPostPipelineFromResult::activated(int iMsg)
|
||||
{
|
||||
Gui::SelectionFilter ResultFilter("SELECT Fem::FemResultObject COUNT 1");
|
||||
|
||||
if (ResultFilter.match()) {
|
||||
|
||||
Fem::FemResultObject* result = static_cast<Fem::FemResultObject*>(ResultFilter.Result[0][0].getObject());
|
||||
std::string FeatName = getUniqueObjectName("Pipeline");
|
||||
|
||||
openCommand("Create pipeline from result");
|
||||
doCommand(Doc,"App.activeDocument().addObject('Fem::FemPostPipeline','%s')",FeatName.c_str());
|
||||
|
||||
//TODO: use python function call for this
|
||||
static_cast<Fem::FemPostPipeline*>(getDocument()->getObject(FeatName.c_str()))->load(result);
|
||||
|
||||
this->updateActive();
|
||||
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(Gui::getMainWindow(),
|
||||
qApp->translate("CmdFemPostCreateClipFilter", "Wrong selection"),
|
||||
qApp->translate("CmdFemPostCreateClipFilter", "Select a result, please."));
|
||||
}
|
||||
}
|
||||
|
||||
bool CmdFemPostPipelineFromResult::isActive(void)
|
||||
{
|
||||
return hasActiveDocument();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -1048,6 +1095,7 @@ void CreateFemCommands(void)
|
|||
rcCmdMgr.addCommand(new CmdFemPostCreateScalarClipFilter);
|
||||
rcCmdMgr.addCommand(new CmdFemPostFunctions);
|
||||
rcCmdMgr.addCommand(new CmdFemPostApllyChanges);
|
||||
rcCmdMgr.addCommand(new CmdFemPostPipelineFromResult);
|
||||
#endif
|
||||
}
|
||||
=======
|
||||
|
@ -1910,6 +1958,52 @@ bool CmdFemPostCreateScalarClipFilter::isActive(void)
|
|||
return hasActiveDocument();
|
||||
}
|
||||
|
||||
|
||||
|
||||
DEF_STD_CMD_A(CmdFemPostWarpVectorFilter);
|
||||
|
||||
CmdFemPostWarpVectorFilter::CmdFemPostWarpVectorFilter()
|
||||
: Command("Fem_PostCreateWarpVectorFilter")
|
||||
{
|
||||
sAppModule = "Fem";
|
||||
sGroup = QT_TR_NOOP("Fem");
|
||||
sMenuText = QT_TR_NOOP("Warp the geometry along a vector field by a certain factor");
|
||||
sToolTipText = QT_TR_NOOP("Warp the geometry along a vector field by a certain factor");
|
||||
sWhatsThis = "Fem_PostCreateWarpVectorFilter";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "fem-fem-mesh-create-node-by-poly";
|
||||
}
|
||||
|
||||
void CmdFemPostWarpVectorFilter::activated(int iMsg)
|
||||
{
|
||||
std::vector<Fem::FemPostPipeline*> pipelines = App::GetApplication().getActiveDocument()->getObjectsOfType<Fem::FemPostPipeline>();
|
||||
if (!pipelines.empty()) {
|
||||
Fem::FemPostPipeline *pipeline = pipelines.front();
|
||||
|
||||
std::string FeatName = getUniqueObjectName("WarpVector");
|
||||
|
||||
openCommand("Create warp vector filter");
|
||||
doCommand(Doc,"App.activeDocument().addObject('Fem::FemPostWarpVectorFilter','%s')",FeatName.c_str());
|
||||
doCommand(Doc,"__list__ = App.ActiveDocument.%s.Filter", pipeline->getNameInDocument());
|
||||
doCommand(Doc,"__list__.append(App.ActiveDocument.%s)", FeatName.c_str());
|
||||
doCommand(Doc,"App.ActiveDocument.%s.Filter = __list__", pipeline->getNameInDocument());
|
||||
doCommand(Doc,"del __list__");
|
||||
|
||||
this->updateActive();
|
||||
doCommand(Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str());
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(Gui::getMainWindow(),
|
||||
qApp->translate("CmdFemPostCreateWarpVectorFilter", "Wrong selection"),
|
||||
qApp->translate("CmdFemPostCreateWarpVectorFilter", "Select a pipeline, please."));
|
||||
}
|
||||
}
|
||||
|
||||
bool CmdFemPostWarpVectorFilter::isActive(void)
|
||||
{
|
||||
return hasActiveDocument();
|
||||
}
|
||||
|
||||
// #####################################################################################################
|
||||
|
||||
|
||||
|
@ -2145,9 +2239,10 @@ void CreateFemCommands(void)
|
|||
#ifdef FC_USE_VTK
|
||||
rcCmdMgr.addCommand(new CmdFemPostCreateClipFilter);
|
||||
rcCmdMgr.addCommand(new CmdFemPostCreateScalarClipFilter);
|
||||
rcCmdMgr.addCommand(new CmdFemPostWarpVectorFilter);
|
||||
rcCmdMgr.addCommand(new CmdFemPostFunctions);
|
||||
rcCmdMgr.addCommand(new CmdFemPostApllyChanges);
|
||||
rcCmdMgr.addCommand(new CmdFemPostPipelineFromResult);
|
||||
#endif
|
||||
}
|
||||
>>>>>>> Command for creation of post pipeline from result
|
||||
>>>>>>> Add warp vector filter
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "ui_TaskPostDisplay.h"
|
||||
#include "ui_TaskPostClip.h"
|
||||
#include "ui_TaskPostScalarClip.h"
|
||||
#include "ui_TaskPostWarpVector.h"
|
||||
#include "TaskPostBoxes.h"
|
||||
#include "ViewProviderFemPostObject.h"
|
||||
#include "ViewProviderFemPostFunction.h"
|
||||
|
@ -449,4 +450,91 @@ void TaskPostScalarClip::on_InsideOut_toggled(bool val) {
|
|||
}
|
||||
|
||||
|
||||
//############################################################################################
|
||||
|
||||
TaskPostWarpVector::TaskPostWarpVector(ViewProviderDocumentObject* view, QWidget* parent) :
|
||||
TaskPostBox(view, Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"), tr("Clip options"), parent) {
|
||||
|
||||
assert(view->isDerivedFrom(ViewProviderFemPostWarpVector::getClassTypeId()));
|
||||
|
||||
//we load the views widget
|
||||
proxy = new QWidget(this);
|
||||
ui = new Ui_TaskPostWarpVector();
|
||||
ui->setupUi(proxy);
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
//load the default values
|
||||
updateEnumerationList(getTypedObject<Fem::FemPostWarpVectorFilter>()->Vector, ui->Vector);
|
||||
|
||||
double value = static_cast<Fem::FemPostWarpVectorFilter*>(getObject())->Factor.getValue();
|
||||
//don't forget to sync the slider
|
||||
ui->Value->blockSignals(true);
|
||||
ui->Value->setValue( value);
|
||||
ui->Value->blockSignals(false);
|
||||
//don't forget to sync the slider
|
||||
ui->Max->blockSignals(true);
|
||||
ui->Max->setValue( value==0 ? 1 : value * 10.);
|
||||
ui->Max->blockSignals(false);
|
||||
ui->Min->blockSignals(true);
|
||||
ui->Min->setValue( value==0 ? 0 : value / 10.);
|
||||
ui->Min->blockSignals(false);
|
||||
ui->Slider->blockSignals(true);
|
||||
ui->Slider->setValue((value - ui->Min->value()) / (ui->Max->value() - ui->Min->value())*100.);
|
||||
ui->Slider->blockSignals(false);
|
||||
}
|
||||
|
||||
TaskPostWarpVector::~TaskPostWarpVector() {
|
||||
|
||||
}
|
||||
|
||||
void TaskPostWarpVector::applyPythonCode() {
|
||||
|
||||
}
|
||||
|
||||
void TaskPostWarpVector::on_Vector_currentIndexChanged(int idx) {
|
||||
|
||||
static_cast<Fem::FemPostWarpVectorFilter*>(getObject())->Vector.setValue(idx);
|
||||
recompute();
|
||||
}
|
||||
|
||||
void TaskPostWarpVector::on_Slider_valueChanged(int v) {
|
||||
|
||||
double val = ui->Min->value() + (ui->Max->value()-ui->Min->value())/100.*v;
|
||||
static_cast<Fem::FemPostWarpVectorFilter*>(getObject())->Factor.setValue(val);
|
||||
recompute();
|
||||
|
||||
//don't forget to sync the spinbox
|
||||
ui->Value->blockSignals(true);
|
||||
ui->Value->setValue( val );
|
||||
ui->Value->blockSignals(false);
|
||||
}
|
||||
|
||||
void TaskPostWarpVector::on_Value_valueChanged(double v) {
|
||||
|
||||
static_cast<Fem::FemPostWarpVectorFilter*>(getObject())->Factor.setValue(v);
|
||||
recompute();
|
||||
|
||||
//don't forget to sync the slider
|
||||
ui->Slider->blockSignals(true);
|
||||
ui->Slider->setValue(int((v - ui->Min->value()) / (ui->Max->value() - ui->Min->value())*100.));
|
||||
ui->Slider->blockSignals(false);
|
||||
}
|
||||
|
||||
void TaskPostWarpVector::on_Max_valueChanged(double v) {
|
||||
|
||||
ui->Slider->blockSignals(true);
|
||||
ui->Slider->setValue((ui->Value->value() - ui->Min->value()) / (ui->Max->value() - ui->Min->value())*100.);
|
||||
ui->Slider->blockSignals(false);
|
||||
}
|
||||
|
||||
void TaskPostWarpVector::on_Min_valueChanged(double v) {
|
||||
|
||||
ui->Slider->blockSignals(true);
|
||||
ui->Slider->setValue((ui->Value->value() - ui->Min->value()) / (ui->Max->value() - ui->Min->value())*100.);
|
||||
ui->Slider->blockSignals(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_TaskPostBoxes.cpp"
|
||||
|
|
|
@ -35,6 +35,7 @@ class QComboBox;
|
|||
class Ui_TaskPostDisplay;
|
||||
class Ui_TaskPostClip;
|
||||
class Ui_TaskPostScalarClip;
|
||||
class Ui_TaskPostWarpVector;
|
||||
|
||||
|
||||
namespace FemGui {
|
||||
|
@ -183,6 +184,28 @@ private:
|
|||
Ui_TaskPostScalarClip* ui;
|
||||
};
|
||||
|
||||
class TaskPostWarpVector : public TaskPostBox {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskPostWarpVector(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0);
|
||||
virtual ~TaskPostWarpVector();
|
||||
|
||||
virtual void applyPythonCode();
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_Slider_valueChanged(int v);
|
||||
void on_Value_valueChanged(double v);
|
||||
void on_Max_valueChanged(double v);
|
||||
void on_Min_valueChanged(double v);
|
||||
void on_Vector_currentIndexChanged(int idx);
|
||||
|
||||
private:
|
||||
QWidget* proxy;
|
||||
Ui_TaskPostWarpVector* ui;
|
||||
};
|
||||
|
||||
} //namespace FemGui
|
||||
|
||||
#endif // GUI_TASKVIEW_TaskPostDisplay_H
|
||||
|
|
|
@ -69,3 +69,22 @@ void ViewProviderFemPostScalarClip::setupTaskDialog(TaskDlgPost* dlg) {
|
|||
//add the display options
|
||||
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
|
||||
}
|
||||
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostWarpVector, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostWarpVector::ViewProviderFemPostWarpVector() {
|
||||
|
||||
}
|
||||
|
||||
ViewProviderFemPostWarpVector::~ViewProviderFemPostWarpVector() {
|
||||
|
||||
}
|
||||
|
||||
void ViewProviderFemPostWarpVector::setupTaskDialog(TaskDlgPost* dlg) {
|
||||
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostWarpVector(dlg->getView()));
|
||||
|
||||
//add the display options
|
||||
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,19 @@ protected:
|
|||
virtual void setupTaskDialog(TaskDlgPost* dlg);
|
||||
};
|
||||
|
||||
class FemGuiExport ViewProviderFemPostWarpVector : public ViewProviderFemPostObject {
|
||||
|
||||
PROPERTY_HEADER(FemGui::ViewProviderFemPostWarpVector);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
ViewProviderFemPostWarpVector();
|
||||
~ViewProviderFemPostWarpVector();
|
||||
|
||||
protected:
|
||||
virtual void setupTaskDialog(TaskDlgPost* dlg);
|
||||
};
|
||||
|
||||
} //namespace FemGui
|
||||
|
||||
|
||||
|
|
|
@ -87,6 +87,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
|||
<< "Separator"
|
||||
<< "Fem_PostCreateClipFilter"
|
||||
<< "Fem_PostCreateScalarClipFilter"
|
||||
<< "Fem_PostCreateWarpVectorFilter"
|
||||
<< "Separator"
|
||||
<< "Fem_PostCreateFunctions";
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user