IMPs 21044, 21057, 21067

This commit is contained in:
jfa 2011-03-18 15:05:50 +00:00
parent 1fde2f4863
commit 63db5e2dd5
41 changed files with 2542 additions and 1591 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -1196,6 +1196,11 @@ module GEOM
GEOM_Object MakePrismVecH2Ways (in GEOM_Object theBase,
in GEOM_Object theVec,
in double theH);
/* The Same as MakePrismVecH but with scaling */
GEOM_Object MakePrismVecHWithScaling (in GEOM_Object theBase,
in GEOM_Object theVec,
in double theH,
in double theScaleFactor);
/*!
* Create a shape by extrusion of the base shape along a vector, defined by two points.
@ -1211,6 +1216,11 @@ module GEOM
GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase,
in GEOM_Object thePoint1,
in GEOM_Object thePoint2);
/* The Same as MakePrismTwoPnt but with scaling */
GEOM_Object MakePrismTwoPntWithScaling (in GEOM_Object theBase,
in GEOM_Object thePoint1,
in GEOM_Object thePoint2,
in double theScaleFactor);
/*!
* Create a shape by extrusion of the base shape along a vector, defined by DX DY DZ.
@ -1223,6 +1233,10 @@ module GEOM
/* The same prism but in two directions forward&backward */
GEOM_Object MakePrismDXDYDZ2Ways (in GEOM_Object theBase,
in double theDX, in double theDY, in double theDZ);
/* The Same as MakePrismDXDYDZ but with scaling */
GEOM_Object MakePrismDXDYDZWithScaling (in GEOM_Object theBase,
in double theDX, in double theDY, in double theDZ,
in double theScaleFactor);
/*!
* Create a shape by extrusion of the base shape along
@ -2484,25 +2498,32 @@ module GEOM
/*!
* Create a polyline on the set of points.
* \param thePoints Sequence of points for the polyline.
* \param theIsClosed If TRUE, build a closed wire.
* \return New GEOM_Object, containing the created polyline.
*/
GEOM_Object MakePolyline (in ListOfGO thePoints);
GEOM_Object MakePolyline (in ListOfGO thePoints,
in boolean theIsClosed);
/*!
* Create bezier curve on the set of points.
* \param thePoints Sequence of points for the bezier curve.
* \param theIsClosed If TRUE, build a closed curve.
* \return New GEOM_Object, containing the created bezier curve.
*/
GEOM_Object MakeSplineBezier (in ListOfGO thePoints);
GEOM_Object MakeSplineBezier (in ListOfGO thePoints,
in boolean theIsClosed);
/*!
* Create B-Spline curve on the set of points.
* \param thePoints Sequence of points for the B-Spline curve.
* \param theIsClosed If TRUE, build a closed curve.
* \param theDoReordering If TRUE, the algo does not follow the order of
* \a thePoints but searches for the closest vertex.
* \return New GEOM_Object, containing the created B-Spline curve.
*/
GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints,
in boolean theIsClosed);
in boolean theIsClosed,
in boolean theDoReordering);
/*!
* Create a sketcher (wire or face), following the textual description,

View File

@ -508,10 +508,13 @@ module GEOM
GEOM_Object MakeArcOfEllipse (in GEOM_Object theCenter,
in GEOM_Object thePnt1,
in GEOM_Object thePnt2) ;
GEOM_Object MakePolyline (in GEOM_List thePoints) ;
GEOM_Object MakeSplineBezier (in GEOM_List thePoints) ;
GEOM_Object MakePolyline (in GEOM_List thePoints,
in boolean theIsClosed) ;
GEOM_Object MakeSplineBezier (in GEOM_List thePoints,
in boolean theIsClosed) ;
GEOM_Object MakeSplineInterpolation (in GEOM_List thePoints,
in boolean theIsClosed) ;
in boolean theIsClosed,
in boolean theDoReordering) ;
GEOM_Object MakeSketcher (in string theCommand,
in GEOM_List theWorkingPlane) ;

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : BasicGUI_CurveDlg.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BasicGUI_CurveDlg.h"
#include <DlgRef.h>
@ -70,7 +69,7 @@ BasicGUI_CurveDlg::BasicGUI_CurveDlg( GeometryGUI* theGeometryGUI, QWidget* pare
mainFrame()->RadioButton2->setIcon( image3 );
mainFrame()->RadioButton3->setIcon( image2 );
GroupPoints = new DlgRef_1Sel1Check( centralWidget() );
GroupPoints = new DlgRef_1Sel3Check( centralWidget() );
GroupPoints->GroupBox1->setTitle( tr( "GEOM_NODES" ) );
GroupPoints->TextLabel1->setText( tr( "GEOM_POINTS" ) );
@ -81,7 +80,13 @@ BasicGUI_CurveDlg::BasicGUI_CurveDlg( GeometryGUI* theGeometryGUI, QWidget* pare
GroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
GroupPoints->CheckButton1->setChecked(false);
GroupPoints->CheckButton1->hide();
//GroupPoints->CheckButton1->hide();
GroupPoints->CheckButton2->setText( tr( "GEOM_IS_REORDER" ) );
GroupPoints->CheckButton2->setChecked(false);
GroupPoints->CheckButton2->hide();
GroupPoints->CheckButton3->hide();
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
@ -121,14 +126,15 @@ void BasicGUI_CurveDlg::Init()
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog( ) ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( GroupPoints->CheckButton1,SIGNAL( toggled(bool) ), this, SLOT( CheckButtonToggled() ) );
connect( GroupPoints->CheckButton1, SIGNAL( toggled(bool) ), this, SLOT( CheckButtonToggled() ) );
connect( GroupPoints->CheckButton2, SIGNAL( toggled(bool) ), this, SLOT( CheckButtonToggled() ) );
connect( myGeomGUI->getApp()->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
@ -147,10 +153,21 @@ void BasicGUI_CurveDlg::ConstructorsClicked( int id )
QString aTitle = tr( id == 0 ? "GEOM_POLYLINE" : id == 1 ? "GEOM_BEZIER" : "GEOM_INTERPOL" );
mainFrame()->GroupConstructors->setTitle( aTitle );
if (id == 2) // b-spline
GroupPoints->CheckButton1->show();
else
GroupPoints->CheckButton1->hide();
if (id == 0) { // polyline (wire)
//GroupPoints->CheckButton1->hide();
GroupPoints->CheckButton1->setText( tr( "GEOM_BUILD_CLOSED_WIRE" ) );
GroupPoints->CheckButton2->hide();
}
else if (id == 1) { // bezier
//GroupPoints->CheckButton1->hide();
GroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
GroupPoints->CheckButton2->hide();
}
else { // b-spline
//GroupPoints->CheckButton1->show();
GroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
GroupPoints->CheckButton2->show();
}
myPoints.clear();
@ -323,15 +340,16 @@ bool BasicGUI_CurveDlg::execute( ObjectList& objects )
switch ( getConstructorId() ) {
case 0 :
anObj = anOper->MakePolyline( points.in() );
anObj = anOper->MakePolyline( points.in(), GroupPoints->CheckButton1->isChecked() );
res = true;
break;
case 1 :
anObj = anOper->MakeSplineBezier( points.in() );
anObj = anOper->MakeSplineBezier( points.in(), GroupPoints->CheckButton1->isChecked() );
res = true;
break;
case 2 :
anObj = anOper->MakeSplineInterpolation( points.in(), GroupPoints->CheckButton1->isChecked() );
anObj = anOper->MakeSplineInterpolation( points.in(), GroupPoints->CheckButton1->isChecked(),
GroupPoints->CheckButton2->isChecked() );
res = true;
break;
}

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : BasicGUI_CurveDlg.h
// Author : Alexander SLADKOV, Open CASCADE S.A.S. (alexander.sladkov@opencascade.com)
//
#ifndef BASICGUI_CURVEDLG_H
#define BASICGUI_CURVEDLG_H
@ -32,7 +31,7 @@
#include <list>
class DlgRef_1Sel1Check;
class DlgRef_1Sel3Check;
//=================================================================================
// class : BasicGUI_CurveDlg
@ -58,7 +57,7 @@ private:
void enterEvent( QEvent* );
private:
DlgRef_1Sel1Check* GroupPoints;
DlgRef_1Sel3Check* GroupPoints;
QList<GEOM::GeomObjPtr> myPoints;
private slots:

View File

@ -15,11 +15,10 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : DlgRef.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#include "DlgRef.h"
//////////////////////////////////////////
@ -190,6 +189,20 @@ DlgRef_1Sel3Spin1Check::~DlgRef_1Sel3Spin1Check()
{
}
//////////////////////////////////////////
// DlgRef_1Sel4Spin2Check
//////////////////////////////////////////
DlgRef_1Sel4Spin2Check::DlgRef_1Sel4Spin2Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel4Spin2Check::~DlgRef_1Sel4Spin2Check()
{
}
//////////////////////////////////////////
// DlgRef_1Sel4Spin
//////////////////////////////////////////
@ -386,6 +399,20 @@ DlgRef_2Sel2Spin1Check::~DlgRef_2Sel2Spin1Check()
{
}
//////////////////////////////////////////
// DlgRef_2Sel2Spin3Check
//////////////////////////////////////////
DlgRef_2Sel2Spin3Check::DlgRef_2Sel2Spin3Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel2Spin3Check::~DlgRef_2Sel2Spin3Check()
{
}
//////////////////////////////////////////
// DlgRef_2Sel2Spin
//////////////////////////////////////////

View File

@ -15,11 +15,10 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : DlgRef.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#ifndef GEOM_DLGREF_H
#define GEOM_DLGREF_H
@ -227,6 +226,22 @@ public:
~DlgRef_1Sel3Spin1Check();
};
//////////////////////////////////////////
// DlgRef_1Sel4Spin2Check
//////////////////////////////////////////
#include "ui_DlgRef_1Sel4Spin2Check_QTD.h"
class DLGREF_EXPORT DlgRef_1Sel4Spin2Check : public QWidget,
public Ui::DlgRef_1Sel4Spin2Check_QTD
{
Q_OBJECT
public:
DlgRef_1Sel4Spin2Check( QWidget* = 0, Qt::WindowFlags = 0 );
~DlgRef_1Sel4Spin2Check();
};
//////////////////////////////////////////
// DlgRef_1Sel4Spin
//////////////////////////////////////////
@ -451,6 +466,22 @@ public:
~DlgRef_2Sel2Spin1Check();
};
//////////////////////////////////////////
// DlgRef_2Sel2Spin3Check
//////////////////////////////////////////
#include "ui_DlgRef_2Sel2Spin3Check_QTD.h"
class DLGREF_EXPORT DlgRef_2Sel2Spin3Check : public QWidget,
public Ui::DlgRef_2Sel2Spin3Check_QTD
{
Q_OBJECT
public:
DlgRef_2Sel2Spin3Check( QWidget* = 0, Qt::WindowFlags = 0 );
~DlgRef_2Sel2Spin3Check();
};
//////////////////////////////////////////
// DlgRef_2Sel2Spin
//////////////////////////////////////////

View File

@ -15,7 +15,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
TEMPLATE = lib
TARGET = DlgRef
@ -63,8 +62,10 @@ HEADERS += DlgRef_2Sel2Spin_QTD.h
HEADERS += DlgRef_2Sel3Spin_QTD.h
HEADERS += DlgRef_1Sel1Spin1Check_QTD.h
HEADERS += DlgRef_1Sel3Spin1Check_QTD.h
HEADERS += DlgRef_1Sel4Spin2Check_QTD.h
HEADERS += DlgRef_2Sel1Spin2Check_QTD.h
HEADERS += DlgRef_2Sel2Spin1Check_QTD.h
HEADERS += DlgRef_2Sel2Spin3Check_QTD.h
HEADERS += DlgRef_2Sel4Spin1Check_QTD.h
HEADERS += DlgRef_3Sel4Spin2Check_QTD.h
HEADERS += DlgRef_4Sel1List_QTD.h
@ -89,8 +90,10 @@ HEADERS += DlgRef_2Sel2Spin.h
HEADERS += DlgRef_2Sel3Spin.h
HEADERS += DlgRef_1Sel1Spin1Check.h
HEADERS += DlgRef_1Sel3Spin1Check.h
HEADERS += DlgRef_1Sel4Spin2Check.h
HEADERS += DlgRef_2Sel1Spin2Check.h
HEADERS += DlgRef_2Sel2Spin1Check.h
HEADERS += DlgRef_2Sel2Spin3Check.h
HEADERS += DlgRef_2Sel4Spin1Check.h
HEADERS += DlgRef_3Sel4Spin2Check.h
HEADERS += DlgRef_3Sel3Spin1Check.h
@ -117,8 +120,10 @@ SOURCES += DlgRef_2Sel2Spin.cxx
SOURCES += DlgRef_2Sel3Spin.cxx
SOURCES += DlgRef_1Sel1Spin1Check.cxx
SOURCES += DlgRef_1Sel3Spin1Check.cxx
SOURCES += DlgRef_1Sel4Spin2Check.cxx
SOURCES += DlgRef_2Sel1Spin2Check.cxx
SOURCES += DlgRef_2Sel2Spin1Check.cxx
SOURCES += DlgRef_2Sel2Spin3Check.cxx
SOURCES += DlgRef_2Sel4Spin1Check.cxx
SOURCES += DlgRef_3Sel4Spin2Check.cxx
SOURCES += DlgRef_3Sel3Spin1Check.cxx

View File

@ -0,0 +1,211 @@
<ui version="4.0" >
<class>DlgRef_1Sel4Spin2Check_QTD</class>
<widget class="QWidget" name="DlgRef_1Sel4Spin2Check_QTD" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>156</width>
<height>120</height>
</rect>
</property>
<property name="windowTitle" >
<string/>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QGroupBox" name="GroupBox1" >
<property name="title" >
<string/>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="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="1" >
<widget class="QPushButton" name="PushButton1" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QLineEdit" name="LineEdit1" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="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="1" column="1" colspan="2" >
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="2" column="0" >
<widget class="QLabel" name="TextLabel3" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="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="2" column="1" colspan="2" >
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
<item row="3" column="0" >
<widget class="QLabel" name="TextLabel4" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>TL4</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2" >
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ" />
</item>
<item row="4" column="0" >
<widget class="QLabel" name="TextLabel5" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>TL5</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2" >
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_SC" />
</item>
<item row="5" column="0" colspan="3" >
<widget class="QCheckBox" name="CheckBox1" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="6" column="0" colspan="3" >
<widget class="QCheckBox" name="CheckBox2" >
<property name="text" >
<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>PushButton1</tabstop>
<tabstop>LineEdit1</tabstop>
<tabstop>SpinBox_DX</tabstop>
<tabstop>SpinBox_DY</tabstop>
<tabstop>SpinBox_DZ</tabstop>
<tabstop>SpinBox_SC</tabstop>
<tabstop>CheckBox1</tabstop>
<tabstop>CheckBox2</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,208 @@
<ui version="4.0" >
<class>DlgRef_2Sel2Spin3Check_QTD</class>
<widget class="QWidget" name="DlgRef_2Sel2Spin3Check_QTD" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>156</width>
<height>197</height>
</rect>
</property>
<property name="windowTitle" >
<string/>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QGroupBox" name="GroupBox1" >
<property name="title" >
<string/>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="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="1" >
<widget class="QPushButton" name="PushButton1" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QLineEdit" name="LineEdit1" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="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="1" column="1" >
<widget class="QPushButton" name="PushButton2" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QLineEdit" name="LineEdit2" />
</item>
<item row="2" column="0" >
<widget class="QLabel" name="TextLabel3" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="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="2" column="1" colspan="2" >
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="3" column="0" >
<widget class="QLabel" name="TextLabel4" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>TL4</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2" >
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
<item row="4" column="0" colspan="3" >
<widget class="QCheckBox" name="CheckBox1" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="5" column="0" colspan="3" >
<widget class="QCheckBox" name="CheckBox2" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="6" column="0" colspan="3" >
<widget class="QCheckBox" name="CheckBox3" >
<property name="text" >
<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>PushButton1</tabstop>
<tabstop>LineEdit1</tabstop>
<tabstop>PushButton2</tabstop>
<tabstop>LineEdit2</tabstop>
<tabstop>SpinBox_DX</tabstop>
<tabstop>SpinBox_DY</tabstop>
<tabstop>CheckBox1</tabstop>
<tabstop>CheckBox2</tabstop>
<tabstop>CheckBox3</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -15,13 +15,12 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# GEOM DLGREF :
# File : Makefile.am
# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
# Package : DlgRef
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# Libraries targets
@ -48,6 +47,7 @@ UIC_FILES = \
ui_DlgRef_1Sel3Check_QTD.h \
ui_DlgRef_1Sel3Spin_QTD.h \
ui_DlgRef_1Sel3Spin1Check_QTD.h \
ui_DlgRef_1Sel4Spin2Check_QTD.h \
ui_DlgRef_1Sel4Spin_QTD.h \
ui_DlgRef_1Sel5Spin1Check_QTD.h \
ui_DlgRef_1Sel5Spin_QTD.h \
@ -62,6 +62,7 @@ UIC_FILES = \
ui_DlgRef_2Sel1SpinInt_QTD.h \
ui_DlgRef_2Sel2List_QTD.h \
ui_DlgRef_2Sel2Spin1Check_QTD.h \
ui_DlgRef_2Sel2Spin3Check_QTD.h \
ui_DlgRef_2Sel2Spin_QTD.h \
ui_DlgRef_2Sel3Spin2Rb_QTD.h \
ui_DlgRef_2Sel3Spin_QTD.h \

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "GEOM_PythonDump.hxx"
@ -52,6 +51,15 @@ namespace GEOM
}
}
TPythonDump& TPythonDump::operator<< (bool theArg)
{
if (theArg)
myStream << "True";
else
myStream << "False";
return *this;
}
TPythonDump& TPythonDump::operator<< (long int theArg)
{
myStream<<theArg;

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOM_PYTHONDUMP_HXX_
#define _GEOM_PYTHONDUMP_HXX_
@ -44,8 +43,9 @@ namespace GEOM
Standard_EXPORT TPythonDump (Handle(GEOM_Function)& theFunction, bool theAppend=false);
Standard_EXPORT virtual ~TPythonDump();
// operator TCollection_AsciiString () const;
//operator TCollection_AsciiString () const;
Standard_EXPORT TPythonDump& operator<< (bool theArg);
Standard_EXPORT TPythonDump& operator<< (long int theArg);
Standard_EXPORT TPythonDump& operator<< (int theArg);
Standard_EXPORT TPythonDump& operator<< (double theArg);

View File

@ -573,6 +573,10 @@ Please, select face, shell or solid and try again</translation>
<source>GEOM_EXTRUSION_TITLE</source>
<translation>Construction by Extrusion</translation>
</message>
<message>
<source>GEOM_SCALE_PRISM</source>
<translation>Scale the face opposite to the base</translation>
</message>
<message>
<source>GEOM_FACE</source>
<translation>Face</translation>
@ -4218,6 +4222,14 @@ Otherwise the dimensions will be kept without modifications.</translation>
<source>GEOM_IS_CLOSED</source>
<translation>Build a closed edge</translation>
</message>
<message>
<source>GEOM_BUILD_CLOSED_WIRE</source>
<translation>Build a closed wire</translation>
</message>
<message>
<source>GEOM_IS_REORDER</source>
<translation>Reorder vertices taking into account distances</translation>
</message>
</context>
<context>
<name>BasicGUI_EllipseDlg</name>

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -68,6 +67,8 @@
#include <GEOMImpl_IPipeShellSect.hxx>
#include <GEOMImpl_IPipeBiNormal.hxx>
#include <Precision.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
@ -921,7 +922,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusPntVecRR
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theVec,
double theH)
double theH, double theScaleFactor)
{
SetErrorCode(KO);
@ -948,6 +949,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec
aCI.SetBase(aRefBase);
aCI.SetVector(aRefVec);
aCI.SetH(theH);
aCI.SetScale(theScaleFactor);
//Compute the Prism value
try {
@ -967,8 +969,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec
}
//Make a Python command
GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismVecH("
<< theBase << ", " << theVec << ", " << theH << ")";
GEOM::TPythonDump pd (aFunction);
pd << aPrism << " = geompy.MakePrismVecH(" << theBase << ", " << theVec << ", " << theH;
if (theScaleFactor > Precision::Confusion())
pd << ", " << theScaleFactor << ")";
else
pd << ")";
SetErrorCode(OK);
return aPrism;
@ -1041,7 +1047,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH2Ways (Handle(GEOM_
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
(Handle(GEOM_Object) theBase,
Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2)
Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2,
double theScaleFactor)
{
SetErrorCode(KO);
@ -1069,6 +1076,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
aCI.SetBase(aRefBase);
aCI.SetFirstPoint(aRefPnt1);
aCI.SetLastPoint(aRefPnt2);
aCI.SetScale(theScaleFactor);
//Compute the Prism value
try {
@ -1088,8 +1096,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
}
//Make a Python command
GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrism("
<< theBase << ", " << thePoint1 << ", " << thePoint2 << ")";
GEOM::TPythonDump pd (aFunction);
pd << aPrism << " = geompy.MakePrism(" << theBase << ", " << thePoint1 << ", " << thePoint2;
if (theScaleFactor > Precision::Confusion())
pd << ", " << theScaleFactor << ")";
else
pd << ")";
SetErrorCode(OK);
return aPrism;
@ -1162,7 +1174,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt2Ways
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ
(Handle(GEOM_Object) theBase, double theDX, double theDY, double theDZ)
(Handle(GEOM_Object) theBase, double theDX, double theDY, double theDZ,
double theScaleFactor)
{
SetErrorCode(KO);
@ -1189,6 +1202,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ
aCI.SetDX(theDX);
aCI.SetDY(theDY);
aCI.SetDZ(theDZ);
aCI.SetScale(theScaleFactor);
//Compute the Prism value
try {
@ -1207,8 +1221,13 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ
}
//Make a Python command
GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismDXDYDZ("
<< theBase << ", " << theDX << ", " << theDY << ", " << theDZ << ")";
GEOM::TPythonDump pd (aFunction);
pd << aPrism << " = geompy.MakePrismDXDYDZ("
<< theBase << ", " << theDX << ", " << theDY << ", " << theDZ;
if (theScaleFactor > Precision::Confusion())
pd << ", " << theScaleFactor << ")";
else
pd << ")";
SetErrorCode(OK);
return aPrism;
@ -1510,7 +1529,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
pd << aFilling << " = geompy.MakeFilling("
<< theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
<< theTol2D << ", " << theTol3D << ", " << theNbIter << ", ";
if( theMethod==1 ) pd << "GEOM.FOM_UseOri";
if( theMethod==1 ) pd << "GEOM.FOM_UseOri";
else if( theMethod==2 ) pd << "GEOM.FOM_AutoCorrect";
else pd << "GEOM.FOM_Default";
if(isApprox)
@ -1538,13 +1557,13 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
return anObj;
Standard_Integer nbObj = theSeqSections->Length();
if (!nbObj)
if (!nbObj)
return anObj;
//Add a new ThruSections object
Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GetDocID(), GEOM_THRUSECTIONS);
//Add a new ThruSections function
int aTypeFunc = (theRuled ? THRUSECTIONS_RULED : THRUSECTIONS_SMOOTHED);
@ -1565,7 +1584,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
Handle(Standard_Transient) anItem = theSeqSections->Value(i);
if(anItem.IsNull())
continue;
Handle(GEOM_Object) aSectObj = Handle(GEOM_Object)::DownCast(anItem);
if(!aSectObj.IsNull())
{
@ -1607,7 +1626,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
Handle(Standard_Transient) anItem = theSeqSections->Value(i);
if(anItem.IsNull())
continue;
Handle(GEOM_Object) aSectObj = Handle(GEOM_Object)::DownCast(anItem);
if(!aSectObj.IsNull()) {
pyDump<< aSectObj;
@ -1615,13 +1634,11 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
pyDump<<", ";
}
}
pyDump<< "],"<<theModeSolid << "," << thePreci <<","<< theRuled <<")";
SetErrorCode(OK);
return aThruSect;
}
@ -1643,14 +1660,14 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
return anObj;
Standard_Integer nbBases = theBases->Length();
if (!nbBases)
return anObj;
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
//Add a new Pipe function
Handle(GEOM_Function) aFunction =
@ -1675,7 +1692,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
Handle(Standard_Transient) anItem = theBases->Value(i);
if(anItem.IsNull())
continue;
Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
if(aBase.IsNull())
continue;
@ -1687,7 +1704,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
if(anItemLoc.IsNull())
continue;
Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
if(aLoc.IsNull())
continue;
@ -1707,7 +1724,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
aCI.SetPath(aRefPath);
aCI.SetWithContactMode(theWithContact);
aCI.SetWithCorrectionMode(theWithCorrections);
//Compute the Pipe value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
@ -1733,38 +1750,35 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
Handle(Standard_Transient) anItem = theBases->Value(i);
if(anItem.IsNull())
continue;
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
pyDump<<", ";
}
}
pyDump<< "], [";
for(i =1 ; i <= nbLocs; i++) {
Handle(Standard_Transient) anItem = theLocations->Value(i);
if(anItem.IsNull())
continue;
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbLocs)
pyDump<<", ";
}
}
}
pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
SetErrorCode(OK);
return aPipeDS;
}
@ -1787,17 +1801,17 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
return anObj;
Standard_Integer nbBases = theBases->Length();
if (!nbBases)
return anObj;
Standard_Integer nbSubBases = (theSubBases.IsNull() ? 0 :theSubBases->Length());
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
//Add a new Pipe function
Handle(GEOM_Function) aFunction =
@ -1869,7 +1883,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
aCI.SetPath(aRefPath);
aCI.SetWithContactMode(theWithContact);
aCI.SetWithCorrectionMode(theWithCorrections);
//Compute the Pipe value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
@ -1895,48 +1909,46 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
Handle(Standard_Transient) anItem = theBases->Value(i);
if(anItem.IsNull())
continue;
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
pyDump<<", ";
}
}
pyDump<< "], [";
for(i =1 ; i <= nbSubBases; i++) {
Handle(Standard_Transient) anItem = theSubBases->Value(i);
if(anItem.IsNull())
continue;
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
pyDump<<", ";
}
}
pyDump<< "], [";
for(i =1 ; i <= nbLocs; i++) {
Handle(Standard_Transient) anItem = theLocations->Value(i);
if(anItem.IsNull())
continue;
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbLocs)
pyDump<<", ";
}
}
}
pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
@ -1961,15 +1973,15 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
return anObj;
Standard_Integer nbBases = theBases->Length();
if (!nbBases)
return anObj;
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
//Add a new Pipe function
Handle(GEOM_Function) aFunction =
@ -2018,7 +2030,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
aCI.SetBases(aSeqBases);
aCI.SetLocations(aSeqLocs);
//Compute the Pipe value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
@ -2044,31 +2056,30 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
Handle(Standard_Transient) anItem = theBases->Value(i);
if(anItem.IsNull())
continue;
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
pyDump<<", ";
}
}
pyDump<< "], [";
for(i =1 ; i <= nbLocs; i++) {
Handle(Standard_Transient) anItem = theLocations->Value(i);
if(anItem.IsNull())
continue;
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbLocs)
pyDump<<", ";
}
}
}
pyDump<< "])";
@ -2137,4 +2148,3 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Han
SetErrorCode(OK);
return aPipe;
}

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOMImpl_I3DPrimOperations_HXX_
#define _GEOMImpl_I3DPrimOperations_HXX_
@ -68,31 +67,34 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
double theRMajor, double theRMinor);
Standard_EXPORT Handle(GEOM_Object) MakePrismVecH (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theVec, double theH);
Handle(GEOM_Object) theVec,
double theH, double theScaleFactor = -1.0);
Standard_EXPORT Handle(GEOM_Object) MakePrismVecH2Ways (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theVec, double theH);
Handle(GEOM_Object) theVec, double theH);
Standard_EXPORT Handle(GEOM_Object) MakePrismTwoPnt (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) thePoint1,
Handle(GEOM_Object) thePoint2);
Handle(GEOM_Object) thePoint1,
Handle(GEOM_Object) thePoint2,
double theScaleFactor = -1.0);
Standard_EXPORT Handle(GEOM_Object) MakePrismTwoPnt2Ways (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) thePoint1,
Handle(GEOM_Object) thePoint2);
Handle(GEOM_Object) thePoint1,
Handle(GEOM_Object) thePoint2);
Standard_EXPORT Handle(GEOM_Object) MakePrismDXDYDZ (Handle(GEOM_Object) theBase,
double theDX, double theDY, double theDZ);
double theDX, double theDY, double theDZ,
double theScaleFactor = -1.0);
Standard_EXPORT Handle(GEOM_Object) MakePrismDXDYDZ2Ways (Handle(GEOM_Object) theBase,
double theDX, double theDY, double theDZ);
double theDX, double theDY, double theDZ);
Standard_EXPORT Handle(GEOM_Object) MakePipe (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) thePath);
Handle(GEOM_Object) thePath);
Standard_EXPORT Handle(GEOM_Object) MakeRevolutionAxisAngle (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theAxis,
double theAngle);
Handle(GEOM_Object) theAxis,
double theAngle);
Standard_EXPORT Handle(GEOM_Object) MakeRevolutionAxisAngle2Ways (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theAxis,

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -76,73 +75,6 @@ GEOMImpl_ICurvesOperations::~GEOMImpl_ICurvesOperations()
}
//=============================================================================
/*!
* MakePolyline
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline (std::list<Handle(GEOM_Object)> thePoints)
{
SetErrorCode(KO);
//Add a new Polyline object
Handle(GEOM_Object) aPolyline = GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE);
//Add a new Polyline function for creation a polyline relatively to points set
Handle(GEOM_Function) aFunction =
aPolyline->AddFunction(GEOMImpl_PolylineDriver::GetID(), POLYLINE_POINTS);
if (aFunction.IsNull()) return NULL;
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_PolylineDriver::GetID()) return NULL;
GEOMImpl_IPolyline aCI (aFunction);
int aLen = thePoints.size();
aCI.SetLength(aLen);
int ind = 1;
std::list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
for (; it != thePoints.end(); it++, ind++) {
Handle(GEOM_Function) aRefPnt = (*it)->GetLastFunction();
if (aRefPnt.IsNull()) {
SetErrorCode("NULL point for Polyline");
return NULL;
}
aCI.SetPoint(ind, aRefPnt);
}
//Compute the Polyline value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Polyline driver failed");
return NULL;
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
//Make a Python command
GEOM::TPythonDump pd (aFunction);
pd << aPolyline << " = geompy.MakePolyline([";
it = thePoints.begin();
pd << (*it++);
while (it != thePoints.end()) {
pd << ", " << (*it++);
}
pd << "])";
SetErrorCode(OK);
return aPolyline;
}
//=============================================================================
/*!
* MakeCircleThreePnt
@ -594,26 +526,26 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArcOfEllipse (Handle(GEOM_Ob
//=============================================================================
/*!
* MakeSplineBezier
* MakePolyline
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier
(std::list<Handle(GEOM_Object)> thePoints)
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline (std::list<Handle(GEOM_Object)> thePoints,
bool theIsClosed)
{
SetErrorCode(KO);
//Add a new Spline object
Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
//Add a new Polyline object
Handle(GEOM_Object) aPolyline = GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE);
//Add a new Spline function for creation a bezier curve relatively to points set
//Add a new Polyline function for creation a polyline relatively to points set
Handle(GEOM_Function) aFunction =
aSpline->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_BEZIER);
aPolyline->AddFunction(GEOMImpl_PolylineDriver::GetID(), POLYLINE_POINTS);
if (aFunction.IsNull()) return NULL;
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_SplineDriver::GetID()) return NULL;
if (aFunction->GetDriverGUID() != GEOMImpl_PolylineDriver::GetID()) return NULL;
GEOMImpl_ISpline aCI (aFunction);
GEOMImpl_IPolyline aCI (aFunction);
int aLen = thePoints.size();
aCI.SetLength(aLen);
@ -622,19 +554,22 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier
std::list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
for (; it != thePoints.end(); it++, ind++) {
Handle(GEOM_Function) aRefPnt = (*it)->GetLastFunction();
if (aRefPnt.IsNull()) return NULL;
if (aRefPnt.IsNull()) {
SetErrorCode("NULL point for Polyline");
return NULL;
}
aCI.SetPoint(ind, aRefPnt);
}
//Compute the Spline value
aCI.SetIsClosed(theIsClosed);
//Compute the Polyline value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Spline driver failed");
SetErrorCode("Polyline driver failed");
return NULL;
}
}
@ -646,27 +581,27 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier
//Make a Python command
GEOM::TPythonDump pd (aFunction);
pd << aSpline << " = geompy.MakeBezier([";
pd << aPolyline << " = geompy.MakePolyline([";
it = thePoints.begin();
pd << (*it++);
while (it != thePoints.end()) {
pd << ", " << (*it++);
}
pd << "])";
pd << "], " << theIsClosed << ")";
SetErrorCode(OK);
return aSpline;
return aPolyline;
}
//=============================================================================
/*!
* MakeSplineInterpolation
* MakeSplineBezier
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier
(std::list<Handle(GEOM_Object)> thePoints,
bool theIsClosed)
bool theIsClosed)
{
SetErrorCode(KO);
@ -675,7 +610,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
//Add a new Spline function for creation a bezier curve relatively to points set
Handle(GEOM_Function) aFunction =
aSpline->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_INTERPOLATION);
aSpline->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_BEZIER);
if (aFunction.IsNull()) return NULL;
//Check if the function is set correctly
@ -714,6 +649,78 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
return NULL;
}
//Make a Python command
GEOM::TPythonDump pd (aFunction);
pd << aSpline << " = geompy.MakeBezier([";
it = thePoints.begin();
pd << (*it++);
while (it != thePoints.end()) {
pd << ", " << (*it++);
}
pd << "], " << theIsClosed << ")";
SetErrorCode(OK);
return aSpline;
}
//=============================================================================
/*!
* MakeSplineInterpolation
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
(std::list<Handle(GEOM_Object)> thePoints,
bool theIsClosed,
bool theDoReordering)
{
SetErrorCode(KO);
//Add a new Spline object
Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
//Add a new Spline function for creation a bezier curve relatively to points set
Handle(GEOM_Function) aFunction =
aSpline->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_INTERPOLATION);
if (aFunction.IsNull()) return NULL;
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_SplineDriver::GetID()) return NULL;
GEOMImpl_ISpline aCI (aFunction);
int aLen = thePoints.size();
aCI.SetLength(aLen);
int ind = 1;
std::list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
for (; it != thePoints.end(); it++, ind++) {
Handle(GEOM_Function) aRefPnt = (*it)->GetLastFunction();
if (aRefPnt.IsNull()) return NULL;
aCI.SetPoint(ind, aRefPnt);
}
aCI.SetIsClosed(theIsClosed);
aCI.SetDoReordering(theDoReordering);
//Compute the Spline value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Spline driver failed");
return NULL;
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
//Make a Python command
GEOM::TPythonDump pd (aFunction);
pd << aSpline << " = geompy.MakeInterpol([";
@ -723,9 +730,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
while (it != thePoints.end()) {
pd << ", " << (*it++);
}
pd << "]";
if ( theIsClosed ) pd << ", True";
pd << ")";
pd << "], " << theIsClosed << ", " << theDoReordering << ")";
SetErrorCode(OK);
return aSpline;

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOMImpl_ICurvesOperations_HXX_
#define _GEOMImpl_ICurvesOperations_HXX_
@ -37,8 +36,6 @@ class GEOMImpl_ICurvesOperations : public GEOM_IOperations {
Standard_EXPORT GEOMImpl_ICurvesOperations(GEOM_Engine* theEngine, int theDocID);
Standard_EXPORT ~GEOMImpl_ICurvesOperations();
Standard_EXPORT Handle(GEOM_Object) MakePolyline (std::list<Handle(GEOM_Object)> thePoints);
Standard_EXPORT Handle(GEOM_Object) MakeCircleThreePnt (Handle(GEOM_Object) thePnt1,
Handle(GEOM_Object) thePnt2,
Handle(GEOM_Object) thePnt3);
@ -66,9 +63,15 @@ class GEOMImpl_ICurvesOperations : public GEOM_IOperations {
Handle(GEOM_Object) thePnt2,
Handle(GEOM_Object) thePnt3);
Standard_EXPORT Handle(GEOM_Object) MakeSplineBezier (std::list<Handle(GEOM_Object)> thePoints);
Standard_EXPORT Handle(GEOM_Object) MakePolyline (std::list<Handle(GEOM_Object)> thePoints,
bool theIsClosed = false);
Standard_EXPORT Handle(GEOM_Object) MakeSplineBezier (std::list<Handle(GEOM_Object)> thePoints,
bool theIsClosed = false);
Standard_EXPORT Handle(GEOM_Object) MakeSplineInterpolation (std::list<Handle(GEOM_Object)> thePoints,
bool theIsClosed = false);
bool theIsClosed = false,
bool theDoReordering = false);
Standard_EXPORT Handle(GEOM_Object) MakeSketcher (const char* theCommand,
std::list<double> theWorkingPlane);

View File

@ -18,14 +18,14 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//NOTE: This is an intreface to a function for the Polyline creation.
//
//NOTE: This is an interface to a function for the Polyline creation.
#include "GEOM_Function.hxx"
#define POLY_ARG_LENG 1
#define POLY_ARG_LAST 1
#define POLY_ARG_CLOS 2
class GEOMImpl_IPolyline
{
@ -37,10 +37,14 @@ class GEOMImpl_IPolyline
void SetPoint(int theId, Handle(GEOM_Function) theP) { _func->SetReference(POLY_ARG_LAST + theId, theP); }
void SetIsClosed(bool theIsClosed) { _func->SetInteger(POLY_ARG_CLOS, (int)theIsClosed); }
int GetLength() { return _func->GetInteger(POLY_ARG_LENG); }
Handle(GEOM_Function) GetPoint(int theId) { return _func->GetReference(POLY_ARG_LAST + theId); }
bool GetIsClosed() { return (bool)_func->GetInteger(POLY_ARG_CLOS); }
private:
Handle(GEOM_Function) _func;

View File

@ -18,10 +18,9 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//NOTE: This is an intreface to a function for the Prism creation.
//
#include "GEOM_Function.hxx"
#define PRISM_ARG_H 1
@ -32,6 +31,7 @@
#define PRISM_ARG_DX 6
#define PRISM_ARG_DY 7
#define PRISM_ARG_DZ 8
#define PRISM_ARG_SCALE 9
class GEOMImpl_IPrism
{
@ -44,6 +44,11 @@ class GEOMImpl_IPrism
void SetFirstPoint(Handle(GEOM_Function) thePoint) { _func->SetReference(PRISM_ARG_PNT_F, thePoint); }
void SetLastPoint (Handle(GEOM_Function) thePoint) { _func->SetReference(PRISM_ARG_PNT_L, thePoint); }
Handle(GEOM_Function) GetBase () { return _func->GetReference(PRISM_ARG_BASE); }
Handle(GEOM_Function) GetVector() { return _func->GetReference(PRISM_ARG_VEC ); }
Handle(GEOM_Function) GetFirstPoint() { return _func->GetReference(PRISM_ARG_PNT_F ); }
Handle(GEOM_Function) GetLastPoint () { return _func->GetReference(PRISM_ARG_PNT_L ); }
void SetDX(double theDX) { _func->SetReal(PRISM_ARG_DX, theDX); }
void SetDY(double theDY) { _func->SetReal(PRISM_ARG_DY, theDY); }
void SetDZ(double theDZ) { _func->SetReal(PRISM_ARG_DZ, theDZ); }
@ -52,15 +57,14 @@ class GEOMImpl_IPrism
double GetDY() { return _func->GetReal(PRISM_ARG_DY); }
double GetDZ() { return _func->GetReal(PRISM_ARG_DZ); }
Handle(GEOM_Function) GetBase () { return _func->GetReference(PRISM_ARG_BASE); }
Handle(GEOM_Function) GetVector() { return _func->GetReference(PRISM_ARG_VEC ); }
Handle(GEOM_Function) GetFirstPoint() { return _func->GetReference(PRISM_ARG_PNT_F ); }
Handle(GEOM_Function) GetLastPoint () { return _func->GetReference(PRISM_ARG_PNT_L ); }
void SetH(double theH) { _func->SetReal(PRISM_ARG_H, theH); }
double GetH() { return _func->GetReal(PRISM_ARG_H); }
void SetScale(double theH) { _func->SetReal(PRISM_ARG_SCALE, theH); }
double GetScale() { return _func->GetReal(PRISM_ARG_SCALE); }
private:
Handle(GEOM_Function) _func;

View File

@ -18,14 +18,14 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NOTE: This is an interface to a function for the Spline creation.
//
#include "GEOM_Function.hxx"
#define SPL_ARG_LENG 1
#define SPL_ARG_CLOS 2
#define SPL_ARG_REOR 3
#define SPL_ARG_LAST 2
class GEOMImpl_ISpline
@ -38,12 +38,16 @@ class GEOMImpl_ISpline
void SetIsClosed(bool theIsClosed) { _func->SetInteger(SPL_ARG_CLOS, (int)theIsClosed); }
void SetDoReordering(bool theDoReordering) { _func->SetInteger(SPL_ARG_REOR, (int)theDoReordering); }
void SetPoint(int theId, Handle(GEOM_Function) theP) { _func->SetReference(SPL_ARG_LAST + theId, theP); }
int GetLength() { return _func->GetInteger(SPL_ARG_LENG); }
bool GetIsClosed() { return (bool)_func->GetInteger(SPL_ARG_CLOS); }
bool GetDoReordering() { return (bool)_func->GetInteger(SPL_ARG_REOR); }
Handle(GEOM_Function) GetPoint(int theId) { return _func->GetReference(SPL_ARG_LAST + theId); }
private:

File diff suppressed because it is too large Load Diff

View File

@ -18,11 +18,10 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : GEOMImpl_PipeDriver.ixx
// Module : GEOMImpl
//
#ifndef _GEOMImpl_PipeDriver_HeaderFile
#define _GEOMImpl_PipeDriver_HeaderFile
@ -120,6 +119,10 @@ class Handle(GEOMImpl_PipeDriver) : public Handle(TFunction_Driver) {
#include <Standard_CString.hxx>
#endif
#include <TopoDS_Wire.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_HSequenceOfShape.hxx>
class TColStd_SequenceOfExtendedString;
@ -150,6 +153,13 @@ public:
Standard_EXPORT static const Standard_GUID& GetID();
Standard_EXPORT ~GEOMImpl_PipeDriver() {};
Standard_EXPORT static TopoDS_Shape CreatePipeWithDifferentSections
(const TopoDS_Wire& theWirePath,
const Handle(TopTools_HSequenceOfShape) theBases,
const Handle(TopTools_HSequenceOfShape) theLocs,
const Standard_Boolean theWithContact,
const Standard_Boolean theWithCorrect);
// Type management
//

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -87,7 +86,7 @@ Standard_Integer GEOMImpl_PolylineDriver::Execute(TFunction_Logbook& log) const
}
if (aShapePnt.ShapeType() == TopAbs_VERTEX) {
aMakePoly.Add(TopoDS::Vertex(aShapePnt));
// if (!aMakePoly.Added()) return 0;
//if (!aMakePoly.Added()) return 0;
}
}
// Compare first and last point coordinates and close polyline if it's the same.
@ -100,7 +99,8 @@ Standard_Integer GEOMImpl_PolylineDriver::Execute(TFunction_Logbook& log) const
TopoDS_Shape aLastPnt = aLPoint->GetValue();
TopoDS_Vertex aV2 = TopoDS::Vertex(aLastPnt);
if ( !aV1.IsNull() && !aV2.IsNull() && aV1.IsSame(aV2) )
if ( (!aV1.IsNull() && !aV2.IsNull() && aV1.IsSame(aV2)) ||
aCI.GetIsClosed())
aMakePoly.Close();
}

View File

@ -18,59 +18,68 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
#include <GEOMImpl_PrismDriver.hxx>
#include <GEOMImpl_IShapesOperations.hxx>
#include <GEOMImpl_IPrism.hxx>
#include <GEOMImpl_IShapesOperations.hxx>
#include <GEOMImpl_IMeasureOperations.hxx>
#include <GEOMImpl_PipeDriver.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOM_Function.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRep_Tool.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <Precision.hxx>
#include <gp_Ax3.hxx>
#include <gp_Pnt.hxx>
#include <gp_Trsf.hxx>
#include <gp_Vec.hxx>
#include <gp_Trsf.hxx>
#include <Standard_Stream.hxx>
#include <Standard_ConstructionError.hxx>
//=======================================================================
//function : GetID
//purpose :
//=======================================================================
//=======================================================================
const Standard_GUID& GEOMImpl_PrismDriver::GetID()
{
static Standard_GUID aPrismDriver("FF1BBB17-5D14-4df2-980B-3A668264EA16");
return aPrismDriver;
return aPrismDriver;
}
//=======================================================================
//function : GEOMImpl_PrismDriver
//purpose :
//purpose :
//=======================================================================
GEOMImpl_PrismDriver::GEOMImpl_PrismDriver()
GEOMImpl_PrismDriver::GEOMImpl_PrismDriver()
{
}
//=======================================================================
//function : Execute
//purpose :
//=======================================================================
//=======================================================================
Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
{
if (Label().IsNull()) return 0;
if (Label().IsNull()) return 0;
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
GEOMImpl_IPrism aCI (aFunction);
@ -94,14 +103,19 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
}
if (aV.Magnitude() > Precision::Confusion()) {
aV.Normalize();
if (aType == PRISM_BASE_VEC_H_2WAYS) {
gp_Trsf aTrsf;
aTrsf.SetTranslation( (-aV) * aCI.GetH() );
BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
aShapeBase = aTransformation.Shape();
aCI.SetH( aCI.GetH()*2 );
if (aType != PRISM_BASE_DXDYDZ_2WAYS && aCI.GetScale() > Precision::Confusion()) {
aShape = MakeScaledPrism(aShapeBase, aV * aCI.GetH(), aCI.GetScale());
}
else {
if (aType == PRISM_BASE_VEC_H_2WAYS) {
gp_Trsf aTrsf;
aTrsf.SetTranslation((-aV) * aCI.GetH());
BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
aShapeBase = aTransformation.Shape();
aCI.SetH(aCI.GetH()*2);
}
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV * aCI.GetH(), Standard_False).Shape();
}
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV * aCI.GetH(), Standard_False).Shape();
}
}
}
@ -119,15 +133,19 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
if (!V1.IsNull() && !V2.IsNull()) {
gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
if (aV.Magnitude() > gp::Resolution()) {
if (aType == PRISM_BASE_TWO_PNT_2WAYS)
{
if (aType != PRISM_BASE_DXDYDZ_2WAYS && aCI.GetScale() > Precision::Confusion()) {
aShape = MakeScaledPrism(aShapeBase, aV, aCI.GetScale());
}
else {
if (aType == PRISM_BASE_TWO_PNT_2WAYS) {
gp_Trsf aTrsf;
aTrsf.SetTranslation(-aV);
BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
aShapeBase = aTransformation.Shape();
aV = aV * 2;
}
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
}
}
}
}
@ -136,15 +154,19 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
TopoDS_Shape aShapeBase = aRefBase->GetValue();
gp_Vec aV (aCI.GetDX(), aCI.GetDY(), aCI.GetDZ());
if (aV.Magnitude() > gp::Resolution()) {
if (aType == PRISM_BASE_DXDYDZ_2WAYS)
{
if (aType != PRISM_BASE_DXDYDZ_2WAYS && aCI.GetScale() > Precision::Confusion()) {
aShape = MakeScaledPrism(aShapeBase, aV, aCI.GetScale());
}
else {
if (aType == PRISM_BASE_DXDYDZ_2WAYS) {
gp_Trsf aTrsf;
aTrsf.SetTranslation(-aV);
BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
aShapeBase = aTransformation.Shape();
aV = aV * 2;
}
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
}
}
}
@ -153,26 +175,91 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
aFunction->SetValue(aRes);
log.SetTouched(Label());
log.SetTouched(Label());
return 1;
return 1;
}
//=======================================================================
//function : MakeScaledPrism
//purpose :
//=======================================================================
TopoDS_Shape GEOMImpl_PrismDriver::MakeScaledPrism (const TopoDS_Shape& theShapeBase,
const gp_Vec& theVector,
const Standard_Real theScaleFactor)
{
TopoDS_Shape aShape;
// 1. aCDG = geompy.MakeCDG(theBase)
gp_Ax3 aPos = GEOMImpl_IMeasureOperations::GetPosition(theShapeBase);
gp_Pnt aCDG = aPos.Location();
TopoDS_Shape aShapeCDG_1 = BRepBuilderAPI_MakeVertex(aCDG).Shape();
// 2. Scale = geompy.MakeScaleTransform(theBase, aCDG, theScaleFactor)
// Bug 6839: Check for standalone (not included in faces) degenerated edges
TopTools_IndexedDataMapOfShapeListOfShape aEFMap;
TopExp::MapShapesAndAncestors(theShapeBase, TopAbs_EDGE, TopAbs_FACE, aEFMap);
Standard_Integer i, nbE = aEFMap.Extent();
for (i = 1; i <= nbE; i++) {
TopoDS_Shape anEdgeSh = aEFMap.FindKey(i);
if (BRep_Tool::Degenerated(TopoDS::Edge(anEdgeSh))) {
const TopTools_ListOfShape& aFaces = aEFMap.FindFromIndex(i);
if (aFaces.IsEmpty())
Standard_ConstructionError::Raise
("Scaling aborted : cannot scale standalone degenerated edge");
}
}
// Perform Scaling
gp_Trsf aTrsf;
aTrsf.SetScale(aCDG, theScaleFactor);
BRepBuilderAPI_Transform aBRepTrsf (theShapeBase, aTrsf, Standard_False);
TopoDS_Shape aScale = aBRepTrsf.Shape();
// 3. aBase2 = geompy.MakeTranslationVectorDistance(Scale, theVec, theH)
gp_Trsf aTrsf3;
aTrsf3.SetTranslation(theVector);
TopLoc_Location aLocOrig = aScale.Location();
gp_Trsf aTrsfOrig = aLocOrig.Transformation();
TopLoc_Location aLocRes (aTrsf3 * aTrsfOrig);
TopoDS_Shape aBase2 = aScale.Located(aLocRes);
// 4. aCDG_2 = geompy.MakeTranslationVectorDistance(aCDG, theVec, theH)
gp_Pnt aCDG_2 = aCDG.Translated(theVector);
TopoDS_Shape aShapeCDG_2 = BRepBuilderAPI_MakeVertex(aCDG_2).Shape();
// 5. Vector = geompy.MakeVector(aCDG, aCDG_2)
TopoDS_Shape aShapeVec = BRepBuilderAPI_MakeEdge(aCDG, aCDG_2).Shape();
TopoDS_Edge anEdge = TopoDS::Edge(aShapeVec);
TopoDS_Wire aWirePath = BRepBuilderAPI_MakeWire(anEdge);
// 6. aPrism = geompy.MakePipeWithDifferentSections([theBase, aBase2], [aCDG, aCDG_2], Vector, False, False)
Handle(TopTools_HSequenceOfShape) aBases = new TopTools_HSequenceOfShape;
aBases->Append(theShapeBase);
aBases->Append(aBase2);
Handle(TopTools_HSequenceOfShape) aLocs = new TopTools_HSequenceOfShape;
aLocs->Append(aShapeCDG_1);
aLocs->Append(aShapeCDG_2);
aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections(aWirePath, aBases, aLocs, false, false);
return aShape;
}
//=======================================================================
//function : GEOMImpl_PrismDriver_Type_
//function : GEOMImpl_PrismDriver_Type_
//purpose :
//=======================================================================
//=======================================================================
Standard_EXPORT Handle_Standard_Type& GEOMImpl_PrismDriver_Type_()
{
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
if (aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
if (aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
if (aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PrismDriver",
@ -187,7 +274,7 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_PrismDriver_Type_()
//=======================================================================
//function : DownCast
//purpose :
//=======================================================================
//=======================================================================
const Handle(GEOMImpl_PrismDriver) Handle(GEOMImpl_PrismDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(GEOMImpl_PrismDriver) _anOtherObject;
@ -198,5 +285,5 @@ const Handle(GEOMImpl_PrismDriver) Handle(GEOMImpl_PrismDriver)::DownCast(const
}
}
return _anOtherObject ;
return _anOtherObject;
}

View File

@ -18,11 +18,10 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : GEOMImpl_PrismDriver.ixx
// Module : GEOMImpl
//
#ifndef _GEOMImpl_PrismDriver_HeaderFile
#define _GEOMImpl_PrismDriver_HeaderFile
@ -104,9 +103,9 @@ class Handle(GEOMImpl_PrismDriver) : public Handle(TFunction_Driver) {
return (GEOMImpl_PrismDriver *)ControlAccess();
}
Standard_EXPORT ~Handle(GEOMImpl_PrismDriver)() {};
Standard_EXPORT ~Handle(GEOMImpl_PrismDriver)() {};
Standard_EXPORT static const Handle(GEOMImpl_PrismDriver) DownCast(const Handle(Standard_Transient)& AnObject);
Standard_EXPORT static const Handle(GEOMImpl_PrismDriver) DownCast(const Handle(Standard_Transient)& AnObject);
};
#ifndef _TFunction_Driver_HeaderFile
@ -119,6 +118,10 @@ class Handle(GEOMImpl_PrismDriver) : public Handle(TFunction_Driver) {
#include <Standard_CString.hxx>
#endif
#include <TopoDS_Shape.hxx>
#include <gp_Vec.hxx>
#include <Standard_Real.hxx>
class TColStd_SequenceOfExtendedString;
@ -126,35 +129,39 @@ class GEOMImpl_PrismDriver : public TFunction_Driver {
public:
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// Methods PUBLIC
//
Standard_EXPORT GEOMImpl_PrismDriver();
Standard_EXPORT virtual Standard_Integer Execute(TFunction_Logbook& log) const;
Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const { return Standard_True; }
Standard_EXPORT static const Standard_GUID& GetID();
Standard_EXPORT ~GEOMImpl_PrismDriver() {};
// Methods PUBLIC
Standard_EXPORT GEOMImpl_PrismDriver();
Standard_EXPORT ~GEOMImpl_PrismDriver() {};
Standard_EXPORT virtual Standard_Integer Execute (TFunction_Logbook& log) const;
Standard_EXPORT virtual void Validate (TFunction_Logbook&) const {}
Standard_EXPORT Standard_Boolean MustExecute (const TFunction_Logbook&) const { return Standard_True; }
Standard_EXPORT static const Standard_GUID& GetID();
Standard_EXPORT static TopoDS_Shape MakeScaledPrism (const TopoDS_Shape& theShapeBase,
const gp_Vec& theVector,
const Standard_Real theScaleFactor);
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_PrismDriver_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const { return STANDARD_TYPE(GEOMImpl_PrismDriver) ; }
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const { return (STANDARD_TYPE(GEOMImpl_PrismDriver) == AType || TFunction_Driver::IsKind(AType)); }
// Type management
Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_PrismDriver_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const { return STANDARD_TYPE(GEOMImpl_PrismDriver) ; }
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const { return (STANDARD_TYPE(GEOMImpl_PrismDriver) == AType || TFunction_Driver::IsKind(AType)); }
};

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -86,7 +85,21 @@ Standard_Integer GEOMImpl_SplineDriver::Execute(TFunction_Logbook& log) const
if (aLen < 2) return 0;
Standard_Boolean isSeveral = Standard_False;
gp_Pnt aPrevP;
TColgp_Array1OfPnt CurvePoints (1, aLen);
int aRealLen = aLen;
if (aType == SPLINE_BEZIER && aCI.GetIsClosed()) {
Handle(GEOM_Function) aFPoint = aCI.GetPoint(1);
TopoDS_Shape aFirstPnt = aFPoint->GetValue();
TopoDS_Vertex aV1 = TopoDS::Vertex(aFirstPnt);
Handle(GEOM_Function) aLPoint = aCI.GetPoint(aLen);
TopoDS_Shape aLastPnt = aLPoint->GetValue();
TopoDS_Vertex aV2 = TopoDS::Vertex(aLastPnt);
if (!aV1.IsNull() && !aV2.IsNull() && !aV1.IsSame(aV2)) {
aRealLen++;
}
}
TColgp_Array1OfPnt CurvePoints (1, aRealLen);
for (ind = 1; ind <= aLen; ind++) {
Handle(GEOM_Function) aRefPoint = aCI.GetPoint(ind);
TopoDS_Shape aShapePnt = aRefPoint->GetValue();
@ -105,16 +118,27 @@ Standard_Integer GEOMImpl_SplineDriver::Execute(TFunction_Logbook& log) const
if (!isSeveral) {
Standard_ConstructionError::Raise("Points for Bezier Curve are too close");
}
if (aRealLen > aLen) { // set last point equal to first for the closed curve
CurvePoints.SetValue(aRealLen, CurvePoints.Value(1));
}
Handle(Geom_BezierCurve) GBC = new Geom_BezierCurve(CurvePoints);
aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
} else {
//GeomAPI_PointsToBSpline GBC (CurvePoints);
//aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt(1, aLen);
for (ind = 1; ind <= aLen; ind++) {
aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
if (aCI.GetDoReordering()) {
// TODO
for (ind = 1; ind <= aLen; ind++) {
aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
}
}
int isClosed = aCI.GetIsClosed();
else {
for (ind = 1; ind <= aLen; ind++) {
aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
}
}
bool isClosed = aCI.GetIsClosed();
GeomAPI_Interpolate GBC (aHCurvePoints, isClosed, gp::Resolution());
GBC.Perform();
if (GBC.IsDone())

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -458,7 +457,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecH
//Create the Prism
Handle(GEOM_Object) anObject =
GetOperations()->MakePrismVecH(aBase, aVec, theH);
GetOperations()->MakePrismVecH(aBase, aVec, theH);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
@ -494,6 +493,35 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecH2Ways
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePrismVecH
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecHWithScaling
(GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theVec,
CORBA::Double theH, CORBA::Double theScaleFactor)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference objects
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
//Create the Prism
Handle(GEOM_Object) anObject =
GetOperations()->MakePrismVecH(aBase, aVec, theH, theScaleFactor);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePrismTwoPnt
@ -558,6 +586,39 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt2Ways
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePrismTwoPnt
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPntWithScaling
(GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePoint1,
GEOM::GEOM_Object_ptr thePoint2,
CORBA::Double theScaleFactor)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference objects
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
return aGEOMObject._retn();
//Create the Prism
Handle(GEOM_Object) anObject =
GetOperations()->MakePrismTwoPnt(aBase, aPoint1, aPoint2, theScaleFactor);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePrismDXDYDZ
@ -614,6 +675,35 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ2Ways
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePrismDXDYDZ
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZWithScaling
(GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
CORBA::Double theDY, CORBA::Double theDZ,
CORBA::Double theScaleFactor)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference objects
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
if (aBase.IsNull()) return aGEOMObject._retn();
//Create the Prism
Handle(GEOM_Object) anObject =
GetOperations()->MakePrismDXDYDZ(aBase, theDX, theDY, theDZ, theScaleFactor);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePipe

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOM_I3DPrimOperations_i_HeaderFile
#define _GEOM_I3DPrimOperations_i_HeaderFile
@ -107,6 +106,11 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
GEOM::GEOM_Object_ptr theVec,
CORBA::Double theH);
GEOM::GEOM_Object_ptr MakePrismVecHWithScaling (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr theVec,
CORBA::Double theH,
CORBA::Double theScaleFactor);
GEOM::GEOM_Object_ptr MakePrismTwoPnt (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePoint1,
GEOM::GEOM_Object_ptr thePoint2);
@ -115,6 +119,11 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
GEOM::GEOM_Object_ptr thePoint1,
GEOM::GEOM_Object_ptr thePoint2);
GEOM::GEOM_Object_ptr MakePrismTwoPntWithScaling (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePoint1,
GEOM::GEOM_Object_ptr thePoint2,
CORBA::Double theScaleFactor);
GEOM::GEOM_Object_ptr MakePrismDXDYDZ (GEOM::GEOM_Object_ptr theBase,
CORBA::Double theDX,
CORBA::Double theDY,
@ -123,6 +132,11 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
CORBA::Double theDX,
CORBA::Double theDY,
CORBA::Double theDZ);
GEOM::GEOM_Object_ptr MakePrismDXDYDZWithScaling (GEOM::GEOM_Object_ptr theBase,
CORBA::Double theDX,
CORBA::Double theDY,
CORBA::Double theDZ,
CORBA::Double theScaleFactor);
GEOM::GEOM_Object_ptr MakePipe (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePath);

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -334,7 +333,8 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeArcOfEllipse
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakePolyline
(const GEOM::ListOfGO& thePoints)
(const GEOM::ListOfGO& thePoints,
CORBA::Boolean theIsClosed)
{
GEOM::GEOM_Object_var aGEOMObject;
@ -353,7 +353,7 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakePolyline
// Make Polyline
Handle(GEOM_Object) anObject =
GetOperations()->MakePolyline(aPoints);
GetOperations()->MakePolyline(aPoints, theIsClosed);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
@ -366,38 +366,6 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakePolyline
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineBezier
(const GEOM::ListOfGO& thePoints)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference point
int ind = 0;
int aLen = thePoints.length();
std::list<Handle(GEOM_Object)> aPoints;
for (; ind < aLen; ind++) {
Handle(GEOM_Object) aPnt = GetObjectImpl(thePoints[ind]);
if (aPnt.IsNull()) return aGEOMObject._retn();
aPoints.push_back(aPnt);
}
// Make Bezier curve
Handle(GEOM_Object) anObject =
GetOperations()->MakeSplineBezier(aPoints);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//=============================================================================
/*!
* MakeSplineInterpolation
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
(const GEOM::ListOfGO& thePoints,
CORBA::Boolean theIsClosed)
{
@ -416,9 +384,43 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
aPoints.push_back(aPnt);
}
// Make Bezier curve
Handle(GEOM_Object) anObject =
GetOperations()->MakeSplineBezier(aPoints, theIsClosed);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//=============================================================================
/*!
* MakeSplineInterpolation
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
(const GEOM::ListOfGO& thePoints,
CORBA::Boolean theIsClosed,
CORBA::Boolean theDoReordering)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference point
int ind = 0;
int aLen = thePoints.length();
std::list<Handle(GEOM_Object)> aPoints;
for (; ind < aLen; ind++) {
Handle(GEOM_Object) aPnt = GetObjectImpl(thePoints[ind]);
if (aPnt.IsNull()) return aGEOMObject._retn();
aPoints.push_back(aPnt);
}
// Make Polyline
Handle(GEOM_Object) anObject =
GetOperations()->MakeSplineInterpolation(aPoints, theIsClosed);
GetOperations()->MakeSplineInterpolation(aPoints, theIsClosed, theDoReordering);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOM_ICurvesOperations_i_HeaderFile
#define _GEOM_ICurvesOperations_i_HeaderFile
@ -76,12 +75,15 @@ class GEOM_I_EXPORT GEOM_ICurvesOperations_i :
GEOM::GEOM_Object_ptr thePnt2,
GEOM::GEOM_Object_ptr thePnt3);
GEOM::GEOM_Object_ptr MakePolyline (const GEOM::ListOfGO& thePoints);
GEOM::GEOM_Object_ptr MakePolyline (const GEOM::ListOfGO& thePoints,
CORBA::Boolean theIsClosed);
GEOM::GEOM_Object_ptr MakeSplineBezier (const GEOM::ListOfGO& thePoints);
GEOM::GEOM_Object_ptr MakeSplineBezier (const GEOM::ListOfGO& thePoints,
CORBA::Boolean theIsClosed);
GEOM::GEOM_Object_ptr MakeSplineInterpolation (const GEOM::ListOfGO& thePoints,
CORBA::Boolean theIsClosed);
CORBA::Boolean theIsClosed,
CORBA::Boolean theDoReordering);
GEOM::GEOM_Object_ptr MakeSketcher (const char* theCommand, const GEOM::ListOfDouble& theWorkingPlane);

View File

@ -2756,14 +2756,15 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeArcOfEllipse (GEOM::GEOM_Object_ptr the
//=============================================================================
// MakePolyline:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePolyline (GEOM::GEOM_List_ptr thePoints)
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePolyline (GEOM::GEOM_List_ptr thePoints,
CORBA::Boolean theIsClosed)
{
beginService( " GEOM_Superv_i::MakePolyline" );
MESSAGE("GEOM_Superv_i::MakePolyline");
if (GEOM_List_i<GEOM::ListOfGO>* aListImplP =
dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(thePoints, myPOA).in())) {
getCurvesOp();
GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakePolyline(aListImplP->GetList());
GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakePolyline(aListImplP->GetList(), theIsClosed);
endService( " GEOM_Superv_i::MakePolyline" );
return anObj;
}
@ -2774,14 +2775,15 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePolyline (GEOM::GEOM_List_ptr thePoints
//=============================================================================
// MakeSplineBezier:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineBezier (GEOM::GEOM_List_ptr thePoints)
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineBezier (GEOM::GEOM_List_ptr thePoints,
CORBA::Boolean theIsClosed)
{
beginService( " GEOM_Superv_i::MakeSplineBezier" );
MESSAGE("GEOM_Superv_i::MakeSplineBezier");
if (GEOM_List_i<GEOM::ListOfGO>* aListImplP =
dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(thePoints, myPOA).in())) {
getCurvesOp();
GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeSplineBezier(aListImplP->GetList());
GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeSplineBezier(aListImplP->GetList(), theIsClosed);
endService( " GEOM_Superv_i::MakeSplineBezier" );
return anObj;
}
@ -2793,14 +2795,15 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineBezier (GEOM::GEOM_List_ptr thePo
// MakeSplineInterpolation:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineInterpolation (GEOM::GEOM_List_ptr thePoints,
CORBA::Boolean theIsClosed)
CORBA::Boolean theIsClosed,
CORBA::Boolean theDoReordering)
{
beginService( " GEOM_Superv_i::MakeSplineInterpolation" );
MESSAGE("GEOM_Superv_i::MakeSplineInterpolation");
if (GEOM_List_i<GEOM::ListOfGO>* aListImplP =
dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(thePoints, myPOA).in())) {
getCurvesOp();
GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeSplineInterpolation(aListImplP->GetList(), theIsClosed);
GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeSplineInterpolation(aListImplP->GetList(), theIsClosed, theDoReordering);
endService( " GEOM_Superv_i::MakeSplineInterpolation" );
return anObj;
}

File diff suppressed because it is too large Load Diff

View File

@ -901,35 +901,39 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a polyline on the set of points.
# @param thePoints Sequence of points for the polyline.
# @param theIsClosed If True, build a closed wire.
# @return New GEOM_Object, containing the created polyline.
#
# @ref tui_creation_curve "Example"
def MakePolyline(self,thePoints):
def MakePolyline(self, thePoints, theIsClosed=False):
# Example: see GEOM_TestAll.py
anObj = self.CurvesOp.MakePolyline(thePoints)
anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
RaiseIfFailed("MakePolyline", self.CurvesOp)
return anObj
## Create bezier curve on the set of points.
# @param thePoints Sequence of points for the bezier curve.
# @param theIsClosed If True, build a closed curve.
# @return New GEOM_Object, containing the created bezier curve.
#
# @ref tui_creation_curve "Example"
def MakeBezier(self,thePoints):
def MakeBezier(self, thePoints, theIsClosed=False):
# Example: see GEOM_TestAll.py
anObj = self.CurvesOp.MakeSplineBezier(thePoints)
anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
return anObj
## Create B-Spline curve on the set of points.
# @param thePoints Sequence of points for the B-Spline curve.
# @param theIsClosed If True, build a closed curve.
# @param theDoReordering If TRUE, the algo does not follow the order of
# \a thePoints but searches for the closest vertex.
# @return New GEOM_Object, containing the created B-Spline curve.
#
# @ref tui_creation_curve "Example"
def MakeInterpol(self, thePoints, theIsClosed=False):
def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
# Example: see GEOM_TestAll.py
anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
return anObj
@ -1294,13 +1298,22 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theBase Base shape to be extruded.
# @param thePoint1 First end of extrusion vector.
# @param thePoint2 Second end of extrusion vector.
# @param theScaleFactor Use it to make prism with scaled second base.
# Nagative value means not scaled second base.
# @return New GEOM_Object, containing the created prism.
#
# @ref tui_creation_prism "Example"
def MakePrism(self, theBase, thePoint1, thePoint2):
def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
# Example: see GEOM_TestAll.py
anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
anObj = None
Parameters = ""
if theScaleFactor > 0:
theScaleFactor,Parameters = ParseParameters(theScaleFactor)
anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
else:
anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
anObj.SetParameters(Parameters)
return anObj
## Create a shape by extrusion of the base shape along a
@ -1323,13 +1336,21 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theBase Base shape to be extruded.
# @param theVec Direction of extrusion.
# @param theH Prism dimension along theVec.
# @param theScaleFactor Use it to make prism with scaled second base.
# Nagative value means not scaled second base.
# @return New GEOM_Object, containing the created prism.
#
# @ref tui_creation_prism "Example"
def MakePrismVecH(self, theBase, theVec, theH):
def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
# Example: see GEOM_TestAll.py
theH,Parameters = ParseParameters(theH)
anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
anObj = None
Parameters = ""
if theScaleFactor > 0:
theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
else:
theH,Parameters = ParseParameters(theH)
anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
RaiseIfFailed("MakePrismVecH", self.PrimOp)
anObj.SetParameters(Parameters)
return anObj
@ -1354,13 +1375,21 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a shape by extrusion of the base shape along the dx, dy, dz direction
# @param theBase Base shape to be extruded.
# @param theDX, theDY, theDZ Directions of extrusion.
# @param theScaleFactor Use it to make prism with scaled second base.
# Nagative value means not scaled second base.
# @return New GEOM_Object, containing the created prism.
#
# @ref tui_creation_prism "Example"
def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
# Example: see GEOM_TestAll.py
theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
anObj = None
Parameters = ""
if theScaleFactor > 0:
theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
else:
theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
anObj.SetParameters(Parameters)
return anObj

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : GenerationGUI_PrismDlg.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "GenerationGUI_PrismDlg.h"
#include <DlgRef.h>
@ -72,42 +71,48 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg (GeometryGUI* theGeometryGUI, QWi
mainFrame()->RadioButton1->setChecked(true);
GroupPoints = new DlgRef_2Sel1Spin2Check(centralWidget());
GroupPoints->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV"));
GroupPoints->TextLabel1->setText(tr("GEOM_BASE"));
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
GroupPoints->TextLabel3->setText(tr("GEOM_HEIGHT"));
GroupPoints->PushButton1->setIcon(image1);
GroupPoints->PushButton2->setIcon(image1);
GroupPoints->LineEdit1->setReadOnly(true);
GroupPoints->LineEdit2->setReadOnly(true);
GroupPoints->CheckButton1->setText(tr("GEOM_BOTHWAY"));
GroupPoints->CheckButton2->setText(tr("GEOM_REVERSE"));
GroupVecH = new DlgRef_2Sel2Spin3Check(centralWidget());
GroupVecH->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV"));
GroupVecH->TextLabel1->setText(tr("GEOM_BASE"));
GroupVecH->TextLabel2->setText(tr("GEOM_VECTOR"));
GroupVecH->TextLabel3->setText(tr("GEOM_HEIGHT"));
GroupVecH->TextLabel4->setText(tr("GEOM_SCALE_FACTOR"));
GroupVecH->PushButton1->setIcon(image1);
GroupVecH->PushButton2->setIcon(image1);
GroupVecH->LineEdit1->setReadOnly(true);
GroupVecH->LineEdit2->setReadOnly(true);
GroupVecH->CheckBox1->setText(tr("GEOM_BOTHWAY"));
GroupVecH->CheckBox2->setText(tr("GEOM_REVERSE"));
GroupVecH->CheckBox3->setText(tr("GEOM_SCALE_PRISM"));
GroupPoints2 = new DlgRef_3Sel1Check(centralWidget());
GroupPoints2->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV_2P"));
GroupPoints2->TextLabel1->setText(tr("GEOM_BASE"));
GroupPoints2->TextLabel2->setText(tr("GEOM_POINT_I").arg(1));
GroupPoints2->TextLabel3->setText(tr("GEOM_POINT_I").arg(2));
GroupPoints2->PushButton1->setIcon(image1);
GroupPoints2->PushButton2->setIcon(image1);
GroupPoints2->PushButton3->setIcon(image1);
GroupPoints2->CheckButton1->setText(tr("GEOM_BOTHWAY"));
Group2Points = new DlgRef_3Sel3Spin2Check(centralWidget());
Group2Points->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV_2P"));
Group2Points->TextLabel1->setText(tr("GEOM_BASE"));
Group2Points->TextLabel2->setText(tr("GEOM_POINT_I").arg(1));
Group2Points->TextLabel3->setText(tr("GEOM_POINT_I").arg(2));
Group2Points->TextLabel4->setText(tr("GEOM_SCALE_FACTOR"));
Group2Points->PushButton1->setIcon(image1);
Group2Points->PushButton2->setIcon(image1);
Group2Points->PushButton3->setIcon(image1);
Group2Points->CheckBox1->setText(tr("GEOM_BOTHWAY"));
Group2Points->CheckBox2->setText(tr("GEOM_SCALE_PRISM"));
GroupPoints3 = new DlgRef_1Sel3Spin1Check(centralWidget());
GroupPoints3->GroupBox1->setTitle(tr("GEOM_EXTRUSION_DXDYDZ"));
GroupPoints3->TextLabel1->setText(tr("GEOM_BASE"));
GroupPoints3->PushButton1->setIcon(image1);
GroupPoints3->TextLabel2->setText(tr("GEOM_DX"));
GroupPoints3->TextLabel3->setText(tr("GEOM_DY"));
GroupPoints3->TextLabel4->setText(tr("GEOM_DZ"));
GroupPoints3->CheckButton1->setText(tr("GEOM_BOTHWAY"));
GroupDXDYDZ = new DlgRef_1Sel4Spin2Check(centralWidget());
GroupDXDYDZ->GroupBox1->setTitle(tr("GEOM_EXTRUSION_DXDYDZ"));
GroupDXDYDZ->TextLabel1->setText(tr("GEOM_BASE"));
GroupDXDYDZ->PushButton1->setIcon(image1);
GroupDXDYDZ->TextLabel2->setText(tr("GEOM_DX"));
GroupDXDYDZ->TextLabel3->setText(tr("GEOM_DY"));
GroupDXDYDZ->TextLabel4->setText(tr("GEOM_DZ"));
GroupDXDYDZ->TextLabel5->setText(tr("GEOM_SCALE_FACTOR"));
GroupDXDYDZ->CheckBox1->setText(tr("GEOM_BOTHWAY"));
GroupDXDYDZ->CheckBox2->setText(tr("GEOM_SCALE_PRISM"));
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
layout->setMargin(0); layout->setSpacing(6);
layout->addWidget(GroupPoints);
layout->addWidget(GroupPoints2);
layout->addWidget(GroupPoints3);
layout->addWidget(GroupVecH);
layout->addWidget(Group2Points);
layout->addWidget(GroupDXDYDZ);
/***************************************************************/
setHelpFileName("create_extrusion_page.html");
@ -135,35 +140,53 @@ void GenerationGUI_PrismDlg::Init()
double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
// min, max, step and decimals for spin boxes & initial values
initSpinBox(GroupPoints3->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision" );
initSpinBox(GroupPoints3->SpinBox_DY, COORD_MIN, COORD_MAX, step, "length_precision" );
initSpinBox(GroupPoints3->SpinBox_DZ, COORD_MIN, COORD_MAX, step, "length_precision" );
GroupPoints3->SpinBox_DX->setValue(0.0);
GroupPoints3->SpinBox_DY->setValue(0.0);
GroupPoints3->SpinBox_DZ->setValue(0.0);
double aScaleFactor = 2.0;
double aScaleStep = 0.5;
initSpinBox(GroupPoints->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision" );
GroupPoints->SpinBox_DX->setValue(100.0);
initSpinBox(GroupVecH->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision" );
GroupVecH->SpinBox_DX->setValue(100.0);
initSpinBox(GroupDXDYDZ->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision" );
initSpinBox(GroupDXDYDZ->SpinBox_DY, COORD_MIN, COORD_MAX, step, "length_precision" );
initSpinBox(GroupDXDYDZ->SpinBox_DZ, COORD_MIN, COORD_MAX, step, "length_precision" );
GroupDXDYDZ->SpinBox_DX->setValue(0.0);
GroupDXDYDZ->SpinBox_DY->setValue(0.0);
GroupDXDYDZ->SpinBox_DZ->setValue(0.0);
initSpinBox(GroupVecH->SpinBox_DY, 0.0, COORD_MAX, aScaleStep, "parametric_precision" );
initSpinBox(Group2Points->SpinBox1, 0.0, COORD_MAX, aScaleStep, "parametric_precision" );
initSpinBox(GroupDXDYDZ->SpinBox_SC, 0.0, COORD_MAX, aScaleStep, "parametric_precision" );
GroupVecH->SpinBox_DY->setValue(aScaleFactor);
Group2Points->SpinBox1->setValue(aScaleFactor);
GroupDXDYDZ->SpinBox_SC->setValue(aScaleFactor);
// hide not used controls
Group2Points->TextLabel5->hide();
Group2Points->TextLabel6->hide();
Group2Points->SpinBox2->hide();
Group2Points->SpinBox3->hide();
// init variables
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setReadOnly(true);
GroupPoints->LineEdit2->setReadOnly(true);
myEditCurrentArgument = GroupVecH->LineEdit1;
GroupVecH->LineEdit1->setReadOnly(true);
GroupVecH->LineEdit2->setReadOnly(true);
GroupPoints2->LineEdit1->setReadOnly(true);
GroupPoints2->LineEdit2->setReadOnly(true);
GroupPoints2->LineEdit3->setReadOnly(true);
Group2Points->LineEdit1->setReadOnly(true);
Group2Points->LineEdit2->setReadOnly(true);
Group2Points->LineEdit3->setReadOnly(true);
GroupPoints3->LineEdit1->setReadOnly(true);
GroupDXDYDZ->LineEdit1->setReadOnly(true);
GroupPoints->LineEdit1->setText("");
GroupPoints->LineEdit2->setText("");
GroupVecH->LineEdit1->setText("");
GroupVecH->LineEdit2->setText("");
GroupPoints2->LineEdit1->setText("");
GroupPoints2->LineEdit2->setText("");
GroupPoints2->LineEdit3->setText("");
Group2Points->LineEdit1->setText("");
Group2Points->LineEdit2->setText("");
Group2Points->LineEdit3->setText("");
GroupPoints3->LineEdit1->setText("");
GroupDXDYDZ->LineEdit1->setText("");
myBaseObjects.clear();
myPoint1.nullify();
@ -176,29 +199,36 @@ void GenerationGUI_PrismDlg::Init()
connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupVecH->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupVecH->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupVecH->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
connect(GroupVecH->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(GroupVecH->CheckBox2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
connect(GroupVecH->CheckBox3, SIGNAL(toggled(bool)), this, SLOT(onScalePrism()));
connect(GroupVecH->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints2->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(Group2Points->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group2Points->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group2Points->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group2Points->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(Group2Points->CheckBox2, SIGNAL(toggled(bool)), this, SLOT(onScalePrism()));
connect(Group2Points->SpinBox1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints3->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints3->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints3->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(GroupDXDYDZ->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupDXDYDZ->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDXDYDZ->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDXDYDZ->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDXDYDZ->SpinBox_SC, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDXDYDZ->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(GroupDXDYDZ->CheckBox2, SIGNAL(toggled(bool)), this, SLOT(onScalePrism()));
initName(tr("GEOM_EXTRUSION"));
ConstructorsClicked(0);
onBothway();
}
//=================================================================================
@ -207,10 +237,10 @@ void GenerationGUI_PrismDlg::Init()
//=================================================================================
void GenerationGUI_PrismDlg::SetDoubleSpinBoxStep (double step)
{
GroupPoints->SpinBox_DX->setSingleStep(step);
GroupPoints3->SpinBox_DX->setSingleStep(step);
GroupPoints3->SpinBox_DY->setSingleStep(step);
GroupPoints3->SpinBox_DZ->setSingleStep(step);
GroupVecH->SpinBox_DX->setSingleStep(step);
GroupDXDYDZ->SpinBox_DX->setSingleStep(step);
GroupDXDYDZ->SpinBox_DY->setSingleStep(step);
GroupDXDYDZ->SpinBox_DZ->setSingleStep(step);
}
//=================================================================================
@ -221,33 +251,33 @@ void GenerationGUI_PrismDlg::ConstructorsClicked (int constructorId)
{
switch (constructorId) {
case 0:
GroupPoints2->hide();
GroupPoints3->hide();
GroupPoints->show();
GroupPoints->LineEdit2->setText("");
Group2Points->hide();
GroupDXDYDZ->hide();
GroupVecH->show();
GroupVecH->LineEdit2->setText("");
myVec.nullify();
GroupPoints->PushButton1->click();
GroupVecH->PushButton1->click();
break;
case 1:
GroupPoints->hide();
GroupPoints2->show();
GroupPoints3->hide();
GroupPoints2->LineEdit2->setText("");
GroupPoints2->LineEdit3->setText("");
GroupVecH->hide();
Group2Points->show();
GroupDXDYDZ->hide();
Group2Points->LineEdit2->setText("");
Group2Points->LineEdit3->setText("");
myPoint1.nullify();
myPoint2.nullify();
GroupPoints2->PushButton1->click();
Group2Points->PushButton1->click();
break;
case 2:
GroupPoints->hide();
GroupPoints2->hide();
GroupPoints3->show();
GroupPoints3->PushButton1->click();
GroupVecH->hide();
Group2Points->hide();
GroupDXDYDZ->show();
GroupDXDYDZ->PushButton1->click();
break;
default:
break;
@ -295,58 +325,58 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
erasePreview();
myEditCurrentArgument->setText("");
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ||
myEditCurrentArgument == GroupPoints2->LineEdit1 ||
myEditCurrentArgument == GroupPoints3->LineEdit1 ) {
if ( myEditCurrentArgument == GroupVecH->LineEdit1 ||
myEditCurrentArgument == Group2Points->LineEdit1 ||
myEditCurrentArgument == GroupDXDYDZ->LineEdit1 ) {
myBaseObjects.clear();
QList<GEOM::GeomObjPtr> objects = getSelected( TopAbs_SHAPE, -1 );
for ( int i = 0; i < objects.count(); i++ ) {
GEOM::shape_type stype = objects[i]->GetMaxShapeType();
if ( stype < GEOM::SHELL || stype > GEOM::VERTEX )
continue;
continue;
myBaseObjects << objects[i];
}
if ( !myBaseObjects.isEmpty() ) {
QString aName = myBaseObjects.count() > 1 ? QString( "%1_objects").arg( myBaseObjects.count() ) : GEOMBase::GetName( myBaseObjects[0].get() );
GroupPoints->LineEdit1->setText( aName );
GroupPoints2->LineEdit1->setText( aName );
GroupPoints3->LineEdit1->setText( aName );
GroupVecH->LineEdit1->setText( aName );
Group2Points->LineEdit1->setText( aName );
GroupDXDYDZ->LineEdit1->setText( aName );
}
else {
GroupPoints->LineEdit1->setText( "" );
GroupPoints2->LineEdit1->setText( "" );
GroupPoints3->LineEdit1->setText( "" );
GroupVecH->LineEdit1->setText( "" );
Group2Points->LineEdit1->setText( "" );
GroupDXDYDZ->LineEdit1->setText( "" );
}
}
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
else if ( myEditCurrentArgument == GroupVecH->LineEdit2 ) {
myVec = getSelected( TopAbs_EDGE );
if ( myVec ) {
QString aName = GEOMBase::GetName( myVec.get() );
myEditCurrentArgument->setText( aName );
if ( myBaseObjects.isEmpty() )
GroupPoints->PushButton1->click();
GroupVecH->PushButton1->click();
}
}
if ( myEditCurrentArgument == GroupPoints2->LineEdit2 ) {
if ( myEditCurrentArgument == Group2Points->LineEdit2 ) {
myPoint1 = getSelected( TopAbs_VERTEX );
if ( myPoint1 ) {
QString aName = GEOMBase::GetName( myPoint1.get() );
myEditCurrentArgument->setText( aName );
if ( !myPoint2 )
GroupPoints2->PushButton3->click();
Group2Points->PushButton3->click();
else if ( myBaseObjects.isEmpty() )
GroupPoints2->PushButton1->click();
Group2Points->PushButton1->click();
}
}
if ( myEditCurrentArgument == GroupPoints2->LineEdit3 ) {
if ( myEditCurrentArgument == Group2Points->LineEdit3 ) {
myPoint2 = getSelected( TopAbs_VERTEX );
if ( myPoint2 ) {
QString aName = GEOMBase::GetName( myPoint2.get() );
myEditCurrentArgument->setText( aName );
if ( myBaseObjects.isEmpty() )
GroupPoints2->PushButton1->click();
Group2Points->PushButton1->click();
else if ( !myPoint1 )
GroupPoints2->PushButton2->click();
Group2Points->PushButton2->click();
}
}
@ -363,42 +393,42 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
globalSelection(GEOM_ALLSHAPES);
if (send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->PushButton2->setDown(false);
GroupPoints->LineEdit2->setEnabled(false);
if (send == GroupVecH->PushButton1) {
myEditCurrentArgument = GroupVecH->LineEdit1;
GroupVecH->PushButton2->setDown(false);
GroupVecH->LineEdit2->setEnabled(false);
}
else if (send == GroupPoints->PushButton2) {
myEditCurrentArgument = GroupPoints->LineEdit2;
GroupPoints->PushButton1->setDown(false);
GroupPoints->LineEdit1->setEnabled(false);
else if (send == GroupVecH->PushButton2) {
myEditCurrentArgument = GroupVecH->LineEdit2;
GroupVecH->PushButton1->setDown(false);
GroupVecH->LineEdit1->setEnabled(false);
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
}
else if (send == GroupPoints2->PushButton1) {
myEditCurrentArgument = GroupPoints2->LineEdit1;
GroupPoints2->PushButton2->setDown(false);
GroupPoints2->PushButton3->setDown(false);
GroupPoints2->LineEdit2->setEnabled(false);
GroupPoints2->LineEdit3->setEnabled(false);
else if (send == Group2Points->PushButton1) {
myEditCurrentArgument = Group2Points->LineEdit1;
Group2Points->PushButton2->setDown(false);
Group2Points->PushButton3->setDown(false);
Group2Points->LineEdit2->setEnabled(false);
Group2Points->LineEdit3->setEnabled(false);
}
else if (send == GroupPoints2->PushButton2) {
myEditCurrentArgument = GroupPoints2->LineEdit2;
GroupPoints2->PushButton1->setDown(false);
GroupPoints2->PushButton3->setDown(false);
GroupPoints2->LineEdit1->setEnabled(false);
GroupPoints2->LineEdit3->setEnabled(false);
else if (send == Group2Points->PushButton2) {
myEditCurrentArgument = Group2Points->LineEdit2;
Group2Points->PushButton1->setDown(false);
Group2Points->PushButton3->setDown(false);
Group2Points->LineEdit1->setEnabled(false);
Group2Points->LineEdit3->setEnabled(false);
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
}
else if (send == GroupPoints2->PushButton3) {
myEditCurrentArgument = GroupPoints2->LineEdit3;
GroupPoints2->PushButton1->setDown(false);
GroupPoints2->PushButton2->setDown(false);
GroupPoints2->LineEdit1->setEnabled(false);
GroupPoints2->LineEdit2->setEnabled(false);
else if (send == Group2Points->PushButton3) {
myEditCurrentArgument = Group2Points->LineEdit3;
Group2Points->PushButton1->setDown(false);
Group2Points->PushButton2->setDown(false);
Group2Points->LineEdit1->setEnabled(false);
Group2Points->LineEdit2->setEnabled(false);
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
}
else if (send == GroupPoints3->PushButton1) {
myEditCurrentArgument = GroupPoints3->LineEdit1;
else if (send == GroupDXDYDZ->PushButton1) {
myEditCurrentArgument = GroupDXDYDZ->LineEdit1;
}
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
this, SLOT(SelectionIntoArgument()));
@ -446,15 +476,6 @@ void GenerationGUI_PrismDlg::ValueChangedInSpinBox()
displayPreview();
}
//=================================================================================
// function : getHeight()
// purpose :
//=================================================================================
double GenerationGUI_PrismDlg::getHeight() const
{
return GroupPoints->SpinBox_DX->value();
}
//=================================================================================
// function : createOperation
// purpose :
@ -473,16 +494,16 @@ bool GenerationGUI_PrismDlg::isValid (QString& msg)
bool ok = false;
switch ( getConstructorId() ) {
case 0:
ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) &&
ok = GroupVecH->SpinBox_DX->isValid( msg, !IsPreview() ) &&
!myBaseObjects.isEmpty() && myVec;
break;
case 1:
ok = !myBaseObjects.isEmpty() && myPoint1 && myPoint2;
break;
case 2:
ok = GroupPoints3->SpinBox_DX->isValid( msg, !IsPreview() ) &&
GroupPoints3->SpinBox_DY->isValid( msg, !IsPreview() ) &&
GroupPoints3->SpinBox_DZ->isValid( msg, !IsPreview() ) &&
ok = GroupDXDYDZ->SpinBox_DX->isValid( msg, !IsPreview() ) &&
GroupDXDYDZ->SpinBox_DY->isValid( msg, !IsPreview() ) &&
GroupDXDYDZ->SpinBox_DZ->isValid( msg, !IsPreview() ) &&
!myBaseObjects.isEmpty();
break;
default:
@ -492,6 +513,62 @@ bool GenerationGUI_PrismDlg::isValid (QString& msg)
return ok;
}
//=================================================================================
// function : onReverse()
// purpose :
//=================================================================================
void GenerationGUI_PrismDlg::onReverse()
{
double anOldValue = GroupVecH->SpinBox_DX->value();
GroupVecH->SpinBox_DX->setValue(-anOldValue);
}
//=================================================================================
// function : onBothway()
// purpose :
//=================================================================================
void GenerationGUI_PrismDlg::onBothway()
{
GroupVecH->CheckBox2->setEnabled(!GroupVecH->CheckBox1->isChecked()); // is reversed
GroupVecH->CheckBox3->setEnabled(!GroupVecH->CheckBox1->isChecked()); // is scaled
GroupVecH->TextLabel4->setEnabled(!GroupVecH->CheckBox1->isChecked() &&
GroupVecH->CheckBox3->isChecked()); // scale factor
GroupVecH->SpinBox_DY->setEnabled(!GroupVecH->CheckBox1->isChecked() &&
GroupVecH->CheckBox3->isChecked()); // scale factor
Group2Points->CheckBox2->setEnabled(!Group2Points->CheckBox1->isChecked()); // is scaled
Group2Points->TextLabel4->setEnabled(!Group2Points->CheckBox1->isChecked() &&
Group2Points->CheckBox2->isChecked()); // scale factor
Group2Points->SpinBox1->setEnabled(!Group2Points->CheckBox1->isChecked() &&
Group2Points->CheckBox2->isChecked()); // scale factor
GroupDXDYDZ->CheckBox2->setEnabled(!GroupDXDYDZ->CheckBox1->isChecked()); // is scaled
GroupDXDYDZ->TextLabel5->setEnabled(!GroupDXDYDZ->CheckBox1->isChecked() &&
GroupDXDYDZ->CheckBox2->isChecked()); // scale factor
GroupDXDYDZ->SpinBox_SC->setEnabled(!GroupDXDYDZ->CheckBox1->isChecked() &&
GroupDXDYDZ->CheckBox2->isChecked()); // scale factor
displayPreview();
}
//=================================================================================
// function : onScalePrism()
// purpose :
//=================================================================================
void GenerationGUI_PrismDlg::onScalePrism()
{
GroupVecH->TextLabel4->setEnabled(GroupVecH->CheckBox3->isChecked());
GroupVecH->SpinBox_DY->setEnabled(GroupVecH->CheckBox3->isChecked());
Group2Points->TextLabel4->setEnabled(Group2Points->CheckBox2->isChecked());
Group2Points->SpinBox1->setEnabled(Group2Points->CheckBox2->isChecked());
GroupDXDYDZ->TextLabel5->setEnabled(GroupDXDYDZ->CheckBox2->isChecked());
GroupDXDYDZ->SpinBox_SC->setEnabled(GroupDXDYDZ->CheckBox2->isChecked());
displayPreview();
}
//=================================================================================
// function : execute
// purpose :
@ -506,68 +583,66 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
for (int i = 0; i < myBaseObjects.count(); i++) {
switch (getConstructorId()) {
case 0:
if (!GroupPoints->CheckButton1->isChecked())
anObj = anOper->MakePrismVecH(myBaseObjects[i].get(), myVec.get(), getHeight());
else
anObj = anOper->MakePrismVecH2Ways(myBaseObjects[i].get(), myVec.get(), getHeight());
if (GroupVecH->CheckBox1->isChecked())
anObj = anOper->MakePrismVecH2Ways(myBaseObjects[i].get(), myVec.get(),
GroupVecH->SpinBox_DX->value());
else {
if (GroupVecH->CheckBox3->isChecked())
anObj = anOper->MakePrismVecHWithScaling(myBaseObjects[i].get(), myVec.get(),
GroupVecH->SpinBox_DX->value(),
GroupVecH->SpinBox_DY->value());
else
anObj = anOper->MakePrismVecH(myBaseObjects[i].get(), myVec.get(),
GroupVecH->SpinBox_DX->value());
}
if (!anObj->_is_nil() && !IsPreview()) {
aParameters << GroupPoints->SpinBox_DX->text();
aParameters << GroupVecH->SpinBox_DX->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
break;
case 1:
if (!GroupPoints2->CheckButton1->isChecked())
anObj = anOper->MakePrismTwoPnt(myBaseObjects[i].get(), myPoint1.get(), myPoint2.get());
else
if (Group2Points->CheckBox1->isChecked())
anObj = anOper->MakePrismTwoPnt2Ways(myBaseObjects[i].get(), myPoint1.get(), myPoint2.get());
else {
if (Group2Points->CheckBox2->isChecked())
anObj = anOper->MakePrismTwoPntWithScaling(myBaseObjects[i].get(), myPoint1.get(),
myPoint2.get(), Group2Points->SpinBox1->value());
else
anObj = anOper->MakePrismTwoPnt(myBaseObjects[i].get(), myPoint1.get(), myPoint2.get());
}
break;
case 2:
double dx = GroupPoints3->SpinBox_DX->value();
double dy = GroupPoints3->SpinBox_DY->value();
double dz = GroupPoints3->SpinBox_DZ->value();
if (!GroupPoints3->CheckButton1->isChecked())
anObj = anOper->MakePrismDXDYDZ(myBaseObjects[i].get(), dx, dy, dz);
else
double dx = GroupDXDYDZ->SpinBox_DX->value();
double dy = GroupDXDYDZ->SpinBox_DY->value();
double dz = GroupDXDYDZ->SpinBox_DZ->value();
if (GroupDXDYDZ->CheckBox1->isChecked())
anObj = anOper->MakePrismDXDYDZ2Ways(myBaseObjects[i].get(), dx, dy, dz);
else {
if (GroupDXDYDZ->CheckBox2->isChecked())
anObj = anOper->MakePrismDXDYDZWithScaling(myBaseObjects[i].get(), dx, dy, dz,
GroupDXDYDZ->SpinBox_SC->value());
else
anObj = anOper->MakePrismDXDYDZ(myBaseObjects[i].get(), dx, dy, dz);
}
if (!anObj->_is_nil() && !IsPreview()) {
aParameters << GroupPoints3->SpinBox_DX->text();
aParameters << GroupPoints3->SpinBox_DY->text();
aParameters << GroupPoints3->SpinBox_DZ->text();
aParameters << GroupDXDYDZ->SpinBox_DX->text();
aParameters << GroupDXDYDZ->SpinBox_DY->text();
aParameters << GroupDXDYDZ->SpinBox_DZ->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
break;
}
if (!anObj->_is_nil())
objects.push_back(anObj._retn());
}
return true;
}
//=================================================================================
// function : onReverse()
// purpose :
//=================================================================================
void GenerationGUI_PrismDlg::onReverse()
{
double anOldValue = GroupPoints->SpinBox_DX->value();
GroupPoints->SpinBox_DX->setValue(-anOldValue);
}
//=================================================================================
// function : onBothway()
// purpose :
//=================================================================================
void GenerationGUI_PrismDlg::onBothway()
{
GroupPoints->CheckButton2->setEnabled(!GroupPoints->CheckButton1->isChecked());
displayPreview();
}
//=================================================================================
// function : addSubshapeToStudy
// purpose : virtual method to add new SubObjects if local selection

View File

@ -18,21 +18,20 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : GenerationGUI_PrismDlg.h
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef GENERATIONGUI_PRISMDLG_H
#define GENERATIONGUI_PRISMDLG_H
#include "GEOMBase_Skeleton.h"
#include "GEOM_GenericObjPtr.h"
class DlgRef_2Sel1Spin2Check;
class DlgRef_3Sel1Check;
class DlgRef_1Sel3Spin1Check;
class DlgRef_2Sel2Spin3Check;
class DlgRef_3Sel3Spin2Check;
class DlgRef_1Sel4Spin2Check;
//=================================================================================
// class : GenerationGUI_PrismDlg
@ -57,16 +56,15 @@ protected:
private:
void Init();
void enterEvent( QEvent* );
double getHeight() const;
private:
QList<GEOM::GeomObjPtr> myBaseObjects; /* Base shapes */
GEOM::GeomObjPtr myVec; /* Vector, defining the direction */
GEOM::GeomObjPtr myPoint1, myPoint2; /* Points for extrusion */
DlgRef_2Sel1Spin2Check* GroupPoints;
DlgRef_3Sel1Check* GroupPoints2; // for second layout for extrusion using 2 points
DlgRef_1Sel3Spin1Check* GroupPoints3;
DlgRef_2Sel2Spin3Check* GroupVecH;
DlgRef_3Sel3Spin2Check* Group2Points;
DlgRef_1Sel4Spin2Check* GroupDXDYDZ;
private slots:
void ClickOnOk();
@ -79,6 +77,7 @@ private slots:
void SetDoubleSpinBoxStep( double );
void onReverse();
void onBothway();
void onScalePrism();
};
#endif // GENERATIONGUI_PRISMDLG_H