1 // SALOME SUPERVGraph : build Supervisor viewer into desktop
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SUPERVGraph_ViewFrame.cxx
25 // Author : Nicolas REJNERI
30 #include "SUPERVGraph_ViewFrame.h"
32 #include "utilities.h"
36 #include <qcolordialog.h>
39 SUPERVGraph_View::SUPERVGraph_View( QWidget* theParent ): QWidget( theParent )
44 SUPERVGraph_View::SUPERVGraph_View( SUPERVGraph_View* theParent ): QWidget( theParent )
49 void SUPERVGraph_View::contextMenuPopup( QPopupMenu* )
54 void SUPERVGraph_View::init( QWidget* theParent )
56 if ( theParent->inherits( "QMainWindow" ) ) {
57 ( ( QMainWindow* )theParent )->setCentralWidget( this );
60 QBoxLayout* layout = new QVBoxLayout( theParent );
61 layout->addWidget( this );
69 SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame( SUIT_Desktop* theDesktop )
70 : SUIT_ViewWindow( theDesktop )
74 //myView = new SUPERVGraph_View(this);
75 // Set BackgroundColor
77 int R = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorRed").toInt();
78 int G = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorGreen").toInt();
79 int B = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorBlue").toInt();
80 setBackgroundColor(QColor(R,G,B));*/
83 SUPERVGraph_ViewFrame::~SUPERVGraph_ViewFrame() {}
86 Returns widget containing 3D-Viewer
88 SUPERVGraph_View* SUPERVGraph_ViewFrame::getViewWidget()
94 void SUPERVGraph_ViewFrame::setViewWidget( SUPERVGraph_View* theView )
101 Display/hide Trihedron
103 void SUPERVGraph_ViewFrame::onViewTrihedron()
105 MESSAGE ( "SUPERVGraph_ViewFrame::onViewTrihedron" )
109 Provides top projection of the active view
111 void SUPERVGraph_ViewFrame::onViewTop()
113 MESSAGE ( "SUPERVGraph_ViewFrame::onViewTop" )
117 Provides bottom projection of the active view
119 void SUPERVGraph_ViewFrame::onViewBottom()
121 MESSAGE ( "SUPERVGraph_ViewFrame::onViewBottom" )
125 Provides left projection of the active view
127 void SUPERVGraph_ViewFrame::onViewLeft()
129 MESSAGE ( "SUPERVGraph_ViewFrame::onViewLeft" )
133 Provides right projection of the active view
135 void SUPERVGraph_ViewFrame::onViewRight()
137 MESSAGE ( "SUPERVGraph_ViewFrame::onViewRight" )
141 Provides back projection of the active view
143 void SUPERVGraph_ViewFrame::onViewBack()
145 MESSAGE ( "SUPERVGraph_ViewFrame::onViewBack" )
149 Provides front projection of the active view
151 void SUPERVGraph_ViewFrame::onViewFront()
153 MESSAGE ( "SUPERVGraph_ViewFrame::onViewFront" )
157 Reset the active view
159 void SUPERVGraph_ViewFrame::onViewReset()
161 MESSAGE ( "SUPERVGraph_ViewFrame::onViewReset" )
167 Rotates the active view
169 void SUPERVGraph_ViewFrame::onViewRotate()
171 MESSAGE ( "SUPERVGraph_ViewFrame::onViewRotate" )
175 Sets a new center of the active view
177 void SUPERVGraph_ViewFrame::onViewGlobalPan()
179 MESSAGE ( "SUPERVGraph_ViewFrame::onViewGlobalPan" )
183 Zooms the active view
185 void SUPERVGraph_ViewFrame::onViewZoom()
187 MESSAGE ( "SUPERVGraph_ViewFrame::onViewZoom" )
191 Moves the active view
193 void SUPERVGraph_ViewFrame::onViewPan()
195 MESSAGE ( "SUPERVGraph_ViewFrame::onViewPan" )
197 myView->ActivatePanning();
201 Fits all obejcts within a rectangular area of the active view
203 void SUPERVGraph_ViewFrame::onViewFitArea()
205 MESSAGE ( "SUPERVGraph_ViewFrame::onViewFitArea" )
209 Fits all objects in the active view
211 void SUPERVGraph_ViewFrame::onViewFitAll()
213 MESSAGE ( "SUPERVGraph_ViewFrame::onViewFitAll" )
217 Set background of the viewport
219 void SUPERVGraph_ViewFrame::setBackgroundColor( const QColor& color )
222 myView->setPaletteBackgroundColor(color);
226 Returns background of the viewport
228 QColor SUPERVGraph_ViewFrame::backgroundColor() const
231 return myView->paletteBackgroundColor();
232 return QMainWindow::backgroundColor();
235 void SUPERVGraph_ViewFrame::onAdjustTrihedron()
237 MESSAGE ( "SUPERVGraph_ViewFrame::onAdjustTrihedron" )
240 void SUPERVGraph_ViewFrame::rename( const Handle(SALOME_InteractiveObject)& IObject,
243 MESSAGE ( "SUPERVGraph_ViewFrame::rename" )
246 void SUPERVGraph_ViewFrame::unHighlightAll()
248 MESSAGE ( "SUPERVGraph_ViewFrame::unHighlightAll" )
251 void SUPERVGraph_ViewFrame::highlight( const Handle(SALOME_InteractiveObject)& IObject,
252 bool highlight, bool immediatly )
254 MESSAGE ( "SUPERVGraph_ViewFrame::highlight" )
257 bool SUPERVGraph_ViewFrame::isInViewer( const Handle(SALOME_InteractiveObject)& IObject )
259 MESSAGE ( "SUPERVGraph_ViewFrame::isInViewer" )
263 bool SUPERVGraph_ViewFrame::isVisible( const Handle(SALOME_InteractiveObject)& IObject )
265 MESSAGE ( "SUPERVGraph_ViewFrame::isVisible" )
269 void SUPERVGraph_ViewFrame::undo( const _PTR(Study)& aStudy,
270 const char* StudyFrameEntry )
272 MESSAGE ( "SUPERVGraph_ViewFrame::undo" )
275 void SUPERVGraph_ViewFrame::redo( const _PTR(Study)& aStudy,
276 const char* StudyFrameEntry )
278 MESSAGE ( "SUPERVGraph_ViewFrame::redo" )