FEM: constraint contact: object implementation
This commit is contained in:
@@ -354,6 +354,51 @@ bool CmdFemConstraintFixed::isActive(void)
|
||||
|
||||
//=====================================================================================
|
||||
|
||||
DEF_STD_CMD_A(CmdFemConstraintContact);
|
||||
|
||||
CmdFemConstraintContact::CmdFemConstraintContact()
|
||||
: Command("Fem_ConstraintContact")
|
||||
{
|
||||
sAppModule = "Fem";
|
||||
sGroup = QT_TR_NOOP("Fem");
|
||||
sMenuText = QT_TR_NOOP("Constraint contact ");
|
||||
sToolTipText = QT_TR_NOOP("Creates a FEM constraint for contact between faces");
|
||||
sWhatsThis = "Fem_ConstraintContact";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "fem-constraint-contact";
|
||||
}
|
||||
|
||||
void CmdFemConstraintContact::activated(int iMsg)
|
||||
{
|
||||
Fem::FemAnalysis *Analysis;
|
||||
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintContact");
|
||||
|
||||
openCommand("Make FEM constraint contact on face");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintContact\",\"%s\")",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.Slope = 1000000.00",FeatName.c_str()); //OvG: set default not equal to 0
|
||||
doCommand(Doc,"App.activeDocument().%s.Friction = 0.0",FeatName.c_str()); //OvG: set default not equal to 0
|
||||
doCommand(Doc,"App.activeDocument().%s.Scale = 1",FeatName.c_str()); //OvG: set initial scale to 1
|
||||
doCommand(Doc,"App.activeDocument().%s.Member = App.activeDocument().%s.Member + [App.activeDocument().%s]",
|
||||
Analysis->getNameInDocument(),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 CmdFemConstraintContact::isActive(void)
|
||||
{
|
||||
return FemGui::ActiveAnalysisObserver::instance()->hasActiveObject();
|
||||
}
|
||||
|
||||
//=====================================================================================
|
||||
|
||||
DEF_STD_CMD_A(CmdFemConstraintForce);
|
||||
|
||||
CmdFemConstraintForce::CmdFemConstraintForce()
|
||||
@@ -1143,7 +1188,8 @@ void CreateFemCommands(void)
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintGear());
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintPulley());
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintDisplacement());
|
||||
|
||||
rcCmdMgr.addCommand(new CmdFemConstraintContact());
|
||||
|
||||
#ifdef FC_USE_VTK
|
||||
rcCmdMgr.addCommand(new CmdFemPostCreateClipFilter);
|
||||
rcCmdMgr.addCommand(new CmdFemPostCreateScalarClipFilter);
|
||||
|
||||
Reference in New Issue
Block a user