[FEM] Add rigid body constraint
This commit is contained in:
committed by
Chris Hennes
parent
acecc2c435
commit
cefbb17c17
@@ -387,6 +387,48 @@ bool CmdFemConstraintFixed::isActive()
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================
|
||||
DEF_STD_CMD_A(CmdFemConstraintRigidBody)
|
||||
|
||||
CmdFemConstraintRigidBody::CmdFemConstraintRigidBody()
|
||||
: Command("FEM_ConstraintRigidBody")
|
||||
{
|
||||
sAppModule = "Fem";
|
||||
sGroup = QT_TR_NOOP("Fem");
|
||||
sMenuText = QT_TR_NOOP("Constraint rigid body");
|
||||
sToolTipText = QT_TR_NOOP("Creates a FEM constraint for a rigid body");
|
||||
sWhatsThis = "FEM_ConstraintRigidBody";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "FEM_ConstraintRigidBody";
|
||||
}
|
||||
|
||||
void CmdFemConstraintRigidBody::activated(int)
|
||||
{
|
||||
Fem::FemAnalysis* Analysis;
|
||||
|
||||
if (getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("ConstraintRigidBody");
|
||||
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Make FEM constraint fixed geometry"));
|
||||
doCommand(Doc, "App.activeDocument().addObject(\"Fem::ConstraintRigidBody\",\"%s\")", FeatName.c_str());
|
||||
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 CmdFemConstraintRigidBody::isActive()
|
||||
{
|
||||
return FemGui::ActiveAnalysisObserver::instance()->hasActiveObject();
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================
|
||||
DEF_STD_CMD_A(CmdFemConstraintFluidBoundary)
|
||||
|
||||
@@ -2625,6 +2667,7 @@ void CreateFemCommands()
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintContact());
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintDisplacement());
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintFixed());
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintRigidBody());
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintFluidBoundary());
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintForce());
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintGear());
|
||||
|
||||
Reference in New Issue
Block a user