FEM: add gitattributes file to let git manage file endings and normalize them

This commit is contained in:
Bernd Hahnebach
2019-12-10 22:13:03 +01:00
parent 97804f851d
commit e680701037
26 changed files with 4968 additions and 4906 deletions

View File

@@ -1,86 +1,86 @@
/***************************************************************************
* Copyright (c) 2017 FreeCAD Developers *
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
* Based on src/Mod/Fem/Gui/DlgSettingsFemCcx.cpp *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#include "Gui/Application.h"
#include "DlgSettingsFemExportAbaqusImp.h"
#include "ui_DlgSettingsFemExportAbaqus.h"
#include <Gui/PrefWidgets.h>
using namespace FemGui;
DlgSettingsFemExportAbaqusImp::DlgSettingsFemExportAbaqusImp( QWidget* parent )
: PreferencePage( parent ), ui(new Ui_DlgSettingsFemExportAbaqus)
{
ui->setupUi(this);
}
/*
* Destroys the object and frees any allocated resources
*/
DlgSettingsFemExportAbaqusImp::~DlgSettingsFemExportAbaqusImp()
{
// no need to delete child widgets, Qt does it all for us
delete ui;
}
void DlgSettingsFemExportAbaqusImp::saveSettings()
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem/Abaqus");
hGrp->SetInt("AbaqusElementChoice", ui->comboBoxElemChoiceParam->currentIndex());
ui->comboBoxElemChoiceParam->onSave();
ui->checkBoxWriteGroups->onSave();
}
void DlgSettingsFemExportAbaqusImp::loadSettings()
{
ui->comboBoxElemChoiceParam->onRestore();
ui->checkBoxWriteGroups->onRestore();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem/Abaqus");
int index = hGrp->GetInt("AbaqusElementChoice", 0);
if (index > -1) ui->comboBoxElemChoiceParam->setCurrentIndex(index);
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void DlgSettingsFemExportAbaqusImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
int c_index = ui->comboBoxElemChoiceParam->currentIndex();
ui->retranslateUi(this);
ui->comboBoxElemChoiceParam->setCurrentIndex(c_index);
}
else {
QWidget::changeEvent(e);
}
}
#include "moc_DlgSettingsFemExportAbaqusImp.cpp"
/***************************************************************************
* Copyright (c) 2017 FreeCAD Developers *
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
* Based on src/Mod/Fem/Gui/DlgSettingsFemCcx.cpp *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#include "Gui/Application.h"
#include "DlgSettingsFemExportAbaqusImp.h"
#include "ui_DlgSettingsFemExportAbaqus.h"
#include <Gui/PrefWidgets.h>
using namespace FemGui;
DlgSettingsFemExportAbaqusImp::DlgSettingsFemExportAbaqusImp( QWidget* parent )
: PreferencePage( parent ), ui(new Ui_DlgSettingsFemExportAbaqus)
{
ui->setupUi(this);
}
/*
* Destroys the object and frees any allocated resources
*/
DlgSettingsFemExportAbaqusImp::~DlgSettingsFemExportAbaqusImp()
{
// no need to delete child widgets, Qt does it all for us
delete ui;
}
void DlgSettingsFemExportAbaqusImp::saveSettings()
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem/Abaqus");
hGrp->SetInt("AbaqusElementChoice", ui->comboBoxElemChoiceParam->currentIndex());
ui->comboBoxElemChoiceParam->onSave();
ui->checkBoxWriteGroups->onSave();
}
void DlgSettingsFemExportAbaqusImp::loadSettings()
{
ui->comboBoxElemChoiceParam->onRestore();
ui->checkBoxWriteGroups->onRestore();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem/Abaqus");
int index = hGrp->GetInt("AbaqusElementChoice", 0);
if (index > -1) ui->comboBoxElemChoiceParam->setCurrentIndex(index);
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void DlgSettingsFemExportAbaqusImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
int c_index = ui->comboBoxElemChoiceParam->currentIndex();
ui->retranslateUi(this);
ui->comboBoxElemChoiceParam->setCurrentIndex(c_index);
}
else {
QWidget::changeEvent(e);
}
}
#include "moc_DlgSettingsFemExportAbaqusImp.cpp"

View File

@@ -1,53 +1,53 @@
/***************************************************************************
* Copyright (c) 2017 FreeCAD Developers *
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
* Based on src/Mod/Fem/Gui/DlgSettingsFemCcx.h *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H
#define FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H
#include <Gui/PropertyPage.h>
namespace FemGui {
class Ui_DlgSettingsFemExportAbaqus;
class DlgSettingsFemExportAbaqusImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
public:
DlgSettingsFemExportAbaqusImp( QWidget* parent = 0 );
~DlgSettingsFemExportAbaqusImp();
protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
private:
Ui_DlgSettingsFemExportAbaqus* ui;
};
} // namespace FemGui
#endif // FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H
/***************************************************************************
* Copyright (c) 2017 FreeCAD Developers *
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
* Based on src/Mod/Fem/Gui/DlgSettingsFemCcx.h *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H
#define FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H
#include <Gui/PropertyPage.h>
namespace FemGui {
class Ui_DlgSettingsFemExportAbaqus;
class DlgSettingsFemExportAbaqusImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
public:
DlgSettingsFemExportAbaqusImp( QWidget* parent = 0 );
~DlgSettingsFemExportAbaqusImp();
protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
private:
Ui_DlgSettingsFemExportAbaqus* ui;
};
} // namespace FemGui
#endif // FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H

View File

@@ -1,85 +1,85 @@
/**************************************************************************
* Copyright (c) 2018 FreeCAD Developers *
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
* Based on src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusCcxImp.cpp *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#include "Gui/Application.h"
#include "DlgSettingsFemInOutVtkImp.h"
#include "ui_DlgSettingsFemInOutVtk.h"
#include <Gui/PrefWidgets.h>
using namespace FemGui;
DlgSettingsFemInOutVtkImp::DlgSettingsFemInOutVtkImp( QWidget* parent )
: PreferencePage( parent ), ui(new Ui_DlgSettingsFemInOutVtk)
{
ui->setupUi(this);
}
/*
* Destroys the object and frees any allocated resources
*/
DlgSettingsFemInOutVtkImp::~DlgSettingsFemInOutVtkImp()
{
// no need to delete child widgets, Qt does it all for us
delete ui;
}
void DlgSettingsFemInOutVtkImp::saveSettings()
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem/InOutVtk");
hGrp->SetInt("ImportObject", ui->comboBoxVtkImportObject->currentIndex());
ui->comboBoxVtkImportObject->onSave();
}
void DlgSettingsFemInOutVtkImp::loadSettings()
{
ui->comboBoxVtkImportObject->onRestore();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem/InOutVtk");
int index = hGrp->GetInt("ImportObject", 0);
// 0 is standard on first initialize, 0 .. vtk res obj, 1 .. FEM mesh obj, 2 .. FreeCAD res obj
if (index > -1) ui->comboBoxVtkImportObject->setCurrentIndex(index);
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void DlgSettingsFemInOutVtkImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
int c_index = ui->comboBoxVtkImportObject->currentIndex();
ui->retranslateUi(this);
ui->comboBoxVtkImportObject->setCurrentIndex(c_index);
}
else {
QWidget::changeEvent(e);
}
}
#include "moc_DlgSettingsFemInOutVtkImp.cpp"
/**************************************************************************
* Copyright (c) 2018 FreeCAD Developers *
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
* Based on src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusCcxImp.cpp *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#include "Gui/Application.h"
#include "DlgSettingsFemInOutVtkImp.h"
#include "ui_DlgSettingsFemInOutVtk.h"
#include <Gui/PrefWidgets.h>
using namespace FemGui;
DlgSettingsFemInOutVtkImp::DlgSettingsFemInOutVtkImp( QWidget* parent )
: PreferencePage( parent ), ui(new Ui_DlgSettingsFemInOutVtk)
{
ui->setupUi(this);
}
/*
* Destroys the object and frees any allocated resources
*/
DlgSettingsFemInOutVtkImp::~DlgSettingsFemInOutVtkImp()
{
// no need to delete child widgets, Qt does it all for us
delete ui;
}
void DlgSettingsFemInOutVtkImp::saveSettings()
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem/InOutVtk");
hGrp->SetInt("ImportObject", ui->comboBoxVtkImportObject->currentIndex());
ui->comboBoxVtkImportObject->onSave();
}
void DlgSettingsFemInOutVtkImp::loadSettings()
{
ui->comboBoxVtkImportObject->onRestore();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem/InOutVtk");
int index = hGrp->GetInt("ImportObject", 0);
// 0 is standard on first initialize, 0 .. vtk res obj, 1 .. FEM mesh obj, 2 .. FreeCAD res obj
if (index > -1) ui->comboBoxVtkImportObject->setCurrentIndex(index);
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void DlgSettingsFemInOutVtkImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
int c_index = ui->comboBoxVtkImportObject->currentIndex();
ui->retranslateUi(this);
ui->comboBoxVtkImportObject->setCurrentIndex(c_index);
}
else {
QWidget::changeEvent(e);
}
}
#include "moc_DlgSettingsFemInOutVtkImp.cpp"

View File

@@ -1,53 +1,53 @@
/***************************************************************************
* Copyright (c) 2018 FreeCAD Developers *
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
* Based on src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusCcxImp.h *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEMGUI_DLGSETTINGSFEMINOUTVTKIMP_H
#define FEMGUI_DLGSETTINGSFEMINOUTVTKIMP_H
#include <Gui/PropertyPage.h>
namespace FemGui {
class Ui_DlgSettingsFemInOutVtk;
class DlgSettingsFemInOutVtkImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
public:
DlgSettingsFemInOutVtkImp( QWidget* parent = 0 );
~DlgSettingsFemInOutVtkImp();
protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
private:
Ui_DlgSettingsFemInOutVtk* ui;
};
} // namespace FemGui
#endif // FEMGUI_DLGSETTINGSFEMINOUTVTKIMP_H
/***************************************************************************
* Copyright (c) 2018 FreeCAD Developers *
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
* Based on src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusCcxImp.h *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEMGUI_DLGSETTINGSFEMINOUTVTKIMP_H
#define FEMGUI_DLGSETTINGSFEMINOUTVTKIMP_H
#include <Gui/PropertyPage.h>
namespace FemGui {
class Ui_DlgSettingsFemInOutVtk;
class DlgSettingsFemInOutVtkImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
public:
DlgSettingsFemInOutVtkImp( QWidget* parent = 0 );
~DlgSettingsFemInOutVtkImp();
protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
private:
Ui_DlgSettingsFemInOutVtk* ui;
};
} // namespace FemGui
#endif // FEMGUI_DLGSETTINGSFEMINOUTVTKIMP_H

View File

@@ -1,151 +1,151 @@
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#include "ViewProviderFemPostFilter.h"
#include "TaskPostBoxes.h"
#include <Mod/Fem/App/FemPostFilter.h>
#include <Base/Console.h>
using namespace FemGui;
PROPERTY_SOURCE(FemGui::ViewProviderFemPostClip, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostClip::ViewProviderFemPostClip() {
sPixmap = "fem-post-filter-clip-region";
}
ViewProviderFemPostClip::~ViewProviderFemPostClip() {
}
void ViewProviderFemPostClip::setupTaskDialog(TaskDlgPost* dlg) {
//add the function box
dlg->appendBox(new TaskPostClip(dlg->getView(),
&static_cast<Fem::FemPostClipFilter*>(dlg->getView()->getObject())->Function));
//add the display options
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
}
PROPERTY_SOURCE(FemGui::ViewProviderFemPostDataAlongLine, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostDataAlongLine::ViewProviderFemPostDataAlongLine() {
sPixmap = "fem-post-filter-data-along-line";
}
ViewProviderFemPostDataAlongLine::~ViewProviderFemPostDataAlongLine() {
}
void ViewProviderFemPostDataAlongLine::setupTaskDialog(TaskDlgPost* dlg) {
//add the function box
dlg->appendBox(new TaskPostDataAlongLine(dlg->getView()));
}
PROPERTY_SOURCE(FemGui::ViewProviderFemPostDataAtPoint, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostDataAtPoint::ViewProviderFemPostDataAtPoint() {
sPixmap = "fem-post-filter-data-at-point";
}
ViewProviderFemPostDataAtPoint::~ViewProviderFemPostDataAtPoint() {
}
void ViewProviderFemPostDataAtPoint::setupTaskDialog(TaskDlgPost* dlg) {
//add the function box
dlg->appendBox(new TaskPostDataAtPoint(dlg->getView()));
}
PROPERTY_SOURCE(FemGui::ViewProviderFemPostScalarClip, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostScalarClip::ViewProviderFemPostScalarClip() {
sPixmap = "fem-post-filter-clip-scalar";
}
ViewProviderFemPostScalarClip::~ViewProviderFemPostScalarClip() {
}
void ViewProviderFemPostScalarClip::setupTaskDialog(TaskDlgPost* dlg) {
//add the function box
dlg->appendBox(new TaskPostScalarClip(dlg->getView()));
//add the display options
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
}
PROPERTY_SOURCE(FemGui::ViewProviderFemPostWarpVector, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostWarpVector::ViewProviderFemPostWarpVector() {
sPixmap = "fem-post-filter-warp";
}
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);
}
PROPERTY_SOURCE(FemGui::ViewProviderFemPostCut, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostCut::ViewProviderFemPostCut() {
sPixmap = "fem-post-filter-cut-function";
}
ViewProviderFemPostCut::~ViewProviderFemPostCut() {
}
void ViewProviderFemPostCut::setupTaskDialog(TaskDlgPost* dlg) {
//add the function box
dlg->appendBox(new TaskPostCut(dlg->getView(),
&static_cast<Fem::FemPostCutFilter*>(dlg->getView()->getObject())->Function));
//add the display options
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
}
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#include "ViewProviderFemPostFilter.h"
#include "TaskPostBoxes.h"
#include <Mod/Fem/App/FemPostFilter.h>
#include <Base/Console.h>
using namespace FemGui;
PROPERTY_SOURCE(FemGui::ViewProviderFemPostClip, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostClip::ViewProviderFemPostClip() {
sPixmap = "fem-post-filter-clip-region";
}
ViewProviderFemPostClip::~ViewProviderFemPostClip() {
}
void ViewProviderFemPostClip::setupTaskDialog(TaskDlgPost* dlg) {
//add the function box
dlg->appendBox(new TaskPostClip(dlg->getView(),
&static_cast<Fem::FemPostClipFilter*>(dlg->getView()->getObject())->Function));
//add the display options
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
}
PROPERTY_SOURCE(FemGui::ViewProviderFemPostDataAlongLine, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostDataAlongLine::ViewProviderFemPostDataAlongLine() {
sPixmap = "fem-post-filter-data-along-line";
}
ViewProviderFemPostDataAlongLine::~ViewProviderFemPostDataAlongLine() {
}
void ViewProviderFemPostDataAlongLine::setupTaskDialog(TaskDlgPost* dlg) {
//add the function box
dlg->appendBox(new TaskPostDataAlongLine(dlg->getView()));
}
PROPERTY_SOURCE(FemGui::ViewProviderFemPostDataAtPoint, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostDataAtPoint::ViewProviderFemPostDataAtPoint() {
sPixmap = "fem-post-filter-data-at-point";
}
ViewProviderFemPostDataAtPoint::~ViewProviderFemPostDataAtPoint() {
}
void ViewProviderFemPostDataAtPoint::setupTaskDialog(TaskDlgPost* dlg) {
//add the function box
dlg->appendBox(new TaskPostDataAtPoint(dlg->getView()));
}
PROPERTY_SOURCE(FemGui::ViewProviderFemPostScalarClip, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostScalarClip::ViewProviderFemPostScalarClip() {
sPixmap = "fem-post-filter-clip-scalar";
}
ViewProviderFemPostScalarClip::~ViewProviderFemPostScalarClip() {
}
void ViewProviderFemPostScalarClip::setupTaskDialog(TaskDlgPost* dlg) {
//add the function box
dlg->appendBox(new TaskPostScalarClip(dlg->getView()));
//add the display options
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
}
PROPERTY_SOURCE(FemGui::ViewProviderFemPostWarpVector, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostWarpVector::ViewProviderFemPostWarpVector() {
sPixmap = "fem-post-filter-warp";
}
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);
}
PROPERTY_SOURCE(FemGui::ViewProviderFemPostCut, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostCut::ViewProviderFemPostCut() {
sPixmap = "fem-post-filter-cut-function";
}
ViewProviderFemPostCut::~ViewProviderFemPostCut() {
}
void ViewProviderFemPostCut::setupTaskDialog(TaskDlgPost* dlg) {
//add the function box
dlg->appendBox(new TaskPostCut(dlg->getView(),
&static_cast<Fem::FemPostCutFilter*>(dlg->getView()->getObject())->Function));
//add the display options
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
}

View File

@@ -1,112 +1,112 @@
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEM_VIEWPROVIDERFEMPOSTFILTER_H
#define FEM_VIEWPROVIDERFEMPOSTFILTER_H
#include "ViewProviderFemPostObject.h"
namespace FemGui
{
class FemGuiExport ViewProviderFemPostClip : public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostClip);
public:
/// constructor.
ViewProviderFemPostClip();
~ViewProviderFemPostClip();
protected:
virtual void setupTaskDialog(TaskDlgPost* dlg);
};
class FemGuiExport ViewProviderFemPostDataAlongLine : public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostDataAlongLine);
public:
/// constructor.
ViewProviderFemPostDataAlongLine();
~ViewProviderFemPostDataAlongLine();
protected:
virtual void setupTaskDialog(TaskDlgPost* dlg);
};
class FemGuiExport ViewProviderFemPostDataAtPoint: public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostDataAtPoint);
public:
/// constructor.
ViewProviderFemPostDataAtPoint();
~ViewProviderFemPostDataAtPoint();
protected:
virtual void setupTaskDialog(TaskDlgPost* dlg);
};
class FemGuiExport ViewProviderFemPostScalarClip : public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostScalarClip);
public:
/// constructor.
ViewProviderFemPostScalarClip();
~ViewProviderFemPostScalarClip();
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);
};
class FemGuiExport ViewProviderFemPostCut : public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostCut);
public:
/// constructor.
ViewProviderFemPostCut();
~ViewProviderFemPostCut();
protected:
virtual void setupTaskDialog(TaskDlgPost* dlg);
};
} //namespace FemGui
#endif // FEM_VIEWPROVIDERFEMPOSTFILTER_H
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEM_VIEWPROVIDERFEMPOSTFILTER_H
#define FEM_VIEWPROVIDERFEMPOSTFILTER_H
#include "ViewProviderFemPostObject.h"
namespace FemGui
{
class FemGuiExport ViewProviderFemPostClip : public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostClip);
public:
/// constructor.
ViewProviderFemPostClip();
~ViewProviderFemPostClip();
protected:
virtual void setupTaskDialog(TaskDlgPost* dlg);
};
class FemGuiExport ViewProviderFemPostDataAlongLine : public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostDataAlongLine);
public:
/// constructor.
ViewProviderFemPostDataAlongLine();
~ViewProviderFemPostDataAlongLine();
protected:
virtual void setupTaskDialog(TaskDlgPost* dlg);
};
class FemGuiExport ViewProviderFemPostDataAtPoint: public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostDataAtPoint);
public:
/// constructor.
ViewProviderFemPostDataAtPoint();
~ViewProviderFemPostDataAtPoint();
protected:
virtual void setupTaskDialog(TaskDlgPost* dlg);
};
class FemGuiExport ViewProviderFemPostScalarClip : public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostScalarClip);
public:
/// constructor.
ViewProviderFemPostScalarClip();
~ViewProviderFemPostScalarClip();
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);
};
class FemGuiExport ViewProviderFemPostCut : public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostCut);
public:
/// constructor.
ViewProviderFemPostCut();
~ViewProviderFemPostCut();
protected:
virtual void setupTaskDialog(TaskDlgPost* dlg);
};
} //namespace FemGui
#endif // FEM_VIEWPROVIDERFEMPOSTFILTER_H

File diff suppressed because it is too large Load Diff

View File

@@ -1,222 +1,222 @@
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEM_VIEWPROVIDERFEMPOSTFUNCTION_H
#define FEM_VIEWPROVIDERFEMPOSTFUNCTION_H
#include <Gui/ViewProviderDocumentObject.h>
#include <Mod/Fem/App/FemPostFunction.h>
#include <Inventor/SbMatrix.h>
#include <QWidget>
#include <boost/signals2.hpp>
class SoScale;
class SoSurroundScale;
class SoTransformManip;
class SoComposeMatrix;
class SoMatrixTransform;
class SoDragger;
class SoSphere;
class Ui_PlaneWidget;
class Ui_SphereWidget;
namespace FemGui
{
class ViewProviderFemPostFunction;
class FemGuiExport FunctionWidget : public QWidget {
Q_OBJECT
public:
FunctionWidget() {}
virtual ~FunctionWidget() {}
virtual void applyPythonCode() = 0;
virtual void setViewProvider(ViewProviderFemPostFunction* view);
void onObjectsChanged(const App::DocumentObject& obj, const App::Property&);
protected:
ViewProviderFemPostFunction* getView() {return m_view;}
Fem::FemPostFunction* getObject(){return m_object;}
bool blockObjectUpdates() {return m_block;}
void setBlockObjectUpdates(bool val) {m_block = val;}
virtual void onChange(const App::Property& p) = 0;
private:
bool m_block;
ViewProviderFemPostFunction* m_view;
Fem::FemPostFunction* m_object;
boost::signals2::scoped_connection m_connection;
};
class FemGuiExport ViewProviderFemPostFunctionProvider : public Gui::ViewProviderDocumentObject
{
PROPERTY_HEADER(FemGui::ViewProviderFemPostFunction);
public:
ViewProviderFemPostFunctionProvider();
virtual ~ViewProviderFemPostFunctionProvider();
App::PropertyFloat SizeX;
App::PropertyFloat SizeY;
App::PropertyFloat SizeZ;
protected:
virtual std::vector< App::DocumentObject* > claimChildren(void) const;
virtual std::vector< App::DocumentObject* > claimChildren3D(void) const;
virtual void onChanged(const App::Property* prop);
virtual void updateData(const App::Property*);
void updateSize();
};
class FemGuiExport ViewProviderFemPostFunction : public Gui::ViewProviderDocumentObject
{
PROPERTY_HEADER(FemGui::ViewProviderFemPostFunction);
public:
/// constructor.
ViewProviderFemPostFunction();
~ViewProviderFemPostFunction();
App::PropertyFloat AutoScaleFactorX;
App::PropertyFloat AutoScaleFactorY;
App::PropertyFloat AutoScaleFactorZ;
void attach(App::DocumentObject *pcObject);
bool doubleClicked(void);
std::vector<std::string> getDisplayModes() const;
//creates the widget used in the task dalogs, either for the function itself or for
//the fiter using it
virtual FunctionWidget* createControlWidget() {return NULL;}
protected:
virtual bool setEdit(int ModNum);
virtual void unsetEdit(int ModNum);
virtual void onChanged(const App::Property* prop);
void setAutoScale(bool value) {m_autoscale = value;}
bool autoScale() {return m_autoscale;}
bool isDragging() {return m_isDragging;}
virtual SoTransformManip* setupManipulator();
virtual void draggerUpdate(SoDragger*) {}
SoTransformManip* getManipulator() {return m_manip;}
SoSeparator* getGeometryNode() {return m_geometrySeperator;}
SoScale* getScaleNode() {return m_scale;}
SoTransform* getTransformNode() {return m_transform;}
private:
static void dragStartCallback(void * data, SoDragger * d);
static void dragFinishCallback(void * data, SoDragger * d);
static void dragMotionCallback(void * data, SoDragger * d);
SoSeparator* m_geometrySeperator;
SoTransformManip* m_manip;
SoScale* m_scale;
SoTransform* m_transform;
bool m_autoscale, m_isDragging, m_autoRecompute;
};
// ***************************************************************************
class FemGuiExport PlaneWidget : public FunctionWidget {
Q_OBJECT
public:
PlaneWidget();
virtual ~PlaneWidget();
virtual void applyPythonCode();
virtual void onChange(const App::Property& p);
virtual void setViewProvider(ViewProviderFemPostFunction* view);
private Q_SLOTS:
void originChanged(double);
void normalChanged(double);
private:
Ui_PlaneWidget* ui;
};
class FemGuiExport ViewProviderFemPostPlaneFunction : public ViewProviderFemPostFunction {
PROPERTY_HEADER(FemGui::ViewProviderFemPostPlaneFunction);
public:
ViewProviderFemPostPlaneFunction();
virtual ~ViewProviderFemPostPlaneFunction();
virtual FunctionWidget* createControlWidget();
protected:
virtual void draggerUpdate(SoDragger* mat);
virtual void updateData(const App::Property*);
};
// ***************************************************************************
class FemGuiExport SphereWidget : public FunctionWidget {
Q_OBJECT
public:
SphereWidget();
virtual ~SphereWidget();
virtual void applyPythonCode();
virtual void onChange(const App::Property& p);
virtual void setViewProvider(ViewProviderFemPostFunction* view);
private Q_SLOTS:
void centerChanged(double);
void radiusChanged(double);
private:
Ui_SphereWidget* ui;
};
class FemGuiExport ViewProviderFemPostSphereFunction : public ViewProviderFemPostFunction {
PROPERTY_HEADER(FemGui::ViewProviderFemPostSphereFunction);
public:
ViewProviderFemPostSphereFunction();
virtual ~ViewProviderFemPostSphereFunction();
virtual SoTransformManip* setupManipulator();
virtual FunctionWidget* createControlWidget();
protected:
virtual void draggerUpdate(SoDragger* mat);
virtual void updateData(const App::Property*);
};
} //namespace FemGui
#endif // FEM_VIEWPROVIDERFEMPOSTFUNCTION_H
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEM_VIEWPROVIDERFEMPOSTFUNCTION_H
#define FEM_VIEWPROVIDERFEMPOSTFUNCTION_H
#include <Gui/ViewProviderDocumentObject.h>
#include <Mod/Fem/App/FemPostFunction.h>
#include <Inventor/SbMatrix.h>
#include <QWidget>
#include <boost/signals2.hpp>
class SoScale;
class SoSurroundScale;
class SoTransformManip;
class SoComposeMatrix;
class SoMatrixTransform;
class SoDragger;
class SoSphere;
class Ui_PlaneWidget;
class Ui_SphereWidget;
namespace FemGui
{
class ViewProviderFemPostFunction;
class FemGuiExport FunctionWidget : public QWidget {
Q_OBJECT
public:
FunctionWidget() {}
virtual ~FunctionWidget() {}
virtual void applyPythonCode() = 0;
virtual void setViewProvider(ViewProviderFemPostFunction* view);
void onObjectsChanged(const App::DocumentObject& obj, const App::Property&);
protected:
ViewProviderFemPostFunction* getView() {return m_view;}
Fem::FemPostFunction* getObject(){return m_object;}
bool blockObjectUpdates() {return m_block;}
void setBlockObjectUpdates(bool val) {m_block = val;}
virtual void onChange(const App::Property& p) = 0;
private:
bool m_block;
ViewProviderFemPostFunction* m_view;
Fem::FemPostFunction* m_object;
boost::signals2::scoped_connection m_connection;
};
class FemGuiExport ViewProviderFemPostFunctionProvider : public Gui::ViewProviderDocumentObject
{
PROPERTY_HEADER(FemGui::ViewProviderFemPostFunction);
public:
ViewProviderFemPostFunctionProvider();
virtual ~ViewProviderFemPostFunctionProvider();
App::PropertyFloat SizeX;
App::PropertyFloat SizeY;
App::PropertyFloat SizeZ;
protected:
virtual std::vector< App::DocumentObject* > claimChildren(void) const;
virtual std::vector< App::DocumentObject* > claimChildren3D(void) const;
virtual void onChanged(const App::Property* prop);
virtual void updateData(const App::Property*);
void updateSize();
};
class FemGuiExport ViewProviderFemPostFunction : public Gui::ViewProviderDocumentObject
{
PROPERTY_HEADER(FemGui::ViewProviderFemPostFunction);
public:
/// constructor.
ViewProviderFemPostFunction();
~ViewProviderFemPostFunction();
App::PropertyFloat AutoScaleFactorX;
App::PropertyFloat AutoScaleFactorY;
App::PropertyFloat AutoScaleFactorZ;
void attach(App::DocumentObject *pcObject);
bool doubleClicked(void);
std::vector<std::string> getDisplayModes() const;
//creates the widget used in the task dalogs, either for the function itself or for
//the fiter using it
virtual FunctionWidget* createControlWidget() {return NULL;}
protected:
virtual bool setEdit(int ModNum);
virtual void unsetEdit(int ModNum);
virtual void onChanged(const App::Property* prop);
void setAutoScale(bool value) {m_autoscale = value;}
bool autoScale() {return m_autoscale;}
bool isDragging() {return m_isDragging;}
virtual SoTransformManip* setupManipulator();
virtual void draggerUpdate(SoDragger*) {}
SoTransformManip* getManipulator() {return m_manip;}
SoSeparator* getGeometryNode() {return m_geometrySeperator;}
SoScale* getScaleNode() {return m_scale;}
SoTransform* getTransformNode() {return m_transform;}
private:
static void dragStartCallback(void * data, SoDragger * d);
static void dragFinishCallback(void * data, SoDragger * d);
static void dragMotionCallback(void * data, SoDragger * d);
SoSeparator* m_geometrySeperator;
SoTransformManip* m_manip;
SoScale* m_scale;
SoTransform* m_transform;
bool m_autoscale, m_isDragging, m_autoRecompute;
};
// ***************************************************************************
class FemGuiExport PlaneWidget : public FunctionWidget {
Q_OBJECT
public:
PlaneWidget();
virtual ~PlaneWidget();
virtual void applyPythonCode();
virtual void onChange(const App::Property& p);
virtual void setViewProvider(ViewProviderFemPostFunction* view);
private Q_SLOTS:
void originChanged(double);
void normalChanged(double);
private:
Ui_PlaneWidget* ui;
};
class FemGuiExport ViewProviderFemPostPlaneFunction : public ViewProviderFemPostFunction {
PROPERTY_HEADER(FemGui::ViewProviderFemPostPlaneFunction);
public:
ViewProviderFemPostPlaneFunction();
virtual ~ViewProviderFemPostPlaneFunction();
virtual FunctionWidget* createControlWidget();
protected:
virtual void draggerUpdate(SoDragger* mat);
virtual void updateData(const App::Property*);
};
// ***************************************************************************
class FemGuiExport SphereWidget : public FunctionWidget {
Q_OBJECT
public:
SphereWidget();
virtual ~SphereWidget();
virtual void applyPythonCode();
virtual void onChange(const App::Property& p);
virtual void setViewProvider(ViewProviderFemPostFunction* view);
private Q_SLOTS:
void centerChanged(double);
void radiusChanged(double);
private:
Ui_SphereWidget* ui;
};
class FemGuiExport ViewProviderFemPostSphereFunction : public ViewProviderFemPostFunction {
PROPERTY_HEADER(FemGui::ViewProviderFemPostSphereFunction);
public:
ViewProviderFemPostSphereFunction();
virtual ~ViewProviderFemPostSphereFunction();
virtual SoTransformManip* setupManipulator();
virtual FunctionWidget* createControlWidget();
protected:
virtual void draggerUpdate(SoDragger* mat);
virtual void updateData(const App::Property*);
};
} //namespace FemGui
#endif // FEM_VIEWPROVIDERFEMPOSTFUNCTION_H

File diff suppressed because it is too large Load Diff

View File

@@ -1,162 +1,162 @@
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEM_VIEWPROVIDERFEMPOSTOBJECT_H
#define FEM_VIEWPROVIDERFEMPOSTOBJECT_H
#include <Gui/ViewProviderGeometryObject.h>
#include <CXX/Objects.hxx>
#include <Base/Observer.h>
#include <vtkSmartPointer.h>
#include <vtkPolyDataMapper.h>
#include <vtkOutlineFilter.h>
#include <vtkOutlineCornerFilter.h>
#include <vtkLookupTable.h>
#include <vtkExtractEdges.h>
#include <vtkAppendPolyData.h>
#include <vtkGeometryFilter.h>
#include <vtkVertexGlyphFilter.h>
class SoIndexedPointSet;
class vtkUnsignedCharArray;
class vtkDataArray;
class vtkPoints;
class SoSeparator;
class SoNormal;
class SoNormalBinding;
class SoMaterial;
class SoShapeHints;
class SoMaterialBinding;
class SoIndexedFaceSet;
class SoIndexedLineSet;
class SoIndexedMarkerSet;
class SoCoordinate3;
class SoDrawStyle;
class SoIndexedFaceSet;
class SoIndexedLineSet;
class SoIndexedTriangleStripSet;
namespace Gui {
class SoFCColorBar;
}
namespace FemGui
{
class TaskDlgPost;
class FemGuiExport ViewProviderFemPostObject : public Gui::ViewProviderDocumentObject,
public Base::Observer<int>
{
PROPERTY_HEADER(FemGui::ViewProviderFemPostObject);
public:
/// constructor.
ViewProviderFemPostObject();
/// destructor.
~ViewProviderFemPostObject();
App::PropertyEnumeration Field;
App::PropertyEnumeration VectorMode;
App::PropertyPercent Transparency;
void attach(App::DocumentObject *pcObject);
void setDisplayMode(const char* ModeName);
std::vector<std::string> getDisplayModes() const;
void updateData(const App::Property*);
void onChanged(const App::Property* prop);
//edit handling
virtual bool doubleClicked(void);
virtual bool setEdit(int ModNum);
virtual void unsetEdit(int ModNum);
virtual void hide(void);
virtual void show(void);
virtual SoSeparator* getFrontRoot(void) const;
//observer for the color bar
virtual void OnChange(Base::Subject< int >& rCaller, int rcReason);
/** @name Selection handling
* This group of methods do the selection handling.
* Here you can define how the selection for your ViewProvider
* works.
*/
//@{
// /// indicates if the ViewProvider use the new Selection model
// virtual bool useNewSelectionModel(void) const {return true;}
// /// return a hit element to the selection path or 0
// virtual std::string getElement(const SoDetail*) const;
// virtual SoDetail* getDetail(const char*) const;
// /// return the highlight lines for a given element or the whole shape
// virtual std::vector<Base::Vector3d> getSelectionShape(const char* Element) const;
// //@}
protected:
virtual void setupTaskDialog(TaskDlgPost* dlg);
bool setupPipeline();
void update();
SoCoordinate3* m_coordinates;
SoIndexedPointSet* m_markers;
SoIndexedLineSet* m_lines;
SoIndexedFaceSet* m_faces;
SoIndexedTriangleStripSet* m_triangleStrips;
SoMaterial* m_material;
SoMaterialBinding* m_materialBinding;
SoShapeHints* m_shapeHints;
SoNormalBinding* m_normalBinding;
SoNormal* m_normals;
SoDrawStyle* m_drawStyle;
SoSeparator* m_seperator;
Gui::SoFCColorBar* m_colorBar;
SoSeparator* m_colorRoot;
SoDrawStyle* m_colorStyle;
vtkSmartPointer<vtkPolyDataAlgorithm> m_currentAlgorithm;
vtkSmartPointer<vtkGeometryFilter> m_surface;
vtkSmartPointer<vtkAppendPolyData> m_surfaceEdges;
vtkSmartPointer<vtkOutlineCornerFilter> m_outline;
vtkSmartPointer<vtkExtractEdges> m_wireframe, m_wireframeSurface;
vtkSmartPointer<vtkVertexGlyphFilter> m_points, m_pointsSurface;
private:
void updateProperties();
void update3D();
void WritePointData(vtkPoints *points, vtkDataArray *normals,
vtkDataArray *tcoords);
void WriteColorData(bool ResetColorBarRange);
void WriteTransparency();
App::Enumeration m_coloringEnum, m_vectorEnum;
bool m_blockPropertyChanges;
};
} //namespace FemGui
#endif // FEM_VIEWPROVIDERFEMPOSTOBJECT_H
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEM_VIEWPROVIDERFEMPOSTOBJECT_H
#define FEM_VIEWPROVIDERFEMPOSTOBJECT_H
#include <Gui/ViewProviderGeometryObject.h>
#include <CXX/Objects.hxx>
#include <Base/Observer.h>
#include <vtkSmartPointer.h>
#include <vtkPolyDataMapper.h>
#include <vtkOutlineFilter.h>
#include <vtkOutlineCornerFilter.h>
#include <vtkLookupTable.h>
#include <vtkExtractEdges.h>
#include <vtkAppendPolyData.h>
#include <vtkGeometryFilter.h>
#include <vtkVertexGlyphFilter.h>
class SoIndexedPointSet;
class vtkUnsignedCharArray;
class vtkDataArray;
class vtkPoints;
class SoSeparator;
class SoNormal;
class SoNormalBinding;
class SoMaterial;
class SoShapeHints;
class SoMaterialBinding;
class SoIndexedFaceSet;
class SoIndexedLineSet;
class SoIndexedMarkerSet;
class SoCoordinate3;
class SoDrawStyle;
class SoIndexedFaceSet;
class SoIndexedLineSet;
class SoIndexedTriangleStripSet;
namespace Gui {
class SoFCColorBar;
}
namespace FemGui
{
class TaskDlgPost;
class FemGuiExport ViewProviderFemPostObject : public Gui::ViewProviderDocumentObject,
public Base::Observer<int>
{
PROPERTY_HEADER(FemGui::ViewProviderFemPostObject);
public:
/// constructor.
ViewProviderFemPostObject();
/// destructor.
~ViewProviderFemPostObject();
App::PropertyEnumeration Field;
App::PropertyEnumeration VectorMode;
App::PropertyPercent Transparency;
void attach(App::DocumentObject *pcObject);
void setDisplayMode(const char* ModeName);
std::vector<std::string> getDisplayModes() const;
void updateData(const App::Property*);
void onChanged(const App::Property* prop);
//edit handling
virtual bool doubleClicked(void);
virtual bool setEdit(int ModNum);
virtual void unsetEdit(int ModNum);
virtual void hide(void);
virtual void show(void);
virtual SoSeparator* getFrontRoot(void) const;
//observer for the color bar
virtual void OnChange(Base::Subject< int >& rCaller, int rcReason);
/** @name Selection handling
* This group of methods do the selection handling.
* Here you can define how the selection for your ViewProvider
* works.
*/
//@{
// /// indicates if the ViewProvider use the new Selection model
// virtual bool useNewSelectionModel(void) const {return true;}
// /// return a hit element to the selection path or 0
// virtual std::string getElement(const SoDetail*) const;
// virtual SoDetail* getDetail(const char*) const;
// /// return the highlight lines for a given element or the whole shape
// virtual std::vector<Base::Vector3d> getSelectionShape(const char* Element) const;
// //@}
protected:
virtual void setupTaskDialog(TaskDlgPost* dlg);
bool setupPipeline();
void update();
SoCoordinate3* m_coordinates;
SoIndexedPointSet* m_markers;
SoIndexedLineSet* m_lines;
SoIndexedFaceSet* m_faces;
SoIndexedTriangleStripSet* m_triangleStrips;
SoMaterial* m_material;
SoMaterialBinding* m_materialBinding;
SoShapeHints* m_shapeHints;
SoNormalBinding* m_normalBinding;
SoNormal* m_normals;
SoDrawStyle* m_drawStyle;
SoSeparator* m_seperator;
Gui::SoFCColorBar* m_colorBar;
SoSeparator* m_colorRoot;
SoDrawStyle* m_colorStyle;
vtkSmartPointer<vtkPolyDataAlgorithm> m_currentAlgorithm;
vtkSmartPointer<vtkGeometryFilter> m_surface;
vtkSmartPointer<vtkAppendPolyData> m_surfaceEdges;
vtkSmartPointer<vtkOutlineCornerFilter> m_outline;
vtkSmartPointer<vtkExtractEdges> m_wireframe, m_wireframeSurface;
vtkSmartPointer<vtkVertexGlyphFilter> m_points, m_pointsSurface;
private:
void updateProperties();
void update3D();
void WritePointData(vtkPoints *points, vtkDataArray *normals,
vtkDataArray *tcoords);
void WriteColorData(bool ResetColorBarRange);
void WriteTransparency();
App::Enumeration m_coloringEnum, m_vectorEnum;
bool m_blockPropertyChanges;
};
} //namespace FemGui
#endif // FEM_VIEWPROVIDERFEMPOSTOBJECT_H

View File

@@ -1,90 +1,90 @@
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#include "ViewProviderFemPostPipeline.h"
#include "ViewProviderFemPostFunction.h"
#include <Mod/Fem/App/FemPostPipeline.h>
#include <Base/Console.h>
#include <Gui/Application.h>
using namespace FemGui;
PROPERTY_SOURCE(FemGui::ViewProviderFemPostPipeline, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostPipeline::ViewProviderFemPostPipeline()
{
sPixmap = "fem-post-data-pipline";
}
ViewProviderFemPostPipeline::~ViewProviderFemPostPipeline()
{
}
std::vector< App::DocumentObject* > ViewProviderFemPostPipeline::claimChildren(void) const {
Fem::FemPostPipeline* pipeline = static_cast<Fem::FemPostPipeline*>(getObject());
std::vector<App::DocumentObject*> children;
if(pipeline->Functions.getValue())
children.push_back(pipeline->Functions.getValue());
children.insert(children.end(), pipeline->Filter.getValues().begin(), pipeline->Filter.getValues().end());
return children;
}
std::vector< App::DocumentObject* > ViewProviderFemPostPipeline::claimChildren3D(void) const {
return claimChildren();
}
void ViewProviderFemPostPipeline::updateData(const App::Property* prop) {
FemGui::ViewProviderFemPostObject::onChanged(prop);
if(strcmp(prop->getName(), "Function") == 0) {
updateFunctionSize();
}
}
void ViewProviderFemPostPipeline::updateFunctionSize() {
//we need to get the bounding box and set the function provider size
Fem::FemPostPipeline* obj = static_cast<Fem::FemPostPipeline*>(getObject());
if(!obj->Functions.getValue() || !obj->Functions.getValue()->isDerivedFrom(Fem::FemPostFunctionProvider::getClassTypeId()))
return;
//get the function provider
FemGui::ViewProviderFemPostFunctionProvider* vp = static_cast<FemGui::ViewProviderFemPostFunctionProvider*>(
Gui::Application::Instance->getViewProvider(obj->Functions.getValue()));
if(obj->Data.getValue() && obj->Data.getValue()->IsA("vtkDataSet")) {
vtkBoundingBox box = obj->getBoundingBox();
vp->SizeX.setValue(box.GetLength(0)*1.2);
vp->SizeY.setValue(box.GetLength(1)*1.2);
vp->SizeZ.setValue(box.GetLength(2)*1.2);
}
}
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#include "ViewProviderFemPostPipeline.h"
#include "ViewProviderFemPostFunction.h"
#include <Mod/Fem/App/FemPostPipeline.h>
#include <Base/Console.h>
#include <Gui/Application.h>
using namespace FemGui;
PROPERTY_SOURCE(FemGui::ViewProviderFemPostPipeline, FemGui::ViewProviderFemPostObject)
ViewProviderFemPostPipeline::ViewProviderFemPostPipeline()
{
sPixmap = "fem-post-data-pipline";
}
ViewProviderFemPostPipeline::~ViewProviderFemPostPipeline()
{
}
std::vector< App::DocumentObject* > ViewProviderFemPostPipeline::claimChildren(void) const {
Fem::FemPostPipeline* pipeline = static_cast<Fem::FemPostPipeline*>(getObject());
std::vector<App::DocumentObject*> children;
if(pipeline->Functions.getValue())
children.push_back(pipeline->Functions.getValue());
children.insert(children.end(), pipeline->Filter.getValues().begin(), pipeline->Filter.getValues().end());
return children;
}
std::vector< App::DocumentObject* > ViewProviderFemPostPipeline::claimChildren3D(void) const {
return claimChildren();
}
void ViewProviderFemPostPipeline::updateData(const App::Property* prop) {
FemGui::ViewProviderFemPostObject::onChanged(prop);
if(strcmp(prop->getName(), "Function") == 0) {
updateFunctionSize();
}
}
void ViewProviderFemPostPipeline::updateFunctionSize() {
//we need to get the bounding box and set the function provider size
Fem::FemPostPipeline* obj = static_cast<Fem::FemPostPipeline*>(getObject());
if(!obj->Functions.getValue() || !obj->Functions.getValue()->isDerivedFrom(Fem::FemPostFunctionProvider::getClassTypeId()))
return;
//get the function provider
FemGui::ViewProviderFemPostFunctionProvider* vp = static_cast<FemGui::ViewProviderFemPostFunctionProvider*>(
Gui::Application::Instance->getViewProvider(obj->Functions.getValue()));
if(obj->Data.getValue() && obj->Data.getValue()->IsA("vtkDataSet")) {
vtkBoundingBox box = obj->getBoundingBox();
vp->SizeX.setValue(box.GetLength(0)*1.2);
vp->SizeY.setValue(box.GetLength(1)*1.2);
vp->SizeZ.setValue(box.GetLength(2)*1.2);
}
}

View File

@@ -1,53 +1,53 @@
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEM_VIEWPROVIDERFEMPOSTPIPELINE_H
#define FEM_VIEWPROVIDERFEMPOSTPIPELINE_H
#include "ViewProviderFemPostObject.h"
namespace FemGui
{
class FemGuiExport ViewProviderFemPostPipeline : public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostPipeline);
public:
/// constructor.
ViewProviderFemPostPipeline();
~ViewProviderFemPostPipeline();
virtual std::vector< App::DocumentObject* > claimChildren(void) const;
virtual std::vector< App::DocumentObject* > claimChildren3D(void) const;
virtual void updateData(const App::Property* prop);
protected:
void updateFunctionSize();
};
} //namespace FemGui
#endif // FEM_VIEWPROVIDERFEMPOSTPIPELINE_H
/***************************************************************************
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEM_VIEWPROVIDERFEMPOSTPIPELINE_H
#define FEM_VIEWPROVIDERFEMPOSTPIPELINE_H
#include "ViewProviderFemPostObject.h"
namespace FemGui
{
class FemGuiExport ViewProviderFemPostPipeline : public ViewProviderFemPostObject {
PROPERTY_HEADER(FemGui::ViewProviderFemPostPipeline);
public:
/// constructor.
ViewProviderFemPostPipeline();
~ViewProviderFemPostPipeline();
virtual std::vector< App::DocumentObject* > claimChildren(void) const;
virtual std::vector< App::DocumentObject* > claimChildren3D(void) const;
virtual void updateData(const App::Property* prop);
protected:
void updateFunctionSize();
};
} //namespace FemGui
#endif // FEM_VIEWPROVIDERFEMPOSTPIPELINE_H