Merge from branch BR_Dev_For_4_0 (from tag mergeto_BR_QT4_Dev_12Feb08)

This commit is contained in:
vsr 2008-02-12 15:57:45 +00:00
parent 04f3d723da
commit ab9aa28a64
61 changed files with 935 additions and 331 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -5,7 +5,7 @@
<ul> <ul>
<li>\subpage create_extrusion_page</li> <li>\subpage create_extrusion_page</li>
<li>\subpage create_revolution_page</li> <li>\subpage create_revolution_page</li>
<li>\subpage creaet_filling_page</li> <li>\subpage create_filling_page</li>
<li>\subpage create_extrusion_alongpath_page</li> <li>\subpage create_extrusion_alongpath_page</li>
</ul> </ul>

View File

@ -12,7 +12,11 @@ solid or compsolid).
\n Firstly, you can define the <b>Base Shape</b> (a basis of the \n Firstly, you can define the <b>Base Shape</b> (a basis of the
extrusion), the \b Vector (a direction of the extrusion) and the \b extrusion), the \b Vector (a direction of the extrusion) and the \b
Height of extrusion. Height of extrusion.
\b <b>TUI Command:</b> <em>geompy.MakePrismVecH(Base, Vector, Height)</em> \n The \b Result of the operation will be a GEOM_Object (edge, face,
shell, solid or compsolid).
\n <b> Both Directions </b> checkbox allows extruiding the source
object both forward and backward.
\n <b>TUI Command:</b> <em>geompy.MakePrismVecH(Base, Vector, Height)</em>
\n <b>Arguments:</b> Name + 1 shape (vertex, edge, planar wire, face or \n <b>Arguments:</b> Name + 1 shape (vertex, edge, planar wire, face or
shell) serving as base object + 1 vector (for direction of the shell) serving as base object + 1 vector (for direction of the
extrusion) + 1 value (dimension). extrusion) + 1 value (dimension).
@ -22,6 +26,8 @@ extrusion) + 1 value (dimension).
\n Secondly, you can define the \b Extrusion by the <b>Base Shape</b> \n Secondly, you can define the \b Extrusion by the <b>Base Shape</b>
and the \b Start and <b>End Point</b> of the \b Vector (in this way and the \b Start and <b>End Point</b> of the \b Vector (in this way
you don't need to create it in advance). you don't need to create it in advance).
\n <b> Both Directions </b> checkbox allows extruiding the source
object both forward and backward.
\n <b>TUI Command:</b> <em>geompy.MakePrism(Base, Point1, Point2)</em> \n <b>TUI Command:</b> <em>geompy.MakePrism(Base, Point1, Point2)</em>
\n <b>Arguments:</b> Name + 1 shape (vertex, edge, planar wire, face or \n <b>Arguments:</b> Name + 1 shape (vertex, edge, planar wire, face or
shell) serving as base object + 2 vertices. shell) serving as base object + 2 vertices.

View File

@ -1,18 +1,20 @@
/*! /*!
\page creaet_filling_page Filling Surface with Edges \page create_filling_page Filling Surface with Edges
To generate a \b Filling in the <b>Main Menu</b> select <b>New Entity - > Generation - > Filling</b> To generate a \b Filling in the <b>Main Menu</b> select <b>New Entity - > Generation - > Filling</b>
\n To create a curving face using several edges you need to define the \n To create a curving face using several edges you need to define the
<b>Edges Compound</b>, \b Minimum and <b>Maximum Degree</b>, \b <b>Edges Compound</b>, \b Minimum and <b>Maximum Degree</b>, \b
Tolerance for \b 2D and for \b 3D and the <b>Number of Iterations</b>. Tolerance for \b 2D and for \b 3D , the <b>Number of Iterations</b>
and <b>Approximation</b>.
\n The \b Result of the operation will be a GEOM_Object (face). \n The \b Result of the operation will be a GEOM_Object (face).
\n <b>TUI Command:</b> <em>geompy.MakeFilling(Edges, MinDegree, MaxDegree, Tol2D, Tol3D, NbIter)</em> \n <b>TUI Command:</b> <em>geompy.MakeFilling(Edges, MinDegree,
\n <b>Arguments:</b> Name + 1 List of edges + 5 Parameters MaxDegree, Tol2D, Tol3D, NbIter, isApprox)</em>
\n <b>Arguments:</b> Name + 1 List of edges + 6 Parameters
(Min. degree, Max. degree, Number of iterations, 2D tolerance, 3D (Min. degree, Max. degree, Number of iterations, 2D tolerance, 3D
tolerance, Number of iterations). tolerance, Number of iterations, Approximation).
\image html filling.png \image html filling.png

View File

@ -28,7 +28,7 @@
<ul> <ul>
<li>\ref create_extrusion_page</li> <li>\ref create_extrusion_page</li>
<li>\ref create_revolution_page</li> <li>\ref create_revolution_page</li>
<li>\ref creaet_filling_page</li> <li>\ref create_filling_page</li>
<li>\ref create_extrusion_alongpath_page</li> <li>\ref create_extrusion_alongpath_page</li>
</ul> </ul>
<li>\subpage work_with_groups_page</li> <li>\subpage work_with_groups_page</li>

View File

@ -4,14 +4,24 @@
To create a \b Line in the <b>Main Menu</b> select <b>New Entity - >Basic - > Line</b> To create a \b Line in the <b>Main Menu</b> select <b>New Entity - >Basic - > Line</b>
\n To create a \b Line you should define \b Point1 and \b Point2,
which are the points through which the \b Line passes.
\n The \b Result of the operation will be a GEOM_Object (edge).
There are 2 algorithms to create a \b Line in the 3D space.
The Result of each operation will be a GEOM_Object (edge).
\n Firstly you can define a \b Line through \b Point1 and \b Point2,
which are the points through which the \b Line passes.
\n <b>TUI Command:</b> <em>geompy.MakeLineTwoPnt(Point1, Point2)</em> \n <b>TUI Command:</b> <em>geompy.MakeLineTwoPnt(Point1, Point2)</em>
\n <b>Arguments:</b> Name + 2 vertices. \n <b>Arguments:</b> Name + 2 vertices.
\image html line.png \image html line1.png
\n Secondly you can define a \b Line as intersection of \b Plane1 and
\b Plane2.
\n <b>TUI Command:</b> <em>geompy.MakeLineTwoFaces(myFace1, myFace2)</em>
\n <b>Arguments:</b> Name + 2 faces.
\image html line2.png
<b>Example:</b> <b>Example:</b>

View File

@ -5,7 +5,7 @@
To create a \b Point in the <b>Main Menu</b> select <b>New Entity - > To create a \b Point in the <b>Main Menu</b> select <b>New Entity - >
Basic - > Point</b> Basic - > Point</b>
\n There are three algorithms to create a \b Point in the 3D space. \n There are four algorithms to create a \b Point in the 3D space.
\n Each time the \b Result of the operation will be a GEOM_Object \n Each time the \b Result of the operation will be a GEOM_Object
(vertex). (vertex).
@ -23,9 +23,9 @@ coordinates of the old one.
\n <b>Arguments:</b> Name + 1 reference point + 3 coordinates defining \n <b>Arguments:</b> Name + 1 reference point + 3 coordinates defining
the position of this point regarding the reference one. the position of this point regarding the reference one.
\image html neo-point2.png \image html point2.png
\n Finally, we can define a point by an \b Edge and a \b Parameter \n Thirdly, we can define a point by an \b Edge and a \b Parameter
indicating its position on the Edge, ranging from 0.0 to 1.0. For example, 0.5 means that the indicating its position on the Edge, ranging from 0.0 to 1.0. For example, 0.5 means that the
point is located in the middle of the edge. point is located in the middle of the edge.
\n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurve(Edge,Parameter).</em> \n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurve(Edge,Parameter).</em>
@ -34,6 +34,11 @@ position of the point on the given edge.
\image html point3.png \image html point3.png
\n Finally, we can define a point by intersection of two \b Lines.
\n <b>TUI Command:</b> <em>geompy.MakePointOnLinesIntersection(myLine1,myLine2).</em>
\n <b>Arguments:</b> Name + 2 lines
\image html point4.png
<b>Example:</b> <b>Example:</b>
\image html points.png \image html points.png

View File

@ -8,6 +8,8 @@ select <b>New Entity - > Generation - > Revolution</b>
\n To create an extruded shape by \b Revolution you need to define the \n To create an extruded shape by \b Revolution you need to define the
source \b Object to rotate, the \b Axis of revolution and the \b Angle by which source \b Object to rotate, the \b Axis of revolution and the \b Angle by which
the \b Shape has to be rotated around the \b Axis (in degrees). the \b Shape has to be rotated around the \b Axis (in degrees).
\n <b> Both Directions </b> checkbox allows extruding the source
object both forward and backward.
\n The \b Result of the operation will be a GEOM_Object (edge, face, shell, \n The \b Result of the operation will be a GEOM_Object (edge, face, shell,
solid or compsolid). solid or compsolid).

View File

@ -32,7 +32,7 @@
<ul> <ul>
<li>\ref create_extrusion_page</li> <li>\ref create_extrusion_page</li>
<li>\ref create_revolution_page</li> <li>\ref create_revolution_page</li>
<li>\ref creaet_filling_page</li> <li>\ref create_filling_page</li>
<li>\ref create_extrusion_alongpath_page</li> <li>\ref create_extrusion_alongpath_page</li>
</ul> </ul>
<li>\ref work_with_groups_page</li> <li>\ref work_with_groups_page</li>

View File

@ -902,7 +902,7 @@ module GEOM
GEOM_Object MakeFilling (in GEOM_Object theShape, GEOM_Object MakeFilling (in GEOM_Object theShape,
in long theMinDeg, in long theMaxDeg, in long theMinDeg, in long theMaxDeg,
in double theTol2D, in double theTol3D, in double theTol2D, in double theTol3D,
in long theNbIter); in long theNbIter, in boolean theApprox);
/*! /*!
* Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices. * Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.

View File

@ -176,7 +176,7 @@ module GEOM
GEOM_Object MakeFilling (in GEOM_Object theShape, GEOM_Object MakeFilling (in GEOM_Object theShape,
in long theMinDeg, in long theMaxDeg, in long theMinDeg, in long theMaxDeg,
in double theTol2D, in double theTol3D, in double theTol2D, in double theTol3D,
in long theNbIter) ; in long theNbIter, in boolean theApprox) ;
GEOM_Object MakeThruSections(in ListOfGO theSeqSections, GEOM_Object MakeThruSections(in ListOfGO theSeqSections,
in boolean theModeSolid, in boolean theModeSolid,
in double thePreci, in double thePreci,

View File

@ -8,6 +8,35 @@
<path-prefix-list> <path-prefix-list>
</path-prefix-list> </path-prefix-list>
<!-- Geom data types -->
<type-list>
<type name="BCErrorType" kind="int"/>
<objref name="GEOM_Object" id="IDL:GEOM/GEOM_Object:1.0" />
<objref name="GEOM_List" id="IDL:GEOM/GEOM_List:1.0" />
<objref name="GEOM_Gen" id="IDL:GEOM/GEOM_Gen:1.0" />
<objref name="GEOM_Shape" id="IDL:GEOM/GEOM_Object:1.0" />
<objref name="GEOM_Superv" id="IDL:GEOM/GEOM_Superv:1.0" />
<objref name="GEOM_IBasicOperations" id="IDL:GEOM/GEOM_IBasicOperations:1.0" />
<objref name="GEOM_ITransformOperations" id="IDL:GEOM/GEOM_ITransformOperations:1.0" />
<objref name="GEOM_I3DPrimOperations" id="IDL:GEOM/GEOM_I3DPrimOperations:1.0" />
<objref name="GEOM_IShapesOperations" id="IDL:GEOM/GEOM_IShapesOperations:1.0" />
<objref name="GEOM_IBooleanOperations" id="IDL:GEOM/GEOM_IBooleanOperations:1.0" />
<objref name="GEOM_ICurvesOperations" id="IDL:GEOM/GEOM_ICurvesOperations:1.0" />
<objref name="GEOM_ILocalOperations" id="IDL:GEOM/GEOM_ILocalOperations:1.0" />
<objref name="GEOM_IHealingOperations" id="IDL:GEOM/GEOM_IHealingOperations:1.0" />
<objref name="GEOM_IInsertOperations" id="IDL:GEOM/GEOM_IInsertOperations:1.0" />
<objref name="GEOM_IMeasureOperations" id="IDL:GEOM/GEOM_IMeasureOperations:1.0" />
<objref name="GEOM_IBlocksOperations" id="IDL:GEOM/GEOM_IBlocksOperations:1.0" />
<objref name="GEOM_IGroupOperations" id="IDL:GEOM/GEOM_IGroupOperations:1.0" />
<sequence name="ListOfLong" content="int" />
<sequence name="ListOfGO" content="GEOM_Object" />
<sequence name="string_array" content="string" />
<struct name="BCError" >
<member name="incriminated" type="ListOfLong"/>
</struct>
<sequence name="BCErrors" content="BCError" />
</type-list>
<!-- Component list --> <!-- Component list -->
<component-list> <component-list>
<component> <component>

View File

@ -147,6 +147,12 @@ void BooleanGUI_Dialog::Init()
initName( mainFrame()->GroupConstructors->title() ); initName( mainFrame()->GroupConstructors->title() );
setTabOrder( mainFrame()->GroupConstructors, mainFrame()->GroupBoxName );
setTabOrder( mainFrame()->GroupBoxName, mainFrame()->GroupMedium );
setTabOrder( mainFrame()->GroupMedium, mainFrame()->GroupButtons );
mainFrame()->RadioButton1->setFocus();
globalSelection( GEOM_ALLSHAPES ); globalSelection( GEOM_ALLSHAPES );
} }

View File

@ -191,6 +191,20 @@ DlgRef_1Sel4Spin::~DlgRef_1Sel4Spin()
{ {
} }
//////////////////////////////////////////
// DlgRef_1Sel5Spin1Check
//////////////////////////////////////////
DlgRef_1Sel5Spin1Check::DlgRef_1Sel5Spin1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel5Spin1Check::~DlgRef_1Sel5Spin1Check()
{
}
////////////////////////////////////////// //////////////////////////////////////////
// DlgRef_1Sel5Spin // DlgRef_1Sel5Spin
////////////////////////////////////////// //////////////////////////////////////////

View File

@ -226,6 +226,22 @@ public:
~DlgRef_1Sel4Spin(); ~DlgRef_1Sel4Spin();
}; };
//////////////////////////////////////////
// DlgRef_1Sel5Spin1Check
//////////////////////////////////////////
#include "ui_DlgRef_1Sel5Spin1Check_QTD.h"
class DLGREF_EXPORT DlgRef_1Sel5Spin1Check : public QWidget,
public Ui::DlgRef_1Sel5Spin1Check_QTD
{
Q_OBJECT
public:
DlgRef_1Sel5Spin1Check( QWidget* = 0, Qt::WindowFlags = 0 );
~DlgRef_1Sel5Spin1Check();
};
////////////////////////////////////////// //////////////////////////////////////////
// DlgRef_1Sel5Spin // DlgRef_1Sel5Spin
////////////////////////////////////////// //////////////////////////////////////////

View File

@ -13,10 +13,22 @@
<string/> <string/>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <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> <number>0</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0" >
@ -25,18 +37,28 @@
<string/> <string/>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <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> <number>6</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" > <widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -55,9 +77,7 @@
<item row="0" column="1" > <item row="0" column="1" >
<widget class="QPushButton" name="PushButton1" > <widget class="QPushButton" name="PushButton1" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -70,9 +90,7 @@
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" > <widget class="QLabel" name="TextLabel2" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -95,6 +113,11 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11" /> <layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction> <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>PushButton1</tabstop>
<tabstop>LineEdit1</tabstop>
<tabstop>SpinBox_DX</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -13,10 +13,22 @@
<string/> <string/>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <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> <number>6</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0" >
@ -25,10 +37,22 @@
<string/> <string/>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <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> <number>6</number>
</property> </property>
<item row="2" column="1" colspan="2" > <item row="2" column="1" colspan="2" >
@ -43,9 +67,7 @@
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" > <widget class="QLabel" name="TextLabel2" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -61,9 +83,7 @@
<item row="3" column="0" > <item row="3" column="0" >
<widget class="QLabel" name="TextLabel4" > <widget class="QLabel" name="TextLabel4" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -79,9 +99,7 @@
<item row="2" column="0" > <item row="2" column="0" >
<widget class="QLabel" name="TextLabel3" > <widget class="QLabel" name="TextLabel3" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -100,9 +118,7 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" > <widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -118,9 +134,7 @@
<item row="0" column="1" > <item row="0" column="1" >
<widget class="QPushButton" name="PushButton1" > <widget class="QPushButton" name="PushButton1" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -137,6 +151,13 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11" /> <layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction> <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>PushButton1</tabstop>
<tabstop>LineEdit1</tabstop>
<tabstop>SpinBox_DX</tabstop>
<tabstop>SpinBox_DY</tabstop>
<tabstop>SpinBox_DZ</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -13,10 +13,22 @@
<string/> <string/>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <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> <number>6</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0" >
@ -25,18 +37,28 @@
<string/> <string/>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <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> <number>6</number>
</property> </property>
<item row="2" column="0" > <item row="2" column="0" >
<widget class="QLabel" name="TextLabel6" > <widget class="QLabel" name="TextLabel6" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -58,18 +80,25 @@
<string/> <string/>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<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>
<item> <item>
<widget class="QLabel" name="TextLabel3" > <widget class="QLabel" name="TextLabel3" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -88,9 +117,7 @@
<item> <item>
<widget class="QLabel" name="TextLabel4" > <widget class="QLabel" name="TextLabel4" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -109,9 +136,7 @@
<item> <item>
<widget class="QLabel" name="TextLabel5" > <widget class="QLabel" name="TextLabel5" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -136,9 +161,7 @@
<item row="0" column="1" > <item row="0" column="1" >
<widget class="QPushButton" name="PushButton1" > <widget class="QPushButton" name="PushButton1" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -151,9 +174,7 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" > <widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -173,6 +194,14 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11" /> <layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction> <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>PushButton1</tabstop>
<tabstop>LineEdit1</tabstop>
<tabstop>SpinBox_DX</tabstop>
<tabstop>SpinBox_DY</tabstop>
<tabstop>SpinBox_DZ</tabstop>
<tabstop>SpinBox_S</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -0,0 +1,189 @@
<ui version="4.0" >
<class>DlgRef_1Sel5Spin1Check_QTD</class>
<widget class="QWidget" name="DlgRef_1Sel5Spin1Check_QTD" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>165</width>
<height>125</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>
<item row="0" column="0" >
<widget class="QGroupBox" name="GroupBox1" >
<property name="title" >
<string/>
</property>
<layout class="QGridLayout" >
<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" colspan="3" >
<layout class="QGridLayout" >
<item row="0" 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="0" column="1" >
<widget class="QDoubleSpinBox" name="SpinBox1" />
</item>
<item row="0" column="2" >
<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="0" column="3" >
<widget class="QDoubleSpinBox" name="SpinBox2" />
</item>
<item row="1" 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="1" column="1" >
<widget class="QDoubleSpinBox" name="SpinBox4" />
</item>
<item row="1" column="2" >
<widget class="QLabel" name="TextLabel6" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>TL6</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="3" >
<widget class="QDoubleSpinBox" name="SpinBox5" />
</item>
<item row="2" 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="2" column="1" >
<widget class="QDoubleSpinBox" name="SpinBox3" />
</item>
<item row="2" column="2" colspan="2" >
<widget class="QCheckBox" name="CheckBox1" >
<property name="text" >
<string/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>PushButton1</tabstop>
<tabstop>LineEdit1</tabstop>
<tabstop>SpinBox1</tabstop>
<tabstop>SpinBox2</tabstop>
<tabstop>SpinBox4</tabstop>
<tabstop>SpinBox5</tabstop>
<tabstop>SpinBox3</tabstop>
<tabstop>CheckBox1</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -13,10 +13,22 @@
<string/> <string/>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <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> <number>0</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0" >
@ -25,10 +37,22 @@
<string/> <string/>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <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> <number>6</number>
</property> </property>
<item row="2" column="1" > <item row="2" column="1" >
@ -43,9 +67,7 @@
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" > <widget class="QLabel" name="TextLabel2" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -61,9 +83,7 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" > <widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -79,9 +99,7 @@
<item row="2" column="0" > <item row="2" column="0" >
<widget class="QLabel" name="TextLabel3" > <widget class="QLabel" name="TextLabel3" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -101,6 +119,11 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11" /> <layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction> <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>SpinBox_DX</tabstop>
<tabstop>SpinBox_DY</tabstop>
<tabstop>SpinBox_DZ</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -13,18 +13,28 @@
<string/> <string/>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <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> <number>6</number>
</property> </property>
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QGroupBox" name="GroupBoxName" > <widget class="QGroupBox" name="GroupBoxName" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -33,12 +43,21 @@
<string>Result name</string> <string>Result name</string>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<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>
<item> <item>
<widget class="QLabel" name="NameLabel" > <widget class="QLabel" name="NameLabel" >
<property name="text" > <property name="text" >
@ -58,9 +77,7 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QGroupBox" name="GroupConstructors" > <widget class="QGroupBox" name="GroupConstructors" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -69,12 +86,21 @@
<string/> <string/>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<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>
<item> <item>
<widget class="QRadioButton" name="RadioButton1" > <widget class="QRadioButton" name="RadioButton1" >
<property name="text" > <property name="text" >
@ -109,9 +135,7 @@
<item row="3" column="0" > <item row="3" column="0" >
<widget class="QGroupBox" name="GroupButtons" > <widget class="QGroupBox" name="GroupButtons" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -120,12 +144,21 @@
<string/> <string/>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<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>
<item> <item>
<widget class="QPushButton" name="buttonOk" > <widget class="QPushButton" name="buttonOk" >
<property name="text" > <property name="text" >
@ -176,9 +209,7 @@
<item row="2" column="0" > <item row="2" column="0" >
<widget class="QWidget" native="1" name="GroupMedium" > <widget class="QWidget" native="1" name="GroupMedium" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -187,6 +218,17 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<tabstops>
<tabstop>RadioButton1</tabstop>
<tabstop>RadioButton2</tabstop>
<tabstop>RadioButton3</tabstop>
<tabstop>RadioButton4</tabstop>
<tabstop>ResultName</tabstop>
<tabstop>buttonOk</tabstop>
<tabstop>buttonApply</tabstop>
<tabstop>buttonCancel</tabstop>
<tabstop>buttonHelp</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -50,6 +50,7 @@ UIC_FILES = \
ui_DlgRef_1Sel3Check_QTD.h \ ui_DlgRef_1Sel3Check_QTD.h \
ui_DlgRef_1Sel3Spin_QTD.h \ ui_DlgRef_1Sel3Spin_QTD.h \
ui_DlgRef_1Sel4Spin_QTD.h \ ui_DlgRef_1Sel4Spin_QTD.h \
ui_DlgRef_1Sel5Spin1Check_QTD.h \
ui_DlgRef_1Sel5Spin_QTD.h \ ui_DlgRef_1Sel5Spin_QTD.h \
ui_DlgRef_1Sel_QTD.h \ ui_DlgRef_1Sel_QTD.h \
ui_DlgRef_1SelExt_QTD.h \ ui_DlgRef_1SelExt_QTD.h \

View File

@ -518,6 +518,13 @@ GEOM::GEOM_IOperations_ptr EntityGUI_SubShapeDlg::createOperation()
bool EntityGUI_SubShapeDlg::isValid( QString& msg ) bool EntityGUI_SubShapeDlg::isValid( QString& msg )
{ {
bool isOk = false; bool isOk = false;
Handle(SALOME_InteractiveObject) IO = firstIObject();
Standard_Boolean testResult;
myObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
if ( !testResult || myObject->_is_nil() ) {
updateButtonState();
return isOk;
}
if ( !myObject->_is_nil() ) { if ( !myObject->_is_nil() ) {
if ( isAllSubShapes() ) if ( isAllSubShapes() )
isOk = true; isOk = true;

View File

@ -116,6 +116,25 @@ GEOM_Engine::GEOM_Engine()
_UndoLimit = 10; _UndoLimit = 10;
} }
/*!
* Destructor
*/
GEOM_Engine::~GEOM_Engine()
{
GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It(_objects);
for(; It.More(); It.Next())
{
RemoveObject(Handle(GEOM_Object)::DownCast(It.Value()));
}
//Close all documents not closed
for(Interface_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next())
Close(anItr.Key());
_mapIDDocument.Clear();
_objects.Clear();
}
//============================================================================= //=============================================================================
/*! /*!
* GetDocument * GetDocument
@ -179,7 +198,22 @@ Handle(GEOM_Object) GEOM_Engine::AddObject(int theDocID, int theType)
Handle(TDocStd_Document) aDoc = GetDocument(theDocID); Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main()); Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
TDF_Label aChild = TDF_TagSource::NewChild(aDoc->Main()); // NPAL18604: use existing label to decrease memory usage,
// if this label has been freed (object deleted)
bool useExisting = false;
TDF_Label aChild;
if (!_lastCleared.IsNull()) {
if (_lastCleared.Root() == aDoc->Main().Root()) {
useExisting = true;
aChild = _lastCleared;
_lastCleared.Nullify();
}
}
if (!useExisting) {
// create new label
aChild = TDF_TagSource::NewChild(aDoc->Main());
}
Handle(GEOM_Object) anObject = new GEOM_Object(aChild, theType); Handle(GEOM_Object) anObject = new GEOM_Object(aChild, theType);
//Put an object in the map of created objects //Put an object in the map of created objects
@ -204,7 +238,21 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) theMainShape,
Handle(TDocStd_Document) aDoc = GetDocument(theMainShape->GetDocID()); Handle(TDocStd_Document) aDoc = GetDocument(theMainShape->GetDocID());
Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main()); Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
TDF_Label aChild = TDF_TagSource::NewChild(aDoc->Main()); // NPAL18604: use existing label to decrease memory usage,
// if this label has been freed (object deleted)
bool useExisting = false;
TDF_Label aChild;
if (!_lastCleared.IsNull()) {
if (_lastCleared.Root() == aDoc->Main().Root()) {
useExisting = true;
aChild = _lastCleared;
_lastCleared.Nullify();
}
}
if (!useExisting) {
// create new label
aChild = TDF_TagSource::NewChild(aDoc->Main());
}
Handle(GEOM_Function) aMainShape = theMainShape->GetLastFunction(); Handle(GEOM_Function) aMainShape = theMainShape->GetLastFunction();
Handle(GEOM_Object) anObject = new GEOM_Object(aChild, 28); //28 is SUBSHAPE type Handle(GEOM_Object) anObject = new GEOM_Object(aChild, 28); //28 is SUBSHAPE type
@ -274,6 +322,7 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_Object) theObject)
TDF_Label aLabel = theObject->GetEntry(); TDF_Label aLabel = theObject->GetEntry();
aLabel.ForgetAllAttributes(Standard_True); aLabel.ForgetAllAttributes(Standard_True);
_lastCleared = aLabel;
theObject.Nullify(); theObject.Nullify();
@ -357,6 +406,8 @@ void GEOM_Engine::Close(int theDocID)
} }
for (Standard_Integer i=1; i<=aSeq.Length(); i++) _objects.UnBind(aSeq.Value(i)); for (Standard_Integer i=1; i<=aSeq.Length(); i++) _objects.UnBind(aSeq.Value(i));
_lastCleared.Nullify();
_mapIDDocument.UnBind(theDocID); _mapIDDocument.UnBind(theDocID);
_OCAFApp->Close(aDoc); _OCAFApp->Close(aDoc);
aDoc.Nullify(); aDoc.Nullify();

View File

@ -30,12 +30,13 @@
#include <TDocStd_Document.hxx> #include <TDocStd_Document.hxx>
#include <TColStd_HArray1OfInteger.hxx> #include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx> #include <TColStd_HSequenceOfAsciiString.hxx>
#include <TDF_Label.hxx>
class GEOM_Engine class GEOM_Engine
{ {
public: public:
Standard_EXPORT GEOM_Engine(); Standard_EXPORT GEOM_Engine();
Standard_EXPORT ~GEOM_Engine() { _mapIDDocument.Clear(); _objects.Clear(); } Standard_EXPORT virtual ~GEOM_Engine();
//Retuns the engine //Retuns the engine
Standard_EXPORT static GEOM_Engine* GetEngine(); Standard_EXPORT static GEOM_Engine* GetEngine();
@ -101,6 +102,8 @@ class GEOM_Engine
GEOM_DataMapOfAsciiStringTransient _objects; GEOM_DataMapOfAsciiStringTransient _objects;
Resource_DataMapOfAsciiStringAsciiString _studyEntry2NameMap; Resource_DataMapOfAsciiStringAsciiString _studyEntry2NameMap;
TDF_Label _lastCleared;
}; };
#endif #endif

View File

@ -3014,7 +3014,8 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeFilling(GEOM::GEOM_Shape_ptr myShape,
CORBA::Short maxdeg, CORBA::Short maxdeg,
CORBA::Double tol3d, CORBA::Double tol3d,
CORBA::Double tol2d, CORBA::Double tol2d,
CORBA::Short nbiter) CORBA::Short nbiter,
CORBA::Boolean theApprox)
throw (SALOME::SALOME_Exception) throw (SALOME::SALOME_Exception)
{ {
Unexpect aCatch(SALOME_SalomeException); Unexpect aCatch(SALOME_SalomeException);
@ -3053,7 +3054,7 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeFilling(GEOM::GEOM_Shape_ptr myShape,
Handle(GeomFill_Line) Line = new GeomFill_Line(i) ; Handle(GeomFill_Line) Line = new GeomFill_Line(i) ;
GeomFill_AppSurf App(mindeg, maxdeg, tol3d, tol2d, nbiter) ; /* user parameters */ GeomFill_AppSurf App(mindeg, maxdeg, tol3d, tol2d, nbiter) ; /* user parameters */
App.Perform(Line, Section) ; App.Perform(Line, Section, theApprox) ;
if (!App.IsDone()) { if (!App.IsDone()) {
THROW_SALOME_CORBA_EXCEPTION("Filling aborted : non valid shape result", SALOME::BAD_PARAM); THROW_SALOME_CORBA_EXCEPTION("Filling aborted : non valid shape result", SALOME::BAD_PARAM);

View File

@ -3430,6 +3430,10 @@
<source>GEOM_RESULT_NAME_LBL</source> <source>GEOM_RESULT_NAME_LBL</source>
<translation>Name</translation> <translation>Name</translation>
</message> </message>
<message>
<source>GEOM_FILLING_APPROX</source>
<translation>Approximation</translation>
</message>
</context> </context>
<context> <context>
<name>BasicGUI_MarkerDlg</name> <name>BasicGUI_MarkerDlg</name>

View File

@ -86,6 +86,12 @@ Standard_Integer GEOMImpl_BoxDriver::Execute(TFunction_Logbook& log) const
aShape2.ShapeType() == TopAbs_VERTEX) { aShape2.ShapeType() == TopAbs_VERTEX) {
gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(aShape1)); gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(aShape2)); gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
if (P1.X() == P2.X() || P1.Y() == P2.Y() || P1.Z() == P2.Z()) {
StdFail_NotDone::Raise("Box can not be created, the points belong to the same plane");
return 0;
}
BRepPrimAPI_MakeBox MB (P1,P2); BRepPrimAPI_MakeBox MB (P1,P2);
MB.Build(); MB.Build();

View File

@ -88,6 +88,7 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const
Standard_Real tol3d = IF.GetTol2D(); Standard_Real tol3d = IF.GetTol2D();
Standard_Real tol2d = IF.GetTol3D(); Standard_Real tol2d = IF.GetTol3D();
Standard_Integer nbiter = IF.GetNbIter(); Standard_Integer nbiter = IF.GetNbIter();
Standard_Boolean isApprox = IF.GetApprox();
if (mindeg > maxdeg) { if (mindeg > maxdeg) {
Standard_RangeError::Raise("Minimal degree can not be more than maximal degree"); Standard_RangeError::Raise("Minimal degree can not be more than maximal degree");
@ -115,7 +116,7 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const
Handle(GeomFill_Line) Line = new GeomFill_Line(i); Handle(GeomFill_Line) Line = new GeomFill_Line(i);
GeomFill_AppSurf App (mindeg, maxdeg, tol3d, tol2d, nbiter); /* user parameters */ GeomFill_AppSurf App (mindeg, maxdeg, tol3d, tol2d, nbiter); /* user parameters */
App.Perform(Line, Section); App.Perform(Line, Section, isApprox);
if (!App.IsDone()) return 0; if (!App.IsDone()) return 0;
Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots; Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots;

View File

@ -1110,7 +1110,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSolidShell (Handle(GEOM_Obje
//============================================================================= //=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
(Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg, (Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg,
double theTol2D, double theTol3D, int theNbIter) double theTol2D, double theTol3D, int theNbIter, bool isApprox)
{ {
SetErrorCode(KO); SetErrorCode(KO);
@ -1138,6 +1138,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
aFI.SetTol2D(theTol2D); aFI.SetTol2D(theTol2D);
aFI.SetTol3D(theTol3D); aFI.SetTol3D(theTol3D);
aFI.SetNbIter(theNbIter); aFI.SetNbIter(theNbIter);
aFI.SetApprox(isApprox);
//Compute the Solid value //Compute the Solid value
try { try {
@ -1159,9 +1160,13 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
} }
//Make a Python command //Make a Python command
GEOM::TPythonDump(aFunction) << aFilling << " = geompy.MakeFilling(" GEOM::TPythonDump pd (aFunction);
pd << aFilling << " = geompy.MakeFilling("
<< theShape << ", " << theMinDeg << ", " << theMaxDeg << ", " << theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
<< theTol2D << ", " << theTol3D << ", " << theNbIter << ")"; << theTol2D << ", " << theTol3D << ", " << theNbIter;
if(isApprox)
pd << ", " << isApprox;
pd << ")";
SetErrorCode(OK); SetErrorCode(OK);
return aFilling; return aFilling;

View File

@ -83,7 +83,7 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
Standard_EXPORT Handle(GEOM_Object) MakeSolidShell (Handle(GEOM_Object) theShell); Standard_EXPORT Handle(GEOM_Object) MakeSolidShell (Handle(GEOM_Object) theShell);
Standard_EXPORT Handle(GEOM_Object) MakeFilling (Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg, double theTol2D, double theTol3D, int theNbIter); Standard_EXPORT Handle(GEOM_Object) MakeFilling (Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg, double theTol2D, double theTol3D, int theNbIter, bool isApprox);
Standard_EXPORT Handle(GEOM_Object) MakeThruSections(const Handle(TColStd_HSequenceOfTransient)& theSeqSections, Standard_EXPORT Handle(GEOM_Object) MakeThruSections(const Handle(TColStd_HSequenceOfTransient)& theSeqSections,
bool theModeSolid, bool theModeSolid,

View File

@ -28,6 +28,7 @@
#define FILL_ARG_TOL3D 4 #define FILL_ARG_TOL3D 4
#define FILL_ARG_SHAPE 5 #define FILL_ARG_SHAPE 5
#define FILL_ARG_NBITER 6 #define FILL_ARG_NBITER 6
#define FILL_ARG_APPROX 7
class GEOMImpl_IFilling class GEOMImpl_IFilling
{ {
@ -47,6 +48,9 @@ class GEOMImpl_IFilling
void SetNbIter(int theNbIter) { _func->SetInteger(FILL_ARG_NBITER, theNbIter); } void SetNbIter(int theNbIter) { _func->SetInteger(FILL_ARG_NBITER, theNbIter); }
int GetNbIter() { return _func->GetInteger(FILL_ARG_NBITER); } int GetNbIter() { return _func->GetInteger(FILL_ARG_NBITER); }
void SetApprox(bool theApprox) { _func->SetInteger(FILL_ARG_APPROX, theApprox); }
bool GetApprox() { return _func->GetInteger(FILL_ARG_APPROX); }
void SetShape(Handle(GEOM_Function) theShape) { _func->SetReference(FILL_ARG_SHAPE, theShape); } void SetShape(Handle(GEOM_Function) theShape) { _func->SetReference(FILL_ARG_SHAPE, theShape); }
Handle(GEOM_Function) GetShape() { return _func->GetReference(FILL_ARG_SHAPE); } Handle(GEOM_Function) GetShape() { return _func->GetReference(FILL_ARG_SHAPE); }

View File

@ -638,7 +638,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueFaces
Handle(GEOM_Function) aFunction = theShape->GetLastFunction(); Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
GEOM::TPythonDump pd (aFunction, /*append=*/true); GEOM::TPythonDump pd (aFunction, /*append=*/true);
pd << "[" << anAsciiList.ToCString(); pd << "[" << anAsciiList.ToCString();
pd << "] = geompy.GetGlueFaces" << theShape << ", " << theTolerance << ")"; pd << "] = geompy.GetGlueFaces(" << theShape << ", " << theTolerance << ")";
SetErrorCode(OK); SetErrorCode(OK);

View File

@ -100,8 +100,14 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
Standard_Real anAngle = RI.GetAngle(); Standard_Real anAngle = RI.GetAngle();
aTrsf.SetRotation(anAx1, anAngle); aTrsf.SetRotation(anAx1, anAngle);
BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False); //NPAL18620: performance problem: multiple locations are accumulated
aShape = aTransformation.Shape(); // in shape and need a great time to process
//BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False);
//aShape = aTransformation.Shape();
TopLoc_Location aLocOrig = anOriginal.Location();
gp_Trsf aTrsfOrig = aLocOrig.Transformation();
TopLoc_Location aLocRes (aTrsf * aTrsfOrig);
aShape = anOriginal.Located(aLocRes);
} }
else if (aType == ROTATE_THREE_POINTS || aType == ROTATE_THREE_POINTS_COPY) { else if (aType == ROTATE_THREE_POINTS || aType == ROTATE_THREE_POINTS_COPY) {
Handle(GEOM_Function) aCentPoint = RI.GetCentPoint(); Handle(GEOM_Function) aCentPoint = RI.GetCentPoint();
@ -125,8 +131,14 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
gp_Ax1 anAx1(aCP, aDir); gp_Ax1 anAx1(aCP, aDir);
Standard_Real anAngle = aVec1.Angle(aVec2); Standard_Real anAngle = aVec1.Angle(aVec2);
aTrsf.SetRotation(anAx1, anAngle); aTrsf.SetRotation(anAx1, anAngle);
BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False); //NPAL18620: performance problem: multiple locations are accumulated
aShape = aTransformation.Shape(); // in shape and need a great time to process
//BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False);
//aShape = aTransformation.Shape();
TopLoc_Location aLocOrig = anOriginal.Location();
gp_Trsf aTrsfOrig = aLocOrig.Transformation();
TopLoc_Location aLocRes (aTrsf * aTrsfOrig);
aShape = anOriginal.Located(aLocRes);
} }
else if (aType == ROTATE_1D) { else if (aType == ROTATE_1D) {
//Get direction //Get direction
@ -149,10 +161,17 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
BRep_Builder B; BRep_Builder B;
B.MakeCompound( aCompound ); B.MakeCompound( aCompound );
TopLoc_Location aLocOrig = anOriginal.Location();
gp_Trsf aTrsfOrig = aLocOrig.Transformation();
for (int i = 0; i < nbtimes; i++ ) { for (int i = 0; i < nbtimes; i++ ) {
aTrsf.SetRotation(AX1, i*angle*PI180); aTrsf.SetRotation(AX1, i*angle*PI180);
BRepBuilderAPI_Transform myBRepTransformation(anOriginal, aTrsf, Standard_False) ; //NPAL18620: performance problem: multiple locations are accumulated
B.Add( aCompound, myBRepTransformation.Shape() ); // in shape and need a great time to process
//BRepBuilderAPI_Transform aBRepTransformation(anOriginal, aTrsf, Standard_False);
//B.Add(aCompound, aBRepTransformation.Shape());
TopLoc_Location aLocRes (aTrsf * aTrsfOrig);
B.Add(aCompound, anOriginal.Located(aLocRes));
} }
aShape = aCompound; aShape = aCompound;
@ -173,8 +192,8 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
gp_Ax1 AX1(aP1, D); gp_Ax1 AX1(aP1, D);
gp_Trsf theTransformation1 ; gp_Trsf aTrsf1;
gp_Trsf theTransformation2 ; gp_Trsf aTrsf2;
gp_Pnt P1; gp_Pnt P1;
GProp_GProps System; GProp_GProps System;
@ -208,7 +227,10 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
Standard_Real step = RI.GetStep(); Standard_Real step = RI.GetStep();
Standard_Real ang = RI.GetAngle(); Standard_Real ang = RI.GetAngle();
gp_Vec myVec ; TopLoc_Location aLocOrig = anOriginal.Location();
gp_Trsf aTrsfOrig = aLocOrig.Transformation();
gp_Vec aVec;
TopoDS_Compound aCompound; TopoDS_Compound aCompound;
BRep_Builder B; BRep_Builder B;
B.MakeCompound( aCompound ); B.MakeCompound( aCompound );
@ -217,23 +239,24 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
DX = i * step * Vec.X(); DX = i * step * Vec.X();
DY = i * step * Vec.Y(); DY = i * step * Vec.Y();
DZ = i * step * Vec.Z(); DZ = i * step * Vec.Z();
myVec.SetCoord( DX, DY, DZ ) ; aVec.SetCoord( DX, DY, DZ );
theTransformation1.SetTranslation(myVec) ; aTrsf1.SetTranslation(aVec);
theTransformation2.SetRotation(AX1, j*ang*PI180) ; aTrsf2.SetRotation(AX1, j*ang*PI180);
BRepBuilderAPI_Transform myBRepTransformation1(anOriginal, theTransformation1, Standard_False) ; //NPAL18620: performance problem: multiple locations are accumulated
BRepBuilderAPI_Transform myBRepTransformation2(myBRepTransformation1.Shape(), theTransformation2, Standard_False) ; // in shape and need a great time to process
B.Add( aCompound, myBRepTransformation2.Shape() ); //BRepBuilderAPI_Transform aBRepTrsf1 (anOriginal, aTrsf1, Standard_False);
//BRepBuilderAPI_Transform aBRepTrsf2 (aBRepTrsf1.Shape(), aTrsf2, Standard_False);
//B.Add(aCompound, aBRepTrsf2.Shape());
TopLoc_Location aLocRes (aTrsf2 * aTrsf1 * aTrsfOrig);
B.Add(aCompound, anOriginal.Located(aLocRes));
} }
} }
aShape = aCompound; aShape = aCompound;
} }
else return 0; else return 0;
if (aShape.IsNull()) return 0; if (aShape.IsNull()) return 0;
aFunction->SetValue(aShape); aFunction->SetValue(aShape);
@ -250,7 +273,6 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
//======================================================================= //=======================================================================
Standard_EXPORT Handle_Standard_Type& GEOMImpl_RotateDriver_Type_() Standard_EXPORT Handle_Standard_Type& GEOMImpl_RotateDriver_Type_()
{ {
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); 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); static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
@ -258,7 +280,6 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_RotateDriver_Type_()
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); 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_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_RotateDriver", static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_RotateDriver",
sizeof(GEOMImpl_RotateDriver), sizeof(GEOMImpl_RotateDriver),
@ -273,7 +294,6 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_RotateDriver_Type_()
//function : DownCast //function : DownCast
//purpose : //purpose :
//======================================================================= //=======================================================================
const Handle(GEOMImpl_RotateDriver) Handle(GEOMImpl_RotateDriver)::DownCast(const Handle(Standard_Transient)& AnObject) const Handle(GEOMImpl_RotateDriver) Handle(GEOMImpl_RotateDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
{ {
Handle(GEOMImpl_RotateDriver) _anOtherObject; Handle(GEOMImpl_RotateDriver) _anOtherObject;
@ -286,5 +306,3 @@ const Handle(GEOMImpl_RotateDriver) Handle(GEOMImpl_RotateDriver)::DownCast(cons
return _anOtherObject; return _anOtherObject;
} }

View File

@ -155,6 +155,13 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
Standard_ConstructionError::Raise("Wire construction failed: some gaps detected"); Standard_ConstructionError::Raise("Wire construction failed: some gaps detected");
} else { } else {
} }
aFW->ClosedWireMode() = Standard_False;
aFW->FixConnected();
if (aFW->StatusConnected(ShapeExtend_FAIL)) {
Standard_ConstructionError::Raise("Wire construction failed: cannot build connected wire");
}
aShape = aFW->WireAPIMake(); aShape = aFW->WireAPIMake();
} }
} }

View File

@ -93,10 +93,16 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
aP2 = BRep_Tool::Pnt(TopoDS::Vertex(aV2)); aP2 = BRep_Tool::Pnt(TopoDS::Vertex(aV2));
aTrsf.SetTranslation(aP1, aP2); aTrsf.SetTranslation(aP1, aP2);
BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False); //NPAL18620: performance problem: multiple locations are accumulated
aShape = aTransformation.Shape(); // in shape and need a great time to process
//BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False);
} else if(aType == TRANSLATE_VECTOR || aType == TRANSLATE_VECTOR_COPY) { //aShape = aTransformation.Shape();
TopLoc_Location aLocOrig = anOriginal.Location();
gp_Trsf aTrsfOrig = aLocOrig.Transformation();
TopLoc_Location aLocRes (aTrsf * aTrsfOrig);
aShape = anOriginal.Located(aLocRes);
}
else if (aType == TRANSLATE_VECTOR || aType == TRANSLATE_VECTOR_COPY) {
Handle(GEOM_Function) aVector = TI.GetVector(); Handle(GEOM_Function) aVector = TI.GetVector();
if(aVector.IsNull()) return 0; if(aVector.IsNull()) return 0;
TopoDS_Shape aV = aVector->GetValue(); TopoDS_Shape aV = aVector->GetValue();
@ -107,19 +113,31 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
aP2 = BRep_Tool::Pnt(TopExp::LastVertex(anEdge)); aP2 = BRep_Tool::Pnt(TopExp::LastVertex(anEdge));
aTrsf.SetTranslation(aP1, aP2); aTrsf.SetTranslation(aP1, aP2);
BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False); //NPAL18620: performance problem: multiple locations are accumulated
aShape = aTransformation.Shape(); // in shape and need a great time to process
//BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False);
//aShape = aTransformation.Shape();
TopLoc_Location aLocOrig = anOriginal.Location();
gp_Trsf aTrsfOrig = aLocOrig.Transformation();
TopLoc_Location aLocRes (aTrsf * aTrsfOrig);
aShape = anOriginal.Located(aLocRes);
} }
else if (aType == TRANSLATE_XYZ || aType == TRANSLATE_XYZ_COPY) { else if (aType == TRANSLATE_XYZ || aType == TRANSLATE_XYZ_COPY) {
gp_Vec aVec (TI.GetDX(), TI.GetDY(), TI.GetDZ()); gp_Vec aVec (TI.GetDX(), TI.GetDY(), TI.GetDZ());
aTrsf.SetTranslation(aVec); aTrsf.SetTranslation(aVec);
BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False); //NPAL18620: performance problem: multiple locations are accumulated
aShape = aTransformation.Shape(); // in shape and need a great time to process
//BRepBuilderAPI_Transform aTransformation (anOriginal, aTrsf, Standard_False);
//aShape = aTransformation.Shape();
TopLoc_Location aLocOrig = anOriginal.Location();
gp_Trsf aTrsfOrig = aLocOrig.Transformation();
TopLoc_Location aLocRes (aTrsf * aTrsfOrig);
aShape = anOriginal.Located(aLocRes);
} }
else if (aType == TRANSLATE_1D) { else if (aType == TRANSLATE_1D) {
Standard_Real DX, DY, DZ, step = TI.GetStep1(); Standard_Real DX, DY, DZ, step = TI.GetStep1();
Standard_Integer nbtimes = TI.GetNbIter1(); Standard_Integer nbtimes = TI.GetNbIter1();
gp_Vec myVec ; gp_Vec aVec;
TopoDS_Compound aCompound; TopoDS_Compound aCompound;
BRep_Builder B; BRep_Builder B;
B.MakeCompound( aCompound ); B.MakeCompound( aCompound );
@ -133,21 +151,28 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
gp_Vec Vec(BRep_Tool::Pnt(TopExp::FirstVertex(anEdge)), BRep_Tool::Pnt(TopExp::LastVertex(anEdge))); gp_Vec Vec(BRep_Tool::Pnt(TopExp::FirstVertex(anEdge)), BRep_Tool::Pnt(TopExp::LastVertex(anEdge)));
Vec.Normalize(); Vec.Normalize();
TopLoc_Location aLocOrig = anOriginal.Location();
gp_Trsf aTrsfOrig = aLocOrig.Transformation();
for (int i = 0; i < nbtimes; i++) { for (int i = 0; i < nbtimes; i++) {
DX = i * step * Vec.X(); DX = i * step * Vec.X();
DY = i * step * Vec.Y(); DY = i * step * Vec.Y();
DZ = i * step * Vec.Z(); DZ = i * step * Vec.Z();
myVec.SetCoord( DX, DY, DZ ) ; aVec.SetCoord( DX, DY, DZ );
aTrsf.SetTranslation(myVec) ; aTrsf.SetTranslation(aVec);
BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False) ; //NPAL18620: performance problem: multiple locations are accumulated
B.Add(aCompound , aTransformation.Shape() ); // in shape and need a great time to process
//BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False);
//B.Add(aCompound, aTransformation.Shape());
TopLoc_Location aLocRes (aTrsf * aTrsfOrig);
B.Add(aCompound, anOriginal.Located(aLocRes));
} }
aShape = aCompound; aShape = aCompound;
} }
else if (aType == TRANSLATE_2D) { else if (aType == TRANSLATE_2D) {
Standard_Integer nbtimes1 = TI.GetNbIter1(), nbtimes2 = TI.GetNbIter2(); Standard_Integer nbtimes1 = TI.GetNbIter1(), nbtimes2 = TI.GetNbIter2();
Standard_Real DX, DY, DZ, step1 = TI.GetStep1(), step2 = TI.GetStep2(); Standard_Real DX, DY, DZ, step1 = TI.GetStep1(), step2 = TI.GetStep2();
gp_Vec myVec ; gp_Vec aVec;
Handle(GEOM_Function) aVector = TI.GetVector(); Handle(GEOM_Function) aVector = TI.GetVector();
if(aVector.IsNull()) return 0; if(aVector.IsNull()) return 0;
TopoDS_Shape aV = aVector->GetValue(); TopoDS_Shape aV = aVector->GetValue();
@ -170,15 +195,22 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
BRep_Builder B; BRep_Builder B;
B.MakeCompound( aCompound ); B.MakeCompound( aCompound );
TopLoc_Location aLocOrig = anOriginal.Location();
gp_Trsf aTrsfOrig = aLocOrig.Transformation();
for (int i = 0; i < nbtimes1; i++) { for (int i = 0; i < nbtimes1; i++) {
for (int j = 0; j < nbtimes2; j++) { for (int j = 0; j < nbtimes2; j++) {
DX = i * step1 * Vec1.X() + j * step2 * Vec2.X(); DX = i * step1 * Vec1.X() + j * step2 * Vec2.X();
DY = i * step1 * Vec1.Y() + j * step2 * Vec2.Y(); DY = i * step1 * Vec1.Y() + j * step2 * Vec2.Y();
DZ = i * step1 * Vec1.Z() + j * step2 * Vec2.Z(); DZ = i * step1 * Vec1.Z() + j * step2 * Vec2.Z();
myVec.SetCoord( DX, DY, DZ ) ; aVec.SetCoord( DX, DY, DZ );
aTrsf.SetTranslation(myVec) ; aTrsf.SetTranslation(aVec);
BRepBuilderAPI_Transform myBRepTransformation(anOriginal, aTrsf, Standard_False) ; //NPAL18620: performance problem: multiple locations are accumulated
B.Add(aCompound , myBRepTransformation.Shape() ); // in shape and need a great time to process
//BRepBuilderAPI_Transform aBRepTransformation(anOriginal, aTrsf, Standard_False);
//B.Add(aCompound, aBRepTransformation.Shape());
TopLoc_Location aLocRes (aTrsf * aTrsfOrig);
B.Add(aCompound, anOriginal.Located(aLocRes));
} }
} }
aShape = aCompound; aShape = aCompound;
@ -186,7 +218,6 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
else return 0; else return 0;
if (aShape.IsNull()) return 0; if (aShape.IsNull()) return 0;
aFunction->SetValue(aShape); aFunction->SetValue(aShape);
@ -211,7 +242,6 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_TranslateDriver_Type_()
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); 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_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_TranslateDriver", static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_TranslateDriver",
sizeof(GEOMImpl_TranslateDriver), sizeof(GEOMImpl_TranslateDriver),
@ -226,7 +256,6 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_TranslateDriver_Type_()
//function : DownCast //function : DownCast
//purpose : //purpose :
//======================================================================= //=======================================================================
const Handle(GEOMImpl_TranslateDriver) Handle(GEOMImpl_TranslateDriver)::DownCast(const Handle(Standard_Transient)& AnObject) const Handle(GEOMImpl_TranslateDriver) Handle(GEOMImpl_TranslateDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
{ {
Handle(GEOMImpl_TranslateDriver) _anOtherObject; Handle(GEOMImpl_TranslateDriver) _anOtherObject;
@ -239,5 +268,3 @@ const Handle(GEOMImpl_TranslateDriver) Handle(GEOMImpl_TranslateDriver)::DownCas
return _anOtherObject; return _anOtherObject;
} }

View File

@ -565,8 +565,8 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy(SALOMEDS::Study_ptr theStudy, GEOM:
//============================================================================ //============================================================================
void GEOM_Gen_i::register_name(char * name) void GEOM_Gen_i::register_name(char * name)
{ {
GEOM::GEOM_Gen_ptr g = GEOM::GEOM_Gen::_narrow(_this()); GEOM::GEOM_Gen_var g = _this();
name_service->Register(g, CORBA::string_dup(name)); name_service->Register(g, name);
} }
//============================================================================ //============================================================================
@ -599,6 +599,7 @@ GEOM::GEOM_IBasicOperations_ptr GEOM_Gen_i::GetIBasicOperations(CORBA::Long theS
GEOM::GEOM_Gen_ptr engine = _this(); GEOM::GEOM_Gen_ptr engine = _this();
//transfer reference on engine
GEOM_IBasicOperations_i* aServant = GEOM_IBasicOperations_i* aServant =
new GEOM_IBasicOperations_i(_poa, engine, _impl->GetIBasicOperations(theStudyID)); new GEOM_IBasicOperations_i(_poa, engine, _impl->GetIBasicOperations(theStudyID));
@ -928,7 +929,8 @@ GEOM_I_EXPORT
const char * interfaceName) const char * interfaceName)
{ {
GEOM_Gen_i * myGEOM_Gen_i = new GEOM_Gen_i(orb, poa, contId, instanceName, interfaceName); GEOM_Gen_i * myGEOM_Gen_i = new GEOM_Gen_i(orb, poa, contId, instanceName, interfaceName);
myGEOM_Gen_i->register_name("/myGEOM_Gen"); // NRI : 11/07/2002 : Add for Supervision example // Don't understand the reason of this register ????
// myGEOM_Gen_i->register_name("/myGEOM_Gen"); // NRI : 11/07/2002 : Add for Supervision example
return myGEOM_Gen_i->getId(); return myGEOM_Gen_i->getId();
} }
} }

View File

@ -247,8 +247,9 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeSpherePntR
if (thePnt == NULL) return aGEOMObject._retn(); if (thePnt == NULL) return aGEOMObject._retn();
//Get the reference point //Get the reference point
CORBA::String_var entry=thePnt->GetEntry();
Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
(thePnt->GetStudyID(), thePnt->GetEntry()); (thePnt->GetStudyID(), entry);
if (aPnt.IsNull()) return aGEOMObject._retn(); if (aPnt.IsNull()) return aGEOMObject._retn();
@ -566,7 +567,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFilling(GEOM::GEOM_Object_pt
CORBA::Long theMaxDeg, CORBA::Long theMaxDeg,
CORBA::Double theTol2D, CORBA::Double theTol2D,
CORBA::Double theTol3D, CORBA::Double theTol3D,
CORBA::Long theNbIter) CORBA::Long theNbIter,
CORBA::Boolean theApprox)
{ {
GEOM::GEOM_Object_var aGEOMObject; GEOM::GEOM_Object_var aGEOMObject;
@ -582,7 +584,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFilling(GEOM::GEOM_Object_pt
if (aShape.IsNull()) return aGEOMObject._retn(); if (aShape.IsNull()) return aGEOMObject._retn();
//Create the Solid //Create the Solid
Handle(GEOM_Object) anObject = GetOperations()->MakeFilling(aShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter); Handle(GEOM_Object) anObject = GetOperations()->MakeFilling(aShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, theApprox);
if (!GetOperations()->IsDone() || anObject.IsNull()) if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn(); return aGEOMObject._retn();

View File

@ -105,7 +105,7 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
GEOM::GEOM_Object_ptr theAxis, GEOM::GEOM_Object_ptr theAxis,
CORBA::Double theAngle); 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); 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::Boolean theApprox);
GEOM::GEOM_Object_ptr MakeThruSections(const GEOM::ListOfGO& theSeqSections, GEOM::GEOM_Object_ptr MakeThruSections(const GEOM::ListOfGO& theSeqSections,
CORBA::Boolean theModeSolid, CORBA::Boolean theModeSolid,

View File

@ -72,10 +72,12 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeBoolean
if (theShape1 == NULL || theShape2 == NULL) return aGEOMObject._retn(); if (theShape1 == NULL || theShape2 == NULL) return aGEOMObject._retn();
//Get the reference shapes //Get the reference shapes
CORBA::String_var entry=theShape1->GetEntry();
Handle(GEOM_Object) aSh1 = GetOperations()->GetEngine()->GetObject Handle(GEOM_Object) aSh1 = GetOperations()->GetEngine()->GetObject
(theShape1->GetStudyID(), theShape1->GetEntry()); (theShape1->GetStudyID(), entry);
entry=theShape2->GetEntry();
Handle(GEOM_Object) aSh2 = GetOperations()->GetEngine()->GetObject Handle(GEOM_Object) aSh2 = GetOperations()->GetEngine()->GetObject
(theShape2->GetStudyID(), theShape2->GetEntry()); (theShape2->GetStudyID(), entry);
if (aSh1.IsNull() || aSh2.IsNull()) return aGEOMObject._retn(); if (aSh1.IsNull() || aSh2.IsNull()) return aGEOMObject._retn();

View File

@ -114,7 +114,7 @@ void GEOM_IOperations_i::FinishOperation()
//============================================================================= //=============================================================================
/*! /*!
* AboutOperation * AbortOperation
*/ */
//============================================================================= //=============================================================================
void GEOM_IOperations_i::AbortOperation() void GEOM_IOperations_i::AbortOperation()
@ -132,6 +132,6 @@ GEOM::GEOM_Object_ptr GEOM_IOperations_i::GetObject(Handle(GEOM_Object) theObjec
if(theObject.IsNull()) return NULL; if(theObject.IsNull()) return NULL;
TCollection_AsciiString anEntry; TCollection_AsciiString anEntry;
TDF_Tool::Entry(theObject->GetEntry(), anEntry); TDF_Tool::Entry(theObject->GetEntry(), anEntry);
GEOM::GEOM_Object_var GO = GEOM::GEOM_Object::_duplicate(_engine->GetObject(theObject->GetDocID(), anEntry.ToCString())); GEOM::GEOM_Object_var GO = _engine->GetObject(theObject->GetDocID(), anEntry.ToCString());
return GO._retn(); return GO._retn();
} }

View File

@ -59,7 +59,7 @@ class GEOM_I_EXPORT GEOM_IOperations_i : public virtual POA_GEOM::GEOM_IOperatio
private: private:
::GEOM_IOperations* _impl; ::GEOM_IOperations* _impl;
GEOM::GEOM_Gen_ptr _engine; GEOM::GEOM_Gen_var _engine;
}; };
#endif #endif

View File

@ -61,7 +61,9 @@ GEOM_Object_i::GEOM_Object_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr
//============================================================================= //=============================================================================
GEOM_Object_i::~GEOM_Object_i() GEOM_Object_i::~GEOM_Object_i()
{} {
GEOM_Engine::GetEngine()->RemoveObject(_impl);
}
//============================================================================= //=============================================================================

View File

@ -85,7 +85,7 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public
private: private:
GEOM::GEOM_Gen_ptr _engine; GEOM::GEOM_Gen_var _engine;
Handle(GEOM_Object) _impl; Handle(GEOM_Object) _impl;
TopoDS_Shape _geom; TopoDS_Shape _geom;
}; };

View File

@ -70,6 +70,12 @@ GEOM_Superv_i::GEOM_Superv_i(CORBA::ORB_ptr orb,
GEOM_Superv_i::~GEOM_Superv_i() GEOM_Superv_i::~GEOM_Superv_i()
{ {
MESSAGE("GEOM_Superv_i::~GEOM_Superv_i"); MESSAGE("GEOM_Superv_i::~GEOM_Superv_i");
if (!CORBA::is_nil(myBasicOp))
myBasicOp->Destroy();
if (!CORBA::is_nil(myBoolOp))
myBoolOp->Destroy();
if (!CORBA::is_nil(my3DPrimOp))
my3DPrimOp->Destroy();
delete name_service; delete name_service;
} }
@ -79,8 +85,8 @@ GEOM_Superv_i::~GEOM_Superv_i()
//============================================================================ //============================================================================
void GEOM_Superv_i::register_name(char * name) void GEOM_Superv_i::register_name(char * name)
{ {
GEOM::GEOM_Superv_ptr g = GEOM::GEOM_Superv::_narrow(POA_GEOM::GEOM_Superv::_this()); GEOM::GEOM_Superv_var g = _this();
name_service->Register(g, strdup(name)); name_service->Register(g, name);
} }
//============================================================================= //=============================================================================
@ -88,9 +94,17 @@ void GEOM_Superv_i::register_name(char * name)
//============================================================================= //=============================================================================
void GEOM_Superv_i::setGeomEngine() void GEOM_Superv_i::setGeomEngine()
{ {
if ( !CORBA::is_nil(myGeomEngine) )
return;
// get GEOM_Gen engine // get GEOM_Gen engine
/*
SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service ); SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service );
Engines::Component_var comp = lcc->FindOrLoad_Component( "FactoryServer", "GEOM" ); Engines::Component_var comp = lcc->FindOrLoad_Component( "FactoryServer", "GEOM" );
*/
Engines::Container_var cont=GetContainerRef();
cont->load_component_Library("GEOM");
Engines::Component_var comp=cont->create_component_instance("GEOM",0);
myGeomEngine = GEOM::GEOM_Gen::_narrow(comp); myGeomEngine = GEOM::GEOM_Gen::_narrow(comp);
} }
@ -799,7 +813,9 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSphere (CORBA::Double theX,
MESSAGE("GEOM_Superv_i::MakeSphepe"); MESSAGE("GEOM_Superv_i::MakeSphepe");
getBasicOp(); getBasicOp();
get3DPrimOp(); get3DPrimOp();
GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeSpherePntR(myBasicOp->MakePointXYZ(theX, theY, theZ), theRadius); GEOM::GEOM_Object_var o = myBasicOp->MakePointXYZ(theX, theY, theZ);
GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeSpherePntR(o, theRadius);
o->Destroy();
endService( " GEOM_Superv_i::MakeSphepe" ); endService( " GEOM_Superv_i::MakeSphepe" );
return anObj; return anObj;
} }
@ -1003,12 +1019,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeRevolutionAxisAngle2Ways (GEOM::GEOM_Ob
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilling (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilling (GEOM::GEOM_Object_ptr theShape,
CORBA::Long theMinDeg, CORBA::Long theMaxDeg, CORBA::Long theMinDeg, CORBA::Long theMaxDeg,
CORBA::Double theTol2D, CORBA::Double theTol3D, CORBA::Double theTol2D, CORBA::Double theTol3D,
CORBA::Long theNbIter) CORBA::Long theNbIter, CORBA::Boolean theApprox)
{ {
beginService( " GEOM_Superv_i::MakeFilling" ); beginService( " GEOM_Superv_i::MakeFilling" );
MESSAGE("GEOM_Superv_i::MakeFilling"); MESSAGE("GEOM_Superv_i::MakeFilling");
get3DPrimOp(); get3DPrimOp();
GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter); GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, theApprox);
endService( " GEOM_Superv_i::MakeFilling" ); endService( " GEOM_Superv_i::MakeFilling" );
return anObj; return anObj;
} }
@ -2737,7 +2753,8 @@ extern "C"
const char * interfaceName) const char * interfaceName)
{ {
GEOM_Superv_i * myGEOM_Superv_i = new GEOM_Superv_i(orb, poa, contId, instanceName, interfaceName); GEOM_Superv_i * myGEOM_Superv_i = new GEOM_Superv_i(orb, poa, contId, instanceName, interfaceName);
myGEOM_Superv_i->register_name("/myGEOM_Superv"); //Don't understand the reason why this component is registered ???
// myGEOM_Superv_i->register_name("/myGEOM_Superv");
return myGEOM_Superv_i->getId() ; return myGEOM_Superv_i->getId() ;
} }
} }

View File

@ -237,7 +237,7 @@ public:
GEOM::GEOM_Object_ptr MakeFilling (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr MakeFilling (GEOM::GEOM_Object_ptr theShape,
CORBA::Long theMinDeg, CORBA::Long theMaxDeg, CORBA::Long theMinDeg, CORBA::Long theMaxDeg,
CORBA::Double theTol2D, CORBA::Double theTol3D, CORBA::Double theTol2D, CORBA::Double theTol3D,
CORBA::Long theNbIter); CORBA::Long theNbIter, CORBA::Boolean theApprox);
GEOM::GEOM_Object_ptr MakeThruSections(const GEOM::ListOfGO& theSeqSections, GEOM::GEOM_Object_ptr MakeThruSections(const GEOM::ListOfGO& theSeqSections,
CORBA::Boolean theModeSolid, CORBA::Boolean theModeSolid,
@ -566,21 +566,21 @@ public:
private: private:
SALOME_NamingService * name_service; SALOME_NamingService * name_service;
GEOM::GEOM_Gen_ptr myGeomEngine; GEOM::GEOM_Gen_var myGeomEngine;
CORBA::Long myStudyID; CORBA::Long myStudyID;
CORBA::Long myLastStudyID; // mkr : PAL10770 CORBA::Long myLastStudyID; // mkr : PAL10770
PortableServer::POA_var myPOA; PortableServer::POA_var myPOA;
GEOM::GEOM_IBasicOperations_ptr myBasicOp; GEOM::GEOM_IBasicOperations_var myBasicOp;
GEOM::GEOM_I3DPrimOperations_ptr my3DPrimOp; GEOM::GEOM_I3DPrimOperations_var my3DPrimOp;
GEOM::GEOM_IBooleanOperations_ptr myBoolOp; GEOM::GEOM_IBooleanOperations_var myBoolOp;
GEOM::GEOM_IInsertOperations_ptr myInsOp; GEOM::GEOM_IInsertOperations_var myInsOp;
GEOM::GEOM_ITransformOperations_ptr myTransfOp; GEOM::GEOM_ITransformOperations_var myTransfOp;
GEOM::GEOM_IShapesOperations_ptr myShapesOp; GEOM::GEOM_IShapesOperations_var myShapesOp;
GEOM::GEOM_IBlocksOperations_ptr myBlocksOp; GEOM::GEOM_IBlocksOperations_var myBlocksOp;
GEOM::GEOM_ICurvesOperations_ptr myCurvesOp; GEOM::GEOM_ICurvesOperations_var myCurvesOp;
GEOM::GEOM_ILocalOperations_ptr myLocalOp; GEOM::GEOM_ILocalOperations_var myLocalOp;
GEOM::GEOM_IGroupOperations_ptr myGroupOp; GEOM::GEOM_IGroupOperations_var myGroupOp;
}; };

View File

@ -700,8 +700,8 @@ def MakeCopy(aShape):
print "MakeCopy : ", InsertOp.GetErrorCode() print "MakeCopy : ", InsertOp.GetErrorCode()
return anObj return anObj
def MakeFilling(aShape,mindeg,maxdeg,tol2d,tol3d,nbiter): def MakeFilling(aShape,mindeg,maxdeg,tol2d,tol3d,nbiter,isApprox=0):
anObj = PrimOp.MakeFilling(aShape,mindeg,maxdeg,tol2d,tol3d,nbiter) anObj = PrimOp.MakeFilling(aShape,mindeg,maxdeg,tol2d,tol3d,nbiter,isApprox)
if PrimOp.IsDone() == 0: if PrimOp.IsDone() == 0:
print "MakeFilling : ", PrimOp.GetErrorCode() print "MakeFilling : ", PrimOp.GetErrorCode()
return anObj return anObj

View File

@ -1379,8 +1379,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @return New GEOM_Object, containing the created filling surface. # @return New GEOM_Object, containing the created filling surface.
# #
# Example: see GEOM_TestAll.py # Example: see GEOM_TestAll.py
def MakeFilling(self,theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter): def MakeFilling(self,theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter) anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox)
RaiseIfFailed("MakeFilling", self.PrimOp) RaiseIfFailed("MakeFilling", self.PrimOp)
return anObj return anObj

View File

@ -61,7 +61,7 @@ GenerationGUI_FillingDlg::GenerationGUI_FillingDlg( GeometryGUI* theGeometryGUI,
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close(); mainFrame()->RadioButton3->close();
GroupPoints = new DlgRef_1Sel5Spin( centralWidget() ); GroupPoints = new DlgRef_1Sel5Spin1Check( centralWidget() );
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) ); GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupPoints->TextLabel1->setText( tr( "GEOM_FILLING_COMPOUND" ) ); GroupPoints->TextLabel1->setText( tr( "GEOM_FILLING_COMPOUND" ) );
GroupPoints->TextLabel2->setText( tr( "GEOM_FILLING_MIN_DEG" ) ); GroupPoints->TextLabel2->setText( tr( "GEOM_FILLING_MIN_DEG" ) );
@ -69,6 +69,7 @@ GenerationGUI_FillingDlg::GenerationGUI_FillingDlg( GeometryGUI* theGeometryGUI,
GroupPoints->TextLabel4->setText( tr( "GEOM_FILLING_NB_ITER" ) ); GroupPoints->TextLabel4->setText( tr( "GEOM_FILLING_NB_ITER" ) );
GroupPoints->TextLabel5->setText( tr( "GEOM_FILLING_MAX_DEG" ) ); GroupPoints->TextLabel5->setText( tr( "GEOM_FILLING_MAX_DEG" ) );
GroupPoints->TextLabel6->setText( tr( "GEOM_FILLING_TOL_3D" ) ); GroupPoints->TextLabel6->setText( tr( "GEOM_FILLING_TOL_3D" ) );
GroupPoints->CheckBox1->setText( tr( "GEOM_FILLING_APPROX" ) );
GroupPoints->PushButton1->setIcon( image1 ); GroupPoints->PushButton1->setIcon( image1 );
GroupPoints->LineEdit1->setReadOnly( true ); GroupPoints->LineEdit1->setReadOnly( true );
@ -77,7 +78,7 @@ GenerationGUI_FillingDlg::GenerationGUI_FillingDlg( GeometryGUI* theGeometryGUI,
layout->addWidget( GroupPoints ); layout->addWidget( GroupPoints );
/***************************************************************/ /***************************************************************/
setHelpFileName( "creaet_filling_page.html" ); setHelpFileName( "create_filling_page.html" );
/* Initialisations */ /* Initialisations */
Init(); Init();
@ -107,6 +108,7 @@ void GenerationGUI_FillingDlg::Init()
myTol3D = 0.0001; myTol3D = 0.0001;
myTol2D = 0.0001; myTol2D = 0.0001;
myNbIter = 5; myNbIter = 5;
myIsApprox = false;
myOkCompound = false; myOkCompound = false;
globalSelection( GEOM_COMPOUND ); globalSelection( GEOM_COMPOUND );
@ -139,6 +141,8 @@ void GenerationGUI_FillingDlg::Init()
connect( GroupPoints->SpinBox4, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) ); connect( GroupPoints->SpinBox4, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
connect( GroupPoints->SpinBox5, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) ); connect( GroupPoints->SpinBox5, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
connect( GroupPoints->CheckBox1, SIGNAL( stateChanged( int ) ), this, SLOT( ApproxChanged() ) );
// VSR: TODO ->> // VSR: TODO ->>
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox1, SLOT( SetStep( double ) ) ); connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox1, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox2, SLOT( SetStep( double ) ) ); connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox2, SLOT( SetStep( double ) ) );
@ -300,6 +304,16 @@ void GenerationGUI_FillingDlg::ValueChangedInSpinBox( double newValue )
displayPreview(); displayPreview();
} }
//=================================================================================
// function : ApproxChanged()
// purpose :
//=================================================================================
void GenerationGUI_FillingDlg::ApproxChanged()
{
myIsApprox = GroupPoints->CheckBox1->isChecked();
displayPreview();
}
//================================================================================= //=================================================================================
// function : createOperation // function : createOperation
// purpose : // purpose :
@ -327,7 +341,7 @@ bool GenerationGUI_FillingDlg::execute( ObjectList& objects )
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation() )->MakeFilling( anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation() )->MakeFilling(
myCompound, myMinDeg, myMaxDeg, myTol2D, myTol3D, myNbIter ); myCompound, myMinDeg, myMaxDeg, myTol2D, myTol3D, myNbIter, myIsApprox );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() ); objects.push_back( anObj._retn() );

View File

@ -28,7 +28,7 @@
#include <GEOMBase_Skeleton.h> #include <GEOMBase_Skeleton.h>
class DlgRef_1Sel5Spin; class DlgRef_1Sel5Spin1Check;
//================================================================================= //=================================================================================
// class : GenerationGUI_FillingDlg // class : GenerationGUI_FillingDlg
@ -59,9 +59,10 @@ private:
Standard_Real myTol3D; Standard_Real myTol3D;
Standard_Real myTol2D; Standard_Real myTol2D;
Standard_Integer myNbIter; Standard_Integer myNbIter;
bool myIsApprox;
bool myOkCompound; /* to check when curv. compound is defined */ bool myOkCompound; /* to check when curv. compound is defined */
DlgRef_1Sel5Spin* GroupPoints; DlgRef_1Sel5Spin1Check* GroupPoints;
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
@ -71,6 +72,7 @@ private slots:
void SelectionIntoArgument(); void SelectionIntoArgument();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
void ValueChangedInSpinBox( double ); void ValueChangedInSpinBox( double );
void ApproxChanged();
}; };
#endif // GENERATIONGUI_FILLINGDLG_H #endif // GENERATIONGUI_FILLINGDLG_H

View File

@ -279,8 +279,10 @@ bool RepairGUI_GlueDlg::ClickOnApply()
//================================================================================= //=================================================================================
void RepairGUI_GlueDlg::SelectionIntoArgument() void RepairGUI_GlueDlg::SelectionIntoArgument()
{ {
if ( mySubShapesChk->isChecked() && getConstructorId() == 1 ) if ( mySubShapesChk->isChecked() && getConstructorId() == 1 ) {
updateButtonState();
return; return;
}
erasePreview(); erasePreview();
myEditCurrentArgument->setText( "" ); myEditCurrentArgument->setText( "" );
@ -603,6 +605,8 @@ void RepairGUI_GlueDlg::onDetect()
msg = tr( "THERE_ARE_NO_FACES_FOR_GLUING" ); msg = tr( "THERE_ARE_NO_FACES_FOR_GLUING" );
} }
connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
SUIT_MessageBox::information( this, tr( "GEOM_FREE_BOUNDS_TLT" ), msg, tr( "Close" ) ); SUIT_MessageBox::information( this, tr( "GEOM_FREE_BOUNDS_TLT" ), msg, tr( "Close" ) );
updateButtonState(); updateButtonState();
activateSelection(); activateSelection();
@ -635,10 +639,13 @@ void RepairGUI_GlueDlg::activateSelection()
globalSelection( GEOM_ALLSHAPES ); globalSelection( GEOM_ALLSHAPES );
else { else {
displayPreview( true, false, false, 2/*line width*/, 1/*display mode*/, Quantity_NOC_RED ); displayPreview( true, false, false, 2/*line width*/, 1/*display mode*/, Quantity_NOC_RED );
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ) ;
globalSelection( GEOM_PREVIEW ); globalSelection( GEOM_PREVIEW );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ) ;
} }
} }
updateViewer(); updateViewer();
} }
@ -656,9 +663,13 @@ void RepairGUI_GlueDlg::updateButtonState()
} }
else else
{ {
bool wasSelected = false;
SALOME_ListIteratorOfListIO it ( selectedIO() );
if (it.More() > 0)
wasSelected = true;
bool wasDetected = myTmpObjs.size() ? true : false; bool wasDetected = myTmpObjs.size() ? true : false;
buttonOk()->setEnabled( hasMainObj && wasDetected ); buttonOk()->setEnabled( hasMainObj && wasDetected && wasSelected );
buttonApply()->setEnabled( hasMainObj && wasDetected ); buttonApply()->setEnabled( hasMainObj && wasDetected && wasSelected );
mySubShapesChk->setEnabled( hasMainObj && wasDetected ); mySubShapesChk->setEnabled( hasMainObj && wasDetected );
myDetectBtn->setEnabled( hasMainObj ); myDetectBtn->setEnabled( hasMainObj );
if ( !hasMainObj || !wasDetected ) if ( !hasMainObj || !wasDetected )