zz_addObjectDialog.cpp

changeset 135
c243df39913e
parent 116
4fde8fdf258a
child 136
13db97be14cb
equal deleted inserted replaced
134:7fd0784471df 135:c243df39913e
65 dCoordCount = 3; 65 dCoordCount = 3;
66 66
67 case OBJ_Radial: 67 case OBJ_Radial:
68 dCoordCount = 3; 68 dCoordCount = 3;
69 69
70 qRadialTypeLabel = new QLabel ("Type:"); 70 lb_radType = new QLabel ("Type:");
71 qRadialResolutionLabel = new QLabel ("Resolution:"); 71 lb_radResolution = new QLabel ("Resolution:");
72 qRadialSegmentsLabel = new QLabel ("Segments:"); 72 lb_radSegments = new QLabel ("Segments:");
73 qRadialRingNumLabel = new QLabel ("Ring number:"); 73 lb_radRingNum = new QLabel ("Ring number:");
74 74
75 qRadialType = new QComboBox; 75 qRadialType = new QComboBox;
76 76
77 for (int i = 0; i < LDRadial::NumTypes; ++i) 77 for (int i = 0; i < LDRadial::NumTypes; ++i)
78 qRadialType->addItem (LDRadial::radialTypeName ((LDRadial::Type) i)); 78 qRadialType->addItem (LDRadial::radialTypeName ((LDRadial::Type) i));
80 connect (qRadialType, SIGNAL (currentIndexChanged (int)), this, SLOT (slot_radialTypeChanged (int))); 80 connect (qRadialType, SIGNAL (currentIndexChanged (int)), this, SLOT (slot_radialTypeChanged (int)));
81 81
82 qRadialResolution = new QComboBox; 82 qRadialResolution = new QComboBox;
83 qRadialResolution->addItems ({"Normal (16)", "Hi-Res (48)"}); 83 qRadialResolution->addItems ({"Normal (16)", "Hi-Res (48)"});
84 84
85 qRadialSegments = new QSpinBox; 85 sb_radSegments = new QSpinBox;
86 qRadialSegments->setMinimum (1); 86 sb_radSegments->setMinimum (1);
87 87
88 qRadialRingNum = new QSpinBox; 88 sb_radRingNum = new QSpinBox;
89 qRadialRingNum->setEnabled (false); 89 sb_radRingNum->setEnabled (false);
90 break; 90 break;
91 91
92 default: 92 default:
93 break; 93 break;
94 } 94 }
133 case OBJ_Comment: 133 case OBJ_Comment:
134 qLayout->addWidget (qCommentLine, 0, 1); 134 qLayout->addWidget (qCommentLine, 0, 1);
135 break; 135 break;
136 136
137 case OBJ_Radial: 137 case OBJ_Radial:
138 qLayout->addWidget (qRadialTypeLabel, 1, 1); 138 qLayout->addWidget (lb_radType, 1, 1);
139 qLayout->addWidget (qRadialType, 1, 2); 139 qLayout->addWidget (qRadialType, 1, 2);
140 qLayout->addWidget (qRadialResolutionLabel, 2, 1); 140 qLayout->addWidget (lb_radResolution, 2, 1);
141 qLayout->addWidget (qRadialResolution, 2, 2); 141 qLayout->addWidget (qRadialResolution, 2, 2);
142 qLayout->addWidget (qRadialSegmentsLabel, 3, 1); 142 qLayout->addWidget (lb_radSegments, 3, 1);
143 qLayout->addWidget (qRadialSegments, 3, 2); 143 qLayout->addWidget (sb_radSegments, 3, 2);
144 qLayout->addWidget (qRadialRingNumLabel, 4, 1); 144 qLayout->addWidget (lb_radRingNum, 4, 1);
145 qLayout->addWidget (qRadialRingNum, 4, 2); 145 qLayout->addWidget (sb_radRingNum, 4, 2);
146 break; 146 break;
147 147
148 default: 148 default:
149 break; 149 break;
150 } 150 }
159 qCoordLayout->addWidget (qaCoordinates[i], (i / 3), (i % 3)); 159 qCoordLayout->addWidget (qaCoordinates[i], (i / 3), (i % 3));
160 160
161 qLayout->addLayout (qCoordLayout, 0, 1, 2, 2); 161 qLayout->addLayout (qCoordLayout, 0, 1, 2, 2);
162 } 162 }
163 163
164 qLayout->addWidget (qButtons, 5, 1); 164 qLayout->addWidget (bbx_buttons, 5, 1);
165 setLayout (qLayout); 165 setLayout (qLayout);
166 setWindowTitle (format (APPNAME_DISPLAY " - new %s", 166 setWindowTitle (format (APPNAME_DISPLAY " - new %s",
167 g_saObjTypeNames[type]).chars()); 167 g_saObjTypeNames[type]).chars());
168 168
169 setWindowIcon (QIcon (zIconName.chars ())); 169 setWindowIcon (QIcon (zIconName.chars ()));
191 // ============================================================================= 191 // =============================================================================
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
193 // ============================================================================= 193 // =============================================================================
194 void AddObjectDialog::slot_radialTypeChanged (int dType) { 194 void AddObjectDialog::slot_radialTypeChanged (int dType) {
195 LDRadial::Type eType = (LDRadial::Type) dType; 195 LDRadial::Type eType = (LDRadial::Type) dType;
196 qRadialRingNum->setEnabled (eType == LDRadial::Ring || eType == LDRadial::Cone); 196 sb_radRingNum->setEnabled (eType == LDRadial::Ring || eType == LDRadial::Cone);
197 } 197 }
198 198
199 // ============================================================================= 199 // =============================================================================
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
201 // ============================================================================= 201 // =============================================================================
262 pRad->dColor = dlg.dColor; 262 pRad->dColor = dlg.dColor;
263 pRad->vPosition.x = dlg.qaCoordinates[0]->value (); 263 pRad->vPosition.x = dlg.qaCoordinates[0]->value ();
264 pRad->vPosition.y = dlg.qaCoordinates[1]->value (); 264 pRad->vPosition.y = dlg.qaCoordinates[1]->value ();
265 pRad->vPosition.z = dlg.qaCoordinates[2]->value (); 265 pRad->vPosition.z = dlg.qaCoordinates[2]->value ();
266 pRad->dDivisions = (dlg.qRadialResolution->currentIndex () == 0) ? 16 : 48; 266 pRad->dDivisions = (dlg.qRadialResolution->currentIndex () == 0) ? 16 : 48;
267 pRad->dSegments = min<short> (dlg.qRadialSegments->value (), pRad->dDivisions); 267 pRad->dSegments = min<short> (dlg.sb_radSegments->value (), pRad->dDivisions);
268 pRad->eRadialType = (LDRadial::Type) dlg.qRadialType->currentIndex (); 268 pRad->eRadialType = (LDRadial::Type) dlg.qRadialType->currentIndex ();
269 pRad->dRingNum = dlg.qRadialRingNum->value (); 269 pRad->dRingNum = dlg.sb_radRingNum->value ();
270 pRad->mMatrix = g_mIdentity; 270 pRad->mMatrix = g_mIdentity;
271 271
272 obj = pRad; 272 obj = pRad;
273 } 273 }
274 break; 274 break;

mercurial