File: VRenderInterface.Qt3.cpp

package info (click to toggle)
libqglviewer 2.3.4-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 7,084 kB
  • ctags: 3,725
  • sloc: cpp: 27,441; sh: 989; makefile: 103
file content (145 lines) | stat: -rw-r--r-- 5,651 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/****************************************************************************

 Copyright (C) 2002-2008 Gilles Debunne. All rights reserved.

 This file is part of the QGLViewer library version 2.3.4.

 http://www.libqglviewer.com - contact@libqglviewer.com

 This file may be used under the terms of the GNU General Public License 
 versions 2.0 or 3.0 as published by the Free Software Foundation and
 appearing in the LICENSE file included in the packaging of this file.
 In addition, as a special exception, Gilles Debunne gives you certain 
 additional rights, described in the file GPL_EXCEPTION in this package.

 libQGLViewer uses dual licensing. Commercial/proprietary software must
 purchase a libQGLViewer Commercial License.

 This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

*****************************************************************************/

/****************************************************************************
** Form implementation generated from reading ui file 'VRenderInterface.Qt3.ui'
**
** Created: lun. août 31 22:38:23 2009
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "VRenderInterface.Qt3.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a VRenderInterface as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
VRenderInterface::VRenderInterface( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "VRenderInterface" );
    VRenderInterfaceLayout = new QVBoxLayout( this, 5, 6, "VRenderInterfaceLayout"); 

    includeHidden = new QCheckBox( this, "includeHidden" );
    VRenderInterfaceLayout->addWidget( includeHidden );

    cullBackFaces = new QCheckBox( this, "cullBackFaces" );
    VRenderInterfaceLayout->addWidget( cullBackFaces );

    blackAndWhite = new QCheckBox( this, "blackAndWhite" );
    VRenderInterfaceLayout->addWidget( blackAndWhite );

    colorBackground = new QCheckBox( this, "colorBackground" );
    VRenderInterfaceLayout->addWidget( colorBackground );

    tightenBBox = new QCheckBox( this, "tightenBBox" );
    VRenderInterfaceLayout->addWidget( tightenBBox );

    layout3 = new QHBoxLayout( 0, 0, 6, "layout3"); 

    sortLabel = new QLabel( this, "sortLabel" );
    layout3->addWidget( sortLabel );

    sortMethod = new QComboBox( FALSE, this, "sortMethod" );
    layout3->addWidget( sortMethod );
    VRenderInterfaceLayout->addLayout( layout3 );
    spacer1 = new QSpacerItem( 31, 41, QSizePolicy::Minimum, QSizePolicy::Expanding );
    VRenderInterfaceLayout->addItem( spacer1 );

    Layout4 = new QHBoxLayout( 0, 0, 6, "Layout4"); 

    SaveButton = new QPushButton( this, "SaveButton" );
    Layout4->addWidget( SaveButton );

    CancelButton = new QPushButton( this, "CancelButton" );
    Layout4->addWidget( CancelButton );
    VRenderInterfaceLayout->addLayout( Layout4 );
    languageChange();
    resize( QSize(298, 245).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( SaveButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( CancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );

    // tab order
    setTabOrder( SaveButton, CancelButton );
    setTabOrder( CancelButton, includeHidden );
    setTabOrder( includeHidden, cullBackFaces );
    setTabOrder( cullBackFaces, blackAndWhite );
    setTabOrder( blackAndWhite, colorBackground );
    setTabOrder( colorBackground, tightenBBox );
    setTabOrder( tightenBBox, sortMethod );
}

/*
 *  Destroys the object and frees any allocated resources
 */
VRenderInterface::~VRenderInterface()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void VRenderInterface::languageChange()
{
    setCaption( tr( "Vectorial rendering options" ) );
    includeHidden->setText( tr( "Include hidden parts" ) );
    QToolTip::add( includeHidden, tr( "Hidden polygons are also included in the output (usually twice bigger)" ) );
    cullBackFaces->setText( tr( "Cull back faces" ) );
    QToolTip::add( cullBackFaces, tr( "Back faces (non clockwise point ordering) are removed from the output" ) );
    blackAndWhite->setText( tr( "Black and white" ) );
    QToolTip::add( blackAndWhite, tr( "Black and white rendering" ) );
    colorBackground->setText( tr( "Color background" ) );
    QToolTip::add( colorBackground, tr( "Use current background color instead of white" ) );
    tightenBBox->setText( tr( "Tighten bounding box" ) );
    QToolTip::add( tightenBBox, tr( "Fit output bounding box to current display" ) );
    sortLabel->setText( tr( "Sort method:" ) );
    QToolTip::add( sortLabel, tr( "Polygon depth sorting method" ) );
    sortMethod->clear();
    sortMethod->insertItem( tr( "No sorting" ) );
    sortMethod->insertItem( tr( "BSP" ) );
    sortMethod->insertItem( tr( "Topological" ) );
    sortMethod->insertItem( tr( "Advanced topological" ) );
    sortMethod->setCurrentItem( 3 );
    QToolTip::add( sortMethod, tr( "Polygon depth sorting method" ) );
    SaveButton->setText( tr( "Save" ) );
    CancelButton->setText( tr( "Cancel" ) );
}