~ubuntu-branches/ubuntu/wily/ifrit/wily

« back to all changes in this revision

Viewing changes to shells/qt/iqtrenderwindowsubject.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2009-09-13 14:53:24 UTC
  • mfrom: (1.1.11 upstream) (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090913145324-084ivqvf29arkc1b
Tags: 3.3.2-1
* New upstream release.
* Bump Standards-Version to 3.8.3.  No changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*=========================================================================
2
 
 
3
 
  Program:   Ionization FRont Interactive Tool (IFRIT)
4
 
  Language:  C++
5
 
 
6
 
 
7
 
Copyright (c) 2002-2006 Nick Gnedin 
8
 
All rights reserved.
9
 
 
10
 
This file may be distributed and/or modified under the terms of the
11
 
GNU General Public License version 2 as published by the Free Software
12
 
Foundation and appearing in the file LICENSE.GPL included in the
13
 
packaging of this file.
14
 
 
15
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
16
 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
 
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
19
 
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
 
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
 
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 
 
26
 
=========================================================================*/
 
1
/*=========================================================================
 
2
 
 
3
  Program:   Ionization FRont Interactive Tool (IFRIT)
 
4
  Language:  C++
 
5
 
 
6
 
 
7
Copyright (c) 2002-2006 Nick Gnedin 
 
8
All rights reserved.
 
9
 
 
10
This file may be distributed and/or modified under the terms of the
 
11
GNU General Public License version 2 as published by the Free Software
 
12
Foundation and appearing in the file LICENSE.GPL included in the
 
13
packaging of this file.
 
14
 
 
15
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
 
16
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
17
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
18
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
 
19
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
20
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
21
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 
22
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 
23
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
24
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
25
 
 
26
=========================================================================*/
27
27
  
28
28
//
29
29
//  This class is based on original vtkQGLRenderWindow class written by Manish P. Pagey [pagey@drcsdca.com ]
71
71
#include "iarraytemplate.h"
72
72
 
73
73
 
 
74
using namespace iParameter;
 
75
 
 
76
 
74
77
iqtRenderWindowSubject::iqtRenderWindowSubject(iggRenderWindow *owner, QWidget* parent) : 
75
78
#ifdef IQT_3
76
 
        QGLWidget(parent,0,0,parent?Qt::WFlags(0):iqtHelper::GetFlags(iqtHelper::_VisualizationWindow)), 
 
79
        QGLWidget(parent,0,0,parent?Qt::WFlags(0):iqtHelper::GetFlags(WindowType::Render)), 
77
80
#else
78
 
        QGLWidget(parent,0,parent?Qt::WFlags(0):iqtHelper::GetFlags(iqtHelper::_VisualizationWindow)), 
 
81
        QGLWidget(parent,0,parent?Qt::WFlags(0):iqtHelper::GetFlags(WindowType::Render)), 
79
82
#endif
80
83
        ibgRenderWindowSubject(owner)
81
84
{
120
123
{
121
124
        if(parent == 0)
122
125
        {
123
 
                iqtHelper::SetParent(this,parent,iqtHelper::GetFlags(border ? iqtHelper::_VisualizationWindow : iqtHelper::_VisualizationWindowWithoutBorder));
 
126
                iqtHelper::SetParent(this,parent,iqtHelper::GetFlags(border ? WindowType::Render : WindowType::BorderlessRender));
124
127
#ifndef IQT_3
125
128
                this->setFormat(this->format()); // is this Qt 4 bug?
126
129
#endif
190
193
}
191
194
 
192
195
 
193
 
void* iqtRenderWindowSubject::GetGenericWindowId() const
 
196
void* iqtRenderWindowSubject::GetDisplayId() const
 
197
{
 
198
#if defined(Q_WS_X11)
 
199
        return (void *)this->x11Display();
 
200
#else
 
201
        return 0;
 
202
#endif
 
203
}
 
204
 
 
205
 
 
206
void* iqtRenderWindowSubject::GetWindowId() const
194
207
{
195
208
        return (void *)this->winId();
196
209
}
291
304
        //  I don't think we need this - it crashes X-server over the remote connection
292
305
        //
293
306
        //mOwner->OpenGLInit();
 
307
        mWindowHelper->RestoreDecoration();
294
308
}
295
309
 
296
310
 
366
380
}
367
381
 
368
382
 
369
 
bool iqtRenderWindowSubject::IsCurrent()
 
383
bool iqtRenderWindowSubject::IsCurrent() const
370
384
{
371
385
        return this->context() == QGLContext::currentContext();
372
386
}
373
387
 
374
388
 
 
389
void iqtRenderWindowSubject::RequestStereo(bool s)
 
390
{
 
391
        QGLFormat f = this->format();
 
392
        f.setStereo(s);
 
393
        this->setFormat(f);
 
394
}
 
395
 
 
396
 
375
397
bool iqtRenderWindowSubject::event(QEvent *e)
376
398
{
377
399
        //