mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-12 01:30:36 +05:00
0022765: [EDF] Improvement of local selection mechanism
This commit is contained in:
parent
33eddb946d
commit
5f650dfab8
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 17 KiB |
@ -8,7 +8,15 @@ This operation returns the angle in degrees between two lines or linear edges.
|
|||||||
|
|
||||||
If both objects are <b>vectors</b>, the angle is computed in accordance with their orientations, otherwise the minimum angle is computed.
|
If both objects are <b>vectors</b>, the angle is computed in accordance with their orientations, otherwise the minimum angle is computed.
|
||||||
|
|
||||||
\n <b>TUI Command:</b> <em>geompy.GetAngle(shape1, shape2),</em> where
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
|
<b>TUI Command:</b> <em>geompy.GetAngle(shape1, shape2),</em> where
|
||||||
Shape1 and Shape2 are shapes between which the angle is computed.
|
Shape1 and Shape2 are shapes between which the angle is computed.
|
||||||
Another TUI command is <em>geompy.GetAngleRadians(shape1,shape2),</em>
|
Another TUI command is <em>geompy.GetAngleRadians(shape1,shape2),</em>
|
||||||
which returns the value of angle in radians.
|
which returns the value of angle in radians.
|
||||||
|
@ -7,7 +7,15 @@ geometrical object.
|
|||||||
|
|
||||||
\image html neo-basicprop.png
|
\image html neo-basicprop.png
|
||||||
|
|
||||||
\n<b>TUI Command:</b> <em>geompy.BasicProperties(Shape),</em> where
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
|
<b>TUI Command:</b> <em>geompy.BasicProperties(Shape),</em> where
|
||||||
\em Shape is a shape whose properties are inquired.
|
\em Shape is a shape whose properties are inquired.
|
||||||
|
|
||||||
See also a \ref tui_basic_properties_page "TUI example".
|
See also a \ref tui_basic_properties_page "TUI example".
|
||||||
|
@ -10,7 +10,15 @@ The coordinates of two corners of its bounding box are shown in the table.
|
|||||||
|
|
||||||
Press \b Apply or <b>Apply and Close</b> button to publish the bounding \b Box in the study.
|
Press \b Apply or <b>Apply and Close</b> button to publish the bounding \b Box in the study.
|
||||||
|
|
||||||
\n <b>TUI Commands:</b> <em>[Xmin,Xmax, Ymin,Ymax, Zmin,Zmax] = geompy.BoundingBox(Shape, precise)</em>,
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
|
<b>TUI Commands:</b> <em>[Xmin,Xmax, Ymin,Ymax, Zmin,Zmax] = geompy.BoundingBox(Shape, precise)</em>,
|
||||||
<em>BBox = geompy.MakeBoundingBox(Shape, precise)</em>, where \em Shape
|
<em>BBox = geompy.MakeBoundingBox(Shape, precise)</em>, where \em Shape
|
||||||
is the shape for which the bounding box is computed. \em precise TRUE
|
is the shape for which the bounding box is computed. \em precise TRUE
|
||||||
for precise computation; FALSE for fast one. Default value is False.
|
for precise computation; FALSE for fast one. Default value is False.
|
||||||
|
@ -9,7 +9,15 @@ the selected geometrical object.
|
|||||||
|
|
||||||
Press \b Apply or <b>Apply and Close</b> button to publish the \b Point in the study.
|
Press \b Apply or <b>Apply and Close</b> button to publish the \b Point in the study.
|
||||||
|
|
||||||
\n <b>TUI Command:</b> <em> geompy.MakeCDG(Shape),</em> where \em Shape is
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
|
<b>TUI Command:</b> <em> geompy.MakeCDG(Shape),</em> where \em Shape is
|
||||||
the shape for which a center of gravity is computed.
|
the shape for which a center of gravity is computed.
|
||||||
|
|
||||||
See also a \ref tui_center_of_mass_page "TUI example".
|
See also a \ref tui_center_of_mass_page "TUI example".
|
||||||
|
@ -53,8 +53,8 @@ projected on the given edge to produce the resulting point.
|
|||||||
projected point.
|
projected point.
|
||||||
\image html point3_2.png
|
\image html point3_2.png
|
||||||
|
|
||||||
\n Fourthly, we can define a point by intersection of two \b Lines or \b Wires (or a Wire and a Line).
|
\n Fourthly, we can define a point by intersection of two \b Lines or \b Wires (or a Wire and a Line).
|
||||||
If they intersect only once, a point will be created. If there are several intersections, a compound of points will be created. The type of the selected object (Line or Wire) can be changed in the popup menu, after clicking the corresponding selection button.
|
If they intersect only once, a point will be created. If there are several intersections, a compound of points will be created.
|
||||||
\n <b>TUI Command:</b> <em>geompy.MakePointOnLinesIntersection(myLine1,myWire1).</em>
|
\n <b>TUI Command:</b> <em>geompy.MakePointOnLinesIntersection(myLine1,myWire1).</em>
|
||||||
\n <b>Arguments:</b> Name + 2 1D objects
|
\n <b>Arguments:</b> Name + 2 1D objects
|
||||||
|
|
||||||
@ -75,6 +75,14 @@ The position of the point on it can be defined in one of two ways:
|
|||||||
|
|
||||||
\image html point5_2.png
|
\image html point5_2.png
|
||||||
|
|
||||||
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
<b>Example:</b>
|
<b>Example:</b>
|
||||||
|
|
||||||
\image html points.png "Points by edge and parameter and by coordinates"
|
\image html points.png "Points by edge and parameter and by coordinates"
|
||||||
|
@ -10,7 +10,15 @@ The table displays:
|
|||||||
- 3*3 matrix of its own moments of inertia (in rows <b> 1:1, 2:1</b> and <b>3:1</b>) and
|
- 3*3 matrix of its own moments of inertia (in rows <b> 1:1, 2:1</b> and <b>3:1</b>) and
|
||||||
- the relative moments of inertia (in row <b>IX & IY & IZ</b>)
|
- the relative moments of inertia (in row <b>IX & IY & IZ</b>)
|
||||||
|
|
||||||
\n <b>TUI Command:</b> <em>geompy.Inertia(Shape),</em> where \em Shape is
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
|
<b>TUI Command:</b> <em>geompy.Inertia(Shape),</em> where \em Shape is
|
||||||
a shape for which the own matrix of inertia and the relative moments of inertia are
|
a shape for which the own matrix of inertia and the relative moments of inertia are
|
||||||
returned.
|
returned.
|
||||||
|
|
||||||
|
@ -17,11 +17,20 @@ Select one of the found solutions in the \b Solution list to display it in the V
|
|||||||
Press \b Apply or <b>Apply and Close</b> button to create a set of closest
|
Press \b Apply or <b>Apply and Close</b> button to create a set of closest
|
||||||
points, corresponding to all found solutions.
|
points, corresponding to all found solutions.
|
||||||
|
|
||||||
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
<b>TUI Commands:</b>
|
<b>TUI Commands:</b>
|
||||||
\n<em>aDist = geompy.MinDistance(Shape1, Shape2),</em>
|
- <em>aDist = geompy.MinDistance(Shape1, Shape2),</em>
|
||||||
\n<em>[aDist, DX, DY, DZ] = geompy.MinDistanceComponents(Shape1, Shape2),</em>
|
- <em>[aDist, DX, DY, DZ] = geompy.MinDistanceComponents(Shape1, Shape2),</em>
|
||||||
\n<em>[nbSols, (x11, y11, z11, x21, y21, z21, ...)] = geompy.ClosestPoints(Shape1, Shape2),</em>
|
- <em>[nbSols, (x11, y11, z11, x21, y21, z21, ...)] = geompy.ClosestPoints(Shape1, Shape2),</em>
|
||||||
\n where \em Shape1 and \em Shape2 are the shapes, between which the minimal
|
.
|
||||||
|
where \em Shape1 and \em Shape2 are the shapes, between which the minimal
|
||||||
distance is computed.
|
distance is computed.
|
||||||
|
|
||||||
See also a \ref tui_min_distance_page "TUI example".
|
See also a \ref tui_min_distance_page "TUI example".
|
||||||
|
@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
\page projection_operation_page Projection
|
\page projection_operation_page Projection
|
||||||
|
|
||||||
\n To produce a <b>Projection</b> in the <b>Main Menu</b> select
|
To produce a <b>Projection</b> in the <b>Main Menu</b> select
|
||||||
<b>Operations - > Transformation - > Projection</b>
|
<b>Operations - > Transformation - > Projection</b>
|
||||||
|
|
||||||
\n This operation makes normal projection of one shape to another.
|
This operation makes normal projection of one shape to another.
|
||||||
\n There are 3 types of projection different by types of operands.
|
|
||||||
|
There are 3 types of projection different by types of operands.
|
||||||
|
|
||||||
Firstly, you can project <b>Source vertex, edge or wire</b> on a given <b>Target face</b>.
|
Firstly, you can project <b>Source vertex, edge or wire</b> on a given <b>Target face</b>.
|
||||||
|
|
||||||
@ -22,14 +23,22 @@ Thirdly, you can project <b>Source vertex</b> on a given <b>Target edge</b>.
|
|||||||
|
|
||||||
\ref restore_presentation_parameters_page "Advanced options".
|
\ref restore_presentation_parameters_page "Advanced options".
|
||||||
|
|
||||||
\n <b>Example:</b>
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
|
<b>Example:</b>
|
||||||
|
|
||||||
\image html projection_preview.png "The curve (in red) and its projection on the cylindric surface"
|
\image html projection_preview.png "The curve (in red) and its projection on the cylindric surface"
|
||||||
|
|
||||||
\n <b>TUI Command:</b> <em>geompy.MakeProjection(Source, Target),</em>
|
<b>TUI Command:</b> <em>geompy.MakeProjection(Source, Target),</em>
|
||||||
where \em Source is a shape which has to be projected, \em Target
|
\n where \em Source is a shape which has to be projected, \em Target
|
||||||
is a shape, on which the \em Source shape will be projected. The \em
|
is a shape, on which the \em Source shape will be projected. The \em
|
||||||
Result will be a \em GEOM_Object.
|
Result will be a \em GEOM_Object.
|
||||||
|
|
||||||
Our <b>TUI Scripts</b> provide you with useful examples of the use of
|
Our <b>TUI Scripts</b> provide you with useful examples of the use of
|
||||||
\ref tui_projection "Transformation Operations".
|
\ref tui_projection "Transformation Operations".
|
||||||
|
@ -16,6 +16,14 @@ In this dialog:
|
|||||||
- Activate \ref restore_presentation_parameters_page "Advanced options" if required.
|
- Activate \ref restore_presentation_parameters_page "Advanced options" if required.
|
||||||
- Press "Apply" or "Apply & Close" button to get the result (VERTEX, EDGE, WIRE or COMPOUND).
|
- Press "Apply" or "Apply & Close" button to get the result (VERTEX, EDGE, WIRE or COMPOUND).
|
||||||
|
|
||||||
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
This operation can be performed using a <b>TUI Command:</b>
|
This operation can be performed using a <b>TUI Command:</b>
|
||||||
|
|
||||||
<em>geompy.MakeSection(s1, s2, checkSelfInte)</em>
|
<em>geompy.MakeSection(s1, s2, checkSelfInte)</em>
|
||||||
|
@ -9,7 +9,15 @@ geometrical object.
|
|||||||
|
|
||||||
The table displays \b Min and \b Max tolerance values for \b Face, \b Edge and \b Vertex tolerance.
|
The table displays \b Min and \b Max tolerance values for \b Face, \b Edge and \b Vertex tolerance.
|
||||||
|
|
||||||
\n <b>TUI Command:</b> <em>geompy.Tolerance(Shape),</em> where \em Shape
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
|
<b>TUI Command:</b> <em>geompy.Tolerance(Shape),</em> where \em Shape
|
||||||
is a shape for which minimal and maximal tolerances are returned.
|
is a shape for which minimal and maximal tolerances are returned.
|
||||||
|
|
||||||
See also a \ref tui_tolerance_page "TUI example".
|
See also a \ref tui_tolerance_page "TUI example".
|
||||||
|
@ -5,22 +5,30 @@
|
|||||||
This operation provides the list of types and quantities of all topological
|
This operation provides the list of types and quantities of all topological
|
||||||
entities, composing the selected geometrical object.
|
entities, composing the selected geometrical object.
|
||||||
|
|
||||||
For the COMPOUND or COMPSOLID shape, additionally the information about
|
For the \em COMPOUND or \em COMPSOLID shape, additionally the information about
|
||||||
"flat" content is shown - a number of "simple" top-level shapes enclosed into the compound.
|
"flat" content is shown - a number of "simple" top-level shapes enclosed into the compound.
|
||||||
|
|
||||||
\image html measures8.png
|
\image html measures8.png
|
||||||
|
|
||||||
\n <b>TUI Command:</b> <em>geompy.WhatIs(Shape),</em> where \em Shape is a
|
\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
|
||||||
|
- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
|
||||||
|
in the viewer to navigate between selectable objects.
|
||||||
|
- Press left mouse button to select an appropriate object to the dialog box.
|
||||||
|
.
|
||||||
|
For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
|
||||||
|
of the GUI module's documentation.
|
||||||
|
|
||||||
|
<b>TUI Command:</b> <em>geompy.WhatIs(Shape),</em> where \em Shape is a
|
||||||
shape from which a description is returned.
|
shape from which a description is returned.
|
||||||
|
|
||||||
\n <b>Kind of Shape</b> field characterizes the
|
<b>Kind of Shape</b> field characterizes the
|
||||||
whole shape. If there is no additional information about the
|
whole shape. If there is no additional information about the
|
||||||
shape, <b>Basic Properties</b> button is disabled, otherwise it
|
shape, <b>Basic Properties</b> button is disabled, otherwise it
|
||||||
provides information about center and dimensions of the shape.
|
provides information about center and dimensions of the shape.
|
||||||
|
|
||||||
\image html measures8a.png
|
\image html measures8a.png
|
||||||
|
|
||||||
\n <b>TUI Command:</b> <em>geompy.KindOfShape(Shape),</em> where \em Shape is a
|
<b>TUI Command:</b> <em>geompy.KindOfShape(Shape),</em> where \em Shape is a
|
||||||
shape from which a description is returned.
|
shape from which a description is returned.
|
||||||
|
|
||||||
See also a \ref tui_whatis_page "TUI example".
|
See also a \ref tui_whatis_page "TUI example".
|
||||||
|
@ -119,6 +119,8 @@ void AdvancedGUI_SmoothingSurfaceDlg::Init()
|
|||||||
|
|
||||||
showOnlyPreviewControl();
|
showOnlyPreviewControl();
|
||||||
|
|
||||||
|
globalSelection();
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||||
//@@ initialize dialog box widgets here @@//
|
//@@ initialize dialog box widgets here @@//
|
||||||
|
|
||||||
// Signal/slot connections
|
// Signal/slot connections
|
||||||
@ -160,7 +162,8 @@ bool AdvancedGUI_SmoothingSurfaceDlg::ClickOnApply()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
initName();
|
initName();
|
||||||
|
globalSelection();
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,6 +174,8 @@ bool AdvancedGUI_SmoothingSurfaceDlg::ClickOnApply()
|
|||||||
void AdvancedGUI_SmoothingSurfaceDlg::ActivateThisDialog()
|
void AdvancedGUI_SmoothingSurfaceDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
globalSelection();
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||||
//displayPreview();
|
//displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,6 +254,16 @@ bool AdvancedGUI_SmoothingSurfaceDlg::execute (ObjectList& objects)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapesToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void AdvancedGUI_SmoothingSurfaceDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < myPoints.count(); i++ )
|
||||||
|
GEOMBase::PublishSubObject( myPoints[i].get() );
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : getNbPoints()
|
// function : getNbPoints()
|
||||||
// purpose : Returns the number of points in myPoints list.
|
// purpose : Returns the number of points in myPoints list.
|
||||||
@ -337,5 +352,7 @@ void AdvancedGUI_SmoothingSurfaceDlg::SetEditCurrentArgument()
|
|||||||
if ( sender() == GroupPoints->PushButton1 )
|
if ( sender() == GroupPoints->PushButton1 )
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
myEditCurrentArgument->setFocus();
|
myEditCurrentArgument->setFocus();
|
||||||
|
globalSelection();
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& );
|
virtual bool execute( ObjectList& );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
@ -68,8 +69,6 @@
|
|||||||
#define SPACING 6
|
#define SPACING 6
|
||||||
#define MARGIN 9
|
#define MARGIN 9
|
||||||
|
|
||||||
enum { SelectEdge, SelectWire };
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : BasicGUI_PointDlg()
|
// class : BasicGUI_PointDlg()
|
||||||
// purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
|
// purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
|
||||||
@ -150,20 +149,15 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren
|
|||||||
GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ"));
|
GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ"));
|
||||||
|
|
||||||
/* popup menu for line intersect buttons */
|
/* popup menu for line intersect buttons */
|
||||||
myBtnPopup = new QMenu(this);
|
|
||||||
QIcon ico_line = QIcon(image6);
|
QIcon ico_line = QIcon(image6);
|
||||||
QIcon ico_wire = QIcon(image7);
|
QIcon ico_wire = QIcon(image7);
|
||||||
myActions[myBtnPopup->addAction(ico_line, tr("GEOM_EDGE"))] = SelectEdge;
|
|
||||||
myActions[myBtnPopup->addAction(ico_wire, tr("GEOM_WIRE"))] = SelectWire;
|
|
||||||
|
|
||||||
GroupLineIntersection = new DlgRef_2Sel(centralWidget());
|
GroupLineIntersection = new DlgRef_2Sel(centralWidget());
|
||||||
GroupLineIntersection->GroupBox1->setTitle(tr("GEOM_LINE_INTERSECTION"));
|
GroupLineIntersection->GroupBox1->setTitle(tr("GEOM_LINE_INTERSECTION"));
|
||||||
GroupLineIntersection->TextLabel1->setText(tr("GEOM_LINE1"));
|
GroupLineIntersection->TextLabel1->setText(tr("GEOM_LINE1"));
|
||||||
GroupLineIntersection->TextLabel2->setText(tr("GEOM_LINE2"));
|
GroupLineIntersection->TextLabel2->setText(tr("GEOM_LINE2"));
|
||||||
GroupLineIntersection->PushButton1->setIcon(image2);
|
GroupLineIntersection->PushButton1->setIcon(image2);
|
||||||
GroupLineIntersection->PushButton1->setMenu(myBtnPopup);
|
|
||||||
GroupLineIntersection->PushButton2->setIcon(image2);
|
GroupLineIntersection->PushButton2->setIcon(image2);
|
||||||
GroupLineIntersection->PushButton2->setMenu(myBtnPopup);
|
|
||||||
GroupLineIntersection->LineEdit2->setEnabled(false);
|
GroupLineIntersection->LineEdit2->setEnabled(false);
|
||||||
|
|
||||||
myCoordGrp = new QGroupBox(tr("GEOM_COORDINATES_RES"), centralWidget());
|
myCoordGrp = new QGroupBox(tr("GEOM_COORDINATES_RES"), centralWidget());
|
||||||
@ -286,9 +280,7 @@ void BasicGUI_PointDlg::Init()
|
|||||||
connect(GroupOnSurface->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(GroupOnSurface->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(GroupLineIntersection->PushButton1, SIGNAL(pressed()), this, SLOT(SetEditCurrentArgument()));
|
connect(GroupLineIntersection->PushButton1, SIGNAL(pressed()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(GroupLineIntersection->PushButton2, SIGNAL(pressed()), this, SLOT(SetEditCurrentArgument()));
|
connect(GroupLineIntersection->PushButton2, SIGNAL(pressed()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
connect(myBtnPopup, SIGNAL(triggered(QAction*)), this, SLOT(onBtnPopup(QAction*)));
|
|
||||||
|
|
||||||
connect(GroupOnCurve->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
connect(GroupOnCurve->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
connect(GroupOnSurface->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
connect(GroupOnSurface->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
connect(GroupOnSurface->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
connect(GroupOnSurface->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
@ -391,8 +383,9 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
|
|||||||
case GEOM_POINT_INTINT:
|
case GEOM_POINT_INTINT:
|
||||||
{
|
{
|
||||||
globalSelection(); // close local contexts, if any
|
globalSelection(); // close local contexts, if any
|
||||||
myNeedType = TopAbs_EDGE;
|
std::list<int> needTypes;
|
||||||
localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
|
needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
|
|
||||||
myEditCurrentArgument = GroupLineIntersection->LineEdit1;
|
myEditCurrentArgument = GroupLineIntersection->LineEdit1;
|
||||||
GroupLineIntersection->LineEdit1->setText("");
|
GroupLineIntersection->LineEdit1->setText("");
|
||||||
@ -500,7 +493,14 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
myLine2.nullify();
|
myLine2.nullify();
|
||||||
}
|
}
|
||||||
|
|
||||||
GEOM::GeomObjPtr aSelectedObject = getSelected(myNeedType);
|
GEOM::GeomObjPtr aSelectedObject;
|
||||||
|
if (id == GEOM_POINT_INTINT) {
|
||||||
|
QList<TopAbs_ShapeEnum> needTypes;
|
||||||
|
needTypes << TopAbs_EDGE, needTypes << TopAbs_WIRE;
|
||||||
|
aSelectedObject= getSelected(needTypes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject= getSelected(myNeedType);
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if (aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull()) {
|
if (aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull()) {
|
||||||
QString aName = GEOMBase::GetName(aSelectedObject.get());
|
QString aName = GEOMBase::GetName(aSelectedObject.get());
|
||||||
@ -535,19 +535,13 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) {
|
if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) {
|
||||||
myLine1 = aSelectedObject;
|
myLine1 = aSelectedObject;
|
||||||
if (myLine1 && !myLine2) {
|
if (myLine1 && !myLine2) {
|
||||||
GroupLineIntersection->PushButton2->setMenu(0);
|
|
||||||
GroupLineIntersection->PushButton2->click();
|
GroupLineIntersection->PushButton2->click();
|
||||||
GroupLineIntersection->PushButton2->setDown(true);
|
|
||||||
GroupLineIntersection->PushButton2->setMenu(myBtnPopup);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) {
|
else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) {
|
||||||
myLine2 = aSelectedObject;
|
myLine2 = aSelectedObject;
|
||||||
if (myLine2 && !myLine1) {
|
if (myLine2 && !myLine1) {
|
||||||
GroupLineIntersection->PushButton1->setMenu(0);
|
|
||||||
GroupLineIntersection->PushButton1->click();
|
GroupLineIntersection->PushButton1->click();
|
||||||
GroupLineIntersection->PushButton1->setDown(true);
|
|
||||||
GroupLineIntersection->PushButton1->setMenu(myBtnPopup);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -992,17 +986,6 @@ void BasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
|
|||||||
QTimer::singleShot(50, this, SLOT(updateSize()));
|
QTimer::singleShot(50, this, SLOT(updateSize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : onBtnPopup()
|
|
||||||
// purpose :
|
|
||||||
//=================================================================================
|
|
||||||
void BasicGUI_PointDlg::onBtnPopup(QAction* a)
|
|
||||||
{
|
|
||||||
globalSelection(); // close local contexts, if any
|
|
||||||
myNeedType = myActions[a] == SelectEdge ? TopAbs_EDGE : TopAbs_WIRE;
|
|
||||||
localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : updateSize
|
// function : updateSize
|
||||||
// purpose : adjust dialog size to minimum
|
// purpose : adjust dialog size to minimum
|
||||||
|
@ -99,7 +99,6 @@ private:
|
|||||||
QGroupBox* myParamGroup;
|
QGroupBox* myParamGroup;
|
||||||
QButtonGroup* myParamCoord;
|
QButtonGroup* myParamCoord;
|
||||||
|
|
||||||
QMenu* myBtnPopup;
|
|
||||||
QMap<QAction*, int> myActions;
|
QMap<QAction*, int> myActions;
|
||||||
|
|
||||||
TopAbs_ShapeEnum myNeedType;
|
TopAbs_ShapeEnum myNeedType;
|
||||||
@ -116,7 +115,6 @@ private slots:
|
|||||||
void SetDoubleSpinBoxStep( double );
|
void SetDoubleSpinBoxStep( double );
|
||||||
void ClickParamCoord( int );
|
void ClickParamCoord( int );
|
||||||
void CheckBoxClicked( int );
|
void CheckBoxClicked( int );
|
||||||
void onBtnPopup( QAction* );
|
|
||||||
void updateSize();
|
void updateSize();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -199,6 +199,10 @@ void BooleanGUI_Dialog::Init()
|
|||||||
|
|
||||||
globalSelection(GEOM_ALLSHAPES);
|
globalSelection(GEOM_ALLSHAPES);
|
||||||
|
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
|
|
||||||
myGroup->PushButton1->click();
|
myGroup->PushButton1->click();
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
resize(100,100);
|
resize(100,100);
|
||||||
@ -236,8 +240,7 @@ bool BooleanGUI_Dialog::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BooleanGUI_Dialog::reset()
|
void BooleanGUI_Dialog::reset()
|
||||||
{
|
{
|
||||||
myObjects = new GEOM::ListOfGO;
|
myObjects.clear();
|
||||||
myObjects->length( 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -262,12 +265,11 @@ void BooleanGUI_Dialog::singleSelection()
|
|||||||
|
|
||||||
if (myEditCurrentArgument == myGroup->LineEdit1) {
|
if (myEditCurrentArgument == myGroup->LineEdit1) {
|
||||||
myObject1 = aSelectedObject;
|
myObject1 = aSelectedObject;
|
||||||
if (!myGroup->PushButton2->isHidden() && !myObjects->length())
|
if (!myGroup->PushButton2->isHidden() && !myObjects.count())
|
||||||
myGroup->PushButton2->click();
|
myGroup->PushButton2->click();
|
||||||
}
|
}
|
||||||
else if (myEditCurrentArgument == myGroup->LineEdit2) {
|
else if (myEditCurrentArgument == myGroup->LineEdit2) {
|
||||||
myObjects->length(1);
|
myObjects << aSelectedObject;
|
||||||
myObjects[0] = aSelectedObject.get();
|
|
||||||
if (!myObject1)
|
if (!myObject1)
|
||||||
myGroup->PushButton1->click();
|
myGroup->PushButton1->click();
|
||||||
}
|
}
|
||||||
@ -287,23 +289,11 @@ void BooleanGUI_Dialog::multipleSelection()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
myObjects = getSelected( TopAbs_SHAPE, -1 );
|
||||||
SALOME_ListIO aSelList;
|
|
||||||
aSelMgr->selectedObjects(aSelList);
|
|
||||||
myObjects->length(aSelList.Extent());
|
|
||||||
|
|
||||||
int i = 0;
|
int i = myObjects.count();
|
||||||
for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
|
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value() );
|
|
||||||
|
|
||||||
if ( !CORBA::is_nil( aSelectedObject ) ) {
|
|
||||||
myObjects[i++] = aSelectedObject;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
myObjects->length( i );
|
|
||||||
if ( i == 1 ) {
|
if ( i == 1 ) {
|
||||||
myEditCurrentArgument->setText( GEOMBase::GetName( myObjects[0] ) );
|
myEditCurrentArgument->setText( GEOMBase::GetName( myObjects.first().get() ) );
|
||||||
} else if ( i > 0 ) {
|
} else if ( i > 0 ) {
|
||||||
myEditCurrentArgument->setText( QString::number( i ) + "_" + tr( "GEOM_OBJECTS" ) );
|
myEditCurrentArgument->setText( QString::number( i ) + "_" + tr( "GEOM_OBJECTS" ) );
|
||||||
}
|
}
|
||||||
@ -315,6 +305,7 @@ void BooleanGUI_Dialog::multipleSelection()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BooleanGUI_Dialog::SelectionIntoArgument()
|
void BooleanGUI_Dialog::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
if ( myOperation == BooleanGUI::SECTION ||
|
if ( myOperation == BooleanGUI::SECTION ||
|
||||||
(myOperation == BooleanGUI::CUT &&
|
(myOperation == BooleanGUI::CUT &&
|
||||||
myEditCurrentArgument == myGroup->LineEdit1)) {
|
myEditCurrentArgument == myGroup->LineEdit1)) {
|
||||||
@ -349,11 +340,19 @@ void BooleanGUI_Dialog::SetEditCurrentArgument()
|
|||||||
myGroup->LineEdit1->setEnabled(false);
|
myGroup->LineEdit1->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
globalSelection(GEOM_ALLSHAPES);
|
||||||
|
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
|
|
||||||
// enable line edit
|
// enable line edit
|
||||||
myEditCurrentArgument->setEnabled(true);
|
myEditCurrentArgument->setEnabled(true);
|
||||||
myEditCurrentArgument->setFocus();
|
myEditCurrentArgument->setFocus();
|
||||||
// after setFocus(), because it will be setDown(false) when loses focus
|
// after setFocus(), because it will be setDown(false) when loses focus
|
||||||
send->setDown(true);
|
send->setDown(true);
|
||||||
|
|
||||||
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -399,13 +398,13 @@ bool BooleanGUI_Dialog::isValid (QString&)
|
|||||||
switch (myOperation) {
|
switch (myOperation) {
|
||||||
case BooleanGUI::FUSE:
|
case BooleanGUI::FUSE:
|
||||||
case BooleanGUI::COMMON:
|
case BooleanGUI::COMMON:
|
||||||
isOK = myObjects->length() > 1;
|
isOK = myObjects.count() > 1;
|
||||||
break;
|
break;
|
||||||
case BooleanGUI::CUT:
|
case BooleanGUI::CUT:
|
||||||
isOK = myObject1 && myObjects->length();
|
isOK = myObject1 && myObjects.count();
|
||||||
break;
|
break;
|
||||||
case BooleanGUI::SECTION:
|
case BooleanGUI::SECTION:
|
||||||
isOK = myObject1 && (myObjects->length() == 1);
|
isOK = myObject1 && (myObjects.count() == 1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -425,25 +424,30 @@ bool BooleanGUI_Dialog::execute (ObjectList& objects)
|
|||||||
GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
|
GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
|
||||||
const bool isCheckSelfInte = myGroup->CheckBox1->isChecked();
|
const bool isCheckSelfInte = myGroup->CheckBox1->isChecked();
|
||||||
|
|
||||||
|
GEOM::ListOfGO_var anObjects = new GEOM::ListOfGO();
|
||||||
|
anObjects->length( myObjects.count() );
|
||||||
|
for ( int i = 0; i < myObjects.count(); i++ )
|
||||||
|
anObjects[i] = myObjects[i].copy();
|
||||||
|
|
||||||
switch (myOperation) {
|
switch (myOperation) {
|
||||||
case BooleanGUI::FUSE:
|
case BooleanGUI::FUSE:
|
||||||
{
|
{
|
||||||
const bool isRmExtraEdges = myGroup->CheckBox2->isChecked();
|
const bool isRmExtraEdges = myGroup->CheckBox2->isChecked();
|
||||||
|
|
||||||
anObj = anOper->MakeFuseList
|
anObj = anOper->MakeFuseList
|
||||||
(myObjects, isCheckSelfInte, isRmExtraEdges);
|
(anObjects, isCheckSelfInte, isRmExtraEdges);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BooleanGUI::COMMON:
|
case BooleanGUI::COMMON:
|
||||||
anObj = anOper->MakeCommonList(myObjects, isCheckSelfInte);
|
anObj = anOper->MakeCommonList(anObjects, isCheckSelfInte);
|
||||||
break;
|
break;
|
||||||
case BooleanGUI::CUT:
|
case BooleanGUI::CUT:
|
||||||
anObj =
|
anObj =
|
||||||
anOper->MakeCutList(myObject1.get(), myObjects, isCheckSelfInte);
|
anOper->MakeCutList(myObject1.get(), anObjects, isCheckSelfInte);
|
||||||
break;
|
break;
|
||||||
case BooleanGUI::SECTION:
|
case BooleanGUI::SECTION:
|
||||||
anObj = anOper->MakeBoolean
|
anObj = anOper->MakeBoolean
|
||||||
(myObject1.get(), myObjects[0], myOperation, isCheckSelfInte);
|
(myObject1.get(), anObjects[0], myOperation, isCheckSelfInte);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -470,3 +474,14 @@ void BooleanGUI_Dialog::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
|
|||||||
mainFrame()->CheckBoxAddPrefix->isChecked()); // ? false
|
mainFrame()->CheckBoxAddPrefix->isChecked()); // ? false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapesToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_Dialog::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
GEOMBase::PublishSubObject( myObject1.get() );
|
||||||
|
for ( int i = 0; i < myObjects.count(); i++ )
|
||||||
|
GEOMBase::PublishSubObject( myObjects[i].get() );
|
||||||
|
}
|
||||||
|
@ -51,6 +51,7 @@ protected:
|
|||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& );
|
virtual bool execute( ObjectList& );
|
||||||
virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
|
virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
@ -63,7 +64,7 @@ private:
|
|||||||
int myOperation;
|
int myOperation;
|
||||||
|
|
||||||
GEOM::GeomObjPtr myObject1;
|
GEOM::GeomObjPtr myObject1;
|
||||||
GEOM::ListOfGO_var myObjects;
|
QList<GEOM::GeomObjPtr> myObjects;
|
||||||
|
|
||||||
DlgRef_2Sel2Spin3Check* myGroup;
|
DlgRef_2Sel2Spin3Check* myGroup;
|
||||||
|
|
||||||
|
@ -461,9 +461,9 @@ void GEOMBase_Helper::activate( const int theType )
|
|||||||
//================================================================
|
//================================================================
|
||||||
// Function : localSelection
|
// Function : localSelection
|
||||||
// Purpose : Activate selection of sub-shapes in accordance with mode
|
// Purpose : Activate selection of sub-shapes in accordance with mode
|
||||||
// theMode is from TopAbs_ShapeEnum
|
// modes are from TopAbs_ShapeEnum
|
||||||
//================================================================
|
//================================================================
|
||||||
void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMode )
|
void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const std::list<int> modes )
|
||||||
{
|
{
|
||||||
SALOME_ListIO aListOfIO;
|
SALOME_ListIO aListOfIO;
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMo
|
|||||||
anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) );
|
anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
getDisplayer()->LocalSelection( aListOfIO, theMode );
|
getDisplayer()->LocalSelection( aListOfIO, modes );
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
@ -487,19 +487,42 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMo
|
|||||||
// Purpose : Activate selection of sub-shapes in accordance with mode
|
// Purpose : Activate selection of sub-shapes in accordance with mode
|
||||||
// theMode is from TopAbs_ShapeEnum
|
// theMode is from TopAbs_ShapeEnum
|
||||||
//================================================================
|
//================================================================
|
||||||
void GEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const int mode )
|
void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMode )
|
||||||
|
{
|
||||||
|
std::list<int> modes;
|
||||||
|
modes.push_back( theMode );
|
||||||
|
localSelection( theObjs, modes );
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// Function : localSelection
|
||||||
|
// Purpose : Activate selection of sub-shapes in accordance with mode
|
||||||
|
// modes are from TopAbs_ShapeEnum
|
||||||
|
//================================================================
|
||||||
|
void GEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const std::list<int> modes )
|
||||||
{
|
{
|
||||||
// If object is null local selection for all objects is activated
|
// If object is null local selection for all objects is activated
|
||||||
if ( obj->_is_nil() ) {
|
if ( obj->_is_nil() ) {
|
||||||
getDisplayer()->LocalSelection( Handle(SALOME_InteractiveObject)(), mode );
|
getDisplayer()->LocalSelection( Handle(SALOME_InteractiveObject)(), modes );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectList objList;
|
ObjectList objList;
|
||||||
objList.push_back( obj );
|
objList.push_back( obj );
|
||||||
localSelection( objList, mode );
|
localSelection( objList, modes );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// Function : localSelection
|
||||||
|
// Purpose : Activate selection of sub-shapes in accordance with mode
|
||||||
|
// mode is from TopAbs_ShapeEnum
|
||||||
|
//================================================================
|
||||||
|
void GEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const int mode )
|
||||||
|
{
|
||||||
|
std::list<int> modes;
|
||||||
|
modes.push_back( mode );
|
||||||
|
localSelection( obj, modes );
|
||||||
|
}
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
// Function : globalSelection
|
// Function : globalSelection
|
||||||
|
@ -95,7 +95,9 @@ protected:
|
|||||||
const bool = true );
|
const bool = true );
|
||||||
void erasePreview ( const bool = true );
|
void erasePreview ( const bool = true );
|
||||||
|
|
||||||
|
void localSelection( const ObjectList&, const std::list<int> );
|
||||||
void localSelection( const ObjectList&, const int );
|
void localSelection( const ObjectList&, const int );
|
||||||
|
void localSelection( GEOM::GEOM_Object_ptr, const std::list<int> );
|
||||||
void localSelection( GEOM::GEOM_Object_ptr, const int );
|
void localSelection( GEOM::GEOM_Object_ptr, const int );
|
||||||
void activate( const int );
|
void activate( const int );
|
||||||
void globalSelection( const int = GEOM_ALLOBJECTS, const bool = false );
|
void globalSelection( const int = GEOM_ALLOBJECTS, const bool = false );
|
||||||
|
@ -1797,7 +1797,7 @@ void GEOM_Displayer::internalReset()
|
|||||||
* of their sub-shapes (with opened local context for OCC viewer)
|
* of their sub-shapes (with opened local context for OCC viewer)
|
||||||
*/
|
*/
|
||||||
//=================================================================
|
//=================================================================
|
||||||
void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& theIO, const int theMode )
|
void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& theIO, const std::list<int> modes )
|
||||||
{
|
{
|
||||||
SUIT_Session* session = SUIT_Session::session();
|
SUIT_Session* session = SUIT_Session::session();
|
||||||
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
|
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
|
||||||
@ -1814,11 +1814,25 @@ void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& the
|
|||||||
if (!theIO.IsNull() && !vf->isVisible(theIO))
|
if (!theIO.IsNull() && !vf->isVisible(theIO))
|
||||||
Display(theIO);
|
Display(theIO);
|
||||||
SALOME_Prs* prs = vf->CreatePrs( theIO.IsNull() ? 0 : theIO->getEntry() );
|
SALOME_Prs* prs = vf->CreatePrs( theIO.IsNull() ? 0 : theIO->getEntry() );
|
||||||
vf->LocalSelection( prs, theMode );
|
vf->LocalSelection( prs, modes );
|
||||||
delete prs; // delete presentation because displayer is its owner
|
delete prs; // delete presentation because displayer is its owner
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================
|
||||||
|
/*!
|
||||||
|
* GEOM_Displayer::LocalSelection
|
||||||
|
* Activate selection of CAD shapes with activisation of selection
|
||||||
|
* of their sub-shapes (with opened local context for OCC viewer)
|
||||||
|
*/
|
||||||
|
//=================================================================
|
||||||
|
void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& theIO, const int theMode )
|
||||||
|
{
|
||||||
|
std::list<int> modes;
|
||||||
|
modes.push_back( theMode );
|
||||||
|
LocalSelection( theIO, modes );
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================
|
//=================================================================
|
||||||
/*!
|
/*!
|
||||||
* GEOM_Displayer::globalSelection
|
* GEOM_Displayer::globalSelection
|
||||||
@ -1932,11 +1946,25 @@ void GEOM_Displayer::GlobalSelection( const TColStd_MapOfInteger& theModes,
|
|||||||
* of their sub-shapes (with opened local context for OCC viewer)
|
* of their sub-shapes (with opened local context for OCC viewer)
|
||||||
*/
|
*/
|
||||||
//=================================================================
|
//=================================================================
|
||||||
void GEOM_Displayer::LocalSelection( const SALOME_ListIO& theIOList, const int theMode )
|
void GEOM_Displayer::LocalSelection( const SALOME_ListIO& theIOList, const std::list<int> modes )
|
||||||
{
|
{
|
||||||
SALOME_ListIteratorOfListIO Iter( theIOList );
|
SALOME_ListIteratorOfListIO Iter( theIOList );
|
||||||
for ( ; Iter.More(); Iter.Next() )
|
for ( ; Iter.More(); Iter.Next() )
|
||||||
LocalSelection( Iter.Value(), theMode );
|
LocalSelection( Iter.Value(), modes );
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================
|
||||||
|
/*!
|
||||||
|
* GEOM_Displayer::LocalSelection
|
||||||
|
* Activate selection of CAD shapes with activisation of selection
|
||||||
|
* of their sub-shapes (with opened local context for OCC viewer)
|
||||||
|
*/
|
||||||
|
//=================================================================
|
||||||
|
void GEOM_Displayer::LocalSelection( const SALOME_ListIO& theIOList, const int theMode )
|
||||||
|
{
|
||||||
|
std::list<int> modes;
|
||||||
|
modes.push_back( theMode );
|
||||||
|
LocalSelection( theIOList, modes );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================
|
//=================================================================
|
||||||
|
@ -186,7 +186,9 @@ public:
|
|||||||
bool ToActivate() const;
|
bool ToActivate() const;
|
||||||
|
|
||||||
/* Activate/Deactivate selection*/
|
/* Activate/Deactivate selection*/
|
||||||
|
void LocalSelection( const Handle(SALOME_InteractiveObject)&, const std::list<int> );
|
||||||
void LocalSelection( const Handle(SALOME_InteractiveObject)&, const int );
|
void LocalSelection( const Handle(SALOME_InteractiveObject)&, const int );
|
||||||
|
void LocalSelection( const SALOME_ListIO& theIOList, const std::list<int> );
|
||||||
void LocalSelection( const SALOME_ListIO& theIOList, const int );
|
void LocalSelection( const SALOME_ListIO& theIOList, const int );
|
||||||
void GlobalSelection( const int = GEOM_ALLOBJECTS, const bool = false );
|
void GlobalSelection( const int = GEOM_ALLOBJECTS, const bool = false );
|
||||||
void GlobalSelection( const TColStd_MapOfInteger&, const bool = false, const QList<int>* = 0 );
|
void GlobalSelection( const TColStd_MapOfInteger&, const bool = false, const QList<int>* = 0 );
|
||||||
|
@ -202,7 +202,14 @@ void GenerationGUI_FillingDlg::initSelection()
|
|||||||
aTypes.Add( GEOM_EDGE );
|
aTypes.Add( GEOM_EDGE );
|
||||||
aTypes.Add( GEOM_WIRE );
|
aTypes.Add( GEOM_WIRE );
|
||||||
aTypes.Add( GEOM_COMPOUND );
|
aTypes.Add( GEOM_COMPOUND );
|
||||||
|
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_EDGE );
|
||||||
|
needTypes.push_back( TopAbs_WIRE );
|
||||||
|
needTypes.push_back( TopAbs_COMPOUND );
|
||||||
|
|
||||||
globalSelection( aTypes );
|
globalSelection( aTypes );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -232,12 +239,11 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
|
|||||||
void GenerationGUI_FillingDlg::SetEditCurrentArgument()
|
void GenerationGUI_FillingDlg::SetEditCurrentArgument()
|
||||||
{
|
{
|
||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
globalSelection(GEOM_ALLSHAPES);
|
|
||||||
|
|
||||||
if (send == GroupPoints->PushButton1) {
|
if (send == GroupPoints->PushButton1) {
|
||||||
GroupPoints->LineEdit1->setFocus();
|
GroupPoints->LineEdit1->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
globalSelection(GEOM_COMPOUND);
|
initSelection();
|
||||||
this->SelectionIntoArgument();
|
this->SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -388,3 +394,13 @@ bool GenerationGUI_FillingDlg::execute(ObjectList& objects)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapesToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_FillingDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
foreach( GEOM::GeomObjPtr o, myObjects )
|
||||||
|
GEOMBase::PublishSubObject( o.get() );
|
||||||
|
}
|
||||||
|
@ -49,6 +49,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& );
|
virtual bool execute( ObjectList& );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -136,7 +136,10 @@ void MeasureGUI_AngleDlg::Init()
|
|||||||
// init variables
|
// init variables
|
||||||
myGrp->LineEdit1->setText("");
|
myGrp->LineEdit1->setText("");
|
||||||
myGrp->LineEdit2->setText("");
|
myGrp->LineEdit2->setText("");
|
||||||
myObj = myObj2 = GEOM::GEOM_Object::_nil();
|
myGrp->LineEdit1->setEnabled(true);
|
||||||
|
myGrp->LineEdit2->setEnabled(false);
|
||||||
|
myObj.nullify();
|
||||||
|
myObj2.nullify();
|
||||||
|
|
||||||
mySelBtn = myGrp->PushButton1;
|
mySelBtn = myGrp->PushButton1;
|
||||||
mySelEdit = myGrp->LineEdit1;
|
mySelEdit = myGrp->LineEdit1;
|
||||||
@ -149,7 +152,7 @@ void MeasureGUI_AngleDlg::Init()
|
|||||||
connect(mySelEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect(mySelEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
connect(mySelBtn2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(mySelBtn2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
globalSelection(GEOM_LINE);
|
activateSelection();
|
||||||
MeasureGUI_Skeleton::Init();
|
MeasureGUI_Skeleton::Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,15 +162,7 @@ void MeasureGUI_AngleDlg::Init()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void MeasureGUI_AngleDlg::SelectionIntoArgument()
|
void MeasureGUI_AngleDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
GEOM::GeomObjPtr aSelectedObject = getSelected( TopAbs_EDGE );
|
||||||
SALOME_ListIO aSelList;
|
|
||||||
aSelMgr->selectedObjects(aSelList);
|
|
||||||
|
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
|
|
||||||
|
|
||||||
if (aSelList.Extent() > 0) {
|
|
||||||
aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear selection
|
// clear selection
|
||||||
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||||
@ -177,12 +172,12 @@ void MeasureGUI_AngleDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
if (myEditCurrentArgument == mySelEdit) {
|
if (myEditCurrentArgument == mySelEdit) {
|
||||||
myObj = aSelectedObject;
|
myObj = aSelectedObject;
|
||||||
if (!myObj->_is_nil() && myObj2->_is_nil())
|
if (myObj && !myObj2)
|
||||||
myGrp->PushButton2->click();
|
myGrp->PushButton2->click();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myObj2 = aSelectedObject;
|
myObj2 = aSelectedObject;
|
||||||
if (!myObj2->_is_nil() && myObj->_is_nil())
|
if (myObj2 && !myObj)
|
||||||
myGrp->PushButton1->click();
|
myGrp->PushButton1->click();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,8 +190,8 @@ void MeasureGUI_AngleDlg::SelectionIntoArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void MeasureGUI_AngleDlg::processObject()
|
void MeasureGUI_AngleDlg::processObject()
|
||||||
{
|
{
|
||||||
myGrp->LineEdit1->setText(!myObj->_is_nil() ? GEOMBase::GetName(myObj ) : "");
|
myGrp->LineEdit1->setText(myObj ? GEOMBase::GetName(myObj.get()) : "");
|
||||||
myGrp->LineEdit2->setText(!myObj2->_is_nil() ? GEOMBase::GetName(myObj2) : "");
|
myGrp->LineEdit2->setText(myObj2 ? GEOMBase::GetName(myObj2.get()) : "");
|
||||||
|
|
||||||
double anAngle = 0.;
|
double anAngle = 0.;
|
||||||
if (getParameters(anAngle)) {
|
if (getParameters(anAngle)) {
|
||||||
@ -220,7 +215,7 @@ bool MeasureGUI_AngleDlg::getParameters (double& theAngle)
|
|||||||
if (isValid(msg)) {
|
if (isValid(msg)) {
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
||||||
try {
|
try {
|
||||||
theAngle = anOper->GetAngle(myObj, myObj2);
|
theAngle = anOper->GetAngle(myObj.get(), myObj2.get());
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& e) {
|
catch(const SALOME::SALOME_Exception& e) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException(e);
|
SalomeApp_Tools::QtCatchCorbaException(e);
|
||||||
@ -262,7 +257,7 @@ void MeasureGUI_AngleDlg::SetEditCurrentArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||||
globalSelection(GEOM_LINE);
|
activateSelection();
|
||||||
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
this, SLOT(SelectionIntoArgument()));
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
@ -304,10 +299,11 @@ void MeasureGUI_AngleDlg::LineEditReturnPressed()
|
|||||||
SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
|
SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
|
||||||
{
|
{
|
||||||
double anAngle = 0.;
|
double anAngle = 0.;
|
||||||
|
myGrp->LineEdit3->setText("");
|
||||||
|
|
||||||
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
||||||
|
|
||||||
if (myObj->_is_nil() || myObj2->_is_nil() || !getParameters(anAngle) ||
|
if (!myObj || !myObj2 || !getParameters(anAngle) ||
|
||||||
vw->getViewManager()->getType() != OCCViewer_Viewer::Type())
|
vw->getViewManager()->getType() != OCCViewer_Viewer::Type())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -315,8 +311,8 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
|
|||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS;
|
OCC_CATCH_SIGNALS;
|
||||||
TopoDS_Shape S1, S2;
|
TopoDS_Shape S1, S2;
|
||||||
if (GEOMBase::GetShape(myObj , S1, TopAbs_EDGE) &&
|
if (GEOMBase::GetShape(myObj.get() , S1, TopAbs_EDGE) &&
|
||||||
GEOMBase::GetShape(myObj2, S2, TopAbs_EDGE)) {
|
GEOMBase::GetShape(myObj2.get(), S2, TopAbs_EDGE)) {
|
||||||
TopoDS_Edge anEdge1 = TopoDS::Edge(S1);
|
TopoDS_Edge anEdge1 = TopoDS::Edge(S1);
|
||||||
TopoDS_Edge anEdge2 = TopoDS::Edge(S2);
|
TopoDS_Edge anEdge2 = TopoDS::Edge(S2);
|
||||||
|
|
||||||
@ -399,5 +395,15 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool MeasureGUI_AngleDlg::isValid (QString& msg)
|
bool MeasureGUI_AngleDlg::isValid (QString& msg)
|
||||||
{
|
{
|
||||||
return MeasureGUI_Skeleton::isValid(msg) && !myObj2->_is_nil();
|
return MeasureGUI_Skeleton::isValid(msg) && myObj2;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : activateSelection()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void MeasureGUI_AngleDlg::activateSelection()
|
||||||
|
{
|
||||||
|
globalSelection(GEOM_LINE);
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
bool getParameters( double& );
|
bool getParameters( double& );
|
||||||
|
void activateSelection();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QLineEdit* myEditCurrentArgument;
|
QLineEdit* myEditCurrentArgument;
|
||||||
@ -59,7 +60,7 @@ private:
|
|||||||
QPushButton* mySelBtn2;
|
QPushButton* mySelBtn2;
|
||||||
MeasureGUI_2Sel1LineEdit* myGrp;
|
MeasureGUI_2Sel1LineEdit* myGrp;
|
||||||
|
|
||||||
GEOM::GEOM_Object_var myObj2;
|
GEOM::GeomObjPtr myObj2;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MEASUREGUI_ANGLEDLG_H
|
#endif // MEASUREGUI_ANGLEDLG_H
|
||||||
|
@ -124,7 +124,7 @@ void MeasureGUI_BndBoxDlg::Init()
|
|||||||
this, SLOT(SelectionIntoArgument()));
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
initName(tr("GEOM_BNDBOX"));
|
initName(tr("GEOM_BNDBOX"));
|
||||||
globalSelection();
|
activateSelection();
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,6 +148,7 @@ bool MeasureGUI_BndBoxDlg::ClickOnApply()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
initName();
|
initName();
|
||||||
|
activateSelection();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +163,7 @@ void MeasureGUI_BndBoxDlg::ActivateThisDialog()
|
|||||||
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
this, SLOT(SelectionIntoArgument()));
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
globalSelection();
|
activateSelection();
|
||||||
redisplayPreview();
|
redisplayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,11 +217,11 @@ bool MeasureGUI_BndBoxDlg::getParameters (double& theXmin, double& theXmax,
|
|||||||
double& theYmin, double& theYmax,
|
double& theYmin, double& theYmax,
|
||||||
double& theZmin, double& theZmax)
|
double& theZmin, double& theZmax)
|
||||||
{
|
{
|
||||||
if (myObj->_is_nil())
|
if (!myObj)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
|
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
|
||||||
anOper->GetBoundingBox(myObj, true, theXmin, theXmax, theYmin, theYmax, theZmin, theZmax);
|
anOper->GetBoundingBox(myObj.get(), true, theXmin, theXmax, theYmin, theYmax, theZmin, theZmax);
|
||||||
|
|
||||||
return anOper->IsDone();
|
return anOper->IsDone();
|
||||||
}
|
}
|
||||||
@ -249,28 +250,19 @@ SALOME_Prs* MeasureGUI_BndBoxDlg::buildPrs()
|
|||||||
void MeasureGUI_BndBoxDlg::SelectionIntoArgument()
|
void MeasureGUI_BndBoxDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
myObj = GEOM::GEOM_Object::_nil();
|
myObj.nullify();
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
QList<TopAbs_ShapeEnum> aTypes;
|
||||||
SALOME_ListIO aSelList;
|
aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
|
||||||
aSelMgr->selectedObjects(aSelList);
|
myObj = getSelected( aTypes );
|
||||||
|
|
||||||
if (aSelList.Extent() != 1) {
|
if ( !myObj ) {
|
||||||
processObject();
|
processObject();
|
||||||
erasePreview();
|
erasePreview();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First());
|
myEditCurrentArgument->setText(GEOMBase::GetName(myObj.get()));
|
||||||
|
|
||||||
if (aSelectedObject->_is_nil()) {
|
|
||||||
processObject();
|
|
||||||
erasePreview();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
myObj = aSelectedObject;
|
|
||||||
myEditCurrentArgument->setText(GEOMBase::GetName(myObj));
|
|
||||||
processObject();
|
processObject();
|
||||||
redisplayPreview();
|
redisplayPreview();
|
||||||
}
|
}
|
||||||
@ -290,7 +282,7 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_BndBoxDlg::createOperation()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool MeasureGUI_BndBoxDlg::isValid (QString&)
|
bool MeasureGUI_BndBoxDlg::isValid (QString&)
|
||||||
{
|
{
|
||||||
return !myObj->_is_nil();
|
return myObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -300,7 +292,7 @@ bool MeasureGUI_BndBoxDlg::isValid (QString&)
|
|||||||
bool MeasureGUI_BndBoxDlg::execute (ObjectList& objects)
|
bool MeasureGUI_BndBoxDlg::execute (ObjectList& objects)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
|
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
|
||||||
GEOM::GEOM_Object_var anObj = anOper->MakeBoundingBox(myObj, true);
|
GEOM::GEOM_Object_var anObj = anOper->MakeBoundingBox(myObj.get(), true);
|
||||||
|
|
||||||
if (!anObj->_is_nil())
|
if (!anObj->_is_nil())
|
||||||
objects.push_back(anObj._retn());
|
objects.push_back(anObj._retn());
|
||||||
@ -308,6 +300,20 @@ bool MeasureGUI_BndBoxDlg::execute (ObjectList& objects)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : activateSelection()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void MeasureGUI_BndBoxDlg::activateSelection()
|
||||||
|
{
|
||||||
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE );
|
||||||
|
needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL );
|
||||||
|
needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : redisplayPreview()
|
// function : redisplayPreview()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -337,3 +343,12 @@ void MeasureGUI_BndBoxDlg::redisplayPreview()
|
|||||||
catch (...) {
|
catch (...) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void MeasureGUI_BndBoxDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
GEOMBase::PublishSubObject( myObj.get() );
|
||||||
|
}
|
||||||
|
@ -48,7 +48,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid (QString&);
|
virtual bool isValid (QString&);
|
||||||
virtual bool execute (ObjectList&);
|
virtual bool execute (ObjectList&);
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
void redisplayPreview();
|
void redisplayPreview();
|
||||||
virtual void processObject();
|
virtual void processObject();
|
||||||
virtual SALOME_Prs* buildPrs();
|
virtual SALOME_Prs* buildPrs();
|
||||||
@ -56,10 +56,11 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent (QEvent*);
|
void enterEvent (QEvent*);
|
||||||
|
void activateSelection();
|
||||||
bool getParameters (double&, double&, double&, double&, double&, double&);
|
bool getParameters (double&, double&, double&, double&, double&, double&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GEOM::GEOM_Object_var myObj;
|
GEOM::GeomObjPtr myObj;
|
||||||
MeasureGUI_1Sel6LineEdit* myGrp;
|
MeasureGUI_1Sel6LineEdit* myGrp;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -120,10 +120,23 @@ void MeasureGUI_CenterMassDlg::Init()
|
|||||||
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
initName( tr( "GEOM_POINT") );
|
initName( tr( "GEOM_POINT") );
|
||||||
globalSelection();
|
activateSelection();
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : activateSelection
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void MeasureGUI_CenterMassDlg::activateSelection()
|
||||||
|
{
|
||||||
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE );
|
||||||
|
needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL );
|
||||||
|
needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ClickOnOk()
|
// function : ClickOnOk()
|
||||||
@ -146,6 +159,7 @@ bool MeasureGUI_CenterMassDlg::ClickOnApply()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
initName();
|
initName();
|
||||||
|
activateSelection();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// myMeasureGUI->MakeCDGAndDisplay( myGeomShape );
|
// myMeasureGUI->MakeCDGAndDisplay( myGeomShape );
|
||||||
@ -159,26 +173,17 @@ bool MeasureGUI_CenterMassDlg::ClickOnApply()
|
|||||||
void MeasureGUI_CenterMassDlg::SelectionIntoArgument()
|
void MeasureGUI_CenterMassDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
erasePreview();
|
erasePreview();
|
||||||
myObj = GEOM::GEOM_Object::_nil();
|
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
myObj.nullify();
|
||||||
SALOME_ListIO aSelList;
|
QList<TopAbs_ShapeEnum> aTypes;
|
||||||
aSelMgr->selectedObjects(aSelList);
|
aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
|
||||||
|
myObj = getSelected( aTypes );
|
||||||
|
|
||||||
if (aSelList.Extent() != 1) {
|
if ( !myObj ) {
|
||||||
processObject();
|
processObject();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
|
||||||
GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
|
|
||||||
|
|
||||||
if ( aSelectedObject->_is_nil() ) {
|
|
||||||
processObject();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
myObj = aSelectedObject;
|
|
||||||
processObject();
|
processObject();
|
||||||
displayPreview(true);
|
displayPreview(true);
|
||||||
}
|
}
|
||||||
@ -220,7 +225,7 @@ void MeasureGUI_CenterMassDlg::ActivateThisDialog()
|
|||||||
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
SIGNAL(currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
globalSelection();
|
activateSelection();
|
||||||
displayPreview(true);
|
displayPreview(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +235,7 @@ void MeasureGUI_CenterMassDlg::ActivateThisDialog()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void MeasureGUI_CenterMassDlg::processObject()
|
void MeasureGUI_CenterMassDlg::processObject()
|
||||||
{
|
{
|
||||||
if ( myObj->_is_nil() ) {
|
if ( !myObj ) {
|
||||||
myGrp->LineEdit1->setText( "" );
|
myGrp->LineEdit1->setText( "" );
|
||||||
myGrp->LineEdit2->setText( "" );
|
myGrp->LineEdit2->setText( "" );
|
||||||
myGrp->LineEdit3->setText( "" );
|
myGrp->LineEdit3->setText( "" );
|
||||||
@ -242,7 +247,7 @@ void MeasureGUI_CenterMassDlg::processObject()
|
|||||||
|
|
||||||
getParameters( x, y, z );
|
getParameters( x, y, z );
|
||||||
|
|
||||||
myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) );
|
myGrp->LineEdit1->setText( GEOMBase::GetName( myObj.get() ) );
|
||||||
|
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
|
int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
|
||||||
@ -280,7 +285,7 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_CenterMassDlg::createOperation()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool MeasureGUI_CenterMassDlg::isValid( QString& )
|
bool MeasureGUI_CenterMassDlg::isValid( QString& )
|
||||||
{
|
{
|
||||||
return !myObj->_is_nil();
|
return myObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -289,12 +294,12 @@ bool MeasureGUI_CenterMassDlg::isValid( QString& )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool MeasureGUI_CenterMassDlg::getParameters( double& theX, double& theY, double& theZ )
|
bool MeasureGUI_CenterMassDlg::getParameters( double& theX, double& theY, double& theZ )
|
||||||
{
|
{
|
||||||
if ( myObj->_is_nil() )
|
if ( !myObj )
|
||||||
return false;
|
return false;
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
||||||
GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj );
|
GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj.get() );
|
||||||
if ( !anOper->IsDone() )
|
if ( !anOper->IsDone() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -328,10 +333,19 @@ bool MeasureGUI_CenterMassDlg::getParameters( double& theX, double& theY, double
|
|||||||
bool MeasureGUI_CenterMassDlg::execute( ObjectList& objects )
|
bool MeasureGUI_CenterMassDlg::execute( ObjectList& objects )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
||||||
GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj );
|
GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj.get() );
|
||||||
|
|
||||||
if ( !anObj->_is_nil() )
|
if ( !anObj->_is_nil() )
|
||||||
objects.push_back( anObj._retn() );
|
objects.push_back( anObj._retn() );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void MeasureGUI_CenterMassDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
GEOMBase::PublishSubObject( myObj.get() );
|
||||||
|
}
|
||||||
|
@ -47,6 +47,7 @@ protected:
|
|||||||
// redefined from GEOMBase_Helper
|
// redefined from GEOMBase_Helper
|
||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual bool execute( ObjectList& );
|
virtual bool execute( ObjectList& );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -61,10 +62,11 @@ private:
|
|||||||
void Init();
|
void Init();
|
||||||
void enterEvent( QEvent* );
|
void enterEvent( QEvent* );
|
||||||
void processObject();
|
void processObject();
|
||||||
|
void activateSelection();
|
||||||
bool getParameters( double&, double&, double& );
|
bool getParameters( double&, double&, double& );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GEOM::GEOM_Object_var myObj;
|
GEOM::GeomObjPtr myObj;
|
||||||
MeasureGUI_1Sel3LineEdit* myGrp;
|
MeasureGUI_1Sel3LineEdit* myGrp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -128,6 +128,12 @@ void MeasureGUI_DistanceDlg::Init()
|
|||||||
myEditCurrentArgument = myGrp->LineEdit1;
|
myEditCurrentArgument = myGrp->LineEdit1;
|
||||||
myDbls = new GEOM::ListOfDouble();
|
myDbls = new GEOM::ListOfDouble();
|
||||||
|
|
||||||
|
myGrp->LineEdit1->setEnabled(true);
|
||||||
|
myGrp->LineEdit2->setEnabled(false);
|
||||||
|
|
||||||
|
myObj1.nullify();
|
||||||
|
myObj2.nullify();
|
||||||
|
|
||||||
// signals and slots connections
|
// signals and slots connections
|
||||||
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
@ -140,7 +146,7 @@ void MeasureGUI_DistanceDlg::Init()
|
|||||||
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
this, SLOT(SelectionIntoArgument()));
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
globalSelection();
|
activateSelection();
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,6 +170,7 @@ bool MeasureGUI_DistanceDlg::ClickOnApply()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
initName();
|
initName();
|
||||||
|
activateSelection();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +185,7 @@ void MeasureGUI_DistanceDlg::ActivateThisDialog()
|
|||||||
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
this, SLOT(SelectionIntoArgument()));
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
globalSelection();
|
activateSelection();
|
||||||
redisplayPreview();
|
redisplayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,15 +237,9 @@ void MeasureGUI_DistanceDlg::SolutionSelected (int i)
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void MeasureGUI_DistanceDlg::SelectionIntoArgument()
|
void MeasureGUI_DistanceDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
QList<TopAbs_ShapeEnum> aTypes;
|
||||||
SALOME_ListIO aSelList;
|
aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
|
||||||
aSelMgr->selectedObjects(aSelList);
|
GEOM::GeomObjPtr aSelectedObject = getSelected( aTypes );
|
||||||
|
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
|
|
||||||
|
|
||||||
if (aSelList.Extent() > 0) {
|
|
||||||
aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First());
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear selection
|
// clear selection
|
||||||
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||||
@ -248,12 +249,12 @@ void MeasureGUI_DistanceDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
if (myEditCurrentArgument == myGrp->LineEdit1) {
|
if (myEditCurrentArgument == myGrp->LineEdit1) {
|
||||||
myObj1 = aSelectedObject;
|
myObj1 = aSelectedObject;
|
||||||
if (!myObj1->_is_nil() && myObj2->_is_nil())
|
if (myObj1 && !myObj2)
|
||||||
myGrp->PushButton2->click();
|
myGrp->PushButton2->click();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myObj2 = aSelectedObject;
|
myObj2 = aSelectedObject;
|
||||||
if (!myObj2->_is_nil() && myObj1->_is_nil())
|
if (myObj2 && !myObj1)
|
||||||
myGrp->PushButton1->click();
|
myGrp->PushButton1->click();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,8 +298,8 @@ void MeasureGUI_DistanceDlg::SetEditCurrentArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void MeasureGUI_DistanceDlg::processObject()
|
void MeasureGUI_DistanceDlg::processObject()
|
||||||
{
|
{
|
||||||
myGrp->LineEdit1->setText(!myObj1->_is_nil() ? GEOMBase::GetName(myObj1) : "");
|
myGrp->LineEdit1->setText(myObj1 ? GEOMBase::GetName(myObj1.get()) : "");
|
||||||
myGrp->LineEdit2->setText(!myObj2->_is_nil() ? GEOMBase::GetName(myObj2) : "");
|
myGrp->LineEdit2->setText(myObj2 ? GEOMBase::GetName(myObj2.get()) : "");
|
||||||
|
|
||||||
myGrp->ComboBox1->clear();
|
myGrp->ComboBox1->clear();
|
||||||
myDbls->length(0);
|
myDbls->length(0);
|
||||||
@ -311,7 +312,7 @@ void MeasureGUI_DistanceDlg::processObject()
|
|||||||
|
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
|
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
|
||||||
try {
|
try {
|
||||||
nbSols = anOper->ClosestPoints(myObj1, myObj2, myDbls);
|
nbSols = anOper->ClosestPoints(myObj1.get(), myObj2.get(), myDbls);
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& e) {
|
catch (const SALOME::SALOME_Exception& e) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException(e);
|
SalomeApp_Tools::QtCatchCorbaException(e);
|
||||||
@ -340,7 +341,7 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
|
|||||||
|
|
||||||
int currSol = myGrp->ComboBox1->currentIndex();
|
int currSol = myGrp->ComboBox1->currentIndex();
|
||||||
|
|
||||||
if (myObj1->_is_nil() || myObj2->_is_nil() ||
|
if (!myObj1 || !myObj2 ||
|
||||||
currSol == -1 || (currSol+1)*6 > myDbls->length() ||
|
currSol == -1 || (currSol+1)*6 > myDbls->length() ||
|
||||||
vw->getViewManager()->getType() != OCCViewer_Viewer::Type())
|
vw->getViewManager()->getType() != OCCViewer_Viewer::Type())
|
||||||
return 0;
|
return 0;
|
||||||
@ -424,7 +425,7 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_DistanceDlg::createOperation()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool MeasureGUI_DistanceDlg::isValid (QString& msg)
|
bool MeasureGUI_DistanceDlg::isValid (QString& msg)
|
||||||
{
|
{
|
||||||
return !myObj1->_is_nil() && !myObj2->_is_nil();
|
return myObj1 && myObj2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -437,7 +438,7 @@ bool MeasureGUI_DistanceDlg::execute (ObjectList& objects)
|
|||||||
GEOM::GEOM_IBasicOperations_var aBasicOper = getGeomEngine()->GetIBasicOperations(getStudyId());
|
GEOM::GEOM_IBasicOperations_var aBasicOper = getGeomEngine()->GetIBasicOperations(getStudyId());
|
||||||
|
|
||||||
GEOM::ListOfDouble_var aDbls;
|
GEOM::ListOfDouble_var aDbls;
|
||||||
int nbSols = anOper->ClosestPoints(myObj1, myObj2, aDbls);
|
int nbSols = anOper->ClosestPoints(myObj1.get(), myObj2.get(), aDbls);
|
||||||
|
|
||||||
if (anOper->IsDone()) {
|
if (anOper->IsDone()) {
|
||||||
bool doPublishAll = true;
|
bool doPublishAll = true;
|
||||||
@ -482,6 +483,20 @@ bool MeasureGUI_DistanceDlg::execute (ObjectList& objects)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : activateSelection()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void MeasureGUI_DistanceDlg::activateSelection()
|
||||||
|
{
|
||||||
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE );
|
||||||
|
needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL );
|
||||||
|
needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : redisplayPreview()
|
// function : redisplayPreview()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -517,11 +532,21 @@ void MeasureGUI_DistanceDlg::redisplayPreview()
|
|||||||
QString MeasureGUI_DistanceDlg::getNewObjectName (int currObj) const
|
QString MeasureGUI_DistanceDlg::getNewObjectName (int currObj) const
|
||||||
{
|
{
|
||||||
QString aName = tr("GEOM_MINDIST_NAME") + QString("_%1_").arg((currObj+1)/2);
|
QString aName = tr("GEOM_MINDIST_NAME") + QString("_%1_").arg((currObj+1)/2);
|
||||||
aName += GEOMBase::GetName(currObj%2 ? myObj1 : myObj2);
|
aName += GEOMBase::GetName(currObj%2 ? myObj1.get() : myObj2.get());
|
||||||
|
|
||||||
return aName;
|
return aName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void MeasureGUI_DistanceDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
GEOMBase::PublishSubObject( myObj1.get() );
|
||||||
|
GEOMBase::PublishSubObject( myObj2.get() );
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : MeasureGUI_DistanceGroup
|
// function : MeasureGUI_DistanceGroup
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -99,6 +99,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid (QString&);
|
virtual bool isValid (QString&);
|
||||||
virtual bool execute (ObjectList&);
|
virtual bool execute (ObjectList&);
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual QString getNewObjectName (int CurrObj = -1) const;
|
virtual QString getNewObjectName (int CurrObj = -1) const;
|
||||||
|
|
||||||
void redisplayPreview();
|
void redisplayPreview();
|
||||||
@ -108,10 +109,11 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent (QEvent*);
|
void enterEvent (QEvent*);
|
||||||
|
void activateSelection();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GEOM::GEOM_Object_var myObj1;
|
GEOM::GeomObjPtr myObj1;
|
||||||
GEOM::GEOM_Object_var myObj2;
|
GEOM::GeomObjPtr myObj2;
|
||||||
|
|
||||||
MeasureGUI_DistanceGroup* myGrp;
|
MeasureGUI_DistanceGroup* myGrp;
|
||||||
GEOM::ListOfDouble_var myDbls;
|
GEOM::ListOfDouble_var myDbls;
|
||||||
|
@ -122,6 +122,19 @@ void MeasureGUI_InertiaDlg::Init()
|
|||||||
MeasureGUI_Skeleton::Init();
|
MeasureGUI_Skeleton::Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : activateSelection()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void MeasureGUI_InertiaDlg::activateSelection()
|
||||||
|
{
|
||||||
|
MeasureGUI_Skeleton::activateSelection();
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : processObject
|
// function : processObject
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -176,13 +189,13 @@ void MeasureGUI_InertiaDlg::processObject()
|
|||||||
bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I,
|
bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I,
|
||||||
gp_XYZ& theIXYZ )
|
gp_XYZ& theIXYZ )
|
||||||
{
|
{
|
||||||
if ( myObj->_is_nil() )
|
if ( !myObj )
|
||||||
return false;
|
return false;
|
||||||
else {
|
else {
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
||||||
try {
|
try {
|
||||||
double x, y, z;
|
double x, y, z;
|
||||||
anOper->GetInertia( myObj,
|
anOper->GetInertia( myObj.get(),
|
||||||
I( 1, 1 ), I( 1, 2 ), I( 1, 3 ),
|
I( 1, 1 ), I( 1, 2 ), I( 1, 3 ),
|
||||||
I( 2, 1 ), I( 2, 2 ), I( 2, 3 ),
|
I( 2, 1 ), I( 2, 2 ), I( 2, 3 ),
|
||||||
I( 3, 1 ), I( 3, 2 ), I( 3, 3 ),
|
I( 3, 1 ), I( 3, 2 ), I( 3, 3 ),
|
||||||
@ -198,3 +211,22 @@ bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I,
|
|||||||
return anOper->IsDone();
|
return anOper->IsDone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MeasureGUI_InertiaDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myObj.nullify();
|
||||||
|
QList<TopAbs_ShapeEnum> aTypes;
|
||||||
|
aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
|
||||||
|
myObj = getSelected( aTypes );
|
||||||
|
|
||||||
|
if (!myObj) {
|
||||||
|
mySelEdit->setText("");
|
||||||
|
processObject();
|
||||||
|
erasePreview();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mySelEdit->setText(GEOMBase::GetName(myObj.get()));
|
||||||
|
processObject();
|
||||||
|
redisplayPreview();
|
||||||
|
}
|
||||||
|
@ -49,6 +49,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper and MeasureGUI_Skeleton
|
// redefined from GEOMBase_Helper and MeasureGUI_Skeleton
|
||||||
virtual void processObject();
|
virtual void processObject();
|
||||||
|
virtual void activateSelection();
|
||||||
|
virtual void SelectionIntoArgument();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
//
|
//
|
||||||
#include "MeasureGUI_MaxToleranceDlg.h"
|
#include "MeasureGUI_MaxToleranceDlg.h"
|
||||||
#include "MeasureGUI_Widgets.h"
|
#include "MeasureGUI_Widgets.h"
|
||||||
|
#include <GEOMBase.h>
|
||||||
#include "DlgRef.h"
|
#include "DlgRef.h"
|
||||||
|
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
@ -163,7 +164,7 @@ bool MeasureGUI_MaxToleranceDlg::getParameters( double& theMinFaceToler,
|
|||||||
else {
|
else {
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
||||||
try {
|
try {
|
||||||
anOper->GetTolerance( myObj,
|
anOper->GetTolerance( myObj.get(),
|
||||||
theMinFaceToler, theMaxFaceToler, theMinEdgeToler,
|
theMinFaceToler, theMaxFaceToler, theMinEdgeToler,
|
||||||
theMaxEdgeToler, theMinVertexToler, theMaxVertexToler );
|
theMaxEdgeToler, theMinVertexToler, theMaxVertexToler );
|
||||||
}
|
}
|
||||||
@ -175,3 +176,35 @@ bool MeasureGUI_MaxToleranceDlg::getParameters( double& theMinFaceToler,
|
|||||||
return anOper->IsDone();
|
return anOper->IsDone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : activateSelection()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void MeasureGUI_MaxToleranceDlg::activateSelection()
|
||||||
|
{
|
||||||
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_EDGE );
|
||||||
|
needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL );
|
||||||
|
needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND ); localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
|
}
|
||||||
|
|
||||||
|
void MeasureGUI_MaxToleranceDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myObj.nullify();
|
||||||
|
QList<TopAbs_ShapeEnum> aTypes;
|
||||||
|
aTypes << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
|
||||||
|
myObj = getSelected( aTypes );
|
||||||
|
|
||||||
|
if (!myObj) {
|
||||||
|
mySelEdit->setText("");
|
||||||
|
processObject();
|
||||||
|
erasePreview();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mySelEdit->setText(GEOMBase::GetName(myObj.get()));
|
||||||
|
processObject();
|
||||||
|
redisplayPreview();
|
||||||
|
}
|
||||||
|
@ -46,9 +46,11 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper and MeasureGUI_Skeleton
|
// redefined from GEOMBase_Helper and MeasureGUI_Skeleton
|
||||||
virtual void processObject();
|
virtual void processObject();
|
||||||
|
virtual void SelectionIntoArgument();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
void activateSelection();
|
||||||
bool getParameters( double&, double&, double&,
|
bool getParameters( double&, double&, double&,
|
||||||
double&, double&, double& );
|
double&, double&, double& );
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ void MeasureGUI_PointDlg::activateSelection()
|
|||||||
void MeasureGUI_PointDlg::SelectionIntoArgument()
|
void MeasureGUI_PointDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
myObj = GEOM::GEOM_Object::_nil();
|
myObj.nullify();
|
||||||
myGrp->LineEdit1->setText( "" );
|
myGrp->LineEdit1->setText( "" );
|
||||||
myGrp->LineEdit2->setText( "" );
|
myGrp->LineEdit2->setText( "" );
|
||||||
myGrp->LineEdit3->setText( "" );
|
myGrp->LineEdit3->setText( "" );
|
||||||
@ -135,23 +135,20 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
|
|||||||
if (aSelList.Extent() < 1)
|
if (aSelList.Extent() < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
myObj = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
|
||||||
GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
|
|
||||||
|
|
||||||
if ( aSelectedObject->_is_nil() )
|
if ( !myObj )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myObj = aSelectedObject;
|
|
||||||
|
|
||||||
TColStd_IndexedMapOfInteger anIndexes;
|
TColStd_IndexedMapOfInteger anIndexes;
|
||||||
aSelMgr->GetIndexes(aSelList.First(), anIndexes);
|
aSelMgr->GetIndexes(aSelList.First(), anIndexes);
|
||||||
|
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( anIndexes.Extent() > 1 || !GEOMBase::GetShape( myObj, aShape ) || aShape.IsNull() )
|
if ( anIndexes.Extent() > 1 || !GEOMBase::GetShape( myObj.get(), aShape ) || aShape.IsNull() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TopoDS_Vertex aPoint;
|
TopoDS_Vertex aPoint;
|
||||||
QString aName = GEOMBase::GetName( myObj );
|
QString aName = GEOMBase::GetName( myObj.get() );
|
||||||
if ( anIndexes.Extent() == 0 ) {
|
if ( anIndexes.Extent() == 0 ) {
|
||||||
if ( aShape.ShapeType() == TopAbs_VERTEX )
|
if ( aShape.ShapeType() == TopAbs_VERTEX )
|
||||||
aPoint = TopoDS::Vertex( aShape );
|
aPoint = TopoDS::Vertex( aShape );
|
||||||
@ -180,7 +177,7 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
catch( ... )
|
catch( ... )
|
||||||
{
|
{
|
||||||
myObj = GEOM::GEOM_Object::_nil();
|
myObj.nullify();
|
||||||
myGrp->LineEdit1->setText( "" );
|
myGrp->LineEdit1->setText( "" );
|
||||||
myGrp->LineEdit2->setText( "" );
|
myGrp->LineEdit2->setText( "" );
|
||||||
myGrp->LineEdit3->setText( "" );
|
myGrp->LineEdit3->setText( "" );
|
||||||
|
@ -122,8 +122,30 @@ void MeasureGUI_PropertiesDlg::activateSelection()
|
|||||||
}
|
}
|
||||||
|
|
||||||
globalSelection( aTypes );
|
globalSelection( aTypes );
|
||||||
|
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MeasureGUI_PropertiesDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myObj.nullify();
|
||||||
|
QList<TopAbs_ShapeEnum> aTypes;
|
||||||
|
aTypes << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPOUND;
|
||||||
|
myObj = getSelected( aTypes );
|
||||||
|
|
||||||
|
if (!myObj) {
|
||||||
|
mySelEdit->setText("");
|
||||||
|
processObject();
|
||||||
|
erasePreview();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mySelEdit->setText(GEOMBase::GetName(myObj.get()));
|
||||||
|
processObject();
|
||||||
|
redisplayPreview();
|
||||||
|
}
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : processObject
|
// function : processObject
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -155,12 +177,12 @@ bool MeasureGUI_PropertiesDlg::getParameters( double& theLength,
|
|||||||
double& theArea,
|
double& theArea,
|
||||||
double& theVolume )
|
double& theVolume )
|
||||||
{
|
{
|
||||||
if ( myObj->_is_nil() )
|
if ( !myObj )
|
||||||
return false;
|
return false;
|
||||||
else {
|
else {
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
||||||
try {
|
try {
|
||||||
anOper->GetBasicProperties( myObj, theLength, theArea, theVolume );
|
anOper->GetBasicProperties( myObj.get(), theLength, theArea, theVolume );
|
||||||
}
|
}
|
||||||
catch( const SALOME::SALOME_Exception& e ) {
|
catch( const SALOME::SALOME_Exception& e ) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException( e );
|
SalomeApp_Tools::QtCatchCorbaException( e );
|
||||||
@ -180,8 +202,8 @@ SALOME_Prs* MeasureGUI_PropertiesDlg::buildPrs()
|
|||||||
SALOME_Prs* prs = 0;
|
SALOME_Prs* prs = 0;
|
||||||
TopoDS_Shape shape;
|
TopoDS_Shape shape;
|
||||||
|
|
||||||
if ( GEOMBase::GetShape( myObj, shape, TopAbs_EDGE ) &&
|
if ( GEOMBase::GetShape( myObj.get(), shape, TopAbs_EDGE ) &&
|
||||||
getDisplayer()->IsDisplayed( GEOMBase::GetEntry(myObj) ) ) {
|
getDisplayer()->IsDisplayed( GEOMBase::GetEntry(myObj.get()) ) ) {
|
||||||
shape = GEOMBase::CreateArrowForLinearEdge( shape );
|
shape = GEOMBase::CreateArrowForLinearEdge( shape );
|
||||||
if ( !shape.IsNull() )
|
if ( !shape.IsNull() )
|
||||||
prs = getDisplayer()->BuildPrs( shape );
|
prs = getDisplayer()->BuildPrs( shape );
|
||||||
|
@ -48,6 +48,7 @@ protected:
|
|||||||
// redefined from GEOMBase_Helper and MeasureGUI_Skeleton
|
// redefined from GEOMBase_Helper and MeasureGUI_Skeleton
|
||||||
virtual void processObject();
|
virtual void processObject();
|
||||||
virtual void activateSelection();
|
virtual void activateSelection();
|
||||||
|
virtual void SelectionIntoArgument();
|
||||||
virtual SALOME_Prs* buildPrs();
|
virtual SALOME_Prs* buildPrs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -245,27 +245,24 @@ void MeasureGUI_Skeleton::SetEditCurrentArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void MeasureGUI_Skeleton::SelectionIntoArgument()
|
void MeasureGUI_Skeleton::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
myObj = GEOM::GEOM_Object::_nil();
|
myObj.nullify();
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
SALOME_ListIO aSelList;
|
SALOME_ListIO aSelList;
|
||||||
aSelMgr->selectedObjects(aSelList);
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
|
|
||||||
|
|
||||||
if (aSelList.Extent() > 0) {
|
if (aSelList.Extent() > 0) {
|
||||||
aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
|
myObj = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aSelectedObject->_is_nil()) {
|
if ( !myObj ) {
|
||||||
mySelEdit->setText("");
|
mySelEdit->setText("");
|
||||||
processObject();
|
processObject();
|
||||||
erasePreview();
|
erasePreview();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
myObj = aSelectedObject;
|
mySelEdit->setText(GEOMBase::GetName(myObj.get()));
|
||||||
mySelEdit->setText(GEOMBase::GetName(myObj));
|
|
||||||
processObject();
|
processObject();
|
||||||
redisplayPreview();
|
redisplayPreview();
|
||||||
}
|
}
|
||||||
@ -356,7 +353,7 @@ void MeasureGUI_Skeleton::activateSelection()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool MeasureGUI_Skeleton::isValid( QString& )
|
bool MeasureGUI_Skeleton::isValid( QString& )
|
||||||
{
|
{
|
||||||
return !myObj->_is_nil();
|
return myObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
|
@ -77,7 +77,7 @@ protected:
|
|||||||
protected:
|
protected:
|
||||||
QPushButton* mySelBtn;
|
QPushButton* mySelBtn;
|
||||||
QLineEdit* mySelEdit;
|
QLineEdit* mySelEdit;
|
||||||
GEOM::GEOM_Object_var myObj;
|
GEOM::GeomObjPtr myObj;
|
||||||
|
|
||||||
GeometryGUI* myGeomGUI;
|
GeometryGUI* myGeomGUI;
|
||||||
GEOM_Displayer* myDisplayer;
|
GEOM_Displayer* myDisplayer;
|
||||||
|
@ -187,6 +187,18 @@ void MeasureGUI_WhatisDlg::processObject()
|
|||||||
myParamsDlg->adjustSize();
|
myParamsDlg->adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : activateSelection()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void MeasureGUI_WhatisDlg::activateSelection()
|
||||||
|
{
|
||||||
|
MeasureGUI_Skeleton::activateSelection();
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ClickOnProperties()
|
// function : ClickOnProperties()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -202,13 +214,13 @@ void MeasureGUI_WhatisDlg::ClickOnProperties()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool MeasureGUI_WhatisDlg::getParameters( QString& theText )
|
bool MeasureGUI_WhatisDlg::getParameters( QString& theText )
|
||||||
{
|
{
|
||||||
if ( myObj->_is_nil() )
|
if ( !myObj )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
theText = anOper->WhatIs( myObj );
|
theText = anOper->WhatIs( myObj.get() );
|
||||||
}
|
}
|
||||||
catch( const SALOME::SALOME_Exception& e )
|
catch( const SALOME::SALOME_Exception& e )
|
||||||
{
|
{
|
||||||
@ -231,7 +243,7 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
|
|||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
int aLenPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
|
int aLenPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
|
||||||
|
|
||||||
if ( myObj->_is_nil() )
|
if ( !myObj )
|
||||||
return aKindStr;
|
return aKindStr;
|
||||||
|
|
||||||
GEOM::GEOM_IKindOfShape::shape_kind aKind;
|
GEOM::GEOM_IKindOfShape::shape_kind aKind;
|
||||||
@ -242,7 +254,7 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
aKind = anOper->KindOfShape( myObj, anInts, aDbls );
|
aKind = anOper->KindOfShape( myObj.get(), anInts, aDbls );
|
||||||
}
|
}
|
||||||
catch( const SALOME::SALOME_Exception& e ) {
|
catch( const SALOME::SALOME_Exception& e ) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException( e );
|
SalomeApp_Tools::QtCatchCorbaException( e );
|
||||||
@ -601,3 +613,20 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
|
|||||||
|
|
||||||
return aKindStr;
|
return aKindStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MeasureGUI_WhatisDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myObj.nullify();
|
||||||
|
myObj = getSelected( TopAbs_SHAPE );
|
||||||
|
|
||||||
|
if (!myObj) {
|
||||||
|
mySelEdit->setText("");
|
||||||
|
processObject();
|
||||||
|
erasePreview();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mySelEdit->setText(GEOMBase::GetName(myObj.get()));
|
||||||
|
processObject();
|
||||||
|
redisplayPreview();
|
||||||
|
}
|
@ -48,6 +48,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper and MeasureGUI_Skeleton
|
// redefined from GEOMBase_Helper and MeasureGUI_Skeleton
|
||||||
virtual void processObject();
|
virtual void processObject();
|
||||||
|
virtual void activateSelection();
|
||||||
|
virtual void SelectionIntoArgument();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void ClickOnProperties();
|
virtual void ClickOnProperties();
|
||||||
|
@ -237,6 +237,9 @@ void TransformationGUI_ProjectionDlg::SetEditCurrentArgument()
|
|||||||
aMap.Add( GEOM_EDGE );
|
aMap.Add( GEOM_EDGE );
|
||||||
aMap.Add( GEOM_WIRE );
|
aMap.Add( GEOM_WIRE );
|
||||||
globalSelection( aMap );
|
globalSelection( aMap );
|
||||||
|
std::list<int> needTypes;
|
||||||
|
needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE );
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), needTypes );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROJ_ON_WIRE:
|
case PROJ_ON_WIRE:
|
||||||
|
Loading…
Reference in New Issue
Block a user