1 // Copyright (C) 2006-2012 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "FormSchemaView.hxx"
21 #include "GraphicsView.hxx"
24 #include "YacsTrace.hxx"
27 using namespace YACS::HMI;
29 FormSchemaView::FormSchemaView(QWidget *parent)
33 vboxLayout->removeWidget(gv_schema);
35 gv_schema = new GraphicsView(this);
36 gv_schema->setObjectName(QString::fromUtf8("gv_schema"));
37 vboxLayout->insertWidget(0, gv_schema);
40 dial->setWrapping(true);
41 dial->setRange(0, 359);
45 hs_position->setRange(0, 999);
46 hs_position->setValue(500);
49 vs_position->setRange(0, 999);
50 vs_position->setValue(500);
53 vs_zoom->setRange(-100, 100);
58 FormSchemaView::~FormSchemaView()
62 void FormSchemaView::on_dial_valueChanged(int val)
64 DEBTRACE("FormSchemaView::on_dial_valueChanged " << val);
65 int delta = val - _prevRotate;
67 gv_schema->rotate(delta);
70 void FormSchemaView::on_hs_position_valueChanged(int val)
72 DEBTRACE("FormSchemaView::on_hs_poistion_valueChanged " << val);
73 int delta = val - _prevHsPos;
75 gv_schema->translate(val,0);
78 void FormSchemaView::on_vs_position_valueChanged(int val)
80 DEBTRACE("FormSchemaView::on_vs_poistion_valueChanged " << val);
81 int delta = val - _prevVsPos;
83 gv_schema->translate(0, val);
86 void FormSchemaView::on_vs_zoom_valueChanged(int val)
88 DEBTRACE("FormSchemaView::on_vs_zoom_valueChanged " << val);
89 int delta = val - _prevZoom;
91 if (delta>=0) s=delta/25.0;
94 gv_schema->scale(s, s);