<ul>
<li>\subpage create_extrusion_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>
</ul>
-*/
\ No newline at end of file
+*/
\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
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
shell) serving as base object + 1 vector (for direction of the
extrusion) + 1 value (dimension).
\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
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>Arguments:</b> Name + 1 shape (vertex, edge, planar wire, face or
shell) serving as base object + 2 vertices.
/*!
-\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>
\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
-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 <b>TUI Command:</b> <em>geompy.MakeFilling(Edges, MinDegree, MaxDegree, Tol2D, Tol3D, NbIter)</em>
-\n <b>Arguments:</b> Name + 1 List of edges + 5 Parameters
+\n <b>TUI Command:</b> <em>geompy.MakeFilling(Edges, MinDegree,
+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
-tolerance, Number of iterations).
+tolerance, Number of iterations, Approximation).
\image html filling.png
<ul>
<li>\ref create_extrusion_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>
</ul>
<li>\subpage work_with_groups_page</li>
</ul>
</ul>
-*/
\ No newline at end of file
+*/
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>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>
To create a \b Point in the <b>Main Menu</b> select <b>New Entity - >
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
(vertex).
\n <b>Arguments:</b> Name + 1 reference point + 3 coordinates defining
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
point is located in the middle of the edge.
\n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurve(Edge,Parameter).</em>
\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>
\image html points.png
\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
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,
solid or compsolid).
<ul>
<li>\ref create_extrusion_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>
</ul>
<li>\ref work_with_groups_page</li>
</ul>
</ul>
-*/
\ No newline at end of file
+*/
GEOM_Object MakeFilling (in GEOM_Object theShape,
in long theMinDeg, in long theMaxDeg,
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.
GEOM_Object MakeFilling (in GEOM_Object theShape,
in long theMinDeg, in long theMaxDeg,
in double theTol2D, in double theTol3D,
- in long theNbIter) ;
+ in long theNbIter, in boolean theApprox) ;
GEOM_Object MakeThruSections(in ListOfGO theSeqSections,
in boolean theModeSolid,
in double thePreci,
<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>
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 );
}
{
}
+//////////////////////////////////////////
+// DlgRef_1Sel5Spin1Check
+//////////////////////////////////////////
+
+DlgRef_1Sel5Spin1Check::DlgRef_1Sel5Spin1Check( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+ setupUi( this );
+}
+
+DlgRef_1Sel5Spin1Check::~DlgRef_1Sel5Spin1Check()
+{
+}
+
//////////////////////////////////////////
// DlgRef_1Sel5Spin
//////////////////////////////////////////
~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
//////////////////////////////////////////
<string/>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
<number>0</number>
</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>
</property>
<item row="0" column="0" >
<string/>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
<number>9</number>
</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>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1" >
<widget class="QPushButton" name="PushButton1" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <tabstops>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>LineEdit1</tabstop>
+ <tabstop>SpinBox_DX</tabstop>
+ </tabstops>
<resources/>
<connections/>
</ui>
<string/>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
<number>0</number>
</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>
</property>
<item row="0" column="0" >
<string/>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
<number>9</number>
</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>
</property>
<item row="2" column="1" colspan="2" >
<item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="3" column="0" >
<widget class="QLabel" name="TextLabel4" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="0" >
<widget class="QLabel" name="TextLabel3" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1" >
<widget class="QPushButton" name="PushButton1" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <tabstops>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>LineEdit1</tabstop>
+ <tabstop>SpinBox_DX</tabstop>
+ <tabstop>SpinBox_DY</tabstop>
+ <tabstop>SpinBox_DZ</tabstop>
+ </tabstops>
<resources/>
<connections/>
</ui>
<string/>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
<number>0</number>
</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>
</property>
<item row="0" column="0" >
<string/>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
+ <number>9</number>
+ </property>
+ <property name="topMargin" >
+ <number>9</number>
+ </property>
+ <property name="rightMargin" >
+ <number>9</number>
+ </property>
+ <property name="bottomMargin" >
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="horizontalSpacing" >
+ <number>6</number>
+ </property>
+ <property name="verticalSpacing" >
<number>6</number>
</property>
<item row="2" column="0" >
<widget class="QLabel" name="TextLabel6" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<string/>
</property>
<layout class="QHBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
<property name="spacing" >
<number>6</number>
</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>
<widget class="QLabel" name="TextLabel3" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QLabel" name="TextLabel4" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QLabel" name="TextLabel5" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1" >
<widget class="QPushButton" name="PushButton1" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</widget>
<layoutdefault spacing="6" margin="11" />
<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/>
<connections/>
</ui>
--- /dev/null
+<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>
<string/>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
<number>0</number>
</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>
</property>
<item row="0" column="0" >
<string/>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
<number>9</number>
</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>
</property>
<item row="2" column="1" >
<item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="0" >
<widget class="QLabel" name="TextLabel3" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <tabstops>
+ <tabstop>SpinBox_DX</tabstop>
+ <tabstop>SpinBox_DY</tabstop>
+ <tabstop>SpinBox_DZ</tabstop>
+ </tabstops>
<resources/>
<connections/>
</ui>
<string/>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
<number>9</number>
</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>
</property>
<item row="1" column="0" >
<widget class="QGroupBox" name="GroupBoxName" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<string>Result name</string>
</property>
<layout class="QHBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
<property name="spacing" >
<number>6</number>
</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>
<widget class="QLabel" name="NameLabel" >
<property name="text" >
<item row="0" column="0" >
<widget class="QGroupBox" name="GroupConstructors" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<string/>
</property>
<layout class="QHBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
<property name="spacing" >
<number>6</number>
</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>
<widget class="QRadioButton" name="RadioButton1" >
<property name="text" >
<item row="3" column="0" >
<widget class="QGroupBox" name="GroupButtons" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<string/>
</property>
<layout class="QHBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
<property name="spacing" >
<number>6</number>
</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>
<widget class="QPushButton" name="buttonOk" >
<property name="text" >
<item row="2" column="0" >
<widget class="QWidget" native="1" name="GroupMedium" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
</layout>
</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/>
<connections/>
</ui>
ui_DlgRef_1Sel3Check_QTD.h \
ui_DlgRef_1Sel3Spin_QTD.h \
ui_DlgRef_1Sel4Spin_QTD.h \
+ ui_DlgRef_1Sel5Spin1Check_QTD.h \
ui_DlgRef_1Sel5Spin_QTD.h \
ui_DlgRef_1Sel_QTD.h \
ui_DlgRef_1SelExt_QTD.h \
bool EntityGUI_SubShapeDlg::isValid( QString& msg )
{
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 ( isAllSubShapes() )
isOk = true;
_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
//=============================================================================
Handle(GEOM_Object) GEOM_Engine::AddObject(int theDocID, int theType)
{
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
- Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
+ Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
- TDF_Label aChild = TDF_TagSource::NewChild(aDoc->Main());
- Handle(GEOM_Object) anObject = new GEOM_Object(aChild, theType);
+ // 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);
- //Put an object in the map of created objects
- TCollection_AsciiString anID = BuildIDFromObject(anObject);
- if(_objects.IsBound(anID)) _objects.UnBind(anID);
- _objects.Bind(anID, anObject);
+ //Put an object in the map of created objects
+ TCollection_AsciiString anID = BuildIDFromObject(anObject);
+ if(_objects.IsBound(anID)) _objects.UnBind(anID);
+ _objects.Bind(anID, anObject);
- return anObject;
+ return anObject;
}
//=============================================================================
Handle(TDocStd_Document) aDoc = GetDocument(theMainShape->GetDocID());
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_Object) anObject = new GEOM_Object(aChild, 28); //28 is SUBSHAPE type
//=============================================================================
bool GEOM_Engine::RemoveObject(Handle(GEOM_Object) theObject)
{
- if(!theObject) return false;
+ if (!theObject) return false;
//Remove an object from the map of available objects
TCollection_AsciiString anID = BuildIDFromObject(theObject);
- if(_objects.IsBound(anID)) _objects.UnBind(anID);
+ if (_objects.IsBound(anID)) _objects.UnBind(anID);
int nb = theObject->GetNbFunctions();
Handle(TDataStd_TreeNode) aNode;
- for(int i = 1; i<=nb; i++) {
+ for (int i = 1; i<=nb; i++) {
Handle(GEOM_Function) aFunction = theObject->GetFunction(i);
- if(aFunction->GetEntry().FindAttribute(GEOM_Function::GetFunctionTreeID(), aNode))
+ if (aFunction->GetEntry().FindAttribute(GEOM_Function::GetFunctionTreeID(), aNode))
aNode->Remove();
}
TDF_Label aLabel = theObject->GetEntry();
aLabel.ForgetAllAttributes(Standard_True);
+ _lastCleared = aLabel;
theObject.Nullify();
//=============================================================================
void GEOM_Engine::Close(int theDocID)
{
- if(_mapIDDocument.IsBound(theDocID)) {
+ if (_mapIDDocument.IsBound(theDocID)) {
Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
//Remove all GEOM Objects associated to the given document
TColStd_SequenceOfAsciiString aSeq;
- GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It(_objects);
- for(; It.More(); It.Next()) {
- TCollection_AsciiString anObjID(It.Key());
+ GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It (_objects);
+ for (; It.More(); It.Next()) {
+ TCollection_AsciiString anObjID (It.Key());
Standard_Integer anID = ExtractDocID(anObjID);
- if(theDocID == anID) aSeq.Append(It.Key());
+ if (theDocID == anID) aSeq.Append(It.Key());
}
- 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);
aDoc.Nullify();
}
#include <TDocStd_Document.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
+#include <TDF_Label.hxx>
class GEOM_Engine
{
public:
Standard_EXPORT GEOM_Engine();
- Standard_EXPORT ~GEOM_Engine() { _mapIDDocument.Clear(); _objects.Clear(); }
+ Standard_EXPORT virtual ~GEOM_Engine();
//Retuns the engine
Standard_EXPORT static GEOM_Engine* GetEngine();
GEOM_DataMapOfAsciiStringTransient _objects;
Resource_DataMapOfAsciiStringAsciiString _studyEntry2NameMap;
+
+ TDF_Label _lastCleared;
};
#endif
CORBA::Short maxdeg,
CORBA::Double tol3d,
CORBA::Double tol2d,
- CORBA::Short nbiter)
+ CORBA::Short nbiter,
+ CORBA::Boolean theApprox)
throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
Handle(GeomFill_Line) Line = new GeomFill_Line(i) ;
GeomFill_AppSurf App(mindeg, maxdeg, tol3d, tol2d, nbiter) ; /* user parameters */
- App.Perform(Line, Section) ;
+ App.Perform(Line, Section, theApprox) ;
if (!App.IsDone()) {
THROW_SALOME_CORBA_EXCEPTION("Filling aborted : non valid shape result", SALOME::BAD_PARAM);
<source>GEOM_RESULT_NAME_LBL</source>
<translation>Name</translation>
</message>
+ <message>
+ <source>GEOM_FILLING_APPROX</source>
+ <translation>Approximation</translation>
+ </message>
</context>
<context>
<name>BasicGUI_MarkerDlg</name>
aShape2.ShapeType() == TopAbs_VERTEX) {
gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
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);
MB.Build();
Standard_Real tol3d = IF.GetTol2D();
Standard_Real tol2d = IF.GetTol3D();
Standard_Integer nbiter = IF.GetNbIter();
+ Standard_Boolean isApprox = IF.GetApprox();
if (mindeg > maxdeg) {
Standard_RangeError::Raise("Minimal degree can not be more than maximal degree");
Handle(GeomFill_Line) Line = new GeomFill_Line(i);
GeomFill_AppSurf App (mindeg, maxdeg, tol3d, tol2d, nbiter); /* user parameters */
- App.Perform(Line, Section);
+ App.Perform(Line, Section, isApprox);
if (!App.IsDone()) return 0;
Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots;
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
(Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg,
- double theTol2D, double theTol3D, int theNbIter)
+ double theTol2D, double theTol3D, int theNbIter, bool isApprox)
{
SetErrorCode(KO);
aFI.SetTol2D(theTol2D);
aFI.SetTol3D(theTol3D);
aFI.SetNbIter(theNbIter);
+ aFI.SetApprox(isApprox);
//Compute the Solid value
try {
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aFilling << " = geompy.MakeFilling("
+ GEOM::TPythonDump pd (aFunction);
+ pd << aFilling << " = geompy.MakeFilling("
<< theShape << ", " << theMinDeg << ", " << theMaxDeg << ", "
- << theTol2D << ", " << theTol3D << ", " << theNbIter << ")";
+ << theTol2D << ", " << theTol3D << ", " << theNbIter;
+ if(isApprox)
+ pd << ", " << isApprox;
+ pd << ")";
SetErrorCode(OK);
return aFilling;
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,
bool theModeSolid,
#define FILL_ARG_TOL3D 4
#define FILL_ARG_SHAPE 5
#define FILL_ARG_NBITER 6
+#define FILL_ARG_APPROX 7
class GEOMImpl_IFilling
{
void SetNbIter(int theNbIter) { _func->SetInteger(FILL_ARG_NBITER, theNbIter); }
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); }
Handle(GEOM_Function) GetShape() { return _func->GetReference(FILL_ARG_SHAPE); }
Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
GEOM::TPythonDump pd (aFunction, /*append=*/true);
pd << "[" << anAsciiList.ToCString();
- pd << "] = geompy.GetGlueFaces" << theShape << ", " << theTolerance << ")";
+ pd << "] = geompy.GetGlueFaces(" << theShape << ", " << theTolerance << ")";
SetErrorCode(OK);
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
+// License as published by the Free Software Foundation; either
// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//=======================================================================
//function : GetID
//purpose :
-//=======================================================================
+//=======================================================================
const Standard_GUID& GEOMImpl_RotateDriver::GetID()
{
static Standard_GUID aRotateDriver("FF1BBB56-5D14-4df2-980B-3A668264EA16");
- return aRotateDriver;
+ return aRotateDriver;
}
//=======================================================================
//function : GEOMImpl_RotateDriver
-//purpose :
+//purpose :
//=======================================================================
-GEOMImpl_RotateDriver::GEOMImpl_RotateDriver()
+GEOMImpl_RotateDriver::GEOMImpl_RotateDriver()
{
}
//=======================================================================
//function : Execute
//purpose :
-//=======================================================================
+//=======================================================================
Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
{
- if(Label().IsNull()) return 0;
+ if (Label().IsNull()) return 0;
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
- if(aFunction.IsNull()) return 0;
+ if (aFunction.IsNull()) return 0;
GEOMImpl_IRotate RI(aFunction);
gp_Trsf aTrsf;
gp_Pnt aCP, aP1, aP2;
Standard_Integer aType = aFunction->GetType();
Handle(GEOM_Function) anOriginalFunction = RI.GetOriginal();
- if(anOriginalFunction.IsNull()) return 0;
+ if (anOriginalFunction.IsNull()) return 0;
TopoDS_Shape aShape, anOriginal = anOriginalFunction->GetValue();
- if(anOriginal.IsNull()) return 0;
+ if (anOriginal.IsNull()) return 0;
- if(aType == ROTATE || aType == ROTATE_COPY) {
+ if (aType == ROTATE || aType == ROTATE_COPY) {
Handle(GEOM_Function) anAxis = RI.GetAxis();
- if(anAxis.IsNull()) return 0;
+ if (anAxis.IsNull()) return 0;
TopoDS_Shape A = anAxis->GetValue();
- if(A.IsNull() || A.ShapeType() != TopAbs_EDGE) return 0;
+ if (A.IsNull() || A.ShapeType() != TopAbs_EDGE) return 0;
TopoDS_Edge anEdge = TopoDS::Edge(A);
gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(anEdge));
gp_Ax1 anAx1(aP1, aDir);
Standard_Real anAngle = RI.GetAngle();
aTrsf.SetRotation(anAx1, anAngle);
-
- BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False);
- aShape = aTransformation.Shape();
+
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // 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) aPoint1 = RI.GetPoint1();
Handle(GEOM_Function) aPoint2 = RI.GetPoint2();
gp_Ax1 anAx1(aCP, aDir);
Standard_Real anAngle = aVec1.Angle(aVec2);
aTrsf.SetRotation(anAx1, anAngle);
- BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False);
- aShape = aTransformation.Shape();
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // 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
Handle(GEOM_Function) anAxis = RI.GetAxis();
if(anAxis.IsNull()) return 0;
gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(anEdge));
gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(anEdge));
- gp_Dir D(gp_Vec(aP1, aP2)) ;
+ gp_Dir D(gp_Vec(aP1, aP2));
- gp_Ax1 AX1(aP1, D) ;
+ gp_Ax1 AX1(aP1, D);
Standard_Integer nbtimes = RI.GetNbIter1();
- Standard_Real angle = 360.0/nbtimes ;
+ Standard_Real angle = 360.0/nbtimes;
TopoDS_Compound aCompound;
BRep_Builder B;
B.MakeCompound( aCompound );
-
+
+ TopLoc_Location aLocOrig = anOriginal.Location();
+ gp_Trsf aTrsfOrig = aLocOrig.Transformation();
+
for (int i = 0; i < nbtimes; i++ ) {
- aTrsf.SetRotation(AX1, i*angle*PI180) ;
- BRepBuilderAPI_Transform myBRepTransformation(anOriginal, aTrsf, Standard_False) ;
- B.Add( aCompound, myBRepTransformation.Shape() );
+ aTrsf.SetRotation(AX1, i*angle*PI180);
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // 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;
}
- else if(aType == ROTATE_2D) {
- Standard_Real DX, DY, DZ ;
+ else if (aType == ROTATE_2D) {
+ Standard_Real DX, DY, DZ;
//Get direction
Handle(GEOM_Function) anAxis = RI.GetAxis();
TopoDS_Edge anEdge = TopoDS::Edge(A);
gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(anEdge));
gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(anEdge));
- gp_Dir D(gp_Vec(aP1, aP2)) ;
+ gp_Dir D(gp_Vec(aP1, aP2));
+
+ gp_Ax1 AX1(aP1, D);
- gp_Ax1 AX1(aP1, D) ;
+ gp_Trsf aTrsf1;
+ gp_Trsf aTrsf2;
+ gp_Pnt P1;
+ GProp_GProps System;
- gp_Trsf theTransformation1 ;
- gp_Trsf theTransformation2 ;
- gp_Pnt P1 ;
- GProp_GProps System ;
-
- if ( anOriginal.ShapeType() == TopAbs_VERTEX) {
+ if (anOriginal.ShapeType() == TopAbs_VERTEX) {
P1 = BRep_Tool::Pnt(TopoDS::Vertex( anOriginal ));
- }
+ }
else if ( anOriginal.ShapeType() == TopAbs_EDGE || anOriginal.ShapeType() == TopAbs_WIRE ) {
BRepGProp::LinearProperties(anOriginal, System);
- P1 = System.CentreOfMass() ;
+ P1 = System.CentreOfMass();
}
else if ( anOriginal.ShapeType() == TopAbs_FACE || anOriginal.ShapeType() == TopAbs_SHELL ) {
BRepGProp::SurfaceProperties(anOriginal, System);
- P1 = System.CentreOfMass() ;
+ P1 = System.CentreOfMass();
}
else {
BRepGProp::VolumeProperties(anOriginal, System);
- P1 = System.CentreOfMass() ;
+ P1 = System.CentreOfMass();
}
-
+
Handle(Geom_Line) Line = new Geom_Line(AX1);
- GeomAPI_ProjectPointOnCurve aPrjTool( P1, Line ) ;
+ GeomAPI_ProjectPointOnCurve aPrjTool( P1, Line );
gp_Pnt P2 = aPrjTool.NearestPoint();
-
+
if ( P1.IsEqual(P2, Precision::Confusion() ) ) return 0;
-
- gp_Vec Vec(P1.X()-P2.X(), P1.Y()-P2.Y(), P1.Z()-P2.Z()) ;
+
+ gp_Vec Vec(P1.X()-P2.X(), P1.Y()-P2.Y(), P1.Z()-P2.Z());
Vec.Normalize();
-
+
Standard_Integer nbtimes2 = RI.GetNbIter2();
Standard_Integer nbtimes1 = RI.GetNbIter1();
Standard_Real step = RI.GetStep();
Standard_Real ang = RI.GetAngle();
- gp_Vec myVec ;
+ TopLoc_Location aLocOrig = anOriginal.Location();
+ gp_Trsf aTrsfOrig = aLocOrig.Transformation();
+
+ gp_Vec aVec;
TopoDS_Compound aCompound;
BRep_Builder B;
B.MakeCompound( aCompound );
for (int i = 0; i < nbtimes2; i++ ) {
for (int j = 0; j < nbtimes1; j++ ) {
- DX = i * step * Vec.X() ;
- DY = i * step * Vec.Y() ;
- DZ = i * step * Vec.Z() ;
- myVec.SetCoord( DX, DY, DZ ) ;
- theTransformation1.SetTranslation(myVec) ;
- theTransformation2.SetRotation(AX1, j*ang*PI180) ;
- BRepBuilderAPI_Transform myBRepTransformation1(anOriginal, theTransformation1, Standard_False) ;
- BRepBuilderAPI_Transform myBRepTransformation2(myBRepTransformation1.Shape(), theTransformation2, Standard_False) ;
- B.Add( aCompound, myBRepTransformation2.Shape() );
+ DX = i * step * Vec.X();
+ DY = i * step * Vec.Y();
+ DZ = i * step * Vec.Z();
+ aVec.SetCoord( DX, DY, DZ );
+ aTrsf1.SetTranslation(aVec);
+ aTrsf2.SetRotation(AX1, j*ang*PI180);
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // in shape and need a great time to process
+ //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;
-
}
else return 0;
-
-
if (aShape.IsNull()) return 0;
aFunction->SetValue(aShape);
- log.SetTouched(Label());
+ log.SetTouched(Label());
return 1;
}
//=======================================================================
//function : GEOMImpl_RotateDriver_Type_
//purpose :
-//=======================================================================
+//=======================================================================
Standard_EXPORT Handle_Standard_Type& GEOMImpl_RotateDriver_Type_()
{
-
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
- if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
+ if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
-
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_RotateDriver",
//=======================================================================
//function : DownCast
//purpose :
-//=======================================================================
-
+//=======================================================================
const Handle(GEOMImpl_RotateDriver) Handle(GEOMImpl_RotateDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(GEOMImpl_RotateDriver) _anOtherObject;
}
}
- return _anOtherObject ;
+ return _anOtherObject;
}
-
-
aFW->Load(aWire);
aFW->FixReorder();
- if (aFW->StatusReorder(ShapeExtend_FAIL1)) {
+ if (aFW->StatusReorder(ShapeExtend_FAIL1)) {
Standard_ConstructionError::Raise("Wire construction failed: several loops detected");
} else if (aFW->StatusReorder(ShapeExtend_FAIL)) {
Standard_ConstructionError::Raise("Wire construction failed");
Standard_ConstructionError::Raise("Wire construction failed: some gaps detected");
} 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();
}
}
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
+// License as published by the Free Software Foundation; either
// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//=======================================================================
//function : GetID
//purpose :
-//=======================================================================
+//=======================================================================
const Standard_GUID& GEOMImpl_TranslateDriver::GetID()
{
static Standard_GUID aTranslateDriver("FF1BBB03-5D14-4df2-980B-3A668264EA16");
- return aTranslateDriver;
+ return aTranslateDriver;
}
//=======================================================================
//function : GEOMImpl_TranslateDriver
-//purpose :
+//purpose :
//=======================================================================
-GEOMImpl_TranslateDriver::GEOMImpl_TranslateDriver()
+GEOMImpl_TranslateDriver::GEOMImpl_TranslateDriver()
{
}
//=======================================================================
//function : Execute
//purpose :
-//=======================================================================
+//=======================================================================
Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
{
- if(Label().IsNull()) return 0;
+ if (Label().IsNull()) return 0;
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
- if(aFunction.IsNull()) return 0;
+ if (aFunction.IsNull()) return 0;
GEOMImpl_ITranslate TI(aFunction);
gp_Trsf aTrsf;
Standard_Integer aType = aFunction->GetType();
Handle(GEOM_Function) anOriginalFunction = TI.GetOriginal();
- if(anOriginalFunction.IsNull()) return 0;
+ if (anOriginalFunction.IsNull()) return 0;
TopoDS_Shape aShape, anOriginal = anOriginalFunction->GetValue();
- if(anOriginal.IsNull()) return 0;
+ if (anOriginal.IsNull()) return 0;
- if(aType == TRANSLATE_TWO_POINTS || aType == TRANSLATE_TWO_POINTS_COPY) {
+ if (aType == TRANSLATE_TWO_POINTS || aType == TRANSLATE_TWO_POINTS_COPY) {
Handle(GEOM_Function) aPoint1 = TI.GetPoint1();
Handle(GEOM_Function) aPoint2 = TI.GetPoint2();
if(aPoint1.IsNull() || aPoint2.IsNull()) return 0;
aP2 = BRep_Tool::Pnt(TopoDS::Vertex(aV2));
aTrsf.SetTranslation(aP1, aP2);
- BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False);
- aShape = aTransformation.Shape();
-
- } else if(aType == TRANSLATE_VECTOR || aType == TRANSLATE_VECTOR_COPY) {
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // 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_VECTOR || aType == TRANSLATE_VECTOR_COPY) {
Handle(GEOM_Function) aVector = TI.GetVector();
if(aVector.IsNull()) return 0;
TopoDS_Shape aV = aVector->GetValue();
aP2 = BRep_Tool::Pnt(TopExp::LastVertex(anEdge));
aTrsf.SetTranslation(aP1, aP2);
- BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False);
- aShape = aTransformation.Shape();
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // 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) {
- gp_Vec aVec(TI.GetDX(), TI.GetDY(), TI.GetDZ());
+ else if (aType == TRANSLATE_XYZ || aType == TRANSLATE_XYZ_COPY) {
+ gp_Vec aVec (TI.GetDX(), TI.GetDY(), TI.GetDZ());
aTrsf.SetTranslation(aVec);
- BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False);
- aShape = aTransformation.Shape();
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // 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_Integer nbtimes = TI.GetNbIter1();
- gp_Vec myVec ;
+ gp_Vec aVec;
TopoDS_Compound aCompound;
BRep_Builder B;
B.MakeCompound( aCompound );
gp_Vec Vec(BRep_Tool::Pnt(TopExp::FirstVertex(anEdge)), BRep_Tool::Pnt(TopExp::LastVertex(anEdge)));
Vec.Normalize();
- for (int i = 0; i < nbtimes; i++ ) {
- DX = i * step * Vec.X() ;
- DY = i * step * Vec.Y() ;
- DZ = i * step * Vec.Z() ;
- myVec.SetCoord( DX, DY, DZ ) ;
- aTrsf.SetTranslation(myVec) ;
- BRepBuilderAPI_Transform aTransformation(anOriginal, aTrsf, Standard_False) ;
- B.Add(aCompound , aTransformation.Shape() );
+ TopLoc_Location aLocOrig = anOriginal.Location();
+ gp_Trsf aTrsfOrig = aLocOrig.Transformation();
+
+ for (int i = 0; i < nbtimes; i++) {
+ DX = i * step * Vec.X();
+ DY = i * step * Vec.Y();
+ DZ = i * step * Vec.Z();
+ aVec.SetCoord( DX, DY, DZ );
+ aTrsf.SetTranslation(aVec);
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // 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_Real DX, DY, DZ, step1 = TI.GetStep1(), step2 = TI.GetStep2();
- gp_Vec myVec ;
+ gp_Vec aVec;
Handle(GEOM_Function) aVector = TI.GetVector();
if(aVector.IsNull()) return 0;
TopoDS_Shape aV = aVector->GetValue();
TopoDS_Compound aCompound;
BRep_Builder B;
B.MakeCompound( aCompound );
-
- for (int i = 0; i < nbtimes1; i++ ) {
- for (int j = 0; j < nbtimes2; j++ ) {
- DX = i * step1 * Vec1.X() + j * step2 * Vec2.X() ;
- DY = i * step1 * Vec1.Y() + j * step2 * Vec2.Y() ;
- DZ = i * step1 * Vec1.Z() + j * step2 * Vec2.Z() ;
- myVec.SetCoord( DX, DY, DZ ) ;
- aTrsf.SetTranslation(myVec) ;
- BRepBuilderAPI_Transform myBRepTransformation(anOriginal, aTrsf, Standard_False) ;
- B.Add(aCompound , myBRepTransformation.Shape() );
+
+ TopLoc_Location aLocOrig = anOriginal.Location();
+ gp_Trsf aTrsfOrig = aLocOrig.Transformation();
+
+ for (int i = 0; i < nbtimes1; i++) {
+ for (int j = 0; j < nbtimes2; j++) {
+ DX = i * step1 * Vec1.X() + j * step2 * Vec2.X();
+ DY = i * step1 * Vec1.Y() + j * step2 * Vec2.Y();
+ DZ = i * step1 * Vec1.Z() + j * step2 * Vec2.Z();
+ aVec.SetCoord( DX, DY, DZ );
+ aTrsf.SetTranslation(aVec);
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // 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;
}
else return 0;
-
if (aShape.IsNull()) return 0;
aFunction->SetValue(aShape);
- log.SetTouched(Label());
+ log.SetTouched(Label());
return 1;
}
//=======================================================================
//function : GEOMImpl_TranslateDriver_Type_
//purpose :
-//=======================================================================
+//=======================================================================
Standard_EXPORT Handle_Standard_Type& GEOMImpl_TranslateDriver_Type_()
{
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
- if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
+ if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
-
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_TranslateDriver",
//=======================================================================
//function : DownCast
//purpose :
-//=======================================================================
-
+//=======================================================================
const Handle(GEOMImpl_TranslateDriver) Handle(GEOMImpl_TranslateDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(GEOMImpl_TranslateDriver) _anOtherObject;
}
}
- return _anOtherObject ;
+ return _anOtherObject;
}
-
-
//============================================================================
void GEOM_Gen_i::register_name(char * name)
{
- GEOM::GEOM_Gen_ptr g = GEOM::GEOM_Gen::_narrow(_this());
- name_service->Register(g, CORBA::string_dup(name));
+ GEOM::GEOM_Gen_var g = _this();
+ name_service->Register(g, name);
}
//============================================================================
GEOM::GEOM_Gen_ptr engine = _this();
+ //transfer reference on engine
GEOM_IBasicOperations_i* aServant =
new GEOM_IBasicOperations_i(_poa, engine, _impl->GetIBasicOperations(theStudyID));
const char * 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();
}
}
if (thePnt == NULL) return aGEOMObject._retn();
//Get the reference point
+ CORBA::String_var entry=thePnt->GetEntry();
Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
- (thePnt->GetStudyID(), thePnt->GetEntry());
+ (thePnt->GetStudyID(), entry);
if (aPnt.IsNull()) return aGEOMObject._retn();
CORBA::Long theMaxDeg,
CORBA::Double theTol2D,
CORBA::Double theTol3D,
- CORBA::Long theNbIter)
+ CORBA::Long theNbIter,
+ CORBA::Boolean theApprox)
{
GEOM::GEOM_Object_var aGEOMObject;
if (aShape.IsNull()) return aGEOMObject._retn();
//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())
return aGEOMObject._retn();
GEOM::GEOM_Object_ptr theAxis,
CORBA::Double theAngle);
- GEOM::GEOM_Object_ptr MakeFilling(GEOM::GEOM_Object_ptr theShape, CORBA::Long theMinDeg, CORBA::Long theMaxDeg, CORBA::Double theTol2D, CORBA::Double theTol3D, CORBA::Long theNbIter);
+ 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,
CORBA::Boolean theModeSolid,
if (theShape1 == NULL || theShape2 == NULL) return aGEOMObject._retn();
//Get the reference shapes
+ CORBA::String_var entry=theShape1->GetEntry();
Handle(GEOM_Object) aSh1 = GetOperations()->GetEngine()->GetObject
- (theShape1->GetStudyID(), theShape1->GetEntry());
+ (theShape1->GetStudyID(), entry);
+ entry=theShape2->GetEntry();
Handle(GEOM_Object) aSh2 = GetOperations()->GetEngine()->GetObject
- (theShape2->GetStudyID(), theShape2->GetEntry());
+ (theShape2->GetStudyID(), entry);
if (aSh1.IsNull() || aSh2.IsNull()) return aGEOMObject._retn();
//=============================================================================
/*!
- * AboutOperation
+ * AbortOperation
*/
//=============================================================================
void GEOM_IOperations_i::AbortOperation()
if(theObject.IsNull()) return NULL;
TCollection_AsciiString 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();
}
private:
::GEOM_IOperations* _impl;
- GEOM::GEOM_Gen_ptr _engine;
+ GEOM::GEOM_Gen_var _engine;
};
#endif
//=============================================================================
GEOM_Object_i::~GEOM_Object_i()
-{}
+{
+ GEOM_Engine::GetEngine()->RemoveObject(_impl);
+}
//=============================================================================
private:
- GEOM::GEOM_Gen_ptr _engine;
+ GEOM::GEOM_Gen_var _engine;
Handle(GEOM_Object) _impl;
TopoDS_Shape _geom;
};
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;
}
//============================================================================
void GEOM_Superv_i::register_name(char * name)
{
- GEOM::GEOM_Superv_ptr g = GEOM::GEOM_Superv::_narrow(POA_GEOM::GEOM_Superv::_this());
- name_service->Register(g, strdup(name));
+ GEOM::GEOM_Superv_var g = _this();
+ name_service->Register(g, name);
}
//=============================================================================
//=============================================================================
void GEOM_Superv_i::setGeomEngine()
{
+ if ( !CORBA::is_nil(myGeomEngine) )
+ return;
// get GEOM_Gen engine
+ /*
SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service );
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);
}
MESSAGE("GEOM_Superv_i::MakeSphepe");
getBasicOp();
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" );
return anObj;
}
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilling (GEOM::GEOM_Object_ptr theShape,
CORBA::Long theMinDeg, CORBA::Long theMaxDeg,
CORBA::Double theTol2D, CORBA::Double theTol3D,
- CORBA::Long theNbIter)
+ CORBA::Long theNbIter, CORBA::Boolean theApprox)
{
beginService( " GEOM_Superv_i::MakeFilling" );
MESSAGE("GEOM_Superv_i::MakeFilling");
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" );
return anObj;
}
const char * 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() ;
}
}
GEOM::GEOM_Object_ptr MakeFilling (GEOM::GEOM_Object_ptr theShape,
CORBA::Long theMinDeg, CORBA::Long theMaxDeg,
CORBA::Double theTol2D, CORBA::Double theTol3D,
- CORBA::Long theNbIter);
+ CORBA::Long theNbIter, CORBA::Boolean theApprox);
GEOM::GEOM_Object_ptr MakeThruSections(const GEOM::ListOfGO& theSeqSections,
CORBA::Boolean theModeSolid,
private:
SALOME_NamingService * name_service;
- GEOM::GEOM_Gen_ptr myGeomEngine;
+ GEOM::GEOM_Gen_var myGeomEngine;
CORBA::Long myStudyID;
CORBA::Long myLastStudyID; // mkr : PAL10770
PortableServer::POA_var myPOA;
- GEOM::GEOM_IBasicOperations_ptr myBasicOp;
- GEOM::GEOM_I3DPrimOperations_ptr my3DPrimOp;
- GEOM::GEOM_IBooleanOperations_ptr myBoolOp;
- GEOM::GEOM_IInsertOperations_ptr myInsOp;
- GEOM::GEOM_ITransformOperations_ptr myTransfOp;
- GEOM::GEOM_IShapesOperations_ptr myShapesOp;
- GEOM::GEOM_IBlocksOperations_ptr myBlocksOp;
- GEOM::GEOM_ICurvesOperations_ptr myCurvesOp;
- GEOM::GEOM_ILocalOperations_ptr myLocalOp;
- GEOM::GEOM_IGroupOperations_ptr myGroupOp;
+ GEOM::GEOM_IBasicOperations_var myBasicOp;
+ GEOM::GEOM_I3DPrimOperations_var my3DPrimOp;
+ GEOM::GEOM_IBooleanOperations_var myBoolOp;
+ GEOM::GEOM_IInsertOperations_var myInsOp;
+ GEOM::GEOM_ITransformOperations_var myTransfOp;
+ GEOM::GEOM_IShapesOperations_var myShapesOp;
+ GEOM::GEOM_IBlocksOperations_var myBlocksOp;
+ GEOM::GEOM_ICurvesOperations_var myCurvesOp;
+ GEOM::GEOM_ILocalOperations_var myLocalOp;
+ GEOM::GEOM_IGroupOperations_var myGroupOp;
};
print "MakeCopy : ", InsertOp.GetErrorCode()
return anObj
-def MakeFilling(aShape,mindeg,maxdeg,tol2d,tol3d,nbiter):
- anObj = PrimOp.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,isApprox)
if PrimOp.IsDone() == 0:
print "MakeFilling : ", PrimOp.GetErrorCode()
return anObj
# @return New GEOM_Object, containing the created filling surface.
#
# Example: see GEOM_TestAll.py
- def MakeFilling(self,theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter):
- anObj = self.PrimOp.MakeFilling(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, isApprox)
RaiseIfFailed("MakeFilling", self.PrimOp)
return anObj
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
- GroupPoints = new DlgRef_1Sel5Spin( centralWidget() );
+ GroupPoints = new DlgRef_1Sel5Spin1Check( centralWidget() );
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupPoints->TextLabel1->setText( tr( "GEOM_FILLING_COMPOUND" ) );
GroupPoints->TextLabel2->setText( tr( "GEOM_FILLING_MIN_DEG" ) );
GroupPoints->TextLabel4->setText( tr( "GEOM_FILLING_NB_ITER" ) );
GroupPoints->TextLabel5->setText( tr( "GEOM_FILLING_MAX_DEG" ) );
GroupPoints->TextLabel6->setText( tr( "GEOM_FILLING_TOL_3D" ) );
+ GroupPoints->CheckBox1->setText( tr( "GEOM_FILLING_APPROX" ) );
GroupPoints->PushButton1->setIcon( image1 );
GroupPoints->LineEdit1->setReadOnly( true );
layout->addWidget( GroupPoints );
/***************************************************************/
- setHelpFileName( "creaet_filling_page.html" );
+ setHelpFileName( "create_filling_page.html" );
/* Initialisations */
Init();
myTol3D = 0.0001;
myTol2D = 0.0001;
myNbIter = 5;
+ myIsApprox = false;
myOkCompound = false;
globalSelection( GEOM_COMPOUND );
connect( GroupPoints->SpinBox4, 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 ->>
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox1, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox2, SLOT( SetStep( double ) ) );
displayPreview();
}
+//=================================================================================
+// function : ApproxChanged()
+// purpose :
+//=================================================================================
+void GenerationGUI_FillingDlg::ApproxChanged()
+{
+ myIsApprox = GroupPoints->CheckBox1->isChecked();
+ displayPreview();
+}
+
//=================================================================================
// function : createOperation
// purpose :
GEOM::GEOM_Object_var anObj;
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation() )->MakeFilling(
- myCompound, myMinDeg, myMaxDeg, myTol2D, myTol3D, myNbIter );
+ myCompound, myMinDeg, myMaxDeg, myTol2D, myTol3D, myNbIter, myIsApprox );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
#include <GEOMBase_Skeleton.h>
-class DlgRef_1Sel5Spin;
+class DlgRef_1Sel5Spin1Check;
//=================================================================================
// class : GenerationGUI_FillingDlg
Standard_Real myTol3D;
Standard_Real myTol2D;
Standard_Integer myNbIter;
+ bool myIsApprox;
bool myOkCompound; /* to check when curv. compound is defined */
- DlgRef_1Sel5Spin* GroupPoints;
+ DlgRef_1Sel5Spin1Check* GroupPoints;
private slots:
void ClickOnOk();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox( double );
+ void ApproxChanged();
};
#endif // GENERATIONGUI_FILLINGDLG_H
//=================================================================================
void RepairGUI_GlueDlg::SelectionIntoArgument()
{
- if ( mySubShapesChk->isChecked() && getConstructorId() == 1 )
+ if ( mySubShapesChk->isChecked() && getConstructorId() == 1 ) {
+ updateButtonState();
return;
+ }
erasePreview();
myEditCurrentArgument->setText( "" );
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" ) );
updateButtonState();
activateSelection();
globalSelection( GEOM_ALLSHAPES );
else {
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 );
- }
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ) ;
+ }
}
-
updateViewer();
}
}
else
{
+ bool wasSelected = false;
+ SALOME_ListIteratorOfListIO it ( selectedIO() );
+ if (it.More() > 0)
+ wasSelected = true;
bool wasDetected = myTmpObjs.size() ? true : false;
- buttonOk()->setEnabled( hasMainObj && wasDetected );
- buttonApply()->setEnabled( hasMainObj && wasDetected );
+ buttonOk()->setEnabled( hasMainObj && wasDetected && wasSelected );
+ buttonApply()->setEnabled( hasMainObj && wasDetected && wasSelected );
mySubShapesChk->setEnabled( hasMainObj && wasDetected );
myDetectBtn->setEnabled( hasMainObj );
if ( !hasMainObj || !wasDetected )