--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_LocalCSDlg.h>
+#include <QtxDoubleSpinBox.h>
+#include <QLayout>
+#include <QLabel>
+
+const double RANGE = 1E+10;
+const double STEP = 1.00;
+const double PREC = 2;
+
+HYDROGUI_LocalCSDlg::HYDROGUI_LocalCSDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle )
+{
+ QFrame* aFrame = new QFrame( mainFrame() );
+ addWidget( aFrame, 1 );
+
+ QGridLayout* aLayout = new QGridLayout( aFrame );
+
+ myLX = new QtxDoubleSpinBox( 0, RANGE, STEP, PREC, PREC, aFrame );
+ myLX->setValue( 0.0 );
+ myLY = new QtxDoubleSpinBox( 0, RANGE, STEP, PREC, PREC, aFrame );
+ myLY->setValue( 0.0 );
+
+ aLayout->addWidget( new QLabel( tr( "LX" ), aFrame ), 0, 0 );
+ aLayout->addWidget( myLX, 0, 1 );
+ aLayout->addWidget( new QLabel( tr( "LY" ), aFrame ), 1, 0 );
+ aLayout->addWidget( myLY, 1, 1 );
+ aLayout->setColumnStretch( 0, 0 );
+ aLayout->setColumnStretch( 1, 1 );
+ aLayout->setRowStretch( 2, 1 );
+}
+
+HYDROGUI_LocalCSDlg::~HYDROGUI_LocalCSDlg()
+{
+}
+
+double HYDROGUI_LocalCSDlg::GetLocalX() const
+{
+ return myLX->value();
+}
+
+double HYDROGUI_LocalCSDlg::GetLocalY() const
+{
+ return myLY->value();
+}
+
+void HYDROGUI_LocalCSDlg::SetLocalCS( double theLX, double theLY )
+{
+ myLX->setValue( theLX );
+ myLY->setValue( theLY );
+}
+
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_LocalCSDlg_H
+#define HYDROGUI_LocalCSDlg_H
+
+#include "HYDROGUI_InputPanel.h"
+
+class QtxDoubleSpinBox;
+
+class HYDROGUI_LocalCSDlg : public HYDROGUI_InputPanel
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_LocalCSDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+ virtual ~HYDROGUI_LocalCSDlg();
+
+ double GetLocalX() const;
+ double GetLocalY() const;
+ void SetLocalCS( double theLX, double theLY );
+
+private:
+ QtxDoubleSpinBox* myLX;
+ QtxDoubleSpinBox* myLY;
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_LocalCSOp.h>
+#include <HYDROGUI_LocalCSDlg.h>
+#include <HYDROData_Document.h>
+#include <HYDROGUI_UpdateFlags.h>
+#include <gp_Pnt2d.hxx>
+
+HYDROGUI_LocalCSOp::HYDROGUI_LocalCSOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+ setName( tr( "EDIT_LOCAL_CS" ) );
+}
+
+HYDROGUI_LocalCSOp::~HYDROGUI_LocalCSOp()
+{
+}
+
+void HYDROGUI_LocalCSOp::startOperation()
+{
+ HYDROGUI_Operation::startOperation();
+
+ HYDROGUI_LocalCSDlg* aPanel = ::qobject_cast<HYDROGUI_LocalCSDlg*>( inputPanel() );
+ if ( !aPanel )
+ return;
+
+ double aLX, aLY;
+ doc()->GetLocalCS( aLX, aLY );
+ aPanel->SetLocalCS( aLX, aLY );
+}
+
+HYDROGUI_InputPanel* HYDROGUI_LocalCSOp::createInputPanel() const
+{
+ return new HYDROGUI_LocalCSDlg( module(), getName() );
+}
+
+bool HYDROGUI_LocalCSOp::processApply( int& theUpdateFlags,
+ QString& theErrorMsg,
+ QStringList& theBrowseObjectsEntries )
+{
+ HYDROGUI_LocalCSDlg* aPanel = ::qobject_cast<HYDROGUI_LocalCSDlg*>( inputPanel() );
+ if ( !aPanel )
+ return false;
+
+ double aLX = aPanel->GetLocalX();
+ double aLY = aPanel->GetLocalY();
+ doc()->SetLocalCS( aLX, aLY );
+
+ theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
+
+ return true;
+}
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_LocalCSOp_H
+#define HYDROGUI_LocalCSOp_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_LocalCSOp : public HYDROGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_LocalCSOp( HYDROGUI_Module* theModule );
+ virtual ~HYDROGUI_LocalCSOp();
+
+protected:
+ virtual void startOperation();
+
+ virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+ virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+ QStringList& theBrowseObjectsEntries );
+};
+
+#endif