FEM: cpp commands sort constraints, pressure
This commit is contained in:
@@ -713,6 +713,51 @@ bool CmdFemConstraintPlaneRotation::isActive(void)
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================
|
||||
DEF_STD_CMD_A(CmdFemConstraintPressure);
|
||||
|
||||
CmdFemConstraintPressure::CmdFemConstraintPressure()
|
||||
: Command("FEM_ConstraintPressure")
|
||||
{
|
||||
sAppModule = "Fem";
|
||||
sGroup = QT_TR_NOOP("Fem");
|
||||
sMenuText = QT_TR_NOOP("Constraint pressure");
|
||||
sToolTipText = QT_TR_NOOP("Creates a FEM constraint for a pressure acting on a face");
|
||||
sWhatsThis = "FEM_ConstraintPressure";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "fem-constraint-pressure";
|
||||
}
|
||||
|
||||
void CmdFemConstraintPressure::activated(int)
|
||||
{
|
||||
Fem::FemAnalysis *Analysis;
|
||||
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintPressure");
|
||||
|
||||
openCommand("Make FEM constraint pressure on face");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintPressure\",\"%s\")",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.Pressure = 1000.0",FeatName.c_str()); //OvG: set default not equal to 0
|
||||
doCommand(Doc,"App.activeDocument().%s.Reversed = False",FeatName.c_str()); //OvG: set default to False
|
||||
doCommand(Doc,"App.activeDocument().%s.Scale = 1",FeatName.c_str()); //OvG: set initial scale to 1
|
||||
doCommand(Doc,"App.activeDocument().%s.addObject(App.activeDocument().%s)",
|
||||
Analysis->getNameInDocument(),FeatName.c_str());
|
||||
|
||||
doCommand(Doc,"%s",gethideMeshShowPartStr(FeatName).c_str()); //OvG: Hide meshes and show parts
|
||||
|
||||
updateActive();
|
||||
|
||||
doCommand(Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str());
|
||||
}
|
||||
|
||||
bool CmdFemConstraintPressure::isActive(void)
|
||||
{
|
||||
return FemGui::ActiveAnalysisObserver::instance()->hasActiveObject();
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================
|
||||
DEF_STD_CMD_A(CmdFemConstraintTransform);
|
||||
|
||||
@@ -759,51 +804,6 @@ bool CmdFemConstraintTransform::isActive(void)
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================
|
||||
DEF_STD_CMD_A(CmdFemConstraintPressure);
|
||||
|
||||
CmdFemConstraintPressure::CmdFemConstraintPressure()
|
||||
: Command("FEM_ConstraintPressure")
|
||||
{
|
||||
sAppModule = "Fem";
|
||||
sGroup = QT_TR_NOOP("Fem");
|
||||
sMenuText = QT_TR_NOOP("Constraint pressure");
|
||||
sToolTipText = QT_TR_NOOP("Creates a FEM constraint for a pressure acting on a face");
|
||||
sWhatsThis = "FEM_ConstraintPressure";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "fem-constraint-pressure";
|
||||
}
|
||||
|
||||
void CmdFemConstraintPressure::activated(int)
|
||||
{
|
||||
Fem::FemAnalysis *Analysis;
|
||||
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintPressure");
|
||||
|
||||
openCommand("Make FEM constraint pressure on face");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintPressure\",\"%s\")",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.Pressure = 1000.0",FeatName.c_str()); //OvG: set default not equal to 0
|
||||
doCommand(Doc,"App.activeDocument().%s.Reversed = False",FeatName.c_str()); //OvG: set default to False
|
||||
doCommand(Doc,"App.activeDocument().%s.Scale = 1",FeatName.c_str()); //OvG: set initial scale to 1
|
||||
doCommand(Doc,"App.activeDocument().%s.addObject(App.activeDocument().%s)",
|
||||
Analysis->getNameInDocument(),FeatName.c_str());
|
||||
|
||||
doCommand(Doc,"%s",gethideMeshShowPartStr(FeatName).c_str()); //OvG: Hide meshes and show parts
|
||||
|
||||
updateActive();
|
||||
|
||||
doCommand(Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str());
|
||||
}
|
||||
|
||||
bool CmdFemConstraintPressure::isActive(void)
|
||||
{
|
||||
return FemGui::ActiveAnalysisObserver::instance()->hasActiveObject();
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================
|
||||
DEF_STD_CMD_A(CmdFemConstraintPulley);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user