[skip CI] [FEM] some style changes by MSVC
- to avoid annoying unnecessary diffs while working on the FEM module
This commit is contained in:
@@ -44,7 +44,7 @@ AbaqusHighlighter::~AbaqusHighlighter()
|
||||
{
|
||||
}
|
||||
|
||||
void AbaqusHighlighter::highlightBlock(const QString &text)
|
||||
void AbaqusHighlighter::highlightBlock(const QString& text)
|
||||
{
|
||||
// Find a syntax file for the Abaqus format here
|
||||
// http://notepad-plus.sourceforge.net/commun/userDefinedLang/userDefineLang_Abaqus.xml
|
||||
@@ -54,11 +54,11 @@ void AbaqusHighlighter::highlightBlock(const QString &text)
|
||||
int state = NormalState;
|
||||
int start = 0;
|
||||
|
||||
QColor keywordColor(102,0,227); // this->colorByType(SyntaxHighlighter::Keyword)
|
||||
QColor defnameColor(0,119,255); // this->colorByType(SyntaxHighlighter::Defname)
|
||||
QColor operateColor(153,0,102); // this->colorByType(SyntaxHighlighter::Operator)
|
||||
QColor valueColor(0,0,0); // this->colorByType(SyntaxHighlighter::String)
|
||||
QColor numberColor(0,127,127); // this->colorByType(SyntaxHighlighter::Number)
|
||||
QColor keywordColor(102, 0, 227); // this->colorByType(SyntaxHighlighter::Keyword)
|
||||
QColor defnameColor(0, 119, 255); // this->colorByType(SyntaxHighlighter::Defname)
|
||||
QColor operateColor(153, 0, 102); // this->colorByType(SyntaxHighlighter::Operator)
|
||||
QColor valueColor(0, 0, 0); // this->colorByType(SyntaxHighlighter::String)
|
||||
QColor numberColor(0, 127, 127); // this->colorByType(SyntaxHighlighter::Number)
|
||||
QColor commentColor = this->colorByType(SyntaxHighlighter::Comment);
|
||||
|
||||
for (int i = 0; i < text.length(); ++i) {
|
||||
|
||||
@@ -55,7 +55,7 @@ void ActiveAnalysisObserver::setActiveObject(Fem::FemAnalysis* fem)
|
||||
activeObject = fem;
|
||||
App::Document* doc = fem->getDocument();
|
||||
activeDocument = Gui::Application::Instance->getDocument(doc);
|
||||
activeView = static_cast<Gui::ViewProviderDocumentObject *>(activeDocument->getViewProvider(activeObject));
|
||||
activeView = static_cast<Gui::ViewProviderDocumentObject*>(activeDocument->getViewProvider(activeObject));
|
||||
attachDocument(doc);
|
||||
}
|
||||
else {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,9 +30,9 @@
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemElmerImp::DlgSettingsFemElmerImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemElmerImp)
|
||||
DlgSettingsFemElmerImp::DlgSettingsFemElmerImp(QWidget* parent)
|
||||
: PreferencePage(parent)
|
||||
, ui(new Ui_DlgSettingsFemElmerImp)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ void DlgSettingsFemElmerImp::loadSettings()
|
||||
/**
|
||||
* Sets the strings of the subwidgets using the current language.
|
||||
*/
|
||||
void DlgSettingsFemElmerImp::changeEvent(QEvent *e)
|
||||
void DlgSettingsFemElmerImp::changeEvent(QEvent* e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemGeneralImp::DlgSettingsFemGeneralImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemGeneralImp)
|
||||
DlgSettingsFemGeneralImp::DlgSettingsFemGeneralImp(QWidget* parent)
|
||||
: PreferencePage(parent)
|
||||
, ui(new Ui_DlgSettingsFemGeneralImp)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
@@ -75,7 +75,7 @@ void DlgSettingsFemGeneralImp::loadSettings()
|
||||
/**
|
||||
* Sets the strings of the subwidgets using the current language.
|
||||
*/
|
||||
void DlgSettingsFemGeneralImp::changeEvent(QEvent *e)
|
||||
void DlgSettingsFemGeneralImp::changeEvent(QEvent* e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemGmshImp::DlgSettingsFemGmshImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemGmshImp)
|
||||
DlgSettingsFemGmshImp::DlgSettingsFemGmshImp(QWidget* parent)
|
||||
: PreferencePage(parent)
|
||||
, ui(new Ui_DlgSettingsFemGmshImp)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
@@ -57,7 +57,7 @@ void DlgSettingsFemGmshImp::loadSettings()
|
||||
/**
|
||||
* Sets the strings of the subwidgets using the current language.
|
||||
*/
|
||||
void DlgSettingsFemGmshImp::changeEvent(QEvent *e)
|
||||
void DlgSettingsFemGmshImp::changeEvent(QEvent* e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemInOutVtkImp::DlgSettingsFemInOutVtkImp( QWidget* parent )
|
||||
: PreferencePage( parent ), ui(new Ui_DlgSettingsFemInOutVtk)
|
||||
DlgSettingsFemInOutVtkImp::DlgSettingsFemInOutVtkImp(QWidget* parent)
|
||||
: PreferencePage(parent), ui(new Ui_DlgSettingsFemInOutVtk)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
@@ -49,8 +49,8 @@ DlgSettingsFemInOutVtkImp::~DlgSettingsFemInOutVtkImp()
|
||||
|
||||
void DlgSettingsFemInOutVtkImp::saveSettings()
|
||||
{
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Fem/InOutVtk");
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
|
||||
"User parameter:BaseApp/Preferences/Mod/Fem/InOutVtk");
|
||||
hGrp->SetInt("ImportObject", ui->comboBoxVtkImportObject->currentIndex());
|
||||
|
||||
ui->comboBoxVtkImportObject->onSave();
|
||||
@@ -60,9 +60,9 @@ 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);
|
||||
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);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ void DlgSettingsFemInOutVtkImp::loadSettings()
|
||||
/**
|
||||
* Sets the strings of the subwidgets using the current language.
|
||||
*/
|
||||
void DlgSettingsFemInOutVtkImp::changeEvent(QEvent *e)
|
||||
void DlgSettingsFemInOutVtkImp::changeEvent(QEvent* e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
int c_index = ui->comboBoxVtkImportObject->currentIndex();
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemMaterialImp::DlgSettingsFemMaterialImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemMaterialImp)
|
||||
DlgSettingsFemMaterialImp::DlgSettingsFemMaterialImp(QWidget* parent)
|
||||
: PreferencePage(parent)
|
||||
, ui(new Ui_DlgSettingsFemMaterialImp)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ void DlgSettingsFemMaterialImp::loadSettings()
|
||||
/**
|
||||
* Sets the strings of the subwidgets using the current language.
|
||||
*/
|
||||
void DlgSettingsFemMaterialImp::changeEvent(QEvent *e)
|
||||
void DlgSettingsFemMaterialImp::changeEvent(QEvent* e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemMystranImp::DlgSettingsFemMystranImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemMystranImp)
|
||||
DlgSettingsFemMystranImp::DlgSettingsFemMystranImp(QWidget* parent)
|
||||
: PreferencePage(parent)
|
||||
, ui(new Ui_DlgSettingsFemMystranImp)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
@@ -59,7 +59,7 @@ void DlgSettingsFemMystranImp::loadSettings()
|
||||
/**
|
||||
* Sets the strings of the subwidgets using the current language.
|
||||
*/
|
||||
void DlgSettingsFemMystranImp::changeEvent(QEvent *e)
|
||||
void DlgSettingsFemMystranImp::changeEvent(QEvent* e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemZ88Imp::DlgSettingsFemZ88Imp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgSettingsFemZ88Imp)
|
||||
DlgSettingsFemZ88Imp::DlgSettingsFemZ88Imp(QWidget* parent)
|
||||
: PreferencePage(parent)
|
||||
, ui(new Ui_DlgSettingsFemZ88Imp)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ void DlgSettingsFemZ88Imp::loadSettings()
|
||||
/**
|
||||
* Sets the strings of the subwidgets using the current language.
|
||||
*/
|
||||
void DlgSettingsFemZ88Imp::changeEvent(QEvent *e)
|
||||
void DlgSettingsFemZ88Imp::changeEvent(QEvent* e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
|
||||
@@ -35,17 +35,17 @@ bool FemSelectionGate::allow(App::Document* /*pDoc*/, App::DocumentObject* /*pOb
|
||||
if (!sSubName || sSubName[0] == '\0')
|
||||
return false;
|
||||
|
||||
if( sSubName[0] == 'E' &&
|
||||
if (sSubName[0] == 'E' &&
|
||||
sSubName[1] == 'l' &&
|
||||
sSubName[2] == 'e' &&
|
||||
sSubName[3] == 'm' &&
|
||||
(Type == Element || Type == NodeElement) )
|
||||
(Type == Element || Type == NodeElement))
|
||||
return true;
|
||||
if( sSubName[0] == 'N' &&
|
||||
if (sSubName[0] == 'N' &&
|
||||
sSubName[1] == 'o' &&
|
||||
sSubName[2] == 'd' &&
|
||||
sSubName[3] == 'e' &&
|
||||
(Type == Node || Type == NodeElement) )
|
||||
(Type == Node || Type == NodeElement))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -136,13 +136,13 @@ QWidget* PropertyFemMeshItem::createEditor(QWidget* parent, const QObject* recei
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void PropertyFemMeshItem::setEditorData(QWidget *editor, const QVariant& data) const
|
||||
void PropertyFemMeshItem::setEditorData(QWidget* editor, const QVariant& data) const
|
||||
{
|
||||
Q_UNUSED(editor);
|
||||
Q_UNUSED(data);
|
||||
}
|
||||
|
||||
QVariant PropertyFemMeshItem::editorData(QWidget *editor) const
|
||||
QVariant PropertyFemMeshItem::editorData(QWidget* editor) const
|
||||
{
|
||||
Q_UNUSED(editor);
|
||||
return QVariant();
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <QString>
|
||||
@@ -36,16 +35,14 @@
|
||||
#include <Gui/BitmapFactory.h>
|
||||
|
||||
|
||||
|
||||
using namespace FemGui;
|
||||
using namespace Gui;
|
||||
|
||||
|
||||
TaskAnalysisInfo::TaskAnalysisInfo(Fem::FemAnalysis *pcObject,QWidget *parent)
|
||||
TaskAnalysisInfo::TaskAnalysisInfo(Fem::FemAnalysis* pcObject, QWidget* parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("FEM_Analysis"),
|
||||
tr("Nodes set"),
|
||||
true,
|
||||
parent),
|
||||
tr("Nodes set"),
|
||||
true,
|
||||
parent),
|
||||
pcObject(pcObject)
|
||||
{
|
||||
// we need a separate container widget to add all controls to
|
||||
@@ -56,24 +53,24 @@ TaskAnalysisInfo::TaskAnalysisInfo(Fem::FemAnalysis *pcObject,QWidget *parent)
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
/* QObject::connect(ui->toolButton_Poly,SIGNAL(clicked()),this,SLOT(Poly()));
|
||||
QObject::connect(ui->toolButton_Pick,SIGNAL(clicked()),this,SLOT(Pick()));
|
||||
QObject::connect(ui->comboBox,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int)));*/
|
||||
/* QObject::connect(ui->toolButton_Poly,SIGNAL(clicked()),this,SLOT(Poly()));
|
||||
QObject::connect(ui->toolButton_Pick,SIGNAL(clicked()),this,SLOT(Pick()));
|
||||
QObject::connect(ui->comboBox,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int)));*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
void TaskAnalysisInfo::SwitchMethod(int /*Value*/)
|
||||
{
|
||||
/* if(Value == 1){
|
||||
ui->groupBox_AngleSearch->setEnabled(true);
|
||||
ui->toolButton_Pick->setEnabled(true);
|
||||
ui->toolButton_Poly->setEnabled(false);
|
||||
}else{
|
||||
ui->groupBox_AngleSearch->setEnabled(false);
|
||||
ui->toolButton_Pick->setEnabled(false);
|
||||
ui->toolButton_Poly->setEnabled(true);
|
||||
}*/
|
||||
/* if(Value == 1){
|
||||
ui->groupBox_AngleSearch->setEnabled(true);
|
||||
ui->toolButton_Pick->setEnabled(true);
|
||||
ui->toolButton_Poly->setEnabled(false);
|
||||
}else{
|
||||
ui->groupBox_AngleSearch->setEnabled(false);
|
||||
ui->toolButton_Pick->setEnabled(false);
|
||||
ui->toolButton_Poly->setEnabled(true);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
@@ -82,5 +79,4 @@ TaskAnalysisInfo::~TaskAnalysisInfo()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
#include "moc_TaskAnalysisInfo.cpp"
|
||||
|
||||
@@ -59,13 +59,13 @@ using namespace FemGui;
|
||||
using namespace Gui;
|
||||
|
||||
|
||||
TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *parent)
|
||||
TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject* pcObject, QWidget* parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("FEM_CreateNodesSet"),
|
||||
tr("Nodes set"),
|
||||
true,
|
||||
parent),
|
||||
pcObject(pcObject),
|
||||
selectionMode(none)
|
||||
tr("Nodes set"),
|
||||
true,
|
||||
parent),
|
||||
pcObject(pcObject),
|
||||
selectionMode(none)
|
||||
{
|
||||
// we need a separate container widget to add all controls to
|
||||
proxy = new QWidget(this);
|
||||
@@ -75,13 +75,13 @@ TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *p
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
QObject::connect(ui->toolButton_Poly,SIGNAL(clicked()),this,SLOT(Poly()));
|
||||
QObject::connect(ui->toolButton_Pick,SIGNAL(clicked()),this,SLOT(Pick()));
|
||||
QObject::connect(ui->comboBox,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int)));
|
||||
QObject::connect(ui->toolButton_Poly, SIGNAL(clicked()), this, SLOT(Poly()));
|
||||
QObject::connect(ui->toolButton_Pick, SIGNAL(clicked()), this, SLOT(Pick()));
|
||||
QObject::connect(ui->comboBox, SIGNAL(activated(int)), this, SLOT(SwitchMethod(int)));
|
||||
|
||||
// check if the Link to the FemMesh is defined
|
||||
assert(pcObject->FemMesh.getValue<Fem::FemMeshObject*>());
|
||||
MeshViewProvider = dynamic_cast<ViewProviderFemMesh*>(Gui::Application::Instance->getViewProvider( pcObject->FemMesh.getValue<Fem::FemMeshObject*>()));
|
||||
MeshViewProvider = dynamic_cast<ViewProviderFemMesh*>(Gui::Application::Instance->getViewProvider(pcObject->FemMesh.getValue<Fem::FemMeshObject*>()));
|
||||
assert(MeshViewProvider);
|
||||
|
||||
tempSet = pcObject->Nodes.getValues();
|
||||
@@ -100,13 +100,13 @@ void TaskCreateNodeSet::Poly(void)
|
||||
Gui::View3DInventorViewer* viewer = ((Gui::View3DInventor*)view)->getViewer();
|
||||
viewer->setEditing(true);
|
||||
viewer->startSelection(Gui::View3DInventorViewer::Clip);
|
||||
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), DefineNodesCallback,this);
|
||||
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), DefineNodesCallback, this);
|
||||
}
|
||||
}
|
||||
|
||||
void TaskCreateNodeSet::Pick(void)
|
||||
{
|
||||
if (selectionMode == none){
|
||||
if (selectionMode == none) {
|
||||
selectionMode = PickElement;
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().addSelectionGate(new FemSelectionGate(FemSelectionGate::Element));
|
||||
@@ -115,11 +115,12 @@ void TaskCreateNodeSet::Pick(void)
|
||||
|
||||
void TaskCreateNodeSet::SwitchMethod(int Value)
|
||||
{
|
||||
if(Value == 1){
|
||||
if (Value == 1) {
|
||||
ui->groupBox_AngleSearch->setEnabled(true);
|
||||
ui->toolButton_Pick->setEnabled(true);
|
||||
ui->toolButton_Poly->setEnabled(false);
|
||||
}else{
|
||||
}
|
||||
else {
|
||||
ui->groupBox_AngleSearch->setEnabled(false);
|
||||
ui->toolButton_Pick->setEnabled(false);
|
||||
ui->toolButton_Poly->setEnabled(true);
|
||||
@@ -128,18 +129,18 @@ void TaskCreateNodeSet::SwitchMethod(int Value)
|
||||
|
||||
|
||||
|
||||
void TaskCreateNodeSet::DefineNodesCallback(void * ud, SoEventCallback * n)
|
||||
void TaskCreateNodeSet::DefineNodesCallback(void* ud, SoEventCallback* n)
|
||||
{
|
||||
// show the wait cursor because this could take quite some time
|
||||
Gui::WaitCursor wc;
|
||||
|
||||
TaskCreateNodeSet *taskBox = static_cast<TaskCreateNodeSet *>(ud);
|
||||
TaskCreateNodeSet* taskBox = static_cast<TaskCreateNodeSet*>(ud);
|
||||
|
||||
|
||||
// When this callback function is invoked we must in either case leave the edit mode
|
||||
Gui::View3DInventorViewer* view = reinterpret_cast<Gui::View3DInventorViewer*>(n->getUserData());
|
||||
Gui::View3DInventorViewer* view = reinterpret_cast<Gui::View3DInventorViewer*>(n->getUserData());
|
||||
view->setEditing(false);
|
||||
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), DefineNodesCallback,ud);
|
||||
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), DefineNodesCallback, ud);
|
||||
n->setHandled();
|
||||
|
||||
Gui::SelectionRole role;
|
||||
@@ -154,24 +155,24 @@ void TaskCreateNodeSet::DefineNodesCallback(void * ud, SoEventCallback * n)
|
||||
Gui::ViewVolumeProjection proj(vv);
|
||||
Base::Polygon2d polygon;
|
||||
for (std::vector<SbVec2f>::const_iterator it = clPoly.begin(); it != clPoly.end(); ++it)
|
||||
polygon.Add(Base::Vector2d((*it)[0],(*it)[1]));
|
||||
polygon.Add(Base::Vector2d((*it)[0], (*it)[1]));
|
||||
|
||||
taskBox->DefineNodes(polygon,proj,role == Gui::SelectionRole::Inner ? true : false);
|
||||
taskBox->DefineNodes(polygon, proj, role == Gui::SelectionRole::Inner ? true : false);
|
||||
}
|
||||
|
||||
void TaskCreateNodeSet::DefineNodes(const Base::Polygon2d &polygon,const Gui::ViewVolumeProjection &proj,bool inner)
|
||||
void TaskCreateNodeSet::DefineNodes(const Base::Polygon2d& polygon, const Gui::ViewVolumeProjection& proj, bool inner)
|
||||
{
|
||||
const SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(pcObject->FemMesh.getValue<Fem::FemMeshObject*>()->FemMesh.getValue().getSMesh())->GetMeshDS();
|
||||
|
||||
SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator();
|
||||
Base::Vector3f pt2d;
|
||||
|
||||
if(! ui->checkBox_Add->isChecked())
|
||||
if (!ui->checkBox_Add->isChecked())
|
||||
tempSet.clear();
|
||||
|
||||
while (aNodeIter->more()) {
|
||||
const SMDS_MeshNode* aNode = aNodeIter->next();
|
||||
Base::Vector3f vec(aNode->X(),aNode->Y(),aNode->Z());
|
||||
Base::Vector3f vec(aNode->X(), aNode->Y(), aNode->Z());
|
||||
pt2d = proj(vec);
|
||||
if (polygon.Contains(Base::Vector2d(pt2d.x, pt2d.y)) == inner)
|
||||
tempSet.insert(aNode->GetID());
|
||||
@@ -187,25 +188,26 @@ void TaskCreateNodeSet::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
|
||||
if (msg.Type == Gui::SelectionChanges::AddSelection) {
|
||||
std::string subName(msg.pSubName);
|
||||
unsigned int i=0;
|
||||
for(;i<subName.size();i++)
|
||||
if(msg.pSubName[i]=='F')
|
||||
unsigned int i = 0;
|
||||
for (; i < subName.size(); i++)
|
||||
if (msg.pSubName[i] == 'F')
|
||||
break;
|
||||
|
||||
int elem = atoi(subName.substr(4).c_str());
|
||||
int face = atoi(subName.substr(i+1).c_str() );
|
||||
int face = atoi(subName.substr(i + 1).c_str());
|
||||
|
||||
tempSet.clear();
|
||||
tempSet.clear();
|
||||
|
||||
|
||||
Base::Console().Message("Picked Element:%i Face:%i\n",elem,face);
|
||||
Base::Console().Message("Picked Element:%i Face:%i\n", elem, face);
|
||||
|
||||
|
||||
if(! ui->checkBox_Add->isChecked()){
|
||||
std::set<long> tmp = pcObject->FemMesh.getValue<Fem::FemMeshObject*>()->FemMesh.getValue().getSurfaceNodes(elem,face);
|
||||
tempSet.insert(tmp.begin(),tmp.end());
|
||||
}else
|
||||
tempSet = pcObject->FemMesh.getValue<Fem::FemMeshObject*>()->FemMesh.getValue().getSurfaceNodes(elem,face);
|
||||
if (!ui->checkBox_Add->isChecked()) {
|
||||
std::set<long> tmp = pcObject->FemMesh.getValue<Fem::FemMeshObject*>()->FemMesh.getValue().getSurfaceNodes(elem, face);
|
||||
tempSet.insert(tmp.begin(), tmp.end());
|
||||
}
|
||||
else
|
||||
tempSet = pcObject->FemMesh.getValue<Fem::FemMeshObject*>()->FemMesh.getValue().getSurfaceNodes(elem, face);
|
||||
|
||||
selectionMode = none;
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
@@ -222,5 +224,4 @@ TaskCreateNodeSet::~TaskCreateNodeSet()
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
}
|
||||
|
||||
|
||||
#include "moc_TaskCreateNodeSet.cpp"
|
||||
|
||||
@@ -49,8 +49,8 @@ using namespace FemGui;
|
||||
// TaskDialog
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TaskDlgAnalysis::TaskDlgAnalysis(Fem::FemAnalysis *obj)
|
||||
: TaskDialog(),FemAnalysis(obj)
|
||||
TaskDlgAnalysis::TaskDlgAnalysis(Fem::FemAnalysis* obj)
|
||||
: TaskDialog(), FemAnalysis(obj)
|
||||
{
|
||||
driver = new TaskDriver(obj);
|
||||
info = new TaskAnalysisInfo(obj);
|
||||
@@ -114,5 +114,4 @@ void TaskDlgAnalysis::helpRequested()
|
||||
|
||||
}
|
||||
|
||||
|
||||
#include "moc_TaskDlgAnalysis.cpp"
|
||||
|
||||
@@ -45,8 +45,8 @@ using namespace FemGui;
|
||||
// TaskDialog
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TaskDlgCreateNodeSet::TaskDlgCreateNodeSet(Fem::FemSetNodesObject *obj)
|
||||
: TaskDialog(),FemSetNodesObject(obj)
|
||||
TaskDlgCreateNodeSet::TaskDlgCreateNodeSet(Fem::FemSetNodesObject* obj)
|
||||
: TaskDialog(), FemSetNodesObject(obj)
|
||||
{
|
||||
name = new TaskObjectName(obj);
|
||||
param = new TaskCreateNodeSet(obj);
|
||||
@@ -81,7 +81,7 @@ bool TaskDlgCreateNodeSet::accept()
|
||||
// doc->resetEdit();
|
||||
param->MeshViewProvider->resetHighlightNodes();
|
||||
FemSetNodesObject->Label.setValue(name->name);
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -95,12 +95,12 @@ bool TaskDlgCreateNodeSet::accept()
|
||||
bool TaskDlgCreateNodeSet::reject()
|
||||
{
|
||||
FemSetNodesObject->execute();
|
||||
//Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
//if(doc)
|
||||
// doc->resetEdit();
|
||||
//Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
//if(doc)
|
||||
// doc->resetEdit();
|
||||
param->MeshViewProvider->resetHighlightNodes();
|
||||
Gui::Command::abortCommand();
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -110,5 +110,4 @@ void TaskDlgCreateNodeSet::helpRequested()
|
||||
|
||||
}
|
||||
|
||||
|
||||
#include "moc_TaskDlgCreateNodeSet.cpp"
|
||||
|
||||
@@ -51,12 +51,12 @@ using namespace FemGui;
|
||||
// TaskDialog
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TaskDlgMeshShapeNetgen::TaskDlgMeshShapeNetgen(FemGui::ViewProviderFemMeshShapeNetgen *obj)
|
||||
TaskDlgMeshShapeNetgen::TaskDlgMeshShapeNetgen(FemGui::ViewProviderFemMeshShapeNetgen* obj)
|
||||
: TaskDialog(), param(nullptr), ViewProviderFemMeshShapeNetgen(obj)
|
||||
{
|
||||
FemMeshShapeNetgenObject = dynamic_cast<Fem::FemMeshShapeNetgenObject *>(obj->getObject());
|
||||
FemMeshShapeNetgenObject = dynamic_cast<Fem::FemMeshShapeNetgenObject*>(obj->getObject());
|
||||
if (FemMeshShapeNetgenObject) {
|
||||
param = new TaskTetParameter(FemMeshShapeNetgenObject);
|
||||
param = new TaskTetParameter(FemMeshShapeNetgenObject);
|
||||
Content.push_back(param);
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ void TaskDlgMeshShapeNetgen::open()
|
||||
void TaskDlgMeshShapeNetgen::clicked(int button)
|
||||
{
|
||||
try {
|
||||
if(QDialogButtonBox::Apply == button && param->touched)
|
||||
if (QDialogButtonBox::Apply == button && param->touched)
|
||||
{
|
||||
Gui::WaitCursor wc;
|
||||
// May throw an exception which we must handle here
|
||||
@@ -98,14 +98,14 @@ void TaskDlgMeshShapeNetgen::clicked(int button)
|
||||
bool TaskDlgMeshShapeNetgen::accept()
|
||||
{
|
||||
try {
|
||||
if(param->touched)
|
||||
if (param->touched)
|
||||
{
|
||||
Gui::WaitCursor wc;
|
||||
bool ret = FemMeshShapeNetgenObject->recomputeFeature();
|
||||
if (!ret) {
|
||||
wc.restoreCursor();
|
||||
QMessageBox::critical(Gui::getMainWindow(), tr("Meshing failure"),
|
||||
QString::fromStdString(FemMeshShapeNetgenObject->getStatusString()));
|
||||
QString::fromStdString(FemMeshShapeNetgenObject->getStatusString()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ bool TaskDlgMeshShapeNetgen::accept()
|
||||
}
|
||||
|
||||
//FemSetNodesObject->Label.setValue(name->name);
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
|
||||
Gui::Command::commitCommand();
|
||||
|
||||
return true;
|
||||
@@ -137,7 +137,7 @@ bool TaskDlgMeshShapeNetgen::reject()
|
||||
// // doc->resetEdit();
|
||||
//param->MeshViewProvider->resetHighlightNodes();
|
||||
Gui::Command::abortCommand();
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -147,5 +147,4 @@ void TaskDlgMeshShapeNetgen::helpRequested()
|
||||
|
||||
}
|
||||
|
||||
|
||||
#include "moc_TaskDlgMeshShapeNetgen.cpp"
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <Standard_math.hxx>
|
||||
@@ -29,7 +28,6 @@
|
||||
# include <QSlider>
|
||||
#endif
|
||||
|
||||
|
||||
#include "ui_TaskDriver.h"
|
||||
#include "TaskDriver.h"
|
||||
#include <Gui/Application.h>
|
||||
@@ -43,16 +41,14 @@
|
||||
#include <Gui/Utilities.h>
|
||||
|
||||
|
||||
|
||||
using namespace FemGui;
|
||||
using namespace Gui;
|
||||
|
||||
|
||||
TaskDriver::TaskDriver(Fem::FemAnalysis *pcObject,QWidget *parent)
|
||||
TaskDriver::TaskDriver(Fem::FemAnalysis* pcObject, QWidget* parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("FEM_CreateNodesSet"),
|
||||
tr("Nodes set"),
|
||||
true,
|
||||
parent),
|
||||
tr("Nodes set"),
|
||||
true,
|
||||
parent),
|
||||
pcObject(pcObject)
|
||||
{
|
||||
// we need a separate container widget to add all controls to
|
||||
@@ -69,8 +65,6 @@ TaskDriver::TaskDriver(Fem::FemAnalysis *pcObject,QWidget *parent)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TaskDriver::SwitchMethod(int /*Value*/)
|
||||
{
|
||||
//if(Value == 1){
|
||||
@@ -84,14 +78,9 @@ void TaskDriver::SwitchMethod(int /*Value*/)
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TaskDriver::~TaskDriver()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
#include "moc_TaskDriver.cpp"
|
||||
|
||||
Reference in New Issue
Block a user