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.
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.
/* 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
/*!
* 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,
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) ;
// 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>
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" ) );
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 );
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() ) );
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();
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;
}
// 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
#include <list>
-class DlgRef_1Sel1Check;
+class DlgRef_1Sel3Check;
//=================================================================================
// class : BasicGUI_CurveDlg
void enterEvent( QEvent* );
private:
- DlgRef_1Sel1Check* GroupPoints;
+ DlgRef_1Sel3Check* GroupPoints;
QList<GEOM::GeomObjPtr> myPoints;
private slots:
// 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"
//////////////////////////////////////////
{
}
+//////////////////////////////////////////
+// DlgRef_1Sel4Spin2Check
+//////////////////////////////////////////
+
+DlgRef_1Sel4Spin2Check::DlgRef_1Sel4Spin2Check( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+ setupUi( this );
+}
+
+DlgRef_1Sel4Spin2Check::~DlgRef_1Sel4Spin2Check()
+{
+}
+
//////////////////////////////////////////
// DlgRef_1Sel4Spin
//////////////////////////////////////////
{
}
+//////////////////////////////////////////
+// DlgRef_2Sel2Spin3Check
+//////////////////////////////////////////
+
+DlgRef_2Sel2Spin3Check::DlgRef_2Sel2Spin3Check( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+ setupUi( this );
+}
+
+DlgRef_2Sel2Spin3Check::~DlgRef_2Sel2Spin3Check()
+{
+}
+
//////////////////////////////////////////
// DlgRef_2Sel2Spin
//////////////////////////////////////////
// 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
~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
//////////////////////////////////////////
~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
//////////////////////////////////////////
# 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
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
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
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
--- /dev/null
+<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>
--- /dev/null
+<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>
# 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
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 \
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 \
// 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"
}
}
+ TPythonDump& TPythonDump::operator<< (bool theArg)
+ {
+ if (theArg)
+ myStream << "True";
+ else
+ myStream << "False";
+ return *this;
+ }
+
TPythonDump& TPythonDump::operator<< (long int theArg)
{
myStream<<theArg;
// 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_
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);
<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>
<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>
// 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_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
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theVec,
- double theH)
+ double theH, double theScaleFactor)
{
SetErrorCode(KO);
aCI.SetBase(aRefBase);
aCI.SetVector(aRefVec);
aCI.SetH(theH);
+ aCI.SetScale(theScaleFactor);
//Compute the Prism value
try {
}
//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;
//=============================================================================
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);
aCI.SetBase(aRefBase);
aCI.SetFirstPoint(aRefPnt1);
aCI.SetLastPoint(aRefPnt2);
+ aCI.SetScale(theScaleFactor);
//Compute the Prism value
try {
}
//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;
*/
//=============================================================================
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);
aCI.SetDX(theDX);
aCI.SetDY(theDY);
aCI.SetDZ(theDZ);
+ aCI.SetScale(theScaleFactor);
//Compute the Prism value
try {
}
//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;
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)
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);
Handle(Standard_Transient) anItem = theSeqSections->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) aSectObj = Handle(GEOM_Object)::DownCast(anItem);
if(!aSectObj.IsNull())
{
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;
pyDump<<", ";
}
}
-
+
pyDump<< "],"<<theModeSolid << "," << thePreci <<","<< theRuled <<")";
SetErrorCode(OK);
return aThruSect;
-
-
}
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 =
Handle(Standard_Transient) anItem = theBases->Value(i);
if(anItem.IsNull())
continue;
-
+
Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
if(aBase.IsNull())
continue;
Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
if(anItemLoc.IsNull())
continue;
-
+
Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
if(aLoc.IsNull())
continue;
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
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;
-
-
}
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 =
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
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<<")";
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 =
aCI.SetBases(aSeqBases);
aCI.SetLocations(aSeqLocs);
-
+
//Compute the Pipe value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
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<< "])";
SetErrorCode(OK);
return aPipe;
}
-
// 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_
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,
// 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>
}
-//=============================================================================
-/*!
- * 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
return anArc;
}
+//=============================================================================
+/*!
+ * MakePolyline
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline (std::list<Handle(GEOM_Object)> thePoints,
+ bool theIsClosed)
+{
+ 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);
+ }
+
+ 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("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 << "], " << theIsClosed << ")";
+
+ SetErrorCode(OK);
+ return aPolyline;
+}
+
//=============================================================================
/*!
* MakeSplineBezier
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier
- (std::list<Handle(GEOM_Object)> thePoints)
+ (std::list<Handle(GEOM_Object)> thePoints,
+ bool theIsClosed)
{
SetErrorCode(KO);
aCI.SetPoint(ind, aRefPnt);
}
+ aCI.SetIsClosed(theIsClosed);
+
//Compute the Spline value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
while (it != thePoints.end()) {
pd << ", " << (*it++);
}
- pd << "])";
+ pd << "], " << theIsClosed << ")";
SetErrorCode(OK);
return aSpline;
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
(std::list<Handle(GEOM_Object)> thePoints,
- bool theIsClosed)
+ bool theIsClosed,
+ bool theDoReordering)
{
SetErrorCode(KO);
}
aCI.SetIsClosed(theIsClosed);
+ aCI.SetDoReordering(theDoReordering);
//Compute the Spline value
try {
while (it != thePoints.end()) {
pd << ", " << (*it++);
}
- pd << "]";
- if ( theIsClosed ) pd << ", True";
- pd << ")";
+ pd << "], " << theIsClosed << ", " << theDoReordering << ")";
SetErrorCode(OK);
return aSpline;
// 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_
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);
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);
// 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
{
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;
// 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
#define PRISM_ARG_DX 6
#define PRISM_ARG_DY 7
#define PRISM_ARG_DZ 8
+#define PRISM_ARG_SCALE 9
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); }
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;
// 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
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:
// 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_Types.hxx>
#include <GEOM_Function.hxx>
-//#include <GEOMAlgo_GlueAnalyser.hxx>
-
#include <ShapeAnalysis_FreeBounds.hxx>
#include <ShapeAnalysis_Edge.hxx>
#include <ShapeFix_Face.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Compound.hxx>
#include <TopTools_SequenceOfShape.hxx>
+#include <TopTools_HSequenceOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
ShapeAnalysis_Edge sae;
while(1) {
- if(!aMapVertEdge1.Contains(VS1))
+ if (!aMapVertEdge1.Contains(VS1))
MESSAGE (" FillForOtherEdges: map aMapVertEdge1 not contains key VS1");
const TopTools_ListOfShape& aList1 = aMapVertEdge1.FindFromKey(VS1);
//TopoDS_Shape E1next;
TopTools_ListIteratorOfListOfShape anIter1(aList1);
- if(anIter1.Value().IsSame(ES1)) {
+ if (anIter1.Value().IsSame(ES1)) {
anIter1.Next();
}
//E1next = anIter1.Value();
- if(!aMapVertEdge2.Contains(VS2))
+ if (!aMapVertEdge2.Contains(VS2))
MESSAGE (" FillForOtherEdges: map aMapVertEdge2 not contains key VS2");
const TopTools_ListOfShape& aList2 = aMapVertEdge2.FindFromKey(VS2);
//TopoDS_Shape E2next;
TopTools_ListIteratorOfListOfShape anIter2(aList2);
- if(anIter2.Value().IsSame(ES2)) {
+ if (anIter2.Value().IsSame(ES2)) {
anIter2.Next();
}
//E2next = anIter2.Value();
//ES2 = TopoDS::Edge(E2next);
ES1 = TopoDS::Edge(anIter1.Value());
ES2 = TopoDS::Edge(anIter2.Value());
- if(!FF.Contains(ES1)) {
+ if (!FF.Contains(ES1)) {
FF.Add(ES1,ES2);
}
- if(VS1.IsSame(sae.FirstVertex(ES1)))
+ if (VS1.IsSame(sae.FirstVertex(ES1)))
VS1 = sae.LastVertex(ES1);
else
VS1 = sae.FirstVertex(ES1);
- if(VS2.IsSame(sae.FirstVertex(ES2)))
+ if (VS2.IsSame(sae.FirstVertex(ES2)))
VS2 = sae.LastVertex(ES2);
else
VS2 = sae.FirstVertex(ES2);
- if(VS1.IsSame(V1))
+ if (VS1.IsSame(V1))
break;
- if(!FF.Contains(VS1)) {
+ if (!FF.Contains(VS1)) {
FF.Add(VS1,VS2);
}
}
BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
aBuilder.Add(aWire1, aLoc1);
aBuilder.Add(aWire2, aLoc2);
- if(!aBuilder.IsReady()) {
+ if (!aBuilder.IsReady()) {
return false;
}
aBuilder.Build();
BRepTools::Write(C,"/dn02/users_Linux/skl/work/Bugs/14857/comp.brep");
*/
ShapeAnalysis_Edge sae;
- double tol = Max( BRep_Tool::Tolerance(TopoDS::Face(FS1)),
- BRep_Tool::Tolerance(TopoDS::Face(FS2)) );
+ double tol = Max(BRep_Tool::Tolerance(TopoDS::Face(FS1)),
+ BRep_Tool::Tolerance(TopoDS::Face(FS2)));
TopTools_MapOfShape Vs1,Vs2;
TopExp_Explorer exp;
- exp.Init( FS1, TopAbs_EDGE );
+ exp.Init(FS1, TopAbs_EDGE);
TopoDS_Edge E1 = TopoDS::Edge(exp.Current());
TopoDS_Vertex V11 = sae.FirstVertex(E1);
TopoDS_Vertex V21 = sae.LastVertex(E1);
//cout<<"P21("<<P21.X()<<","<<P21.Y()<<","<<P21.Z()<<")"<<endl;
// find corresponding vertexes from created shape
TopoDS_Vertex VN11,VN21;
- for( exp.Init( aShape, TopAbs_VERTEX ); exp.More(); exp.Next() ) {
+ for (exp.Init(aShape, TopAbs_VERTEX); exp.More(); exp.Next()) {
TopoDS_Vertex V = TopoDS::Vertex(exp.Current());
gp_Pnt P = BRep_Tool::Pnt(V);
- if(P.Distance(P11)<tol) {
+ if (P.Distance(P11)<tol) {
VN11 = V;
}
- if(P.Distance(P21)<tol) {
+ if (P.Distance(P21)<tol) {
VN21 = V;
}
}
// find edge contains VN11 and VN21 and corresponding vertexes
TopoDS_Vertex VN12,VN22;
- for( exp.Init( aShape, TopAbs_FACE ); exp.More(); exp.Next() ) {
+ for (exp.Init(aShape, TopAbs_FACE); exp.More(); exp.Next()) {
TopoDS_Shape F = exp.Current();
TopExp_Explorer expe;
bool IsFind = false;
- for( expe.Init( F, TopAbs_EDGE ); expe.More(); expe.Next() ) {
+ for (expe.Init(F, TopAbs_EDGE); expe.More(); expe.Next()) {
TopoDS_Edge E = TopoDS::Edge(expe.Current());
TopoDS_Vertex VF = sae.FirstVertex(E);
TopoDS_Vertex VL = sae.LastVertex(E);
- if( (VF.IsSame(VN11) && VL.IsSame(VN21)) || (VF.IsSame(VN21) && VL.IsSame(VN11)) ) {
+ if ((VF.IsSame(VN11) && VL.IsSame(VN21)) || (VF.IsSame(VN21) && VL.IsSame(VN11))) {
IsFind = true;
break;
}
}
- if(IsFind) {
- for( expe.Init( F, TopAbs_EDGE ); expe.More(); expe.Next() ) {
+ if (IsFind) {
+ for (expe.Init(F, TopAbs_EDGE); expe.More(); expe.Next()) {
TopoDS_Edge E = TopoDS::Edge(expe.Current());
TopoDS_Vertex VF = sae.FirstVertex(E);
TopoDS_Vertex VL = sae.LastVertex(E);
- if( VF.IsSame(VN11) && !VL.IsSame(VN21) )
+ if (VF.IsSame(VN11) && !VL.IsSame(VN21))
VN12 = VL;
- if( VL.IsSame(VN11) && !VF.IsSame(VN21) )
+ if (VL.IsSame(VN11) && !VF.IsSame(VN21))
VN12 = VF;
- if( VF.IsSame(VN21) && !VL.IsSame(VN11) )
+ if (VF.IsSame(VN21) && !VL.IsSame(VN11))
VN22 = VL;
- if( VL.IsSame(VN21) && !VF.IsSame(VN11) )
+ if (VL.IsSame(VN21) && !VF.IsSame(VN11))
VN22 = VF;
}
break;
//cout<<"PN22("<<PN22.X()<<","<<PN22.Y()<<","<<PN22.Z()<<")"<<endl;
TopoDS_Edge E2;
TopExp_Explorer expe;
- for( expe.Init( FS2, TopAbs_EDGE ); expe.More(); expe.Next() ) {
+ for (expe.Init(FS2, TopAbs_EDGE); expe.More(); expe.Next()) {
TopoDS_Edge E = TopoDS::Edge(expe.Current());
TopoDS_Vertex VF = sae.FirstVertex(E);
TopoDS_Vertex VL = sae.LastVertex(E);
gp_Pnt PF = BRep_Tool::Pnt(VF);
gp_Pnt PL = BRep_Tool::Pnt(VL);
- if( PF.Distance(PN12)<tol && PL.Distance(PN22)<tol ) {
+ if (PF.Distance(PN12)<tol && PL.Distance(PN22)<tol) {
V12 = VF;
V22 = VL;
E2 = E;
break;
}
- if( PF.Distance(PN22)<tol && PL.Distance(PN12)<tol ) {
+ if (PF.Distance(PN22)<tol && PL.Distance(PN12)<tol) {
V12 = VL;
V22 = VF;
E2 = E;
gp_Vec aDir(P1,P2);
ShapeAnalysis_Edge sae;
- double tol = Max( BRep_Tool::Tolerance(TopoDS::Face(FS1)),
- BRep_Tool::Tolerance(TopoDS::Face(FS2)) );
+ double tol = Max(BRep_Tool::Tolerance(TopoDS::Face(FS1)),
+ BRep_Tool::Tolerance(TopoDS::Face(FS2)));
TopTools_MapOfShape Vs1,Vs2;
TopoDS_Vertex V11=aLoc1, V12=aLoc2, V21, V22;
TopoDS_Edge E1,E2;
TopExp_Explorer exp1;
- for( exp1.Init(FS1,TopAbs_EDGE); exp1.More(); exp1.Next() ) {
+ for (exp1.Init(FS1,TopAbs_EDGE); exp1.More(); exp1.Next()) {
E1 = TopoDS::Edge(exp1.Current());
TopoDS_Vertex V1 = sae.FirstVertex(E1);
TopoDS_Vertex V2 = sae.LastVertex(E1);
gp_Pnt Ptmp2 = BRep_Tool::Pnt(V2);
//cout<<"P11("<<P11.X()<<","<<P11.Y()<<","<<P11.Z()<<")"<<endl;
//cout<<"P21("<<P21.X()<<","<<P21.Y()<<","<<P21.Z()<<")"<<endl;
- if(P1.Distance(Ptmp1)<tol) {
+ if (P1.Distance(Ptmp1)<tol) {
V21 = V2;
break;
}
- if(P1.Distance(Ptmp2)<tol) {
+ if (P1.Distance(Ptmp2)<tol) {
V21 = V1;
break;
}
TopoDS_Edge E21,E22;
TopoDS_Vertex VE21,VE22;
int nbe=0;
- for( exp1.Init(FS2,TopAbs_EDGE); exp1.More() && nbe<2; exp1.Next() ) {
+ for (exp1.Init(FS2,TopAbs_EDGE); exp1.More() && nbe<2; exp1.Next()) {
TopoDS_Edge E = TopoDS::Edge(exp1.Current());
TopoDS_Vertex V1 = sae.FirstVertex(E);
TopoDS_Vertex V2 = sae.LastVertex(E);
gp_Pnt Ptmp1 = BRep_Tool::Pnt(V1);
gp_Pnt Ptmp2 = BRep_Tool::Pnt(V2);
- if(P2.Distance(Ptmp1)<tol) {
- if(nbe==0) {
+ if (P2.Distance(Ptmp1)<tol) {
+ if (nbe==0) {
E21 = E;
VE21 = V2;
nbe++;
}
- else if(nbe==1) {
+ else if (nbe==1) {
E22 = E;
VE22 = V2;
nbe++;
}
}
- if(P2.Distance(Ptmp2)<tol) {
- if(nbe==0) {
+ if (P2.Distance(Ptmp2)<tol) {
+ if (nbe==0) {
E21 = E;
VE21 = V1;
nbe++;
}
- else if(nbe==1) {
+ else if (nbe==1) {
E22 = E;
VE22 = V1;
nbe++;
gp_Vec aDir2(PV21,PE22);
double ang1 = aDir.Angle(aDir1);
double ang2 = aDir.Angle(aDir2);
- if(fabs(ang1)<fabs(ang2)) {
+ if (fabs(ang1)<fabs(ang2)) {
E2 = E21;
V22 = VE21;
}
{
//cout<<"FindNextPairOfFaces"<<endl;
TopExp_Explorer anExp;
- for ( anExp.Init( aCurFace, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aCurFace, TopAbs_EDGE); anExp.More(); anExp.Next()) {
TopoDS_Shape E1 = anExp.Current();
- if(!FF.Contains(E1)) {
- if(aCI) delete aCI;
+ if (!FF.Contains(E1)) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("FindNextPairOfFaces: Can not find edge in map");
}
- if(!FF.Contains(E1))
+ if (!FF.Contains(E1))
MESSAGE (" FindNextPairOfFaces: map FF not contains key E1");
const TopoDS_Shape& E2 = FF.FindFromKey(E1);
TopExp_Explorer anExpV;
- anExpV.Init( E1, TopAbs_VERTEX );
+ anExpV.Init(E1, TopAbs_VERTEX);
TopoDS_Shape V1 = anExpV.Current();
- if(!FF.Contains(V1)) {
- if(aCI) delete aCI;
+ if (!FF.Contains(V1)) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("FindNextPairOfFaces: Can not find vertex in map");
}
- if(!aMapEdgeFaces1.Contains(E1))
+ if (!aMapEdgeFaces1.Contains(E1))
MESSAGE (" FindNextPairOfFaces: map aMapEdgeFaces1 not contains key E1");
const TopTools_ListOfShape& aList1 = aMapEdgeFaces1.FindFromKey(E1);
- if(aList1.Extent()<2)
+ if (aList1.Extent()<2)
continue;
TopTools_ListIteratorOfListOfShape anIter(aList1);
- if(anIter.Value().IsEqual(aCurFace)) {
+ if (anIter.Value().IsEqual(aCurFace)) {
anIter.Next();
}
TopoDS_Shape F1other = anIter.Value();
- if(FF.Contains(F1other))
+ if (FF.Contains(F1other))
continue;
- if(!FF.Contains(aCurFace))
+ if (!FF.Contains(aCurFace))
MESSAGE (" FindNextPairOfFaces: map FF not contains key aCurFace");
const TopoDS_Shape& F2 = FF.FindFromKey(aCurFace);
- if(!aMapEdgeFaces2.Contains(E2))
+ if (!aMapEdgeFaces2.Contains(E2))
MESSAGE (" FindNextPairOfFaces: map aMapEdgeFaces2 not contains key E2");
const TopTools_ListOfShape& aList2 = aMapEdgeFaces2.FindFromKey(E2);
- if(aList2.Extent()<2) {
- if(aCI) delete aCI;
+ if (aList2.Extent()<2) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("FindNextPairOfFaces: Can not find corresponding face");
}
TopTools_ListIteratorOfListOfShape anIter2(aList2);
- if(anIter2.Value().IsEqual(F2)) {
+ if (anIter2.Value().IsEqual(F2)) {
anIter2.Next();
}
TopoDS_Shape F2other = anIter2.Value();
// add pairs of edges to FF
bool stat = FillForOtherEdges(F1other,E1,V1,FF);
- if( !stat ) {
- if(aCI) delete aCI;
+ if (!stat) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("FindNextPairOfFaces: Can not mapping other egdes");
}
TopoDS_Vertex V1new,V2new;
TopExp_Explorer exp;
double mindist = 1.e10;
- for( exp.Init( S1, TopAbs_VERTEX ); exp.More(); exp.Next() ) {
+ for (exp.Init(S1, TopAbs_VERTEX); exp.More(); exp.Next()) {
TopoDS_Vertex V = TopoDS::Vertex(exp.Current());
gp_Pnt P = BRep_Tool::Pnt(V);
double dist = P1.Distance(P);
- if(dist<mindist) {
+ if (dist<mindist) {
mindist = dist;
V1new = V;
}
}
mindist = 1.e10;
- for( exp.Init( S2, TopAbs_VERTEX ); exp.More(); exp.Next() ) {
+ for (exp.Init(S2, TopAbs_VERTEX); exp.More(); exp.Next()) {
TopoDS_Vertex V = TopoDS::Vertex(exp.Current());
gp_Pnt P = BRep_Tool::Pnt(V);
double dist = P2.Distance(P);
- if(dist<mindist) {
+ if (dist<mindist) {
mindist = dist;
V2new = V;
}
//cout<<" P2new("<<P2new.X()<<","<<P2new.Y()<<","<<P2new.Z()<<")"<<endl;
// replace vertexes if it is needed
- if(!V1.IsSame(V1new)) {
+ if (!V1.IsSame(V1new)) {
V1 = V1new;
P1 = BRep_Tool::Pnt(V1);
MESSAGE (" replace V1");
}
else
MESSAGE (" not replace V1");
- if(!V2.IsSame(V2new)) {
+ if (!V2.IsSame(V2new)) {
V2 = V2new;
P2 = BRep_Tool::Pnt(V2);
MESSAGE (" replace V2");
TopTools_IndexedDataMapOfShapeListOfShape aMapVertFaces2;
TopExp::MapShapesAndAncestors(S2, TopAbs_VERTEX, TopAbs_FACE, aMapVertFaces2);
- if(!aMapVertFaces1.Contains(V1))
+ if (!aMapVertFaces1.Contains(V1))
MESSAGE (" FindFirstPairFaces: map aMapVertFaces1 not contains key V1");
const TopTools_ListOfShape& aList1 = aMapVertFaces1.FindFromKey(V1);
TopTools_ListIteratorOfListOfShape anIter1(aList1);
// find middle point
double x1=0., y1=0., z1=0.;
int nbv1=0;
- for( exp.Init( FS1, TopAbs_VERTEX ); exp.More(); exp.Next() ) {
+ for (exp.Init(FS1, TopAbs_VERTEX); exp.More(); exp.Next()) {
TopoDS_Vertex V = TopoDS::Vertex(exp.Current());
gp_Pnt P = BRep_Tool::Pnt(V);
x1 += P.X();
TColgp_SequenceOfPnt Ps;
TopTools_SequenceOfShape Fs;
- if(!aMapVertFaces2.Contains(V2))
+ if (!aMapVertFaces2.Contains(V2))
MESSAGE (" FindFirstPairFaces: map aMapVertFaces2 not contains key V2");
const TopTools_ListOfShape& aList2 = aMapVertFaces2.FindFromKey(V2);
TopTools_ListIteratorOfListOfShape anIter2(aList2);
- for(; anIter2.More(); anIter2.Next()) {
+ for (; anIter2.More(); anIter2.Next()) {
TopoDS_Shape F = anIter2.Value();
double x2=0., y2=0., z2=0.;
int nbv2=0;
- for( exp.Init( F, TopAbs_VERTEX ); exp.More(); exp.Next() ) {
+ for (exp.Init(F, TopAbs_VERTEX); exp.More(); exp.Next()) {
TopoDS_Vertex V = TopoDS::Vertex(exp.Current());
gp_Pnt P = BRep_Tool::Pnt(V);
x2 += P.X();
int i=1;
double MinAng = PI;
int numface = 0;
- for(; i<=Fs.Length(); i++) {
+ for (; i<=Fs.Length(); i++) {
gp_Vec tmpDir(PM1,Ps(i));
double ang = fabs(aDir.Angle(tmpDir));
- if(ang<MinAng) {
+ if (ang<MinAng) {
MinAng = ang;
numface = i;
}
FS2 = Fs(numface);
}
+//=======================================================================
+//function : CreatePipeWithDifferentSections
+//purpose :
+//=======================================================================
+TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
+ (const TopoDS_Wire& theWirePath,
+ const Handle(TopTools_HSequenceOfShape) theHSeqBases,
+ const Handle(TopTools_HSequenceOfShape) theHSeqLocs,
+ const Standard_Boolean theWithContact,
+ const Standard_Boolean theWithCorrect)
+{
+ TopoDS_Shape aShape;
+
+ TopoDS_Wire aWirePath = theWirePath;
+
+ Standard_Integer nbBases = theHSeqBases->Length();
+ Standard_Integer nbLocs = (theHSeqLocs.IsNull() ? 0 : theHSeqLocs->Length());
+
+ if (nbLocs && nbLocs != nbBases) {
+ Standard_ConstructionError::Raise("Number of sections is not equal to number of locations ");
+ }
+
+ TopTools_SequenceOfShape aSeqBases;
+ TopTools_SequenceOfShape aSeqLocs;
+ TopTools_SequenceOfShape aSeqFaces;
+
+ Standard_Integer i = 1;
+ for (i = 1; i <= nbBases; i++) {
+ if (theHSeqBases->Value(i).IsNull())
+ continue;
+
+ // Make copy to prevent modifying of base object 0020766 : EDF 1320
+ TopoDS_Shape aShapeBase;
+ BRepBuilderAPI_Copy Copy (theHSeqBases->Value(i));
+ if (Copy.IsDone())
+ aShapeBase = Copy.Shape();
+
+ TopAbs_ShapeEnum aTypeBase = aShapeBase.ShapeType();
+
+ //if for section was specified face with a few wires then a few
+ // pipes were build and make solid
+ Standard_Boolean NeedCreateSolid = Standard_False;
+ if (aTypeBase == TopAbs_SHELL) {
+ // create wire as boundary contour if shell is no closed
+ // get free boundary shapes
+ ShapeAnalysis_FreeBounds anAnalizer(aShapeBase);
+ TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
+ TopExp_Explorer anExp;
+ TopoDS_Shape aWire;
+ Standard_Integer NbWires = 0;
+ for (anExp.Init(aClosed, TopAbs_WIRE); anExp.More(); anExp.Next()) {
+ NbWires++;
+ aWire = anExp.Current();
+ }
+ if (NbWires != 1) {
+ // bad case
+ Standard_ConstructionError::Raise("Bad shell is used as section ");
+ }
+ NeedCreateSolid = Standard_True;
+ aSeqFaces.Append(aShapeBase);
+ aSeqBases.Append(aWire);
+ }
+ else if (aTypeBase == TopAbs_FACE) {
+ NeedCreateSolid = Standard_True;
+ //for case one path should be used other type function
+ aSeqFaces.Append(aShapeBase);
+ TopExp_Explorer aExpW(aShapeBase,TopAbs_WIRE);
+ for (; aExpW.More(); aExpW.Next()) {
+ TopoDS_Shape aWireProf = aExpW.Current();
+ aSeqBases.Append(aWireProf);
+ }
+ }
+ else if (aTypeBase == TopAbs_WIRE || aTypeBase == TopAbs_VERTEX) {
+ aSeqBases.Append(aShapeBase);
+ }
+ else if (aTypeBase == TopAbs_EDGE) {
+ TopoDS_Edge anEdge = TopoDS::Edge(aShapeBase);
+ TopoDS_Shape aWireProf = BRepBuilderAPI_MakeWire(anEdge);
+ aSeqBases.Append(aWireProf);
+ }
+ if (nbLocs) {
+ TopoDS_Shape aShapeLoc = theHSeqLocs->Value(i);
+ if (aShapeLoc.IsNull() || aShapeLoc.ShapeType() != TopAbs_VERTEX)
+ continue;
+ aSeqLocs.Append(aShapeLoc);
+ }
+ }
+
+ nbLocs = aSeqLocs.Length();
+
+ // skl 02.05.2007
+ TopTools_SequenceOfShape Edges;
+ if (nbLocs > 0) {
+ // we have to check that each location shape is a vertex from
+ // path and update aSeqLocs if it is needed (and possible)
+ TColgp_SequenceOfPnt PLocs;
+ for (i=1; i<=nbLocs; i++) {
+ TopoDS_Vertex V = TopoDS::Vertex(aSeqLocs.Value(i));
+ PLocs.Append(BRep_Tool::Pnt(V));
+ }
+ //TopTools_SequenceOfShape Edges;
+ TopExp_Explorer anExp;
+ for (anExp.Init(aWirePath, TopAbs_EDGE); anExp.More(); anExp.Next()) {
+ Edges.Append(anExp.Current());
+ }
+ int nbEdges = Edges.Length();
+ ShapeAnalysis_Edge sae;
+ TopoDS_Edge edge = TopoDS::Edge(Edges.First());
+ double tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex VF = sae.FirstVertex(edge);
+ gp_Pnt PF = BRep_Tool::Pnt(VF);
+ //cout<<"PF("<<PF.X()<<","<<PF.Y()<<","<<PF.Z()<<")"<<endl;
+ if (PF.Distance(PLocs.First()) > tol) {
+ Standard_ConstructionError::Raise
+ ("First location shapes is not coincided with first vertex of aWirePath");
+ }
+ aSeqLocs.ChangeValue(1) = VF;
+ edge = TopoDS::Edge(Edges.Last());
+ tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex VL = sae.LastVertex(edge);
+ gp_Pnt PL = BRep_Tool::Pnt(VL);
+ if (PL.Distance(PLocs.Last()) > tol) {
+ Standard_ConstructionError::Raise
+ ("Last location shapes is not coincided with last vertex of aWirePath");
+ }
+ aSeqLocs.ChangeValue(nbLocs) = VL;
+ int jcurr = 2;
+ for (i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
+ TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
+ tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex V1 = sae.FirstVertex(E);
+ TopoDS_Vertex V2 = sae.LastVertex(E);
+ gp_Pnt P1 = BRep_Tool::Pnt(V1);
+ gp_Pnt P2 = BRep_Tool::Pnt(V2);
+ if (P2.Distance(PLocs.Value(jcurr)) < tol) {
+ aSeqLocs.ChangeValue(jcurr) = V2;
+ jcurr++;
+ }
+ else {
+ // find distance between E and aLocs(jcurr)
+ double fp,lp;
+ Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
+ GeomAPI_ProjectPointOnCurve PPCurve (PLocs.Value(jcurr),C);
+ if (PPCurve.NbPoints()>0 &&
+ PLocs.Value(jcurr).Distance(PPCurve.Point(1)) < tol) {
+ double param = PPCurve.Parameter(1);
+ gp_Pnt PC1;
+ C->D0(param,PC1);
+ // split current edge
+ Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
+ Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
+ TopoDS_Edge E1,E2;
+ BRep_Builder B;
+ gp_Pnt Pfp;
+ C->D0(fp,Pfp);
+ if (Pfp.Distance(P1)<tol) {
+ B.MakeEdge(E1,tc1,tol);
+ B.Add(E1,V1);
+ TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+ B.Add(E1,TopoDS::Vertex(tmpV));
+ B.MakeEdge(E2,tc2,tol);
+ tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+ B.Add(E2,TopoDS::Vertex(tmpV));
+ B.Add(E2,V2);
+ }
+ else {
+ B.MakeEdge(E1,tc2,tol);
+ TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+ B.Add(E1,TopoDS::Vertex(tmpV));
+ B.Add(E1,V1);
+ E1.Reverse();
+ B.MakeEdge(E2,tc1,tol);
+ B.Add(E2,V2);
+ tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+ B.Add(E2,TopoDS::Vertex(tmpV));
+ E2.Reverse();
+ }
+ jcurr++;
+ Edges.Remove(i);
+ Edges.InsertAfter(i-1,E1);
+ Edges.InsertAfter(i,E2);
+ }
+ }
+ }
+ if (nbEdges<Edges.Length()) {
+ // one of edges was splitted => we have to update WirePath
+ BRep_Builder B;
+ TopoDS_Wire W;
+ B.MakeWire(W);
+ for (i=1; i<=Edges.Length(); i++) {
+ B.Add(W,TopoDS::Edge(Edges.Value(i)));
+ }
+ aWirePath = W;
+ }
+ }
+
+ // check curvature of wire for condition that
+ // max summary angle between directions along
+ // wire path must be < 4*PI. If not - split wire
+ // and seguences of shapes, perform pipe for each
+ // and make sewing after that
+ double fp,lp;
+ Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(Edges.Value(1)),fp,lp);
+ gp_Pnt P1,P2;
+ gp_Vec Vec1,Vec2;
+ C->D1(fp,P1,Vec1);
+ C->D1(lp,P2,Vec2);
+ double SumAng = fabs(Vec1.Angle(Vec2));
+ Vec1 = Vec2;
+ P1 = P2;
+ TColStd_SequenceOfInteger SplitEdgeNums,SplitLocNums;
+ int LastLoc = 1;
+ //cout<<"Edges.Length()="<<Edges.Length()<<endl;
+ for (i=2; i<=Edges.Length(); i++) {
+ TopoDS_Edge edge = TopoDS::Edge(Edges.Value(i));
+ double tol = BRep_Tool::Tolerance(edge);
+ Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+ C->D1(lp,P2,Vec2);
+ double ang = fabs(Vec1.Angle(Vec2));
+ SumAng += ang;
+ if (SumAng>4*PI) {
+ SumAng = ang;
+ SplitEdgeNums.Append(i-1);
+ int j;
+ for (j=LastLoc+1; j<=aSeqLocs.Length(); j++) {
+ TopoDS_Vertex aVert = TopoDS::Vertex(aSeqLocs.Value(j));
+ gp_Pnt P = BRep_Tool::Pnt(aVert);
+ if (P1.Distance(P) < tol) {
+ SplitLocNums.Append(j);
+ LastLoc = j;
+ break;
+ }
+ }
+ }
+ Vec1 = Vec2;
+ P1 = P2;
+ }
+
+ if (SplitLocNums.Length()==SplitEdgeNums.Length() && SplitEdgeNums.Length()>0) {
+ TopTools_SequenceOfShape aSeqRes;
+ int nn, num1 = 1, num2 = 1;
+ for (nn=1; nn<=SplitEdgeNums.Length(); nn++) {
+ // create wirepath and sequences of shapes
+ BRep_Builder B;
+ TopoDS_Wire tmpW;
+ B.MakeWire(tmpW);
+ for (i=num1; i<=SplitEdgeNums.Value(nn); i++) {
+ B.Add(tmpW,TopoDS::Edge(Edges.Value(i)));
+ }
+ num1 = SplitEdgeNums.Value(nn) + 1;
+ TopTools_SequenceOfShape aTmpSeqBases;
+ TopTools_SequenceOfShape aTmpSeqLocs;
+ for (i=num2; i<=SplitLocNums.Value(nn); i++) {
+ aTmpSeqBases.Append(aSeqBases.Value(i));
+ aTmpSeqLocs.Append(aSeqLocs.Value(i));
+ }
+ num2 = SplitLocNums.Value(nn);
+ // make pipe
+ BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
+ Standard_Integer nbShapes = aTmpSeqBases.Length();
+ for (i=1; i<=nbShapes; i++) {
+ TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
+ TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
+ aBuilder.Add(aTmpSeqBases.Value(i), aVert, theWithContact, theWithCorrect);
+ }
+ if (!aBuilder.IsReady()) {
+ Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
+ }
+ aBuilder.Build();
+ TopoDS_Shape resShape = aBuilder.Shape();
+ aSeqRes.Append(resShape);
+ }
+ // create wirepath and sequences of shapes for last part
+ BRep_Builder B;
+ TopoDS_Wire tmpW;
+ B.MakeWire(tmpW);
+ for (i=num1; i<=Edges.Length(); i++) {
+ B.Add(tmpW,TopoDS::Edge(Edges.Value(i)));
+ }
+ TopTools_SequenceOfShape aTmpSeqBases;
+ TopTools_SequenceOfShape aTmpSeqLocs;
+ for (i=num2; i<=aSeqLocs.Length(); i++) {
+ aTmpSeqBases.Append(aSeqBases.Value(i));
+ aTmpSeqLocs.Append(aSeqLocs.Value(i));
+ }
+ // make pipe for last part
+ BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
+ Standard_Integer nbShapes = aTmpSeqBases.Length();
+ for (i=1; i<=nbShapes; i++) {
+ TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
+ TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
+ aBuilder.Add(aTmpSeqBases.Value(i), aVert, theWithContact, theWithCorrect);
+ }
+ if (!aBuilder.IsReady()) {
+ Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
+ }
+ aBuilder.Build();
+ TopoDS_Shape resShape = aBuilder.Shape();
+ aSeqRes.Append(resShape);
+ // make sewing for result
+ Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
+ aSewing->SetTolerance(Precision::Confusion());
+ aSewing->SetFaceMode(Standard_True);
+ aSewing->SetFloatingEdgesMode(Standard_False);
+ aSewing->SetNonManifoldMode(Standard_False);
+ for (i=1; i<=aSeqRes.Length(); i++) {
+ aSewing->Add(aSeqRes.Value(i));
+ }
+ aSewing->Perform();
+ aShape = aSewing->SewedShape();
+ }
+ else {
+ // old implementation without splitting
+ BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
+
+ Standard_Integer nbShapes = aSeqBases.Length();
+ Standard_Integer step = nbShapes/nbBases;
+
+ if (nbShapes < nbBases || fmod((double)nbShapes, (double)nbBases)) {
+ Standard_ConstructionError::Raise("Invalid sections were specified for building pipe");
+ }
+ Standard_Integer ind =0;
+ for (i = 1; i <= nbShapes && ind < nbShapes; i++) { //i+nbBases <= nbShapes
+ TopTools_SequenceOfShape usedBases;
+ Standard_Integer j = 1;
+ for (; j <= nbBases; j++) {
+ ind = i + (j-1)*step;
+ TopoDS_Shape aWireProf = aSeqBases.Value(ind);
+ usedBases.Append(aWireProf);
+ if (nbLocs) {
+ TopoDS_Shape aShapeLoc = aSeqLocs.Value(j);
+ TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
+ aBuilder.Add(aWireProf, aVert, theWithContact, theWithCorrect);
+ }
+ else
+ aBuilder.Add(aWireProf, theWithContact, theWithCorrect);
+ }
+ if (!aBuilder.IsReady()) {
+ Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
+ }
+ aBuilder.Build();
+ aShape = aBuilder.Shape();
+ aSeqFaces.Append(aShape);
+ for (j = 1; j <=usedBases.Length(); j++)
+ aBuilder.Delete(usedBases.Value(j));
+ }
+
+ //for case if section is face
+ if (aSeqFaces.Length() >1) {
+ BRep_Builder aB;
+ TopoDS_Compound aComp;
+ aB.MakeCompound(aComp);
+ for (i = 1; i <= aSeqFaces.Length(); i++)
+ aB.Add(aComp,aSeqFaces.Value(i));
+ aShape = aComp;
+ }
+ }
+
+ return aShape;
+}
+
//=======================================================================
//function : CreatePipeForShellSections
//purpose : auxilary for Execute()
nbSubBases = (aSubBasesObjs.IsNull() ? 0 :aSubBasesObjs->Length()),
nbLocs = (aLocObjs.IsNull() ? 0 :aLocObjs->Length());
- if( nbLocs != nbBases) {
- if(aCI) delete aCI;
+ if (nbLocs != nbBases) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Number of sections is not equal to number of locations ");
}
- if( nbSubBases && nbSubBases != nbBases) {
- if(aCI) delete aCI;
+ if (nbSubBases && nbSubBases != nbBases) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Number of sections is not equal to number of subsections ");
}
//BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
TopTools_SequenceOfShape VLocs;
- for(i=1; i<=nbBases; i++) {
+ for (i=1; i<=nbBases; i++) {
Handle(Standard_Transient) anItemLoc = aLocObjs->Value(i);
- if(anItemLoc.IsNull())
+ if (anItemLoc.IsNull())
continue;
Handle(GEOM_Function) aRefLoc = Handle(GEOM_Function)::DownCast(anItemLoc);
TopoDS_Shape aShapeLoc = aRefLoc->GetValue();
- if(aShapeLoc.IsNull() || aShapeLoc.ShapeType() != TopAbs_VERTEX)
+ if (aShapeLoc.IsNull() || aShapeLoc.ShapeType() != TopAbs_VERTEX)
continue;
VLocs.Append(aShapeLoc);
}
nbLocs = VLocs.Length();
- if( nbLocs != nbBases) {
- if(aCI) delete aCI;
+ if (nbLocs != nbBases) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("One of location shapes is not a vertex");
}
// split wire path by location points
TColgp_SequenceOfPnt PLocs;
- for(i=1; i<=nbLocs; i++) {
+ for (i=1; i<=nbLocs; i++) {
TopoDS_Vertex V = TopoDS::Vertex(VLocs.Value(i));
PLocs.Append(BRep_Tool::Pnt(V));
}
TopTools_SequenceOfShape Wires;
ShapeAnalysis_Edge sae;
- if(nbLocs==2) {
+ if (nbLocs==2) {
TopExp_Explorer anExp;
- for ( anExp.Init( aWirePath, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aWirePath, TopAbs_EDGE); anExp.More(); anExp.Next()) {
Edges.Append(anExp.Current());
}
Standard_Integer Num1 = 0;
Standard_Integer Num2 = 0;
- for(i=1; i<=Edges.Length(); i++) {
+ for (i=1; i<=Edges.Length(); i++) {
TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
double tol = BRep_Tool::Tolerance(E);
TopoDS_Vertex V1 = sae.FirstVertex(E);
TopoDS_Vertex V2 = sae.LastVertex(E);
gp_Pnt P1 = BRep_Tool::Pnt(V1);
gp_Pnt P2 = BRep_Tool::Pnt(V2);
- if( P1.Distance(PLocs.First()) < tol ) {
+ if (P1.Distance(PLocs.First()) < tol) {
Num1 = i;
}
- if( P2.Distance(PLocs.Last()) < tol ) {
+ if (P2.Distance(PLocs.Last()) < tol) {
Num2 = i;
}
}
- if( Num1>0 && Num2>0 ) {
+ if (Num1>0 && Num2>0) {
TopoDS_Wire W;
B.MakeWire(W);
- for(i=Num1; i<=Num2; i++) {
+ for (i=Num1; i<=Num2; i++) {
B.Add(W,Edges.Value(i));
}
Wires.Append(W);
}
else {
TopExp_Explorer anExp;
- for ( anExp.Init( aWirePath, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aWirePath, TopAbs_EDGE); anExp.More(); anExp.Next()) {
Edges.Append(anExp.Current());
}
TopoDS_Edge edge = TopoDS::Edge(Edges.First());
TopoDS_Vertex VF = sae.FirstVertex(edge);
gp_Pnt PF = BRep_Tool::Pnt(VF);
//cout<<"PF("<<PF.X()<<","<<PF.Y()<<","<<PF.Z()<<")"<<endl;
- if( PF.Distance(PLocs.First()) > tol ) {
- if(aCI) delete aCI;
+ if (PF.Distance(PLocs.First()) > tol) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise
("First location shapes is not coincided with first vertex of aWirePath");
}
tol = BRep_Tool::Tolerance(edge);
TopoDS_Vertex VL = sae.LastVertex(edge);
gp_Pnt PL = BRep_Tool::Pnt(VL);
- if( PL.Distance(PLocs.Last()) > tol ) {
- if(aCI) delete aCI;
+ if (PL.Distance(PLocs.Last()) > tol) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise
("Last location shapes is not coincided with last vertex of aWirePath");
}
VLocs.ChangeValue(nbLocs) = VL;
int jcurr = 2;
TopTools_SequenceOfShape tmpEdges;
- for(i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
+ for (i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
tol = BRep_Tool::Tolerance(E);
TopoDS_Vertex V1 = sae.FirstVertex(E);
TopoDS_Vertex V2 = sae.LastVertex(E);
gp_Pnt P1 = BRep_Tool::Pnt(V1);
gp_Pnt P2 = BRep_Tool::Pnt(V2);
- if( P2.Distance(PLocs.Value(jcurr)) < tol ) {
+ if (P2.Distance(PLocs.Value(jcurr)) < tol) {
// make wire from current edge and add created
// wire to Wires
TopoDS_Wire W;
B.MakeWire(W);
- for(j=1; j<=tmpEdges.Length(); j++)
+ for (j=1; j<=tmpEdges.Length(); j++)
B.Add(W,tmpEdges.Value(j));
B.Add(W,E);
Wires.Append(W);
double fp,lp;
Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
GeomAPI_ProjectPointOnCurve PPCurve (PLocs.Value(jcurr),C);
- if( PPCurve.NbPoints()>0 &&
- PLocs.Value(jcurr).Distance(PPCurve.Point(1)) < tol ) {
+ if (PPCurve.NbPoints()>0 &&
+ PLocs.Value(jcurr).Distance(PPCurve.Point(1)) < tol) {
double param = PPCurve.Parameter(1);
gp_Pnt PC1;
C->D0(param,PC1);
TopoDS_Edge E1,E2;
gp_Pnt Pfp;
C->D0(fp,Pfp);
- if(Pfp.Distance(P1)<tol) {
+ if (Pfp.Distance(P1)<tol) {
B.MakeEdge(E1,tc1,tol);
B.Add(E1,V1);
TopoDS_Shape tmpV = VLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
// create wire from tmpEdges
TopoDS_Wire W;
B.MakeWire(W);
- for(j=1; j<=tmpEdges.Length(); j++)
+ for (j=1; j<=tmpEdges.Length(); j++)
B.Add(W,tmpEdges.Value(j));
Wires.Append(W);
jcurr++;
// create wire from other edges
TopoDS_Wire W;
B.MakeWire(W);
- for(; i<=Edges.Length(); i++)
+ for (; i<=Edges.Length(); i++)
B.Add(W,Edges.Value(i));
Wires.Append(W);
//cout<<"Wires.Length()="<<Wires.Length()<<endl;
}
- if( Wires.Length() != nbLocs-1 ) {
- if(aCI) delete aCI;
+ if (Wires.Length() != nbLocs-1) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise
("One of location shapes is not lied on the path");
}
TopoDS_Wire WPath = TopoDS::Wire(Wires.Value(i));
// 1 section
Handle(Standard_Transient) anItem1 = aBasesObjs->Value(i);
- if(anItem1.IsNull())
+ if (anItem1.IsNull())
continue;
Handle(GEOM_Function) aRefBase1 = Handle(GEOM_Function)::DownCast(anItem1);
- if(aRefBase1.IsNull())
+ if (aRefBase1.IsNull())
continue;
TopoDS_Shape aShBase1 = aRefBase1->GetValue();
- if(aShBase1.IsNull())
+ if (aShBase1.IsNull())
continue;
TopAbs_ShapeEnum aType1 = aShBase1.ShapeType();
// 2 section
Handle(Standard_Transient) anItem2 = aBasesObjs->Value(i+1);
- if(anItem2.IsNull())
+ if (anItem2.IsNull())
continue;
Handle(GEOM_Function) aRefBase2 = Handle(GEOM_Function)::DownCast(anItem2);
- if(aRefBase2.IsNull())
+ if (aRefBase2.IsNull())
continue;
TopoDS_Shape aShBase2 = aRefBase2->GetValue();
- if(aShBase2.IsNull())
+ if (aShBase2.IsNull())
continue;
TopAbs_ShapeEnum aType2 = aShBase2.ShapeType();
//BRepTools::Write(aShBase1,"/dn02/users_Linux/skl/work/Bugs/14857/base1.brep");
- bool OkSec = ( aType1==TopAbs_SHELL || aType1==TopAbs_FACE ) &&
- ( aType2==TopAbs_SHELL || aType2==TopAbs_FACE );
- if( !OkSec ) {
- if(aCI) delete aCI;
+ bool OkSec = (aType1==TopAbs_SHELL || aType1==TopAbs_FACE) &&
+ (aType2==TopAbs_SHELL || aType2==TopAbs_FACE);
+ if (!OkSec) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("One of section shapes has invalid type");
}
// compare sections
TopExp_Explorer anExp;
Standard_Integer nbf1 = 0;
- for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShBase1, TopAbs_FACE); anExp.More(); anExp.Next()) {
nbf1++;
}
Standard_Integer nbf2 = 0;
- for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShBase2, TopAbs_FACE); anExp.More(); anExp.Next()) {
nbf2++;
}
- if(nbf1==nbf2) {
+ if (nbf1==nbf2) {
CreateFewSolids = true;
}
bool NeedReverse = false;
{
// first section
- anExp.Init( aShBase1, TopAbs_FACE );
+ anExp.Init(aShBase1, TopAbs_FACE);
TopoDS_Shape aFace = anExp.Current();
TColgp_SequenceOfPnt aPnts;
double xc=0, yc=0, zc=0;
- for ( anExp.Init( aFace, TopAbs_VERTEX ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aFace, TopAbs_VERTEX); anExp.More(); anExp.Next()) {
TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
aPnts.Append(BRep_Tool::Pnt(V));
xc += aPnts.Last().X();
yc += aPnts.Last().Y();
zc += aPnts.Last().Z();
}
- gp_Pnt PC( xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length() );
+ gp_Pnt PC(xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length());
gp_Vec V1(PC,aPnts.Value(1));
gp_Vec V2(PC,aPnts.Value(2));
gp_Vec VN = V1.Crossed(V2);
- for(int ip=2; ip<aPnts.Length(); ip++) {
+ for (int ip=2; ip<aPnts.Length(); ip++) {
V1 = gp_Vec(PC,aPnts.Value(ip));
V2 = gp_Vec(PC,aPnts.Value(ip+1));
VN.Add(V1.Crossed(V2));
gp_Vec PathNorm;
gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i)));
TopExp_Explorer WE;
- for ( WE.Init( WPath, TopAbs_EDGE ); WE.More(); WE.Next() ) {
+ for (WE.Init(WPath, TopAbs_EDGE); WE.More(); WE.Next()) {
TopoDS_Edge edge = TopoDS::Edge(WE.Current());
double tol = BRep_Tool::Tolerance(edge);
TopoDS_Vertex VF = sae.FirstVertex(edge);
gp_Pnt PF = BRep_Tool::Pnt(VF);
- if( PF.Distance(PLoc) < tol ) {
+ if (PF.Distance(PLoc) < tol) {
double fp,lp;
Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
gp_Pnt P1,P2;
C->D0(fp,P1);
- if( P1.Distance(PLoc) < tol ) {
+ if (P1.Distance(PLoc) < tol) {
C->D0(fp+(lp-fp)/100,P2);
}
else {
else {
TopoDS_Vertex VL = sae.LastVertex(edge);
gp_Pnt PL = BRep_Tool::Pnt(VL);
- if( PL.Distance(PLoc) < tol ) {
+ if (PL.Distance(PLoc) < tol) {
double fp,lp;
Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
gp_Pnt P1,P2;
C->D0(fp,P1);
- if( P1.Distance(PLoc) < tol ) {
+ if (P1.Distance(PLoc) < tol) {
C->D0(fp+(lp-fp)/100,P2);
}
else {
}
cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
- if(fabs(VN.Angle(PathNorm))>PI/2.) {
+ if (fabs(VN.Angle(PathNorm))>PI/2.) {
NeedReverse = true;
aShBase1.Reverse();
}
}
{
// second section
- anExp.Init( aShBase2, TopAbs_FACE );
+ anExp.Init(aShBase2, TopAbs_FACE);
TopoDS_Shape aFace = anExp.Current();
TColgp_SequenceOfPnt aPnts;
double xc=0, yc=0, zc=0;
- for ( anExp.Init( aFace, TopAbs_VERTEX ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aFace, TopAbs_VERTEX); anExp.More(); anExp.Next()) {
TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
aPnts.Append(BRep_Tool::Pnt(V));
xc += aPnts.Last().X();
yc += aPnts.Last().Y();
zc += aPnts.Last().Z();
}
- gp_Pnt PC( xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length() );
+ gp_Pnt PC(xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length());
gp_Vec V1(PC,aPnts.Value(1));
gp_Vec V2(PC,aPnts.Value(2));
gp_Vec VN = V1.Crossed(V2);
- for(int ip=2; ip<aPnts.Length(); ip++) {
+ for (int ip=2; ip<aPnts.Length(); ip++) {
V1 = gp_Vec(PC,aPnts.Value(ip));
V2 = gp_Vec(PC,aPnts.Value(ip+1));
VN.Add(V1.Crossed(V2));
gp_Vec PathNorm;
gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i+1)));
TopExp_Explorer WE;
- for ( WE.Init( WPath, TopAbs_EDGE ); WE.More(); WE.Next() ) {
+ for (WE.Init(WPath, TopAbs_EDGE); WE.More(); WE.Next()) {
TopoDS_Edge edge = TopoDS::Edge(WE.Current());
double tol = BRep_Tool::Tolerance(edge);
TopoDS_Vertex VF = sae.FirstVertex(edge);
gp_Pnt PF = BRep_Tool::Pnt(VF);
- if( PF.Distance(PLoc) < tol ) {
+ if (PF.Distance(PLoc) < tol) {
double fp,lp;
Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
gp_Pnt P1,P2;
C->D0(fp,P1);
- if( P1.Distance(PLoc) < tol ) {
+ if (P1.Distance(PLoc) < tol) {
C->D0(fp+(lp-fp)/100,P2);
}
else {
else {
TopoDS_Vertex VL = sae.LastVertex(edge);
gp_Pnt PL = BRep_Tool::Pnt(VL);
- if( PL.Distance(PLoc) < tol ) {
+ if (PL.Distance(PLoc) < tol) {
double fp,lp;
Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
gp_Pnt P1,P2;
C->D0(fp,P1);
- if( P1.Distance(PLoc) < tol ) {
+ if (P1.Distance(PLoc) < tol) {
C->D0(fp+(lp-fp)/100,P2);
}
else {
}
//cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
//cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
- if(fabs(VN.Angle(PathNorm))>PI/2.)
+ if (fabs(VN.Angle(PathNorm))>PI/2.)
aShBase2.Reverse();
}
*/
- if(!CreateFewSolids) {
+ if (!CreateFewSolids) {
// we can create only one solid
TopoDS_Shape aWire1, aWire2;
// prepare aWire1
- if(aType1==TopAbs_SHELL) {
+ if (aType1==TopAbs_SHELL) {
// create wire as boundary contour if shell is no closed
// get free boundary shapes
- ShapeAnalysis_FreeBounds anAnalizer( aShBase1 );
+ ShapeAnalysis_FreeBounds anAnalizer(aShBase1);
TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
//TopExp_Explorer anExp;
Standard_Integer NbWires = 0;
- for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aClosed, TopAbs_WIRE); anExp.More(); anExp.Next()) {
NbWires++;
aWire1 = anExp.Current();
}
- if(NbWires!=1) {
+ if (NbWires!=1) {
// bad case
- if(aCI) delete aCI;
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Bad shell is used as section ");
}
}
aWire1 = aExpW.Current();
}
// prepare aWire2
- if(aType2==TopAbs_SHELL) {
+ if (aType2==TopAbs_SHELL) {
// create wire as boundary contour if shell is no closed
// get free boundary shapes
- ShapeAnalysis_FreeBounds anAnalizer( aShBase2 );
+ ShapeAnalysis_FreeBounds anAnalizer(aShBase2);
TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
//TopExp_Explorer anExp;
Standard_Integer NbWires = 0;
- for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aClosed, TopAbs_WIRE); anExp.More(); anExp.Next()) {
NbWires++;
aWire2 = anExp.Current();
}
- if(NbWires!=1) {
+ if (NbWires!=1) {
// bad case
- if(aCI) delete aCI;
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Bad shell is used as section ");
}
}
aWire2 = aExpW.Current();
}
// make pipe using aWire1 and aWire2
- if( !aWire1.IsNull() && !aWire2.IsNull() ) {
+ if (!aWire1.IsNull() && !aWire2.IsNull()) {
//BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
BRepOffsetAPI_MakePipeShell aBuilder(WPath);
aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
aWithContact, aWithCorrect);
aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
aWithContact, aWithCorrect);
- if(!aBuilder.IsReady()) {
- if(aCI) delete aCI;
+ if (!aBuilder.IsReady()) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
}
aBuilder.Build();
TopoDS_Shape aShape = aBuilder.Shape();
TopoDS_Shell aShell;
B.MakeShell(aShell);
- for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShape, TopAbs_FACE); anExp.More(); anExp.Next()) {
B.Add(aShell,anExp.Current());
}
- for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShBase1, TopAbs_FACE); anExp.More(); anExp.Next()) {
B.Add(aShell,anExp.Current());
}
- for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShBase2, TopAbs_FACE); anExp.More(); anExp.Next()) {
B.Add(aShell,anExp.Current());
}
// make sewing for this shell
aSewing->SetFaceMode(Standard_True);
aSewing->SetFloatingEdgesMode(Standard_False);
aSewing->SetNonManifoldMode(Standard_False);
- for ( anExp.Init( aShell, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShell, TopAbs_FACE); anExp.More(); anExp.Next()) {
aSewing->Add(anExp.Current());
}
aSewing->Perform();
const TopoDS_Shape aSewShape = aSewing->SewedShape();
- if( aSewShape.ShapeType() == TopAbs_SHELL ) {
+ if (aSewShape.ShapeType() == TopAbs_SHELL) {
aShell = TopoDS::Shell(aSewShape);
GProp_GProps aSystem;
BRepGProp::VolumeProperties(aShell, aSystem);
- if(aSystem.Mass()<0) {
+ if (aSystem.Mass()<0) {
aShell.Reverse();
}
- if(BRep_Tool::IsClosed(aShell)) {
+ if (BRep_Tool::IsClosed(aShell)) {
TopoDS_Solid aSolid;
B.MakeSolid(aSolid);
B.Add(aSolid,aShell);
else {
// main block - creation few solids (for each pair of faces)
TopTools_MapOfShape aFaces1,aFaces2;
- for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShBase1, TopAbs_FACE); anExp.More(); anExp.Next()) {
aFaces1.Add(anExp.Current());
}
- for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShBase2, TopAbs_FACE); anExp.More(); anExp.Next()) {
aFaces2.Add(anExp.Current());
}
// creating map of edge faces
// constuct map face->face
TopTools_IndexedDataMapOfShapeShape FF;
TopoDS_Shape FS1,FS2;
- if(nbSubBases==0) {
+ if (nbSubBases==0) {
// find edge the most distant from location point
// (this edge is not shared by two faces)
double maxdist = 0.;
TopoDS_Shape E1;
TopoDS_Vertex V11,V21;
- for(j=1; j<=aMapEdgeFaces1.Extent(); j++) {
+ for (j=1; j<=aMapEdgeFaces1.Extent(); j++) {
TopoDS_Shape tmp = aMapEdgeFaces1.FindKey(j);
const TopTools_ListOfShape& aList = aMapEdgeFaces1.FindFromKey(tmp);
- if(aList.Extent()>1)
+ if (aList.Extent()>1)
continue;
TopExp_Explorer expv;
- expv.Init( tmp, TopAbs_VERTEX );
+ expv.Init(tmp, TopAbs_VERTEX);
TopoDS_Vertex V1 = TopoDS::Vertex(expv.Current());
expv.Next();
TopoDS_Vertex V2 = TopoDS::Vertex(expv.Current());
gp_Pnt P1 = BRep_Tool::Pnt(V1);
gp_Pnt P2 = BRep_Tool::Pnt(V2);
double dist = PLocs.Value(i).Distance(P1) + PLocs.Value(i).Distance(P2);
- if(dist>maxdist) {
+ if (dist>maxdist) {
E1 = tmp;
V11 = V1;
V21 = V2;
gp_Pnt P21 = BRep_Tool::Pnt(V21);
TopoDS_Shape E2;
TopoDS_Vertex V12,V22;
- for(j=1; j<=aMapEdgeFaces2.Extent(); j++) {
+ for (j=1; j<=aMapEdgeFaces2.Extent(); j++) {
TopoDS_Shape tmp = aMapEdgeFaces2.FindKey(j);
const TopTools_ListOfShape& aList = aMapEdgeFaces2.FindFromKey(tmp);
- if(aList.Extent()>1)
+ if (aList.Extent()>1)
continue;
TopExp_Explorer expv;
- expv.Init( tmp, TopAbs_VERTEX );
+ expv.Init(tmp, TopAbs_VERTEX);
TopoDS_Vertex V1tmp = TopoDS::Vertex(expv.Current());
expv.Next();
TopoDS_Vertex V2tmp = TopoDS::Vertex(expv.Current());
double d2 = P1tmp.Distance(P21) + P2tmp.Distance(P11);
TopoDS_Vertex V1,V2;
gp_Pnt P1,P2;
- if(d1>d2) {
+ if (d1>d2) {
V1 = V2tmp; P1 = P2tmp;
V2 = V1tmp; P2 = P1tmp;
}
gp_Vec Vec1(P11,P1);
gp_Vec Vec2(P21,P2);
double ang = fabs(Vec1.Angle(VM)) + fabs(Vec2.Angle(VM));
- if(ang<minang) {
+ if (ang<minang) {
E2 = tmp;
V12 = V1;
V22 = V2;
// add pairs of edges to FF
bool stat = FillForOtherEdges(FS1,E1,V11,FF);
- if( !stat ) {
- if(aCI) delete aCI;
+ if (!stat) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("FindForOtherEdges: Can not mapping other egdes");
}
else {
{ // 1 section
Handle(Standard_Transient) anItem = aSubBasesObjs->Value(i);
- if(anItem.IsNull()) {
- if(aCI) delete aCI;
+ if (anItem.IsNull()) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid subbase shape");
}
Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
- if(aRefBase.IsNull()) {
- if(aCI) delete aCI;
+ if (aRefBase.IsNull()) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid subbase shape");
}
TopoDS_Shape aSh = aRefBase->GetValue();
- if(aSh.IsNull()) {
- if(aCI) delete aCI;
+ if (aSh.IsNull()) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid subbase shape");
}
- if(aSh.ShapeType()!=TopAbs_FACE) {
- if(aCI) delete aCI;
+ if (aSh.ShapeType()!=TopAbs_FACE) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid subbase shape");
}
FS1 = aSh;
}
{ // 2 section
Handle(Standard_Transient) anItem = aSubBasesObjs->Value(i+1);
- if(anItem.IsNull()) {
- if(aCI) delete aCI;
+ if (anItem.IsNull()) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid subbase shape");
}
Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
- if(aRefBase.IsNull()) {
- if(aCI) delete aCI;
+ if (aRefBase.IsNull()) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid subbase shape");
}
TopoDS_Shape aSh = aRefBase->GetValue();
- if(aSh.IsNull()) {
- if(aCI) delete aCI;
+ if (aSh.IsNull()) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid subbase shape");
}
- if(aSh.ShapeType()!=TopAbs_FACE) {
- if(aCI) delete aCI;
+ if (aSh.ShapeType()!=TopAbs_FACE) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid subbase shape");
}
FS2 = aSh;
}
- if( !aFaces1.Contains(FS1) || !aFaces2.Contains(FS2) ) {
- if(aCI) delete aCI;
+ if (!aFaces1.Contains(FS1) || !aFaces2.Contains(FS2)) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid subbase shape");
}
// add pairs of edges to FF
bool stat = FillCorrespondingEdges(FS1, FS2, TopoDS::Vertex(VLocs(i)),
TopoDS::Vertex(VLocs(i+1)), WPath, FF);
- if( !stat ) {
- if(aCI) delete aCI;
+ if (!stat) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Can not create correct pipe");
}
}
FindNextPairOfFaces(FS1, aMapEdgeFaces1, aMapEdgeFaces2, FF, aCI);
// make pipe for each pair of faces
- for(j=1; j<=FF.Extent(); j++) {
+ for (j=1; j<=FF.Extent(); j++) {
TopoDS_Shape F1 = FF.FindKey(j);
- if( F1.ShapeType() != TopAbs_FACE )
+ if (F1.ShapeType() != TopAbs_FACE)
continue;
TopoDS_Shape F2 = FF.FindFromIndex(j);
TopExp_Explorer aExpW1(F1,TopAbs_WIRE);
TopExp_Explorer aExpW2(F2,TopAbs_WIRE);
TopoDS_Wire aWire2 = TopoDS::Wire(aExpW2.Current());
// make pipe using aWire1 and aWire2
- if( !aWire1.IsNull() && !aWire2.IsNull() ) {
+ if (!aWire1.IsNull() && !aWire2.IsNull()) {
BRepOffsetAPI_MakePipeShell aBuilder(WPath);
aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
aWithContact, aWithCorrect);
aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
aWithContact, aWithCorrect);
- if(!aBuilder.IsReady()) {
- if(aCI) delete aCI;
+ if (!aBuilder.IsReady()) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
}
aBuilder.Build();
TopoDS_Shape aShape = aBuilder.Shape();
TopoDS_Shell aShell;
B.MakeShell(aShell);
- for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShape, TopAbs_FACE); anExp.More(); anExp.Next()) {
B.Add(aShell,anExp.Current());
}
aSewing->SetFaceMode(Standard_True);
aSewing->SetFloatingEdgesMode(Standard_False);
aSewing->SetNonManifoldMode(Standard_False);
- for ( anExp.Init( aShell, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShell, TopAbs_FACE); anExp.More(); anExp.Next()) {
aSewing->Add(anExp.Current());
}
aSewing->Perform();
const TopoDS_Shape aSewShape = aSewing->SewedShape();
- if( aSewShape.ShapeType() == TopAbs_SHELL ) {
+ if (aSewShape.ShapeType() == TopAbs_SHELL) {
aShell = TopoDS::Shell(aSewShape);
GProp_GProps aSystem;
BRepGProp::VolumeProperties(aShell, aSystem);
- if(aSystem.Mass()<0) {
+ if (aSystem.Mass()<0) {
//cout<<"aSewShape is reversed"<<endl;
aShell.Reverse();
}
- if(BRep_Tool::IsClosed(aShell)) {
+ if (BRep_Tool::IsClosed(aShell)) {
TopoDS_Solid aSolid;
B.MakeSolid(aSolid);
B.Add(aSolid,aShell);
Standard_Integer nbBases = aBasesObjs->Length(),
nbv = (VObjs.IsNull() ? 0 :VObjs->Length());
- if( nbv != nbBases ) {
- if(aCI) delete aCI;
+ if (nbv != nbBases) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Number of shapes for recognition is invalid");
}
TopTools_SequenceOfShape SecVs,Bases;
- for(i=1; i<=nbBases; i++) {
+ for (i=1; i<=nbBases; i++) {
// vertex
Handle(Standard_Transient) anItem = VObjs->Value(i);
- if(anItem.IsNull())
+ if (anItem.IsNull())
continue;
Handle(GEOM_Function) aRef = Handle(GEOM_Function)::DownCast(anItem);
TopoDS_Shape V = aRef->GetValue();
- if(V.IsNull() || V.ShapeType() != TopAbs_VERTEX)
+ if (V.IsNull() || V.ShapeType() != TopAbs_VERTEX)
continue;
SecVs.Append(V);
// section
anItem = aBasesObjs->Value(i);
- if(anItem.IsNull())
+ if (anItem.IsNull())
continue;
aRef = Handle(GEOM_Function)::DownCast(anItem);
TopoDS_Shape aSh = aRef->GetValue();
- if(aSh.IsNull())
+ if (aSh.IsNull())
continue;
Bases.Append(aSh);
}
nbv = SecVs.Length();
nbBases = Bases.Length();
- if( nbv != nbBases ) {
- if(aCI) delete aCI;
+ if (nbv != nbBases) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("One of shapes for recognition is not a vertex");
}
TopoDS_Shape aShBase2 = Bases.Value(i+1);
TopExp_Explorer anExp;
Standard_Integer nbf1 = 0;
- for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShBase1, TopAbs_FACE); anExp.More(); anExp.Next()) {
nbf1++;
}
Standard_Integer nbf2 = 0;
- for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShBase2, TopAbs_FACE); anExp.More(); anExp.Next()) {
nbf2++;
}
//cout<<"nbf1="<<nbf1<<" nbf2="<<nbf2<<endl;
- if(nbf1!=nbf2) {
- if(aCI) delete aCI;
+ if (nbf1!=nbf2) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Different number of faces in the sections");
}
TopTools_MapOfShape aFaces1,aFaces2;
- for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShBase1, TopAbs_FACE); anExp.More(); anExp.Next()) {
aFaces1.Add(anExp.Current());
}
- for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShBase2, TopAbs_FACE); anExp.More(); anExp.Next()) {
aFaces2.Add(anExp.Current());
}
// add pairs of edges and vertexes to FF
bool stat = FillCorrespondingEdges(FS1, FS2, V1, V2, FF);
- if( !stat ) {
- if(aCI) delete aCI;
+ if (!stat) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Can not create correct pipe");
}
MESSAGE (" correspondences for subshapes of first pair of faces is found");
ShapeAnalysis_Edge sae;
//cout<<"FF.Extent()="<<FF.Extent()<<endl;
int nbff = 0;
- for(j=1; j<=FF.Extent(); j++) {
+ for (j=1; j<=FF.Extent(); j++) {
TopoDS_Shape F1 = FF.FindKey(j);
- if( F1.ShapeType() != TopAbs_FACE )
+ if (F1.ShapeType() != TopAbs_FACE)
continue;
TopoDS_Shape F2 = FF.FindFromIndex(j);
nbff++;
- //if(nbff!=3) continue;
+ //if (nbff!=3) continue;
MESSAGE (" make pipe for "<<nbff<<" face");
Handle(Geom_Surface) S1 = BRep_Tool::Surface(TopoDS::Face(F1));
- if(S1->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
+ if (S1->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
Handle(Geom_RectangularTrimmedSurface) RTS =
Handle(Geom_RectangularTrimmedSurface)::DownCast(S1);
S1 = RTS->BasisSurface();
}
Handle(Geom_Plane) Pln1 = Handle(Geom_Plane)::DownCast(S1);
- if( Pln1.IsNull() ) {
- if(aCI) delete aCI;
+ if (Pln1.IsNull()) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Surface from face is not plane");
}
gp_Vec aDir1(Pln1->Axis().Direction());
Handle(Geom_Surface) S2 = BRep_Tool::Surface(TopoDS::Face(F2));
- if(S2->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
+ if (S2->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
Handle(Geom_RectangularTrimmedSurface) RTS =
Handle(Geom_RectangularTrimmedSurface)::DownCast(S2);
S2 = RTS->BasisSurface();
}
Handle(Geom_Plane) Pln2 =
Handle(Geom_Plane)::DownCast(S2);
- if( Pln2.IsNull() ) {
- if(aCI) delete aCI;
+ if (Pln2.IsNull()) {
+ if (aCI) delete aCI;
Standard_ConstructionError::Raise("Surface from face is not plane");
}
gp_Vec aDir2(Pln2->Axis().Direction());
gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(SecVs(i)));
gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(SecVs(i+1)));
gp_Vec aDir(P1,P2);
- if(fabs(aDir.Angle(aDir1))>PI/2.)
+ if (fabs(aDir.Angle(aDir1))>PI/2.)
aDir1.Reverse();
- if(fabs(aDir.Angle(aDir2))>PI/2.)
+ if (fabs(aDir.Angle(aDir2))>PI/2.)
aDir2.Reverse();
TopExp_Explorer anExpE(F1,TopAbs_EDGE);
TopTools_SequenceOfShape aNewFs;
//int nbee=0;
- for(; anExpE.More(); anExpE.Next()) {
+ for (; anExpE.More(); anExpE.Next()) {
TopoDS_Edge E1 = TopoDS::Edge(anExpE.Current());
//nbee++;
- if(!FF.Contains(E1))
+ if (!FF.Contains(E1))
MESSAGE ("map FF not contains key E1");
- if(VPE.Contains(E1)) {
+ if (VPE.Contains(E1)) {
aNewFs.Append(VPE.FindFromKey(E1));
#ifdef _DEBUG_
MESSAGE (" using existed face");
TopoDS_Edge E3 = TopoDS::Edge(FF.FindFromKey(E1));
TopoDS_Vertex V1 = sae.FirstVertex(E1);
TopoDS_Vertex V2 = sae.LastVertex(E1);
- if(!FF.Contains(V1))
+ if (!FF.Contains(V1))
MESSAGE ("map FF not contains key V1");
- if(!FF.Contains(V2))
+ if (!FF.Contains(V2))
MESSAGE ("map FF not contains key V2");
TopoDS_Vertex V3 = TopoDS::Vertex(FF.FindFromKey(V2));
TopoDS_Vertex V4 = TopoDS::Vertex(FF.FindFromKey(V1));
TopoDS_Vertex Vtmp = sae.FirstVertex(E3);
- if(Vtmp.IsSame(V4))
+ if (Vtmp.IsSame(V4))
E3.Reverse();
gp_Pnt P1 = BRep_Tool::Pnt(V1);
gp_Pnt P2 = BRep_Tool::Pnt(V2);
// make E2
TopoDS_Edge E2;
Handle(Geom_BSplineCurve) C2;
- if(VPE.Contains(V2)) {
+ if (VPE.Contains(V2)) {
E2 = TopoDS::Edge(VPE.FindFromKey(V2));
double fp,lp;
C2 = Handle(Geom_BSplineCurve)::DownCast(BRep_Tool::Curve(E2,fp,lp));
// make E4
TopoDS_Edge E4;
Handle(Geom_BSplineCurve) C4;
- if(VPE.Contains(V1)) {
+ if (VPE.Contains(V1)) {
E4 = TopoDS::Edge(VPE.FindFromKey(V1));
double fp,lp;
C4 = Handle(Geom_BSplineCurve)::DownCast(BRep_Tool::Curve(E4,fp,lp));
double fp,lp;
Handle(Geom_Curve) C1 = BRep_Tool::Curve(E1,fp,lp);
//bool IsConicC1 = false;
- //if( C1->IsKind(STANDARD_TYPE(Geom_Conic)) ) {
+ //if (C1->IsKind(STANDARD_TYPE(Geom_Conic))) {
// IsConicC1 = true;
// cout<<"C1 - Geom_Conic"<<endl;
//}
- if( C1->IsKind(STANDARD_TYPE(Geom_Line)) || C1->IsKind(STANDARD_TYPE(Geom_Conic)) ) {
+ if (C1->IsKind(STANDARD_TYPE(Geom_Line)) || C1->IsKind(STANDARD_TYPE(Geom_Conic))) {
C1 = new Geom_TrimmedCurve(C1,fp,lp);
}
- //if(IsConicC1) {
+ //if (IsConicC1) {
// double tol = BRep_Tool::Tolerance(E1);
// GeomConvert_ApproxCurve ApxC1(C1,tol,GeomAbs_C1,10,5);
// C1 = ApxC1.Curve();
//}
Handle(Geom_Curve) C3 = BRep_Tool::Curve(E3,fp,lp);
- if( C3->IsKind(STANDARD_TYPE(Geom_Line)) || C3->IsKind(STANDARD_TYPE(Geom_Conic)) ) {
+ if (C3->IsKind(STANDARD_TYPE(Geom_Line)) || C3->IsKind(STANDARD_TYPE(Geom_Conic))) {
C3 = new Geom_TrimmedCurve(C3,fp,lp);
}
//filebuf fic;
//os.precision(15);
Handle(Geom_BSplineCurve) CE1 =
GeomConvert::CurveToBSplineCurve(C1,Convert_RationalC1);
- if(CE1->Degree()<3)
+ if (CE1->Degree()<3)
CE1->IncreaseDegree(3);
Handle(Geom_BSplineCurve) CE2 =
GeomConvert::CurveToBSplineCurve(C2,Convert_RationalC1);
- if(CE2->Degree()<3)
+ if (CE2->Degree()<3)
CE2->IncreaseDegree(3);
Handle(Geom_BSplineCurve) CE3 =
GeomConvert::CurveToBSplineCurve(C3,Convert_RationalC1);
- if(CE3->Degree()<3)
+ if (CE3->Degree()<3)
CE3->IncreaseDegree(3);
Handle(Geom_BSplineCurve) CE4 =
GeomConvert::CurveToBSplineCurve(C4,Convert_RationalC1);
- if(CE4->Degree()<3)
+ if (CE4->Degree()<3)
CE4->IncreaseDegree(3);
//cout<<"CE1->Degree()="<<CE1->Degree()<<" CE2->Degree()="<<CE2->Degree()
// <<" CE3->Degree()="<<CE3->Degree()<<" CE4->Degree()="<<CE4->Degree()<<endl;
- //if(fic.open("/dn02/users_Linux/skl/work/Bugs/14857/ce1.brep",ios::out)) {
+ //if (fic.open("/dn02/users_Linux/skl/work/Bugs/14857/ce1.brep",ios::out)) {
// os<<"DrawTrSurf_BSplineCurve"<<endl;
// GeomTools::Write(CE1,os);
// fic.close();
int n1,n2;
double fp,lp;
// get points from C1
- if(P1.Distance(P1C1)<1.e-6) {
+ if (P1.Distance(P1C1)<1.e-6) {
fp = fp1;
lp = lp1;
}
double step = (lp-fp)/(NbP-1);
Points.SetValue(1,1,P1);
double par = fp;
- for(n1=2; n1<NbP; n1++) {
+ for (n1=2; n1<NbP; n1++) {
gp_Pnt P;
par += step;
C1->D0(par,P);
}
Points.SetValue(1,NbP,P2);
// get points from C3
- if(P4.Distance(P1C3)<1.e-6) {
+ if (P4.Distance(P1C3)<1.e-6) {
fp = fp2;
lp = lp2;
}
step = (lp-fp)/(NbP-1);
Points.SetValue(NbP,1,P4);
par = fp;
- for(n1=2; n1<NbP; n1++) {
+ for (n1=2; n1<NbP; n1++) {
gp_Pnt P;
par += step;
C3->D0(par,P);
}
Points.SetValue(NbP,NbP,P3);
// create isolines and get points from them
- for(n1=1; n1<=NbP; n1++) {
+ for (n1=1; n1<=NbP; n1++) {
gp_Pnt PI1 = Points.Value(1,n1);
gp_Pnt PI2 = Points.Value(NbP,n1);
Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,2);
par = fp;
TopoDS_Compound VComp;
B.MakeCompound(VComp);
- for(n2=2; n2<NbP; n2++) {
+ for (n2=2; n2<NbP; n2++) {
gp_Pnt P;
par += step;
iso->D0(par,P);
// make shell
TopoDS_Shell aShell;
B.MakeShell(aShell);
- for(int nf=1; nf<=aNewFs.Length(); nf++) {
+ for (int nf=1; nf<=aNewFs.Length(); nf++) {
B.Add(aShell,aNewFs(nf));
}
B.Add(aShell,F1);
aSewing->SetFaceMode(Standard_True);
aSewing->SetFloatingEdgesMode(Standard_False);
aSewing->SetNonManifoldMode(Standard_False);
- for ( anExp.Init( aShell, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ for (anExp.Init(aShell, TopAbs_FACE); anExp.More(); anExp.Next()) {
aSewing->Add(anExp.Current());
}
aSewing->Perform();
MESSAGE (" shell for face "<<nbff<<" is created");
const TopoDS_Shape aSewShape = aSewing->SewedShape();
//BRepTools::Write(aSewShape,"/dn02/users_Linux/skl/work/Bugs/14857/sew.brep");
- if( aSewShape.ShapeType() == TopAbs_SHELL ) {
+ if (aSewShape.ShapeType() == TopAbs_SHELL) {
aShell = TopoDS::Shell(aSewShape);
GProp_GProps aSystem;
BRepGProp::VolumeProperties(aShell, aSystem);
- if(aSystem.Mass()<0) {
+ if (aSystem.Mass()<0) {
//cout<<"aSewShape is reversed"<<endl;
aShell.Reverse();
}
- if(BRep_Tool::IsClosed(aShell)) {
+ if (BRep_Tool::IsClosed(aShell)) {
TopoDS_Solid aSolid;
B.MakeSolid(aSolid);
B.Add(aSolid,aShell);
/*
GProp_GProps aSystem;
BRepGProp::VolumeProperties(FixedShell, aSystem);
- if(aSystem.Mass()<0) {
+ if (aSystem.Mass()<0) {
//cout<<"aSewShape is reversed"<<endl;
FixedShell.Reverse();
}
- if(BRep_Tool::IsClosed(FixedShell)) {
+ if (BRep_Tool::IsClosed(FixedShell)) {
TopoDS_Solid aSolid;
B.MakeSolid(aSolid);
B.Add(aSolid,aShell);
TopoDS_Shape aShapeVec = aRefVec->GetValue();
if (aShapeBase.IsNull()) {
- if(aCIBN) delete aCIBN;
+ if (aCIBN) delete aCIBN;
Standard_NullObject::Raise("MakePipe aborted : null base argument");
}
TopoDS_Shape aProf;
- if( aShapeBase.ShapeType() == TopAbs_VERTEX ) {
+ if (aShapeBase.ShapeType() == TopAbs_VERTEX) {
aProf = aShapeBase;
}
- else if( aShapeBase.ShapeType() == TopAbs_EDGE) {
+ else if (aShapeBase.ShapeType() == TopAbs_EDGE) {
aProf = BRepBuilderAPI_MakeWire(TopoDS::Edge(aShapeBase)).Shape();
}
- else if( aShapeBase.ShapeType() == TopAbs_WIRE) {
+ else if (aShapeBase.ShapeType() == TopAbs_WIRE) {
aProf = aShapeBase;
}
- else if( aShapeBase.ShapeType() == TopAbs_FACE) {
+ else if (aShapeBase.ShapeType() == TopAbs_FACE) {
TopExp_Explorer wexp(aShapeBase,TopAbs_WIRE);
aProf = wexp.Current();
}
PipeBuilder.Add(aProf);
if (aShapeVec.IsNull()) {
- if(aCIBN) delete aCIBN;
+ if (aCIBN) delete aCIBN;
Standard_NullObject::Raise
("MakePipe aborted : null vector argument");
}
gp_Dir BiNormal(aVec);
PipeBuilder.SetMode(BiNormal);
PipeBuilder.Build();
- if( aShapeBase.ShapeType() == TopAbs_FACE) {
+ if (aShapeBase.ShapeType() == TopAbs_FACE) {
PipeBuilder.MakeSolid();
}
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
GEOMImpl_IPipe* aCI= 0;
Standard_Integer aType = aFunction->GetType();
- if(aType == PIPE_BASE_PATH)
+ if (aType == PIPE_BASE_PATH)
aCI = new GEOMImpl_IPipe(aFunction);
- else if(aType == PIPE_DIFFERENT_SECTIONS)
+ else if (aType == PIPE_DIFFERENT_SECTIONS)
aCI = new GEOMImpl_IPipeDiffSect(aFunction);
- else if(aType == PIPE_SHELL_SECTIONS)
+ else if (aType == PIPE_SHELL_SECTIONS)
aCI = new GEOMImpl_IPipeShellSect(aFunction);
- else if(aType == PIPE_SHELLS_WITHOUT_PATH)
+ else if (aType == PIPE_SHELLS_WITHOUT_PATH)
aCI = new GEOMImpl_IPipeShellSect(aFunction);
- else if(aType == PIPE_BI_NORMAL_ALONG_VECTOR)
+ else if (aType == PIPE_BI_NORMAL_ALONG_VECTOR)
aCI = new GEOMImpl_IPipeBiNormal(aFunction);
else
return 0;
TopoDS_Wire aWirePath;
- if(aType != PIPE_SHELLS_WITHOUT_PATH) {
+ if (aType != PIPE_SHELLS_WITHOUT_PATH) {
// working with path
Handle(GEOM_Function) aRefPath = aCI->GetPath();
TopoDS_Shape aShapePath = aRefPath->GetValue();
if (aShapePath.IsNull()) {
MESSAGE ("Driver : path is null");
- if(aCI) delete aCI;
+ if (aCI) delete aCI;
Standard_NullObject::Raise("MakePipe aborted : null path argument");
}
// Get path contour
bool isOk = false;
- if ( aShapePath.ShapeType() == TopAbs_COMPOUND ) {
+ if (aShapePath.ShapeType() == TopAbs_COMPOUND) {
TopTools_SequenceOfShape anEdges;
TopExp_Explorer anExp;
BRep_Builder B;
TopoDS_Wire W;
B.MakeWire(W);
- for ( anExp.Init( aShapePath, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
- B.Add( W, anExp.Current() );
+ for (anExp.Init(aShapePath, TopAbs_EDGE); anExp.More(); anExp.Next()) {
+ B.Add(W, anExp.Current());
isOk = true;
}
- if ( isOk )
+ if (isOk)
aWirePath = W;
}
else if (aShapePath.ShapeType() == TopAbs_WIRE) {
isOk = true;
}
}
- if ( !isOk ) {
- if(aCI) delete aCI;
+ if (!isOk) {
+ if (aCI) delete aCI;
Standard_TypeMismatch::Raise("MakePipe aborted : path shape is neither a wire nor an edge");
}
}
TopoDS_Shape aShape;
- if (aType == PIPE_BASE_PATH)
- {
+ if (aType == PIPE_BASE_PATH) {
Handle(GEOM_Function) aRefBase = aCI->GetBase();
TopoDS_Shape aShapeBase;
// Make copy to prevent modifying of base object 0020766 : EDF 1320
BRepBuilderAPI_Copy Copy(aRefBase->GetValue());
- if( Copy.IsDone() )
+ if (Copy.IsDone())
aShapeBase = Copy.Shape();
if (aShapeBase.IsNull()) {
- if(aCI) delete aCI;
+ if (aCI) delete aCI;
Standard_NullObject::Raise("MakePipe aborted : null base argument");
}
//building pipe with different sections
else if (aType == PIPE_DIFFERENT_SECTIONS) {
GEOMImpl_IPipeDiffSect* aCIDS = (GEOMImpl_IPipeDiffSect*)aCI;
- //GEOMImpl_IPipeDiffSect* aCIDS = static_cast<GEOMImpl_IPipeDiffSect*>(aCI);
- //BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
Handle(TColStd_HSequenceOfTransient) aBasesObjs = aCIDS->GetBases ();
Handle(TColStd_HSequenceOfTransient) aLocObjs = aCIDS->GetLocations ();
Standard_Boolean aWithContact = (aCIDS->GetWithContactMode());
Standard_Boolean aWithCorrect = (aCIDS->GetWithCorrectionMode());
+ if (aCI) {
+ delete aCI;
+ aCI = 0;
+ }
- Standard_Integer i =1, nbBases = aBasesObjs->Length(),
- nbLocs = (aLocObjs.IsNull() ? 0 :aLocObjs->Length());
+ Standard_Integer nbBases = aBasesObjs->Length();
+ Standard_Integer nbLocs = (aLocObjs.IsNull() ? 0 : aLocObjs->Length());
- if(nbLocs && nbLocs != nbBases) {
- if(aCI) delete aCI;
- Standard_ConstructionError::Raise("Number of sections is not equal to number of locations ");
- }
- TopTools_SequenceOfShape aSeqBases;
- TopTools_SequenceOfShape aSeqLocs;
- TopTools_SequenceOfShape aSeqFaces;
- for (; i <= nbBases; i++) {
+ Handle(TopTools_HSequenceOfShape) aHSeqBases = new TopTools_HSequenceOfShape;
+ Handle(TopTools_HSequenceOfShape) aHSeqLocs = new TopTools_HSequenceOfShape;
+ Standard_Integer i;
+
+ for (i = 1; i <= nbBases; i++) {
Handle(Standard_Transient) anItem = aBasesObjs->Value(i);
- if(anItem.IsNull())
+ if (anItem.IsNull())
continue;
Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
- if(aRefBase.IsNull())
+ if (aRefBase.IsNull())
continue;
-
- if(aRefBase->GetValue().IsNull())
+ if (aRefBase->GetValue().IsNull())
continue;
- // Make copy to prevent modifying of base object 0020766 : EDF 1320
- TopoDS_Shape aShapeBase;
- BRepBuilderAPI_Copy Copy(aRefBase->GetValue());
- if( Copy.IsDone() )
- aShapeBase = Copy.Shape();
-
- TopAbs_ShapeEnum aTypeBase = aShapeBase.ShapeType();
-
- //if for section was specified face with a few wires then a few
- // pipes were build and make solid
- Standard_Boolean NeedCreateSolid = Standard_False;
- if(aTypeBase == TopAbs_SHELL) {
- // create wire as boundary contour if shell is no closed
- // get free boundary shapes
- ShapeAnalysis_FreeBounds anAnalizer( aShapeBase );
- TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
- TopExp_Explorer anExp;
- TopoDS_Shape aWire;
- Standard_Integer NbWires = 0;
- for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
- NbWires++;
- aWire = anExp.Current();
- }
- if(NbWires!=1) {
- // bad case
- if(aCI) delete aCI;
- Standard_ConstructionError::Raise("Bad shell is used as section ");
- }
- NeedCreateSolid = Standard_True;
- aSeqFaces.Append(aShapeBase);
- aSeqBases.Append(aWire);
- }
- else if(aTypeBase == TopAbs_FACE) {
- NeedCreateSolid = Standard_True;
- //for case one path should be used other type function
- aSeqFaces.Append(aShapeBase);
- TopExp_Explorer aExpW(aShapeBase,TopAbs_WIRE);
- for (; aExpW.More(); aExpW.Next())
- {
- TopoDS_Shape aWireProf = aExpW.Current();
- aSeqBases.Append(aWireProf);
- }
- }
- else if(aTypeBase == TopAbs_WIRE || aTypeBase == TopAbs_VERTEX) {
- aSeqBases.Append(aShapeBase);
- }
- else if(aTypeBase == TopAbs_EDGE) {
- TopoDS_Edge anEdge = TopoDS::Edge(aShapeBase);
- TopoDS_Shape aWireProf = BRepBuilderAPI_MakeWire(anEdge);
- aSeqBases.Append(aWireProf);
- }
- if(nbLocs) {
- Handle(Standard_Transient) anItemLoc = aLocObjs->Value(i);
- if(anItemLoc.IsNull())
- continue;
- Handle(GEOM_Function) aRefLoc = Handle(GEOM_Function)::DownCast(anItemLoc);
- TopoDS_Shape aShapeLoc = aRefLoc->GetValue();
- if(aShapeLoc.IsNull() || aShapeLoc.ShapeType() != TopAbs_VERTEX)
- continue;
- aSeqLocs.Append(aShapeLoc);
- }
- }
-
- nbLocs = aSeqLocs.Length();
-
- // skl 02.05.2007
- TopTools_SequenceOfShape Edges;
- if(nbLocs>0) {
- // we have to check that each location shape is a vertex from
- // path and update aSeqLocs if it is needed (and possible)
- TColgp_SequenceOfPnt PLocs;
- for(i=1; i<=nbLocs; i++) {
- TopoDS_Vertex V = TopoDS::Vertex(aSeqLocs.Value(i));
- PLocs.Append(BRep_Tool::Pnt(V));
- }
- //TopTools_SequenceOfShape Edges;
- TopExp_Explorer anExp;
- for ( anExp.Init( aWirePath, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
- Edges.Append(anExp.Current());
- }
- int nbEdges = Edges.Length();
- ShapeAnalysis_Edge sae;
- TopoDS_Edge edge = TopoDS::Edge(Edges.First());
- double tol = BRep_Tool::Tolerance(edge);
- TopoDS_Vertex VF = sae.FirstVertex(edge);
- gp_Pnt PF = BRep_Tool::Pnt(VF);
- //cout<<"PF("<<PF.X()<<","<<PF.Y()<<","<<PF.Z()<<")"<<endl;
- if( PF.Distance(PLocs.First()) > tol ) {
- if(aCI) delete aCI;
- Standard_ConstructionError::Raise
- ("First location shapes is not coincided with first vertex of aWirePath");
- }
- aSeqLocs.ChangeValue(1) = VF;
- edge = TopoDS::Edge(Edges.Last());
- tol = BRep_Tool::Tolerance(edge);
- TopoDS_Vertex VL = sae.LastVertex(edge);
- gp_Pnt PL = BRep_Tool::Pnt(VL);
- if( PL.Distance(PLocs.Last()) > tol ) {
- if(aCI) delete aCI;
- Standard_ConstructionError::Raise
- ("Last location shapes is not coincided with last vertex of aWirePath");
- }
- aSeqLocs.ChangeValue(nbLocs) = VL;
- int jcurr = 2;
- for(i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
- TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
- tol = BRep_Tool::Tolerance(edge);
- TopoDS_Vertex V1 = sae.FirstVertex(E);
- TopoDS_Vertex V2 = sae.LastVertex(E);
- gp_Pnt P1 = BRep_Tool::Pnt(V1);
- gp_Pnt P2 = BRep_Tool::Pnt(V2);
- if( P2.Distance(PLocs.Value(jcurr)) < tol ) {
- aSeqLocs.ChangeValue(jcurr) = V2;
- jcurr++;
- }
- else {
- // find distance between E and aLocs(jcurr)
- double fp,lp;
- Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
- GeomAPI_ProjectPointOnCurve PPCurve (PLocs.Value(jcurr),C);
- if( PPCurve.NbPoints()>0 &&
- PLocs.Value(jcurr).Distance(PPCurve.Point(1)) < tol ) {
- double param = PPCurve.Parameter(1);
- gp_Pnt PC1;
- C->D0(param,PC1);
- // split current edge
- Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
- Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
- TopoDS_Edge E1,E2;
- BRep_Builder B;
- gp_Pnt Pfp;
- C->D0(fp,Pfp);
- if(Pfp.Distance(P1)<tol) {
- B.MakeEdge(E1,tc1,tol);
- B.Add(E1,V1);
- TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
- B.Add(E1,TopoDS::Vertex(tmpV));
- B.MakeEdge(E2,tc2,tol);
- tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
- B.Add(E2,TopoDS::Vertex(tmpV));
- B.Add(E2,V2);
- }
- else {
- B.MakeEdge(E1,tc2,tol);
- TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
- B.Add(E1,TopoDS::Vertex(tmpV));
- B.Add(E1,V1);
- E1.Reverse();
- B.MakeEdge(E2,tc1,tol);
- B.Add(E2,V2);
- tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
- B.Add(E2,TopoDS::Vertex(tmpV));
- E2.Reverse();
- }
- jcurr++;
- Edges.Remove(i);
- Edges.InsertAfter(i-1,E1);
- Edges.InsertAfter(i,E2);
- }
- }
- }
- if(nbEdges<Edges.Length()) {
- // one of edges was splitted => we have to update WirePath
- BRep_Builder B;
- TopoDS_Wire W;
- B.MakeWire(W);
- for(i=1; i<=Edges.Length(); i++) {
- B.Add(W,TopoDS::Edge(Edges.Value(i)));
- }
- aWirePath = W;
- }
- }
-
- // check curvature of wire for condition that
- // max summary angle between directions along
- // wire path must be < 4*PI. If not - split wire
- // and seguences of shapes, perform pipe for each
- // and make sewing after that
- double fp,lp;
- Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(Edges.Value(1)),fp,lp);
- gp_Pnt P1,P2;
- gp_Vec Vec1,Vec2;
- C->D1(fp,P1,Vec1);
- C->D1(lp,P2,Vec2);
- double SumAng = fabs(Vec1.Angle(Vec2));
- Vec1 = Vec2;
- P1 = P2;
- TColStd_SequenceOfInteger SplitEdgeNums,SplitLocNums;
- int LastLoc = 1;
- //cout<<"Edges.Length()="<<Edges.Length()<<endl;
- for(i=2; i<=Edges.Length(); i++) {
- TopoDS_Edge edge = TopoDS::Edge(Edges.Value(i));
- double tol = BRep_Tool::Tolerance(edge);
- Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
- C->D1(lp,P2,Vec2);
- double ang = fabs(Vec1.Angle(Vec2));
- SumAng += ang;
- if(SumAng>4*PI) {
- SumAng = ang;
- SplitEdgeNums.Append(i-1);
- int j;
- for(j=LastLoc+1; j<=aSeqLocs.Length(); j++) {
- TopoDS_Vertex aVert = TopoDS::Vertex(aSeqLocs.Value(j));
- gp_Pnt P = BRep_Tool::Pnt(aVert);
- if( P1.Distance(P) < tol ) {
- SplitLocNums.Append(j);
- LastLoc = j;
- break;
- }
- }
- }
- Vec1 = Vec2;
- P1 = P2;
+ aHSeqBases->Append(aRefBase->GetValue());
}
+ for (i = 1; i <= nbLocs; i++) {
+ Handle(Standard_Transient) anItemLoc = aLocObjs->Value(i);
+ if (anItemLoc.IsNull())
+ continue;
+ Handle(GEOM_Function) aRefLoc = Handle(GEOM_Function)::DownCast(anItemLoc);
+ TopoDS_Shape aShapeLoc = aRefLoc->GetValue();
+ if (aShapeLoc.IsNull() || aShapeLoc.ShapeType() != TopAbs_VERTEX)
+ continue;
- //cout<<"SplitEdgeNums.Length()="<<SplitEdgeNums.Length()<<endl;
- //cout<<"SplitLocNums.Length()="<<SplitLocNums.Length()<<endl;
- if( SplitLocNums.Length()==SplitEdgeNums.Length() && SplitEdgeNums.Length()>0 ) {
- TopTools_SequenceOfShape aSeqRes;
- int nn, num1 = 1, num2 = 1;
- for(nn=1; nn<=SplitEdgeNums.Length(); nn++) {
- // create wirepath and sequences of shapes
- BRep_Builder B;
- TopoDS_Wire tmpW;
- B.MakeWire(tmpW);
- for(i=num1; i<=SplitEdgeNums.Value(nn); i++) {
- B.Add(tmpW,TopoDS::Edge(Edges.Value(i)));
- }
- num1 = SplitEdgeNums.Value(nn) + 1;
- TopTools_SequenceOfShape aTmpSeqBases;
- TopTools_SequenceOfShape aTmpSeqLocs;
- for(i=num2; i<=SplitLocNums.Value(nn); i++) {
- aTmpSeqBases.Append(aSeqBases.Value(i));
- aTmpSeqLocs.Append(aSeqLocs.Value(i));
- }
- num2 = SplitLocNums.Value(nn);
- // make pipe
- BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
- Standard_Integer nbShapes = aTmpSeqBases.Length();
- for(i=1; i<=nbShapes; i++) {
- TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
- TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
- aBuilder.Add(aTmpSeqBases.Value(i), aVert, aWithContact, aWithCorrect);
- }
- if(!aBuilder.IsReady()) {
- if(aCI) delete aCI;
- Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
- }
- aBuilder.Build();
- TopoDS_Shape resShape = aBuilder.Shape();
- aSeqRes.Append(resShape);
- }
- // create wirepath and sequences of shapes for last part
- BRep_Builder B;
- TopoDS_Wire tmpW;
- B.MakeWire(tmpW);
- for(i=num1; i<=Edges.Length(); i++) {
- B.Add(tmpW,TopoDS::Edge(Edges.Value(i)));
- }
- TopTools_SequenceOfShape aTmpSeqBases;
- TopTools_SequenceOfShape aTmpSeqLocs;
- for(i=num2; i<=aSeqLocs.Length(); i++) {
- aTmpSeqBases.Append(aSeqBases.Value(i));
- aTmpSeqLocs.Append(aSeqLocs.Value(i));
- }
- // make pipe for last part
- BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
- Standard_Integer nbShapes = aTmpSeqBases.Length();
- for(i=1; i<=nbShapes; i++) {
- TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
- TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
- aBuilder.Add(aTmpSeqBases.Value(i), aVert, aWithContact, aWithCorrect);
- }
- if(!aBuilder.IsReady()) {
- if(aCI) delete aCI;
- Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
- }
- aBuilder.Build();
- TopoDS_Shape resShape = aBuilder.Shape();
- aSeqRes.Append(resShape);
- // make sewing for result
- Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
- aSewing->SetTolerance(Precision::Confusion());
- aSewing->SetFaceMode(Standard_True);
- aSewing->SetFloatingEdgesMode(Standard_False);
- aSewing->SetNonManifoldMode(Standard_False);
- for(i=1; i<=aSeqRes.Length(); i++) {
- aSewing->Add(aSeqRes.Value(i));
- }
- aSewing->Perform();
- aShape = aSewing->SewedShape();
+ aHSeqLocs->Append(aShapeLoc);
}
- else {
- // old implementation without splitting
- BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
- Standard_Integer nbShapes = aSeqBases.Length();
- Standard_Integer step = nbShapes/nbBases;
-
- if (nbShapes < nbBases || fmod((double)nbShapes, (double)nbBases)) {
- if(aCI) delete aCI;
- Standard_ConstructionError::Raise("Invalid sections were specified for building pipe");
- }
- Standard_Integer ind =0;
- for (i = 1; i <= nbShapes && ind < nbShapes; i++) { //i+nbBases <= nbShapes
- TopTools_SequenceOfShape usedBases;
- Standard_Integer j = 1;
- for (; j <= nbBases; j++) {
- ind = i + (j-1)*step;
- TopoDS_Shape aWireProf = aSeqBases.Value(ind);
- usedBases.Append(aWireProf);
- if(nbLocs) {
- TopoDS_Shape aShapeLoc = aSeqLocs.Value(j);
- TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
- aBuilder.Add(aWireProf,aVert,aWithContact,aWithCorrect);
- }
- else
- aBuilder.Add(aWireProf,aWithContact,aWithCorrect);
- }
- if(!aBuilder.IsReady()) {
- if(aCI) delete aCI;
- Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
- }
- aBuilder.Build();
- aShape = aBuilder.Shape();
- aSeqFaces.Append(aShape);
- for( j = 1; j <=usedBases.Length(); j++)
- aBuilder.Delete(usedBases.Value(j));
- }
-
- //for case if section is face
- if(aSeqFaces.Length() >1) {
- BRep_Builder aB;
- TopoDS_Compound aComp;
- aB.MakeCompound(aComp);
- for( i = 1; i <= aSeqFaces.Length(); i++)
- aB.Add(aComp,aSeqFaces.Value(i));
- aShape = aComp;
- }
- }
+ aShape = CreatePipeWithDifferentSections(aWirePath, aHSeqBases, aHSeqLocs, aWithContact, aWithCorrect);
}
//building pipe with shell sections
{
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_PipeDriver",
// 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
#include <Standard_CString.hxx>
#endif
+#include <TopoDS_Wire.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopTools_HSequenceOfShape.hxx>
+
class TColStd_SequenceOfExtendedString;
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
//
// 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>
}
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.
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();
}
// 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);
}
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();
}
}
}
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();
+ }
}
}
}
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();
+ }
}
}
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",
//=======================================================================
//function : DownCast
//purpose :
-//=======================================================================
+//=======================================================================
const Handle(GEOMImpl_PrismDriver) Handle(GEOMImpl_PrismDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(GEOMImpl_PrismDriver) _anOtherObject;
}
}
- return _anOtherObject ;
+ return _anOtherObject;
}
// 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
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
#include <Standard_CString.hxx>
#endif
+#include <TopoDS_Shape.hxx>
+#include <gp_Vec.hxx>
+#include <Standard_Real.hxx>
+
class TColStd_SequenceOfExtendedString;
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 ~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();
- // 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() {};
+ 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)); }
};
// 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>
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();
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));
+ }
+ }
+ else {
+ for (ind = 1; ind <= aLen; ind++) {
+ aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
+ }
}
- int isClosed = aCI.GetIsClosed();
+ bool isClosed = aCI.GetIsClosed();
GeomAPI_Interpolate GBC (aHCurvePoints, isClosed, gp::Resolution());
GBC.Perform();
if (GBC.IsDone())
// 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>
//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();
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
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
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
// 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
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);
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,
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);
// 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>
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakePolyline
- (const GEOM::ListOfGO& thePoints)
+ (const GEOM::ListOfGO& thePoints,
+ CORBA::Boolean theIsClosed)
{
GEOM::GEOM_Object_var aGEOMObject;
// Make Polyline
Handle(GEOM_Object) anObject =
- GetOperations()->MakePolyline(aPoints);
+ GetOperations()->MakePolyline(aPoints, theIsClosed);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineBezier
- (const GEOM::ListOfGO& thePoints)
+ (const GEOM::ListOfGO& thePoints,
+ CORBA::Boolean theIsClosed)
{
GEOM::GEOM_Object_var aGEOMObject;
// Make Bezier curve
Handle(GEOM_Object) anObject =
- GetOperations()->MakeSplineBezier(aPoints);
+ GetOperations()->MakeSplineBezier(aPoints, theIsClosed);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
(const GEOM::ListOfGO& thePoints,
- CORBA::Boolean theIsClosed)
+ CORBA::Boolean theIsClosed,
+ CORBA::Boolean theDoReordering)
{
GEOM::GEOM_Object_var aGEOMObject;
// Make Polyline
Handle(GEOM_Object) anObject =
- GetOperations()->MakeSplineInterpolation(aPoints, theIsClosed);
+ GetOperations()->MakeSplineInterpolation(aPoints, theIsClosed, theDoReordering);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
// 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
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);
//=============================================================================
// 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;
}
//=============================================================================
// 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;
}
// 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;
}
// 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_SUPERV_I_H__
#define __GEOM_SUPERV_I_H__
#include "GEOM_List_i.hh"
class GEOM_Superv_i : public virtual POA_GEOM::GEOM_Superv,
- public Engines_Component_i
+ public Engines_Component_i
{
public:
GEOM_Superv_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName);
~GEOM_Superv_i();
// generic method to be put in a super class
void getAdvancedOp();
PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject,
- PortableServer::POA_ptr thePOA);
+ PortableServer::POA_ptr thePOA);
//-----------------------------------------------------------------------//
// Set current stydy ID //
//-----------------------------------------------------------------------//
- void SetStudyID( CORBA::Long theId );
+ void SetStudyID( CORBA::Long theId );
//-----------------------------------------------------------//
- // Create ListOfGO and add items to it //
+ // Create ListOfGO and add items to it //
//-----------------------------------------------------------//
GEOM::GEOM_List_ptr CreateListOfGO();
- void AddItemToListOfGO(GEOM::GEOM_List_ptr& theList,
- GEOM::GEOM_Object_ptr theObject);
+ void AddItemToListOfGO(GEOM::GEOM_List_ptr& theList,
+ GEOM::GEOM_Object_ptr theObject);
//-----------------------------------------------------------//
- // Create ListOfLong and add items to it //
+ // Create ListOfLong and add items to it //
//-----------------------------------------------------------//
GEOM::GEOM_List_ptr CreateListOfLong();
- void AddItemToListOfLong(GEOM::GEOM_List_ptr& theList,
- CORBA::Long theObject);
-
+ void AddItemToListOfLong(GEOM::GEOM_List_ptr& theList,
+ CORBA::Long theObject);
+
//-----------------------------------------------------------//
- // Create ListOfDouble and add items to it //
+ // Create ListOfDouble and add items to it //
//-----------------------------------------------------------//
GEOM::GEOM_List_ptr CreateListOfDouble();
- void AddItemToListOfDouble(GEOM::GEOM_List_ptr& theList,
- CORBA::Double theObject);
+ void AddItemToListOfDouble(GEOM::GEOM_List_ptr& theList,
+ CORBA::Double theObject);
//-----------------------------------------------------------------------//
// Inherited methods from SALOMEDS::Driver //
- //-----------------------------------------------------------------------//
+ //-----------------------------------------------------------------------//
SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- CORBA::Boolean isMultiFile);
+ const char* theURL,
+ CORBA::Boolean isMultiFile);
SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- CORBA::Boolean isMultiFile);
-
+ const char* theURL,
+ CORBA::Boolean isMultiFile);
+
CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
- const SALOMEDS::TMPFile& theStream,
- const char* theURL,
- CORBA::Boolean isMultiFile);
+ const SALOMEDS::TMPFile& theStream,
+ const char* theURL,
+ CORBA::Boolean isMultiFile);
CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent,
- const SALOMEDS::TMPFile& theStream,
- const char* theURL,
- CORBA::Boolean isMultiFile);
+ const SALOMEDS::TMPFile& theStream,
+ const char* theURL,
+ CORBA::Boolean isMultiFile);
void Close(SALOMEDS::SComponent_ptr theComponent);
char* ComponentDataType();
char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
- const char* IORString,
- CORBA::Boolean isMultiFile,
- CORBA::Boolean isASCII);
+ const char* IORString,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean isASCII);
char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
- const char* aLocalPersistentID,
- CORBA::Boolean isMultiFile,
- CORBA::Boolean isASCII);
+ const char* aLocalPersistentID,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean isASCII);
CORBA::Boolean CanPublishInStudy(CORBA::Object_ptr theIOR);
SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
- CORBA::Object_ptr theObject,
- const char* theName) throw (SALOME::SALOME_Exception) ;
+ SALOMEDS::SObject_ptr theSObject,
+ CORBA::Object_ptr theObject,
+ const char* theName) throw (SALOME::SALOME_Exception) ;
GEOM::ListOfGO* PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy,
- //SALOMEDS::SObject_ptr theSObject,
- CORBA::Object_ptr theObject);
+ //SALOMEDS::SObject_ptr theSObject,
+ CORBA::Object_ptr theObject);
CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
- CORBA::Long theObjectID,
- SALOMEDS::SObject_ptr theObject);
+ CORBA::Long theObjectID,
+ SALOMEDS::SObject_ptr theObject);
//-----------------------------------------------------------//
- // Primitives Construction : BasicOperations //
+ // Primitives Construction : BasicOperations //
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakePointXYZ (CORBA::Double theX,
- CORBA::Double theY,
- CORBA::Double theZ);
+ CORBA::Double theY,
+ CORBA::Double theZ);
GEOM::GEOM_Object_ptr MakePointWithReference (GEOM::GEOM_Object_ptr theReference,
- CORBA::Double theX,
- CORBA::Double theY,
- CORBA::Double theZ);
+ CORBA::Double theX,
+ CORBA::Double theY,
+ CORBA::Double theZ);
GEOM::GEOM_Object_ptr MakePointOnCurve (GEOM::GEOM_Object_ptr theRefCurve,
- CORBA::Double theParameter);
+ CORBA::Double theParameter);
GEOM::GEOM_Object_ptr MakePointOnCurveByLength (GEOM::GEOM_Object_ptr theRefCurve,
- CORBA::Double theLength,
- CORBA::Boolean theReverse);
+ CORBA::Double theLength,
+ CORBA::Boolean theReverse);
GEOM::GEOM_Object_ptr MakePointOnCurveByCoord (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theXParameter,
CORBA::Double theYParameter,
CORBA::Double theYParameter,
CORBA::Double theZParameter);
GEOM::GEOM_Object_ptr MakePointOnLinesIntersection (GEOM::GEOM_Object_ptr theRefLine1,
- GEOM::GEOM_Object_ptr theRefLine2);
+ GEOM::GEOM_Object_ptr theRefLine2);
GEOM::GEOM_Object_ptr MakeTangentOnCurve (GEOM::GEOM_Object_ptr theRefCurve,
- CORBA::Double theParameter);
+ CORBA::Double theParameter);
GEOM::GEOM_Object_ptr MakeVectorDXDYDZ (CORBA::Double theDX,
- CORBA::Double theDY,
- CORBA::Double theDZ);
+ CORBA::Double theDY,
+ CORBA::Double theDZ);
GEOM::GEOM_Object_ptr MakeVectorTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2);
+ GEOM::GEOM_Object_ptr thePnt2);
GEOM::GEOM_Object_ptr MakeLineTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2);
+ GEOM::GEOM_Object_ptr thePnt2);
GEOM::GEOM_Object_ptr MakeLineTwoFaces (GEOM::GEOM_Object_ptr theFace1,
- GEOM::GEOM_Object_ptr theFace2);
+ GEOM::GEOM_Object_ptr theFace2);
GEOM::GEOM_Object_ptr MakePlaneThreePnt (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2,
- GEOM::GEOM_Object_ptr thePnt3,
- CORBA::Double theTrimSize);
+ GEOM::GEOM_Object_ptr thePnt2,
+ GEOM::GEOM_Object_ptr thePnt3,
+ CORBA::Double theTrimSize);
GEOM::GEOM_Object_ptr MakePlanePntVec (GEOM::GEOM_Object_ptr thePnt,
- GEOM::GEOM_Object_ptr theVec,
- CORBA::Double theTrimSize);
+ GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theTrimSize);
GEOM::GEOM_Object_ptr MakePlaneFace (GEOM::GEOM_Object_ptr theFace,
- CORBA::Double theTrimSize);
+ CORBA::Double theTrimSize);
GEOM::GEOM_Object_ptr MakePlane2Vec (GEOM::GEOM_Object_ptr theVec1,
- GEOM::GEOM_Object_ptr theVec2,
- CORBA::Double theTrimSize);
+ GEOM::GEOM_Object_ptr theVec2,
+ CORBA::Double theTrimSize);
GEOM::GEOM_Object_ptr MakePlaneLCS (GEOM::GEOM_Object_ptr theLCS,
- CORBA::Double theTrimSize,
- CORBA::Double theOrientation);
+ CORBA::Double theTrimSize,
+ CORBA::Double theOrientation);
GEOM::GEOM_Object_ptr MakeMarker (CORBA::Double theOX , CORBA::Double theOY , CORBA::Double theOZ,
- CORBA::Double theXDX, CORBA::Double theXDY, CORBA::Double theXDZ,
- CORBA::Double theYDX, CORBA::Double theYDY, CORBA::Double theYDZ);
+ CORBA::Double theXDX, CORBA::Double theXDY, CORBA::Double theXDZ,
+ CORBA::Double theYDX, CORBA::Double theYDY, CORBA::Double theYDZ);
GEOM::GEOM_Object_ptr MakeMarkerFromShape (GEOM::GEOM_Object_ptr theShape);
GEOM::GEOM_Object_ptr MakeMarkerPntTwoVec (GEOM::GEOM_Object_ptr theOrigin,
GEOM::GEOM_Object_ptr theXVec,
GEOM::GEOM_Object_ptr theYVec);
-
- GEOM::GEOM_Object_ptr MakeTangentPlaneOnFace (GEOM::GEOM_Object_ptr theFace,
- CORBA::Double theParameterU,
- CORBA::Double theParameterV,
- CORBA::Double theTrimSize);
+
+ GEOM::GEOM_Object_ptr MakeTangentPlaneOnFace (GEOM::GEOM_Object_ptr theFace,
+ CORBA::Double theParameterU,
+ CORBA::Double theParameterV,
+ CORBA::Double theTrimSize);
//-----------------------------------------------------------//
// Primitives Construction : 3DPrimOperations //
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakeBox (CORBA::Double theX1,
- CORBA::Double theY1,
- CORBA::Double theZ1,
- CORBA::Double theX2,
- CORBA::Double theY2,
- CORBA::Double theZ2);
- GEOM::GEOM_Object_ptr MakeBoxDXDYDZ (CORBA::Double theDX,
- CORBA::Double theDY,
- CORBA::Double theDZ);
- GEOM::GEOM_Object_ptr MakeBoxTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2);
+ CORBA::Double theY1,
+ CORBA::Double theZ1,
+ CORBA::Double theX2,
+ CORBA::Double theY2,
+ CORBA::Double theZ2);
+ GEOM::GEOM_Object_ptr MakeBoxDXDYDZ (CORBA::Double theDX,
+ CORBA::Double theDY,
+ CORBA::Double theDZ);
+ GEOM::GEOM_Object_ptr MakeBoxTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
+ GEOM::GEOM_Object_ptr thePnt2);
GEOM::GEOM_Object_ptr MakeFaceHW (CORBA::Double theH,
- CORBA::Double theW,
- CORBA::Short theOrientation);
- GEOM::GEOM_Object_ptr MakeFaceObjHW (GEOM::GEOM_Object_ptr theObj,
- CORBA::Double theH,
- CORBA::Double theW);
+ CORBA::Double theW,
+ CORBA::Short theOrientation);
+ GEOM::GEOM_Object_ptr MakeFaceObjHW (GEOM::GEOM_Object_ptr theObj,
+ CORBA::Double theH,
+ CORBA::Double theW);
GEOM::GEOM_Object_ptr MakeDiskPntVecR (GEOM::GEOM_Object_ptr theCenter,
- GEOM::GEOM_Object_ptr theVector,
- CORBA::Double theR);
+ GEOM::GEOM_Object_ptr theVector,
+ CORBA::Double theR);
GEOM::GEOM_Object_ptr MakeDiskThreePnt (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2,
- GEOM::GEOM_Object_ptr thePnt3);
+ GEOM::GEOM_Object_ptr thePnt2,
+ GEOM::GEOM_Object_ptr thePnt3);
GEOM::GEOM_Object_ptr MakeDiskR (CORBA::Double theR,
- CORBA::Short theOrientation);
+ CORBA::Short theOrientation);
GEOM::GEOM_Object_ptr MakeCylinderPntVecRH (GEOM::GEOM_Object_ptr thePnt,
- GEOM::GEOM_Object_ptr theAxis,
- CORBA::Double theRadius,
- CORBA::Double theHeight);
- GEOM::GEOM_Object_ptr MakeCylinderRH (CORBA::Double theR,
- CORBA::Double theH);
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theRadius,
+ CORBA::Double theHeight);
+ GEOM::GEOM_Object_ptr MakeCylinderRH (CORBA::Double theR,
+ CORBA::Double theH);
GEOM::GEOM_Object_ptr MakeSphere (CORBA::Double theX,
- CORBA::Double theY,
- CORBA::Double theZ,
- CORBA::Double theRadius);
+ CORBA::Double theY,
+ CORBA::Double theZ,
+ CORBA::Double theRadius);
GEOM::GEOM_Object_ptr MakeSphereR (CORBA::Double theR);
- GEOM::GEOM_Object_ptr MakeSpherePntR (GEOM::GEOM_Object_ptr thePnt,
- CORBA::Double theR);
+ GEOM::GEOM_Object_ptr MakeSpherePntR (GEOM::GEOM_Object_ptr thePnt,
+ CORBA::Double theR);
GEOM::GEOM_Object_ptr MakeTorusPntVecRR (GEOM::GEOM_Object_ptr thePnt,
- GEOM::GEOM_Object_ptr theVec,
- CORBA::Double theRMajor,
- CORBA::Double theRMinor);
+ GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theRMajor,
+ CORBA::Double theRMinor);
GEOM::GEOM_Object_ptr MakeTorusRR (CORBA::Double theRMajor,
- CORBA::Double theRMinor);
+ CORBA::Double theRMinor);
GEOM::GEOM_Object_ptr MakeConePntVecR1R2H (GEOM::GEOM_Object_ptr thePnt,
- GEOM::GEOM_Object_ptr theAxis,
- CORBA::Double theR1,
- CORBA::Double theR2,
- CORBA::Double theHeight);
- GEOM::GEOM_Object_ptr MakeConeR1R2H (CORBA::Double theR1,
- CORBA::Double theR2,
- CORBA::Double theHeight);
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theR1,
+ CORBA::Double theR2,
+ CORBA::Double theHeight);
+ GEOM::GEOM_Object_ptr MakeConeR1R2H (CORBA::Double theR1,
+ CORBA::Double theR2,
+ CORBA::Double theHeight);
GEOM::GEOM_Object_ptr MakePrismVecH (GEOM::GEOM_Object_ptr theBase,
- GEOM::GEOM_Object_ptr theVec,
- CORBA::Double theH);
+ GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theH);
GEOM::GEOM_Object_ptr MakePrismVecH2Ways (GEOM::GEOM_Object_ptr theBase,
- GEOM::GEOM_Object_ptr theVec,
- CORBA::Double theH);
+ GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theH);
GEOM::GEOM_Object_ptr MakePrismTwoPnt (GEOM::GEOM_Object_ptr theBase,
- GEOM::GEOM_Object_ptr thePoint1,
- GEOM::GEOM_Object_ptr thePoint2);
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2);
GEOM::GEOM_Object_ptr MakePrismTwoPnt2Ways (GEOM::GEOM_Object_ptr theBase,
- GEOM::GEOM_Object_ptr thePoint1,
- GEOM::GEOM_Object_ptr thePoint2);
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2);
GEOM::GEOM_Object_ptr MakePrismDXDYDZ (GEOM::GEOM_Object_ptr theBase,
- CORBA::Double theDX,
- CORBA::Double theDY,
- CORBA::Double theDZ);
+ CORBA::Double theDX,
+ CORBA::Double theDY,
+ CORBA::Double theDZ);
GEOM::GEOM_Object_ptr MakePrismDXDYDZ2Ways (GEOM::GEOM_Object_ptr theBase,
- CORBA::Double theDX,
- CORBA::Double theDY,
- CORBA::Double theDZ);
- GEOM::GEOM_Object_ptr MakePipe (GEOM::GEOM_Object_ptr theBase,
- GEOM::GEOM_Object_ptr thePath);
+ CORBA::Double theDX,
+ CORBA::Double theDY,
+ CORBA::Double theDZ);
+ GEOM::GEOM_Object_ptr MakePipe (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr thePath);
GEOM::GEOM_Object_ptr MakeRevolutionAxisAngle (GEOM::GEOM_Object_ptr theBase,
- GEOM::GEOM_Object_ptr theAxis,
- CORBA::Double theAngle);
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theAngle);
GEOM::GEOM_Object_ptr MakeRevolutionAxisAngle2Ways (GEOM::GEOM_Object_ptr theBase,
- GEOM::GEOM_Object_ptr theAxis,
- CORBA::Double theAngle);
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theAngle);
GEOM::GEOM_Object_ptr MakeFilling (GEOM::GEOM_Object_ptr theShape,
- CORBA::Long theMinDeg, CORBA::Long theMaxDeg,
- CORBA::Double theTol2D, CORBA::Double theTol3D,
- CORBA::Long theNbIter,
+ CORBA::Long theMinDeg, CORBA::Long theMaxDeg,
+ CORBA::Double theTol2D, CORBA::Double theTol3D,
+ CORBA::Long theNbIter,
GEOM::filling_oper_method theMethod,
CORBA::Boolean theApprox);
GEOM::GEOM_Object_ptr MakeThruSections(const GEOM::ListOfGO& theSeqSections,
- CORBA::Boolean theModeSolid,
- CORBA::Double thePreci,
- CORBA::Boolean theRuled);
-
+ CORBA::Boolean theModeSolid,
+ CORBA::Double thePreci,
+ CORBA::Boolean theRuled);
+
GEOM::GEOM_Object_ptr MakePipeWithDifferentSections(const GEOM::ListOfGO& theBases,
- const GEOM::ListOfGO& theLocations,
- GEOM::GEOM_Object_ptr thePath,
- CORBA::Boolean theWithContact,
- CORBA::Boolean theWithCorrections);
-
+ const GEOM::ListOfGO& theLocations,
+ GEOM::GEOM_Object_ptr thePath,
+ CORBA::Boolean theWithContact,
+ CORBA::Boolean theWithCorrections);
+
GEOM::GEOM_Object_ptr MakePipeWithShellSections(const GEOM::ListOfGO& theBases,
- const GEOM::ListOfGO& theSubBases,
- const GEOM::ListOfGO& theLocations,
- GEOM::GEOM_Object_ptr thePath,
- CORBA::Boolean theWithContact,
- CORBA::Boolean theWithCorrections);
+ const GEOM::ListOfGO& theSubBases,
+ const GEOM::ListOfGO& theLocations,
+ GEOM::GEOM_Object_ptr thePath,
+ CORBA::Boolean theWithContact,
+ CORBA::Boolean theWithCorrections);
GEOM::GEOM_Object_ptr MakePipeShellsWithoutPath(const GEOM::ListOfGO& theBases,
- const GEOM::ListOfGO& theLocations);
-
+ const GEOM::ListOfGO& theLocations);
+
GEOM::GEOM_Object_ptr MakePipeBiNormalAlongVector (GEOM::GEOM_Object_ptr theBase,
- GEOM::GEOM_Object_ptr thePath,
- GEOM::GEOM_Object_ptr theVec);
+ GEOM::GEOM_Object_ptr thePath,
+ GEOM::GEOM_Object_ptr theVec);
//-----------------------------------------------------------//
// BooleanOperations //
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakeBoolean (GEOM::GEOM_Object_ptr theShape1,
- GEOM::GEOM_Object_ptr theShape2,
- CORBA::Long theOperation);
+ GEOM::GEOM_Object_ptr theShape2,
+ CORBA::Long theOperation);
GEOM::GEOM_Object_ptr MakeFuse (GEOM::GEOM_Object_ptr theShape1,
- GEOM::GEOM_Object_ptr theShape2);
+ GEOM::GEOM_Object_ptr theShape2);
GEOM::GEOM_Object_ptr MakePartition (GEOM::GEOM_List_ptr theShapes,
- GEOM::GEOM_List_ptr theTools,
- GEOM::GEOM_List_ptr theKeepInside,
- GEOM::GEOM_List_ptr theRemoveInside,
- CORBA::Short theLimit,
- CORBA::Boolean theRemoveWebs,
- GEOM::GEOM_List_ptr theMaterials,
- CORBA::Short theKeepNonlimitShapes);
+ GEOM::GEOM_List_ptr theTools,
+ GEOM::GEOM_List_ptr theKeepInside,
+ GEOM::GEOM_List_ptr theRemoveInside,
+ CORBA::Short theLimit,
+ CORBA::Boolean theRemoveWebs,
+ GEOM::GEOM_List_ptr theMaterials,
+ CORBA::Short theKeepNonlimitShapes);
GEOM::GEOM_Object_ptr MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePlane);
+ GEOM::GEOM_Object_ptr thePlane);
//-----------------------------------------------------------//
// InsertOperations //
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakeCopy (GEOM::GEOM_Object_ptr theOriginal);
- void Export (GEOM::GEOM_Object_ptr theObject,
- const char* theFileName,
- const char* theFormatName);
- GEOM::GEOM_Object_ptr Import (const char* theFileName,
- const char* theFormatName);
+ void Export (GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName,
+ const char* theFormatName);
+ GEOM::GEOM_Object_ptr Import (const char* theFileName,
+ const char* theFormatName);
void ImportTranslators (GEOM::string_array_out theFormats,
- GEOM::string_array_out thePatterns);
+ GEOM::string_array_out thePatterns);
void ExportTranslators (GEOM::string_array_out theFormats,
- GEOM::string_array_out thePatterns);
+ GEOM::string_array_out thePatterns);
//-----------------------------------------------------------//
// TransformOperations //
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr TranslateTwoPoints (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePoint1,
- GEOM::GEOM_Object_ptr thePoint2);
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2);
GEOM::GEOM_Object_ptr TranslateTwoPointsCopy (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePoint1,
- GEOM::GEOM_Object_ptr thePoint2);
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2);
GEOM::GEOM_Object_ptr TranslateDXDYDZ (GEOM::GEOM_Object_ptr theObject,
- CORBA::Double theDX,
- CORBA::Double theDY,
- CORBA::Double theDZ);
+ CORBA::Double theDX,
+ CORBA::Double theDY,
+ CORBA::Double theDZ);
GEOM::GEOM_Object_ptr TranslateDXDYDZCopy (GEOM::GEOM_Object_ptr theObject,
- CORBA::Double theDX,
- CORBA::Double theDY,
- CORBA::Double theDZ);
+ CORBA::Double theDX,
+ CORBA::Double theDY,
+ CORBA::Double theDZ);
GEOM::GEOM_Object_ptr TranslateVector (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theVector);
+ GEOM::GEOM_Object_ptr theVector);
GEOM::GEOM_Object_ptr TranslateVectorCopy (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theVector);
+ GEOM::GEOM_Object_ptr theVector);
GEOM::GEOM_Object_ptr TranslateVectorDistance (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theVector,
- CORBA::Double theDistance,
- CORBA::Boolean theCopy);
+ GEOM::GEOM_Object_ptr theVector,
+ CORBA::Double theDistance,
+ CORBA::Boolean theCopy);
GEOM::GEOM_Object_ptr MultiTranslate1D (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theVector,
- CORBA::Double theStep,
- CORBA::Long theNbTimes);
+ GEOM::GEOM_Object_ptr theVector,
+ CORBA::Double theStep,
+ CORBA::Long theNbTimes);
GEOM::GEOM_Object_ptr MultiTranslate2D (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theVector1,
- CORBA::Double theStep1,
- CORBA::Long theNbTimes1,
- GEOM::GEOM_Object_ptr theVector2,
- CORBA::Double theStep2,
- CORBA::Long theNbTimes2);
+ GEOM::GEOM_Object_ptr theVector1,
+ CORBA::Double theStep1,
+ CORBA::Long theNbTimes1,
+ GEOM::GEOM_Object_ptr theVector2,
+ CORBA::Double theStep2,
+ CORBA::Long theNbTimes2);
GEOM::GEOM_Object_ptr Rotate (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theAxis,
- CORBA::Double theAngle);
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theAngle);
GEOM::GEOM_Object_ptr RotateCopy (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theAxis,
- CORBA::Double theAngle);
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theAngle);
GEOM::GEOM_Object_ptr RotateThreePoints (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theCentPoint,
- GEOM::GEOM_Object_ptr thePoint1,
- GEOM::GEOM_Object_ptr thePoint2);
+ GEOM::GEOM_Object_ptr theCentPoint,
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2);
GEOM::GEOM_Object_ptr RotateThreePointsCopy (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theCentPoint,
- GEOM::GEOM_Object_ptr thePoint1,
- GEOM::GEOM_Object_ptr thePoint2);
+ GEOM::GEOM_Object_ptr theCentPoint,
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2);
GEOM::GEOM_Object_ptr MultiRotate1D (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theAxis,
- CORBA::Long theNbTimes);
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Long theNbTimes);
GEOM::GEOM_Object_ptr MultiRotate2D (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theAxis,
- CORBA::Double theAngle,
- CORBA::Long theNbTimes1,
- CORBA::Double theStep,
- CORBA::Long theNbTimes2);
- GEOM::GEOM_Object_ptr MirrorPlane (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePlane);
- GEOM::GEOM_Object_ptr MirrorPlaneCopy (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePlane);
- GEOM::GEOM_Object_ptr MirrorAxis (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theAxis);
- GEOM::GEOM_Object_ptr MirrorAxisCopy (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theAxis);
- GEOM::GEOM_Object_ptr MirrorPoint (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePoint);
- GEOM::GEOM_Object_ptr MirrorPointCopy (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePoint);
- GEOM::GEOM_Object_ptr OffsetShape (GEOM::GEOM_Object_ptr theObject,
- CORBA::Double theOffset);
- GEOM::GEOM_Object_ptr OffsetShapeCopy (GEOM::GEOM_Object_ptr theObject,
- CORBA::Double theOffset);
- GEOM::GEOM_Object_ptr ScaleShape (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePoint,
- CORBA::Double theFactor);
- GEOM::GEOM_Object_ptr ScaleShapeCopy (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePoint,
- CORBA::Double theFactor);
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theAngle,
+ CORBA::Long theNbTimes1,
+ CORBA::Double theStep,
+ CORBA::Long theNbTimes2);
+ GEOM::GEOM_Object_ptr MirrorPlane (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr thePlane);
+ GEOM::GEOM_Object_ptr MirrorPlaneCopy (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr thePlane);
+ GEOM::GEOM_Object_ptr MirrorAxis (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr theAxis);
+ GEOM::GEOM_Object_ptr MirrorAxisCopy (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr theAxis);
+ GEOM::GEOM_Object_ptr MirrorPoint (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr thePoint);
+ GEOM::GEOM_Object_ptr MirrorPointCopy (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr thePoint);
+ GEOM::GEOM_Object_ptr OffsetShape (GEOM::GEOM_Object_ptr theObject,
+ CORBA::Double theOffset);
+ GEOM::GEOM_Object_ptr OffsetShapeCopy (GEOM::GEOM_Object_ptr theObject,
+ CORBA::Double theOffset);
+ GEOM::GEOM_Object_ptr ScaleShape (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr thePoint,
+ CORBA::Double theFactor);
+ GEOM::GEOM_Object_ptr ScaleShapeCopy (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr thePoint,
+ CORBA::Double theFactor);
GEOM::GEOM_Object_ptr ScaleShapeAlongAxes (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePoint,
- CORBA::Double theFactorX,
- CORBA::Double theFactorY,
- CORBA::Double theFactorZ);
+ GEOM::GEOM_Object_ptr thePoint,
+ CORBA::Double theFactorX,
+ CORBA::Double theFactorY,
+ CORBA::Double theFactorZ);
GEOM::GEOM_Object_ptr ScaleShapeAlongAxesCopy (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePoint,
- CORBA::Double theFactorX,
- CORBA::Double theFactorY,
- CORBA::Double theFactorZ);
+ GEOM::GEOM_Object_ptr thePoint,
+ CORBA::Double theFactorX,
+ CORBA::Double theFactorY,
+ CORBA::Double theFactorZ);
GEOM::GEOM_Object_ptr PositionShape (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theStartLCS,
- GEOM::GEOM_Object_ptr theEndLCS);
+ GEOM::GEOM_Object_ptr theStartLCS,
+ GEOM::GEOM_Object_ptr theEndLCS);
GEOM::GEOM_Object_ptr PositionShapeCopy (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr theStartLCS,
- GEOM::GEOM_Object_ptr theEndLCS);
+ GEOM::GEOM_Object_ptr theStartLCS,
+ GEOM::GEOM_Object_ptr theEndLCS);
GEOM::GEOM_Object_ptr PositionAlongPath (GEOM::GEOM_Object_ptr theObject,
- GEOM::GEOM_Object_ptr thePath,
- CORBA::Double theDistance,
- CORBA::Boolean theCopy,
- CORBA::Boolean theReverse);
+ GEOM::GEOM_Object_ptr thePath,
+ CORBA::Double theDistance,
+ CORBA::Boolean theCopy,
+ CORBA::Boolean theReverse);
//-----------------------------------------------------------//
// ShapesOperations //
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakeEdge (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2);
+ GEOM::GEOM_Object_ptr thePnt2);
GEOM::GEOM_Object_ptr MakeWire (GEOM::GEOM_List_ptr theEdgesAndWires,
CORBA::Double theTolerance);
GEOM::GEOM_Object_ptr MakeFace (GEOM::GEOM_Object_ptr theWire,
- CORBA::Boolean isPlanarWanted);
+ CORBA::Boolean isPlanarWanted);
GEOM::GEOM_Object_ptr MakeFaceWires (GEOM::GEOM_List_ptr theWires,
- CORBA::Boolean isPlanarWanted);
+ CORBA::Boolean isPlanarWanted);
GEOM::GEOM_Object_ptr MakeShell (GEOM::GEOM_List_ptr theFacesAndShells);
GEOM::GEOM_Object_ptr MakeSolidShell (GEOM::GEOM_Object_ptr theShell);
GEOM::GEOM_Object_ptr MakeSolidShells (GEOM::GEOM_List_ptr theShells);
GEOM::GEOM_Object_ptr MakeCompound (GEOM::GEOM_List_ptr theShapes);
GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theTolerance,
- CORBA::Boolean doKeepNonSolids);
+ CORBA::Double theTolerance,
+ CORBA::Boolean doKeepNonSolids);
GEOM::GEOM_List_ptr GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theTolerance);
+ CORBA::Double theTolerance);
GEOM::GEOM_Object_ptr MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theTolerance,
- const GEOM::ListOfGO& theFaces,
- CORBA::Boolean doKeepNonSolids);
+ CORBA::Double theTolerance,
+ const GEOM::ListOfGO& theFaces,
+ CORBA::Boolean doKeepNonSolids);
GEOM::GEOM_List_ptr MakeExplode (GEOM::GEOM_Object_ptr theShape,
- CORBA::Long theShapeType,
- CORBA::Boolean isSorted);
+ CORBA::Long theShapeType,
+ CORBA::Boolean isSorted);
CORBA::Long NumberOfFaces (GEOM::GEOM_Object_ptr theShape);
CORBA::Long NumberOfEdges (GEOM::GEOM_Object_ptr theShape);
GEOM::GEOM_Object_ptr ChangeOrientation (GEOM::GEOM_Object_ptr theShape);
GEOM::GEOM_List_ptr GetShapesOnShape (GEOM::GEOM_Object_ptr theCheckShape,
- GEOM::GEOM_Object_ptr theShape,
- CORBA::Short theShapeType,
- GEOM::shape_state theState);
+ GEOM::GEOM_Object_ptr theShape,
+ CORBA::Short theShapeType,
+ GEOM::shape_state theState);
GEOM::GEOM_Object_ptr GetShapesOnShapeAsCompound
(GEOM::GEOM_Object_ptr theCheckShape,
- GEOM::GEOM_Object_ptr theShape,
- CORBA::Short theShapeType,
- GEOM::shape_state theState);
+ GEOM::GEOM_Object_ptr theShape,
+ CORBA::Short theShapeType,
+ GEOM::shape_state theState);
//-----------------------------------------------------------//
// BlocksOperations //
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakeQuad4Vertices (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2,
- GEOM::GEOM_Object_ptr thePnt3,
- GEOM::GEOM_Object_ptr thePnt4);
+ GEOM::GEOM_Object_ptr thePnt2,
+ GEOM::GEOM_Object_ptr thePnt3,
+ GEOM::GEOM_Object_ptr thePnt4);
GEOM::GEOM_Object_ptr MakeQuad (GEOM::GEOM_Object_ptr theEdge1,
- GEOM::GEOM_Object_ptr theEdge2,
- GEOM::GEOM_Object_ptr theEdge3,
- GEOM::GEOM_Object_ptr theEdge4);
+ GEOM::GEOM_Object_ptr theEdge2,
+ GEOM::GEOM_Object_ptr theEdge3,
+ GEOM::GEOM_Object_ptr theEdge4);
GEOM::GEOM_Object_ptr MakeQuad2Edges (GEOM::GEOM_Object_ptr theEdge1,
- GEOM::GEOM_Object_ptr theEdge2);
+ GEOM::GEOM_Object_ptr theEdge2);
GEOM::GEOM_Object_ptr MakeHexa (GEOM::GEOM_Object_ptr theFace1,
- GEOM::GEOM_Object_ptr theFace2,
- GEOM::GEOM_Object_ptr theFace3,
- GEOM::GEOM_Object_ptr theFace4,
- GEOM::GEOM_Object_ptr theFace5,
- GEOM::GEOM_Object_ptr theFace6);
+ GEOM::GEOM_Object_ptr theFace2,
+ GEOM::GEOM_Object_ptr theFace3,
+ GEOM::GEOM_Object_ptr theFace4,
+ GEOM::GEOM_Object_ptr theFace5,
+ GEOM::GEOM_Object_ptr theFace6);
GEOM::GEOM_Object_ptr MakeHexa2Faces (GEOM::GEOM_Object_ptr theFace1,
- GEOM::GEOM_Object_ptr theFace2);
+ GEOM::GEOM_Object_ptr theFace2);
GEOM::GEOM_Object_ptr GetPoint (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theX,
- CORBA::Double theY,
- CORBA::Double theZ,
- CORBA::Double theEpsilon);
+ CORBA::Double theX,
+ CORBA::Double theY,
+ CORBA::Double theZ,
+ CORBA::Double theEpsilon);
GEOM::GEOM_Object_ptr GetEdge (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePoint1,
- GEOM::GEOM_Object_ptr thePoint2);
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2);
GEOM::GEOM_Object_ptr GetEdgeNearPoint (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePoint);
+ GEOM::GEOM_Object_ptr thePoint);
GEOM::GEOM_Object_ptr GetFaceByPoints (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePoint1,
- GEOM::GEOM_Object_ptr thePoint2,
- GEOM::GEOM_Object_ptr thePoint3,
- GEOM::GEOM_Object_ptr thePoint4);
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2,
+ GEOM::GEOM_Object_ptr thePoint3,
+ GEOM::GEOM_Object_ptr thePoint4);
GEOM::GEOM_Object_ptr GetFaceByEdges (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr theEdge1,
- GEOM::GEOM_Object_ptr theEdge2);
+ GEOM::GEOM_Object_ptr theEdge1,
+ GEOM::GEOM_Object_ptr theEdge2);
GEOM::GEOM_Object_ptr GetOppositeFace (GEOM::GEOM_Object_ptr theBlock,
- GEOM::GEOM_Object_ptr theFace);
+ GEOM::GEOM_Object_ptr theFace);
GEOM::GEOM_Object_ptr GetFaceNearPoint (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePoint);
+ GEOM::GEOM_Object_ptr thePoint);
GEOM::GEOM_Object_ptr GetFaceByNormale (GEOM::GEOM_Object_ptr theBlock,
- GEOM::GEOM_Object_ptr theVector);
+ GEOM::GEOM_Object_ptr theVector);
CORBA::Boolean IsCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
- CORBA::Long theMinNbFaces,
- CORBA::Long theMaxNbFaces,
- CORBA::Long& theNbBlocks);
+ CORBA::Long theMinNbFaces,
+ CORBA::Long theMaxNbFaces,
+ CORBA::Long& theNbBlocks);
CORBA::Boolean CheckCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
- GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors);
+ GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors);
char* PrintBCErrors (GEOM::GEOM_Object_ptr theCompound,
- const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors);
+ const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors);
GEOM::GEOM_List_ptr ExplodeCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
- CORBA::Long theMinNbFaces,
- CORBA::Long theMaxNbFaces);
+ CORBA::Long theMinNbFaces,
+ CORBA::Long theMaxNbFaces);
GEOM::GEOM_Object_ptr GetBlockNearPoint (GEOM::GEOM_Object_ptr theCompound,
- GEOM::GEOM_Object_ptr thePoint);
+ GEOM::GEOM_Object_ptr thePoint);
GEOM::GEOM_Object_ptr GetBlockByParts (GEOM::GEOM_Object_ptr theCompound,
- GEOM::GEOM_List_ptr theParts);
+ GEOM::GEOM_List_ptr theParts);
GEOM::GEOM_List_ptr GetBlocksByParts (GEOM::GEOM_Object_ptr theCompound,
- GEOM::GEOM_List_ptr theParts);
+ GEOM::GEOM_List_ptr theParts);
GEOM::GEOM_Object_ptr MakeMultiTransformation1D (GEOM::GEOM_Object_ptr theBlock,
- CORBA::Long theDirFace1,
- CORBA::Long theDirFace2,
- CORBA::Long theNbTimes);
+ CORBA::Long theDirFace1,
+ CORBA::Long theDirFace2,
+ CORBA::Long theNbTimes);
GEOM::GEOM_Object_ptr MakeMultiTransformation2D (GEOM::GEOM_Object_ptr theBlock,
- CORBA::Long theDirFace1U,
- CORBA::Long theDirFace2U,
- CORBA::Long theNbTimesU,
- CORBA::Long theDirFace1V,
- CORBA::Long theDirFace2V,
- CORBA::Long theNbTimesV);
+ CORBA::Long theDirFace1U,
+ CORBA::Long theDirFace2U,
+ CORBA::Long theNbTimesU,
+ CORBA::Long theDirFace1V,
+ CORBA::Long theDirFace2V,
+ CORBA::Long theNbTimesV);
//-----------------------------------------------------------//
// CurvesOperations //
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakeCirclePntVecR (GEOM::GEOM_Object_ptr theCenter,
- GEOM::GEOM_Object_ptr theVector,
- CORBA::Double theR);
+ GEOM::GEOM_Object_ptr theVector,
+ CORBA::Double theR);
GEOM::GEOM_Object_ptr MakeCircleThreePnt (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2,
- GEOM::GEOM_Object_ptr thePnt3);
+ GEOM::GEOM_Object_ptr thePnt2,
+ GEOM::GEOM_Object_ptr thePnt3);
GEOM::GEOM_Object_ptr MakeCircleCenter2Pnt (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2,
- GEOM::GEOM_Object_ptr thePnt3);
+ GEOM::GEOM_Object_ptr thePnt2,
+ GEOM::GEOM_Object_ptr thePnt3);
GEOM::GEOM_Object_ptr MakeEllipse (GEOM::GEOM_Object_ptr theCenter,
- GEOM::GEOM_Object_ptr theVector,
- CORBA::Double theRMajor, CORBA::Double theRMinor);
+ GEOM::GEOM_Object_ptr theVector,
+ CORBA::Double theRMajor, CORBA::Double theRMinor);
GEOM::GEOM_Object_ptr MakeEllipseVec (GEOM::GEOM_Object_ptr theCenter,
- GEOM::GEOM_Object_ptr theVector,
- CORBA::Double theRMajor, CORBA::Double theRMinor,
- GEOM::GEOM_Object_ptr theVectorMajor);
+ GEOM::GEOM_Object_ptr theVector,
+ CORBA::Double theRMajor, CORBA::Double theRMinor,
+ GEOM::GEOM_Object_ptr theVectorMajor);
GEOM::GEOM_Object_ptr MakeArc (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2,
- GEOM::GEOM_Object_ptr thePnt3);
+ GEOM::GEOM_Object_ptr thePnt2,
+ GEOM::GEOM_Object_ptr thePnt3);
GEOM::GEOM_Object_ptr MakeArcCenter (GEOM::GEOM_Object_ptr theCenter,
GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2,
CORBA::Boolean theSense);
GEOM::GEOM_Object_ptr MakeArcOfEllipse (GEOM::GEOM_Object_ptr thePnt1,
- GEOM::GEOM_Object_ptr thePnt2,
- GEOM::GEOM_Object_ptr thePnt3);
- GEOM::GEOM_Object_ptr MakePolyline (GEOM::GEOM_List_ptr thePoints);
- GEOM::GEOM_Object_ptr MakeSplineBezier (GEOM::GEOM_List_ptr thePoints);
+ GEOM::GEOM_Object_ptr thePnt2,
+ GEOM::GEOM_Object_ptr thePnt3);
+ GEOM::GEOM_Object_ptr MakePolyline (GEOM::GEOM_List_ptr thePoints,
+ CORBA::Boolean theIsClosed);
+ GEOM::GEOM_Object_ptr MakeSplineBezier (GEOM::GEOM_List_ptr thePoints,
+ CORBA::Boolean theIsClosed);
GEOM::GEOM_Object_ptr MakeSplineInterpolation (GEOM::GEOM_List_ptr thePoints,
- CORBA::Boolean theIsClosed);
- GEOM::GEOM_Object_ptr MakeSketcher (const char* theCommand,
- GEOM::GEOM_List_ptr theWorkingPlane);
+ CORBA::Boolean theIsClosed,
+ CORBA::Boolean theDoReordering);
+ GEOM::GEOM_Object_ptr MakeSketcher (const char* theCommand,
+ GEOM::GEOM_List_ptr theWorkingPlane);
GEOM::GEOM_Object_ptr Make3DSketcher (GEOM::GEOM_List_ptr theCoordinates);
//-----------------------------------------------------------//
// LocalOperations //
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakeFilletAll (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theR);
+ CORBA::Double theR);
GEOM::GEOM_Object_ptr MakeFilletEdges (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR,
- GEOM::GEOM_List_ptr theEdges);
+ GEOM::GEOM_List_ptr theEdges);
GEOM::GEOM_Object_ptr MakeFilletEdgesR1R2 (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR1,
- CORBA::Double theR2, GEOM::GEOM_List_ptr theEdges);
+ CORBA::Double theR2, GEOM::GEOM_List_ptr theEdges);
GEOM::GEOM_Object_ptr MakeFilletFaces (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR,
- GEOM::GEOM_List_ptr theFaces);
+ GEOM::GEOM_List_ptr theFaces);
GEOM::GEOM_Object_ptr MakeFilletFacesR1R2 (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR1,
- CORBA::Double theR2, GEOM::GEOM_List_ptr theFaces);
+ CORBA::Double theR2, GEOM::GEOM_List_ptr theFaces);
GEOM::GEOM_Object_ptr MakeFillet2D (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR,
- GEOM::GEOM_List_ptr theVertexes);
+ GEOM::GEOM_List_ptr theVertexes);
GEOM::GEOM_Object_ptr MakeFillet1D (GEOM::GEOM_Object_ptr theShape, CORBA::Double theR,
- GEOM::GEOM_List_ptr theVertexes);
+ GEOM::GEOM_List_ptr theVertexes);
GEOM::GEOM_Object_ptr MakeChamferAll (GEOM::GEOM_Object_ptr theShape, CORBA::Double theD);
GEOM::GEOM_Object_ptr MakeChamferEdge (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theD1, CORBA::Double theD2,
- CORBA::Long theFace1, CORBA::Long theFace2);
+ CORBA::Double theD1, CORBA::Double theD2,
+ CORBA::Long theFace1, CORBA::Long theFace2);
GEOM::GEOM_Object_ptr MakeChamferEdgeAD (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theD, CORBA::Double theAngle,
- CORBA::Long theFace1, CORBA::Long theFace2);
+ CORBA::Double theD, CORBA::Double theAngle,
+ CORBA::Long theFace1, CORBA::Long theFace2);
GEOM::GEOM_Object_ptr MakeChamferFaces (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theD1, CORBA::Double theD2,
- GEOM::GEOM_List_ptr theFaces);
+ CORBA::Double theD1, CORBA::Double theD2,
+ GEOM::GEOM_List_ptr theFaces);
GEOM::GEOM_Object_ptr MakeChamferFacesAD (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theD, CORBA::Double theAngle,
- GEOM::GEOM_List_ptr theFaces);
+ CORBA::Double theD, CORBA::Double theAngle,
+ GEOM::GEOM_List_ptr theFaces);
GEOM::GEOM_Object_ptr MakeChamferEdges (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theD1, CORBA::Double theD2,
- GEOM::GEOM_List_ptr theEdges);
+ CORBA::Double theD1, CORBA::Double theD2,
+ GEOM::GEOM_List_ptr theEdges);
GEOM::GEOM_Object_ptr MakeChamferEdgesAD (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theD, CORBA::Double theAngle,
- GEOM::GEOM_List_ptr theEdges);
+ CORBA::Double theD, CORBA::Double theAngle,
+ GEOM::GEOM_List_ptr theEdges);
GEOM::GEOM_Object_ptr MakeArchimede (GEOM::GEOM_Object_ptr theShape,
CORBA::Double theWeight,
- CORBA::Double theWaterDensity,
- CORBA::Double theMeshingDeflection);
+ CORBA::Double theWaterDensity,
+ CORBA::Double theMeshingDeflection);
CORBA::Long GetSubShapeIndex (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr theSubShape);
+ GEOM::GEOM_Object_ptr theSubShape);
//-----------------------------------------------------------//
// GroupOperations //
//-----------------------------------------------------------//
- GEOM::GEOM_Object_ptr CreateGroup (GEOM::GEOM_Object_ptr theMainShape,
- CORBA::Long theShapeType);
- void AddObject (GEOM::GEOM_Object_ptr theGroup,
- CORBA::Long theSubShapeId);
- void RemoveObject (GEOM::GEOM_Object_ptr theGroup,
- CORBA::Long theSubShapeId);
+ GEOM::GEOM_Object_ptr CreateGroup (GEOM::GEOM_Object_ptr theMainShape,
+ CORBA::Long theShapeType);
+ void AddObject (GEOM::GEOM_Object_ptr theGroup,
+ CORBA::Long theSubShapeId);
+ void RemoveObject (GEOM::GEOM_Object_ptr theGroup,
+ CORBA::Long theSubShapeId);
CORBA::Long GetType (GEOM::GEOM_Object_ptr theGroup);
GEOM::GEOM_Object_ptr GetMainShape (GEOM::GEOM_Object_ptr theGroup);
GEOM::GEOM_List_ptr GetObjects (GEOM::GEOM_Object_ptr theGroup);
-
+
//-----------------------------------------------------------//
// Advanced Operations //
//-----------------------------------------------------------//
- GEOM::GEOM_List_ptr MakePipeTShape (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Boolean theHexMesh);
- GEOM::GEOM_List_ptr MakePipeTShapeWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
- GEOM::GEOM_List_ptr MakePipeTShapeChamfer (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh);
- GEOM::GEOM_List_ptr MakePipeTShapeChamferWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
- GEOM::GEOM_List_ptr MakePipeTShapeFillet (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRF, CORBA::Boolean theHexMesh);
- GEOM::GEOM_List_ptr MakePipeTShapeFilletWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRF, CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+ GEOM::GEOM_List_ptr MakePipeTShape (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Boolean theHexMesh);
+ GEOM::GEOM_List_ptr MakePipeTShapeWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+ GEOM::GEOM_List_ptr MakePipeTShapeChamfer (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh);
+ GEOM::GEOM_List_ptr MakePipeTShapeChamferWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+ GEOM::GEOM_List_ptr MakePipeTShapeFillet (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRF, CORBA::Boolean theHexMesh);
+ GEOM::GEOM_List_ptr MakePipeTShapeFilletWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRF, CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
/*@@ insert new functions before this line @@ do not remove this line @@*/
-
+
private:
- SALOME_NamingService * name_service;
+ SALOME_NamingService * name_service;
GEOM::GEOM_Gen_var myGeomEngine;
CORBA::Long myStudyID;
CORBA::Long myLastStudyID; // mkr : PAL10770
PortableServer::POA_var myPOA;
-
+
GEOM::GEOM_IBasicOperations_var myBasicOp;
GEOM::GEOM_I3DPrimOperations_var my3DPrimOp;
GEOM::GEOM_IBooleanOperations_var myBoolOp;
GEOM::GEOM_IAdvancedOperations_var myAdvancedOp;
};
-#endif
+#endif
## 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
# @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
# @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
## 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
// 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>
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"));
-
- 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"));
-
- 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"));
+ 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"));
+
+ 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"));
+
+ 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");
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(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(GroupPoints->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision" );
- GroupPoints->SpinBox_DX->setValue(100.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();
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(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(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(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(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(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();
}
//=================================================================================
//=================================================================================
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);
}
//=================================================================================
{
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;
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();
}
}
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()));
displayPreview();
}
-//=================================================================================
-// function : getHeight()
-// purpose :
-//=================================================================================
-double GenerationGUI_PrismDlg::getHeight() const
-{
- return GroupPoints->SpinBox_DX->value();
-}
-
//=================================================================================
// function : createOperation
// purpose :
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:
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 :
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();
+ return true;
}
//=================================================================================
// 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
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();
void SetDoubleSpinBoxStep( double );
void onReverse();
void onBothway();
+ void onScalePrism();
};
#endif // GENERATIONGUI_PRISMDLG_H