GEOM_Object MakeDiskR (in double theR, in short theOrientation);
/*!
- * \brief Create a cylinder with given radius and height at
+ * \brief Create a cylinder with given radius, height and angle (portion of cylinder) at
* the origin of coordinate system.
*
* Axis of the cylinder will be collinear to the OZ axis of the coordinate system.
* \param theR Cylinder radius.
* \param theH Cylinder height.
+ * \param theA Cylinder angle.
* \return New GEOM_Object, containing the created cylinder.
*/
- GEOM_Object MakeCylinderRH (in double theR, in double theH);
+ GEOM_Object MakeCylinderRH (in double theR, in double theH, in double theA);
/*!
- * \brief Create a cylinder with given base point, axis, radius and height.
+ * \brief Create a cylinder with given base point, axis, radius, height and angle (portion of cylinder).
* \param thePnt Central point of cylinder base.
* \param theAxis Cylinder axis.
* \param theR Cylinder radius.
* \param theH Cylinder height.
+ * \param theA Cylinder angle.
* \return New GEOM_Object, containing the created cylinder.
*/
GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt,
in GEOM_Object theAxis,
in double theR,
- in double theH);
+ in double theH,
+ in double theA);
/*!
* \brief Create a cone with given height and radiuses at
GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt,
in GEOM_Object theAxis,
in double theRadius,
- in double theHeight) ;
+ in double theHeight,
+ in double theAngle) ;
GEOM_Object MakeCylinderRH (in double theR,
- in double theH) ;
+ in double theH,
+ in double theA) ;
GEOM_Object MakeSphere (in double theX,
in double theY,
in double theZ,
<inParameter-type>double</inParameter-type>
<inParameter-comment>unknown</inParameter-comment>
</inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
</inParameter-list>
<outParameter-list>
<outParameter>
<inParameter-type>double</inParameter-type>
<inParameter-comment>unknown</inParameter-comment>
</inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
</inParameter-list>
<outParameter-list>
<outParameter>
DlgRef_2Sel2Spin2Push_QTD.ui
DlgRef_2Sel2Spin3Check_QTD.ui
DlgRef_2Sel2Spin_QTD.ui
+ DlgRef_2Sel3Spin1Check_QTD.ui
DlgRef_2Sel3Spin2Rb_QTD.ui
DlgRef_2Sel3Spin_QTD.ui
DlgRef_2SelExt_QTD.ui
DlgRef_3Sel4Spin2Check_QTD.ui
DlgRef_3Sel_QTD.ui
DlgRef_3Spin1Check_QTD.ui
+ DlgRef_3Spin1CheckCyl_QTD.ui
DlgRef_3Spin_QTD.ui
DlgRef_4Sel1List1Check_QTD.ui
DlgRef_4Sel1List_QTD.ui
{
}
+//////////////////////////////////////////
+// DlgRef_2Sel3Spin1Check
+//////////////////////////////////////////
+
+DlgRef_2Sel3Spin1Check::DlgRef_2Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+ setupUi( this );
+}
+
+DlgRef_2Sel3Spin1Check::~DlgRef_2Sel3Spin1Check()
+{
+}
+
//////////////////////////////////////////
// DlgRef_2Sel3Spin2Rb
//////////////////////////////////////////
{
}
+//////////////////////////////////////////
+// DlgRef_3Spin1CheckCyl
+//////////////////////////////////////////
+
+DlgRef_3Spin1CheckCyl::DlgRef_3Spin1CheckCyl( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+ setupUi( this );
+}
+
+DlgRef_3Spin1CheckCyl::~DlgRef_3Spin1CheckCyl()
+{
+}
+
//////////////////////////////////////////
// DlgRef_3Spin
//////////////////////////////////////////
~DlgRef_2Sel2Spin2Push();
};
+//////////////////////////////////////////
+// DlgRef_2Sel3Spin1Check
+//////////////////////////////////////////
+
+#include "ui_DlgRef_2Sel3Spin1Check_QTD.h"
+
+class DLGREF_EXPORT DlgRef_2Sel3Spin1Check : public QWidget,
+ public Ui::DlgRef_2Sel3Spin1Check_QTD
+{
+ Q_OBJECT
+
+public:
+ DlgRef_2Sel3Spin1Check( QWidget* = 0, Qt::WindowFlags = 0 );
+ ~DlgRef_2Sel3Spin1Check();
+};
+
//////////////////////////////////////////
// DlgRef_2Sel3Spin2Rb
//////////////////////////////////////////
~DlgRef_3Spin1Check();
};
+//////////////////////////////////////////
+// DlgRef_3Spin1CheckCyl
+//////////////////////////////////////////
+
+#include "ui_DlgRef_3Spin1CheckCyl_QTD.h"
+
+class DLGREF_EXPORT DlgRef_3Spin1CheckCyl : public QWidget,
+ public Ui::DlgRef_3Spin1CheckCyl_QTD
+{
+ Q_OBJECT
+
+public:
+ DlgRef_3Spin1CheckCyl( QWidget* = 0, Qt::WindowFlags = 0 );
+ ~DlgRef_3Spin1CheckCyl();
+};
+
//////////////////////////////////////////
// DlgRef_3Spin
//////////////////////////////////////////
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DlgRef_3Spin1CheckCyl_QTD</class>
+ <widget class="QWidget" name="DlgRef_3Spin1CheckCyl_QTD">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>611</width>
+ <height>154</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string/>
+ </property>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="GroupBox1">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QGridLayout" columnstretch="0,0,0,0" columnminimumwidth="0,0,0,280">
+ <property name="margin">
+ <number>9</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <item row="2" column="1">
+ <widget class="QLabel" name="TextLabel3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL3</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="TextLabel2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL2</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="TextLabel1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX"/>
+ </item>
+ <item row="1" column="3">
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY"/>
+ </item>
+ <item row="2" column="3">
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="checkBox">
+ <property name="text">
+ <string>CB</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>SalomeApp_DoubleSpinBox</class>
+ <extends>QDoubleSpinBox</extends>
+ <header location="global">SalomeApp_DoubleSpinBox.h</header>
+ </customwidget>
+ </customwidgets>
+ <tabstops>
+ <tabstop>SpinBox_DX</tabstop>
+ <tabstop>SpinBox_DY</tabstop>
+ <tabstop>SpinBox_DZ</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
gp_Pnt aP;
gp_Vec aV;
+
+ TopoDS_Shape aShape;
if (aType == CYLINDER_R_H) {
aP = gp::Origin();
if (aCI.GetH() < 0.0) aV.Reverse();
gp_Ax2 anAxes (aP, aV);
-
- BRepPrimAPI_MakeCylinder MC (anAxes, aCI.GetR(), Abs(aCI.GetH()));
- MC.Build();
- if (!MC.IsDone()) {
- StdFail_NotDone::Raise("Cylinder can't be computed from the given parameters");
- }
-
- TopoDS_Shape aShape = MC.Shape();
+ aShape = BRepPrimAPI_MakeCylinder(anAxes, aCI.GetR(), Abs(aCI.GetH())).Shape();
+ if(aCI.GetA() < 360. && aCI.GetA()> 0.){
+ BRepPrimAPI_MakeCylinder MC(anAxes, aCI.GetR(), Abs(aCI.GetH()), aCI.GetA()*M_PI/180.);
+ MC.Build();
+ if (!MC.IsDone()) {
+ StdFail_NotDone::Raise("Cylinder can't be computed from the given parameters");
+ }
+ aShape = MC.Shape();
+ }
if (aShape.IsNull()) return 0;
aFunction->SetValue(aShape);
* MakeCylinderRH
*/
//=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, double theH)
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, double theH, double theA)
{
SetErrorCode(KO);
aCI.SetR(theR);
aCI.SetH(theH);
+ aCI.SetA(theA);
//Compute the Cylinder value
try {
//Make a Python command
GEOM::TPythonDump(aFunction) << aCylinder
- << " = geompy.MakeCylinderRH(" << theR << ", " << theH << ")";
+ << " = geompy.MakeCylinderRH(" << theR << ", " << theH << ", " << theA << ")";
SetErrorCode(OK);
return aCylinder;
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEOM_Object) thePnt,
Handle(GEOM_Object) theVec,
- double theR, double theH)
+ double theR, double theH, double theA)
{
SetErrorCode(KO);
aCI.SetVector(aRefVec);
aCI.SetR(theR);
aCI.SetH(theH);
+ aCI.SetA(theA);
//Compute the Cylinder value
try {
//Make a Python command
GEOM::TPythonDump(aFunction) << aCylinder << " = geompy.MakeCylinder("
- << thePnt << ", " << theVec << ", " << theR << ", " << theH << ")";
+ << thePnt << ", " << theVec << ", " << theR << ", " << theH << ", " << theA << ")";
SetErrorCode(OK);
return aCylinder;
Handle(GEOM_Object) theVec,
double theR);
Standard_EXPORT Handle(GEOM_Object) MakeDiskR (double theR, int theOrientation);
- Standard_EXPORT Handle(GEOM_Object) MakeCylinderRH (double theR, double theH);
+ Standard_EXPORT Handle(GEOM_Object) MakeCylinderRH (double theR, double theH, double theA);
Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRH (Handle(GEOM_Object) thePnt,
Handle(GEOM_Object) theVec,
- double theR, double theH);
+ double theR, double theH, double theA);
Standard_EXPORT Handle(GEOM_Object) MakeConeR1R2H (double theR1, double theR2, double theH);
Standard_EXPORT Handle(GEOM_Object) MakeConePntVecR1R2H (Handle(GEOM_Object) thePnt,
//
#include "GEOM_Function.hxx"
-#define CYL_ARG_R 1
-#define CYL_ARG_H 2
-#define CYL_ARG_PNT 3
-#define CYL_ARG_VEC 4
+#define CYL_ARG_PNT 1
+#define CYL_ARG_VEC 2
+#define CYL_ARG_R 3
+#define CYL_ARG_H 4
+#define CYL_ARG_A 5
+
+
class GEOMImpl_ICylinder
{
void SetH(double theH) { _func->SetReal(CYL_ARG_H, theH); }
double GetH() { return _func->GetReal(CYL_ARG_H); }
+
+ void SetA(double theA) { _func->SetReal(CYL_ARG_A, theA); }
+
+ double GetA() { return _func->GetReal(CYL_ARG_A); }
void SetPoint(Handle(GEOM_Function) theRefPoint) { _func->SetReference(CYL_ARG_PNT, theRefPoint); }
#define DISK_THREE_PNT 2
#define DISK_R 3
-#define CYLINDER_R_H 1
-#define CYLINDER_PNT_VEC_R_H 2
+#define CYLINDER_R_H 1
+#define CYLINDER_PNT_VEC_R_H 2
#define CONE_R1_R2_H 1
#define CONE_PNT_VEC_R1_R2_H 2
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeCylinderRH (CORBA::Double theR,
- CORBA::Double theH)
+ CORBA::Double theH,
+ CORBA::Double theA)
{
GEOM::GEOM_Object_var aGEOMObject;
GetOperations()->SetNotDone();
//Create the Cylinder
- Handle(GEOM_Object) anObject = GetOperations()->MakeCylinderRH(theR, theH);
+ Handle(GEOM_Object) anObject = GetOperations()->MakeCylinderRH(theR, theH, theA);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeCylinderPntVecRH
(GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
- CORBA::Double theR, CORBA::Double theH)
+ CORBA::Double theR, CORBA::Double theH, CORBA::Double theA)
{
GEOM::GEOM_Object_var aGEOMObject;
if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
//Create the Cylinder
- Handle(GEOM_Object) anObject = GetOperations()->MakeCylinderPntVecRH(aPnt, aVec, theR, theH);
+ Handle(GEOM_Object) anObject = GetOperations()->MakeCylinderPntVecRH(aPnt, aVec, theR, theH, theA);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
CORBA::Short theOrientation);
GEOM::GEOM_Object_ptr MakeCylinderRH (CORBA::Double theR,
- CORBA::Double theH);
-
+ CORBA::Double theH,
+ CORBA::Double theA);
+
GEOM::GEOM_Object_ptr MakeCylinderPntVecRH (GEOM::GEOM_Object_ptr thePnt,
GEOM::GEOM_Object_ptr theVec,
CORBA::Double theR,
- CORBA::Double theH);
-
+ CORBA::Double theH,
+ CORBA::Double theA);
+
GEOM::GEOM_Object_ptr MakeConeR1R2H (CORBA::Double theR1,
CORBA::Double theR2,
CORBA::Double theH);
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCylinderPntVecRH (GEOM::GEOM_Object_ptr thePnt,
GEOM::GEOM_Object_ptr theAxis,
CORBA::Double theRadius,
- CORBA::Double theHeight)
+ CORBA::Double theHeight,
+ CORBA::Double theAngle)
{
beginService( " GEOM_Superv_i::MakeCylinderPntVecRH" );
MESSAGE("GEOM_Superv_i::MakeCylinderPntVecRH");
get3DPrimOp();
- GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeCylinderPntVecRH(thePnt, theAxis, theRadius, theHeight);
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeCylinderPntVecRH(thePnt, theAxis, theRadius, theHeight, theAngle);
endService( " GEOM_Superv_i::MakeCylinderPntVecRH" );
return anObj;
}
// MakeCylinderRH:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCylinderRH (CORBA::Double theR,
- CORBA::Double theH)
+ CORBA::Double theH,
+ CORBA::Double theA)
{
beginService( " GEOM_Superv_i::MakeCylinderRH" );
MESSAGE("GEOM_Superv_i::MakeCylinderRH");
get3DPrimOp();
- GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeCylinderRH(theR, theH);
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeCylinderRH(theR, theH, theA);
endService( " GEOM_Superv_i::MakeCylinderRH" );
return anObj;
}
GEOM::GEOM_Object_ptr MakeCylinderPntVecRH (GEOM::GEOM_Object_ptr thePnt,
GEOM::GEOM_Object_ptr theAxis,
CORBA::Double theRadius,
- CORBA::Double theHeight);
+ CORBA::Double theHeight,
+ CORBA::Double theAngle);
GEOM::GEOM_Object_ptr MakeCylinderRH (CORBA::Double theR,
- CORBA::Double theH);
+ CORBA::Double theH,
+ CORBA::Double theA);
GEOM::GEOM_Object_ptr MakeSphere (CORBA::Double theX,
CORBA::Double theY,
CORBA::Double theZ,
self._autoPublish(anObj, theName, "disk")
return anObj
- ## Create a cylinder with given base point, axis, radius and height.
+ ## Create a cylinder with given base point, axis, radius, height and angle (for a portion of cylinder).
# @param thePnt Central point of cylinder base.
# @param theAxis Cylinder axis.
# @param theR Cylinder radius.
# @param theH Cylinder height.
+ # @param theA Cylinder angle in radian.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @ref tui_creation_cylinder "Example"
@ManageTransactions("PrimOp")
- def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
+ def MakeCylinder(self, thePnt, theAxis, theR, theH, theA=2*math.pi, theName=None):
"""
- Create a cylinder with given base point, axis, radius and height.
+ Create a cylinder with given base point, axis, radius, height and angle (for a portion of cylinder).
Parameters:
thePnt Central point of cylinder base.
theAxis Cylinder axis.
theR Cylinder radius.
theH Cylinder height.
+ theA Cylinder angle in radian.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
New GEOM.GEOM_Object, containing the created cylinder.
"""
# Example: see GEOM_TestAll.py
- theR,theH,Parameters = ParseParameters(theR, theH)
- anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
+ theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
+ anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH, theA)
+
RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
anObj.SetParameters(Parameters)
self._autoPublish(anObj, theName, "cylinder")
return anObj
- ## Create a cylinder with given radius and height at
+ ## Create a cylinder with given radius, height and angle (for a portion of cylinder) at
# the origin of coordinate system. Axis of the cylinder
# will be collinear to the OZ axis of the coordinate system.
# @param theR Cylinder radius.
# @param theH Cylinder height.
+ # @param theA Cylinder angle in radian.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @ref tui_creation_cylinder "Example"
@ManageTransactions("PrimOp")
- def MakeCylinderRH(self, theR, theH, theName=None):
+ def MakeCylinderRH(self, theR, theH, theA=2*math.pi, theName=None):
"""
- Create a cylinder with given radius and height at
+ Create a cylinder with given radius, height and angle (for a portion of cylinder)at
the origin of coordinate system. Axis of the cylinder
will be collinear to the OZ axis of the coordinate system.
Parameters:
theR Cylinder radius.
theH Cylinder height.
+ theA Cylinder angle in radian.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
New GEOM.GEOM_Object, containing the created cylinder.
"""
# Example: see GEOM_TestAll.py
- theR,theH,Parameters = ParseParameters(theR, theH)
- anObj = self.PrimOp.MakeCylinderRH(theR, theH)
+ theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
+ anObj = self.PrimOp.MakeCylinderRH(theR, theH, theA)
+
RaiseIfFailed("MakeCylinderRH", self.PrimOp)
anObj.SetParameters(Parameters)
self._autoPublish(anObj, theName, "cylinder")
mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
mainFrame()->RadioButton3->close();
- GroupPoints = new DlgRef_2Sel2Spin(centralWidget());
+ GroupPoints = new DlgRef_2Sel3Spin1Check(centralWidget());
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT"));
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS"));
GroupPoints->TextLabel4->setText(tr("GEOM_HEIGHT"));
+ GroupPoints->TextLabel5->setText(tr("GEOM_ANGLE"));
+ GroupPoints->checkBox->setText(tr(""));
GroupPoints->PushButton1->setIcon(image2);
GroupPoints->PushButton2->setIcon(image2);
+ GroupPoints->SpinBox_DZ->setDisabled(true);
- GroupDimensions = new DlgRef_2Spin(centralWidget());
+ GroupDimensions = new DlgRef_3Spin1CheckCyl(centralWidget());
GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS"));
GroupDimensions->TextLabel2->setText(tr("GEOM_HEIGHT"));
-
+ GroupDimensions->TextLabel3->setText(tr("GEOM_ANGLE"));
+ GroupDimensions->checkBox->setText(tr(""));
+ GroupDimensions->SpinBox_DZ->setDisabled(true);
+
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
layout->setMargin(0); layout->setSpacing(6);
layout->addWidget(GroupPoints);
// min, max, step and decimals for spin boxes & initial values
initSpinBox(GroupPoints->SpinBox_DX, 0.00001, COORD_MAX, step, "length_precision" );
initSpinBox(GroupPoints->SpinBox_DY, 0.00001, COORD_MAX, step, "length_precision" );
+ initSpinBox(GroupPoints->SpinBox_DZ, 0.00001, 360., step, "length_precision" );
initSpinBox(GroupDimensions->SpinBox_DX, 0.00001, COORD_MAX, step, "length_precision" );
initSpinBox(GroupDimensions->SpinBox_DY, 0.00001, COORD_MAX, step, "length_precision" );
+ initSpinBox(GroupDimensions->SpinBox_DZ, 0.00001, 360., step, "length_precision" );
+
// init variables
myEditCurrentArgument = GroupPoints->LineEdit1;
myPoint.nullify();
myDir.nullify();
- double aRadius(100.0), aHeight(300.0);
+ double aRadius(100.0), aHeight(300.0), aAngle(360.);
GroupPoints->SpinBox_DX->setValue(aRadius);
GroupPoints->SpinBox_DY->setValue(aHeight);
+ GroupPoints->SpinBox_DZ->setValue(aAngle);
GroupDimensions->SpinBox_DX->setValue(aRadius);
GroupDimensions->SpinBox_DY->setValue(aHeight);
+ GroupDimensions->SpinBox_DZ->setValue(aAngle);
// signals and slots connections
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+ connect(GroupPoints->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+ connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
+
+ connect(GroupPoints->checkBox, SIGNAL(toggled(bool)), this, SLOT(ActivateAngle()));
+ connect(GroupDimensions->checkBox, SIGNAL(toggled(bool)), this, SLOT(ActivateAngle()));
initName(tr("GEOM_CYLINDER"));
{
GroupPoints->SpinBox_DX->setSingleStep(step);
GroupPoints->SpinBox_DY->setSingleStep(step);
+ GroupPoints->SpinBox_DZ->setSingleStep(step);
GroupDimensions->SpinBox_DX->setSingleStep(step);
GroupDimensions->SpinBox_DY->setSingleStep(step);
+ GroupDimensions->SpinBox_DZ->setSingleStep(step);
}
//=================================================================================
{
ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) &&
GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) &&
+ GroupPoints->SpinBox_DZ->isValid( msg, !IsPreview() ) &&
myPoint && myDir;
}
else if( getConstructorId() == 1 )
{
ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) &&
- GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() );
+ GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) &&
+ GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() );
}
ok = qAbs( getHeight() ) > Precision::Confusion() && ok;
+ ok = qAbs( getRadius() ) > Precision::Confusion() && ok;
return ok;
}
bool PrimitiveGUI_CylinderDlg::execute (ObjectList& objects)
{
bool res = false;
-
+ bool BAngle = false;
GEOM::GEOM_Object_var anObj;
GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
switch (getConstructorId()) {
case 0:
+ BAngle = GroupPoints->checkBox->isChecked();
if ( myPoint && myDir ) {
- anObj = anOper->MakeCylinderPntVecRH(myPoint.get(), myDir.get(), getRadius(), getHeight());
+ if(!BAngle) anObj = anOper->MakeCylinderPntVecRH(myPoint.get(), myDir.get(), getRadius(), getHeight(), 360.);
+ else anObj = anOper->MakeCylinderPntVecRH(myPoint.get(), myDir.get(), getRadius(), getHeight(), getAngle());
if (!anObj->_is_nil() && !IsPreview())
{
QStringList aParameters;
aParameters << GroupPoints->SpinBox_DX->text();
aParameters << GroupPoints->SpinBox_DY->text();
+ aParameters << GroupPoints->SpinBox_DZ->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
res = true;
}
break;
case 1:
- anObj = anOper->MakeCylinderRH(getRadius(), getHeight());
+ BAngle = GroupDimensions->checkBox->isChecked();
+ if(!BAngle)anObj = anOper->MakeCylinderRH(getRadius(), getHeight(), 360.);
+ else anObj = anOper->MakeCylinderRH(getRadius(), getHeight(), getAngle());
if (!anObj->_is_nil() && !IsPreview())
{
QStringList aParameters;
aParameters << GroupDimensions->SpinBox_DX->text();
aParameters << GroupDimensions->SpinBox_DY->text();
+ aParameters << GroupDimensions->SpinBox_DZ->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
res = true;
return 0;
}
+//=================================================================================
+// function : getAngle()
+// purpose :
+//=================================================================================
+double PrimitiveGUI_CylinderDlg::getAngle() const
+{
+ int aConstructorId = getConstructorId();
+ if (aConstructorId == 0)
+ return GroupPoints->SpinBox_DZ->value();
+ else if (aConstructorId == 1)
+ return GroupDimensions->SpinBox_DZ->value();
+ return 0;
+}
+
//=================================================================================
// function : addSubshapeToStudy
// purpose : virtual method to add new SubObjects if local selection
GEOMBase::PublishSubObject( myDir.get() );
}
}
+
+//=================================================================================
+// function : ActivateAngle()
+// purpose : enable the
+//=================================================================================
+void PrimitiveGUI_CylinderDlg::ActivateAngle()
+{
+ int aConstructorId = getConstructorId();
+ if (aConstructorId == 0){
+ GroupPoints->SpinBox_DZ->setEnabled( GroupPoints->checkBox->isChecked() );
+ processPreview();
+ }
+ else if (aConstructorId == 1){
+ GroupDimensions->SpinBox_DZ->setEnabled( GroupDimensions->checkBox->isChecked() );
+ processPreview();
+ }
+}
\ No newline at end of file
#include "GEOMBase_Skeleton.h"
#include "GEOM_GenericObjPtr.h"
-class DlgRef_2Sel2Spin;
-class DlgRef_2Spin;
+class DlgRef_2Sel3Spin1Check;
+class DlgRef_3Spin1CheckCyl;
//=================================================================================
// class : PrimitiveGUI_CylinderDlg
void enterEvent( QEvent* );
double getRadius() const;
double getHeight() const;
+ double getAngle() const;
private:
GEOM::GeomObjPtr myPoint, myDir;
// to initialize the first selection field with a selected object on the dialog creation
bool myInitial;
- DlgRef_2Sel2Spin* GroupPoints;
- DlgRef_2Spin* GroupDimensions;
+ DlgRef_2Sel3Spin1Check* GroupPoints;
+ DlgRef_3Spin1CheckCyl* GroupDimensions;
private slots:
void ClickOnOk();
void ConstructorsClicked( int );
void ValueChangedInSpinBox();
void SetDoubleSpinBoxStep( double );
+ void ActivateAngle();
};
#endif // PRIMITIVEGUI_CYLINDERDLG_H