FEM: code formating: trailing white spaces
This commit is contained in:
parent
ae9bc220d5
commit
684aca461e
|
@ -94,8 +94,8 @@ set(FemGui_UIC_SRCS
|
||||||
TaskAnalysisInfo.ui
|
TaskAnalysisInfo.ui
|
||||||
TaskDriver.ui
|
TaskDriver.ui
|
||||||
)
|
)
|
||||||
if(BUILD_FEM_VTK)
|
if(BUILD_FEM_VTK)
|
||||||
set(FemGui_UIC_SRCS
|
set(FemGui_UIC_SRCS
|
||||||
${FemGui_UIC_SRCS}
|
${FemGui_UIC_SRCS}
|
||||||
TaskPostDisplay.ui
|
TaskPostDisplay.ui
|
||||||
TaskPostClip.ui
|
TaskPostClip.ui
|
||||||
|
@ -105,7 +105,7 @@ if(BUILD_FEM_VTK)
|
||||||
PlaneWidget.ui
|
PlaneWidget.ui
|
||||||
SphereWidget.ui
|
SphereWidget.ui
|
||||||
)
|
)
|
||||||
endif(BUILD_FEM_VTK)
|
endif(BUILD_FEM_VTK)
|
||||||
qt4_wrap_ui(FemGui_UIC_HDRS ${FemGui_UIC_SRCS})
|
qt4_wrap_ui(FemGui_UIC_HDRS ${FemGui_UIC_SRCS})
|
||||||
|
|
||||||
SET(FemGui_DLG_SRCS
|
SET(FemGui_DLG_SRCS
|
||||||
|
|
|
@ -769,7 +769,7 @@ bool CmdFemCreateNodesSet::isActive(void)
|
||||||
#ifdef FC_USE_VTK
|
#ifdef FC_USE_VTK
|
||||||
|
|
||||||
void setupFilter(Gui::Command* cmd, std::string Name) {
|
void setupFilter(Gui::Command* cmd, std::string Name) {
|
||||||
|
|
||||||
std::vector<Fem::FemPostPipeline*> pipelines = App::GetApplication().getActiveDocument()->getObjectsOfType<Fem::FemPostPipeline>();
|
std::vector<Fem::FemPostPipeline*> pipelines = App::GetApplication().getActiveDocument()->getObjectsOfType<Fem::FemPostPipeline>();
|
||||||
if (!pipelines.empty()) {
|
if (!pipelines.empty()) {
|
||||||
Fem::FemPostPipeline *pipeline = pipelines.front();
|
Fem::FemPostPipeline *pipeline = pipelines.front();
|
||||||
|
@ -782,7 +782,7 @@ void setupFilter(Gui::Command* cmd, std::string Name) {
|
||||||
cmd->doCommand(Gui::Command::Doc,"__list__.append(App.ActiveDocument.%s)", FeatName.c_str());
|
cmd->doCommand(Gui::Command::Doc,"__list__.append(App.ActiveDocument.%s)", FeatName.c_str());
|
||||||
cmd->doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Filter = __list__", pipeline->getNameInDocument());
|
cmd->doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Filter = __list__", pipeline->getNameInDocument());
|
||||||
cmd->doCommand(Gui::Command::Doc,"del __list__");
|
cmd->doCommand(Gui::Command::Doc,"del __list__");
|
||||||
|
|
||||||
cmd->updateActive();
|
cmd->updateActive();
|
||||||
cmd->doCommand(Gui::Command::Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str());
|
cmd->doCommand(Gui::Command::Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str());
|
||||||
|
|
||||||
|
@ -792,7 +792,7 @@ void setupFilter(Gui::Command* cmd, std::string Name) {
|
||||||
qApp->translate("CmdFemPostCreateClipFilter", "Wrong selection"),
|
qApp->translate("CmdFemPostCreateClipFilter", "Wrong selection"),
|
||||||
qApp->translate("CmdFemPostCreateClipFilter", "Select a pipeline, please."));
|
qApp->translate("CmdFemPostCreateClipFilter", "Select a pipeline, please."));
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DEF_STD_CMD_A(CmdFemPostCreateClipFilter);
|
DEF_STD_CMD_A(CmdFemPostCreateClipFilter);
|
||||||
|
@ -912,7 +912,7 @@ CmdFemPostFunctions::CmdFemPostFunctions()
|
||||||
|
|
||||||
void CmdFemPostFunctions::activated(int iMsg)
|
void CmdFemPostFunctions::activated(int iMsg)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
if (iMsg==0)
|
if (iMsg==0)
|
||||||
name = "Plane";
|
name = "Plane";
|
||||||
|
@ -927,7 +927,7 @@ void CmdFemPostFunctions::activated(int iMsg)
|
||||||
Fem::FemPostPipeline *pipeline = pipelines.front();
|
Fem::FemPostPipeline *pipeline = pipelines.front();
|
||||||
|
|
||||||
openCommand("Create function");
|
openCommand("Create function");
|
||||||
|
|
||||||
//check if the pipeline has a filter provider and add one if needed
|
//check if the pipeline has a filter provider and add one if needed
|
||||||
Fem::FemPostFunctionProvider* provider;
|
Fem::FemPostFunctionProvider* provider;
|
||||||
if(!pipeline->Functions.getValue() || pipeline->Functions.getValue()->getTypeId() != Fem::FemPostFunctionProvider::getClassTypeId()) {
|
if(!pipeline->Functions.getValue() || pipeline->Functions.getValue()->getTypeId() != Fem::FemPostFunctionProvider::getClassTypeId()) {
|
||||||
|
@ -938,7 +938,7 @@ void CmdFemPostFunctions::activated(int iMsg)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
provider = static_cast<Fem::FemPostFunctionProvider*>(pipeline->Functions.getValue());
|
provider = static_cast<Fem::FemPostFunctionProvider*>(pipeline->Functions.getValue());
|
||||||
|
|
||||||
//build the object
|
//build the object
|
||||||
std::string FeatName = getUniqueObjectName(name.c_str());
|
std::string FeatName = getUniqueObjectName(name.c_str());
|
||||||
doCommand(Doc,"App.activeDocument().addObject('Fem::FemPost%sFunction','%s')", name.c_str(), FeatName.c_str());
|
doCommand(Doc,"App.activeDocument().addObject('Fem::FemPost%sFunction','%s')", name.c_str(), FeatName.c_str());
|
||||||
|
@ -946,14 +946,14 @@ void CmdFemPostFunctions::activated(int iMsg)
|
||||||
doCommand(Doc,"__list__.append(App.ActiveDocument.%s)", FeatName.c_str());
|
doCommand(Doc,"__list__.append(App.ActiveDocument.%s)", FeatName.c_str());
|
||||||
doCommand(Doc,"App.ActiveDocument.%s.Functions = __list__", provider->getNameInDocument());
|
doCommand(Doc,"App.ActiveDocument.%s.Functions = __list__", provider->getNameInDocument());
|
||||||
doCommand(Doc,"del __list__");
|
doCommand(Doc,"del __list__");
|
||||||
|
|
||||||
//set the default values, for this get the bounding box
|
//set the default values, for this get the bounding box
|
||||||
vtkBoundingBox box = pipeline->getBoundingBox();
|
vtkBoundingBox box = pipeline->getBoundingBox();
|
||||||
|
|
||||||
double center[3];
|
double center[3];
|
||||||
box.GetCenter(center);
|
box.GetCenter(center);
|
||||||
|
|
||||||
if (iMsg==0)
|
if (iMsg==0)
|
||||||
doCommand(Doc,"App.ActiveDocument.%s.Origin = App.Vector(%f, %f, %f)", FeatName.c_str(), center[0],
|
doCommand(Doc,"App.ActiveDocument.%s.Origin = App.Vector(%f, %f, %f)", FeatName.c_str(), center[0],
|
||||||
center[1], center[2]);
|
center[1], center[2]);
|
||||||
else if (iMsg==1) {
|
else if (iMsg==1) {
|
||||||
|
@ -961,8 +961,8 @@ void CmdFemPostFunctions::activated(int iMsg)
|
||||||
center[1] + box.GetLength(1)/2, center[2] + box.GetLength(2)/2);
|
center[1] + box.GetLength(1)/2, center[2] + box.GetLength(2)/2);
|
||||||
doCommand(Doc,"App.ActiveDocument.%s.Radius = %f", FeatName.c_str(), box.GetDiagonalLength()/2);
|
doCommand(Doc,"App.ActiveDocument.%s.Radius = %f", FeatName.c_str(), box.GetDiagonalLength()/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this->updateActive();
|
this->updateActive();
|
||||||
//most of the times functions are added inside of a filter, make sure this still works
|
//most of the times functions are added inside of a filter, make sure this still works
|
||||||
if(Gui::Application::Instance->activeDocument()->getInEdit() == NULL)
|
if(Gui::Application::Instance->activeDocument()->getInEdit() == NULL)
|
||||||
|
@ -973,7 +973,7 @@ void CmdFemPostFunctions::activated(int iMsg)
|
||||||
qApp->translate("CmdFemPostCreateClipFilter", "Wrong selection"),
|
qApp->translate("CmdFemPostCreateClipFilter", "Wrong selection"),
|
||||||
qApp->translate("CmdFemPostCreateClipFilter", "Select a pipeline, please."));
|
qApp->translate("CmdFemPostCreateClipFilter", "Select a pipeline, please."));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since the default icon is reset when enabing/disabling the command we have
|
// Since the default icon is reset when enabing/disabling the command we have
|
||||||
// to explicitly set the icon of the used command.
|
// to explicitly set the icon of the used command.
|
||||||
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(_pcAction);
|
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(_pcAction);
|
||||||
|
@ -991,10 +991,10 @@ Gui::Action * CmdFemPostFunctions::createAction(void)
|
||||||
|
|
||||||
QAction* cmd0 = pcAction->addAction(QString());
|
QAction* cmd0 = pcAction->addAction(QString());
|
||||||
cmd0->setIcon(Gui::BitmapFactory().pixmap("fem-plane"));
|
cmd0->setIcon(Gui::BitmapFactory().pixmap("fem-plane"));
|
||||||
|
|
||||||
QAction* cmd1 = pcAction->addAction(QString());
|
QAction* cmd1 = pcAction->addAction(QString());
|
||||||
cmd1->setIcon(Gui::BitmapFactory().pixmap("fem-sphere"));
|
cmd1->setIcon(Gui::BitmapFactory().pixmap("fem-sphere"));
|
||||||
|
|
||||||
_pcAction = pcAction;
|
_pcAction = pcAction;
|
||||||
languageChange();
|
languageChange();
|
||||||
|
|
||||||
|
@ -1018,12 +1018,12 @@ void CmdFemPostFunctions::languageChange()
|
||||||
cmd->setText(QApplication::translate("CmdFemPostFunctions","Plane"));
|
cmd->setText(QApplication::translate("CmdFemPostFunctions","Plane"));
|
||||||
cmd->setToolTip(QApplication::translate("Fem_PostCreateFunctions","Create a plane function, defined by its orgin and normal"));
|
cmd->setToolTip(QApplication::translate("Fem_PostCreateFunctions","Create a plane function, defined by its orgin and normal"));
|
||||||
cmd->setStatusTip(cmd->toolTip());
|
cmd->setStatusTip(cmd->toolTip());
|
||||||
|
|
||||||
cmd = a[1];
|
cmd = a[1];
|
||||||
cmd->setText(QApplication::translate("CmdFemPostFunctions","Sphere"));
|
cmd->setText(QApplication::translate("CmdFemPostFunctions","Sphere"));
|
||||||
cmd->setToolTip(QApplication::translate("Fem_PostCreateFunctions","Create a phere function, defined by its center and radius"));
|
cmd->setToolTip(QApplication::translate("Fem_PostCreateFunctions","Create a phere function, defined by its center and radius"));
|
||||||
cmd->setStatusTip(cmd->toolTip());
|
cmd->setStatusTip(cmd->toolTip());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CmdFemPostFunctions::isActive(void)
|
bool CmdFemPostFunctions::isActive(void)
|
||||||
|
@ -1053,7 +1053,7 @@ CmdFemPostApllyChanges::CmdFemPostApllyChanges()
|
||||||
void CmdFemPostApllyChanges::activated(int iMsg)
|
void CmdFemPostApllyChanges::activated(int iMsg)
|
||||||
{
|
{
|
||||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Fem");
|
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Fem");
|
||||||
|
|
||||||
if (iMsg == 1)
|
if (iMsg == 1)
|
||||||
hGrp->SetBool("PostAutoRecompute", true);
|
hGrp->SetBool("PostAutoRecompute", true);
|
||||||
else
|
else
|
||||||
|
@ -1074,7 +1074,7 @@ Gui::Action * CmdFemPostApllyChanges::createAction(void)
|
||||||
pcAction->setCheckable(true);
|
pcAction->setCheckable(true);
|
||||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Fem");
|
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Fem");
|
||||||
pcAction->setChecked(hGrp->GetBool("PostAutoRecompute", false));
|
pcAction->setChecked(hGrp->GetBool("PostAutoRecompute", false));
|
||||||
|
|
||||||
return pcAction;
|
return pcAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1096,9 +1096,9 @@ CmdFemPostPipelineFromResult::CmdFemPostPipelineFromResult()
|
||||||
void CmdFemPostPipelineFromResult::activated(int iMsg)
|
void CmdFemPostPipelineFromResult::activated(int iMsg)
|
||||||
{
|
{
|
||||||
Gui::SelectionFilter ResultFilter("SELECT Fem::FemResultObject COUNT 1");
|
Gui::SelectionFilter ResultFilter("SELECT Fem::FemResultObject COUNT 1");
|
||||||
|
|
||||||
if (ResultFilter.match()) {
|
if (ResultFilter.match()) {
|
||||||
|
|
||||||
Fem::FemResultObject* result = static_cast<Fem::FemResultObject*>(ResultFilter.Result[0][0].getObject());
|
Fem::FemResultObject* result = static_cast<Fem::FemResultObject*>(ResultFilter.Result[0][0].getObject());
|
||||||
std::string FeatName = getUniqueObjectName("Pipeline");
|
std::string FeatName = getUniqueObjectName("Pipeline");
|
||||||
|
|
||||||
|
@ -1107,9 +1107,9 @@ void CmdFemPostPipelineFromResult::activated(int iMsg)
|
||||||
|
|
||||||
//TODO: use python function call for this
|
//TODO: use python function call for this
|
||||||
static_cast<Fem::FemPostPipeline*>(getDocument()->getObject(FeatName.c_str()))->load(result);
|
static_cast<Fem::FemPostPipeline*>(getDocument()->getObject(FeatName.c_str()))->load(result);
|
||||||
|
|
||||||
this->updateActive();
|
this->updateActive();
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QMessageBox::warning(Gui::getMainWindow(),
|
QMessageBox::warning(Gui::getMainWindow(),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user