本文整理汇总了C++中MenuManager::addCheckItem方法的典型用法代码示例。如果您正苦于以下问题:C++ MenuManager::addCheckItem方法的具体用法?C++ MenuManager::addCheckItem怎么用?C++ MenuManager::addCheckItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuManager
的用法示例。
在下文中一共展示了MenuManager::addCheckItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onContextMenuRequest
void EditableSceneBodyImpl::onContextMenuRequest(const SceneWidgetEvent& event, MenuManager& menuManager)
{
if(!bodyItem->isEditable()){
return;
}
if(self->body()->isStaticModel()){
return;
}
PointedType pointedType = findPointedObject(event.nodePath());
if(bodyItem && pointedType == PT_SCENE_LINK){
menuManager.addItem(_("Set Free"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::makeLinkFree, this, pointedSceneLink));
menuManager.addItem(_("Set Base"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::setBaseLink, this, pointedSceneLink));
menuManager.addItem(_("Set Translation Pin"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::togglePin, this, pointedSceneLink, true, false));
menuManager.addItem(_("Set Rotation Pin"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::togglePin, this, pointedSceneLink, false, true));
menuManager.addItem(_("Set Both Pins"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::togglePin, this, pointedSceneLink, true, true));
menuManager.addSeparator();
menuManager.addItem(_("Level Attitude"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::makeLinkAttitudeLevel, this));
menuManager.addSeparator();
menuManager.setPath(N_("/Markers"));
Action* item = menuManager.addCheckItem(_("Center of Mass"));
item->setChecked(isCmVisible);
item->sigToggled().connect(boost::bind(&EditableSceneBodyImpl::showCenterOfMass, this, _1));
item = menuManager.addCheckItem(_("ZMP"));
item->setChecked(isZmpVisible);
item->sigToggled().connect(boost::bind(&EditableSceneBodyImpl::showZmp, this, _1));
menuManager.setPath("/");
menuManager.addSeparator();
}
}
示例2: onContextMenuRequest
void EditableSceneBodyImpl::onContextMenuRequest(const SceneWidgetEvent& event, MenuManager& menuManager)
{
if(!isEditable()){
return;
}
PointedType pointedType = findPointedObject(event.nodePath());
if(bodyItem && pointedType == PT_SCENE_LINK){
activeSimulatorItem = SimulatorItem::findActiveSimulatorItemFor(bodyItem);
if(activeSimulatorItem){
if(pointedSceneLink->link()->isRoot()){
Action* item1 = menuManager.addCheckItem(_("Move Position"));
item1->setChecked(forcedPositionMode == MOVE_FORCED_POSITION);
item1->sigToggled().connect(
boost::bind(&EditableSceneBodyImpl::setForcedPositionMode, this, MOVE_FORCED_POSITION, _1));
Action* item2 = menuManager.addCheckItem(_("Keep Position"));
item2->setChecked(forcedPositionMode == KEEP_FORCED_POSITION);
item2->sigToggled().connect(
boost::bind(&EditableSceneBodyImpl::setForcedPositionMode, this, KEEP_FORCED_POSITION, _1));
menuManager.addSeparator();
}
} else {
menuManager.addItem(_("Set Free"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::makeLinkFree, this, pointedSceneLink));
menuManager.addItem(_("Set Base"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::setBaseLink, this, pointedSceneLink));
menuManager.addItem(_("Set Translation Pin"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::togglePin, this, pointedSceneLink, true, false));
menuManager.addItem(_("Set Rotation Pin"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::togglePin, this, pointedSceneLink, false, true));
menuManager.addItem(_("Set Both Pins"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::togglePin, this, pointedSceneLink, true, true));
menuManager.addSeparator();
menuManager.addItem(_("Level Attitude"))->sigTriggered().connect(
boost::bind(&EditableSceneBodyImpl::makeLinkAttitudeLevel, this));
menuManager.addSeparator();
}
menuManager.setPath(_("Markers"));
Action* item = menuManager.addCheckItem(_("Center of Mass"));
item->setChecked(isCmVisible);
item->sigToggled().connect(boost::bind(&EditableSceneBodyImpl::showCenterOfMass, this, _1));
item = menuManager.addCheckItem(_("Projection Point of CoM"));
item->setChecked(isPpcomVisible);
item->sigToggled().connect(boost::bind(&EditableSceneBodyImpl::showPpcom, this, _1));
item = menuManager.addCheckItem(_("ZMP"));
item->setChecked(isZmpVisible);
item->sigToggled().connect(boost::bind(&EditableSceneBodyImpl::showZmp, this, _1));
menuManager.setPath("/");
menuManager.addSeparator();
}
}