#include <GEOMImpl_Types.hxx>
+// enum
+// {
+// SQUARE,
+// HEXAGON
+// };
+
//=================================================================================
// Constructor
//=================================================================================
GroupOrientation->RadioButton2->setText(tr("GEOM_WPLANE_OYZ"));
GroupOrientation->RadioButton3->setText(tr("GEOM_WPLANE_OZX"));
+ GroupPattern = new DlgRef_3Radio(centralWidget());
+ GroupPattern->GroupBox1->setTitle(tr("GEOM_PATTERN"));
+ GroupPattern->RadioButton1->setText(tr("GEOM_SQUARE"));
+ GroupPattern->RadioButton2->setText(tr("GEOM_HEXAGON"));
+ GroupPattern->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+ GroupPattern->RadioButton3->close();
+
GroupPntVecR = new DlgRef_2Sel1Spin(centralWidget());
GroupPntVecR->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupPntVecR->TextLabel1->setText(tr("GEOM_CENTER_POINT"));
layout->addWidget(GroupParams);
layout->addWidget(GroupOrientation);
layout->addWidget(GroupPntVecR);
+ layout->addWidget(GroupPattern);
/***************************************************************/
setHelpFileName("create_divideddisk_page.html");
// min, max, step and decimals for spin boxes & initial values
initSpinBox(GroupParams->SpinBox_DX, 0.00001, COORD_MAX, step, "length_precision" );
+ initSpinBox(GroupPntVecR->SpinBox_DX, 0.00001, COORD_MAX, step, "length_precision" );
GroupParams ->SpinBox_DX->setValue(100);
GroupPntVecR->SpinBox_DX->setValue(100);
GroupOrientation->RadioButton1->setChecked(true);
myOrientation = 1;
+
+ GroupPattern->RadioButton1->setChecked(true);
+ myPattern = GEOM::SQUARE;
// Signal/slot connections
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(GroupOrientation->RadioButton1, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
connect(GroupOrientation->RadioButton2, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
connect(GroupOrientation->RadioButton3, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
+
+ connect(GroupPattern->RadioButton1, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
+ connect(GroupPattern->RadioButton2, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
initName(tr("GEOM_DIVIDEDDISK"));
//=================================================================================
void AdvancedGUI_DividedDiskDlg::RadioButtonClicked()
{
- if (GroupOrientation->RadioButton1->isChecked())
+ QRadioButton* send = (QRadioButton*)sender();
+
+ // Orientation
+ if (send == GroupOrientation->RadioButton1)
myOrientation = 1;
- else if (GroupOrientation->RadioButton2->isChecked())
+ else if ( send == GroupOrientation->RadioButton2)
myOrientation = 2;
- else if (GroupOrientation->RadioButton3->isChecked())
+ else if ( send == GroupOrientation->RadioButton3)
myOrientation = 3;
+ // Division pattern
+ else if (send == GroupPattern->RadioButton1)
+ myPattern = GEOM::SQUARE;
+ else if (send == GroupPattern->RadioButton2)
+ myPattern = GEOM::HEXAGON;
+
displayPreview(true);
}
GEOM::GEOM_Object_var anObj;
GEOM::GEOM_IAdvancedOperations_var anOper = GEOM::GEOM_IAdvancedOperations::_narrow(getOperation());
- CORBA::Double theRatio = 50;
+ CORBA::Double theRatio = 67; // About 2/3
CORBA::Double theR = 0;
switch (getConstructorId()) {
theR = GroupParams->SpinBox_DX->value(); // init parameter value from dialog box ;
// call engine function
- anObj = anOper->MakeDividedDisk(theR, theRatio, myOrientation);
+ anObj = anOper->MakeDividedDisk(theR, theRatio, myOrientation, myPattern);
res = !anObj->_is_nil();
if (res && !IsPreview())
{
theR = GroupPntVecR->SpinBox_DX->value();
// call engine function
- anObj = anOper->MakeDividedDiskPntVecR(myPoint.get(), myDir.get(), theR, theRatio);
+ anObj = anOper->MakeDividedDiskPntVecR(myPoint.get(), myDir.get(), theR, theRatio, myPattern);
res = !anObj->_is_nil();
if (res && !IsPreview())
{