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
* \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 @@*/
};

View File

@ -620,7 +620,8 @@ module GEOM
GEOM_Object MakeDividedDisk (in double theR, in double theRatio, in short theOrientation,
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 @@*/
};

View File

@ -62,10 +62,18 @@ AdvancedGUI_DividedCylinderDlg::AdvancedGUI_DividedCylinderDlg (GeometryGUI* the
GroupParams->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
GroupParams->TextLabel1->setText(tr("GEOM_RADIUS"));
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());
layout->setMargin(0); layout->setSpacing(6);
layout->addWidget(GroupParams);
layout->addWidget(GroupPattern);
/***************************************************************/
setHelpFileName("create_dividedcylinder_page.html");
@ -100,6 +108,9 @@ void AdvancedGUI_DividedCylinderDlg::Init()
double aHeight = 300;
GroupParams->SpinBox_DX->setValue(aRadius);
GroupParams->SpinBox_DY->setValue(aHeight);
GroupPattern->RadioButton1->setChecked(true);
myPattern = GEOM::SQUARE;
// Signal/slot connections
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
@ -109,6 +120,9 @@ void AdvancedGUI_DividedCylinderDlg::Init()
connect(GroupParams->SpinBox_DX, 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"));
@ -125,6 +139,23 @@ void AdvancedGUI_DividedCylinderDlg::SetDoubleSpinBoxStep (double step)
//@@ 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()
// purpose :
@ -218,7 +249,7 @@ bool AdvancedGUI_DividedCylinderDlg::execute (ObjectList& objects)
CORBA::Double theH = GroupParams->SpinBox_DY->value();
// call engine function
anObj = anOper->MakeDividedCylinder(theR, theH);
anObj = anOper->MakeDividedCylinder(theR, theH, myPattern);
res = !anObj->_is_nil();
if (res && !IsPreview())
{

View File

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

View File

@ -79,10 +79,11 @@ AdvancedGUI_DividedDiskDlg::AdvancedGUI_DividedDiskDlg (GeometryGUI* theGeometry
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"));

View File

@ -838,6 +838,10 @@ Please, select face, shell or solid and try again</translation>
<source>GEOM_HEIGHT</source>
<translation>Height :</translation>
</message>
<message>
<source>GEOM_HEXAGON</source>
<translation>Hexagon</translation>
</message>
<message>
<source>GEOM_HOLES</source>
<translation>Holes</translation>
@ -1146,6 +1150,10 @@ Please, select face, shell or solid and try again</translation>
<source>GEOM_OFFSET_TITLE</source>
<translation>Offset Surface</translation>
</message>
<message>
<source>GEOM_PATTERN</source>
<translation>Division pattern</translation>
</message>
<message>
<source>GEOM_PROJECTION</source>
<translation>Projection</translation>
@ -1850,6 +1858,10 @@ Please, select face, shell or solid and try again</translation>
<source>GEOM_SPLINE_TITLE</source>
<translation>Spline Construction</translation>
</message>
<message>
<source>GEOM_SQUARE</source>
<translation>Square</translation>
</message>
<message>
<source>GEOM_START_LCS</source>
<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>
<translation>Hauteur:</translation>
</message>
<message>
<source>GEOM_HEXAGON</source>
<translation>Héxagone</translation>
</message>
<message>
<source>GEOM_HOLES</source>
<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>
<translation>Décaler une surface</translation>
</message>
<message>
<source>GEOM_PATTERN</source>
<translation>Schema de découpe</translation>
</message>
<message>
<source>GEOM_PROJECTION</source>
<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>
<translation>Construction d&apos;un spline</translation>
</message>
<message>
<source>GEOM_SQUARE</source>
<translation>Carré</translation>
</message>
<message>
<source>GEOM_START_LCS</source>
<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.
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedCylinder (double theR, double theH)
Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedCylinder (double theR,
double theH,
int thePattern)
{
SetErrorCode(KO);
//Add a new object
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
aShape = my3DPrimOperations->MakePrismDXDYDZ(aBaseShape,0.0,0.0,theH, -1.0);

View File

@ -118,7 +118,10 @@ public:
double theRatio,
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 @@*/
};
#endif

View File

@ -387,7 +387,9 @@ GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedDiskPntVecR (GEOM::
* \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;
@ -395,7 +397,7 @@ GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedCylinder (CORBA::Do
GetOperations()->SetNotDone();
//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())
return aGEOMObject._retn();

View File

@ -75,7 +75,9 @@ class GEOM_I_EXPORT GEOM_IAdvancedOperations_i :
CORBA::Double theRatio,
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 @@*/
::GEOMImpl_IAdvancedOperations* GetOperations()

View File

@ -3419,12 +3419,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDividedDisk (CORBA::Double theR, CORBA:
//=============================================================================
// 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" );
MESSAGE("GEOM_Superv_i::MakeDividedCylinder");
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" );
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 MakeDividedDisk (CORBA::Double theR, CORBA::Double theRatio,
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 @@*/
private: