EDF 2281 : Possibility to choose the division pattern for the cylinder and missing translations

This commit is contained in:
rnc 2012-07-27 09:18:14 +00:00
parent d52b0e38ed
commit 75d091c0e2
13 changed files with 89 additions and 13 deletions

View File

@ -3804,7 +3804,9 @@ module GEOM
* \param theH Height of the cylinder * \param theH Height of the cylinder
* \return New GEOM_Object, containing the created shape. * \return New GEOM_Object, containing the created shape.
*/ */
GEOM_Object MakeDividedCylinder (in double theR, in double theH); GEOM_Object MakeDividedCylinder (in double theR,
in double theH,
in pattern thePattern );
/*@@ insert new functions before this line @@ do not remove this line @@*/ /*@@ insert new functions before this line @@ do not remove this line @@*/
}; };

View File

@ -620,7 +620,8 @@ module GEOM
GEOM_Object MakeDividedDisk (in double theR, in double theRatio, in short theOrientation, GEOM_Object MakeDividedDisk (in double theR, in double theRatio, in short theOrientation,
in pattern thePattern); in pattern thePattern);
GEOM_Object MakeDividedCylinder (in double theR, in double theH); GEOM_Object MakeDividedCylinder (in double theR, in double theH,
in pattern thePattern);
/*@@ insert new functions before this line @@ do not remove this line @@*/ /*@@ insert new functions before this line @@ do not remove this line @@*/
}; };

View File

@ -63,9 +63,17 @@ AdvancedGUI_DividedCylinderDlg::AdvancedGUI_DividedCylinderDlg (GeometryGUI* the
GroupParams->TextLabel1->setText(tr("GEOM_RADIUS")); GroupParams->TextLabel1->setText(tr("GEOM_RADIUS"));
GroupParams->TextLabel2->setText(tr("GEOM_HEIGHT")); GroupParams->TextLabel2->setText(tr("GEOM_HEIGHT"));
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();
QVBoxLayout* layout = new QVBoxLayout(centralWidget()); QVBoxLayout* layout = new QVBoxLayout(centralWidget());
layout->setMargin(0); layout->setSpacing(6); layout->setMargin(0); layout->setSpacing(6);
layout->addWidget(GroupParams); layout->addWidget(GroupParams);
layout->addWidget(GroupPattern);
/***************************************************************/ /***************************************************************/
setHelpFileName("create_dividedcylinder_page.html"); setHelpFileName("create_dividedcylinder_page.html");
@ -101,6 +109,9 @@ void AdvancedGUI_DividedCylinderDlg::Init()
GroupParams->SpinBox_DX->setValue(aRadius); GroupParams->SpinBox_DX->setValue(aRadius);
GroupParams->SpinBox_DY->setValue(aHeight); GroupParams->SpinBox_DY->setValue(aHeight);
GroupPattern->RadioButton1->setChecked(true);
myPattern = GEOM::SQUARE;
// Signal/slot connections // Signal/slot connections
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
@ -110,6 +121,9 @@ void AdvancedGUI_DividedCylinderDlg::Init()
connect(GroupParams->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); connect(GroupParams->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupParams->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); connect(GroupParams->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPattern->RadioButton1, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
connect(GroupPattern->RadioButton2, SIGNAL(clicked()), this, SLOT(RadioButtonClicked()));
initName(tr("GEOM_DIVIDEDCYLINDER")); initName(tr("GEOM_DIVIDEDCYLINDER"));
resize(minimumSizeHint()); resize(minimumSizeHint());
@ -125,6 +139,23 @@ void AdvancedGUI_DividedCylinderDlg::SetDoubleSpinBoxStep (double step)
//@@ set double spin box step for all spin boxes here @@// //@@ set double spin box step for all spin boxes here @@//
} }
//=================================================================================
// function : RadioButtonClicked()
// purpose : Radio button management
//=================================================================================
void AdvancedGUI_DividedCylinderDlg::RadioButtonClicked()
{
QRadioButton* send = (QRadioButton*)sender();
// Division pattern
if (send == GroupPattern->RadioButton1)
myPattern = GEOM::SQUARE;
else if (send == GroupPattern->RadioButton2)
myPattern = GEOM::HEXAGON;
displayPreview(true);
}
//================================================================================= //=================================================================================
// function : ClickOnOk() // function : ClickOnOk()
// purpose : // purpose :
@ -218,7 +249,7 @@ bool AdvancedGUI_DividedCylinderDlg::execute (ObjectList& objects)
CORBA::Double theH = GroupParams->SpinBox_DY->value(); CORBA::Double theH = GroupParams->SpinBox_DY->value();
// call engine function // call engine function
anObj = anOper->MakeDividedCylinder(theR, theH); anObj = anOper->MakeDividedCylinder(theR, theH, myPattern);
res = !anObj->_is_nil(); res = !anObj->_is_nil();
if (res && !IsPreview()) if (res && !IsPreview())
{ {

View File

@ -25,6 +25,7 @@
#include <GEOMBase_Skeleton.h> #include <GEOMBase_Skeleton.h>
class DlgRef_2Spin; class DlgRef_2Spin;
class DlgRef_3Radio;
//================================================================================= //=================================================================================
// class : AdvancedGUI_DividedCylinderDlg // class : AdvancedGUI_DividedCylinderDlg
@ -50,6 +51,8 @@ private:
private: private:
DlgRef_2Spin* GroupParams; DlgRef_2Spin* GroupParams;
DlgRef_3Radio* GroupPattern;
GEOM::pattern myPattern;
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
@ -57,6 +60,7 @@ private slots:
void ActivateThisDialog(); void ActivateThisDialog();
void ValueChangedInSpinBox(); void ValueChangedInSpinBox();
void SetDoubleSpinBoxStep( double ); void SetDoubleSpinBoxStep( double );
void RadioButtonClicked();
}; };
#endif // ADVANCEDGUI_DIVIDEDCYLINDERDLG_H #endif // ADVANCEDGUI_DIVIDEDCYLINDERDLG_H

View File

@ -79,10 +79,11 @@ AdvancedGUI_DividedDiskDlg::AdvancedGUI_DividedDiskDlg (GeometryGUI* theGeometry
GroupPattern = new DlgRef_3Radio(centralWidget()); GroupPattern = new DlgRef_3Radio(centralWidget());
GroupPattern->GroupBox1->setTitle(tr("GEOM_PATTERN")); 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->setAttribute(Qt::WA_DeleteOnClose);
GroupPattern->RadioButton3->close(); GroupPattern->RadioButton3->close();
GroupPntVecR = new DlgRef_2Sel1Spin(centralWidget()); GroupPntVecR = new DlgRef_2Sel1Spin(centralWidget());
GroupPntVecR->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); GroupPntVecR->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupPntVecR->TextLabel1->setText(tr("GEOM_CENTER_POINT")); GroupPntVecR->TextLabel1->setText(tr("GEOM_CENTER_POINT"));

View File

@ -838,6 +838,10 @@ Please, select face, shell or solid and try again</translation>
<source>GEOM_HEIGHT</source> <source>GEOM_HEIGHT</source>
<translation>Height :</translation> <translation>Height :</translation>
</message> </message>
<message>
<source>GEOM_HEXAGON</source>
<translation>Hexagon</translation>
</message>
<message> <message>
<source>GEOM_HOLES</source> <source>GEOM_HOLES</source>
<translation>Holes</translation> <translation>Holes</translation>
@ -1146,6 +1150,10 @@ Please, select face, shell or solid and try again</translation>
<source>GEOM_OFFSET_TITLE</source> <source>GEOM_OFFSET_TITLE</source>
<translation>Offset Surface</translation> <translation>Offset Surface</translation>
</message> </message>
<message>
<source>GEOM_PATTERN</source>
<translation>Division pattern</translation>
</message>
<message> <message>
<source>GEOM_PROJECTION</source> <source>GEOM_PROJECTION</source>
<translation>Projection</translation> <translation>Projection</translation>
@ -1850,6 +1858,10 @@ Please, select face, shell or solid and try again</translation>
<source>GEOM_SPLINE_TITLE</source> <source>GEOM_SPLINE_TITLE</source>
<translation>Spline Construction</translation> <translation>Spline Construction</translation>
</message> </message>
<message>
<source>GEOM_SQUARE</source>
<translation>Square</translation>
</message>
<message> <message>
<source>GEOM_START_LCS</source> <source>GEOM_START_LCS</source>
<translation>Start LCS</translation> <translation>Start LCS</translation>

View File

@ -838,6 +838,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
<source>GEOM_HEIGHT</source> <source>GEOM_HEIGHT</source>
<translation>Hauteur:</translation> <translation>Hauteur:</translation>
</message> </message>
<message>
<source>GEOM_HEXAGON</source>
<translation>Héxagone</translation>
</message>
<message> <message>
<source>GEOM_HOLES</source> <source>GEOM_HOLES</source>
<translation>Trous</translation> <translation>Trous</translation>
@ -1146,6 +1150,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
<source>GEOM_OFFSET_TITLE</source> <source>GEOM_OFFSET_TITLE</source>
<translation>Décaler une surface</translation> <translation>Décaler une surface</translation>
</message> </message>
<message>
<source>GEOM_PATTERN</source>
<translation>Schema de découpe</translation>
</message>
<message> <message>
<source>GEOM_PROJECTION</source> <source>GEOM_PROJECTION</source>
<translation>Projection</translation> <translation>Projection</translation>
@ -1850,6 +1858,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
<source>GEOM_SPLINE_TITLE</source> <source>GEOM_SPLINE_TITLE</source>
<translation>Construction d&apos;un spline</translation> <translation>Construction d&apos;un spline</translation>
</message> </message>
<message>
<source>GEOM_SQUARE</source>
<translation>Carré</translation>
</message>
<message> <message>
<source>GEOM_START_LCS</source> <source>GEOM_START_LCS</source>
<translation>SCL du Début</translation> <translation>SCL du Début</translation>

View File

@ -2367,14 +2367,16 @@ Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedDiskPntVecR (Handle
* \return New GEOM_Object, containing the created shape. * \return New GEOM_Object, containing the created shape.
*/ */
//============================================================================= //=============================================================================
Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedCylinder (double theR, double theH) Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedCylinder (double theR,
double theH,
int thePattern)
{ {
SetErrorCode(KO); SetErrorCode(KO);
//Add a new object //Add a new object
Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDCYLINDER); Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDCYLINDER);
Handle(GEOM_Object) aBaseShape = MakeDividedDisk(theR, 50.0, 1, 0); Handle(GEOM_Object) aBaseShape = MakeDividedDisk(theR, 67.0, 1, thePattern);
aBaseShape->GetLastFunction()->SetDescription(""); // Erase dump of MakeDividedDisk aBaseShape->GetLastFunction()->SetDescription(""); // Erase dump of MakeDividedDisk
aShape = my3DPrimOperations->MakePrismDXDYDZ(aBaseShape,0.0,0.0,theH, -1.0); aShape = my3DPrimOperations->MakePrismDXDYDZ(aBaseShape,0.0,0.0,theH, -1.0);

View File

@ -118,7 +118,10 @@ public:
double theRatio, double theRatio,
int thePattern); int thePattern);
Standard_EXPORT Handle(GEOM_Object) MakeDividedCylinder (double theR, double theH); Standard_EXPORT Handle(GEOM_Object) MakeDividedCylinder (double theR,
double theH,
int thePattern);
/*@@ insert new functions before this line @@ do not remove this line @@*/ /*@@ insert new functions before this line @@ do not remove this line @@*/
}; };
#endif #endif

View File

@ -387,7 +387,9 @@ GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedDiskPntVecR (GEOM::
* \return New GEOM_Object, containing the created shape. * \return New GEOM_Object, containing the created shape.
*/ */
//============================================================================= //=============================================================================
GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedCylinder (CORBA::Double theR, CORBA::Double theH) GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedCylinder (CORBA::Double theR,
CORBA::Double theH,
GEOM::pattern thePattern)
{ {
GEOM::GEOM_Object_var aGEOMObject; GEOM::GEOM_Object_var aGEOMObject;
@ -395,7 +397,7 @@ GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedCylinder (CORBA::Do
GetOperations()->SetNotDone(); GetOperations()->SetNotDone();
//Create the DividedCylinder //Create the DividedCylinder
Handle(GEOM_Object) anObject = GetOperations()->MakeDividedCylinder(theR, theH); Handle(GEOM_Object) anObject = GetOperations()->MakeDividedCylinder(theR, theH, thePattern);
if (!GetOperations()->IsDone() || anObject.IsNull()) if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn(); return aGEOMObject._retn();

View File

@ -75,7 +75,9 @@ class GEOM_I_EXPORT GEOM_IAdvancedOperations_i :
CORBA::Double theRatio, CORBA::Double theRatio,
GEOM::pattern thePattern); GEOM::pattern thePattern);
GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR, CORBA::Double theH); GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR,
CORBA::Double theH,
GEOM::pattern thePattern);
/*@@ insert new functions before this line @@ do not remove this line @@*/ /*@@ insert new functions before this line @@ do not remove this line @@*/
::GEOMImpl_IAdvancedOperations* GetOperations() ::GEOMImpl_IAdvancedOperations* GetOperations()

View File

@ -3419,12 +3419,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDividedDisk (CORBA::Double theR, CORBA:
//============================================================================= //=============================================================================
// MakeDividedCylinder // MakeDividedCylinder
//============================================================================= //=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDividedCylinder (CORBA::Double theR, CORBA::Double theH) GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDividedCylinder (CORBA::Double theR,
CORBA::Double theH,
GEOM::pattern thePattern)
{ {
beginService( " GEOM_Superv_i::MakeDividedCylinder" ); beginService( " GEOM_Superv_i::MakeDividedCylinder" );
MESSAGE("GEOM_Superv_i::MakeDividedCylinder"); MESSAGE("GEOM_Superv_i::MakeDividedCylinder");
getAdvancedOp(); getAdvancedOp();
GEOM::GEOM_Object_ptr anObj = myAdvancedOp->MakeDividedCylinder(theR, theH); GEOM::GEOM_Object_ptr anObj = myAdvancedOp->MakeDividedCylinder(theR, theH, thePattern);
endService( " GEOM_Superv_i::MakeDividedCylinder" ); endService( " GEOM_Superv_i::MakeDividedCylinder" );
return anObj; return anObj;
} }

View File

@ -708,7 +708,9 @@ public:
GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3); GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
GEOM::GEOM_Object_ptr MakeDividedDisk (CORBA::Double theR, CORBA::Double theRatio, GEOM::GEOM_Object_ptr MakeDividedDisk (CORBA::Double theR, CORBA::Double theRatio,
CORBA::Short theOrientation, GEOM::pattern thePattern); CORBA::Short theOrientation, GEOM::pattern thePattern);
GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR, CORBA::Double theH); GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR,
CORBA::Double theH,
GEOM::pattern thePattern);
/*@@ insert new functions before this line @@ do not remove this line @@*/ /*@@ insert new functions before this line @@ do not remove this line @@*/
private: private: