Remove unused code into GUI
This commit is contained in:
@@ -559,24 +559,12 @@ StdCmdToggleClipPlane::StdCmdToggleClipPlane()
|
||||
Action * StdCmdToggleClipPlane::createAction(void)
|
||||
{
|
||||
Action *pcAction = (Action*)Command::createAction();
|
||||
#if 0
|
||||
pcAction->setCheckable(true);
|
||||
#endif
|
||||
return pcAction;
|
||||
}
|
||||
|
||||
void StdCmdToggleClipPlane::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
#if 0
|
||||
View3DInventor* view = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
|
||||
if (view) {
|
||||
if (iMsg > 0 && !view->hasClippingPlane())
|
||||
view->toggleClippingPlane();
|
||||
else if (iMsg == 0 && view->hasClippingPlane())
|
||||
view->toggleClippingPlane();
|
||||
}
|
||||
#else
|
||||
static QPointer<Gui::Dialog::Clipping> clipping = nullptr;
|
||||
if (!clipping) {
|
||||
View3DInventor* view = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
|
||||
@@ -584,29 +572,12 @@ void StdCmdToggleClipPlane::activated(int iMsg)
|
||||
clipping = Gui::Dialog::Clipping::makeDockWidget(view);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool StdCmdToggleClipPlane::isActive(void)
|
||||
{
|
||||
#if 0
|
||||
View3DInventor* view = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
|
||||
if (view) {
|
||||
Action* action = qobject_cast<Action*>(_pcAction);
|
||||
if (action->isChecked() != view->hasClippingPlane())
|
||||
action->setChecked(view->hasClippingPlane());
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
Action* action = qobject_cast<Action*>(_pcAction);
|
||||
if (action->isChecked())
|
||||
action->setChecked(false);
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
View3DInventor* view = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
|
||||
return view ? true : false;
|
||||
#endif
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -691,7 +662,6 @@ Gui::Action * StdCmdDrawStyle::createAction(void)
|
||||
a6->setShortcut(QKeySequence(QString::fromUtf8("V,7")));
|
||||
a6->setWhatsThis(QString::fromLatin1(getWhatsThis()));
|
||||
|
||||
|
||||
pcAction->setIcon(a0->icon());
|
||||
|
||||
_pcAction = pcAction;
|
||||
@@ -1151,26 +1121,13 @@ StdCmdSetAppearance::StdCmdSetAppearance()
|
||||
void StdCmdSetAppearance::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
#if 0
|
||||
static QPointer<QDialog> dlg = 0;
|
||||
if (!dlg)
|
||||
dlg = new Gui::Dialog::DlgDisplayPropertiesImp(true, getMainWindow());
|
||||
dlg->setModal(false);
|
||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||
dlg->show();
|
||||
#else
|
||||
Gui::Control().showDialog(new Gui::Dialog::TaskDisplayProperties());
|
||||
#endif
|
||||
}
|
||||
|
||||
bool StdCmdSetAppearance::isActive(void)
|
||||
{
|
||||
#if 0
|
||||
return Gui::Selection().size() != 0;
|
||||
#else
|
||||
return (Gui::Control().activeDialog() == nullptr) &&
|
||||
(Gui::Selection().size() != 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -1517,13 +1474,11 @@ StdCmdViewFitSelection::StdCmdViewFitSelection()
|
||||
void StdCmdViewFitSelection::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
//doCommand(Command::Gui,"Gui.activeDocument().activeView().fitAll()");
|
||||
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"ViewSelection\")");
|
||||
}
|
||||
|
||||
bool StdCmdViewFitSelection::isActive(void)
|
||||
{
|
||||
//return isViewOfType(Gui::View3DInventor::getClassTypeId());
|
||||
return getGuiApplication()->sendHasMsgToActiveView("ViewSelection");
|
||||
}
|
||||
|
||||
@@ -1733,7 +1688,6 @@ void StdViewDockUndockFullscreen::activated(int iMsg)
|
||||
else
|
||||
clone->setCurrentViewMode(MDIView::FullScreen);
|
||||
}
|
||||
|
||||
// destroy the old view
|
||||
view->deleteSelf();
|
||||
}
|
||||
@@ -1779,8 +1733,7 @@ StdCmdViewVR::StdCmdViewVR()
|
||||
|
||||
void StdCmdViewVR::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
//doCommand(Command::Gui,"Gui.activeDocument().activeView().fitAll()");
|
||||
Q_UNUSED(iMsg);
|
||||
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"ViewVR\")");
|
||||
}
|
||||
|
||||
@@ -2040,95 +1993,7 @@ bool StdCmdToggleNavigation::isActive(void)
|
||||
|
||||
|
||||
|
||||
#if 0 // old Axis command
|
||||
// Command to show/hide axis cross
|
||||
class StdCmdAxisCross : public Gui::Command
|
||||
{
|
||||
private:
|
||||
SoShapeScale* axisCross;
|
||||
SoGroup* axisGroup;
|
||||
public:
|
||||
StdCmdAxisCross() : Command("Std_AxisCross"), axisCross(0), axisGroup(0)
|
||||
{
|
||||
sGroup = "Standard-View";
|
||||
sMenuText = QT_TR_NOOP("Toggle axis cross");
|
||||
sToolTipText = QT_TR_NOOP("Toggle axis cross");
|
||||
sStatusTip = QT_TR_NOOP("Toggle axis cross");
|
||||
sWhatsThis = "Std_AxisCross";
|
||||
sPixmap = "Std_AxisCross";
|
||||
}
|
||||
~StdCmdAxisCross()
|
||||
{
|
||||
if (axisGroup)
|
||||
axisGroup->unref();
|
||||
if (axisCross)
|
||||
axisCross->unref();
|
||||
}
|
||||
const char* className() const
|
||||
{ return "StdCmdAxisCross"; }
|
||||
|
||||
Action * createAction(void)
|
||||
{
|
||||
axisCross = new Gui::SoShapeScale;
|
||||
axisCross->ref();
|
||||
Gui::SoAxisCrossKit* axisKit = new Gui::SoAxisCrossKit();
|
||||
axisKit->set("xAxis.appearance.drawStyle", "lineWidth 2");
|
||||
axisKit->set("yAxis.appearance.drawStyle", "lineWidth 2");
|
||||
axisKit->set("zAxis.appearance.drawStyle", "lineWidth 2");
|
||||
axisCross->setPart("shape", axisKit);
|
||||
axisGroup = new SoSkipBoundingGroup;
|
||||
axisGroup->ref();
|
||||
axisGroup->addChild(axisCross);
|
||||
|
||||
Action *pcAction = Gui::Command::createAction();
|
||||
pcAction->setCheckable(true);
|
||||
return pcAction;
|
||||
}
|
||||
|
||||
protected:
|
||||
void activated(int iMsg)
|
||||
{
|
||||
float scale = 1.0f;
|
||||
|
||||
Gui::View3DInventor* view = qobject_cast<Gui::View3DInventor*>
|
||||
(getMainWindow()->activeWindow());
|
||||
if (view) {
|
||||
SoNode* scene = view->getViewer()->getSceneGraph();
|
||||
SoSeparator* sep = static_cast<SoSeparator*>(scene);
|
||||
bool hasaxis = (sep->findChild(axisGroup) != -1);
|
||||
if (iMsg > 0 && !hasaxis) {
|
||||
axisCross->scaleFactor = scale;
|
||||
sep->addChild(axisGroup);
|
||||
}
|
||||
else if (iMsg == 0 && hasaxis) {
|
||||
sep->removeChild(axisGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool isActive(void)
|
||||
{
|
||||
Gui::View3DInventor* view = qobject_cast<View3DInventor*>(Gui::getMainWindow()->activeWindow());
|
||||
if (view) {
|
||||
Gui::View3DInventorViewer* viewer = view->getViewer();
|
||||
if (!viewer)
|
||||
return false; // no active viewer
|
||||
SoGroup* group = dynamic_cast<SoGroup*>(viewer->getSceneGraph());
|
||||
if (!group)
|
||||
return false; // empty scene graph
|
||||
bool hasaxis = group->findChild(axisGroup) != -1;
|
||||
if (_pcAction->isChecked() != hasaxis)
|
||||
_pcAction->setChecked(hasaxis);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
if (_pcAction->isChecked())
|
||||
_pcAction->setChecked(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
#else
|
||||
//===========================================================================
|
||||
// Std_ViewExample1
|
||||
//===========================================================================
|
||||
@@ -2175,8 +2040,6 @@ bool StdCmdAxisCross::isActive(void)
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//===========================================================================
|
||||
// Std_ViewExample1
|
||||
//===========================================================================
|
||||
@@ -3831,7 +3694,6 @@ void CreateViewStdCommands(void)
|
||||
rcCmdMgr.addCommand(new StdCmdSelForward());
|
||||
rcCmdMgr.addCommand(new StdCmdTreeViewActions());
|
||||
|
||||
|
||||
auto hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
|
||||
if(hGrp->GetASCII("GestureRollFwdCommand").empty())
|
||||
hGrp->SetASCII("GestureRollFwdCommand","Std_SelForward");
|
||||
|
||||
Reference in New Issue
Block a user