Merge from V6_main 13/12/2012
BIN
doc/salome/gui/GEOM/images/3dsketch4.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
doc/salome/gui/GEOM/images/3dsketch_2angles_rel.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
doc/salome/gui/GEOM/images/3dsketch_angle_abs.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
doc/salome/gui/GEOM/images/3dsketch_angle_height_rel.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
doc/salome/gui/GEOM/images/3dsketch_angle_rel.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
doc/salome/gui/GEOM/images/3dsketch_dlg.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
doc/salome/gui/GEOM/images/fused_wire.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 10 KiB |
BIN
doc/salome/gui/GEOM/images/pipe_path.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
doc/salome/gui/GEOM/images/pipe_path_dlg.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
doc/salome/gui/GEOM/images/wire_before_fuse.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
@ -7,9 +7,9 @@ considered as a compound of blocks, the given shape must satisfy the
|
|||||||
following conditions:
|
following conditions:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Each element of the compound should be a Block (6 faces and 12 edges);</li>
|
<li>Each element of the compound should be a Block (6 faces and 12 edges);</li>
|
||||||
<li>A connection between two Blocks should be an entire quadrangle face or an entire edge;</li>
|
<li>Blocks can be connected only via an entire quadrangle face or an entire edge;</li>
|
||||||
<li>The compound should be connected;</li>
|
<li>The compound should be connected;</li>
|
||||||
<li>Two quadrangle faces should be glued.</li>
|
<li>Each couple of connecting quadrangle faces should be glued.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
\n Informs of the following possible errors:
|
\n Informs of the following possible errors:
|
||||||
|
@ -5,27 +5,24 @@
|
|||||||
3D Sketcher allows creating a closed or unclosed 3D wire, made of
|
3D Sketcher allows creating a closed or unclosed 3D wire, made of
|
||||||
consequent straight segments.
|
consequent straight segments.
|
||||||
|
|
||||||
|
<b>Example:</b>
|
||||||
|
|
||||||
|
\image html 3dsketch4.png
|
||||||
|
|
||||||
To create a 3D Sketch, select in the main menu <em>New Entity -> Basic -> 3D Sketch</em>.
|
To create a 3D Sketch, select in the main menu <em>New Entity -> Basic -> 3D Sketch</em>.
|
||||||
|
|
||||||
\image html 3dsketch2.png
|
\image html 3dsketch_dlg.png
|
||||||
|
|
||||||
The first sketcher point can be defined by \b Absolute coordinates X, Y and Z.
|
The first point of a sketch can be defined by \b Absolute coordinates X, Y and Z.
|
||||||
When the first point is defined, it is possible to add straight segments.
|
When the first point is defined, it is possible to add straight segments.
|
||||||
Each segment will start at the end point of previous segment or at the
|
Each segment will start at the end point of the previous segment or at the
|
||||||
sketcher first point, if there are no validated segments.
|
first point of the sketch, if there are no validated segments.
|
||||||
|
|
||||||
Segment can be defined by:
|
|
||||||
- \b Absolute coordinates X, Y and Z of its second end,
|
|
||||||
- \b Relative coordinates DX, DY and DZ of its second end with
|
|
||||||
respect to the previous applied point,
|
|
||||||
- \b Direction and \b Length of the segment. Direction is set by two
|
|
||||||
\b Angles in selected coordinate system.
|
|
||||||
|
|
||||||
The way of segment construction can be selected by the <b>Coordinates Type</b>
|
The way of segment construction can be selected by the <b>Coordinates Type</b>
|
||||||
radio buttons.
|
radio buttons.
|
||||||
|
|
||||||
To validate the segment and to proceed with the definition of the next
|
To validate a segment and to proceed with the definition of the next
|
||||||
segment, click <b>Apply</b> button. \b Undo and \b Redo buttons,
|
one, click <b>Apply</b> button. \b Undo and \b Redo buttons,
|
||||||
respectively, remove or restore the last segment in the wire.
|
respectively, remove or restore the last segment in the wire.
|
||||||
|
|
||||||
\n <b>"Sketch Validation"</b> button applies the wire, built by the
|
\n <b>"Sketch Validation"</b> button applies the wire, built by the
|
||||||
@ -33,9 +30,37 @@ user, "as is".
|
|||||||
\n <b>"Sketch Closure"</b> closes the Sketch by a straight line from
|
\n <b>"Sketch Closure"</b> closes the Sketch by a straight line from
|
||||||
the start to the end point and applies it.
|
the start to the end point and applies it.
|
||||||
|
|
||||||
<b>Example:</b>
|
A segment can be defined by:
|
||||||
|
- <b>Cartesian coordinates</b> of its second end, which can be either:
|
||||||
|
- \b Absolute coordinates X, Y and Z, or
|
||||||
|
- \b Relative coordinates DX, DY and DZ with
|
||||||
|
respect to the previous applied point,
|
||||||
|
|
||||||
|
- <b>Angular coordinates</b> of its second end specified by:
|
||||||
|
<ul>
|
||||||
|
<li> the \b Length of the segment and an \b Angle in the chosen plane (OXY for example) in \b Relative mode.
|
||||||
|
The angle is then relative to a local coordinate system with the last point of the sketch as origin. </li>
|
||||||
|
|
||||||
|
\image html 3dsketch_angle_rel.png
|
||||||
|
|
||||||
|
<li> the \b Radius (i.e. the distance from the origin) and an \b Angle in the chosen plane in \b Absolute mode </li>
|
||||||
|
|
||||||
|
\image html 3dsketch_angle_abs.png
|
||||||
|
|
||||||
\image html 3dsketch1.png
|
In both angular modes you can additionally specify the following:
|
||||||
|
|
||||||
|
<li> the second \b Angle (latitude) </li>
|
||||||
|
|
||||||
|
\image html 3dsketch_2angles_rel.png
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
<li> the \b Height </li>
|
||||||
|
|
||||||
|
\image html 3dsketch_angle_height_rel.png
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
<b>TUI Command:</b> <em>geompy.Make3DSketcher( [ PointsList ] )</em>
|
<b>TUI Command:</b> <em>geompy.Make3DSketcher( [ PointsList ] )</em>
|
||||||
This algorithm creates a wire from the list of real values, which
|
This algorithm creates a wire from the list of real values, which
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
/*!
|
|
||||||
|
|
||||||
\page create_adv_obj_page Creating Advanced Geometrical Objects
|
|
||||||
|
|
||||||
<b>New Entity -> Advanced </b> submenu allows to create additional complex topological objects.
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>\subpage create_pipetshape_page</li>
|
|
||||||
<li>\subpage create_divideddisk_page</li>
|
|
||||||
<li>\subpage create_dividedcylinder_page</li>
|
|
||||||
<!--@@ insert new functions before this line @@ do not remove this line @@-->
|
|
||||||
</ul>
|
|
||||||
<!--WRNING : In order to let this page appear in the documentation please remove this file from the EXCLUDE_PATTERNS field of the doxyfile.in file in ../ -->
|
|
||||||
*/
|
|
@ -14,7 +14,7 @@ axis, creating a body of revolution.</li>
|
|||||||
<li>\subpage create_filling_page "Create a surface" from a set of edges.</li>
|
<li>\subpage create_filling_page "Create a surface" from a set of edges.</li>
|
||||||
<li>\subpage create_extrusion_alongpath_page "Extrude an object along a path",
|
<li>\subpage create_extrusion_alongpath_page "Extrude an object along a path",
|
||||||
creating a more complex trajectory object.</li>
|
creating a more complex trajectory object.</li>
|
||||||
|
<li>\subpage create_pipe_path_page "Restore Path" of a pipe-like shape.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -22,4 +22,8 @@ Entity - > Build - > Compound</b>.
|
|||||||
Our <b>TUI Scripts</b> provide you with useful examples of creation of
|
Our <b>TUI Scripts</b> provide you with useful examples of creation of
|
||||||
\ref tui_creation_compound "Advanced Geometric Objects".
|
\ref tui_creation_compound "Advanced Geometric Objects".
|
||||||
|
|
||||||
|
<b> More details: </b>
|
||||||
|
|
||||||
|
Perhaps you ask yourself : \ref partition_explanation "What's the difference between partition, compounds and fuse operation ?"
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
\page create_dividedcylinder_page DividedCylinder
|
\page create_dividedcylinder_page DividedCylinder
|
||||||
|
|
||||||
The <b>Divided cylinder</b> object is a cylinder divided into \b blocks for easy hexaedral meshing.Two division patterns are available :
|
The <b>Divided cylinder</b> object is a cylinder divided into \b blocks for easy hexahedral meshing. Two division patterns are available :
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li> A square pattern which is frequently used </li>
|
<li> A square pattern, which is frequently used; </li>
|
||||||
<li> An hexagonal pattern which ensures a better mesh quality and especially less acute or obtuse angles </li>
|
<li> A hexagonal pattern, which ensures a better mesh quality and especially less acute or obtuse angles. </li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
\image html dividedcylinder.png
|
\image html dividedcylinder.png
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
\page create_divideddisk_page DividedDisk
|
\page create_divideddisk_page DividedDisk
|
||||||
|
|
||||||
The <b>Divided disk</b> object is a disk divided into \b blocks. It means that it's a shape <b>prepared for hexaedral meshing</b>. Two division patterns are available :
|
The <b>Divided disk</b> object is a disk divided into \b blocks for easy hexahedral meshing. Two division patterns are available :
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li> A square pattern which is frequently used </li>
|
<li> A square pattern, which is frequently used; </li>
|
||||||
<li> An hexagonal pattern which ensures a better mesh quality and especially less acute or obtuse angles </li>
|
<li> A hexagonal pattern, which ensures a better mesh quality and especially less acute or obtuse angles. </li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
\n Moreover this shape can be used as a basis in an \ref create_extrusion_alongpath_page "Extrusion along a path" operation in order to obtain any <b>tube shape</b> prepared for hexaedral meshing
|
\n Moreover, this shape can be used as a basis in an \ref create_extrusion_alongpath_page "Extrusion along a path" operation in order to obtain any <b>tube shape</b> prepared for hexahedral meshing
|
||||||
(see example below). (Another alternative is to create a 2D mesh on the divided disk and create a 3D mesh by extrusion in the SMESH module.)
|
(see example below). (Another alternative is to create a 2D mesh on the divided disk and create a 3D mesh by extrusion in the SMESH module.)
|
||||||
|
|
||||||
|
|
||||||
@ -21,13 +21,13 @@ Example:
|
|||||||
To create a <b> Divided Disk </b> in the <b>Main Menu</b> select <b>New Entity - >
|
To create a <b> Divided Disk </b> in the <b>Main Menu</b> select <b>New Entity - >
|
||||||
Advanced - > DividedDisk </b>
|
Advanced - > DividedDisk </b>
|
||||||
|
|
||||||
\n Then there are 2 ways to create a <b> Divided Disk</b> in 3D space.
|
\n There are 2 ways to create a <b> Divided Disk</b> in 3D space.
|
||||||
\n For both operations :
|
\n For both operations :
|
||||||
Specify the parameters of the DividedDisk object creation in the opened dialog
|
Specify the parameters of the DividedDisk object creation in the opened dialog
|
||||||
box and press "Apply" or "Apply & Close" button.
|
box and press "Apply" or "Apply & Close" button.
|
||||||
The result of each operation will be a GEOM_Object.
|
The result of each operation will be a GEOM_Object.
|
||||||
|
|
||||||
\n First way : by radius and orientation (plane "OXY", "OYZ" or "OZX"). The resulting disk is located at the origin of coordinates
|
\n At first it is possible to define a disk by its radius and orientation (plane "OXY", "OYZ" or "OZX"). The resulting disk is located at the origin of coordinates
|
||||||
|
|
||||||
<b>TUI Command:</b> <em>geompy.MakeDividedDisk(Radius, Orientation, Pattern)</em>
|
<b>TUI Command:</b> <em>geompy.MakeDividedDisk(Radius, Orientation, Pattern)</em>
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ The result of each operation will be a GEOM_Object.
|
|||||||
|
|
||||||
\image html divided_disk_dlg.png
|
\image html divided_disk_dlg.png
|
||||||
|
|
||||||
\n Second way : by giving its center, normal and radius.
|
\n At second the disk can be defined by its center, normal and radius.
|
||||||
|
|
||||||
<b>TUI Command:</b> <em>geompy.MakeDividedDiskPntVecR(Center, Vector,
|
<b>TUI Command:</b> <em>geompy.MakeDividedDiskPntVecR(Center, Vector,
|
||||||
Radius, Pattern)</em>
|
Radius, Pattern)</em>
|
||||||
|
@ -2,33 +2,30 @@
|
|||||||
|
|
||||||
\page create_hexa_solid_page Hexaedral solid
|
\page create_hexa_solid_page Hexaedral solid
|
||||||
|
|
||||||
\n <b>Description:</b> Builds a hexahedral solid. either of the below
|
This operation allows to build a hexahedral solid bypassing
|
||||||
mentioned arguments. This operation allows to build a solid bypassing
|
the intermediate stage of building a shell and 4 faces (in case of
|
||||||
the intermediate stage of building a shell and 4 faces (in the case of
|
building by 2 faces) or just a shell (in case of building by 6
|
||||||
building by 2 faces) or just a shell (in the case of building by 6
|
|
||||||
faces).
|
faces).
|
||||||
|
|
||||||
|
There are 2 algorithms to create a hexahedral solid in the 3D space.
|
||||||
\n The \b Result of the operation will be a \b GEOM_Object (solid).
|
\n The \b Result of the operation will be a \b GEOM_Object (solid).
|
||||||
|
|
||||||
\n <b>TUI Command:</b>
|
Firstly, you can define a Hexahedral Solid by two faces, other four faces are created automatically.
|
||||||
<ul>
|
|
||||||
<li><em>geompy.MakeHexa2Faces(F1, F2),</em> where F1 and F2 are faces
|
|
||||||
from which the hexahedron is constructed, other four faces are created
|
|
||||||
automatically.</li>
|
|
||||||
<li><em>geompy.MakeHexa(F1, F2, F3, F4, F5, F6),</em> where F1 — F6 are six faces from which the hexahedron is constructed.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
\n <b>Arguments:</b>
|
<b>TUI Command:</b> <em>geompy.MakeHexa2Faces(F1, F2),</em>
|
||||||
<ul>
|
<b>Arguments: Name + 2 Faces.
|
||||||
<li>Name + 2 Faces, or</li>
|
|
||||||
<li>Name + 6 Faces.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
\n <b>Dialog Box:</b>
|
|
||||||
|
|
||||||
\image html block4.png
|
\image html block4.png
|
||||||
|
|
||||||
|
\n <b>Example:</b>
|
||||||
|
|
||||||
|
\image html image181.png
|
||||||
|
<center>Hexahedral Solid built on the base of two Faces</center>
|
||||||
|
|
||||||
|
Secondly, you can define a Hexahedral Solid by all six faces.
|
||||||
|
|
||||||
|
<b>TUI Command:</b> <em>geompy.MakeHexa(F1, F2, F3, F4, F5, F6),</em>
|
||||||
|
<b>Arguments:</b> Name + 6 Faces.
|
||||||
|
|
||||||
\image html block5.png
|
\image html block5.png
|
||||||
|
|
||||||
@ -37,9 +34,6 @@ automatically.</li>
|
|||||||
\image html image180.png
|
\image html image180.png
|
||||||
<center>Hexahedral Solid built on the base of six Faces</center>
|
<center>Hexahedral Solid built on the base of six Faces</center>
|
||||||
|
|
||||||
\image html image181.png
|
|
||||||
<center>Hexahedral Solid built on the base of two Faces</center>
|
|
||||||
|
|
||||||
|
|
||||||
The created blocks can be processed with \ref blocks_operations_page "Operations on Blocks".
|
The created blocks can be processed with \ref blocks_operations_page "Operations on Blocks".
|
||||||
|
|
||||||
|
44
doc/salome/gui/GEOM/input/creating_pipe_path.doc
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/*!
|
||||||
|
|
||||||
|
\page create_pipe_path_page Restore Path
|
||||||
|
|
||||||
|
To generate a \b Path in the <b>Main Menu</b> select <b>New Entity - > Generation - > Restore Path</b>
|
||||||
|
|
||||||
|
\image html pipe_path_dlg.png
|
||||||
|
|
||||||
|
\n To obtain the \b Path of a pipe-like shape, you should define the
|
||||||
|
<b>Pipe-like shell or solid</b> and two pipe \b Bases, which can
|
||||||
|
be defined by a wire, a face or a list of edges.<br>
|
||||||
|
\n <b>Select unpublished edges</b> checkbox - if checked, allows
|
||||||
|
selecting in the viewer the edges, that are not published in the Object
|
||||||
|
Browser.<br>
|
||||||
|
\n The \b Result of the operation will be a GEOM_Object (edge or wire).<br>
|
||||||
|
|
||||||
|
\n <b>Advanced options</b>:
|
||||||
|
<ul>
|
||||||
|
<li>\ref preview_anchor "Preview"</li>
|
||||||
|
</ul><br>
|
||||||
|
|
||||||
|
\note It is not always possible to obtain an exact or approximate
|
||||||
|
copy of the Shape by applying the \b Pipe operation to the
|
||||||
|
resulting "Path" wire with the first Base as the base;
|
||||||
|
though in some particular cases it might
|
||||||
|
work. Thus, Restore Path function should not
|
||||||
|
be considered as an exact reverse operation of the Pipe.<br>
|
||||||
|
|
||||||
|
\n <b>Example:</b>
|
||||||
|
|
||||||
|
\image html pipe_path.png "Path (red) between two faces (green)"
|
||||||
|
|
||||||
|
\n <b>TUI Command:</b> <em>geompy.RestorePath(aShape, aBase1, aBase2)</em>
|
||||||
|
\n <b>Arguments:</b> Name + 1 pipe-like shape (shell or solid) + 1
|
||||||
|
shape (edge, wire or face) for the first base + 1 shape (edge, wire or
|
||||||
|
face) for the last base.
|
||||||
|
\n <b>TUI Command:</b> <em>geompy.RestorePathEdges(aShape, listEdges1, listEdges2)</em>
|
||||||
|
\n <b>Arguments:</b> Name + 1 pipe-like shape (shell or solid) + 1
|
||||||
|
list of edges for the first base + 1 list of edges for the last base.
|
||||||
|
|
||||||
|
Our <b>TUI Scripts</b> provide you with useful examples of creation of
|
||||||
|
\ref tui_creation_pipe_path "Complex Geometric Objects".
|
||||||
|
|
||||||
|
*/
|
@ -2,39 +2,45 @@
|
|||||||
|
|
||||||
\page create_quadrangle_face_page Quadrangle face
|
\page create_quadrangle_face_page Quadrangle face
|
||||||
|
|
||||||
\n <b>Description:</b> Builds a face using the below mentioned
|
This operation allows to build a face bypassing the
|
||||||
arguments. This operation allows to build a face bypassing the
|
intermediate stage of building edges and wires (in case of
|
||||||
intermediate stage of building edges and wires (in the case of
|
building by 4 points) or wires (in case of building by 4 or 2
|
||||||
building by 4 points) or wires (in the case of building by 4 or 2
|
|
||||||
edges).
|
edges).
|
||||||
|
|
||||||
\n The \b Result of the operation will be a \b GEOM_Object (face).
|
There are 3 algorithms to create a Quadrangle Face in the 3D space.
|
||||||
|
\n The \b Result of each op
|
||||||
|
|
||||||
\n <b>TUI Command:</b>
|
The created blocks can be processed with \ref blocks_operations_page "Operations on Blocks".
|
||||||
<ul>
|
|
||||||
<li><em>geompy.MakeQuad4Vertices(V1, V2, V3, V4),</em> where V1, V2,
|
|
||||||
V3, V4 are four vertices from which a face is constructed. Edges are
|
|
||||||
created automatically.</li>
|
|
||||||
<li><em>geompy.MakeQuad2Edges(E1, E2),</em> where E1, E2 are edges from
|
|
||||||
which the face is constructed, two other edges are created
|
|
||||||
automatically.</li>
|
|
||||||
<li><em>geompy.MakeQuad(E1, E2, E3, E4),</em> where E1, E2, E3, E4 are
|
|
||||||
four edges from which the face is constructed.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<b>Arguments:</b>
|
Our <b>TUI Scripts</b> provide you with useful examples of
|
||||||
<ul>
|
\ref tui_building_by_blocks_p
|
||||||
<li>Name + 4 Points, or</li>
|
|
||||||
<li>Name + 2 Edges, or</li>
|
|
||||||
<li>Name + 4 Edges.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
\n <b>Dialog Box:</b>
|
The created blocks can be processed with \ref blocks_operations_page "Operations on Blocks".
|
||||||
|
|
||||||
|
Our <b>TUI Scripts</b> provide you with useful examples of
|
||||||
|
\ref tui_building_by_blocks_page "Building by Blocks".
|
||||||
|
age "Building by Blocks".
|
||||||
|
eration will be a \b GEOM_Object (face).
|
||||||
|
|
||||||
|
Firstly you can define a Quadrangle Face by four vertices. Edges are
|
||||||
|
created automatically.
|
||||||
|
|
||||||
|
<b>TUI Command:</b> <em>geompy.MakeQuad4Vertices(V1, V2, V3, V4),</em>
|
||||||
|
<b>Arguments:</b> Name + 4 Points.
|
||||||
|
|
||||||
\image html block1.png
|
\image html block1.png
|
||||||
|
|
||||||
|
Secondly, you can define a Quadrangle Face by two edges, while the other two edges are created automatically.
|
||||||
|
<b>TUI Command:</b> <em>geompy.MakeQuad2Edges(E1, E2)
|
||||||
|
<b>Arguments:</b> Name + 2 Edges.
|
||||||
|
|
||||||
\image html block2.png
|
\image html block2.png
|
||||||
|
|
||||||
|
Finally, you can define a Quadrangle Face by four edges.
|
||||||
|
|
||||||
|
<b>TUI Command:</b> <em>geompy.MakeQuad(E1, E2, E3, E4),</em>.
|
||||||
|
<b>Arguments:</b> Name + 4 Edges.
|
||||||
|
|
||||||
\image html block3.png
|
\image html block3.png
|
||||||
|
|
||||||
\n <b>Example:</b>
|
\n <b>Example:</b>
|
||||||
|
@ -27,7 +27,7 @@ To create a <b> 2D Sketch</b>:
|
|||||||
<li> Select the \b plane or the <b>planar face</b> on which to create the sketch.
|
<li> Select the \b plane or the <b>planar face</b> on which to create the sketch.
|
||||||
\note By default the sketch is created on the XOY plane of the global coordinate system.
|
\note By default the sketch is created on the XOY plane of the global coordinate system.
|
||||||
If Local Coordinate Systems have been created in the study they appear
|
If Local Coordinate Systems have been created in the study they appear
|
||||||
in the combobox and can be selected as a reference coordinate system.</li>
|
in the combo-box and can be selected as a reference coordinate system.</li>
|
||||||
|
|
||||||
<li> Choose a \b segment or an \b arc element to start a \b profile or choose \b rectangle to draw a rectangle.
|
<li> Choose a \b segment or an \b arc element to start a \b profile or choose \b rectangle to draw a rectangle.
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ origin of the reference coordinate system.</li>
|
|||||||
|
|
||||||
<li> You can define the segment by either its <b>end point</b> or \b direction and \b length. The direction is defined relatively to the tangent at the last point of the sketch. It can be:
|
<li> You can define the segment by either its <b>end point</b> or \b direction and \b length. The direction is defined relatively to the tangent at the last point of the sketch. It can be:
|
||||||
<ul>
|
<ul>
|
||||||
<li> Tangent (colinear to the tangent at the last point)</li>
|
<li> Tangent (collinear to the tangent at the last point)</li>
|
||||||
<li> Perpendicular</li>
|
<li> Perpendicular</li>
|
||||||
<li> Defined by an angle</li>
|
<li> Defined by an angle</li>
|
||||||
<li> Defined by a vector (Vx, Vy)</li>
|
<li> Defined by a vector (Vx, Vy)</li>
|
||||||
@ -159,7 +159,7 @@ points in the current LCS.
|
|||||||
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_sketcher_page "Sketcher".
|
\ref tui_sketcher_page "Sketcher".
|
||||||
|
|
||||||
A wrapper also exists to help in the construction of a sketcher using simple commands.
|
There is also a wrapper that can help in the construction of a sketcher using simple commands.
|
||||||
The description of this wrapper can be found in the <a class="el" target="_new" href="../../tui/GEOM/docutils/docapi.html#module-salome.geom.sketcher">
|
The description of this wrapper can be found in the <a class="el" target="_new" href="../../tui/GEOM/docutils/docapi.html#module-salome.geom.sketcher">
|
||||||
dedicated page</a> of the <a class="el" target="_new" href="../../tui/GEOM/docutils/index.html">salome.geom python package</a>.
|
dedicated page</a> of the <a class="el" target="_new" href="../../tui/GEOM/docutils/index.html">salome.geom python package</a>.
|
||||||
|
|
||||||
|
12
doc/salome/gui/GEOM/input/faq.doc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/*!
|
||||||
|
|
||||||
|
\page faq FAQ ("Frequently Asked Questions")
|
||||||
|
|
||||||
|
Here you can find the answers to some frequently asked questions:
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>\subpage partition_explanation "What is the difference between partition, compounds and fuse operation ?" </li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
@ -18,7 +18,7 @@ vertexes on this wire in the OCC Viewer and define the \b Radius of the Fillet.
|
|||||||
\b Note: This Operation Works for the Wires with <b>Planar Edges</b> only.
|
\b Note: This Operation Works for the Wires with <b>Planar Edges</b> only.
|
||||||
|
|
||||||
\b Note: Use option <b>Fuse collinear edges to allow bigger radius</b>
|
\b Note: Use option <b>Fuse collinear edges to allow bigger radius</b>
|
||||||
to allow ignoring of possible secant points, i.e. the
|
in order to ignore possible secant points, i.e. the
|
||||||
joints of collinear edges, thus processing such edges as one.
|
joints of collinear edges, thus processing such edges as one.
|
||||||
|
|
||||||
<b>TUI Command:</b> <em>geompy.MakeFillet1D(Shape, R, ListVertexes)</em>
|
<b>TUI Command:</b> <em>geompy.MakeFillet1D(Shape, R, ListVertexes)</em>
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
/*!
|
|
||||||
|
|
||||||
\page first_steps_guide First steps in GEOM
|
|
||||||
|
|
||||||
You can find here some useful information to start working with GEOM
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>\subpage partition_explanation "Partition, compounds and boolean operations" </li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
@ -4,10 +4,20 @@
|
|||||||
|
|
||||||
\n To <b>Fuse Collinear Edges within a Wire</b> in the <b>Main Menu</b>
|
\n To <b>Fuse Collinear Edges within a Wire</b> in the <b>Main Menu</b>
|
||||||
select <b>Repair - > Fuse Collinear Edges within a Wire</b>.
|
select <b>Repair - > Fuse Collinear Edges within a Wire</b>.
|
||||||
\n This operation removes selected vertices from a given wire in case
|
\n This operation removes the selected vertices from a given wire,
|
||||||
if adjacent edges are C1 continuous. The function takes a list of
|
provided that the junction of two adjacent edges is C1 continuous
|
||||||
|
(i.e. the edges have equal tangents at the junction).
|
||||||
|
\n The function takes a list of
|
||||||
vertices to suppress as a parameter. If the list is empty, all
|
vertices to suppress as a parameter. If the list is empty, all
|
||||||
vertices in a wire are assumed.
|
vertices in a wire are taken into account.
|
||||||
|
|
||||||
|
\n \b Example:
|
||||||
|
|
||||||
|
Wire with 2 colinear edges:
|
||||||
|
\image html wire_before_fuse.png
|
||||||
|
|
||||||
|
Fused wire (only one edge):
|
||||||
|
\image html fused_wire.png
|
||||||
|
|
||||||
\n <b>Arguments:</b> Name + a wire + a list of vertices (can be empty).
|
\n <b>Arguments:</b> Name + a wire + a list of vertices (can be empty).
|
||||||
|
|
||||||
|
@ -2,24 +2,11 @@
|
|||||||
|
|
||||||
\page fuse_operation_page Fuse
|
\page fuse_operation_page Fuse
|
||||||
|
|
||||||
For detail description of the Boolean operations please refer to
|
|
||||||
<a href="SALOME_BOA_PA.pdf">this document</a>.
|
|
||||||
It provides a general review of the Partition and Boolean
|
|
||||||
operations algorithms, describes the usage methodology and highlighs
|
|
||||||
major limitations of these operations.
|
|
||||||
|
|
||||||
To produce a \b Fuse operation in the <b>Main Menu</b> select
|
To produce a \b Fuse operation in the <b>Main Menu</b> select
|
||||||
<b>Operations - > Boolean - > Fuse</b>
|
<b>Operations - > Boolean - > Fuse</b>.
|
||||||
|
|
||||||
This operation creates a shape from two shapes.
|
|
||||||
|
|
||||||
|
This operation creates one shape from two shapes.
|
||||||
The \b Result will be any \b GEOM_Object.
|
The \b Result will be any \b GEOM_Object.
|
||||||
<b>TUI Command:</b> <em>geompy.MakeFuse(s1, s2)</em>
|
|
||||||
<b>Arguments:</b> Name + 2 shapes.
|
|
||||||
<b>Advanced option:</b>
|
|
||||||
\ref restore_presentation_parameters_page "Set presentation parameters and sub-shapes from arguments".
|
|
||||||
|
|
||||||
\image html bool1.png
|
|
||||||
|
|
||||||
<b>Example:</b>
|
<b>Example:</b>
|
||||||
|
|
||||||
@ -27,7 +14,24 @@ The \b Result will be any \b GEOM_Object.
|
|||||||
|
|
||||||
\image html fusesn2.png "The resulting fuse"
|
\image html fusesn2.png "The resulting fuse"
|
||||||
|
|
||||||
|
<b>TUI Command:</b> <em>geompy.MakeFuse(s1, s2)</em>\n
|
||||||
|
<b>Arguments:</b> Name + 2 shapes.\n
|
||||||
|
<b>Advanced option:</b>
|
||||||
|
\ref restore_presentation_parameters_page "Set presentation parameters and sub-shapes from arguments".
|
||||||
|
|
||||||
|
\image html bool1.png
|
||||||
|
|
||||||
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_fuse "Boolean Operations".
|
\ref tui_fuse "Boolean Operations".
|
||||||
|
|
||||||
|
<b> More details </b>
|
||||||
|
<ul>
|
||||||
|
<li>For a detailed description of the Boolean operations please refer to
|
||||||
|
<a href="SALOME_BOA_PA.pdf">this document</a>.
|
||||||
|
It provides a general review of the Partition and Boolean
|
||||||
|
operations algorithms, describes the usage methodology and highlights
|
||||||
|
major limitations of these operations.</li>
|
||||||
|
<li>Perhaps you also ask yourself : \ref partition_explanation "What is the difference between partition, compounds and fuse operation ?"</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -4,18 +4,18 @@
|
|||||||
|
|
||||||
\image html measures2.png
|
\image html measures2.png
|
||||||
|
|
||||||
Retrieve all non blocks solids and faces from the given shape.
|
This operation retrieves all non block solids and faces from the given
|
||||||
Collect them in two groups: solids and faces separately.
|
shape in two groups: solids and faces separately.
|
||||||
|
|
||||||
\n <b>Result:</b> Two or less groups are published in the Object
|
Two or less groups are published in the Object
|
||||||
Browser under the processed object. Reports error if
|
Browser under the processed object. An error is raised if
|
||||||
no bad sub-shapes (solids and faces) have been found.
|
no bad sub-shapes (solids and faces) have been found.
|
||||||
|
|
||||||
\n <b>TUI Command:</b>
|
\n <b>TUI Command:</b>
|
||||||
<em>geompy.GetNonBlocks(Compound).</em> Returns a tuple of two
|
<em>geompy.GetNonBlocks(Compound).</em> Returns a tuple of two
|
||||||
GEOM_Objects. The first object is a group of all non block solids
|
GEOM_Objects. The first object is a group of all non block solids
|
||||||
(= not 6 faces, or with 6 faces, but with the presence of
|
(not having 6 faces, or having 6 faces, but some of them
|
||||||
non-quadrangular faces). The second object is a group of all non
|
are not quadrangular). The second object is a group of all non
|
||||||
quadrangular faces.
|
quadrangular faces.
|
||||||
|
|
||||||
See also a \ref tui_get_non_blocks_page "TUI example".
|
See also a \ref tui_get_non_blocks_page "TUI example".
|
||||||
|
@ -22,10 +22,10 @@ Select the required file and click \b Open. Your file will be imported in
|
|||||||
the module and its contents (geometrical object) will be displayed in
|
the module and its contents (geometrical object) will be displayed in
|
||||||
the <b>Object Browser</b>.
|
the <b>Object Browser</b>.
|
||||||
|
|
||||||
\note If the selected file is in IGES format and the length is not
|
\note If the selected file is in IGES or STEP format and the length
|
||||||
expressed in meters, it will be suggested to scale the model into the
|
is not expressed in meters, it will be asked whether to take or not these
|
||||||
metric system (see the picture below). This feature can be helpful if
|
units into account (see the picture below). This feature can be
|
||||||
some wrong units have been written to the IGES file by a
|
helpful if some wrong units have been written to the IGES or STEP file by a
|
||||||
3rd-party software.
|
3rd-party software.
|
||||||
|
|
||||||
\image html iges_unit.png
|
\image html iges_unit.png
|
||||||
|
@ -4,9 +4,6 @@
|
|||||||
|
|
||||||
\image html geomscreen.png
|
\image html geomscreen.png
|
||||||
|
|
||||||
If you are a new user some general information about GEOM usage are given here:
|
|
||||||
\subpage first_steps_guide
|
|
||||||
|
|
||||||
\b Geometry module of SALOME is destined for:
|
\b Geometry module of SALOME is destined for:
|
||||||
- \subpage import_export_geom_obj_page "import and export of geometrical models"
|
- \subpage import_export_geom_obj_page "import and export of geometrical models"
|
||||||
in IGES, BREP and STEP formats;
|
in IGES, BREP and STEP formats;
|
||||||
@ -30,6 +27,9 @@ Geometry module preferences are described in the
|
|||||||
Almost all geometry module functionalities are accessible via
|
Almost all geometry module functionalities are accessible via
|
||||||
\subpage geompy_page "Geometry module Python Interface"
|
\subpage geompy_page "Geometry module Python Interface"
|
||||||
|
|
||||||
|
You can find the answer to some Frequently Asked Questions in this page:
|
||||||
|
- \subpage faq "Frequently Asked Questions"
|
||||||
|
|
||||||
Other functions are available in <a class="el" target="_new" href="../../tui/GEOM/docutils/index.html">salome.geom python package</a>.
|
Other functions are available in <a class="el" target="_new" href="../../tui/GEOM/docutils/index.html">salome.geom python package</a>.
|
||||||
|
|
||||||
\image html image3.png "Example of Geometry module usage for engineering tasks"
|
\image html image3.png "Example of Geometry module usage for engineering tasks"
|
||||||
|
@ -2,11 +2,15 @@
|
|||||||
|
|
||||||
\page partition_page Partition
|
\page partition_page Partition
|
||||||
|
|
||||||
For detail description of the Partition operation please refer to
|
<ul>
|
||||||
|
<li>For a detailed description of the Partition operation please refer to
|
||||||
<a href="SALOME_BOA_PA.pdf">this document</a>.
|
<a href="SALOME_BOA_PA.pdf">this document</a>.
|
||||||
It provides a general review of the Partition and Boolean
|
It provides a general review of the Partition and Boolean
|
||||||
operations algorithms, describes the usage methodology and highlighs
|
operations algorithms, describes the usage methodology and highlights
|
||||||
major limitations of these operations.
|
major limitations of these operations.</li>
|
||||||
|
|
||||||
|
<li>Perhaps you also ask yourself : \ref partition_explanation "What's the difference between partition, compounds and fuse operation ?"</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
To produce a \b Partition in the <b>Main Menu</b> select <b>Operations - > Partition</b>
|
To produce a \b Partition in the <b>Main Menu</b> select <b>Operations - > Partition</b>
|
||||||
|
|
||||||
|
@ -4,15 +4,15 @@
|
|||||||
|
|
||||||
\tableofcontents
|
\tableofcontents
|
||||||
|
|
||||||
It is frequently asked about the difference between the above mentioned operations. It's indeed simple. Lets take the example of a cylinder and a box that you want to join together.
|
It is frequently asked about the difference between the above mentioned operations. It is indeed simple. Let us take the example of a cylinder and a box that you want to join together.
|
||||||
|
|
||||||
\section sec1 Fuse
|
\section sec1 Fuse
|
||||||
|
|
||||||
The \b fuse operation will make a <b>single solid</b> from the two given solids. It allows you to build complex models by putting simple shapes together.
|
The \b fuse operation will make a <b>single solid</b> from two given solids. It allows you to build complex models by putting simple shapes together.
|
||||||
\image html fuse.png
|
\image html fuse.png
|
||||||
|
|
||||||
\section sec2 Partition
|
\section sec2 Partition
|
||||||
The \b partition operation will also connect the two solids but it will <b>keep a face at the frontier</b> (in brown on the picture below). The resulting shape will consist in <b>two connected solids</b> that share
|
The \b partition operation will also connect the solids but it will <b>keep a face at the frontier</b> (in brown in the picture below). The resulting shape will consist of <b>two connected solids</b> that share
|
||||||
a face at their frontier. It means that this face is present only one time in the resulting shape and is a sub-shape of both the box and the cylinder.
|
a face at their frontier. It means that this face is present only one time in the resulting shape and is a sub-shape of both the box and the cylinder.
|
||||||
|
|
||||||
\n This operation allows you to identify different areas in a shape (e.g. different materials) and to ensure a <b>conformal mesh</b> when meshing it later. Indeed the face at the frontier is meshed only once.
|
\n This operation allows you to identify different areas in a shape (e.g. different materials) and to ensure a <b>conformal mesh</b> when meshing it later. Indeed the face at the frontier is meshed only once.
|
||||||
@ -21,10 +21,10 @@ a face at their frontier. It means that this face is present only one time in th
|
|||||||
|
|
||||||
|
|
||||||
\section sec3 Compound
|
\section sec3 Compound
|
||||||
When you build a \b compound by using the build -> compound operation you just make <b>an object that contains the two separate solids</b> like in a "bag".
|
When you build a \b compound by using the Build -> Compound operation you just make <b>an object that contains two separate solids</b> like in a "bag".
|
||||||
The two solids remain unconnected. The compound is just a set of shapes, no more.
|
The two solids remain unconnected. The compound is just a set of shapes, no more.
|
||||||
|
|
||||||
\n The compound Allows applying operations to a collection of shapes.
|
\n The compound allows applying operations to a collection of shapes.
|
||||||
|
|
||||||
\image html compound2.png
|
\image html compound2.png
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ In the frame of this example we can summarize the following differences:
|
|||||||
<li> \b Partition
|
<li> \b Partition
|
||||||
<ul>
|
<ul>
|
||||||
<li>\a Result : Two <b>connected solids</b> sharing faces.</li>
|
<li>\a Result : Two <b>connected solids</b> sharing faces.</li>
|
||||||
<li>\a Purpose : Useful to ensure a conformal mesh of separated areas of your model (fluid / solid , concrete / steel ...)</li>
|
<li>\a Purpose : Useful to ensure a conformal mesh of separate areas of your model (fluid / solid , concrete / steel ...).</li>
|
||||||
</ul>
|
</ul>
|
||||||
<li> \b Compound
|
<li> \b Compound
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -86,16 +86,17 @@ gg.createAndDisplayGO(id_pipetshapefillet_position)
|
|||||||
\code
|
\code
|
||||||
import geompy
|
import geompy
|
||||||
import salome
|
import salome
|
||||||
|
import GEOM
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create DividedDisk object
|
# create DividedDisk object
|
||||||
divideddisk = geompy.MakeDividedDisk(100, 50)
|
divideddisk = geompy.MakeDividedDisk(100, 1, GEOM.SQUARE)
|
||||||
|
|
||||||
# add object in the study
|
# add object in the study
|
||||||
id_divideddisk = geompy.addToStudy(divideddisk,"DividedDisk")
|
id_divideddisk = geompy.addToStudy(divideddisk,"DividedDisk")
|
||||||
|
|
||||||
# display divideddisk
|
# display divideddisk
|
||||||
gg.createAndDisplayGO(id_divideddisk)
|
gg.createAndDisplayGO(id_divideddisk)
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\anchor tui_creation_dividedcylinder
|
\anchor tui_creation_dividedcylinder
|
||||||
@ -104,16 +105,17 @@ gg.createAndDisplayGO(id_divideddisk)
|
|||||||
\code
|
\code
|
||||||
import geompy
|
import geompy
|
||||||
import salome
|
import salome
|
||||||
|
import GEOM
|
||||||
gg = salome.ImportComponentGUI("GEOM")
|
gg = salome.ImportComponentGUI("GEOM")
|
||||||
|
|
||||||
# create DividedCylinder object
|
# create DividedCylinder object
|
||||||
dividedcylinder = geompy.MakeDividedCylinder(100, 300)
|
dividedcylinder = geompy.MakeDividedCylinder(100, 300, GEOM.SQUARE)
|
||||||
|
|
||||||
# add object in the study
|
# add object in the study
|
||||||
id_dividedcylinder = geompy.addToStudy(dividedcylinder,"DividedCylinder")
|
id_dividedcylinder = geompy.addToStudy(dividedcylinder,"DividedCylinder")
|
||||||
|
|
||||||
# display dividedcylinder
|
# display dividedcylinder
|
||||||
gg.createAndDisplayGO(id_dividedcylinder)
|
gg.createAndDisplayGO(id_dividedcylinder)
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
<!--@@ insert new functions before this line @@ do not remove this line @@-->
|
<!--@@ insert new functions before this line @@ do not remove this line @@-->
|
||||||
|
@ -623,31 +623,78 @@ from math import pi
|
|||||||
spring = MakeSpring(50, 100, 2*pi, 1, 5, pi/2)
|
spring = MakeSpring(50, 100, 2*pi, 1, 5, pi/2)
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
|
|
||||||
|
\anchor tui_creation_pipe_path
|
||||||
|
<br><h2>Creation of a Middle Path</h2>
|
||||||
|
|
||||||
|
\code
|
||||||
|
import salome
|
||||||
|
import geompy
|
||||||
|
|
||||||
|
# Create a box
|
||||||
|
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||||
|
|
||||||
|
# Get two opposite faces
|
||||||
|
[Face_1,Face_2] = geompy.SubShapes(Box_1, [31, 33])
|
||||||
|
|
||||||
|
# Get edges
|
||||||
|
Box_1_edge_12 = geompy.GetSubShape(Box_1, [12])
|
||||||
|
Box_1_edge_22 = geompy.GetSubShape(Box_1, [22])
|
||||||
|
Box_1_edge_25 = geompy.GetSubShape(Box_1, [25])
|
||||||
|
Box_1_edge_29 = geompy.GetSubShape(Box_1, [29])
|
||||||
|
Box_1_edge_8 = geompy.GetSubShape(Box_1, [8])
|
||||||
|
Box_1_edge_18 = geompy.GetSubShape(Box_1, [18])
|
||||||
|
Box_1_edge_26 = geompy.GetSubShape(Box_1, [26])
|
||||||
|
Box_1_edge_30 = geompy.GetSubShape(Box_1, [30])
|
||||||
|
|
||||||
|
# These three calls to RestorePath return the same result
|
||||||
|
Path_1 = geompy.RestorePath(Box_1, Face_1, Face_2)
|
||||||
|
Path_2 = geompy.RestorePathEdges(Box_1, [Face_1], [Face_2])
|
||||||
|
Path_3 = geompy.RestorePathEdges(Box_1,
|
||||||
|
[Box_1_edge_12, Box_1_edge_22, Box_1_edge_25, Box_1_edge_29],
|
||||||
|
[Box_1_edge_8, Box_1_edge_18, Box_1_edge_26, Box_1_edge_30])
|
||||||
|
|
||||||
|
# Publish created objects
|
||||||
|
geompy.addToStudy( Box_1, 'Box_1' )
|
||||||
|
geompy.addToStudyInFather( Box_1, Face_1, 'Face_1' )
|
||||||
|
geompy.addToStudyInFather( Box_1, Face_2, 'Face_2' )
|
||||||
|
geompy.addToStudyInFather( Box_1, Box_1_edge_25, 'Box_1:edge_25' )
|
||||||
|
geompy.addToStudyInFather( Box_1, Box_1_edge_22, 'Box_1:edge_22' )
|
||||||
|
geompy.addToStudyInFather( Box_1, Box_1_edge_12, 'Box_1:edge_12' )
|
||||||
|
geompy.addToStudyInFather( Box_1, Box_1_edge_29, 'Box_1:edge_29' )
|
||||||
|
geompy.addToStudyInFather( Box_1, Box_1_edge_18, 'Box_1:edge_18' )
|
||||||
|
geompy.addToStudyInFather( Box_1, Box_1_edge_26, 'Box_1:edge_26' )
|
||||||
|
geompy.addToStudyInFather( Box_1, Box_1_edge_8, 'Box_1:edge_8' )
|
||||||
|
geompy.addToStudyInFather( Box_1, Box_1_edge_30, 'Box_1:edge_30' )
|
||||||
|
geompy.addToStudy( Path_1, 'Path_1' )
|
||||||
|
geompy.addToStudy( Path_2, 'Path_2' )
|
||||||
|
geompy.addToStudy( Path_3, 'Path_3' )
|
||||||
|
\endcode
|
||||||
|
|
||||||
<br><h2>Creation of Tangent Plane On Face</h2>
|
<br><h2>Creation of Tangent Plane On Face</h2>
|
||||||
\code
|
\code
|
||||||
import salome
|
import salome
|
||||||
import geompy
|
import geompy
|
||||||
|
|
||||||
# Create Vertexes for curve
|
# Create Vertexes for curve
|
||||||
Vertex_1 = geompy.MakeVertex(0, 0, 0)
|
Vertex_1 = geompy.MakeVertex(0, 0, 0)
|
||||||
Vertex_2 = geompy.MakeVertex(0, 90, 30)
|
Vertex_2 = geompy.MakeVertex(0, 90, 30)
|
||||||
Vertex_3 = geompy.MakeVertex(100, 90, 0)
|
Vertex_3 = geompy.MakeVertex(100, 90, 0)
|
||||||
Vertex_4 = geompy.MakeVertex(-100, 90, 0)
|
Vertex_4 = geompy.MakeVertex(-100, 90, 0)
|
||||||
# Create curve
|
# Create curve
|
||||||
Curve_1 = geompy.MakeInterpol([Vertex_4, Vertex_2, Vertex_3, Vertex_1])
|
Curve_1 = geompy.MakeInterpol([Vertex_4, Vertex_2, Vertex_3, Vertex_1])
|
||||||
# Create Face by Extrusion of the Curve
|
# Create Face by Extrusion of the Curve
|
||||||
Extrusion_1 = geompy.MakePrismDXDYDZ(Curve_1, 0, 30, -60)
|
Extrusion_1 = geompy.MakePrismDXDYDZ(Curve_1, 0, 30, -60)
|
||||||
# Make Tangent on this Extrusion (Face)
|
# Make Tangent on this Extrusion (Face)
|
||||||
Tangent_1 = geompy.MakeTangentPlaneOnFace(Extrusion_1, 0.7, 0.5, 150)
|
Tangent_1 = geompy.MakeTangentPlaneOnFace(Extrusion_1, 0.7, 0.5, 150)
|
||||||
# Publish in the study
|
# Publish in the study
|
||||||
geompy.addToStudy( Vertex_1, "Vertex_1" )
|
geompy.addToStudy( Vertex_1, "Vertex_1" )
|
||||||
geompy.addToStudy( Vertex_2, "Vertex_2" )
|
geompy.addToStudy( Vertex_2, "Vertex_2" )
|
||||||
geompy.addToStudy( Vertex_3, "Vertex_3" )
|
geompy.addToStudy( Vertex_3, "Vertex_3" )
|
||||||
geompy.addToStudy( Vertex_4, "Vertex_4" )
|
geompy.addToStudy( Vertex_4, "Vertex_4" )
|
||||||
geompy.addToStudy( Curve_1, "Curve_1" )
|
geompy.addToStudy( Curve_1, "Curve_1" )
|
||||||
geompy.addToStudy( Extrusion_1, "Extrusion_1" )
|
geompy.addToStudy( Extrusion_1, "Extrusion_1" )
|
||||||
geompy.addToStudy( Tangent_1, "Tangent_1" )
|
geompy.addToStudy( Tangent_1, "Tangent_1" )
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -14,7 +14,7 @@ geompy.addToStudy(box, 'box')
|
|||||||
geompy.addToStudy(cyl, 'cyl')
|
geompy.addToStudy(cyl, 'cyl')
|
||||||
|
|
||||||
# make a compound
|
# make a compound
|
||||||
compound = geompy.MakeCompound([box1, box2])
|
compound = geompy.MakeCompound([box, cyl])
|
||||||
geompy.addToStudy(compound, 'compound')
|
geompy.addToStudy(compound, 'compound')
|
||||||
|
|
||||||
# explore the compound
|
# explore the compound
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
\page work_with_groups_page Working with groups
|
\page work_with_groups_page Working with groups
|
||||||
|
|
||||||
Creation and editing groups of sub-shapes of a geometrical object makes
|
Creation and editing groups of sub-shapes of a geometrical object makes
|
||||||
handling sub-shapes much easier. Also some Boolean operations on
|
handling sub-shapes much easier. Boolean operations on
|
||||||
groups are available.
|
groups are also available.
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>\ref create_groups_anchor "Create a Group"</li>
|
<li>\ref create_groups_anchor "Create a Group"</li>
|
||||||
@ -142,7 +142,7 @@ The following dialog box will appear:
|
|||||||
\image html groups_union_dlg.png
|
\image html groups_union_dlg.png
|
||||||
|
|
||||||
In this dialog box you should specify the name of the resulting group
|
In this dialog box you should specify the name of the resulting group
|
||||||
and set of groups which will be united.
|
and select the groups, which will be united.
|
||||||
</li>
|
</li>
|
||||||
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm creation of the group.</li>
|
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm creation of the group.</li>
|
||||||
</ol>
|
</ol>
|
||||||
@ -155,7 +155,7 @@ and set of groups which will be united.
|
|||||||
<h2>Intersection of groups</h2>
|
<h2>Intersection of groups</h2>
|
||||||
|
|
||||||
This operation allows to create a new group in such a way that only
|
This operation allows to create a new group in such a way that only
|
||||||
sub-shapes that are present in all initial groups together are added to the
|
the sub-shapes that are present in all initial groups are added to the
|
||||||
new one.
|
new one.
|
||||||
|
|
||||||
<em>To intersect groups:</em>
|
<em>To intersect groups:</em>
|
||||||
@ -166,7 +166,7 @@ The following dialog box will appear:
|
|||||||
\image html groups_intersect_dlg.png
|
\image html groups_intersect_dlg.png
|
||||||
|
|
||||||
In this dialog box you should specify the name of the resulting group
|
In this dialog box you should specify the name of the resulting group
|
||||||
and set of groups which will be intersected.
|
and select the groups, which will be intersected.
|
||||||
</li>
|
</li>
|
||||||
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm creation of the group.</li>
|
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm creation of the group.</li>
|
||||||
</ol>
|
</ol>
|
||||||
@ -190,10 +190,9 @@ The following dialog box will appear:
|
|||||||
\image html groups_cut_dlg.png
|
\image html groups_cut_dlg.png
|
||||||
|
|
||||||
In this dialog box you should specify the name of the resulting group
|
In this dialog box you should specify the name of the resulting group
|
||||||
and groups which will be cut.
|
and the groups which will be cut.
|
||||||
</li>
|
</li>
|
||||||
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm creation of the
|
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm creation of the group.</li>
|
||||||
group.</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
Our <b>TUI Scripts</b> provide you with useful examples of
|
Our <b>TUI Scripts</b> provide you with useful examples of
|
||||||
|
@ -209,7 +209,10 @@ module GEOM
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Get an entry of the object in GEOM component.
|
* \brief Get internal (unique) entry of the object in the GEOM component's data tree.
|
||||||
|
* \note This is not an entry of the data object in SALOME study.
|
||||||
|
* This is internal function of GEOM component, though it can be used outside it for
|
||||||
|
appropriate reason (e.g. for unique identification of geometry object).
|
||||||
*/
|
*/
|
||||||
string GetEntry();
|
string GetEntry();
|
||||||
|
|
||||||
@ -715,6 +718,11 @@ module GEOM
|
|||||||
in double theTrimSize);
|
in double theTrimSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Interface for shapes transforming.
|
||||||
|
*
|
||||||
|
* Translation, rotation, scaling, mirroring, offset, projection, recomputing.
|
||||||
|
*/
|
||||||
interface GEOM_ITransformOperations : GEOM_IOperations
|
interface GEOM_ITransformOperations : GEOM_IOperations
|
||||||
{
|
{
|
||||||
/*!
|
/*!
|
||||||
@ -1077,7 +1085,8 @@ module GEOM
|
|||||||
* \param thePath Wire or Edge along that the object will be translated.
|
* \param thePath Wire or Edge along that the object will be translated.
|
||||||
* \param theDistance progress of Path (0 = actual location, 1 = end of path location).
|
* \param theDistance progress of Path (0 = actual location, 1 = end of path location).
|
||||||
* \param theCopy is a true or false parameter. true is to create a copy, false to move the object.
|
* \param theCopy is a true or false parameter. true is to create a copy, false to move the object.
|
||||||
* \param theReverse is a true or false parameter. true is to reverse direction, false is to move normal direction.
|
* \param theReverse is a true or false parameter. True is to reverse
|
||||||
|
* direction, false is to move normal direction.
|
||||||
* \return New GEOM_Object, containing the displaced shape.
|
* \return New GEOM_Object, containing the displaced shape.
|
||||||
*/
|
*/
|
||||||
GEOM_Object PositionAlongPath (in GEOM_Object theObject,
|
GEOM_Object PositionAlongPath (in GEOM_Object theObject,
|
||||||
@ -1105,7 +1114,6 @@ module GEOM
|
|||||||
GEOM_Object RecomputeObject (in GEOM_Object theObject);
|
GEOM_Object RecomputeObject (in GEOM_Object theObject);
|
||||||
};
|
};
|
||||||
|
|
||||||
// # GEOM_I3DPrimOperations:
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Interface for 3D primitives creation
|
* \brief Interface for 3D primitives creation
|
||||||
*
|
*
|
||||||
@ -1485,9 +1493,49 @@ module GEOM
|
|||||||
in GEOM_Object thePath,
|
in GEOM_Object thePath,
|
||||||
in GEOM_Object theVec);
|
in GEOM_Object theVec);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Build a middle path of a pipe-like shape.
|
||||||
|
*
|
||||||
|
* The path shape can be a wire or an edge.
|
||||||
|
* \param theShape It can be closed or unclosed pipe-like shell
|
||||||
|
* or a pipe-like solid.
|
||||||
|
* \param theBase1, theBase2 Two bases of the supposed pipe. This
|
||||||
|
* should be wires or faces of \a theShape.
|
||||||
|
* \note It is not assumed that exact or approximate copy of \a theShape
|
||||||
|
* can be obtained by applying existing Pipe operation on the
|
||||||
|
* resulting "Path" wire taking \a theBase1 as the base - it is not
|
||||||
|
* always possible; though in some particular cases it might work
|
||||||
|
* it is not guaranteed. Thus, RestorePath function should not be
|
||||||
|
* considered as an exact reverse operation of the Pipe.
|
||||||
|
* \return New GEOM_Object, containing an edge or wire that represent
|
||||||
|
* source pipe's "path".
|
||||||
|
*/
|
||||||
|
GEOM_Object RestorePath (in GEOM_Object theShape,
|
||||||
|
in GEOM_Object theBase1,
|
||||||
|
in GEOM_Object theBase2);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Build a middle path of a pipe-like shape.
|
||||||
|
*
|
||||||
|
* The path shape can be a wire or an edge.
|
||||||
|
* \param theShape It can be closed or unclosed pipe-like shell
|
||||||
|
* or a pipe-like solid.
|
||||||
|
* \param theBase1, theBase2 Two bases of the supposed pipe. This
|
||||||
|
* should be lists of edges of \a theShape.
|
||||||
|
* \note It is not assumed that exact or approximate copy of \a theShape
|
||||||
|
* can be obtained by applying existing Pipe operation on the
|
||||||
|
* resulting "Path" wire taking \a theBase1 as the base - it is not
|
||||||
|
* always possible; though in some particular cases it might work
|
||||||
|
* it is not guaranteed. Thus, RestorePath function should not be
|
||||||
|
* considered as an exact reverse operation of the Pipe.
|
||||||
|
* \return New GEOM_Object, containing an edge or wire that represent
|
||||||
|
* source pipe's "path".
|
||||||
|
*/
|
||||||
|
GEOM_Object RestorePathEdges (in GEOM_Object theShape,
|
||||||
|
in ListOfGO theBase1,
|
||||||
|
in ListOfGO theBase2);
|
||||||
};
|
};
|
||||||
|
|
||||||
// # GEOM_IShapesOperations
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Interface for Shapes creation:
|
* \brief Interface for Shapes creation:
|
||||||
*
|
*
|
||||||
@ -3244,8 +3292,9 @@ module GEOM
|
|||||||
* \param theFileName The file, containing the shape.
|
* \param theFileName The file, containing the shape.
|
||||||
* \param theFormatName Specify format for the file reading.
|
* \param theFormatName Specify format for the file reading.
|
||||||
* Available formats can be obtained with <VAR>ImportTranslators()</VAR> method.
|
* Available formats can be obtained with <VAR>ImportTranslators()</VAR> method.
|
||||||
* If format 'IGES_SCALE' is used instead 'IGES' length unit will be
|
* If format 'IGES_SCALE' is used instead of 'IGES' or
|
||||||
* set to 'meter' and result model will be scaled.
|
* format 'STEP_SCALE' is used instead of 'STEP',
|
||||||
|
* file length unit will be ignored (set to 'meter') and result model will be scaled.
|
||||||
* \return New GEOM_Object, containing the imported shape.
|
* \return New GEOM_Object, containing the imported shape.
|
||||||
*/
|
*/
|
||||||
GEOM_Object ImportFile (in string theFileName, in string theFormatName);
|
GEOM_Object ImportFile (in string theFileName, in string theFormatName);
|
||||||
|
@ -28,12 +28,15 @@
|
|||||||
class QButtonGroup;
|
class QButtonGroup;
|
||||||
class QDoubleSpinBox;
|
class QDoubleSpinBox;
|
||||||
class EntityGUI_3Spin;
|
class EntityGUI_3Spin;
|
||||||
|
class EntityGUI_Type;
|
||||||
class EntityGUI_Angles;
|
class EntityGUI_Angles;
|
||||||
class EntityGUI_Controls;
|
class EntityGUI_Controls;
|
||||||
class DlgRef_3Radio;
|
|
||||||
class SOCC_Prs;
|
class SOCC_Prs;
|
||||||
|
class gp_Dir;
|
||||||
|
|
||||||
#include <AIS_ListOfInteractive.hxx>
|
#include <AIS_ListOfInteractive.hxx>
|
||||||
|
#include <AIS_AngleDimension.hxx>
|
||||||
|
#include <AIS_LengthDimension.hxx>
|
||||||
|
|
||||||
#ifndef COORD_MIN
|
#ifndef COORD_MIN
|
||||||
# define COORD_MIN -1e+15
|
# define COORD_MIN -1e+15
|
||||||
@ -42,6 +45,9 @@ class SOCC_Prs;
|
|||||||
# define DBL_DIGITS_DISPLAY 16
|
# define DBL_DIGITS_DISPLAY 16
|
||||||
#endif // COORD_MIN
|
#endif // COORD_MIN
|
||||||
|
|
||||||
|
// For convenience
|
||||||
|
bool isSame (double d1, double d2);
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : EntityGUI_Dlg
|
// class : EntityGUI_Dlg
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -52,11 +58,21 @@ class EntityGUI_3DSketcherDlg : public GEOMBase_Skeleton
|
|||||||
|
|
||||||
struct XYZ
|
struct XYZ
|
||||||
{
|
{
|
||||||
XYZ() { x = y = z = 0.0; command = params = ""; }
|
XYZ() { x = y = z = 0.0; command = params = ""; L=A=T=0; }
|
||||||
double x, y, z; // for preview only
|
double x, y, z; // for preview only
|
||||||
|
int L, A, T; // for preview only
|
||||||
QString command;
|
QString command;
|
||||||
QString params;
|
QString params;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct prsType
|
||||||
|
{
|
||||||
|
prsType(){L=A=T=0;}
|
||||||
|
int L;
|
||||||
|
int A;
|
||||||
|
int T;
|
||||||
|
};
|
||||||
|
|
||||||
typedef QList<XYZ> XYZList;
|
typedef QList<XYZ> XYZList;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -82,10 +98,34 @@ private:
|
|||||||
const int = -1,
|
const int = -1,
|
||||||
const int = -1);
|
const int = -1);
|
||||||
|
|
||||||
|
Handle(AIS_LengthDimension) createAISLengthDimension(double theLength,
|
||||||
|
gp_Pnt P1,
|
||||||
|
gp_Pnt P2,
|
||||||
|
gp_Dir theNormal);
|
||||||
|
|
||||||
|
Handle(AIS_AngleDimension) createAISAngleDimension(double theAngle,
|
||||||
|
gp_Pnt P0,
|
||||||
|
gp_Pnt P1,
|
||||||
|
gp_Pnt P2);
|
||||||
|
|
||||||
|
void displayAngle(double theAngle,
|
||||||
|
gp_Pnt P0,
|
||||||
|
gp_Pnt P1,
|
||||||
|
gp_Pnt P2,
|
||||||
|
bool store = false);
|
||||||
|
|
||||||
|
void displayLength(gp_Pnt P1,
|
||||||
|
gp_Pnt P2,
|
||||||
|
gp_Dir theNormal,
|
||||||
|
bool store = false);
|
||||||
|
|
||||||
|
void displayText(std::string theText,
|
||||||
|
gp_Pnt P,
|
||||||
|
bool store = false);
|
||||||
|
|
||||||
void displayTrihedron( int );
|
void displayTrihedron( int );
|
||||||
|
|
||||||
void displayAngle( double, double, double, int, bool store = false );
|
void displayDimensions(bool store = false);
|
||||||
void displayLength( double theLength = -1.0, bool store = false, int type = 1);
|
|
||||||
|
|
||||||
bool createShapes( GEOM::GEOM_Object_ptr,
|
bool createShapes( GEOM::GEOM_Object_ptr,
|
||||||
TopoDS_Shape&,
|
TopoDS_Shape&,
|
||||||
@ -95,27 +135,38 @@ private:
|
|||||||
XYZ getPenultimatePoint() const;
|
XYZ getPenultimatePoint() const;
|
||||||
XYZ getCurrentPoint() const;
|
XYZ getCurrentPoint() const;
|
||||||
|
|
||||||
|
gp_Dir getPresentationPlane() const;
|
||||||
|
|
||||||
std::string doubleToString( double );
|
std::string doubleToString( double );
|
||||||
|
|
||||||
void removeLastIOFromPrs( int );
|
gp_Trsf toReferenceSystem(gp_Pnt origin) const;
|
||||||
void restoreLastIOToPrs( int );
|
gp_Trsf toCurrentSystem(gp_Pnt origin) const;
|
||||||
|
|
||||||
|
void removeLastIOFromPrs();
|
||||||
|
void restoreLastIOToPrs();
|
||||||
|
|
||||||
|
double radius(gp_Pnt) const;
|
||||||
|
double height(gp_Pnt) const;
|
||||||
|
double longitude(gp_Pnt) const;
|
||||||
|
double latitude(gp_Pnt) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XYZList myPointsList;
|
XYZList myPointsList;
|
||||||
XYZList myRedoList;
|
XYZList myRedoList;
|
||||||
AIS_ListOfInteractive myLengthIORedoList;
|
AIS_ListOfInteractive myLengthIORedoList;
|
||||||
AIS_ListOfInteractive myAngleIORedoList;
|
AIS_ListOfInteractive myAngleIORedoList;
|
||||||
int myPrsType;
|
AIS_ListOfInteractive myTextIORedoList;
|
||||||
std::list<int> myPrsTypeList;
|
prsType myPrsType;
|
||||||
std::list<int> myPrsTypeRedoList;
|
|
||||||
|
|
||||||
EntityGUI_3Spin* Group3Spin;
|
EntityGUI_3Spin* Group3Spin;
|
||||||
EntityGUI_Angles* GroupAngles;
|
EntityGUI_Angles* GroupAngles;
|
||||||
EntityGUI_Controls* GroupControls;
|
EntityGUI_Controls* GroupControls;
|
||||||
DlgRef_3Radio* GroupType;
|
EntityGUI_Type* GroupType;
|
||||||
QButtonGroup* myTypeGroup;
|
QButtonGroup* myTypeGroup1;
|
||||||
|
QButtonGroup* myTypeGroup2;
|
||||||
|
|
||||||
int myMode;
|
int myMode;
|
||||||
|
int myCoordType;
|
||||||
int myOrientation;
|
int myOrientation;
|
||||||
bool myOK;
|
bool myOK;
|
||||||
bool isLengthVisible;
|
bool isLengthVisible;
|
||||||
@ -125,6 +176,7 @@ private:
|
|||||||
GeometryGUI* myGeometryGUI;
|
GeometryGUI* myGeometryGUI;
|
||||||
SOCC_Prs* myAnglePrs;
|
SOCC_Prs* myAnglePrs;
|
||||||
SOCC_Prs* myLengthPrs;
|
SOCC_Prs* myLengthPrs;
|
||||||
|
SOCC_Prs* myTextPrs;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>351</width>
|
<width>488</width>
|
||||||
<height>148</height>
|
<height>172</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -27,7 +27,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="TextLabel4">
|
<widget class="QLabel" name="TextLabel1">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -42,10 +42,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1" colspan="2">
|
||||||
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DL"/>
|
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DL"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="3">
|
||||||
<widget class="QPushButton" name="buttonApply">
|
<widget class="QPushButton" name="buttonApply">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Create</string>
|
<string>Create</string>
|
||||||
@ -53,7 +53,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="TextLabel1">
|
<widget class="QLabel" name="TextLabel2">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -68,10 +68,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1" colspan="2">
|
||||||
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DA"/>
|
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DA"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
<item row="1" column="3">
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<property name="margin">
|
<property name="margin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
@ -95,7 +95,27 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="2" column="0">
|
||||||
|
<widget class="QCheckBox" name="checkBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>CheckBox</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1" colspan="2">
|
||||||
|
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DA2"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="checkBox_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>CheckBox</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1" colspan="2">
|
||||||
|
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DH"/>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="3">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="radioButton_1">
|
<widget class="QRadioButton" name="radioButton_1">
|
||||||
@ -120,16 +140,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QCheckBox" name="checkBox">
|
|
||||||
<property name="text">
|
|
||||||
<string>CheckBox</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DA2"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="CheckBox3">
|
<widget class="QCheckBox" name="CheckBox3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@ -56,13 +56,6 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="label_8">
|
|
||||||
<property name="text">
|
|
||||||
<string>Start:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_1">
|
<widget class="QLabel" name="label_1">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -93,13 +86,6 @@
|
|||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QLineEdit" name="lineEdit_3"/>
|
<widget class="QLineEdit" name="lineEdit_3"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="3">
|
|
||||||
<widget class="QLabel" name="label_7">
|
|
||||||
<property name="text">
|
|
||||||
<string>End:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
<item row="1" column="2">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -130,6 +116,20 @@
|
|||||||
<item row="3" column="3">
|
<item row="3" column="3">
|
||||||
<widget class="QLineEdit" name="lineEdit_6"/>
|
<widget class="QLineEdit" name="lineEdit_6"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="text">
|
||||||
|
<string>Start :</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<widget class="QLabel" name="label_8">
|
||||||
|
<property name="text">
|
||||||
|
<string>End :</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
87
src/EntityGUI/EntityGUI_Type_QTD.ui
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>EntityGUI_Type_QTD</class>
|
||||||
|
<widget class="QWidget" name="EntityGUI_Type_QTD">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>271</width>
|
||||||
|
<height>92</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="GroupType2">
|
||||||
|
<property name="title">
|
||||||
|
<string>GroupBox</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="RadioButton3">
|
||||||
|
<property name="text">
|
||||||
|
<string>RadioButton3</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoExclusive">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="RadioButton4">
|
||||||
|
<property name="text">
|
||||||
|
<string>RadioButton4</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoExclusive">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="GroupType1">
|
||||||
|
<property name="title">
|
||||||
|
<string>GroupBox</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="RadioButton1">
|
||||||
|
<property name="text">
|
||||||
|
<string>RadioButton1</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoExclusive">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="RadioButton2">
|
||||||
|
<property name="text">
|
||||||
|
<string>RadioButton2</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoExclusive">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
|
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>RadioButton3</tabstop>
|
||||||
|
</tabstops>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@ -210,6 +210,20 @@ EntityGUI_Point::~EntityGUI_Point()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////
|
||||||
|
// EntityGUI_Type
|
||||||
|
//////////////////////////////////////////
|
||||||
|
|
||||||
|
EntityGUI_Type::EntityGUI_Type( QWidget* parent, Qt::WindowFlags f )
|
||||||
|
: QWidget( parent, f )
|
||||||
|
{
|
||||||
|
setupUi( this );
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityGUI_Type::~EntityGUI_Type()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////
|
//////////////////////////////////////////
|
||||||
// EntityGUI_Angles
|
// EntityGUI_Angles
|
||||||
//////////////////////////////////////////
|
//////////////////////////////////////////
|
||||||
|
@ -222,6 +222,22 @@ public:
|
|||||||
QButtonGroup* ButtonGroup;
|
QButtonGroup* ButtonGroup;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//////////////////////////////////////////
|
||||||
|
// EntityGUI_Type
|
||||||
|
//////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "ui_EntityGUI_Type_QTD.h"
|
||||||
|
|
||||||
|
class EntityGUI_Type : public QWidget,
|
||||||
|
public Ui::EntityGUI_Type_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
EntityGUI_Type( QWidget* = 0, Qt::WindowFlags = 0 );
|
||||||
|
~EntityGUI_Type();
|
||||||
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////
|
//////////////////////////////////////////
|
||||||
// EntityGUI_Angles
|
// EntityGUI_Angles
|
||||||
//////////////////////////////////////////
|
//////////////////////////////////////////
|
||||||
|
@ -85,6 +85,7 @@ UIC_FILES = \
|
|||||||
ui_EntityGUI_Dir2_QTD.h \
|
ui_EntityGUI_Dir2_QTD.h \
|
||||||
ui_EntityGUI_Point_QTD.h \
|
ui_EntityGUI_Point_QTD.h \
|
||||||
ui_EntityGUI_Skeleton_QTD.h \
|
ui_EntityGUI_Skeleton_QTD.h \
|
||||||
|
ui_EntityGUI_Type_QTD.h \
|
||||||
ui_EntityGUI_Angles_QTD.h \
|
ui_EntityGUI_Angles_QTD.h \
|
||||||
ui_EntityGUI_Controls_QTD.h
|
ui_EntityGUI_Controls_QTD.h
|
||||||
|
|
||||||
|
@ -1101,10 +1101,19 @@ bool ProcessFunction(Handle(GEOM_Function)& theFunction,
|
|||||||
else if (aCMDpref == "WW") {
|
else if (aCMDpref == "WW") {
|
||||||
aNewDescr += "sk.close()";
|
aNewDescr += "sk.close()";
|
||||||
}
|
}
|
||||||
else {
|
else if (aCMDpref.Value(1) == 'O'){
|
||||||
aNewDescr += "sk.addPointAnglesLength(\"";
|
TCollection_AsciiString aCMDtrunc = aStrVals.Value(1);
|
||||||
aNewDescr += aCMDpref + "\", " +
|
aCMDtrunc.Trunc(3);
|
||||||
aStrVals.Value(2) + ", " + aStrVals.Value(3) + ", " + aStrVals.Value(4) + ")";
|
if (aCMDpref.Value(4) == 'C')
|
||||||
|
aNewDescr += "sk.addPointRadiusAngleH";
|
||||||
|
else
|
||||||
|
aNewDescr += "sk.addPointRadiusAngles";
|
||||||
|
if (aCMDpref.Value(5) == 'A')
|
||||||
|
aNewDescr += "Absolute(";
|
||||||
|
else
|
||||||
|
aNewDescr += "Relative(";
|
||||||
|
aNewDescr += aStrVals.Value(4) + ", " +
|
||||||
|
aStrVals.Value(2) + ", " + aStrVals.Value(3) + ", " + "\""+aCMDtrunc+"\"" + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aNewDescr += "\n\t";
|
aNewDescr += "\n\t";
|
||||||
|
@ -40,6 +40,8 @@
|
|||||||
#include <ShapeFix_Edge.hxx>
|
#include <ShapeFix_Edge.hxx>
|
||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
#include <Geom2d_Curve.hxx>
|
#include <Geom2d_Curve.hxx>
|
||||||
|
#include <GProp_GProps.hxx>
|
||||||
|
#include <BRepGProp.hxx>
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -88,6 +90,16 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
|
|||||||
if(Vmax > PI2 - Precision::PConfusion() || Vmin < -PI2+::Precision::PConfusion()) {
|
if(Vmax > PI2 - Precision::PConfusion() || Vmin < -PI2+::Precision::PConfusion()) {
|
||||||
Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S);
|
Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S);
|
||||||
gp_Sphere sp = aSphere->Sphere();
|
gp_Sphere sp = aSphere->Sphere();
|
||||||
|
//modified by jgv, 12.11.2012 for issue 21777//
|
||||||
|
Standard_Real Radius = sp.Radius();
|
||||||
|
Standard_Real HalfArea = 2.*M_PI*Radius*Radius;
|
||||||
|
GProp_GProps Properties;
|
||||||
|
BRepGProp::SurfaceProperties(aFace, Properties);
|
||||||
|
Standard_Real anArea = Properties.Mass();
|
||||||
|
Standard_Real AreaTol = Radius*Radius*1.e-6;
|
||||||
|
if (anArea > HalfArea - AreaTol) //no chance to avoid singularity
|
||||||
|
return Standard_False;
|
||||||
|
///////////////////////////////////////////////
|
||||||
gp_Ax3 ax3 = sp.Position();
|
gp_Ax3 ax3 = sp.Position();
|
||||||
if(Abs(Vmax-Vmin) < PI2) {
|
if(Abs(Vmax-Vmin) < PI2) {
|
||||||
gp_Ax3 axnew3(ax3.Axis().Location(), ax3.Direction()^ax3.XDirection(),ax3.XDirection());
|
gp_Ax3 axnew3(ax3.Axis().Location(), ax3.Direction()^ax3.XDirection(),ax3.XDirection());
|
||||||
|
@ -101,11 +101,10 @@ static
|
|||||||
const Standard_Integer ,
|
const Standard_Integer ,
|
||||||
NMTTools_IndexedDataMapOfIndexedMapOfInteger& );
|
NMTTools_IndexedDataMapOfIndexedMapOfInteger& );
|
||||||
|
|
||||||
//modified by NIZNHY-PKV Thu Feb 16 12:24:52 2012f
|
|
||||||
static
|
static
|
||||||
Standard_Boolean IsClosed(const TopoDS_Edge& ,
|
Standard_Boolean IsClosed(const TopoDS_Edge& ,
|
||||||
const TopoDS_Face& );
|
const TopoDS_Face&,
|
||||||
//modified by NIZNHY-PKV Thu Feb 16 12:24:56 2012t
|
Standard_Boolean& );
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : FillImagesFaces
|
//function : FillImagesFaces
|
||||||
@ -216,6 +215,7 @@ void GEOMAlgo_Builder::BuildSplitFaces()
|
|||||||
const Handle(IntTools_Context)& aCtx= pPF->Context();
|
const Handle(IntTools_Context)& aCtx= pPF->Context();
|
||||||
//
|
//
|
||||||
Standard_Boolean bToReverse, bIsClosed, bIsDegenerated;
|
Standard_Boolean bToReverse, bIsClosed, bIsDegenerated;
|
||||||
|
Standard_Boolean bFlagClosed;
|
||||||
Standard_Integer i, aNb, aNbF, nF;
|
Standard_Integer i, aNb, aNbF, nF;
|
||||||
TopTools_MapOfShape aMFence;
|
TopTools_MapOfShape aMFence;
|
||||||
TColStd_IndexedMapOfInteger aMFP;
|
TColStd_IndexedMapOfInteger aMFP;
|
||||||
@ -312,10 +312,7 @@ void GEOMAlgo_Builder::BuildSplitFaces()
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
bIsDegenerated=BRep_Tool::Degenerated(aE);
|
bIsDegenerated=BRep_Tool::Degenerated(aE);
|
||||||
//modified by NIZNHY-PKV Wed Mar 07 07:46:09 2012f
|
bIsClosed=IsClosed(aE, aF, bFlagClosed);
|
||||||
bIsClosed=IsClosed(aE, aF);
|
|
||||||
//bIsClosed=BRep_Tool::IsClosed(aE, aF);
|
|
||||||
//modified by NIZNHY-PKV Wed Mar 07 07:46:13 2012t
|
|
||||||
//
|
//
|
||||||
const TopTools_ListOfShape& aLIE=myImages.Image(aE);
|
const TopTools_ListOfShape& aLIE=myImages.Image(aE);
|
||||||
aIt.Initialize(aLIE);
|
aIt.Initialize(aLIE);
|
||||||
@ -349,7 +346,16 @@ void GEOMAlgo_Builder::BuildSplitFaces()
|
|||||||
aWES.AddStartElement(aSp);
|
aWES.AddStartElement(aSp);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}// if (aMFence.Add(aSp))
|
}// if (bIsClosed){
|
||||||
|
//
|
||||||
|
//modified by NIZNHY-PKV Wed Nov 28 13:50:34 2012f
|
||||||
|
if (!bIsClosed && bFlagClosed) {
|
||||||
|
if (!BRep_Tool::IsClosed(aSp, aF)){
|
||||||
|
BOPTools_Tools3D::DoSplitSEAMOnFace(aSp, aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//modified by NIZNHY-PKV Wed Nov 28 13:50:36 2012t
|
||||||
|
//
|
||||||
//
|
//
|
||||||
aSp.Orientation(anOriE);
|
aSp.Orientation(anOriE);
|
||||||
bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, aCtx);
|
bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, aCtx);
|
||||||
@ -942,11 +948,13 @@ void UpdateCandidates(const Standard_Integer theNF,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean IsClosed(const TopoDS_Edge& aE,
|
Standard_Boolean IsClosed(const TopoDS_Edge& aE,
|
||||||
const TopoDS_Face& aF)
|
const TopoDS_Face& aF,
|
||||||
|
Standard_Boolean& bFlag)
|
||||||
{
|
{
|
||||||
Standard_Boolean bRet;
|
Standard_Boolean bRet;
|
||||||
//
|
//
|
||||||
bRet=BRep_Tool::IsClosed(aE, aF);
|
bRet=BRep_Tool::IsClosed(aE, aF);
|
||||||
|
bFlag=bRet;
|
||||||
if (bRet) {
|
if (bRet) {
|
||||||
Standard_Integer iCnt;
|
Standard_Integer iCnt;
|
||||||
TopoDS_Shape aE1;
|
TopoDS_Shape aE1;
|
||||||
|
@ -78,12 +78,25 @@
|
|||||||
#include <GEOMAlgo_PassKey.hxx>
|
#include <GEOMAlgo_PassKey.hxx>
|
||||||
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
|
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
|
||||||
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
|
||||||
|
//
|
||||||
|
#include <gp_Dir2d.hxx>
|
||||||
|
#include <gp_Pnt2d.hxx>
|
||||||
|
#include <Geom2d_Line.hxx>
|
||||||
|
#include <Geom2dAdaptor_Curve.hxx>
|
||||||
|
#include <Geom2dHatch_Hatcher.hxx>
|
||||||
|
#include <TColStd_ListOfInteger.hxx>
|
||||||
|
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||||
|
#include <HatchGen_Domain.hxx>
|
||||||
|
#include <Geom2dHatch_Hatcher.hxx>
|
||||||
|
#include <IntTools_Context.hxx>
|
||||||
|
#include <BRepTools.hxx>
|
||||||
|
#include <IntTools_Tools.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : GEOMAlgo_FinderShapeOn1
|
//function : GEOMAlgo_FinderShapeOn1
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
GEOMAlgo_FinderShapeOn2::GEOMAlgo_FinderShapeOn2()
|
GEOMAlgo_FinderShapeOn2::GEOMAlgo_FinderShapeOn2()
|
||||||
:
|
:
|
||||||
GEOMAlgo_ShapeAlgo()
|
GEOMAlgo_ShapeAlgo()
|
||||||
{
|
{
|
||||||
@ -97,14 +110,14 @@
|
|||||||
//function : ~
|
//function : ~
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
GEOMAlgo_FinderShapeOn2::~GEOMAlgo_FinderShapeOn2()
|
GEOMAlgo_FinderShapeOn2::~GEOMAlgo_FinderShapeOn2()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetClsf
|
//function : SetClsf
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::SetClsf(const Handle(GEOMAlgo_Clsf)& aClsf)
|
void GEOMAlgo_FinderShapeOn2::SetClsf(const Handle(GEOMAlgo_Clsf)& aClsf)
|
||||||
{
|
{
|
||||||
myClsf=aClsf;
|
myClsf=aClsf;
|
||||||
}
|
}
|
||||||
@ -112,7 +125,7 @@
|
|||||||
//function : Clsf
|
//function : Clsf
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
const Handle(GEOMAlgo_Clsf)& GEOMAlgo_FinderShapeOn2::Clsf() const
|
const Handle(GEOMAlgo_Clsf)& GEOMAlgo_FinderShapeOn2::Clsf() const
|
||||||
{
|
{
|
||||||
return myClsf;
|
return myClsf;
|
||||||
}
|
}
|
||||||
@ -120,7 +133,7 @@
|
|||||||
//function : SetShapeType
|
//function : SetShapeType
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::SetShapeType(const TopAbs_ShapeEnum aType)
|
void GEOMAlgo_FinderShapeOn2::SetShapeType(const TopAbs_ShapeEnum aType)
|
||||||
{
|
{
|
||||||
myShapeType=aType;
|
myShapeType=aType;
|
||||||
}
|
}
|
||||||
@ -128,7 +141,7 @@
|
|||||||
//function : ShapeType
|
//function : ShapeType
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn2::ShapeType()const
|
TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn2::ShapeType()const
|
||||||
{
|
{
|
||||||
return myShapeType;
|
return myShapeType;
|
||||||
}
|
}
|
||||||
@ -136,7 +149,7 @@
|
|||||||
//function : SetState
|
//function : SetState
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::SetState(const GEOMAlgo_State aState)
|
void GEOMAlgo_FinderShapeOn2::SetState(const GEOMAlgo_State aState)
|
||||||
{
|
{
|
||||||
myState=aState;
|
myState=aState;
|
||||||
}
|
}
|
||||||
@ -144,7 +157,7 @@
|
|||||||
//function : State
|
//function : State
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
GEOMAlgo_State GEOMAlgo_FinderShapeOn2::State() const
|
GEOMAlgo_State GEOMAlgo_FinderShapeOn2::State() const
|
||||||
{
|
{
|
||||||
return myState;
|
return myState;
|
||||||
}
|
}
|
||||||
@ -152,7 +165,7 @@
|
|||||||
//function : SetNbPntsMin
|
//function : SetNbPntsMin
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::SetNbPntsMin(const Standard_Integer aNb)
|
void GEOMAlgo_FinderShapeOn2::SetNbPntsMin(const Standard_Integer aNb)
|
||||||
{
|
{
|
||||||
myNbPntsMin=aNb;
|
myNbPntsMin=aNb;
|
||||||
}
|
}
|
||||||
@ -160,7 +173,7 @@
|
|||||||
//function : NbPntsMin
|
//function : NbPntsMin
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Integer GEOMAlgo_FinderShapeOn2::NbPntsMin()const
|
Standard_Integer GEOMAlgo_FinderShapeOn2::NbPntsMin()const
|
||||||
{
|
{
|
||||||
return myNbPntsMin;
|
return myNbPntsMin;
|
||||||
}
|
}
|
||||||
@ -168,7 +181,7 @@
|
|||||||
//function : SetNbPntsMax
|
//function : SetNbPntsMax
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::SetNbPntsMax(const Standard_Integer aNb)
|
void GEOMAlgo_FinderShapeOn2::SetNbPntsMax(const Standard_Integer aNb)
|
||||||
{
|
{
|
||||||
myNbPntsMax=aNb;
|
myNbPntsMax=aNb;
|
||||||
}
|
}
|
||||||
@ -176,7 +189,7 @@
|
|||||||
//function : NbPntsMax
|
//function : NbPntsMax
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Integer GEOMAlgo_FinderShapeOn2::NbPntsMax()const
|
Standard_Integer GEOMAlgo_FinderShapeOn2::NbPntsMax()const
|
||||||
{
|
{
|
||||||
return myNbPntsMax;
|
return myNbPntsMax;
|
||||||
}
|
}
|
||||||
@ -192,7 +205,7 @@
|
|||||||
// function: Shapes
|
// function: Shapes
|
||||||
// purpose:
|
// purpose:
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
const TopTools_ListOfShape& GEOMAlgo_FinderShapeOn2::Shapes() const
|
const TopTools_ListOfShape& GEOMAlgo_FinderShapeOn2::Shapes() const
|
||||||
{
|
{
|
||||||
Standard_Integer i, aNb;
|
Standard_Integer i, aNb;
|
||||||
TopTools_ListOfShape* pL;
|
TopTools_ListOfShape* pL;
|
||||||
@ -213,7 +226,7 @@
|
|||||||
//function : Perform
|
//function : Perform
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::Perform()
|
void GEOMAlgo_FinderShapeOn2::Perform()
|
||||||
{
|
{
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
myWarningStatus=0;
|
myWarningStatus=0;
|
||||||
@ -265,7 +278,7 @@
|
|||||||
//function : CheckData
|
//function : CheckData
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::CheckData()
|
void GEOMAlgo_FinderShapeOn2::CheckData()
|
||||||
{
|
{
|
||||||
Standard_Integer iErr;
|
Standard_Integer iErr;
|
||||||
//
|
//
|
||||||
@ -306,7 +319,7 @@
|
|||||||
//function : ProcessVertices
|
//function : ProcessVertices
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::ProcessVertices()
|
void GEOMAlgo_FinderShapeOn2::ProcessVertices()
|
||||||
{
|
{
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
//
|
//
|
||||||
@ -347,7 +360,7 @@
|
|||||||
//function : ProcessEdges
|
//function : ProcessEdges
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::ProcessEdges()
|
void GEOMAlgo_FinderShapeOn2::ProcessEdges()
|
||||||
{
|
{
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
//
|
//
|
||||||
@ -450,7 +463,7 @@
|
|||||||
//function : ProcessFaces
|
//function : ProcessFaces
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::ProcessFaces()
|
void GEOMAlgo_FinderShapeOn2::ProcessFaces()
|
||||||
{
|
{
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
//
|
//
|
||||||
@ -545,7 +558,7 @@
|
|||||||
//function : ProcessSolids
|
//function : ProcessSolids
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::ProcessSolids()
|
void GEOMAlgo_FinderShapeOn2::ProcessSolids()
|
||||||
{
|
{
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
//
|
//
|
||||||
@ -592,11 +605,9 @@
|
|||||||
//function : InnerPoints
|
//function : InnerPoints
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF,
|
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF,
|
||||||
GEOMAlgo_ListOfPnt& aLP)
|
GEOMAlgo_ListOfPnt& aLP)
|
||||||
{
|
{
|
||||||
myErrorStatus=0;
|
|
||||||
//
|
|
||||||
Standard_Integer j, j1, j2, k, n[4], aNbLinks, aNx, aNb, iCnt;//, aNbMax, *pIds;
|
Standard_Integer j, j1, j2, k, n[4], aNbLinks, aNx, aNb, iCnt;//, aNbMax, *pIds;
|
||||||
TopLoc_Location aLoc;
|
TopLoc_Location aLoc;
|
||||||
Handle(Poly_Triangulation) aTRF;
|
Handle(Poly_Triangulation) aTRF;
|
||||||
@ -604,6 +615,8 @@
|
|||||||
GEOMAlgo_DataMapOfPassKeyInteger aMPKI;
|
GEOMAlgo_DataMapOfPassKeyInteger aMPKI;
|
||||||
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger aIt;
|
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger aIt;
|
||||||
gp_Pnt aP, aP1, aP2;
|
gp_Pnt aP, aP1, aP2;
|
||||||
|
//
|
||||||
|
myErrorStatus=0;
|
||||||
//
|
//
|
||||||
aLP.Clear();
|
aLP.Clear();
|
||||||
//
|
//
|
||||||
@ -648,20 +661,11 @@
|
|||||||
iCnt=aIt.Value();
|
iCnt=aIt.Value();
|
||||||
if (iCnt==1) {
|
if (iCnt==1) {
|
||||||
const GEOMAlgo_PassKey& aPK=aIt.Key();
|
const GEOMAlgo_PassKey& aPK=aIt.Key();
|
||||||
//qf
|
|
||||||
/*
|
|
||||||
aNbMax=aPK.NbMax();
|
|
||||||
pIds=(Standard_Integer*)aPK.Key();
|
|
||||||
for (k=1; k<3; ++k) {
|
|
||||||
aNx=*(pIds+aNbMax-k);
|
|
||||||
aMBN.Add(aNx);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
aNx=(Standard_Integer)aPK.Id(1);
|
aNx=(Standard_Integer)aPK.Id(1);
|
||||||
aMBN.Add(aNx);
|
aMBN.Add(aNx);
|
||||||
aNx=(Standard_Integer)aPK.Id(2);
|
aNx=(Standard_Integer)aPK.Id(2);
|
||||||
aMBN.Add(aNx);
|
aMBN.Add(aNx);
|
||||||
//qt
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -677,74 +681,76 @@
|
|||||||
//
|
//
|
||||||
aNb=aLP.Extent();
|
aNb=aLP.Extent();
|
||||||
//
|
//
|
||||||
if (!aNb && myNbPntsMin) {
|
//modified by NIZNHY-PKV Mon Sep 24 08:42:32 2012f
|
||||||
// try to fill it yourself
|
if (!aNb && myNbPntsMin) { // A
|
||||||
Standard_Boolean bIsDone;
|
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
|
||||||
Standard_Integer aN1, aN2;
|
Standard_Integer i, aNb, aIx, iErr, aNbDomains;
|
||||||
|
Standard_Real aUMin, aUMax, aVMin, aVMax, dU, aUx, aVx, aV1, aV2;
|
||||||
|
gp_Pnt aPx;
|
||||||
|
gp_Dir2d aD2D (0., 1.);
|
||||||
|
gp_Pnt2d aP2D;
|
||||||
|
Handle(Geom2d_Line) aL2D;
|
||||||
Handle(Geom_Surface) aS;
|
Handle(Geom_Surface) aS;
|
||||||
GeomAdaptor_Surface aGAS;
|
TopoDS_Face aFF;
|
||||||
GeomAbs_SurfaceType aType;
|
|
||||||
//
|
//
|
||||||
aS=BRep_Tool::Surface(aF);
|
aFF=aF;
|
||||||
aGAS.Load(aS);
|
aFF.Orientation (TopAbs_FORWARD);
|
||||||
aType=aGAS.GetType();
|
//
|
||||||
if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) {
|
Geom2dHatch_Hatcher& aHatcher=myContext->Hatcher(aFF);
|
||||||
// inner links
|
//
|
||||||
aNbLinks=aMPKI.Extent();
|
aS=BRep_Tool::Surface(aFF);
|
||||||
aIt.Initialize(aMPKI);
|
BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
|
||||||
for (; aIt.More(); aIt.Next()) {
|
//
|
||||||
iCnt=aIt.Value();
|
aNb=myNbPntsMin+1;
|
||||||
if (iCnt>1) {
|
dU=(aUMax-aUMin)/aNb;
|
||||||
// take the first having occured inner link
|
for (i=1; i<aNb; ++i) {
|
||||||
// and discretize it
|
aUx=aUMin+i*dU;
|
||||||
const GEOMAlgo_PassKey& aPK=aIt.Key();
|
aP2D.SetCoord(aUx, 0.);
|
||||||
//qf
|
aL2D=new Geom2d_Line (aP2D, aD2D);
|
||||||
/*
|
Geom2dAdaptor_Curve aHCur(aL2D);
|
||||||
aNbMax=aPK.NbMax();
|
//
|
||||||
pIds=(Standard_Integer*)aPK.Key();
|
aHatcher.ClrHatchings();
|
||||||
aN1=*(pIds+aNbMax-1);
|
aIx=aHatcher.AddHatching(aHCur);
|
||||||
aN2=*(pIds+aNbMax-2);
|
//
|
||||||
*/
|
aHatcher.Trim(aIx);
|
||||||
//
|
bIsDone=aHatcher.TrimDone(aIx);
|
||||||
aN1=(Standard_Integer)aPK.Id(1);
|
if (!bIsDone) {
|
||||||
aN2=(Standard_Integer)aPK.Id(2);
|
myErrorStatus=42;
|
||||||
//qt
|
return;
|
||||||
aP1=aNodes(aN1).Transformed(aTrsf);
|
}
|
||||||
aP2=aNodes(aN2).Transformed(aTrsf);
|
//
|
||||||
//
|
aHatcher.ComputeDomains(aIx);
|
||||||
if (aType==GeomAbs_Cylinder) {
|
bIsDone=aHatcher.IsDone(aIx);
|
||||||
Standard_Real aTolSM;
|
if (!bIsDone) {
|
||||||
gp_Cylinder aCyl;
|
continue;
|
||||||
//
|
}
|
||||||
aTolSM=1.523e-6;//~1.-cos(0.1 deg)
|
//
|
||||||
aCyl=aGAS.Cylinder();
|
aNbDomains=aHatcher.NbDomains(aIx);
|
||||||
if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, aTolSM)) {
|
for (j=1; j<=aNbDomains; ++j) {
|
||||||
continue;
|
const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, j) ;
|
||||||
}
|
// 1
|
||||||
}
|
bHasFirstPoint=aDomain.HasFirstPoint();
|
||||||
//
|
bHasSecondPoint=aDomain.HasSecondPoint();
|
||||||
BRepLib_MakeEdge aBME(aP1, aP2);
|
if (!bHasFirstPoint || !bHasSecondPoint) {
|
||||||
bIsDone=aBME.IsDone();
|
continue;
|
||||||
if (!bIsDone) {
|
}
|
||||||
myErrorStatus=30; //can not obtain the line fron the link
|
// 2
|
||||||
return;
|
aV1=aDomain.FirstPoint().Parameter();
|
||||||
}
|
aV2=aDomain.SecondPoint().Parameter();
|
||||||
//
|
aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
|
||||||
const TopoDS_Shape& aSx=aBME.Shape();
|
// 3
|
||||||
const TopoDS_Edge& aE=TopoDS::Edge(aSx);
|
aS->D0(aUx, aVx, aPx);
|
||||||
//
|
aLP.Append(aPx);
|
||||||
InnerPoints(aE, myNbPntsMin, aLP);
|
break;
|
||||||
break;
|
}
|
||||||
}// if (iCnt>1)
|
}// for (i=1; i<aNb; ++i) {
|
||||||
}// for (; aIt.More(); aIt.Next())
|
|
||||||
}// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder)
|
|
||||||
}// if (!aNb && myNbPntsMin) {
|
}// if (!aNb && myNbPntsMin) {
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : InnerPoints
|
//function : InnerPoints
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
|
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
|
||||||
GEOMAlgo_ListOfPnt& aLP)
|
GEOMAlgo_ListOfPnt& aLP)
|
||||||
{
|
{
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
@ -800,7 +806,7 @@
|
|||||||
//function : InnerPoints
|
//function : InnerPoints
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
|
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
|
||||||
const Standard_Integer aNbPntsMin,
|
const Standard_Integer aNbPntsMin,
|
||||||
GEOMAlgo_ListOfPnt& aLP)
|
GEOMAlgo_ListOfPnt& aLP)
|
||||||
{
|
{
|
||||||
@ -843,3 +849,63 @@
|
|||||||
// 30- can not obtain the line from the link
|
// 30- can not obtain the line from the link
|
||||||
// 40- point can not be classified
|
// 40- point can not be classified
|
||||||
// 41- invalid data for classifier
|
// 41- invalid data for classifier
|
||||||
|
// 42- can not compute hatching
|
||||||
|
|
||||||
|
/*
|
||||||
|
// A
|
||||||
|
if (!aNb && myNbPntsMin) {
|
||||||
|
// try to fill it yourself
|
||||||
|
Standard_Boolean bIsDone;
|
||||||
|
Standard_Integer aN1, aN2;
|
||||||
|
Handle(Geom_Surface) aS;
|
||||||
|
GeomAdaptor_Surface aGAS;
|
||||||
|
GeomAbs_SurfaceType aType;
|
||||||
|
//
|
||||||
|
aS=BRep_Tool::Surface(aF);
|
||||||
|
aGAS.Load(aS);
|
||||||
|
aType=aGAS.GetType();
|
||||||
|
if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) {
|
||||||
|
// inner links
|
||||||
|
aNbLinks=aMPKI.Extent();
|
||||||
|
aIt.Initialize(aMPKI);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
iCnt=aIt.Value();
|
||||||
|
if (iCnt>1) {
|
||||||
|
// take the first having occured inner link
|
||||||
|
// and discretize it
|
||||||
|
const GEOMAlgo_PassKey& aPK=aIt.Key();
|
||||||
|
//
|
||||||
|
aN1=(Standard_Integer)aPK.Id(1);
|
||||||
|
aN2=(Standard_Integer)aPK.Id(2);
|
||||||
|
//
|
||||||
|
aP1=aNodes(aN1).Transformed(aTrsf);
|
||||||
|
aP2=aNodes(aN2).Transformed(aTrsf);
|
||||||
|
//
|
||||||
|
if (aType==GeomAbs_Cylinder) {
|
||||||
|
Standard_Real aTolSM;
|
||||||
|
gp_Cylinder aCyl;
|
||||||
|
//
|
||||||
|
aTolSM=1.523e-6;//~1.-cos(0.1 deg)
|
||||||
|
aCyl=aGAS.Cylinder();
|
||||||
|
if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, aTolSM)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
BRepLib_MakeEdge aBME(aP1, aP2);
|
||||||
|
bIsDone=aBME.IsDone();
|
||||||
|
if (!bIsDone) {
|
||||||
|
myErrorStatus=30; //can not obtain the line fron the link
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const TopoDS_Shape& aSx=aBME.Shape();
|
||||||
|
const TopoDS_Edge& aE=TopoDS::Edge(aSx);
|
||||||
|
//
|
||||||
|
InnerPoints(aE, myNbPntsMin, aLP);
|
||||||
|
break;
|
||||||
|
}// if (iCnt>1)
|
||||||
|
}// for (; aIt.More(); aIt.Next())
|
||||||
|
}// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder)
|
||||||
|
}// if (!aNb && myNbPntsMin) {
|
||||||
|
*/
|
||||||
|
@ -110,7 +110,7 @@ TopAbs_State GEOMAlgo_FinderShapeOnQuad::GetPointState(const gp_Pnt& aP)
|
|||||||
// In the case of concave quadrangle, return IN if
|
// In the case of concave quadrangle, return IN if
|
||||||
// aP is OUT of only one concave side
|
// aP is OUT of only one concave side
|
||||||
double nbIn = 0.;
|
double nbIn = 0.;
|
||||||
for ( int i = 0; i < myPlanes.size(); ++i )
|
for ( size_t i = 0; i < myPlanes.size(); ++i )
|
||||||
{
|
{
|
||||||
TopAbs_State aSt;
|
TopAbs_State aSt;
|
||||||
GEOMAlgo_SurfaceTools::GetState(aP, myPlanes[i], myTolerance, aSt);
|
GEOMAlgo_SurfaceTools::GetState(aP, myPlanes[i], myTolerance, aSt);
|
||||||
|
@ -125,7 +125,7 @@ const NMTTools_CoupleOfShape& GEOMAlgo_GetInPlaceIterator::Value()const
|
|||||||
Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
|
Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
|
||||||
const TopAbs_ShapeEnum aType2)
|
const TopAbs_ShapeEnum aType2)
|
||||||
{
|
{
|
||||||
Standard_Integer iRet, iT1, iT2, iX;
|
Standard_Integer iRet;
|
||||||
//
|
//
|
||||||
iRet=-1;
|
iRet=-1;
|
||||||
//
|
//
|
||||||
|
@ -511,8 +511,7 @@ void GEOMAlgo_GlueDetector::CheckDetected
|
|||||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMVE,
|
const TopTools_IndexedDataMapOfShapeListOfShape& aMVE,
|
||||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMEV)
|
const TopTools_IndexedDataMapOfShapeListOfShape& aMEV)
|
||||||
{
|
{
|
||||||
Standard_Integer i, aNbVSD, aNbA, iRet;
|
Standard_Integer aNbVSD, iRet;
|
||||||
TopAbs_ShapeEnum aTypeS, aTypeA[2];
|
|
||||||
TopExp_Explorer aExp, aExpA;
|
TopExp_Explorer aExp, aExpA;
|
||||||
TopTools_MapOfShape aMFence, aMVSD;
|
TopTools_MapOfShape aMFence, aMVSD;
|
||||||
TopTools_ListOfShape aLV;
|
TopTools_ListOfShape aLV;
|
||||||
|
@ -100,7 +100,6 @@ void GEOMAlgo_Gluer2::MakeFace(const TopoDS_Face& theF,
|
|||||||
Standard_Boolean bIsToReverse, bIsUPeriodic;
|
Standard_Boolean bIsToReverse, bIsUPeriodic;
|
||||||
Standard_Integer iRet;
|
Standard_Integer iRet;
|
||||||
Standard_Real aTol, aUMin, aUMax, aVMin, aVMax;
|
Standard_Real aTol, aUMin, aUMax, aVMin, aVMax;
|
||||||
TopAbs_Orientation aOrE;
|
|
||||||
Handle(Geom_Surface) aS;
|
Handle(Geom_Surface) aS;
|
||||||
TopLoc_Location aLoc;
|
TopLoc_Location aLoc;
|
||||||
TopoDS_Shape aW, aWr;
|
TopoDS_Shape aW, aWr;
|
||||||
|
@ -116,10 +116,10 @@
|
|||||||
|
|
||||||
// If the next macro is defined, autocolor feature works for all sub-shapes;
|
// If the next macro is defined, autocolor feature works for all sub-shapes;
|
||||||
// if it is undefined, autocolor feature works for groups only
|
// if it is undefined, autocolor feature works for groups only
|
||||||
//#define GENERAL_AUTOCOLOR
|
#define GENERAL_AUTOCOLOR
|
||||||
// Below macro, when uncommented, switches on simplified (more performant) algorithm
|
// Below macro, when uncommented, switches on simplified (more performant) algorithm
|
||||||
// of auto-color picking up
|
// of auto-color picking up
|
||||||
//#define SIMPLE_AUTOCOLOR
|
#define SIMPLE_AUTOCOLOR
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
// Function : getActiveStudy
|
// Function : getActiveStudy
|
||||||
@ -1835,19 +1835,15 @@ SALOMEDS::Color GEOM_Displayer::getPredefinedUniqueColor()
|
|||||||
static QList<QColor> colors;
|
static QList<QColor> colors;
|
||||||
|
|
||||||
if ( colors.isEmpty() ) {
|
if ( colors.isEmpty() ) {
|
||||||
const int rfactor = 4; // red color component split factor, must be > 0
|
|
||||||
const int gfactor = 4; // green color component split factor, must be > 0
|
for (int s = 0; s < 2 ; s++)
|
||||||
const int bfactor = 3; // blue color component split factor, must be > 0
|
{
|
||||||
// -
|
for (int v = 100; v >= 40; v = v - 20)
|
||||||
// total number of pre-defined colors is defined as
|
{
|
||||||
// nbcolors = rfactor * gfactor * bfactor
|
for (int h = 0; h < 359 ; h = h + 60)
|
||||||
// NB: all three factors should not have same values
|
{
|
||||||
// otherwise all colors will be greyish
|
colors.append(QColor::fromHsv(h, 255 - s * 127, v * 255 / 100));
|
||||||
|
}
|
||||||
for ( int g = 0; g < gfactor; g++ ) {
|
|
||||||
for ( int r = 0; r < rfactor; r++ ) {
|
|
||||||
for ( int b = 0; b < bfactor; b++ )
|
|
||||||
colors.append( QColor( qRgb( r * 255 / (rfactor-1), g * 255 / (gfactor-1), b * 255 / (bfactor-1) ) ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -363,6 +363,10 @@
|
|||||||
<source>ICON_DLG_PARTITION_PLANE</source>
|
<source>ICON_DLG_PARTITION_PLANE</source>
|
||||||
<translation>partitionplane.png</translation>
|
<translation>partitionplane.png</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ICON_DLG_PIPE_PATH</source>
|
||||||
|
<translation>pipe.png</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ICON_DLG_PIPE</source>
|
<source>ICON_DLG_PIPE</source>
|
||||||
<translation>pipe.png</translation>
|
<translation>pipe.png</translation>
|
||||||
@ -995,6 +999,10 @@
|
|||||||
<source>ICO_PIPE</source>
|
<source>ICO_PIPE</source>
|
||||||
<translation>pipe.png</translation>
|
<translation>pipe.png</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ICO_PIPE_PATH</source>
|
||||||
|
<translation>pipe.png</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ICO_PLANE</source>
|
<source>ICO_PLANE</source>
|
||||||
<translation>plane.png</translation>
|
<translation>plane.png</translation>
|
||||||
|
@ -113,6 +113,14 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>GEOM_ANGLE</source>
|
<source>GEOM_ANGLE</source>
|
||||||
<translation>Angle :</translation>
|
<translation>Angle :</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_ANGLES</source>
|
||||||
|
<translation>Angles</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_ANGLE_2</source>
|
||||||
|
<translation>Angle 2 :</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_ANGLE_1</source>
|
<source>GEOM_ANGLE_1</source>
|
||||||
<translation>Angle</translation>
|
<translation>Angle</translation>
|
||||||
@ -1078,6 +1086,10 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>GEOM_MIRROR_TITLE</source>
|
<source>GEOM_MIRROR_TITLE</source>
|
||||||
<translation>Mirror An Object</translation>
|
<translation>Mirror An Object</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_MODE</source>
|
||||||
|
<translation>Mode</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_MULTIROTATION</source>
|
<source>GEOM_MULTIROTATION</source>
|
||||||
<translation>Multi-Rotation</translation>
|
<translation>Multi-Rotation</translation>
|
||||||
@ -1266,6 +1278,26 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>GEOM_PIPE_TITLE</source>
|
<source>GEOM_PIPE_TITLE</source>
|
||||||
<translation>Pipe Construction</translation>
|
<translation>Pipe Construction</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_PIPE_PATH</source>
|
||||||
|
<translation>Path</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_PIPE_PATH_TITLE</source>
|
||||||
|
<translation>Restore Path</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_PIPE_LIKE_SHAPE</source>
|
||||||
|
<translation>Pipe-like shell or solid</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_PIPE_BASE1_OBJECT</source>
|
||||||
|
<translation>First base face/wire/edges</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_PIPE_BASE2_OBJECT</source>
|
||||||
|
<translation>Last base face/wire/edges</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_PROFILE</source>
|
<source>GEOM_PROFILE</source>
|
||||||
<translation>Profile</translation>
|
<translation>Profile</translation>
|
||||||
@ -1638,6 +1670,18 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>GEOM_SHELL_TITLE</source>
|
<source>GEOM_SHELL_TITLE</source>
|
||||||
<translation>Shell Construction</translation>
|
<translation>Shell Construction</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_SHOW_LENGTH</source>
|
||||||
|
<translation>Show length dimensions</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_SHOW_ANGLE</source>
|
||||||
|
<translation>Show angle dimensions</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_SHOW_POINTS_COORD</source>
|
||||||
|
<translation>Show start/end point coordinates</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_SKETCH</source>
|
<source>GEOM_SKETCH</source>
|
||||||
<translation>Sketch</translation>
|
<translation>Sketch</translation>
|
||||||
@ -1848,7 +1892,7 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_CONTROLS</source>
|
<source>GEOM_CONTROLS</source>
|
||||||
<translation>Dimensions</translation>
|
<translation>Controls</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_SOLID</source>
|
<source>GEOM_SOLID</source>
|
||||||
@ -1886,6 +1930,14 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>GEOM_SQUARE</source>
|
<source>GEOM_SQUARE</source>
|
||||||
<translation>Square</translation>
|
<translation>Square</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_START</source>
|
||||||
|
<translation>Start :</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_END</source>
|
||||||
|
<translation>End :</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_START_LCS</source>
|
<source>GEOM_START_LCS</source>
|
||||||
<translation>Start LCS</translation>
|
<translation>Start LCS</translation>
|
||||||
@ -2682,6 +2734,10 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>MEN_PIPE</source>
|
<source>MEN_PIPE</source>
|
||||||
<translation>Extrusion Along Path</translation>
|
<translation>Extrusion Along Path</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_PIPE_PATH</source>
|
||||||
|
<translation>Restore Path</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_PLANE</source>
|
<source>MEN_PLANE</source>
|
||||||
<translation>Plane</translation>
|
<translation>Plane</translation>
|
||||||
@ -3462,6 +3518,10 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>STB_PIPE</source>
|
<source>STB_PIPE</source>
|
||||||
<translation>Create a shape by extrusion along a path</translation>
|
<translation>Create a shape by extrusion along a path</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_PIPE_PATH</source>
|
||||||
|
<translation>Restore path from a pipe-like shape</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_PLANE</source>
|
<source>STB_PLANE</source>
|
||||||
<translation>Create a plane</translation>
|
<translation>Create a plane</translation>
|
||||||
@ -3746,6 +3806,10 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>TOOL_BASIC</source>
|
<source>TOOL_BASIC</source>
|
||||||
<translation>Basic</translation>
|
<translation>Basic</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOOL_BLOCKS</source>
|
||||||
|
<translation>Blocks</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOOL_BOOLEAN</source>
|
<source>TOOL_BOOLEAN</source>
|
||||||
<translation>Boolean operations</translation>
|
<translation>Boolean operations</translation>
|
||||||
@ -4082,6 +4146,10 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>TOP_PIPE</source>
|
<source>TOP_PIPE</source>
|
||||||
<translation>Extrusion along path</translation>
|
<translation>Extrusion along path</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_PIPE_PATH</source>
|
||||||
|
<translation>Restore path</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_PLANE</source>
|
<source>TOP_PLANE</source>
|
||||||
<translation>Create a plane</translation>
|
<translation>Create a plane</translation>
|
||||||
@ -4687,8 +4755,9 @@ shells and solids on the other hand.</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_SCALE_DIMENSIONS</source>
|
<source>GEOM_SCALE_DIMENSIONS</source>
|
||||||
<translation>Would you like to take into account the units?
|
<translation>Take into account the units (%1) embedded to the file?
|
||||||
Otherwise the dimensions will be kept without modifications.</translation>
|
Ignoring units will cause model scaling (as dimensions are supposed to
|
||||||
|
be specified in meters).</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_ADVANCED</source>
|
<source>GEOM_ADVANCED</source>
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
<source>BRep_API: command not done</source>
|
<source>BRep_API: command not done</source>
|
||||||
<translation>Erreur: impossible de construire l'objet</translation>
|
<translation>Erreur: impossible de construire l'objet</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>PAL_NOT_DONE_ERROR</source>
|
||||||
|
<translation>Opération annulée</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>CHANGE_ORIENTATION_NEW_OBJ_NAME</source>
|
<source>CHANGE_ORIENTATION_NEW_OBJ_NAME</source>
|
||||||
<translation>Inverser</translation>
|
<translation>Inverser</translation>
|
||||||
@ -109,6 +113,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_ANGLE</source>
|
<source>GEOM_ANGLE</source>
|
||||||
<translation>Angle :</translation>
|
<translation>Angle :</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_ANGLES</source>
|
||||||
|
<translation>Angles</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_ANGLE_2</source>
|
||||||
|
<translation>Angle 2 :</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_ANGLE_1</source>
|
<source>GEOM_ANGLE_1</source>
|
||||||
<translation>Angle</translation>
|
<translation>Angle</translation>
|
||||||
@ -357,6 +369,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES</source>
|
<source>GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES</source>
|
||||||
<translation>Sous-objets incriminés</translation>
|
<translation>Sous-objets incriminés</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_GETNONBLOCKS_TITLE</source>
|
||||||
|
<translation>Récupérer les solides non-hexahédres et les faces non-quadrangles</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_GETNONBLOCKS</source>
|
||||||
|
<translation>Récupérer les solides non blocs</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_NONBLOCKS</source>
|
||||||
|
<translation>GroupeSolidesNonBlocs</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_CHECK_INFOS</source>
|
<source>GEOM_CHECK_INFOS</source>
|
||||||
<translation>Objet et son information topologique</translation>
|
<translation>Objet et son information topologique</translation>
|
||||||
@ -710,6 +734,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_FILLET_1D</source>
|
<source>GEOM_FILLET_1D</source>
|
||||||
<translation>Congé 1D</translation>
|
<translation>Congé 1D</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_FILLET_1D_IGNORE_SECANT</source>
|
||||||
|
<translation>Fusionner les arêtes collinéaires pour permettre des rayons plus grands</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_FILLET_ABORT</source>
|
<source>GEOM_FILLET_ABORT</source>
|
||||||
<translation>Il n'est pas possible de calculer un congé avec le rayon %1</translation>
|
<translation>Il n'est pas possible de calculer un congé avec le rayon %1</translation>
|
||||||
@ -836,7 +864,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_HEIGHT</source>
|
<source>GEOM_HEIGHT</source>
|
||||||
<translation>Hauteur:</translation>
|
<translation>Hauteur :</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_HEXAGON</source>
|
<source>GEOM_HEXAGON</source>
|
||||||
@ -1058,6 +1086,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_MIRROR_TITLE</source>
|
<source>GEOM_MIRROR_TITLE</source>
|
||||||
<translation>Refléter un objet</translation>
|
<translation>Refléter un objet</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_MODE</source>
|
||||||
|
<translation>Mode</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_MULTIROTATION</source>
|
<source>GEOM_MULTIROTATION</source>
|
||||||
<translation>Multi-rotation</translation>
|
<translation>Multi-rotation</translation>
|
||||||
@ -1246,6 +1278,26 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_PIPE_TITLE</source>
|
<source>GEOM_PIPE_TITLE</source>
|
||||||
<translation>Construction d'un tuyau</translation>
|
<translation>Construction d'un tuyau</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_PIPE_PATH</source>
|
||||||
|
<translation>Chemin</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_PIPE_PATH_TITLE</source>
|
||||||
|
<translation>Récupérer le chemin</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_PIPE_LIKE_SHAPE</source>
|
||||||
|
<translation>Coque ou solide de type tuyau</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_PIPE_BASE1_OBJECT</source>
|
||||||
|
<translation>Premier(ère) face/contour/arête de base</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_PIPE_BASE2_OBJECT</source>
|
||||||
|
<translation>Dernier(ère) face/contour/arête de base</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_PROFILE</source>
|
<source>GEOM_PROFILE</source>
|
||||||
<translation>Profile</translation>
|
<translation>Profile</translation>
|
||||||
@ -1618,6 +1670,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_SHELL_TITLE</source>
|
<source>GEOM_SHELL_TITLE</source>
|
||||||
<translation>Construction d'une coque</translation>
|
<translation>Construction d'une coque</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_SHOW_LENGTH</source>
|
||||||
|
<translation>Afficher les cotes de longueur</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_SHOW_ANGLE</source>
|
||||||
|
<translation>Afficher les cotes d'angle</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_SHOW_POINTS_COORD</source>
|
||||||
|
<translation>Afficher les points de départ/arrivée</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_SKETCH</source>
|
<source>GEOM_SKETCH</source>
|
||||||
<translation>Esquisse</translation>
|
<translation>Esquisse</translation>
|
||||||
@ -1826,6 +1890,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_COORDINATES_TYPE</source>
|
<source>GEOM_COORDINATES_TYPE</source>
|
||||||
<translation>Type de coordonnées</translation>
|
<translation>Type de coordonnées</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_CONTROLS</source>
|
||||||
|
<translation>Eléments de contrôle</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_SOLID</source>
|
<source>GEOM_SOLID</source>
|
||||||
<translation>Solide</translation>
|
<translation>Solide</translation>
|
||||||
@ -1862,6 +1930,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_SQUARE</source>
|
<source>GEOM_SQUARE</source>
|
||||||
<translation>Carré</translation>
|
<translation>Carré</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_START</source>
|
||||||
|
<translation>Départ :</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_END</source>
|
||||||
|
<translation>Arrivée :</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_START_LCS</source>
|
<source>GEOM_START_LCS</source>
|
||||||
<translation>SCL du Début</translation>
|
<translation>SCL du Début</translation>
|
||||||
@ -2306,6 +2382,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>MEN_CHECK_COMPOUND</source>
|
<source>MEN_CHECK_COMPOUND</source>
|
||||||
<translation>Contrôler un assemblage de blocs</translation>
|
<translation>Contrôler un assemblage de blocs</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_GET_NON_BLOCKS</source>
|
||||||
|
<translation>Récupérer les solides non blocs</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_CHECK_SELF_INTERSECTIONS</source>
|
<source>MEN_CHECK_SELF_INTERSECTIONS</source>
|
||||||
<translation>Détections des auto-intersections</translation>
|
<translation>Détections des auto-intersections</translation>
|
||||||
@ -2418,6 +2498,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>MEN_DISPLAY_ONLY</source>
|
<source>MEN_DISPLAY_ONLY</source>
|
||||||
<translation>Afficher uniquement</translation>
|
<translation>Afficher uniquement</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_SHOW_ONLY_CHILDREN</source>
|
||||||
|
<translation>Afficher uniquement les enfants</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_BRING_TO_FRONT</source>
|
<source>MEN_BRING_TO_FRONT</source>
|
||||||
<translation>Afficher au premier plan</translation>
|
<translation>Afficher au premier plan</translation>
|
||||||
@ -2546,6 +2630,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>MEN_GROUP_EDIT</source>
|
<source>MEN_GROUP_EDIT</source>
|
||||||
<translation>Editer</translation>
|
<translation>Editer</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_GROUP_UNION</source>
|
||||||
|
<translation>Union de groupes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_GROUP_INTERSECT</source>
|
||||||
|
<translation>Intersection de groupes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_GROUP_CUT</source>
|
||||||
|
<translation>Découpe de groupes</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_RELOAD_IMPORTED</source>
|
<source>MEN_RELOAD_IMPORTED</source>
|
||||||
<translation>Recharger à partir du disque</translation>
|
<translation>Recharger à partir du disque</translation>
|
||||||
@ -2638,6 +2734,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>MEN_PIPE</source>
|
<source>MEN_PIPE</source>
|
||||||
<translation>Extrusion suivant un chemin</translation>
|
<translation>Extrusion suivant un chemin</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_PIPE_PATH</source>
|
||||||
|
<translation>Retrouver le chemin</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_PLANE</source>
|
<source>MEN_PLANE</source>
|
||||||
<translation>Plan</translation>
|
<translation>Plan</translation>
|
||||||
@ -3014,6 +3114,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>PREF_TOPLEVEL_COLOR</source>
|
<source>PREF_TOPLEVEL_COLOR</source>
|
||||||
<translation>Couleur des objets mis au premier plan</translation>
|
<translation>Couleur des objets mis au premier plan</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>PREF_TOPLEVEL_DM</source>
|
||||||
|
<translation>Mode d'affichage des objets mis au premier plan</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_KEEP_CURRENT_DM</source>
|
||||||
|
<translation>Conserver le mode d'affichage en cours</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_SHOW_ADD_WACTOR</source>
|
||||||
|
<translation>Afficher un contour en plus</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>PREF_LINE_COLOR</source>
|
<source>PREF_LINE_COLOR</source>
|
||||||
<translation>Couleur des arêtes, vecteurs, contours</translation>
|
<translation>Couleur des arêtes, vecteurs, contours</translation>
|
||||||
@ -3138,6 +3250,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>STB_CHECK_COMPOUND</source>
|
<source>STB_CHECK_COMPOUND</source>
|
||||||
<translation>Contrôler un assemblage de blocs</translation>
|
<translation>Contrôler un assemblage de blocs</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_GET_NON_BLOCKS</source>
|
||||||
|
<translation>Récupérer les solides non-blocs</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_CHECK_SELF_INTERSECTIONS</source>
|
<source>STB_CHECK_SELF_INTERSECTIONS</source>
|
||||||
<translation>Détecte les auto-intersections</translation>
|
<translation>Détecte les auto-intersections</translation>
|
||||||
@ -3218,6 +3334,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>STB_DISPLAY_ONLY</source>
|
<source>STB_DISPLAY_ONLY</source>
|
||||||
<translation>Afficher uniquement</translation>
|
<translation>Afficher uniquement</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_SHOW_ONLY_CHILDREN</source>
|
||||||
|
<translation>Afficher uniquement les enfants</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_EDGE</source>
|
<source>STB_EDGE</source>
|
||||||
<translation>Créer une arête</translation>
|
<translation>Créer une arête</translation>
|
||||||
@ -3306,6 +3426,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>STB_GROUP_EDIT</source>
|
<source>STB_GROUP_EDIT</source>
|
||||||
<translation>Editer un groupe</translation>
|
<translation>Editer un groupe</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_GROUP_UNION</source>
|
||||||
|
<translation>Union de groupes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_GROUP_INTERSECT</source>
|
||||||
|
<translation>Intersection de groupes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_GROUP_CUT</source>
|
||||||
|
<translation>Découpe de groupes</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_RELOAD_IMPORTED</source>
|
<source>STB_RELOAD_IMPORTED</source>
|
||||||
<translation>Recharger l'objet importé depuis le disque</translation>
|
<translation>Recharger l'objet importé depuis le disque</translation>
|
||||||
@ -3386,6 +3518,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>STB_PIPE</source>
|
<source>STB_PIPE</source>
|
||||||
<translation>Créer un objet par extrusion suivant un chemin</translation>
|
<translation>Créer un objet par extrusion suivant un chemin</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_PIPE_PATH</source>
|
||||||
|
<translation>Retrouver le chemin à partir d'un objet de type tuyau</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_PLANE</source>
|
<source>STB_PLANE</source>
|
||||||
<translation>Créer un plan</translation>
|
<translation>Créer un plan</translation>
|
||||||
@ -3410,10 +3546,6 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>STB_POP_CREATE_GROUP</source>
|
<source>STB_POP_CREATE_GROUP</source>
|
||||||
<translation>Créer un groupe</translation>
|
<translation>Créer un groupe</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>STB_POP_SHOW_CHILDREN</source>
|
|
||||||
<translation>Monter les objets fils</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>STB_POP_UNPUBLISH_OBJ</source>
|
<source>STB_POP_UNPUBLISH_OBJ</source>
|
||||||
<translation>Dépublier l'objet</translation>
|
<translation>Dépublier l'objet</translation>
|
||||||
@ -3423,7 +3555,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<translation>Publier l'objet</translation>
|
<translation>Publier l'objet</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_POP_HIDE_CHILDREN</source>
|
<source>STB_POP_DISCLOSE_CHILDREN</source>
|
||||||
|
<translation>Afficher les objets fils</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_POP_CONCEAL_CHILDREN</source>
|
||||||
<translation>Cacher les objets fils</translation>
|
<translation>Cacher les objets fils</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@ -3670,6 +3806,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>TOOL_BASIC</source>
|
<source>TOOL_BASIC</source>
|
||||||
<translation>Objets de base</translation>
|
<translation>Objets de base</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOOL_BLOCKS</source>
|
||||||
|
<translation>Blocs</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOOL_BOOLEAN</source>
|
<source>TOOL_BOOLEAN</source>
|
||||||
<translation>Opérations booléennes </translation>
|
<translation>Opérations booléennes </translation>
|
||||||
@ -3746,6 +3886,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>TOP_CHECK_COMPOUND</source>
|
<source>TOP_CHECK_COMPOUND</source>
|
||||||
<translation>Valider l'assemblage de blocs</translation>
|
<translation>Valider l'assemblage de blocs</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_GET_NON_BLOCKS</source>
|
||||||
|
<translation>Récupérer les solides non-blocs</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_CHECK_SELF_INTERSECTIONS</source>
|
<source>TOP_CHECK_SELF_INTERSECTIONS</source>
|
||||||
<translation>Détection des auto-intersections</translation>
|
<translation>Détection des auto-intersections</translation>
|
||||||
@ -3822,6 +3966,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>TOP_DISPLAY_ONLY</source>
|
<source>TOP_DISPLAY_ONLY</source>
|
||||||
<translation>Afficher uniquement</translation>
|
<translation>Afficher uniquement</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_SHOW_ONLY_CHILDREN</source>
|
||||||
|
<translation>Afficher uniquement les enfants</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_EDGE</source>
|
<source>TOP_EDGE</source>
|
||||||
<translation>Construire une arête</translation>
|
<translation>Construire une arête</translation>
|
||||||
@ -3902,6 +4050,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>TOP_GROUP_EDIT</source>
|
<source>TOP_GROUP_EDIT</source>
|
||||||
<translation>Editer un groupe</translation>
|
<translation>Editer un groupe</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_GROUP_UNION</source>
|
||||||
|
<translation>Union de groupes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_GROUP_INTERSECT</source>
|
||||||
|
<translation>Intersection de groupes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_GROUP_CUT</source>
|
||||||
|
<translation>Découpe de groupes</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_HEX_SOLID</source>
|
<source>TOP_HEX_SOLID</source>
|
||||||
<translation>Solide hexaédrique</translation>
|
<translation>Solide hexaédrique</translation>
|
||||||
@ -3986,6 +4146,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>TOP_PIPE</source>
|
<source>TOP_PIPE</source>
|
||||||
<translation>Extrusion suivant un chemin</translation>
|
<translation>Extrusion suivant un chemin</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_PIPE_PATH</source>
|
||||||
|
<translation>Retrouver le chemin</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_PLANE</source>
|
<source>TOP_PLANE</source>
|
||||||
<translation>Créer un plan</translation>
|
<translation>Créer un plan</translation>
|
||||||
@ -4010,10 +4174,6 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>TOP_POP_CREATE_GROUP</source>
|
<source>TOP_POP_CREATE_GROUP</source>
|
||||||
<translation>Créer un groupe</translation>
|
<translation>Créer un groupe</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>TOP_POP_SHOW_CHILDREN</source>
|
|
||||||
<translation>Montrer les enfants</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_POP_UNPUBLISH_OBJ</source>
|
<source>TOP_POP_UNPUBLISH_OBJ</source>
|
||||||
<translation>Dépublier l'objet</translation>
|
<translation>Dépublier l'objet</translation>
|
||||||
@ -4023,8 +4183,12 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<translation>Publier l'objet</translation>
|
<translation>Publier l'objet</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_POP_HIDE_CHILDREN</source>
|
<source>TOP_POP_DISCLOSE_CHILDREN</source>
|
||||||
<translation>Cacher les enfants</translation>
|
<translation>Afficher les objets fils</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_POP_CONCEAL_CHILDREN</source>
|
||||||
|
<translation>Cacher les objets fils</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_POP_ISOS</source>
|
<source>TOP_POP_ISOS</source>
|
||||||
@ -4294,6 +4458,30 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>STB_REMOVE_EXTRA_EDGES</source>
|
<source>STB_REMOVE_EXTRA_EDGES</source>
|
||||||
<translation>Supprimer les arêtes inutiles</translation>
|
<translation>Supprimer les arêtes inutiles</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_FUSE_EDGES_TITLE</source>
|
||||||
|
<translation>Fusionner les arêtes collinéaires au sein d'un contour</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_FUSE_EDGES</source>
|
||||||
|
<translation>Fusionner les arêtes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>FUSE_EDGES_NEW_OBJ_NAME</source>
|
||||||
|
<translation>FusionArêtes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_FUSE_EDGES</source>
|
||||||
|
<translation>Fusionner les arêtes collinéaires au sein d'un contour</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_FUSE_EDGES</source>
|
||||||
|
<translation>Fusionner les arêtes collinéaires au sein d'un contour</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_FUSE_EDGES</source>
|
||||||
|
<translation>Fusionner les arêtes collinéaires au sein d'un contour</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_NORMALE</source>
|
<source>TOP_NORMALE</source>
|
||||||
<translation>Vecteur normal à une face</translation>
|
<translation>Vecteur normal à une face</translation>
|
||||||
@ -4568,7 +4756,7 @@ les coques et solides d'un autre.</translation>
|
|||||||
<message>
|
<message>
|
||||||
<source>GEOM_SCALE_DIMENSIONS</source>
|
<source>GEOM_SCALE_DIMENSIONS</source>
|
||||||
<translation>Voulez-vous prendre les unités en considération?
|
<translation>Voulez-vous prendre les unités en considération?
|
||||||
Sinon les dimensions seront préservées sans modifications.</translation>
|
Sinon le modèle sera mis à l'échèlle GEOM (unités interprétées comme des mètres).</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_ADVANCED</source>
|
<source>GEOM_ADVANCED</source>
|
||||||
@ -4997,6 +5185,45 @@ Le nombre de points n'est pas suffisant</translation>
|
|||||||
<translation>Choisissez un groupe à éditer</translation>
|
<translation>Choisissez un groupe à éditer</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>GroupGUI_BooleanDlg</name>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_UNION</source>
|
||||||
|
<translation>Union</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_UNION_TITLE</source>
|
||||||
|
<translation>Union de groupes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_INTERSECT</source>
|
||||||
|
<translation>Intersection</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_INTERSECT_TITLE</source>
|
||||||
|
<translation>Intersection de groupes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_CUT</source>
|
||||||
|
<translation>Découpe</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_CUT_TITLE</source>
|
||||||
|
<translation>Découpe de groupes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_GROUPS</source>
|
||||||
|
<translation>Groupes</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_MAIN_GROUPS</source>
|
||||||
|
<translation>Groupes principaux</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_TOOL_GROUPS</source>
|
||||||
|
<translation>Groups outils</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>GroupGUI_GroupDlg</name>
|
<name>GroupGUI_GroupDlg</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -107,7 +107,6 @@
|
|||||||
|
|
||||||
#include <GEOM_version.h>
|
#include <GEOM_version.h>
|
||||||
|
|
||||||
|
|
||||||
#include "GEOMImpl_Types.hxx"
|
#include "GEOMImpl_Types.hxx"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -135,7 +134,7 @@ GEOM::GEOM_Gen_var GeometryGUI::GetGeomGen()
|
|||||||
bool GeometryGUI::InitGeomGen()
|
bool GeometryGUI::InitGeomGen()
|
||||||
{
|
{
|
||||||
GeometryGUI aGG;
|
GeometryGUI aGG;
|
||||||
if( CORBA::is_nil( myComponentGeom ) ) return false;
|
if ( CORBA::is_nil( myComponentGeom ) ) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,12 +172,12 @@ SALOMEDS::Study_var GeometryGUI::ClientStudyToStudy (_PTR(Study) theStudy)
|
|||||||
return aDSStudy._retn();
|
return aDSStudy._retn();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeometryGUI::Modified( bool theIsUpdateActions )
|
void GeometryGUI::Modified (bool theIsUpdateActions)
|
||||||
{
|
{
|
||||||
if( SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() ) ) {
|
if ( SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() ) ) {
|
||||||
if( SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) ) {
|
if ( SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) ) {
|
||||||
appStudy->Modified();
|
appStudy->Modified();
|
||||||
if( theIsUpdateActions )
|
if ( theIsUpdateActions )
|
||||||
app->updateActions();
|
app->updateActions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -281,17 +280,17 @@ void GeometryGUI::ActiveWorkingPlane()
|
|||||||
bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
|
bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
|
||||||
bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
|
bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
|
||||||
|
|
||||||
if( ViewOCC ) {
|
if ( ViewOCC ) {
|
||||||
OCCViewer_ViewWindow* vw = dynamic_cast<OCCViewer_ViewWindow*>( window );
|
OCCViewer_ViewWindow* vw = dynamic_cast<OCCViewer_ViewWindow*>( window );
|
||||||
if ( vw ) {
|
if ( vw ) {
|
||||||
Handle(V3d_View) view3d = vw->getViewPort()->getView();
|
Handle(V3d_View) view3d = vw->getViewPort()->getView();
|
||||||
|
|
||||||
view3d->SetProj(DZ.X(), DZ.Y(), DZ.Z());
|
view3d->SetProj(DZ.X(), DZ.Y(), DZ.Z());
|
||||||
view3d->SetUp(DY.X(), DY.Y(), DY.Z());
|
view3d->SetUp(DY.X(), DY.Y(), DY.Z());
|
||||||
vw->onViewFitAll();
|
vw->onViewFitAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( ViewVTK ) {
|
else if ( ViewVTK ) {
|
||||||
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( window );
|
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( window );
|
||||||
if ( vw ) {
|
if ( vw ) {
|
||||||
vtkCamera* camera = vw->getRenderer()->GetActiveCamera();
|
vtkCamera* camera = vw->getRenderer()->GetActiveCamera();
|
||||||
@ -473,6 +472,7 @@ void GeometryGUI::OnGUIEvent( int id )
|
|||||||
case GEOMOp::OpRevolution: // MENU GENERATION - REVOLUTION
|
case GEOMOp::OpRevolution: // MENU GENERATION - REVOLUTION
|
||||||
case GEOMOp::OpFilling: // MENU GENERATION - FILLING
|
case GEOMOp::OpFilling: // MENU GENERATION - FILLING
|
||||||
case GEOMOp::OpPipe: // MENU GENERATION - PIPE
|
case GEOMOp::OpPipe: // MENU GENERATION - PIPE
|
||||||
|
case GEOMOp::OpPipePath: // MENU GENERATION - RESTORE PATH
|
||||||
libName = "GenerationGUI";
|
libName = "GenerationGUI";
|
||||||
break;
|
break;
|
||||||
case GEOMOp::Op2dSketcher: // MENU ENTITY - SKETCHER
|
case GEOMOp::Op2dSketcher: // MENU ENTITY - SKETCHER
|
||||||
@ -596,15 +596,15 @@ void GeometryGUI::OnGUIEvent( int id )
|
|||||||
// call method of corresponding GUI library
|
// call method of corresponding GUI library
|
||||||
if ( library ) {
|
if ( library ) {
|
||||||
library->OnGUIEvent( id, desk );
|
library->OnGUIEvent( id, desk );
|
||||||
|
|
||||||
// Update a list of materials for "Preferences" dialog
|
// Update a list of materials for "Preferences" dialog
|
||||||
if ( id == GEOMOp::OpMaterialProperties ) {
|
if ( id == GEOMOp::OpMaterialProperties ) {
|
||||||
LightApp_Preferences* pref = preferences();
|
LightApp_Preferences* pref = preferences();
|
||||||
if ( pref ) {
|
if ( pref ) {
|
||||||
Material_ResourceMgr aMatResMgr;
|
Material_ResourceMgr aMatResMgr;
|
||||||
setPreferenceProperty( pref->rootItem()->findItem( tr( "PREF_MATERIAL" ), true )->id(),
|
setPreferenceProperty( pref->rootItem()->findItem( tr( "PREF_MATERIAL" ), true )->id(),
|
||||||
"strings",
|
"strings",
|
||||||
aMatResMgr.materials() );
|
aMatResMgr.materials() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -689,11 +689,11 @@ void GeometryGUI::createGeomAction( const int id, const QString& label, const QS
|
|||||||
void GeometryGUI::createOriginAndBaseVectors()
|
void GeometryGUI::createOriginAndBaseVectors()
|
||||||
{
|
{
|
||||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
|
||||||
if( appStudy ) {
|
if ( appStudy ) {
|
||||||
_PTR(Study) studyDS = appStudy->studyDS();
|
_PTR(Study) studyDS = appStudy->studyDS();
|
||||||
if( studyDS && !CORBA::is_nil( GetGeomGen() ) ) {
|
if ( studyDS && !CORBA::is_nil( GetGeomGen() ) ) {
|
||||||
GEOM::GEOM_IBasicOperations_var aBasicOperations = GetGeomGen()->GetIBasicOperations( studyDS->StudyId() );
|
GEOM::GEOM_IBasicOperations_var aBasicOperations = GetGeomGen()->GetIBasicOperations( studyDS->StudyId() );
|
||||||
if( !aBasicOperations->_is_nil() ) {
|
if ( !aBasicOperations->_is_nil() ) {
|
||||||
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
|
||||||
double aLength = aResourceMgr->doubleValue( "Geometry", "base_vectors_length", 1.0 );
|
double aLength = aResourceMgr->doubleValue( "Geometry", "base_vectors_length", 1.0 );
|
||||||
GEOM::GEOM_Object_var anOrigin = aBasicOperations->MakePointXYZ( 0.0, 0.0, 0.0 );
|
GEOM::GEOM_Object_var anOrigin = aBasicOperations->MakePointXYZ( 0.0, 0.0, 0.0 );
|
||||||
@ -751,6 +751,7 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
createGeomAction( GEOMOp::OpRevolution, "REVOLUTION" );
|
createGeomAction( GEOMOp::OpRevolution, "REVOLUTION" );
|
||||||
createGeomAction( GEOMOp::OpFilling, "FILLING" );
|
createGeomAction( GEOMOp::OpFilling, "FILLING" );
|
||||||
createGeomAction( GEOMOp::OpPipe, "PIPE" );
|
createGeomAction( GEOMOp::OpPipe, "PIPE" );
|
||||||
|
createGeomAction( GEOMOp::OpPipePath, "PIPE_PATH" );
|
||||||
|
|
||||||
createGeomAction( GEOMOp::OpGroupCreate, "GROUP_CREATE" );
|
createGeomAction( GEOMOp::OpGroupCreate, "GROUP_CREATE" );
|
||||||
createGeomAction( GEOMOp::OpGroupEdit, "GROUP_EDIT" );
|
createGeomAction( GEOMOp::OpGroupEdit, "GROUP_EDIT" );
|
||||||
@ -950,6 +951,9 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
createMenu( GEOMOp::OpRevolution, genId, -1 );
|
createMenu( GEOMOp::OpRevolution, genId, -1 );
|
||||||
createMenu( GEOMOp::OpFilling, genId, -1 );
|
createMenu( GEOMOp::OpFilling, genId, -1 );
|
||||||
createMenu( GEOMOp::OpPipe, genId, -1 );
|
createMenu( GEOMOp::OpPipe, genId, -1 );
|
||||||
|
#if OCC_VERSION_LARGE > 0x06050300
|
||||||
|
createMenu( GEOMOp::OpPipePath, genId, -1 );
|
||||||
|
#endif
|
||||||
|
|
||||||
// int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 );
|
// int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 );
|
||||||
|
|
||||||
@ -983,9 +987,9 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
createMenu( GEOMOp::OpShell, buildId, -1 );
|
createMenu( GEOMOp::OpShell, buildId, -1 );
|
||||||
createMenu( GEOMOp::OpSolid, buildId, -1 );
|
createMenu( GEOMOp::OpSolid, buildId, -1 );
|
||||||
createMenu( GEOMOp::OpCompound, buildId, -1 );
|
createMenu( GEOMOp::OpCompound, buildId, -1 );
|
||||||
|
|
||||||
createMenu( separator(), newEntId, -1 );
|
createMenu( separator(), newEntId, -1 );
|
||||||
|
|
||||||
createMenu( GEOMOp::OpPictureImport, newEntId, -1 );
|
createMenu( GEOMOp::OpPictureImport, newEntId, -1 );
|
||||||
#ifdef WITH_OPENCV
|
#ifdef WITH_OPENCV
|
||||||
createMenu( GEOMOp::OpFeatureDetect, newEntId, -1 );
|
createMenu( GEOMOp::OpFeatureDetect, newEntId, -1 );
|
||||||
@ -1110,7 +1114,7 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// ---- create toolbars --------------------------
|
// ---- create toolbars --------------------------
|
||||||
|
|
||||||
int basicTbId = createTool( tr( "TOOL_BASIC" ) );
|
int basicTbId = createTool( tr( "TOOL_BASIC" ) );
|
||||||
createTool( GEOMOp::OpPoint, basicTbId );
|
createTool( GEOMOp::OpPoint, basicTbId );
|
||||||
createTool( GEOMOp::OpLine, basicTbId );
|
createTool( GEOMOp::OpLine, basicTbId );
|
||||||
@ -1124,11 +1128,11 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
createTool( GEOMOp::OpPlane, basicTbId );
|
createTool( GEOMOp::OpPlane, basicTbId );
|
||||||
createTool( GEOMOp::OpLCS, basicTbId );
|
createTool( GEOMOp::OpLCS, basicTbId );
|
||||||
createTool( GEOMOp::OpOriginAndVectors, basicTbId );
|
createTool( GEOMOp::OpOriginAndVectors, basicTbId );
|
||||||
|
|
||||||
// int sketchTbId = createTool( tr( "TOOL_SKETCH" ) );
|
// int sketchTbId = createTool( tr( "TOOL_SKETCH" ) );
|
||||||
// createTool( GEOMOp::Op2dSketcher, sketchTbId );
|
// createTool( GEOMOp::Op2dSketcher, sketchTbId );
|
||||||
// createTool( GEOMOp::Op3dSketcher, sketchTbId );
|
// createTool( GEOMOp::Op3dSketcher, sketchTbId );
|
||||||
|
|
||||||
int primTbId = createTool( tr( "TOOL_PRIMITIVES" ) );
|
int primTbId = createTool( tr( "TOOL_PRIMITIVES" ) );
|
||||||
createTool( GEOMOp::OpBox, primTbId );
|
createTool( GEOMOp::OpBox, primTbId );
|
||||||
createTool( GEOMOp::OpCylinder, primTbId );
|
createTool( GEOMOp::OpCylinder, primTbId );
|
||||||
@ -1138,26 +1142,29 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
createTool( GEOMOp::OpRectangle, primTbId );
|
createTool( GEOMOp::OpRectangle, primTbId );
|
||||||
createTool( GEOMOp::OpDisk, primTbId );
|
createTool( GEOMOp::OpDisk, primTbId );
|
||||||
createTool( GEOMOp::OpPipeTShape, primTbId ); //rnc
|
createTool( GEOMOp::OpPipeTShape, primTbId ); //rnc
|
||||||
|
|
||||||
int blocksTbId = createTool( tr( "TOOL_BLOCKS" ) );
|
int blocksTbId = createTool( tr( "TOOL_BLOCKS" ) );
|
||||||
createTool( GEOMOp::OpDividedDisk, blocksTbId );
|
createTool( GEOMOp::OpDividedDisk, blocksTbId );
|
||||||
createTool( GEOMOp::OpDividedCylinder, blocksTbId );
|
createTool( GEOMOp::OpDividedCylinder, blocksTbId );
|
||||||
|
|
||||||
// int advancedTbId = createTool( tr( "TOOL_ADVANCED" ) ); //rnc
|
// int advancedTbId = createTool( tr( "TOOL_ADVANCED" ) ); //rnc
|
||||||
// createTool( GEOMOp::OpPipeTShape, advancedTbId );
|
// createTool( GEOMOp::OpPipeTShape, advancedTbId );
|
||||||
|
|
||||||
int boolTbId = createTool( tr( "TOOL_BOOLEAN" ) );
|
int boolTbId = createTool( tr( "TOOL_BOOLEAN" ) );
|
||||||
createTool( GEOMOp::OpFuse, boolTbId );
|
createTool( GEOMOp::OpFuse, boolTbId );
|
||||||
createTool( GEOMOp::OpCommon, boolTbId );
|
createTool( GEOMOp::OpCommon, boolTbId );
|
||||||
createTool( GEOMOp::OpCut, boolTbId );
|
createTool( GEOMOp::OpCut, boolTbId );
|
||||||
createTool( GEOMOp::OpSection, boolTbId );
|
createTool( GEOMOp::OpSection, boolTbId );
|
||||||
|
|
||||||
int genTbId = createTool( tr( "TOOL_GENERATION" ) );
|
int genTbId = createTool( tr( "TOOL_GENERATION" ) );
|
||||||
createTool( GEOMOp::OpPrism, genTbId );
|
createTool( GEOMOp::OpPrism, genTbId );
|
||||||
createTool( GEOMOp::OpRevolution, genTbId );
|
createTool( GEOMOp::OpRevolution, genTbId );
|
||||||
createTool( GEOMOp::OpFilling, genTbId );
|
createTool( GEOMOp::OpFilling, genTbId );
|
||||||
createTool( GEOMOp::OpPipe, genTbId );
|
createTool( GEOMOp::OpPipe, genTbId );
|
||||||
|
#if OCC_VERSION_LARGE > 0x06050300
|
||||||
|
createTool( GEOMOp::OpPipePath, genTbId );
|
||||||
|
#endif
|
||||||
|
|
||||||
int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ) );
|
int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ) );
|
||||||
createTool( GEOMOp::OpTranslate, transTbId );
|
createTool( GEOMOp::OpTranslate, transTbId );
|
||||||
createTool( GEOMOp::OpRotate, transTbId );
|
createTool( GEOMOp::OpRotate, transTbId );
|
||||||
@ -1169,14 +1176,14 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
createTool( separator(), transTbId );
|
createTool( separator(), transTbId );
|
||||||
createTool( GEOMOp::OpMultiTranslate, transTbId );
|
createTool( GEOMOp::OpMultiTranslate, transTbId );
|
||||||
createTool( GEOMOp::OpMultiRotate, transTbId );
|
createTool( GEOMOp::OpMultiRotate, transTbId );
|
||||||
|
|
||||||
int operTbId = createTool( tr( "TOOL_OPERATIONS" ) );
|
int operTbId = createTool( tr( "TOOL_OPERATIONS" ) );
|
||||||
createTool( GEOMOp::OpExplode, operTbId );
|
createTool( GEOMOp::OpExplode, operTbId );
|
||||||
createTool( GEOMOp::OpPartition, operTbId );
|
createTool( GEOMOp::OpPartition, operTbId );
|
||||||
createTool( GEOMOp::OpArchimede, operTbId );
|
createTool( GEOMOp::OpArchimede, operTbId );
|
||||||
createTool( GEOMOp::OpShapesOnShape, operTbId );
|
createTool( GEOMOp::OpShapesOnShape, operTbId );
|
||||||
createTool( GEOMOp::OpSharedShapes, operTbId );
|
createTool( GEOMOp::OpSharedShapes, operTbId );
|
||||||
|
|
||||||
int featTbId = createTool( tr( "TOOL_FEATURES" ) );
|
int featTbId = createTool( tr( "TOOL_FEATURES" ) );
|
||||||
createTool( GEOMOp::OpFillet1d, featTbId );
|
createTool( GEOMOp::OpFillet1d, featTbId );
|
||||||
createTool( GEOMOp::OpFillet2d, featTbId );
|
createTool( GEOMOp::OpFillet2d, featTbId );
|
||||||
@ -1184,7 +1191,7 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
createTool( GEOMOp::OpChamfer, featTbId );
|
createTool( GEOMOp::OpChamfer, featTbId );
|
||||||
createTool( GEOMOp::OpExtrudedBoss, featTbId );
|
createTool( GEOMOp::OpExtrudedBoss, featTbId );
|
||||||
createTool( GEOMOp::OpExtrudedCut, featTbId );
|
createTool( GEOMOp::OpExtrudedCut, featTbId );
|
||||||
|
|
||||||
int buildTbId = createTool( tr( "TOOL_BUILD" ) );
|
int buildTbId = createTool( tr( "TOOL_BUILD" ) );
|
||||||
createTool( GEOMOp::OpEdge, buildTbId );
|
createTool( GEOMOp::OpEdge, buildTbId );
|
||||||
createTool( GEOMOp::OpWire, buildTbId );
|
createTool( GEOMOp::OpWire, buildTbId );
|
||||||
@ -1219,7 +1226,7 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
#ifdef WITH_OPENCV
|
#ifdef WITH_OPENCV
|
||||||
createTool( GEOMOp::OpFeatureDetect, picturesTbId );
|
createTool( GEOMOp::OpFeatureDetect, picturesTbId );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// int advancedTbId = createTool( tr( "TOOL_ADVANCED" ) );
|
// int advancedTbId = createTool( tr( "TOOL_ADVANCED" ) );
|
||||||
|
|
||||||
//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@//
|
//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@//
|
||||||
@ -1261,7 +1268,7 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
mgr->setRule(action(GEOMOp::OpBringToFront), bringRule, QtxPopupMgr::VisibleRule );
|
mgr->setRule(action(GEOMOp::OpBringToFront), bringRule, QtxPopupMgr::VisibleRule );
|
||||||
mgr->setRule(action(GEOMOp::OpBringToFront), "topLevel=true", QtxPopupMgr::ToggleRule );
|
mgr->setRule(action(GEOMOp::OpBringToFront), "topLevel=true", QtxPopupMgr::ToggleRule );
|
||||||
mgr->insert( action(GEOMOp::OpClsBringToFront ), -1, -1 ); // clear bring to front
|
mgr->insert( action(GEOMOp::OpClsBringToFront ), -1, -1 ); // clear bring to front
|
||||||
mgr->setRule( action(GEOMOp::OpClsBringToFront ), clientOCC, QtxPopupMgr::VisibleRule );
|
mgr->setRule( action(GEOMOp::OpClsBringToFront ), clientOCC, QtxPopupMgr::VisibleRule );
|
||||||
#endif
|
#endif
|
||||||
mgr->insert( separator(), -1, -1 ); // -----------
|
mgr->insert( separator(), -1, -1 ); // -----------
|
||||||
dispmodeId = mgr->insert( tr( "MEN_DISPLAY_MODE" ), -1, -1 ); // display mode menu
|
dispmodeId = mgr->insert( tr( "MEN_DISPLAY_MODE" ), -1, -1 ); // display mode menu
|
||||||
@ -1293,7 +1300,7 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
mgr->insert( action( GEOMOp::OpPointMarker ), -1, -1 ); // point marker
|
mgr->insert( action( GEOMOp::OpPointMarker ), -1, -1 ); // point marker
|
||||||
//mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and $typeid in {%1}" ).arg(GEOM_POINT ), QtxPopupMgr::VisibleRule );
|
//mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and $typeid in {%1}" ).arg(GEOM_POINT ), QtxPopupMgr::VisibleRule );
|
||||||
mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and ( $typeid in {%1} or compoundOfVertices=true ) " ).arg(GEOM::VERTEX).arg(GEOM::COMPOUND), QtxPopupMgr::VisibleRule );
|
mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and ( $typeid in {%1} or compoundOfVertices=true ) " ).arg(GEOM::VERTEX).arg(GEOM::COMPOUND), QtxPopupMgr::VisibleRule );
|
||||||
mgr->insert( action( GEOMOp::OpMaterialProperties ), -1, -1 ); // material properties
|
mgr->insert( action( GEOMOp::OpMaterialProperties ), -1, -1 ); // material properties
|
||||||
mgr->setRule( action( GEOMOp::OpMaterialProperties ), clientOCCorVTK_AndSomeVisible + " and ($component={'GEOM'}) and selcount>0 and isVisible", QtxPopupMgr::VisibleRule );
|
mgr->setRule( action( GEOMOp::OpMaterialProperties ), clientOCCorVTK_AndSomeVisible + " and ($component={'GEOM'}) and selcount>0 and isVisible", QtxPopupMgr::VisibleRule );
|
||||||
mgr->insert( action( GEOMOp::OpSetTexture ), -1, -1 ); // texture
|
mgr->insert( action( GEOMOp::OpSetTexture ), -1, -1 ); // texture
|
||||||
mgr->setRule( action( GEOMOp::OpSetTexture ), clientOCCorOB_AndSomeVisible + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
|
mgr->setRule( action( GEOMOp::OpSetTexture ), clientOCCorOB_AndSomeVisible + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
|
||||||
@ -1304,7 +1311,7 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
|
|
||||||
mgr->insert( action( GEOMOp::OpIsosWidth ), lineW, -1 ); // isos width
|
mgr->insert( action( GEOMOp::OpIsosWidth ), lineW, -1 ); // isos width
|
||||||
mgr->setRule( action( GEOMOp::OpIsosWidth ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
|
mgr->setRule( action( GEOMOp::OpIsosWidth ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
|
||||||
|
|
||||||
mgr->insert( separator(), -1, -1 ); // -----------
|
mgr->insert( separator(), -1, -1 ); // -----------
|
||||||
mgr->insert( action( GEOMOp::OpAutoColor ), -1, -1 ); // auto color
|
mgr->insert( action( GEOMOp::OpAutoColor ), -1, -1 ); // auto color
|
||||||
mgr->setRule( action( GEOMOp::OpAutoColor ), autoColorPrefix + " and isAutoColor=false", QtxPopupMgr::VisibleRule );
|
mgr->setRule( action( GEOMOp::OpAutoColor ), autoColorPrefix + " and isAutoColor=false", QtxPopupMgr::VisibleRule );
|
||||||
@ -1363,7 +1370,6 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
mgr->insert( action( GEOMOp::OpUnpublishObject ), -1, -1 ); // Unpublish object
|
mgr->insert( action( GEOMOp::OpUnpublishObject ), -1, -1 ); // Unpublish object
|
||||||
mgr->setRule( action( GEOMOp::OpUnpublishObject ), QString("client='ObjectBrowser' and $type in {'Shape' 'Group'} and selcount>0"), QtxPopupMgr::VisibleRule );
|
mgr->setRule( action( GEOMOp::OpUnpublishObject ), QString("client='ObjectBrowser' and $type in {'Shape' 'Group'} and selcount>0"), QtxPopupMgr::VisibleRule );
|
||||||
|
|
||||||
|
|
||||||
mgr->insert( action( GEOMOp::OpPublishObject ), -1, -1 ); // Publish object
|
mgr->insert( action( GEOMOp::OpPublishObject ), -1, -1 ); // Publish object
|
||||||
mgr->setRule( action( GEOMOp::OpPublishObject ), QString("client='ObjectBrowser' and isComponent=true"), QtxPopupMgr::VisibleRule );
|
mgr->setRule( action( GEOMOp::OpPublishObject ), QString("client='ObjectBrowser' and isComponent=true"), QtxPopupMgr::VisibleRule );
|
||||||
|
|
||||||
@ -1372,9 +1378,8 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
|
|
||||||
mgr->hide( mgr->actionId( action( myEraseAll ) ) );
|
mgr->hide( mgr->actionId( action( myEraseAll ) ) );
|
||||||
|
|
||||||
|
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
if(resMgr) {
|
if (resMgr) {
|
||||||
GEOM_AISShape::setTopLevelDisplayMode((GEOM_AISShape::TopLevelDispMode)resMgr->integerValue("Geometry", "toplevel_dm", 0));
|
GEOM_AISShape::setTopLevelDisplayMode((GEOM_AISShape::TopLevelDispMode)resMgr->integerValue("Geometry", "toplevel_dm", 0));
|
||||||
QColor c = resMgr->colorValue( "Geometry", "toplevel_color", QColor( 170, 85, 0 ) );
|
QColor c = resMgr->colorValue( "Geometry", "toplevel_color", QColor( 170, 85, 0 ) );
|
||||||
GEOM_AISShape::setTopLevelColor(SalomeApp_Tools::color(c));
|
GEOM_AISShape::setTopLevelColor(SalomeApp_Tools::color(c));
|
||||||
@ -1399,16 +1404,18 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
|
|||||||
|
|
||||||
// import Python module that manages GEOM plugins (need to be here because SalomePyQt API uses active module)
|
// import Python module that manages GEOM plugins (need to be here because SalomePyQt API uses active module)
|
||||||
PyGILState_STATE gstate = PyGILState_Ensure();
|
PyGILState_STATE gstate = PyGILState_Ensure();
|
||||||
PyObject* pluginsmanager=PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager");
|
PyObject* pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager");
|
||||||
if(pluginsmanager==NULL)
|
if (pluginsmanager == NULL)
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
else
|
else {
|
||||||
{
|
PyObject* result =
|
||||||
PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"geom",tr("MEN_NEW_ENTITY").toStdString().c_str(),tr("GEOM_PLUGINS_OTHER").toStdString().c_str());
|
PyObject_CallMethod(pluginsmanager, (char*)"initialize", (char*)"isss", 1, "geom",
|
||||||
if(result==NULL)
|
tr("MEN_NEW_ENTITY").toStdString().c_str(),
|
||||||
PyErr_Print();
|
tr("GEOM_PLUGINS_OTHER").toStdString().c_str());
|
||||||
Py_XDECREF(result);
|
if (result == NULL)
|
||||||
}
|
PyErr_Print();
|
||||||
|
Py_XDECREF(result);
|
||||||
|
}
|
||||||
PyGILState_Release(gstate);
|
PyGILState_Release(gstate);
|
||||||
// end of GEOM plugins loading
|
// end of GEOM plugins loading
|
||||||
|
|
||||||
@ -1466,13 +1473,13 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
|
|||||||
|
|
||||||
// 0020836 (Basic vectors and origin)
|
// 0020836 (Basic vectors and origin)
|
||||||
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
|
||||||
if( aResourceMgr->booleanValue( "Geometry", "auto_create_base_objects", false ) ) {
|
if ( aResourceMgr->booleanValue( "Geometry", "auto_create_base_objects", false ) ) {
|
||||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
|
||||||
if( appStudy ) {
|
if ( appStudy ) {
|
||||||
_PTR(Study) studyDS = appStudy->studyDS();
|
_PTR(Study) studyDS = appStudy->studyDS();
|
||||||
if( studyDS ) {
|
if ( studyDS ) {
|
||||||
_PTR(SComponent) aSComponent = studyDS->FindComponent("GEOM");
|
_PTR(SComponent) aSComponent = studyDS->FindComponent("GEOM");
|
||||||
if( !aSComponent ) // create objects automatically only if there is no GEOM component
|
if ( !aSComponent ) // create objects automatically only if there is no GEOM component
|
||||||
createOriginAndBaseVectors();
|
createOriginAndBaseVectors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1481,7 +1488,6 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : GeometryGUI::deactivateModule()
|
// function : GeometryGUI::deactivateModule()
|
||||||
// purpose : Called when GEOM module is deactivated
|
// purpose : Called when GEOM module is deactivated
|
||||||
@ -1571,7 +1577,7 @@ void GeometryGUI::onViewManagerAdded( SUIT_ViewManager* vm )
|
|||||||
this, SLOT( OnMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
|
this, SLOT( OnMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
|
||||||
connect( vm, SIGNAL( mouseRelease ( SUIT_ViewWindow*, QMouseEvent* ) ),
|
connect( vm, SIGNAL( mouseRelease ( SUIT_ViewWindow*, QMouseEvent* ) ),
|
||||||
this, SLOT( OnMouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ) );
|
this, SLOT( OnMouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ) );
|
||||||
|
|
||||||
LightApp_SelectionMgr* sm = getApp()->selectionMgr();
|
LightApp_SelectionMgr* sm = getApp()->selectionMgr();
|
||||||
myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) );
|
myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) );
|
||||||
|
|
||||||
@ -1741,31 +1747,30 @@ void GeometryGUI::createPreferences()
|
|||||||
LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" );
|
LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" );
|
||||||
|
|
||||||
int material = addPreference( tr( "PREF_MATERIAL" ), genGroup,
|
int material = addPreference( tr( "PREF_MATERIAL" ), genGroup,
|
||||||
LightApp_Preferences::Selector,
|
LightApp_Preferences::Selector,
|
||||||
"Geometry", "material" );
|
"Geometry", "material" );
|
||||||
|
|
||||||
const int nb = 4;
|
const int nb = 4;
|
||||||
int wd[nb];
|
int wd[nb];
|
||||||
int iter=0;
|
int iter=0;
|
||||||
|
|
||||||
wd[iter++] = addPreference( tr( "PREF_EDGE_WIDTH" ), genGroup,
|
wd[iter++] = addPreference( tr( "PREF_EDGE_WIDTH" ), genGroup,
|
||||||
LightApp_Preferences::IntSpin, "Geometry", "edge_width" );
|
LightApp_Preferences::IntSpin, "Geometry", "edge_width" );
|
||||||
|
|
||||||
wd[iter++] = addPreference( tr( "PREF_ISOLINES_WIDTH" ), genGroup,
|
wd[iter++] = addPreference( tr( "PREF_ISOLINES_WIDTH" ), genGroup,
|
||||||
LightApp_Preferences::IntSpin, "Geometry", "isolines_width" );
|
LightApp_Preferences::IntSpin, "Geometry", "isolines_width" );
|
||||||
|
|
||||||
wd[iter++] = addPreference( tr( "PREF_PREVIEW_EDGE_WIDTH" ), genGroup,
|
wd[iter++] = addPreference( tr( "PREF_PREVIEW_EDGE_WIDTH" ), genGroup,
|
||||||
LightApp_Preferences::IntSpin, "Geometry", "preview_edge_width" );
|
LightApp_Preferences::IntSpin, "Geometry", "preview_edge_width" );
|
||||||
|
|
||||||
wd[iter++] = addPreference( tr( "PREF_MEASURES_LINE_WIDTH" ), genGroup,
|
|
||||||
LightApp_Preferences::IntSpin, "Geometry", "measures_line_width" );
|
|
||||||
|
|
||||||
for(int i = 0; i < nb; i++) {
|
wd[iter++] = addPreference( tr( "PREF_MEASURES_LINE_WIDTH" ), genGroup,
|
||||||
setPreferenceProperty( wd[i], "min", 1 );
|
LightApp_Preferences::IntSpin, "Geometry", "measures_line_width" );
|
||||||
|
|
||||||
|
for (int i = 0; i < nb; i++) {
|
||||||
|
setPreferenceProperty( wd[i], "min", 1 );
|
||||||
setPreferenceProperty( wd[i], "max", 5 );
|
setPreferenceProperty( wd[i], "max", 5 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Quantities with individual precision settings
|
// Quantities with individual precision settings
|
||||||
int precGroup = addPreference( tr( "GEOM_PREF_GROUP_PRECISION" ), tabId );
|
int precGroup = addPreference( tr( "GEOM_PREF_GROUP_PRECISION" ), tabId );
|
||||||
setPreferenceProperty( precGroup, "columns", 2 );
|
setPreferenceProperty( precGroup, "columns", 2 );
|
||||||
@ -1819,7 +1824,6 @@ void GeometryGUI::createPreferences()
|
|||||||
setPreferenceProperty( dispmode, "strings", aModesList );
|
setPreferenceProperty( dispmode, "strings", aModesList );
|
||||||
setPreferenceProperty( dispmode, "indexes", anIndexesList );
|
setPreferenceProperty( dispmode, "indexes", anIndexesList );
|
||||||
|
|
||||||
|
|
||||||
// Set property for top level display mode
|
// Set property for top level display mode
|
||||||
QStringList aTopModesList;
|
QStringList aTopModesList;
|
||||||
aTopModesList.append( tr("MEN_SHOW_ADD_WACTOR") );
|
aTopModesList.append( tr("MEN_SHOW_ADD_WACTOR") );
|
||||||
@ -1891,7 +1895,6 @@ void GeometryGUI::createPreferences()
|
|||||||
addPreference( tr( "PREF_AUTO_CREATE" ), originGroup,
|
addPreference( tr( "PREF_AUTO_CREATE" ), originGroup,
|
||||||
LightApp_Preferences::Bool, "Geometry", "auto_create_base_objects" );
|
LightApp_Preferences::Bool, "Geometry", "auto_create_base_objects" );
|
||||||
|
|
||||||
|
|
||||||
int operationsGroup = addPreference( tr( "PREF_GROUP_OPERATIONS" ), tabId );
|
int operationsGroup = addPreference( tr( "PREF_GROUP_OPERATIONS" ), tabId );
|
||||||
setPreferenceProperty( operationsGroup, "columns", 2 );
|
setPreferenceProperty( operationsGroup, "columns", 2 );
|
||||||
|
|
||||||
@ -1906,18 +1909,20 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par
|
|||||||
if (param == QString("SettingsGeomStep")) {
|
if (param == QString("SettingsGeomStep")) {
|
||||||
double spin_step = aResourceMgr->doubleValue(section, param, 100.);
|
double spin_step = aResourceMgr->doubleValue(section, param, 100.);
|
||||||
EmitSignalDefaultStepValueChanged(spin_step);
|
EmitSignalDefaultStepValueChanged(spin_step);
|
||||||
} else if(param == QString("toplevel_color")) {
|
}
|
||||||
|
else if (param == QString("toplevel_color")) {
|
||||||
QColor c = aResourceMgr->colorValue( "Geometry", "toplevel_color", QColor( 170, 85, 0 ) );
|
QColor c = aResourceMgr->colorValue( "Geometry", "toplevel_color", QColor( 170, 85, 0 ) );
|
||||||
GEOM_AISShape::setTopLevelColor(SalomeApp_Tools::color(c));
|
GEOM_AISShape::setTopLevelColor(SalomeApp_Tools::color(c));
|
||||||
} else if(param == QString("toplevel_dm")) {
|
}
|
||||||
|
else if (param == QString("toplevel_dm")) {
|
||||||
GEOM_AISShape::setTopLevelDisplayMode((GEOM_AISShape::TopLevelDispMode)aResourceMgr->integerValue("Geometry", "toplevel_dm", 0));
|
GEOM_AISShape::setTopLevelDisplayMode((GEOM_AISShape::TopLevelDispMode)aResourceMgr->integerValue("Geometry", "toplevel_dm", 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LightApp_Displayer* GeometryGUI::displayer()
|
LightApp_Displayer* GeometryGUI::displayer()
|
||||||
{
|
{
|
||||||
if( !myDisplayer )
|
if ( !myDisplayer )
|
||||||
myDisplayer = new GEOM_Displayer( dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) );
|
myDisplayer = new GEOM_Displayer( dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) );
|
||||||
return myDisplayer;
|
return myDisplayer;
|
||||||
}
|
}
|
||||||
@ -1926,6 +1931,7 @@ void GeometryGUI::setLocalSelectionMode(const int mode)
|
|||||||
{
|
{
|
||||||
myLocalSelectionMode = mode;
|
myLocalSelectionMode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GeometryGUI::getLocalSelectionMode() const
|
int GeometryGUI::getLocalSelectionMode() const
|
||||||
{
|
{
|
||||||
return myLocalSelectionMode;
|
return myLocalSelectionMode;
|
||||||
@ -1986,7 +1992,7 @@ void GeometryGUI::storeVisualParameters (int savePoint)
|
|||||||
std::string entry = ip->encodeEntry(o_it.key().toLatin1().data(), componentName);
|
std::string entry = ip->encodeEntry(o_it.key().toLatin1().data(), componentName);
|
||||||
|
|
||||||
_PTR(GenericAttribute) anAttr;
|
_PTR(GenericAttribute) anAttr;
|
||||||
if( !obj->FindAttribute(anAttr, "AttributeIOR"))
|
if (!obj->FindAttribute(anAttr, "AttributeIOR"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
std::string param,occParam = vType.toLatin1().data();
|
std::string param,occParam = vType.toLatin1().data();
|
||||||
@ -1994,17 +2000,17 @@ void GeometryGUI::storeVisualParameters (int savePoint)
|
|||||||
occParam += QString::number(aMgrId).toLatin1().data();
|
occParam += QString::number(aMgrId).toLatin1().data();
|
||||||
occParam += NAME_SEPARATOR;
|
occParam += NAME_SEPARATOR;
|
||||||
|
|
||||||
if(aProps.contains(VISIBILITY_PROP)) {
|
if (aProps.contains(VISIBILITY_PROP)) {
|
||||||
param = occParam + VISIBILITY_PROP;
|
param = occParam + VISIBILITY_PROP;
|
||||||
ip->setParameter(entry, param, aProps.value(VISIBILITY_PROP).toInt() == 1 ? "On" : "Off");
|
ip->setParameter(entry, param, aProps.value(VISIBILITY_PROP).toInt() == 1 ? "On" : "Off");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aProps.contains(DISPLAY_MODE_PROP)) {
|
if (aProps.contains(DISPLAY_MODE_PROP)) {
|
||||||
param = occParam + DISPLAY_MODE_PROP;
|
param = occParam + DISPLAY_MODE_PROP;
|
||||||
ip->setParameter(entry, param, QString::number(aProps.value(DISPLAY_MODE_PROP).toInt()).toLatin1().data());
|
ip->setParameter(entry, param, QString::number(aProps.value(DISPLAY_MODE_PROP).toInt()).toLatin1().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aProps.contains(COLOR_PROP)) {
|
if (aProps.contains(COLOR_PROP)) {
|
||||||
QColor c = aProps.value(COLOR_PROP).value<QColor>();
|
QColor c = aProps.value(COLOR_PROP).value<QColor>();
|
||||||
QString colorStr = QString::number(c.red()/255.);
|
QString colorStr = QString::number(c.red()/255.);
|
||||||
colorStr += DIGIT_SEPARATOR; colorStr += QString::number(c.green()/255.);
|
colorStr += DIGIT_SEPARATOR; colorStr += QString::number(c.green()/255.);
|
||||||
@ -2013,59 +2019,59 @@ void GeometryGUI::storeVisualParameters (int savePoint)
|
|||||||
ip->setParameter(entry, param, colorStr.toLatin1().data());
|
ip->setParameter(entry, param, colorStr.toLatin1().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vType == SVTK_Viewer::Type()) {
|
if (vType == SVTK_Viewer::Type()) {
|
||||||
if(aProps.contains(OPACITY_PROP)) {
|
if (aProps.contains(OPACITY_PROP)) {
|
||||||
param = occParam + OPACITY_PROP;
|
param = occParam + OPACITY_PROP;
|
||||||
ip->setParameter(entry, param, QString::number(1. - aProps.value(TRANSPARENCY_PROP).toDouble()).toLatin1().data());
|
ip->setParameter(entry, param, QString::number(1. - aProps.value(TRANSPARENCY_PROP).toDouble()).toLatin1().data());
|
||||||
}
|
}
|
||||||
} else if (vType == SOCC_Viewer::Type()) {
|
} else if (vType == SOCC_Viewer::Type()) {
|
||||||
if(aProps.contains(TRANSPARENCY_PROP)) {
|
if (aProps.contains(TRANSPARENCY_PROP)) {
|
||||||
param = occParam + TRANSPARENCY_PROP;
|
param = occParam + TRANSPARENCY_PROP;
|
||||||
ip->setParameter(entry, param, QString::number(aProps.value(TRANSPARENCY_PROP).toDouble()).toLatin1().data());
|
ip->setParameter(entry, param, QString::number(aProps.value(TRANSPARENCY_PROP).toDouble()).toLatin1().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aProps.contains(TOP_LEVEL_PROP)) {
|
if (aProps.contains(TOP_LEVEL_PROP)) {
|
||||||
param = occParam + TOP_LEVEL_PROP;
|
param = occParam + TOP_LEVEL_PROP;
|
||||||
Standard_Boolean val = aProps.value(TOP_LEVEL_PROP).value<Standard_Boolean>();
|
Standard_Boolean val = aProps.value(TOP_LEVEL_PROP).value<Standard_Boolean>();
|
||||||
if (val == Standard_True)
|
if (val == Standard_True)
|
||||||
ip->setParameter(entry, param, "1");
|
ip->setParameter(entry, param, "1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aProps.contains(ISOS_PROP)) {
|
if (aProps.contains(ISOS_PROP)) {
|
||||||
param = occParam + ISOS_PROP;
|
param = occParam + ISOS_PROP;
|
||||||
ip->setParameter(entry, param, aProps.value(ISOS_PROP).toString().toLatin1().data());
|
ip->setParameter(entry, param, aProps.value(ISOS_PROP).toString().toLatin1().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aProps.contains(VECTOR_MODE_PROP)) {
|
if (aProps.contains(VECTOR_MODE_PROP)) {
|
||||||
param = occParam + VECTOR_MODE_PROP;
|
param = occParam + VECTOR_MODE_PROP;
|
||||||
ip->setParameter(entry, param, QString::number(aProps.value(VECTOR_MODE_PROP).toInt()).toLatin1().data());
|
ip->setParameter(entry, param, QString::number(aProps.value(VECTOR_MODE_PROP).toInt()).toLatin1().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aProps.contains(DEFLECTION_COEFF_PROP)) {
|
if (aProps.contains(DEFLECTION_COEFF_PROP)) {
|
||||||
param = occParam + DEFLECTION_COEFF_PROP;
|
param = occParam + DEFLECTION_COEFF_PROP;
|
||||||
ip->setParameter(entry, param, QString::number(aProps.value(DEFLECTION_COEFF_PROP).toDouble()).toLatin1().data());
|
ip->setParameter(entry, param, QString::number(aProps.value(DEFLECTION_COEFF_PROP).toDouble()).toLatin1().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Marker type of the vertex - ONLY for the "Vertex" and "Compound of the Vertex"
|
//Marker type of the vertex - ONLY for the "Vertex" and "Compound of the Vertex"
|
||||||
if(aProps.contains(MARKER_TYPE_PROP)) {
|
if (aProps.contains(MARKER_TYPE_PROP)) {
|
||||||
param = occParam + MARKER_TYPE_PROP;
|
param = occParam + MARKER_TYPE_PROP;
|
||||||
ip->setParameter(entry, param, aProps.value(MARKER_TYPE_PROP).toString().toLatin1().data());
|
ip->setParameter(entry, param, aProps.value(MARKER_TYPE_PROP).toString().toLatin1().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aProps.contains(MATERIAL_PROP)) {
|
if (aProps.contains(MATERIAL_PROP)) {
|
||||||
param = occParam + MATERIAL_PROP;
|
param = occParam + MATERIAL_PROP;
|
||||||
ip->setParameter(entry, param, aProps.value(MATERIAL_PROP).toString().toLatin1().data());
|
ip->setParameter(entry, param, aProps.value(MATERIAL_PROP).toString().toLatin1().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aProps.contains( EDGE_WIDTH_PROP )) {
|
if (aProps.contains(EDGE_WIDTH_PROP)) {
|
||||||
param = occParam + EDGE_WIDTH_PROP;
|
param = occParam + EDGE_WIDTH_PROP;
|
||||||
ip->setParameter(entry, param, aProps.value(EDGE_WIDTH_PROP).toString().toLatin1().data());
|
ip->setParameter(entry, param, aProps.value(EDGE_WIDTH_PROP).toString().toLatin1().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aProps.contains( ISOS_WIDTH_PROP )) {
|
if (aProps.contains(ISOS_WIDTH_PROP)) {
|
||||||
param = occParam + ISOS_WIDTH_PROP;
|
param = occParam + ISOS_WIDTH_PROP;
|
||||||
ip->setParameter(entry, param, aProps.value(ISOS_WIDTH_PROP).toString().toLatin1().data());
|
ip->setParameter(entry, param, aProps.value(ISOS_WIDTH_PROP).toString().toLatin1().data());
|
||||||
}
|
}
|
||||||
} // object iterator
|
} // object iterator
|
||||||
} // for (views)
|
} // for (views)
|
||||||
@ -2141,52 +2147,42 @@ void GeometryGUI::restoreVisualParameters (int savePoint)
|
|||||||
if (!ok) // bad conversion of view index to integer
|
if (!ok) // bad conversion of view index to integer
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if((viewIndex + 1) > aListOfMap.count()) {
|
if ((viewIndex + 1) > aListOfMap.count()) {
|
||||||
aListOfMap.resize(viewIndex + 1);
|
aListOfMap.resize(viewIndex + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString val((*valuesIt).c_str());
|
QString val((*valuesIt).c_str());
|
||||||
if(paramNameStr == VISIBILITY_PROP){
|
if (paramNameStr == VISIBILITY_PROP) {
|
||||||
aListOfMap[viewIndex].insert(VISIBILITY_PROP, val == "On" ? 1 : 0);
|
aListOfMap[viewIndex].insert(VISIBILITY_PROP, val == "On" ? 1 : 0);
|
||||||
|
} else if (paramNameStr == OPACITY_PROP) {
|
||||||
} else if(paramNameStr == OPACITY_PROP) {
|
|
||||||
aListOfMap[viewIndex].insert(TRANSPARENCY_PROP, 1. - val.toDouble());
|
aListOfMap[viewIndex].insert(TRANSPARENCY_PROP, 1. - val.toDouble());
|
||||||
|
} else if (paramNameStr == TRANSPARENCY_PROP) {
|
||||||
} else if(paramNameStr == TRANSPARENCY_PROP) {
|
|
||||||
aListOfMap[viewIndex].insert( TRANSPARENCY_PROP, val.toDouble() );
|
aListOfMap[viewIndex].insert( TRANSPARENCY_PROP, val.toDouble() );
|
||||||
|
} else if (paramNameStr == TOP_LEVEL_PROP) {
|
||||||
} else if(paramNameStr == TOP_LEVEL_PROP) {
|
aListOfMap[viewIndex].insert( TRANSPARENCY_PROP, val == "1" ? Standard_True : Standard_False );
|
||||||
aListOfMap[viewIndex].insert( TRANSPARENCY_PROP, val == "1" ? Standard_True : Standard_False );
|
} else if (paramNameStr == DISPLAY_MODE_PROP) {
|
||||||
|
|
||||||
} else if(paramNameStr == DISPLAY_MODE_PROP) {
|
|
||||||
aListOfMap[viewIndex].insert( DISPLAY_MODE_PROP, val.toInt());
|
aListOfMap[viewIndex].insert( DISPLAY_MODE_PROP, val.toInt());
|
||||||
|
} else if (paramNameStr == ISOS_PROP) {
|
||||||
} else if(paramNameStr == ISOS_PROP) {
|
|
||||||
aListOfMap[viewIndex].insert( ISOS_PROP, val);
|
aListOfMap[viewIndex].insert( ISOS_PROP, val);
|
||||||
|
} else if (paramNameStr == COLOR_PROP) {
|
||||||
} else if(paramNameStr == COLOR_PROP) {
|
|
||||||
QStringList rgb = val.split(DIGIT_SEPARATOR);
|
QStringList rgb = val.split(DIGIT_SEPARATOR);
|
||||||
if(rgb.count() == 3) {
|
if (rgb.count() == 3) {
|
||||||
QColor c(int(rgb[0].toDouble()*255), int(rgb[1].toDouble()*255), int(rgb[2].toDouble()*255));
|
QColor c(int(rgb[0].toDouble()*255), int(rgb[1].toDouble()*255), int(rgb[2].toDouble()*255));
|
||||||
aListOfMap[viewIndex].insert( COLOR_PROP, c);
|
aListOfMap[viewIndex].insert( COLOR_PROP, c);
|
||||||
}
|
}
|
||||||
} else if(paramNameStr == VECTOR_MODE_PROP) {
|
} else if (paramNameStr == VECTOR_MODE_PROP) {
|
||||||
aListOfMap[viewIndex].insert( VECTOR_MODE_PROP, val.toInt());
|
aListOfMap[viewIndex].insert( VECTOR_MODE_PROP, val.toInt());
|
||||||
|
} else if (paramNameStr == DEFLECTION_COEFF_PROP) {
|
||||||
} else if(paramNameStr == DEFLECTION_COEFF_PROP) {
|
|
||||||
aListOfMap[viewIndex].insert( DEFLECTION_COEFF_PROP, val.toDouble());
|
aListOfMap[viewIndex].insert( DEFLECTION_COEFF_PROP, val.toDouble());
|
||||||
} else if(paramNameStr == MARKER_TYPE_PROP) {
|
} else if (paramNameStr == MARKER_TYPE_PROP) {
|
||||||
aListOfMap[viewIndex].insert( MARKER_TYPE_PROP, val);
|
aListOfMap[viewIndex].insert( MARKER_TYPE_PROP, val);
|
||||||
} else if(paramNameStr == MATERIAL_PROP) {
|
} else if (paramNameStr == MATERIAL_PROP) {
|
||||||
aListOfMap[viewIndex].insert( MATERIAL_PROP, val);
|
aListOfMap[viewIndex].insert( MATERIAL_PROP, val);
|
||||||
} else if(paramNameStr == EDGE_WIDTH_PROP) {
|
} else if (paramNameStr == EDGE_WIDTH_PROP) {
|
||||||
aListOfMap[viewIndex].insert( EDGE_WIDTH_PROP , val);
|
aListOfMap[viewIndex].insert( EDGE_WIDTH_PROP, val);
|
||||||
} else if(paramNameStr == ISOS_WIDTH_PROP) {
|
} else if (paramNameStr == ISOS_WIDTH_PROP) {
|
||||||
aListOfMap[viewIndex].insert( ISOS_WIDTH_PROP , val);
|
aListOfMap[viewIndex].insert( ISOS_WIDTH_PROP, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // for names/parameters iterator
|
} // for names/parameters iterator
|
||||||
|
|
||||||
QList<SUIT_ViewManager*> lst = getApp()->viewManagers();
|
QList<SUIT_ViewManager*> lst = getApp()->viewManagers();
|
||||||
@ -2202,7 +2198,6 @@ void GeometryGUI::restoreVisualParameters (int savePoint)
|
|||||||
displayer()->Display(entry, true, dynamic_cast<SALOME_View*>(vmodel));
|
displayer()->Display(entry, true, dynamic_cast<SALOME_View*>(vmodel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // for entries iterator
|
} // for entries iterator
|
||||||
|
|
||||||
// update all VTK and OCC views
|
// update all VTK and OCC views
|
||||||
@ -2243,7 +2238,7 @@ void GeometryGUI::onViewAboutToShow()
|
|||||||
/*!
|
/*!
|
||||||
\brief Return action by id
|
\brief Return action by id
|
||||||
\param id identifier of the action
|
\param id identifier of the action
|
||||||
\return action
|
\return action
|
||||||
*/
|
*/
|
||||||
QAction* GeometryGUI::getAction(const int id) {
|
QAction* GeometryGUI::getAction(const int id) {
|
||||||
return action(id);
|
return action(id);
|
||||||
@ -2261,32 +2256,32 @@ QAction* GeometryGUI::getAction(const int id) {
|
|||||||
bool GeometryGUI::renameAllowed( const QString& entry) const {
|
bool GeometryGUI::renameAllowed( const QString& entry) const {
|
||||||
|
|
||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0;
|
SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0;
|
||||||
SalomeApp_DataObject* obj = appStudy ? dynamic_cast<SalomeApp_DataObject*>(appStudy->findObjectByEntry(entry)) : 0;
|
SalomeApp_DataObject* obj = appStudy ? dynamic_cast<SalomeApp_DataObject*>(appStudy->findObjectByEntry(entry)) : 0;
|
||||||
|
|
||||||
return (app && appStudy && obj && !appStudy->isComponent(entry) && !obj->isReference());
|
return (app && appStudy && obj && !appStudy->isComponent(entry) && !obj->isReference());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Rename object by entry.
|
Rename object by entry.
|
||||||
\param entry entry of the object
|
\param entry entry of the object
|
||||||
\param name new name of the object
|
\param name new name of the object
|
||||||
\brief Return \c true if rename operation finished successfully, \c false otherwise.
|
\brief Return \c true if rename operation finished successfully, \c false otherwise.
|
||||||
*/
|
*/
|
||||||
bool GeometryGUI::renameObject( const QString& entry, const QString& name) {
|
bool GeometryGUI::renameObject( const QString& entry, const QString& name)
|
||||||
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication());
|
SalomeApp_Application* app =
|
||||||
|
dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication());
|
||||||
SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0;
|
SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0;
|
||||||
|
|
||||||
if(!appStudy)
|
if (!appStudy)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
_PTR(Study) aStudy = appStudy->studyDS();
|
_PTR(Study) aStudy = appStudy->studyDS();
|
||||||
|
|
||||||
if(!aStudy)
|
if (!aStudy)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
bool aLocked = (_PTR(AttributeStudyProperties)(appStudy->studyDS()->GetProperties()))->IsLocked();
|
bool aLocked = (_PTR(AttributeStudyProperties)(appStudy->studyDS()->GetProperties()))->IsLocked();
|
||||||
@ -2311,4 +2306,3 @@ bool GeometryGUI::renameObject( const QString& entry, const QString& name) {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,6 +98,7 @@ namespace GEOMOp {
|
|||||||
OpRevolution = 3201, // MENU NEW ENTITY - GENERATION - REVOLUTION
|
OpRevolution = 3201, // MENU NEW ENTITY - GENERATION - REVOLUTION
|
||||||
OpFilling = 3202, // MENU NEW ENTITY - GENERATION - FILLING
|
OpFilling = 3202, // MENU NEW ENTITY - GENERATION - FILLING
|
||||||
OpPipe = 3203, // MENU NEW ENTITY - GENERATION - EXTRUSION ALONG PATH
|
OpPipe = 3203, // MENU NEW ENTITY - GENERATION - EXTRUSION ALONG PATH
|
||||||
|
OpPipePath = 3204, // MENU NEW ENTITY - GENERATION - RESTORE PATH
|
||||||
// EntityGUI -------------------//--------------------------------
|
// EntityGUI -------------------//--------------------------------
|
||||||
Op2dSketcher = 3300, // MENU NEW ENTITY - SKETCHER
|
Op2dSketcher = 3300, // MENU NEW ENTITY - SKETCHER
|
||||||
Op3dSketcher = 3301, // MENU NEW ENTITY - 3D SKETCHER
|
Op3dSketcher = 3301, // MENU NEW ENTITY - 3D SKETCHER
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
|
|
||||||
#include <Standard_ConstructionError.hxx>
|
#include <Standard_ConstructionError.hxx>
|
||||||
|
|
||||||
|
#include <utilities.h>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : GetID
|
//function : GetID
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -214,9 +216,19 @@ Standard_Integer GEOMImpl_3DSketcherDriver::Execute(TFunction_Logbook& log) cons
|
|||||||
if (aStrVals.Length() != 4)
|
if (aStrVals.Length() != 4)
|
||||||
Standard_ConstructionError::Raise("3D Sketcher error: Bad format of command.");
|
Standard_ConstructionError::Raise("3D Sketcher error: Bad format of command.");
|
||||||
|
|
||||||
|
char type = aStrVals.Value(1).Value(4);
|
||||||
|
char mode = aStrVals.Value(1).Value(5);
|
||||||
|
|
||||||
double anAngle = aStrVals.Value(2).RealValue() * M_PI/180.0;
|
double anAngle = aStrVals.Value(2).RealValue() * M_PI/180.0;
|
||||||
double anAngle2 = aStrVals.Value(3).RealValue() * M_PI/180.0;
|
double anAngle2 = aStrVals.Value(3).RealValue() * M_PI/180.0;
|
||||||
double aLength = aStrVals.Value(4).RealValue();
|
double aLength = aStrVals.Value(4).RealValue();
|
||||||
|
|
||||||
|
double aHeight = aLength * sin(anAngle2);
|
||||||
|
if (type == 'C')
|
||||||
|
{
|
||||||
|
aHeight = aStrVals.Value(3).RealValue();
|
||||||
|
anAngle2 = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
double aProjectedLength = aLength * cos(anAngle2);
|
double aProjectedLength = aLength * cos(anAngle2);
|
||||||
|
|
||||||
@ -224,21 +236,28 @@ Standard_Integer GEOMImpl_3DSketcherDriver::Execute(TFunction_Logbook& log) cons
|
|||||||
vp.SetX(aStrVals.Value(2).RealValue());
|
vp.SetX(aStrVals.Value(2).RealValue());
|
||||||
vp.SetY(aStrVals.Value(3).RealValue());
|
vp.SetY(aStrVals.Value(3).RealValue());
|
||||||
vp.SetZ(aStrVals.Value(4).RealValue());
|
vp.SetZ(aStrVals.Value(4).RealValue());
|
||||||
|
|
||||||
if (aStrVals.Value(1) == "OXY") {
|
gp_XYZ pref = gp::Origin().XYZ();
|
||||||
vp.SetX(p.X() + aProjectedLength * cos(anAngle));
|
if(mode == 'R')
|
||||||
vp.SetY(p.Y() + aProjectedLength * sin(anAngle));
|
pref = p;
|
||||||
vp.SetZ(p.Z() + aLength * sin(anAngle2));
|
|
||||||
|
TCollection_AsciiString aTruncatedCommand = aStrVals.Value(1);
|
||||||
|
aTruncatedCommand.Trunc(3);
|
||||||
|
|
||||||
|
if (aTruncatedCommand == "OXY") {
|
||||||
|
vp.SetX(pref.X() + aProjectedLength * cos(anAngle));
|
||||||
|
vp.SetY(pref.Y() + aProjectedLength * sin(anAngle));
|
||||||
|
vp.SetZ(pref.Z() + aHeight);
|
||||||
}
|
}
|
||||||
else if (aStrVals.Value(1) == "OYZ") {
|
else if (aTruncatedCommand == "OYZ") {
|
||||||
vp.SetX(p.X() + aLength * sin(anAngle2));
|
vp.SetX(pref.X() + aHeight);
|
||||||
vp.SetY(p.Y() + aProjectedLength * cos(anAngle));
|
vp.SetY(pref.Y() + aProjectedLength * cos(anAngle));
|
||||||
vp.SetZ(p.Z() + aProjectedLength * sin(anAngle));
|
vp.SetZ(pref.Z() + aProjectedLength * sin(anAngle));
|
||||||
}
|
}
|
||||||
else if (aStrVals.Value(1) == "OXZ") {
|
else if (aTruncatedCommand == "OXZ") {
|
||||||
vp.SetX(p.X() + aProjectedLength * cos(anAngle));
|
vp.SetX(pref.X() + aProjectedLength * cos(anAngle));
|
||||||
vp.SetY(p.Y() + aLength * sin(anAngle2));
|
vp.SetY(pref.Y() + aHeight);
|
||||||
vp.SetZ(p.Z() + aProjectedLength * sin(anAngle));
|
vp.SetZ(pref.Z() + aProjectedLength * sin(anAngle));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Standard_ConstructionError::Raise("3D Sketcher error: Bad format of command.");
|
Standard_ConstructionError::Raise("3D Sketcher error: Bad format of command.");
|
||||||
@ -295,7 +314,7 @@ Standard_Integer GEOMImpl_3DSketcherDriver::Execute(TFunction_Logbook& log) cons
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aShape.IsNull()) return 0;
|
if (aShape.IsNull()) return 0;
|
||||||
|
|
||||||
aFunction->SetValue(aShape);
|
aFunction->SetValue(aShape);
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#ifdef WNT
|
#ifdef WNT
|
||||||
#pragma warning( disable:4786 )
|
#pragma warning( disable:4786 )
|
||||||
@ -54,6 +53,7 @@
|
|||||||
#include <GEOMImpl_CylinderDriver.hxx>
|
#include <GEOMImpl_CylinderDriver.hxx>
|
||||||
#include <GEOMImpl_PrismDriver.hxx>
|
#include <GEOMImpl_PrismDriver.hxx>
|
||||||
#include <GEOMImpl_PipeDriver.hxx>
|
#include <GEOMImpl_PipeDriver.hxx>
|
||||||
|
#include <GEOMImpl_PipePathDriver.hxx>
|
||||||
#include <GEOMImpl_ThruSectionsDriver.hxx>
|
#include <GEOMImpl_ThruSectionsDriver.hxx>
|
||||||
#include <GEOMImpl_RevolutionDriver.hxx>
|
#include <GEOMImpl_RevolutionDriver.hxx>
|
||||||
#include <GEOMImpl_ShapeDriver.hxx>
|
#include <GEOMImpl_ShapeDriver.hxx>
|
||||||
@ -122,6 +122,7 @@ GEOMImpl_Gen::GEOMImpl_Gen()
|
|||||||
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CylinderDriver::GetID(), new GEOMImpl_CylinderDriver());
|
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_CylinderDriver::GetID(), new GEOMImpl_CylinderDriver());
|
||||||
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PrismDriver::GetID(), new GEOMImpl_PrismDriver());
|
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PrismDriver::GetID(), new GEOMImpl_PrismDriver());
|
||||||
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipeDriver::GetID(), new GEOMImpl_PipeDriver());
|
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipeDriver::GetID(), new GEOMImpl_PipeDriver());
|
||||||
|
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipePathDriver::GetID(), new GEOMImpl_PipePathDriver());
|
||||||
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ThruSectionsDriver::GetID(), new GEOMImpl_ThruSectionsDriver());
|
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_ThruSectionsDriver::GetID(), new GEOMImpl_ThruSectionsDriver());
|
||||||
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RevolutionDriver::GetID(), new GEOMImpl_RevolutionDriver());
|
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_RevolutionDriver::GetID(), new GEOMImpl_RevolutionDriver());
|
||||||
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SphereDriver::GetID(), new GEOMImpl_SphereDriver());
|
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SphereDriver::GetID(), new GEOMImpl_SphereDriver());
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
|
|
||||||
@ -49,6 +48,7 @@
|
|||||||
#include <GEOMImpl_TorusDriver.hxx>
|
#include <GEOMImpl_TorusDriver.hxx>
|
||||||
#include <GEOMImpl_PrismDriver.hxx>
|
#include <GEOMImpl_PrismDriver.hxx>
|
||||||
#include <GEOMImpl_PipeDriver.hxx>
|
#include <GEOMImpl_PipeDriver.hxx>
|
||||||
|
#include <GEOMImpl_PipePathDriver.hxx>
|
||||||
#include <GEOMImpl_RevolutionDriver.hxx>
|
#include <GEOMImpl_RevolutionDriver.hxx>
|
||||||
#include <GEOMImpl_ShapeDriver.hxx>
|
#include <GEOMImpl_ShapeDriver.hxx>
|
||||||
#include <GEOMImpl_FillingDriver.hxx>
|
#include <GEOMImpl_FillingDriver.hxx>
|
||||||
@ -69,6 +69,7 @@
|
|||||||
#include <GEOMImpl_IPipeDiffSect.hxx>
|
#include <GEOMImpl_IPipeDiffSect.hxx>
|
||||||
#include <GEOMImpl_IPipeShellSect.hxx>
|
#include <GEOMImpl_IPipeShellSect.hxx>
|
||||||
#include <GEOMImpl_IPipeBiNormal.hxx>
|
#include <GEOMImpl_IPipeBiNormal.hxx>
|
||||||
|
#include <GEOMImpl_IPipePath.hxx>
|
||||||
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
|
||||||
@ -2176,7 +2177,6 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MakePipeBiNormalAlongVector
|
* MakePipeBiNormalAlongVector
|
||||||
@ -2236,3 +2236,173 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Han
|
|||||||
SetErrorCode(OK);
|
SetErrorCode(OK);
|
||||||
return aPipe;
|
return aPipe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
/*!
|
||||||
|
* RestorePath
|
||||||
|
*/
|
||||||
|
//=============================================================================
|
||||||
|
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::RestorePath (Handle(GEOM_Object) theShape,
|
||||||
|
Handle(GEOM_Object) theBase1,
|
||||||
|
Handle(GEOM_Object) theBase2)
|
||||||
|
{
|
||||||
|
SetErrorCode(KO);
|
||||||
|
|
||||||
|
if (theShape.IsNull() || theBase1.IsNull() || theBase2.IsNull()) return NULL;
|
||||||
|
|
||||||
|
// Add a new Path object
|
||||||
|
Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH);
|
||||||
|
|
||||||
|
// Add a new Path function
|
||||||
|
Handle(GEOM_Function) aFunction =
|
||||||
|
aPath->AddFunction(GEOMImpl_PipePathDriver::GetID(), PIPE_PATH_TWO_BASES);
|
||||||
|
if (aFunction.IsNull()) return NULL;
|
||||||
|
|
||||||
|
// Check if the function is set correctly
|
||||||
|
if (aFunction->GetDriverGUID() != GEOMImpl_PipePathDriver::GetID()) return NULL;
|
||||||
|
|
||||||
|
GEOMImpl_IPipePath aCI (aFunction);
|
||||||
|
|
||||||
|
Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
|
||||||
|
Handle(GEOM_Function) aRefBase1 = theBase1->GetLastFunction();
|
||||||
|
Handle(GEOM_Function) aRefBase2 = theBase2->GetLastFunction();
|
||||||
|
|
||||||
|
if (aRefShape.IsNull() || aRefBase1.IsNull() || aRefBase2.IsNull()) return NULL;
|
||||||
|
|
||||||
|
aCI.SetShape(aRefShape);
|
||||||
|
aCI.SetBase1(aRefBase1);
|
||||||
|
aCI.SetBase2(aRefBase2);
|
||||||
|
|
||||||
|
// Compute the Path value
|
||||||
|
try {
|
||||||
|
#if OCC_VERSION_LARGE > 0x06010000
|
||||||
|
OCC_CATCH_SIGNALS;
|
||||||
|
#endif
|
||||||
|
if (!GetSolver()->ComputeFunction(aFunction)) {
|
||||||
|
SetErrorCode("PipePath driver failed");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Standard_Failure) {
|
||||||
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
|
SetErrorCode("RestorePath: inappropriate arguments given");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make a Python command
|
||||||
|
GEOM::TPythonDump(aFunction) << aPath << " = geompy.RestorePath("
|
||||||
|
<< theShape << ", " << theBase1 << ", " << theBase2 << ")";
|
||||||
|
|
||||||
|
SetErrorCode(OK);
|
||||||
|
return aPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
/*!
|
||||||
|
* RestorePath
|
||||||
|
*/
|
||||||
|
//=============================================================================
|
||||||
|
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::RestorePath
|
||||||
|
(Handle(GEOM_Object) theShape,
|
||||||
|
const Handle(TColStd_HSequenceOfTransient)& theBase1,
|
||||||
|
const Handle(TColStd_HSequenceOfTransient)& theBase2)
|
||||||
|
{
|
||||||
|
SetErrorCode(KO);
|
||||||
|
|
||||||
|
if (theShape.IsNull() || theBase1.IsNull() || theBase2.IsNull()) return NULL;
|
||||||
|
|
||||||
|
Standard_Integer nbBases1 = theBase1->Length();
|
||||||
|
Standard_Integer nbBases2 = theBase2->Length();
|
||||||
|
|
||||||
|
if (!nbBases1 || !nbBases2)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Add a new Path object
|
||||||
|
Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH);
|
||||||
|
|
||||||
|
// Add a new Path function
|
||||||
|
Handle(GEOM_Function) aFunction =
|
||||||
|
aPath->AddFunction(GEOMImpl_PipePathDriver::GetID(), PIPE_PATH_TWO_SEQS);
|
||||||
|
if (aFunction.IsNull()) return NULL;
|
||||||
|
|
||||||
|
// Check if the function is set correctly
|
||||||
|
if (aFunction->GetDriverGUID() != GEOMImpl_PipePathDriver::GetID()) return NULL;
|
||||||
|
|
||||||
|
GEOMImpl_IPipePath aCI (aFunction);
|
||||||
|
|
||||||
|
Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
|
||||||
|
if (aRefShape.IsNull()) return NULL;
|
||||||
|
|
||||||
|
Handle(TColStd_HSequenceOfTransient) aSeqBases1 = new TColStd_HSequenceOfTransient;
|
||||||
|
Handle(TColStd_HSequenceOfTransient) aSeqBases2 = new TColStd_HSequenceOfTransient;
|
||||||
|
|
||||||
|
Standard_Integer i;
|
||||||
|
for (i = 1; i <= nbBases1; i++) {
|
||||||
|
Handle(Standard_Transient) anItem = theBase1->Value(i);
|
||||||
|
if (!anItem.IsNull()) {
|
||||||
|
Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
|
||||||
|
if (!aBase.IsNull()) {
|
||||||
|
Handle(GEOM_Function) aRefBase = aBase->GetLastFunction();
|
||||||
|
if (!aRefBase.IsNull())
|
||||||
|
aSeqBases1->Append(aRefBase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (i = 1; i <= nbBases2; i++) {
|
||||||
|
Handle(Standard_Transient) anItem = theBase2->Value(i);
|
||||||
|
if (!anItem.IsNull()) {
|
||||||
|
Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
|
||||||
|
if (!aBase.IsNull()) {
|
||||||
|
Handle(GEOM_Function) aRefBase = aBase->GetLastFunction();
|
||||||
|
if (!aRefBase.IsNull())
|
||||||
|
aSeqBases2->Append(aRefBase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!aSeqBases1->Length() || !aSeqBases2->Length()) return NULL;
|
||||||
|
|
||||||
|
aCI.SetShape(aRefShape);
|
||||||
|
aCI.SetBaseSeq1(aSeqBases1);
|
||||||
|
aCI.SetBaseSeq2(aSeqBases2);
|
||||||
|
|
||||||
|
// Compute the Path value
|
||||||
|
try {
|
||||||
|
#if OCC_VERSION_LARGE > 0x06010000
|
||||||
|
OCC_CATCH_SIGNALS;
|
||||||
|
#endif
|
||||||
|
if (!GetSolver()->ComputeFunction(aFunction)) {
|
||||||
|
SetErrorCode("PipePath driver failed");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Standard_Failure) {
|
||||||
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
|
SetErrorCode("RestorePath: inappropriate arguments given");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make a Python command
|
||||||
|
GEOM::TPythonDump pyDump (aFunction);
|
||||||
|
pyDump << aPath << " = geompy.RestorePathEdges(" << theShape << ", [";
|
||||||
|
for (i = 1; i <= nbBases1; i++) {
|
||||||
|
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(theBase1->Value(i));
|
||||||
|
if (!anObj.IsNull()) {
|
||||||
|
pyDump << anObj;
|
||||||
|
if (i < nbBases1)
|
||||||
|
pyDump << ", ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pyDump<< "], [";
|
||||||
|
for (i = 1; i <= nbBases2; i++) {
|
||||||
|
Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(theBase2->Value(i));
|
||||||
|
if (!anObj.IsNull()) {
|
||||||
|
pyDump << anObj;
|
||||||
|
if (i < nbBases2)
|
||||||
|
pyDump << ", ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pyDump << "])";
|
||||||
|
|
||||||
|
SetErrorCode(OK);
|
||||||
|
return aPath;
|
||||||
|
}
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef _GEOMImpl_I3DPrimOperations_HXX_
|
#ifndef _GEOMImpl_I3DPrimOperations_HXX_
|
||||||
#define _GEOMImpl_I3DPrimOperations_HXX_
|
#define _GEOMImpl_I3DPrimOperations_HXX_
|
||||||
@ -131,14 +130,21 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
|
|||||||
bool theWithContact,
|
bool theWithContact,
|
||||||
bool theWithCorrections);
|
bool theWithCorrections);
|
||||||
|
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakePipeShellsWithoutPath(
|
Standard_EXPORT Handle(GEOM_Object) MakePipeShellsWithoutPath
|
||||||
const Handle(TColStd_HSequenceOfTransient)& theBases,
|
(const Handle(TColStd_HSequenceOfTransient)& theBases,
|
||||||
const Handle(TColStd_HSequenceOfTransient)& theLocations);
|
const Handle(TColStd_HSequenceOfTransient)& theLocations);
|
||||||
|
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase,
|
Standard_EXPORT Handle(GEOM_Object) MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase,
|
||||||
Handle(GEOM_Object) thePath,
|
Handle(GEOM_Object) thePath,
|
||||||
Handle(GEOM_Object) theVec);
|
Handle(GEOM_Object) theVec);
|
||||||
|
|
||||||
|
Standard_EXPORT Handle(GEOM_Object) RestorePath (Handle(GEOM_Object) theShape,
|
||||||
|
Handle(GEOM_Object) theBase1,
|
||||||
|
Handle(GEOM_Object) theBase2);
|
||||||
|
|
||||||
|
Standard_EXPORT Handle(GEOM_Object) RestorePath (Handle(GEOM_Object) theShape,
|
||||||
|
const Handle(TColStd_HSequenceOfTransient)& theBase1,
|
||||||
|
const Handle(TColStd_HSequenceOfTransient)& theBase2);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
#include <TopoDS_Vertex.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
#include <TopTools_IndexedMapOfShape.hxx>
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
|
||||||
|
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <gp_Vec.hxx>
|
#include <gp_Vec.hxx>
|
||||||
@ -70,6 +71,7 @@
|
|||||||
#include <TFunction_Driver.hxx>
|
#include <TFunction_Driver.hxx>
|
||||||
#include <TFunction_Logbook.hxx>
|
#include <TFunction_Logbook.hxx>
|
||||||
#include <TDF_Tool.hxx>
|
#include <TDF_Tool.hxx>
|
||||||
|
#include <TNaming_CopyShape.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
|
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
|
||||||
|
|
||||||
@ -1138,6 +1140,11 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Objec
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy source shape
|
||||||
|
TopoDS_Shape aShapeCopy;
|
||||||
|
TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
|
||||||
|
TNaming_CopyShape::CopyTool(Te7->GetValue(), aMapTShapes, aShapeCopy);
|
||||||
|
|
||||||
Handle(GEOM_Object) Te8 = myShapesOperations->MakeGlueFaces(Te7, 1e-7, true);
|
Handle(GEOM_Object) Te8 = myShapesOperations->MakeGlueFaces(Te7, 1e-7, true);
|
||||||
if (Te8.IsNull()) {
|
if (Te8.IsNull()) {
|
||||||
SetErrorCode("Impossible to glue faces of TShape");
|
SetErrorCode("Impossible to glue faces of TShape");
|
||||||
@ -1145,6 +1152,34 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Objec
|
|||||||
}
|
}
|
||||||
|
|
||||||
TopoDS_Shape aShape = Te8->GetValue();
|
TopoDS_Shape aShape = Te8->GetValue();
|
||||||
|
BRepCheck_Analyzer anAna (aShape, Standard_True);
|
||||||
|
|
||||||
|
if (!anAna.IsValid()) {
|
||||||
|
// Try to do gluing with the tolerance equal to maximal
|
||||||
|
// tolerance of vertices of the source shape.
|
||||||
|
Standard_Real aTolMax = -RealLast();
|
||||||
|
|
||||||
|
for (TopExp_Explorer ExV (aShapeCopy, TopAbs_VERTEX); ExV.More(); ExV.Next()) {
|
||||||
|
TopoDS_Vertex aVertex = TopoDS::Vertex(ExV.Current());
|
||||||
|
Standard_Real aTol = BRep_Tool::Tolerance(aVertex);
|
||||||
|
|
||||||
|
if (aTol > aTolMax) {
|
||||||
|
aTolMax = aTol;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perform gluing
|
||||||
|
Te7->GetLastFunction()->SetValue(aShapeCopy);
|
||||||
|
Te8 = myShapesOperations->MakeGlueFaces(Te7, aTolMax, true);
|
||||||
|
|
||||||
|
if (Te8.IsNull()) {
|
||||||
|
SetErrorCode("Impossible to glue faces of TShape");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
aShape = Te8->GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
theShape->GetLastFunction()->SetValue(aShape);
|
theShape->GetLastFunction()->SetValue(aShape);
|
||||||
|
|
||||||
@ -2252,7 +2287,14 @@ Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedDisk (double theR,
|
|||||||
int theOrientation, int thePattern)
|
int theOrientation, int thePattern)
|
||||||
{
|
{
|
||||||
SetErrorCode(KO);
|
SetErrorCode(KO);
|
||||||
|
|
||||||
|
if (theOrientation != 1 &&
|
||||||
|
theOrientation != 2 &&
|
||||||
|
theOrientation != 3)
|
||||||
|
{
|
||||||
|
SetErrorCode("theOrientation must be 1(=OXY), 2(=OYZ) or 3(=OZX)");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
//Add a new object
|
//Add a new object
|
||||||
Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
|
Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
|
||||||
|
|
||||||
|
@ -975,15 +975,17 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(TColStd_HArray1OfReal) aCoordsArray = new TColStd_HArray1OfReal (1, PyList_Size( coords ) * 3);
|
int lsize = PyList_Size( coords );
|
||||||
|
|
||||||
if(PyList_Size( coords ) <= 0) {
|
if(lsize <= 0) {
|
||||||
SetErrorCode("Empty list of the points, please check input parameters !!!");
|
SetErrorCode("Empty list of the points, please check input parameters !!!");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Handle(TColStd_HArray1OfReal) aCoordsArray = new TColStd_HArray1OfReal (1, lsize * 3);
|
||||||
|
|
||||||
int k=1;
|
int k=1;
|
||||||
for ( Py_ssize_t i = 0; i< PyList_Size( coords ); ++i ) {
|
for ( Py_ssize_t i = 0; i < lsize; ++i ) {
|
||||||
PyObject* coord = PyList_GetItem( coords, i );
|
PyObject* coord = PyList_GetItem( coords, i );
|
||||||
if (coord != NULL) {
|
if (coord != NULL) {
|
||||||
for ( Py_ssize_t j = 0; j < PyList_Size(coord); ++j) {
|
for ( Py_ssize_t j = 0; j < PyList_Size(coord); ++j) {
|
||||||
@ -1016,7 +1018,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
|
|||||||
|
|
||||||
GEOMImpl_IPolyline aCI (aFunction);
|
GEOMImpl_IPolyline aCI (aFunction);
|
||||||
|
|
||||||
aCI.SetLength(PyList_Size( coords ));
|
aCI.SetLength(lsize);
|
||||||
aCI.SetConstructorType(COORD_CONSTRUCTOR);
|
aCI.SetConstructorType(COORD_CONSTRUCTOR);
|
||||||
aCI.SetIsClosed(false);
|
aCI.SetIsClosed(false);
|
||||||
aCI.SetCoordinates(aCoordsArray);
|
aCI.SetCoordinates(aCoordsArray);
|
||||||
@ -1036,7 +1038,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
|
|||||||
|
|
||||||
GEOMImpl_ISpline aCI (aFunction);
|
GEOMImpl_ISpline aCI (aFunction);
|
||||||
|
|
||||||
aCI.SetLength(PyList_Size( coords ));
|
aCI.SetLength(lsize);
|
||||||
aCI.SetConstructorType(COORD_CONSTRUCTOR);
|
aCI.SetConstructorType(COORD_CONSTRUCTOR);
|
||||||
aCI.SetIsClosed(false);
|
aCI.SetIsClosed(false);
|
||||||
aCI.SetCoordinates(aCoordsArray);
|
aCI.SetCoordinates(aCoordsArray);
|
||||||
@ -1056,7 +1058,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
|
|||||||
|
|
||||||
GEOMImpl_ISpline aCI (aFunction);
|
GEOMImpl_ISpline aCI (aFunction);
|
||||||
aCI.SetConstructorType(COORD_CONSTRUCTOR);
|
aCI.SetConstructorType(COORD_CONSTRUCTOR);
|
||||||
aCI.SetLength(PyList_Size( coords ));
|
aCI.SetLength(lsize);
|
||||||
aCI.SetIsClosed(false);
|
aCI.SetIsClosed(false);
|
||||||
aCI.SetDoReordering(false);
|
aCI.SetDoReordering(false);
|
||||||
aCI.SetCoordinates(aCoordsArray);
|
aCI.SetCoordinates(aCoordsArray);
|
||||||
|
@ -246,9 +246,22 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::Import
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Make a Python command
|
//Make a Python command
|
||||||
if( theFormatName != "IGES_UNIT" ) {
|
if (theFormatName != "IGES_UNIT") {
|
||||||
GEOM::TPythonDump(aFunction) << result << " = geompy.ImportFile(\""
|
GEOM::TPythonDump pd (aFunction);
|
||||||
<< theFileName.ToCString() << "\", \"" << theFormatName.ToCString() << "\")";
|
if (theFormatName == "BREP")
|
||||||
|
pd << result << " = geompy.ImportBREP(\"" << theFileName.ToCString() << "\")";
|
||||||
|
else if (theFormatName == "IGES")
|
||||||
|
pd << result << " = geompy.ImportIGES(\"" << theFileName.ToCString() << "\")";
|
||||||
|
else if (theFormatName == "IGES_SCALE")
|
||||||
|
pd << result << " = geompy.ImportIGES(\"" << theFileName.ToCString() << "\", True)";
|
||||||
|
else if (theFormatName == "STEP")
|
||||||
|
pd << result << " = geompy.ImportSTEP(\"" << theFileName.ToCString() << "\")";
|
||||||
|
else if (theFormatName == "STEP_SCALE")
|
||||||
|
pd << result << " = geompy.ImportSTEP(\"" << theFileName.ToCString() << "\", True)";
|
||||||
|
else {
|
||||||
|
pd << result << " = geompy.ImportFile(\""
|
||||||
|
<< theFileName.ToCString() << "\", \"" << theFormatName.ToCString() << "\")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetErrorCode(OK);
|
SetErrorCode(OK);
|
||||||
@ -260,9 +273,9 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::Import
|
|||||||
gp_Pnt P = BRep_Tool::Pnt(V);
|
gp_Pnt P = BRep_Tool::Pnt(V);
|
||||||
double scale = P.X();
|
double scale = P.X();
|
||||||
TCollection_AsciiString aUnitName = "UNIT_M";
|
TCollection_AsciiString aUnitName = "UNIT_M";
|
||||||
if( fabs(scale-0.01) < 1.e-6 )
|
if (fabs(scale-0.01) < 1.e-6)
|
||||||
aUnitName = "UNIT_CM";
|
aUnitName = "UNIT_CM";
|
||||||
else if( fabs(scale-0.001) < 1.e-6 )
|
else if (fabs(scale-0.001) < 1.e-6)
|
||||||
aUnitName = "UNIT_MM";
|
aUnitName = "UNIT_MM";
|
||||||
//cout<<"IIO: aUnitName = "<<aUnitName.ToCString()<<endl;
|
//cout<<"IIO: aUnitName = "<<aUnitName.ToCString()<<endl;
|
||||||
SetErrorCode(aUnitName);
|
SetErrorCode(aUnitName);
|
||||||
|
61
src/GEOMImpl/GEOMImpl_IPipePath.hxx
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
// NOTE: This is an interface to the function RestorePath.
|
||||||
|
|
||||||
|
#ifndef _GEOMImpl_IPIPEPATH_HXX_
|
||||||
|
#define _GEOMImpl_IPIPEPATH_HXX_
|
||||||
|
|
||||||
|
#include "GEOM_Function.hxx"
|
||||||
|
|
||||||
|
class GEOMImpl_IPipePath
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
enum {
|
||||||
|
PIPE_PATH_SHAPE = 1,
|
||||||
|
PIPE_PATH_BASE1 = 2,
|
||||||
|
PIPE_PATH_BASE2 = 3,
|
||||||
|
PIPE_PATH_SEQ1 = 4,
|
||||||
|
PIPE_PATH_SEQ2 = 5
|
||||||
|
};
|
||||||
|
|
||||||
|
GEOMImpl_IPipePath (Handle(GEOM_Function)& theFunction): _func(theFunction) {}
|
||||||
|
|
||||||
|
void SetShape (Handle(GEOM_Function) theShape) { _func->SetReference(PIPE_PATH_SHAPE, theShape); }
|
||||||
|
void SetBase1 (Handle(GEOM_Function) theBase1) { _func->SetReference(PIPE_PATH_BASE1, theBase1); }
|
||||||
|
void SetBase2 (Handle(GEOM_Function) theBase2) { _func->SetReference(PIPE_PATH_BASE2, theBase2); }
|
||||||
|
void SetBaseSeq1 (const Handle(TColStd_HSequenceOfTransient)& theBase1)
|
||||||
|
{ _func->SetReferenceList(PIPE_PATH_SEQ1, theBase1); }
|
||||||
|
void SetBaseSeq2 (const Handle(TColStd_HSequenceOfTransient)& theBase2)
|
||||||
|
{ _func->SetReferenceList(PIPE_PATH_SEQ2, theBase2); }
|
||||||
|
|
||||||
|
Handle(GEOM_Function) GetShape() { return _func->GetReference(PIPE_PATH_SHAPE); }
|
||||||
|
Handle(GEOM_Function) GetBase1() { return _func->GetReference(PIPE_PATH_BASE1); }
|
||||||
|
Handle(GEOM_Function) GetBase2() { return _func->GetReference(PIPE_PATH_BASE2); }
|
||||||
|
Handle(TColStd_HSequenceOfTransient) GetBaseSeq1 ()
|
||||||
|
{ return _func->GetReferenceList(PIPE_PATH_SEQ1); }
|
||||||
|
Handle(TColStd_HSequenceOfTransient) GetBaseSeq2 ()
|
||||||
|
{ return _func->GetReferenceList(PIPE_PATH_SEQ2); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
Handle(GEOM_Function) _func;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -147,15 +147,10 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
|
|||||||
if (aShape_i.IsNull()) {
|
if (aShape_i.IsNull()) {
|
||||||
Standard_NullObject::Raise("In Partition a shape is null");
|
Standard_NullObject::Raise("In Partition a shape is null");
|
||||||
}
|
}
|
||||||
//
|
|
||||||
//BRepBuilderAPI_Copy aCopyTool (aShape_i);
|
|
||||||
TopoDS_Shape aShape_i_copy;
|
TopoDS_Shape aShape_i_copy;
|
||||||
TNaming_CopyShape::CopyTool(aShape_i, aMapTShapes, aShape_i_copy);
|
TNaming_CopyShape::CopyTool(aShape_i, aMapTShapes, aShape_i_copy);
|
||||||
//if (aCopyTool.IsDone())
|
|
||||||
// aShape_i_copy = aCopyTool.Shape();
|
|
||||||
//else
|
|
||||||
// Standard_NullObject::Raise("Bad shape detected");
|
|
||||||
//
|
|
||||||
// fill aCopyMap for history
|
// fill aCopyMap for history
|
||||||
TopTools_IndexedMapOfShape aShape_i_inds;
|
TopTools_IndexedMapOfShape aShape_i_inds;
|
||||||
TopTools_IndexedMapOfShape aShape_i_copy_inds;
|
TopTools_IndexedMapOfShape aShape_i_copy_inds;
|
||||||
@ -384,11 +379,17 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
aShape = PS.Shape();
|
aShape = PS.Shape();
|
||||||
if (aShape.IsNull()) return 0;
|
if (aShape.IsNull()) {
|
||||||
|
// Mantis issue 22009
|
||||||
|
if (PS.ErrorStatus() == 10 && PS.Tools().Extent() == 0 && PS.Shapes().Extent() == 1)
|
||||||
|
aShape = PS.Shapes().First();
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//Alternative case to check not valid partition IPAL21418
|
//Alternative case to check not valid partition IPAL21418
|
||||||
TopoDS_Iterator It (aShape, Standard_True, Standard_True);
|
TopoDS_Iterator It (aShape, Standard_True, Standard_True);
|
||||||
int nbSubshapes=0;
|
int nbSubshapes = 0;
|
||||||
for (; It.More(); It.Next())
|
for (; It.More(); It.Next())
|
||||||
nbSubshapes++;
|
nbSubshapes++;
|
||||||
if (!nbSubshapes)
|
if (!nbSubshapes)
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <GEOMImpl_IPipeShellSect.hxx>
|
#include <GEOMImpl_IPipeShellSect.hxx>
|
||||||
#include <GEOMImpl_IPipeBiNormal.hxx>
|
#include <GEOMImpl_IPipeBiNormal.hxx>
|
||||||
#include <GEOMImpl_IPipe.hxx>
|
#include <GEOMImpl_IPipe.hxx>
|
||||||
|
#include <GEOMImpl_IPipePath.hxx>
|
||||||
#include <GEOMImpl_GlueDriver.hxx>
|
#include <GEOMImpl_GlueDriver.hxx>
|
||||||
#include <GEOMImpl_Types.hxx>
|
#include <GEOMImpl_Types.hxx>
|
||||||
#include <GEOM_Function.hxx>
|
#include <GEOM_Function.hxx>
|
||||||
@ -41,15 +42,14 @@
|
|||||||
|
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <BRepBuilderAPI_Copy.hxx>
|
||||||
|
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||||
#include <BRepBuilderAPI_Sewing.hxx>
|
#include <BRepBuilderAPI_Sewing.hxx>
|
||||||
#include <BRepCheck_Analyzer.hxx>
|
#include <BRepCheck_Analyzer.hxx>
|
||||||
|
#include <BRepGProp.hxx>
|
||||||
#include <BRepOffsetAPI_MakePipe.hxx>
|
#include <BRepOffsetAPI_MakePipe.hxx>
|
||||||
#include <BRepOffsetAPI_MakePipeShell.hxx>
|
#include <BRepOffsetAPI_MakePipeShell.hxx>
|
||||||
#include <GProp_GProps.hxx>
|
|
||||||
#include <BRepGProp.hxx>
|
|
||||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
|
||||||
#include <BRepBuilderAPI_Copy.hxx>
|
|
||||||
|
|
||||||
#include <TopAbs.hxx>
|
#include <TopAbs.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
@ -68,6 +68,8 @@
|
|||||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
|
||||||
|
#include <GProp_GProps.hxx>
|
||||||
|
|
||||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||||
#include <GeomAPI_Interpolate.hxx>
|
#include <GeomAPI_Interpolate.hxx>
|
||||||
#include <Geom_TrimmedCurve.hxx>
|
#include <Geom_TrimmedCurve.hxx>
|
||||||
@ -88,6 +90,7 @@
|
|||||||
#include <TColStd_HSequenceOfTransient.hxx>
|
#include <TColStd_HSequenceOfTransient.hxx>
|
||||||
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
|
||||||
#include <Standard_NullObject.hxx>
|
#include <Standard_NullObject.hxx>
|
||||||
#include <Standard_TypeMismatch.hxx>
|
#include <Standard_TypeMismatch.hxx>
|
||||||
#include <Standard_ConstructionError.hxx>
|
#include <Standard_ConstructionError.hxx>
|
||||||
@ -100,7 +103,7 @@
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
const Standard_GUID& GEOMImpl_PipeDriver::GetID()
|
const Standard_GUID& GEOMImpl_PipeDriver::GetID()
|
||||||
{
|
{
|
||||||
static Standard_GUID aPipeDriver("FF1BBB19-5D14-4df2-980B-3A668264EA16");
|
static Standard_GUID aPipeDriver ("FF1BBB19-5D14-4df2-980B-3A668264EA16");
|
||||||
return aPipeDriver;
|
return aPipeDriver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2277,23 +2280,23 @@ static TopoDS_Shape CreatePipeBiNormalAlongVector(const TopoDS_Wire& aWirePath,
|
|||||||
//function : Execute
|
//function : Execute
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
|
Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
|
||||||
{
|
{
|
||||||
//cout<<"PipeDriver::Execute"<<endl;
|
|
||||||
if (Label().IsNull()) return 0;
|
if (Label().IsNull()) return 0;
|
||||||
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
|
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
|
||||||
GEOMImpl_IPipe* aCI= 0;
|
|
||||||
Standard_Integer aType = aFunction->GetType();
|
Standard_Integer aType = aFunction->GetType();
|
||||||
|
|
||||||
|
GEOMImpl_IPipe* aCI = 0;
|
||||||
if (aType == PIPE_BASE_PATH)
|
if (aType == PIPE_BASE_PATH)
|
||||||
aCI = new GEOMImpl_IPipe(aFunction);
|
aCI = new GEOMImpl_IPipe (aFunction);
|
||||||
else if (aType == PIPE_DIFFERENT_SECTIONS)
|
else if (aType == PIPE_DIFFERENT_SECTIONS)
|
||||||
aCI = new GEOMImpl_IPipeDiffSect(aFunction);
|
aCI = new GEOMImpl_IPipeDiffSect (aFunction);
|
||||||
else if (aType == PIPE_SHELL_SECTIONS)
|
else if (aType == PIPE_SHELL_SECTIONS)
|
||||||
aCI = new GEOMImpl_IPipeShellSect(aFunction);
|
aCI = new GEOMImpl_IPipeShellSect (aFunction);
|
||||||
else if (aType == PIPE_SHELLS_WITHOUT_PATH)
|
else if (aType == PIPE_SHELLS_WITHOUT_PATH)
|
||||||
aCI = new GEOMImpl_IPipeShellSect(aFunction);
|
aCI = new GEOMImpl_IPipeShellSect (aFunction);
|
||||||
else if (aType == PIPE_BI_NORMAL_ALONG_VECTOR)
|
else if (aType == PIPE_BI_NORMAL_ALONG_VECTOR)
|
||||||
aCI = new GEOMImpl_IPipeBiNormal(aFunction);
|
aCI = new GEOMImpl_IPipeBiNormal (aFunction);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
242
src/GEOMImpl/GEOMImpl_PipePathDriver.cxx
Normal file
@ -0,0 +1,242 @@
|
|||||||
|
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <Standard_Stream.hxx>
|
||||||
|
|
||||||
|
#include <Basics_OCCTVersion.hxx>
|
||||||
|
|
||||||
|
#include <GEOMImpl_PipePathDriver.hxx>
|
||||||
|
|
||||||
|
#include <GEOMImpl_IShapesOperations.hxx>
|
||||||
|
#include <GEOMImpl_ShapeDriver.hxx>
|
||||||
|
#include <GEOMImpl_IPipePath.hxx>
|
||||||
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
#include <GEOM_Function.hxx>
|
||||||
|
|
||||||
|
#include <ShapeAnalysis_FreeBounds.hxx>
|
||||||
|
#include <ShapeAnalysis_Edge.hxx>
|
||||||
|
#include <ShapeFix_Face.hxx>
|
||||||
|
#include <ShapeFix_Shell.hxx>
|
||||||
|
#include <ShapeFix_Shape.hxx>
|
||||||
|
#include <ShapeFix_ShapeTolerance.hxx>
|
||||||
|
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <BRepBuilderAPI_Copy.hxx>
|
||||||
|
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||||
|
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||||
|
#include <BRepBuilderAPI_Sewing.hxx>
|
||||||
|
#include <BRepCheck_Analyzer.hxx>
|
||||||
|
#include <BRepGProp.hxx>
|
||||||
|
#include <BRepOffsetAPI_MakePipe.hxx>
|
||||||
|
#include <BRepOffsetAPI_MakePipeShell.hxx>
|
||||||
|
|
||||||
|
#if OCC_VERSION_LARGE > 0x06050300
|
||||||
|
#include <BRepOffsetAPI_MiddlePath.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <TopAbs.hxx>
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Wire.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS_Solid.hxx>
|
||||||
|
#include <TopoDS_Shell.hxx>
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TopoDS_Compound.hxx>
|
||||||
|
#include <TopTools_SequenceOfShape.hxx>
|
||||||
|
#include <TopTools_HSequenceOfShape.hxx>
|
||||||
|
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
|
||||||
|
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
|
||||||
|
#include <GProp_GProps.hxx>
|
||||||
|
|
||||||
|
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||||
|
#include <GeomAPI_Interpolate.hxx>
|
||||||
|
#include <Geom_TrimmedCurve.hxx>
|
||||||
|
#include <Geom_Plane.hxx>
|
||||||
|
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||||
|
#include <Geom_BezierSurface.hxx>
|
||||||
|
#include <Geom_Line.hxx>
|
||||||
|
#include <Geom_Conic.hxx>
|
||||||
|
#include <Geom_BSplineCurve.hxx>
|
||||||
|
#include <Geom_BSplineSurface.hxx>
|
||||||
|
#include <GeomFill_BSplineCurves.hxx>
|
||||||
|
#include <GeomConvert_ApproxCurve.hxx>
|
||||||
|
#include <GeomConvert.hxx>
|
||||||
|
|
||||||
|
#include <TColgp_SequenceOfPnt.hxx>
|
||||||
|
#include <TColgp_HArray1OfPnt.hxx>
|
||||||
|
#include <TColgp_Array2OfPnt.hxx>
|
||||||
|
#include <TColStd_HSequenceOfTransient.hxx>
|
||||||
|
|
||||||
|
#include <Precision.hxx>
|
||||||
|
|
||||||
|
#include <Standard_NullObject.hxx>
|
||||||
|
#include <Standard_TypeMismatch.hxx>
|
||||||
|
#include <Standard_ConstructionError.hxx>
|
||||||
|
|
||||||
|
#include "utilities.h"
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GetID
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const Standard_GUID& GEOMImpl_PipePathDriver::GetID()
|
||||||
|
{
|
||||||
|
static Standard_GUID aPipePathDriver ("FF1BBB19-5D14-4df2-980B-3A668264EA17");
|
||||||
|
return aPipePathDriver;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GEOMImpl_PipePathDriver
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMImpl_PipePathDriver::GEOMImpl_PipePathDriver()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : Execute
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Integer GEOMImpl_PipePathDriver::Execute (TFunction_Logbook& log) const
|
||||||
|
{
|
||||||
|
if (Label().IsNull()) return 0;
|
||||||
|
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
|
||||||
|
Standard_Integer aType = aFunction->GetType();
|
||||||
|
|
||||||
|
TopoDS_Shape aRes;
|
||||||
|
|
||||||
|
// RestorePath
|
||||||
|
if (aType == PIPE_PATH_TWO_BASES) {
|
||||||
|
GEOMImpl_IPipePath aPI (aFunction);
|
||||||
|
|
||||||
|
Handle(GEOM_Function) aRefShape = aPI.GetShape();
|
||||||
|
Handle(GEOM_Function) aRefBase1 = aPI.GetBase1();
|
||||||
|
Handle(GEOM_Function) aRefBase2 = aPI.GetBase2();
|
||||||
|
|
||||||
|
TopoDS_Shape aShape = aRefShape->GetValue();
|
||||||
|
TopoDS_Shape aBase1 = aRefBase1->GetValue();
|
||||||
|
TopoDS_Shape aBase2 = aRefBase2->GetValue();
|
||||||
|
|
||||||
|
if (aShape.IsNull() || aBase1.IsNull() || aBase2.IsNull())
|
||||||
|
Standard_NullObject::Raise("RestorePath aborted : null argument");
|
||||||
|
|
||||||
|
#if OCC_VERSION_LARGE > 0x06050300
|
||||||
|
BRepOffsetAPI_MiddlePath aMPB (aShape, aBase1, aBase2);
|
||||||
|
aMPB.Build();
|
||||||
|
if (aMPB.IsDone()) {
|
||||||
|
aRes = aMPB.Shape();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
Standard_NullObject::Raise("RestorePath is not implemented in used OCCT version");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else if (aType == PIPE_PATH_TWO_SEQS) {
|
||||||
|
GEOMImpl_IPipePath aPI (aFunction);
|
||||||
|
|
||||||
|
Handle(GEOM_Function) aRefShape = aPI.GetShape();
|
||||||
|
TopoDS_Shape aShape = aRefShape->GetValue();
|
||||||
|
|
||||||
|
Handle(TColStd_HSequenceOfTransient) aBaseSeq1 = aPI.GetBaseSeq1();
|
||||||
|
Handle(TColStd_HSequenceOfTransient) aBaseSeq2 = aPI.GetBaseSeq2();
|
||||||
|
|
||||||
|
TopoDS_Shape aBase1;
|
||||||
|
TopoDS_Shape aBase2;
|
||||||
|
|
||||||
|
if (aBaseSeq1->Length() == 1 && aBaseSeq2->Length() == 1) {
|
||||||
|
Handle(GEOM_Function) aRefShape1 = Handle(GEOM_Function)::DownCast(aBaseSeq1->Value(1));
|
||||||
|
Handle(GEOM_Function) aRefShape2 = Handle(GEOM_Function)::DownCast(aBaseSeq2->Value(1));
|
||||||
|
aBase1 = aRefShape1->GetValue();
|
||||||
|
aBase2 = aRefShape2->GetValue();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aBase1 = GEOMImpl_ShapeDriver::MakeWireFromEdges(aBaseSeq1, Precision::Confusion());
|
||||||
|
aBase2 = GEOMImpl_ShapeDriver::MakeWireFromEdges(aBaseSeq2, Precision::Confusion());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aShape.IsNull() || aBase1.IsNull() || aBase2.IsNull())
|
||||||
|
Standard_NullObject::Raise("RestorePath aborted : null argument");
|
||||||
|
|
||||||
|
#if OCC_VERSION_LARGE > 0x06050300
|
||||||
|
BRepOffsetAPI_MiddlePath aMPB (aShape, aBase1, aBase2);
|
||||||
|
aMPB.Build();
|
||||||
|
if (aMPB.IsDone()) {
|
||||||
|
aRes = aMPB.Shape();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
Standard_NullObject::Raise("RestorePath is not implemented in used OCCT version");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aRes.IsNull()) return 0;
|
||||||
|
|
||||||
|
aFunction->SetValue(aRes);
|
||||||
|
log.SetTouched(Label());
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GEOMImpl_PipePathDriver_Type_
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_EXPORT Handle_Standard_Type& GEOMImpl_PipePathDriver_Type_()
|
||||||
|
{
|
||||||
|
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||||
|
if (aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||||
|
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||||
|
if (aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||||
|
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||||
|
if (aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||||
|
|
||||||
|
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||||
|
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PipePathDriver",
|
||||||
|
sizeof(GEOMImpl_PipePathDriver),
|
||||||
|
1,
|
||||||
|
(Standard_Address)_Ancestors,
|
||||||
|
(Standard_Address)NULL);
|
||||||
|
|
||||||
|
return _aType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : DownCast
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const Handle(GEOMImpl_PipePathDriver) Handle(GEOMImpl_PipePathDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||||
|
{
|
||||||
|
Handle(GEOMImpl_PipePathDriver) _anOtherObject;
|
||||||
|
|
||||||
|
if (!AnObject.IsNull()) {
|
||||||
|
if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_PipePathDriver))) {
|
||||||
|
_anOtherObject = Handle(GEOMImpl_PipePathDriver)((Handle(GEOMImpl_PipePathDriver)&)AnObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _anOtherObject;
|
||||||
|
}
|
167
src/GEOMImpl/GEOMImpl_PipePathDriver.hxx
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
// File : GEOMImpl_PipePathDriver.ixx
|
||||||
|
// Module : GEOMImpl
|
||||||
|
|
||||||
|
#ifndef _GEOMImpl_PipePathDriver_HeaderFile
|
||||||
|
#define _GEOMImpl_PipePathDriver_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TColStd_SequenceOfExtendedString_HeaderFile
|
||||||
|
#include <TColStd_SequenceOfExtendedString.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||||
|
#include <Standard_TypeMismatch.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_GUID_HeaderFile
|
||||||
|
#include <Standard_GUID.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _Handle_TFunction_Driver_HeaderFile
|
||||||
|
#include <Handle_TFunction_Driver.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class Standard_Transient;
|
||||||
|
class Handle_Standard_Type;
|
||||||
|
class Handle(TFunction_Driver);
|
||||||
|
class GEOMImpl_PipePathDriver;
|
||||||
|
|
||||||
|
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMImpl_PipePathDriver);
|
||||||
|
|
||||||
|
class Handle(GEOMImpl_PipePathDriver) : public Handle(TFunction_Driver) {
|
||||||
|
public:
|
||||||
|
inline void* operator new(size_t,void* anAddress)
|
||||||
|
{
|
||||||
|
return anAddress;
|
||||||
|
}
|
||||||
|
inline void* operator new(size_t size)
|
||||||
|
{
|
||||||
|
return Standard::Allocate(size);
|
||||||
|
}
|
||||||
|
inline void operator delete(void *anAddress)
|
||||||
|
{
|
||||||
|
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle(GEOMImpl_PipePathDriver)():Handle(TFunction_Driver)() {}
|
||||||
|
Handle(GEOMImpl_PipePathDriver)(const Handle(GEOMImpl_PipePathDriver)& aHandle) : Handle(TFunction_Driver)(aHandle)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle(GEOMImpl_PipePathDriver)(const GEOMImpl_PipePathDriver* anItem) : Handle(TFunction_Driver)((TFunction_Driver *)anItem)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle(GEOMImpl_PipePathDriver)& operator=(const Handle(GEOMImpl_PipePathDriver)& aHandle)
|
||||||
|
{
|
||||||
|
Assign(aHandle.Access());
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle(GEOMImpl_PipePathDriver)& operator=(const GEOMImpl_PipePathDriver* anItem)
|
||||||
|
{
|
||||||
|
Assign((Standard_Transient *)anItem);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
GEOMImpl_PipePathDriver* operator->()
|
||||||
|
{
|
||||||
|
return (GEOMImpl_PipePathDriver *)ControlAccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
GEOMImpl_PipePathDriver* operator->() const
|
||||||
|
{
|
||||||
|
return (GEOMImpl_PipePathDriver *)ControlAccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_EXPORT ~Handle(GEOMImpl_PipePathDriver)() {};
|
||||||
|
|
||||||
|
Standard_EXPORT static const Handle(GEOMImpl_PipePathDriver) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef _TFunction_Driver_HeaderFile
|
||||||
|
#include <TFunction_Driver.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TFunction_Logbook_HeaderFile
|
||||||
|
#include <TFunction_Logbook.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_CString_HeaderFile
|
||||||
|
#include <Standard_CString.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <TopoDS_Wire.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopTools_HSequenceOfShape.hxx>
|
||||||
|
|
||||||
|
class TColStd_SequenceOfExtendedString;
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMImpl_PipePathDriver : public TFunction_Driver {
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
inline void* operator new(size_t,void* anAddress)
|
||||||
|
{
|
||||||
|
return anAddress;
|
||||||
|
}
|
||||||
|
inline void* operator new(size_t size)
|
||||||
|
{
|
||||||
|
return Standard::Allocate(size);
|
||||||
|
}
|
||||||
|
inline void operator delete(void *anAddress)
|
||||||
|
{
|
||||||
|
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methods PUBLIC
|
||||||
|
//
|
||||||
|
Standard_EXPORT GEOMImpl_PipePathDriver();
|
||||||
|
Standard_EXPORT virtual Standard_Integer Execute(TFunction_Logbook& log) const;
|
||||||
|
Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
|
||||||
|
Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const
|
||||||
|
{ return Standard_True; }
|
||||||
|
Standard_EXPORT static const Standard_GUID& GetID();
|
||||||
|
Standard_EXPORT ~GEOMImpl_PipePathDriver() {};
|
||||||
|
|
||||||
|
// Type management
|
||||||
|
//
|
||||||
|
Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_PipePathDriver_Type_();
|
||||||
|
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const
|
||||||
|
{ return STANDARD_TYPE(GEOMImpl_PipePathDriver) ; }
|
||||||
|
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const
|
||||||
|
{ return (STANDARD_TYPE(GEOMImpl_PipePathDriver) == AType ||
|
||||||
|
TFunction_Driver::IsKind(AType)); }
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -133,66 +133,12 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
|
|||||||
|
|
||||||
if (aType == WIRE_EDGES) {
|
if (aType == WIRE_EDGES) {
|
||||||
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
|
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
|
||||||
TopoDS_Wire aWire;
|
|
||||||
B.MakeWire(aWire);
|
|
||||||
|
|
||||||
// add edges
|
|
||||||
for (unsigned int ind = 1; ind <= aShapes->Length(); ind++) {
|
|
||||||
Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aShapes->Value(ind));
|
|
||||||
TopoDS_Shape aShape_i = aRefShape->GetValue();
|
|
||||||
if (aShape_i.IsNull()) {
|
|
||||||
Standard_NullObject::Raise("Shape for wire construction is null");
|
|
||||||
}
|
|
||||||
if (aShape_i.ShapeType() == TopAbs_EDGE || aShape_i.ShapeType() == TopAbs_WIRE) {
|
|
||||||
TopExp_Explorer exp (aShape_i, TopAbs_EDGE);
|
|
||||||
for (; exp.More(); exp.Next())
|
|
||||||
B.Add(aWire, TopoDS::Edge(exp.Current()));
|
|
||||||
} else {
|
|
||||||
Standard_TypeMismatch::Raise
|
|
||||||
("Shape for wire construction is neither an edge nor a wire");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// fix edges order
|
|
||||||
Handle(ShapeFix_Wire) aFW = new ShapeFix_Wire;
|
|
||||||
aFW->Load(aWire);
|
|
||||||
aFW->FixReorder();
|
|
||||||
|
|
||||||
if (aFW->StatusReorder(ShapeExtend_FAIL1)) {
|
|
||||||
Standard_ConstructionError::Raise("Wire construction failed: several loops detected");
|
|
||||||
} else if (aFW->StatusReorder(ShapeExtend_FAIL)) {
|
|
||||||
Standard_ConstructionError::Raise("Wire construction failed");
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
|
|
||||||
// IMP 0019766: Building a Wire from unconnected edges by introducing a tolerance
|
|
||||||
Standard_Real aTolerance = aCI.GetTolerance();
|
Standard_Real aTolerance = aCI.GetTolerance();
|
||||||
if (aTolerance < Precision::Confusion())
|
if (aTolerance < Precision::Confusion())
|
||||||
aTolerance = Precision::Confusion();
|
aTolerance = Precision::Confusion();
|
||||||
|
|
||||||
aFW->ClosedWireMode() = Standard_False;
|
aShape = MakeWireFromEdges(aShapes, aTolerance);
|
||||||
aFW->FixConnected(aTolerance);
|
|
||||||
if (aFW->StatusConnected(ShapeExtend_FAIL)) {
|
|
||||||
Standard_ConstructionError::Raise("Wire construction failed: cannot build connected wire");
|
|
||||||
}
|
|
||||||
// IMP 0019766
|
|
||||||
if (aFW->StatusConnected(ShapeExtend_DONE3)) {
|
|
||||||
// Confused with <prec> but not Analyzer.Precision(), set the same
|
|
||||||
aFW->FixGapsByRangesMode() = Standard_True;
|
|
||||||
if (aFW->FixGaps3d()) {
|
|
||||||
Handle(ShapeExtend_WireData) sbwd = aFW->WireData();
|
|
||||||
Handle(ShapeFix_Edge) aFe = new ShapeFix_Edge;
|
|
||||||
for (Standard_Integer iedge = 1; iedge <= sbwd->NbEdges(); iedge++) {
|
|
||||||
TopoDS_Edge aEdge = TopoDS::Edge(sbwd->Edge(iedge));
|
|
||||||
aFe->FixVertexTolerance(aEdge);
|
|
||||||
aFe->FixSameParameter(aEdge);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (aFW->StatusGaps3d(ShapeExtend_FAIL)) {
|
|
||||||
Standard_ConstructionError::Raise("Wire construction failed: cannot fix 3d gaps");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
aShape = aFW->WireAPIMake();
|
|
||||||
}
|
}
|
||||||
else if (aType == FACE_WIRE) {
|
else if (aType == FACE_WIRE) {
|
||||||
Handle(GEOM_Function) aRefBase = aCI.GetBase();
|
Handle(GEOM_Function) aRefBase = aCI.GetBase();
|
||||||
@ -594,6 +540,10 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
|
|||||||
BRepCheck_Analyzer ana (aShape, false);
|
BRepCheck_Analyzer ana (aShape, false);
|
||||||
if (!ana.IsValid()) {
|
if (!ana.IsValid()) {
|
||||||
//Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
|
//Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
|
||||||
|
// For Mantis issue 0021772: EDF 2336 GEOM: Non valid face created from two circles
|
||||||
|
Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape (aShape);
|
||||||
|
aSfs->Perform();
|
||||||
|
aShape = aSfs->Shape();
|
||||||
}
|
}
|
||||||
|
|
||||||
aFunction->SetValue(aShape);
|
aFunction->SetValue(aShape);
|
||||||
@ -606,6 +556,73 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TopoDS_Wire GEOMImpl_ShapeDriver::MakeWireFromEdges(const Handle(TColStd_HSequenceOfTransient)& theEdgesFuncs,
|
||||||
|
const Standard_Real theTolerance)
|
||||||
|
{
|
||||||
|
BRep_Builder B;
|
||||||
|
|
||||||
|
TopoDS_Wire aWire;
|
||||||
|
B.MakeWire(aWire);
|
||||||
|
|
||||||
|
// add edges
|
||||||
|
for (unsigned int ind = 1; ind <= theEdgesFuncs->Length(); ind++) {
|
||||||
|
Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(theEdgesFuncs->Value(ind));
|
||||||
|
TopoDS_Shape aShape_i = aRefShape->GetValue();
|
||||||
|
if (aShape_i.IsNull()) {
|
||||||
|
Standard_NullObject::Raise("Shape for wire construction is null");
|
||||||
|
}
|
||||||
|
if (aShape_i.ShapeType() == TopAbs_EDGE || aShape_i.ShapeType() == TopAbs_WIRE) {
|
||||||
|
TopExp_Explorer exp (aShape_i, TopAbs_EDGE);
|
||||||
|
for (; exp.More(); exp.Next())
|
||||||
|
B.Add(aWire, TopoDS::Edge(exp.Current()));
|
||||||
|
} else {
|
||||||
|
Standard_TypeMismatch::Raise
|
||||||
|
("Shape for wire construction is neither an edge nor a wire");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// fix edges order
|
||||||
|
Handle(ShapeFix_Wire) aFW = new ShapeFix_Wire;
|
||||||
|
aFW->Load(aWire);
|
||||||
|
aFW->FixReorder();
|
||||||
|
|
||||||
|
if (aFW->StatusReorder(ShapeExtend_FAIL1)) {
|
||||||
|
Standard_ConstructionError::Raise("Wire construction failed: several loops detected");
|
||||||
|
}
|
||||||
|
else if (aFW->StatusReorder(ShapeExtend_FAIL)) {
|
||||||
|
Standard_ConstructionError::Raise("Wire construction failed");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IMP 0019766: Building a Wire from unconnected edges by introducing a tolerance
|
||||||
|
aFW->ClosedWireMode() = Standard_False;
|
||||||
|
aFW->FixConnected(theTolerance);
|
||||||
|
if (aFW->StatusConnected(ShapeExtend_FAIL)) {
|
||||||
|
Standard_ConstructionError::Raise("Wire construction failed: cannot build connected wire");
|
||||||
|
}
|
||||||
|
// IMP 0019766
|
||||||
|
if (aFW->StatusConnected(ShapeExtend_DONE3)) {
|
||||||
|
// Confused with <prec> but not Analyzer.Precision(), set the same
|
||||||
|
aFW->FixGapsByRangesMode() = Standard_True;
|
||||||
|
if (aFW->FixGaps3d()) {
|
||||||
|
Handle(ShapeExtend_WireData) sbwd = aFW->WireData();
|
||||||
|
Handle(ShapeFix_Edge) aFe = new ShapeFix_Edge;
|
||||||
|
for (Standard_Integer iedge = 1; iedge <= sbwd->NbEdges(); iedge++) {
|
||||||
|
TopoDS_Edge aEdge = TopoDS::Edge(sbwd->Edge(iedge));
|
||||||
|
aFe->FixVertexTolerance(aEdge);
|
||||||
|
aFe->FixSameParameter(aEdge);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (aFW->StatusGaps3d(ShapeExtend_FAIL)) {
|
||||||
|
Standard_ConstructionError::Raise("Wire construction failed: cannot fix 3d gaps");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aWire = aFW->WireAPIMake();
|
||||||
|
|
||||||
|
return aWire;
|
||||||
|
}
|
||||||
|
|
||||||
TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
|
TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
|
||||||
const Standard_Real LinTol,
|
const Standard_Real LinTol,
|
||||||
const Standard_Real AngTol)
|
const Standard_Real AngTol)
|
||||||
|
@ -120,6 +120,8 @@ class Handle(GEOMImpl_ShapeDriver) : public Handle(TFunction_Driver) {
|
|||||||
|
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
#include <TopoDS_Edge.hxx>
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopoDS_Wire.hxx>
|
||||||
|
#include <TColStd_HSequenceOfTransient.hxx>
|
||||||
|
|
||||||
class TColStd_SequenceOfExtendedString;
|
class TColStd_SequenceOfExtendedString;
|
||||||
|
|
||||||
@ -151,9 +153,13 @@ public:
|
|||||||
Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const { return Standard_True; }
|
Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const { return Standard_True; }
|
||||||
Standard_EXPORT static const Standard_GUID& GetID();
|
Standard_EXPORT static const Standard_GUID& GetID();
|
||||||
|
|
||||||
Standard_EXPORT static TopoDS_Edge MakeEdgeFromWire(const TopoDS_Shape& aWire,
|
Standard_EXPORT static TopoDS_Edge MakeEdgeFromWire (const TopoDS_Shape& aWire,
|
||||||
const Standard_Real LinTol,
|
const Standard_Real LinTol,
|
||||||
const Standard_Real AngTol);
|
const Standard_Real AngTol);
|
||||||
|
|
||||||
|
Standard_EXPORT static TopoDS_Wire MakeWireFromEdges
|
||||||
|
(const Handle(TColStd_HSequenceOfTransient)& theEdgesFuncs,
|
||||||
|
const Standard_Real theTolerance);
|
||||||
|
|
||||||
// Type management
|
// Type management
|
||||||
//
|
//
|
||||||
|
@ -100,6 +100,8 @@
|
|||||||
|
|
||||||
#define GEOM_EXTRUDED_BOSS 47
|
#define GEOM_EXTRUDED_BOSS 47
|
||||||
|
|
||||||
|
#define GEOM_PIPE_PATH 48
|
||||||
|
|
||||||
//GEOM_Function types
|
//GEOM_Function types
|
||||||
|
|
||||||
#define COPY_WITH_REF 1
|
#define COPY_WITH_REF 1
|
||||||
@ -214,6 +216,10 @@
|
|||||||
#define PIPE_SHELLS_WITHOUT_PATH 4
|
#define PIPE_SHELLS_WITHOUT_PATH 4
|
||||||
#define PIPE_BI_NORMAL_ALONG_VECTOR 5
|
#define PIPE_BI_NORMAL_ALONG_VECTOR 5
|
||||||
|
|
||||||
|
// RestorePath
|
||||||
|
#define PIPE_PATH_TWO_BASES 1
|
||||||
|
#define PIPE_PATH_TWO_SEQS 2
|
||||||
|
|
||||||
#define THRUSECTIONS_RULED 1
|
#define THRUSECTIONS_RULED 1
|
||||||
#define THRUSECTIONS_SMOOTHED 2
|
#define THRUSECTIONS_SMOOTHED 2
|
||||||
|
|
||||||
|
@ -83,6 +83,7 @@ salomeinclude_HEADERS = \
|
|||||||
GEOMImpl_ITorus.hxx \
|
GEOMImpl_ITorus.hxx \
|
||||||
GEOMImpl_IPrism.hxx \
|
GEOMImpl_IPrism.hxx \
|
||||||
GEOMImpl_IPipe.hxx \
|
GEOMImpl_IPipe.hxx \
|
||||||
|
GEOMImpl_IPipePath.hxx \
|
||||||
GEOMImpl_IRevolution.hxx \
|
GEOMImpl_IRevolution.hxx \
|
||||||
GEOMImpl_IMeasure.hxx \
|
GEOMImpl_IMeasure.hxx \
|
||||||
GEOMImpl_IShapes.hxx \
|
GEOMImpl_IShapes.hxx \
|
||||||
@ -111,6 +112,7 @@ salomeinclude_HEADERS = \
|
|||||||
GEOMImpl_TorusDriver.hxx \
|
GEOMImpl_TorusDriver.hxx \
|
||||||
GEOMImpl_PrismDriver.hxx \
|
GEOMImpl_PrismDriver.hxx \
|
||||||
GEOMImpl_PipeDriver.hxx \
|
GEOMImpl_PipeDriver.hxx \
|
||||||
|
GEOMImpl_PipePathDriver.hxx \
|
||||||
GEOMImpl_ThruSectionsDriver.hxx \
|
GEOMImpl_ThruSectionsDriver.hxx \
|
||||||
GEOMImpl_RevolutionDriver.hxx \
|
GEOMImpl_RevolutionDriver.hxx \
|
||||||
GEOMImpl_ShapeDriver.hxx \
|
GEOMImpl_ShapeDriver.hxx \
|
||||||
@ -185,6 +187,7 @@ dist_libGEOMimpl_la_SOURCES = \
|
|||||||
GEOMImpl_TorusDriver.cxx \
|
GEOMImpl_TorusDriver.cxx \
|
||||||
GEOMImpl_PrismDriver.cxx \
|
GEOMImpl_PrismDriver.cxx \
|
||||||
GEOMImpl_PipeDriver.cxx \
|
GEOMImpl_PipeDriver.cxx \
|
||||||
|
GEOMImpl_PipePathDriver.cxx \
|
||||||
GEOMImpl_ThruSectionsDriver.cxx \
|
GEOMImpl_ThruSectionsDriver.cxx \
|
||||||
GEOMImpl_RevolutionDriver.cxx \
|
GEOMImpl_RevolutionDriver.cxx \
|
||||||
GEOMImpl_ShapeDriver.cxx \
|
GEOMImpl_ShapeDriver.cxx \
|
||||||
|
@ -649,9 +649,9 @@ bool GEOMToolsGUI::Import()
|
|||||||
|
|
||||||
// jfa 21.08.2012 for mantis issue 21511 (STEP file units)
|
// jfa 21.08.2012 for mantis issue 21511 (STEP file units)
|
||||||
CORBA::String_var aUnits = aInsOp->ReadValue(fileN, fileT, "LEN_UNITS");
|
CORBA::String_var aUnits = aInsOp->ReadValue(fileN, fileT, "LEN_UNITS");
|
||||||
TCollection_AsciiString aUnitsStr (aUnits.in());
|
QString aUnitsStr (aUnits.in());
|
||||||
bool needConvert = true;
|
bool needConvert = true;
|
||||||
if (aUnitsStr.IsEmpty() || aUnitsStr == "UNIT_M")
|
if (aUnitsStr.isEmpty() || aUnitsStr == "M" || aUnitsStr.toLower() == "metre")
|
||||||
needConvert = false;
|
needConvert = false;
|
||||||
|
|
||||||
if (needConvert) {
|
if (needConvert) {
|
||||||
@ -664,7 +664,7 @@ bool GEOMToolsGUI::Import()
|
|||||||
if (i < fileNames.count() - 1) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
|
if (i < fileNames.count() - 1) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
|
||||||
igesAnswer = SUIT_MessageBox::question(app->desktop(),
|
igesAnswer = SUIT_MessageBox::question(app->desktop(),
|
||||||
"Question",//tr("WRN_WARNING"),
|
"Question",//tr("WRN_WARNING"),
|
||||||
tr("GEOM_SCALE_DIMENSIONS"),
|
tr("GEOM_SCALE_DIMENSIONS").arg(aUnitsStr),
|
||||||
btns | SUIT_MessageBox::Cancel,
|
btns | SUIT_MessageBox::Cancel,
|
||||||
SUIT_MessageBox::No);
|
SUIT_MessageBox::No);
|
||||||
switch (igesAnswer) {
|
switch (igesAnswer) {
|
||||||
|
@ -111,10 +111,10 @@
|
|||||||
|
|
||||||
// If the next macro is defined, autocolor feature works for all sub-shapes;
|
// If the next macro is defined, autocolor feature works for all sub-shapes;
|
||||||
// if it is undefined, autocolor feature works for groups only
|
// if it is undefined, autocolor feature works for groups only
|
||||||
//#define GENERAL_AUTOCOLOR
|
#define GENERAL_AUTOCOLOR
|
||||||
// Below macro, when uncommented, switches on simplified (more performant) algorithm
|
// Below macro, when uncommented, switches on simplified (more performant) algorithm
|
||||||
// of auto-color picking up
|
// of auto-color picking up
|
||||||
//#define SIMPLE_AUTOCOLOR
|
#define SIMPLE_AUTOCOLOR
|
||||||
|
|
||||||
void GEOMToolsGUI::OnCheckGeometry()
|
void GEOMToolsGUI::OnCheckGeometry()
|
||||||
{
|
{
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "GEOM_Gen_i.hh"
|
#include "GEOM_Gen_i.hh"
|
||||||
#include "GEOM_Object_i.hh"
|
#include "GEOM_Object_i.hh"
|
||||||
|
#include "GEOM_version.h"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -2551,6 +2552,16 @@ char* GEOM_Gen_i::getObjectInfo(CORBA::Long studyId, const char* entry)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Version information
|
||||||
|
char* GEOM_Gen_i::getVersion()
|
||||||
|
{
|
||||||
|
#if GEOM_DEVELOPMENT
|
||||||
|
return CORBA::string_dup(GEOM_VERSION_STR"dev");
|
||||||
|
#else
|
||||||
|
return CORBA::string_dup(GEOM_VERSION_STR);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
// EXPORTED METHODS
|
// EXPORTED METHODS
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
|
@ -264,6 +264,9 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
|
|||||||
virtual bool hasObjectInfo();
|
virtual bool hasObjectInfo();
|
||||||
virtual char* getObjectInfo(CORBA::Long studyId, const char* entry);
|
virtual char* getObjectInfo(CORBA::Long studyId, const char* entry);
|
||||||
|
|
||||||
|
// Version information
|
||||||
|
virtual char* getVersion();
|
||||||
|
|
||||||
//-----------------------------------------------------------------------//
|
//-----------------------------------------------------------------------//
|
||||||
// Internal methods //
|
// Internal methods //
|
||||||
//-----------------------------------------------------------------------//
|
//-----------------------------------------------------------------------//
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
|
|
||||||
@ -1096,7 +1095,6 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
|
|||||||
return GetObject(anObject);
|
return GetObject(anObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MakePipeBiNormalAlongVector
|
* MakePipeBiNormalAlongVector
|
||||||
@ -1127,3 +1125,81 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
|
|||||||
|
|
||||||
return GetObject(anObject);
|
return GetObject(anObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
/*!
|
||||||
|
* RestorePath
|
||||||
|
*/
|
||||||
|
//=============================================================================
|
||||||
|
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::RestorePath
|
||||||
|
(GEOM::GEOM_Object_ptr theShape,
|
||||||
|
GEOM::GEOM_Object_ptr theBase1,
|
||||||
|
GEOM::GEOM_Object_ptr theBase2)
|
||||||
|
{
|
||||||
|
GEOM::GEOM_Object_var aGEOMObject;
|
||||||
|
|
||||||
|
// Set a not done flag
|
||||||
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
|
// Get the reference objects
|
||||||
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
|
Handle(GEOM_Object) aBase1 = GetObjectImpl(theBase1);
|
||||||
|
Handle(GEOM_Object) aBase2 = GetObjectImpl(theBase2);
|
||||||
|
|
||||||
|
if (aShape.IsNull() || aBase1.IsNull() || aBase2.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
|
// Create the Path
|
||||||
|
Handle(GEOM_Object) anObject = GetOperations()->RestorePath(aShape, aBase1, aBase2);
|
||||||
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
|
return GetObject(anObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
/*!
|
||||||
|
* RestorePathEdges
|
||||||
|
*/
|
||||||
|
//=============================================================================
|
||||||
|
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::RestorePathEdges
|
||||||
|
(GEOM::GEOM_Object_ptr theShape,
|
||||||
|
const GEOM::ListOfGO& theBase1,
|
||||||
|
const GEOM::ListOfGO& theBase2)
|
||||||
|
{
|
||||||
|
GEOM::GEOM_Object_var aGEOMObject;
|
||||||
|
|
||||||
|
// Set a not done flag
|
||||||
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
|
// Get the reference objects
|
||||||
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
|
if (aShape.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
|
Handle(TColStd_HSequenceOfTransient) aSeqBases1 = new TColStd_HSequenceOfTransient;
|
||||||
|
Handle(TColStd_HSequenceOfTransient) aSeqBases2 = new TColStd_HSequenceOfTransient;
|
||||||
|
|
||||||
|
int ind;
|
||||||
|
int aNbBases1 = theBase1.length();
|
||||||
|
int aNbBases2 = theBase2.length();
|
||||||
|
|
||||||
|
for (ind = 0; ind < aNbBases1; ind++) {
|
||||||
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase1[ind]);
|
||||||
|
if (!aBase.IsNull())
|
||||||
|
aSeqBases1->Append(aBase);
|
||||||
|
}
|
||||||
|
for (ind = 0; ind < aNbBases2; ind++) {
|
||||||
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase2[ind]);
|
||||||
|
if (!aBase.IsNull())
|
||||||
|
aSeqBases2->Append(aBase);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!aSeqBases1->Length() || !aSeqBases2->Length())
|
||||||
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
|
// Create the Path
|
||||||
|
Handle(GEOM_Object) anObject = GetOperations()->RestorePath(aShape, aSeqBases1, aSeqBases2);
|
||||||
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
|
return GetObject(anObject);
|
||||||
|
}
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef _GEOM_I3DPrimOperations_i_HeaderFile
|
#ifndef _GEOM_I3DPrimOperations_i_HeaderFile
|
||||||
#define _GEOM_I3DPrimOperations_i_HeaderFile
|
#define _GEOM_I3DPrimOperations_i_HeaderFile
|
||||||
@ -188,6 +187,13 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
|
|||||||
GEOM::GEOM_Object_ptr thePath,
|
GEOM::GEOM_Object_ptr thePath,
|
||||||
GEOM::GEOM_Object_ptr theVec);
|
GEOM::GEOM_Object_ptr theVec);
|
||||||
|
|
||||||
|
GEOM::GEOM_Object_ptr RestorePath (GEOM::GEOM_Object_ptr theShape,
|
||||||
|
GEOM::GEOM_Object_ptr theBase1,
|
||||||
|
GEOM::GEOM_Object_ptr theBase2);
|
||||||
|
GEOM::GEOM_Object_ptr RestorePathEdges (GEOM::GEOM_Object_ptr theShape,
|
||||||
|
const GEOM::ListOfGO& theBase1,
|
||||||
|
const GEOM::ListOfGO& theBase2);
|
||||||
|
|
||||||
::GEOMImpl_I3DPrimOperations* GetOperations()
|
::GEOMImpl_I3DPrimOperations* GetOperations()
|
||||||
{ return (::GEOMImpl_I3DPrimOperations*)GetImpl(); }
|
{ return (::GEOMImpl_I3DPrimOperations*)GetImpl(); }
|
||||||
};
|
};
|
||||||
|
@ -81,7 +81,8 @@ libGEOMEngine_la_CPPFLAGS = \
|
|||||||
-I$(srcdir)/../GEOMImpl \
|
-I$(srcdir)/../GEOMImpl \
|
||||||
-I$(srcdir)/../GEOMAlgo \
|
-I$(srcdir)/../GEOMAlgo \
|
||||||
-I$(srcdir)/../GEOM \
|
-I$(srcdir)/../GEOM \
|
||||||
-I$(top_builddir)/idl
|
-I$(top_builddir)/idl \
|
||||||
|
-I$(top_builddir)
|
||||||
|
|
||||||
|
|
||||||
libGEOMEngine_la_LDFLAGS = \
|
libGEOMEngine_la_LDFLAGS = \
|
||||||
|
@ -147,7 +147,13 @@ class StructuralElementManager:
|
|||||||
(meshGroupList, newparams) = self._extractMeshGroups(command)
|
(meshGroupList, newparams) = self._extractMeshGroups(command)
|
||||||
for meshGroup in meshGroupList:
|
for meshGroup in meshGroupList:
|
||||||
# Get the geometrical primitive object
|
# Get the geometrical primitive object
|
||||||
groupSObj = self._studyEditor.study.FindObject(meshGroup)
|
if meshGroup.startswith('/'):
|
||||||
|
groupSObj = self._studyEditor.study.FindObjectByPath(meshGroup)
|
||||||
|
meshGroup = meshGroup.split('/')[-1]
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
groupSObj = self._studyEditor.study.FindObject(meshGroup)
|
||||||
|
pass
|
||||||
groupGeomObj = None
|
groupGeomObj = None
|
||||||
if groupSObj is not None:
|
if groupSObj is not None:
|
||||||
groupGeomObj = \
|
groupGeomObj = \
|
||||||
|
@ -27,7 +27,7 @@ import math
|
|||||||
|
|
||||||
from salome.kernel.logger import Logger
|
from salome.kernel.logger import Logger
|
||||||
from salome.kernel import termcolor
|
from salome.kernel import termcolor
|
||||||
logger = Logger("__PAL_GEOM__.structelem.orientation", color = termcolor.RED)
|
logger = Logger("salome.geom.structelem.orientation", color = termcolor.RED)
|
||||||
|
|
||||||
|
|
||||||
class Orientation1D:
|
class Orientation1D:
|
||||||
@ -57,25 +57,24 @@ class Orientation1D:
|
|||||||
coordinate system.
|
coordinate system.
|
||||||
|
|
||||||
The parameters can be specified several times. In this case, only the
|
The parameters can be specified several times. In this case, only the
|
||||||
first "VECT_Y" is taken into account, and the values of "ANGL_VRIL"
|
last "VECT_Y" or "ANGL_VRIL" is taken into account.
|
||||||
are added to obtain the total rotation angle.
|
|
||||||
"""
|
"""
|
||||||
|
if self._vectorYCoords is not None or self._angle != 0.0:
|
||||||
|
logger.warning('Orientation parameters are specified several '
|
||||||
|
'times for the same mesh group, only the last '
|
||||||
|
'parameter will be used')
|
||||||
mydict = params.copy()
|
mydict = params.copy()
|
||||||
if mydict.has_key("VECT_Y"):
|
if mydict.has_key("VECT_Y"):
|
||||||
newVecCoords = mydict.pop("VECT_Y")
|
newVecCoords = mydict.pop("VECT_Y")
|
||||||
if self._vectorYCoords is None:
|
logger.debug("Setting orientation vector Y to %s" %
|
||||||
logger.debug("Setting orientation vector Y to %s" %
|
|
||||||
str(newVecCoords))
|
str(newVecCoords))
|
||||||
self._vectorYCoords = newVecCoords
|
self._vectorYCoords = newVecCoords
|
||||||
else:
|
self._angle = 0.0
|
||||||
logger.warning('Orientation parameter "VECT_Y" is specified '
|
|
||||||
'several times for the same mesh group, vector'
|
|
||||||
' %s will be used' % str(self._vectorYCoords))
|
|
||||||
if mydict.has_key("ANGL_VRIL"):
|
if mydict.has_key("ANGL_VRIL"):
|
||||||
newAngle = mydict.pop("ANGL_VRIL")
|
newAngle = mydict.pop("ANGL_VRIL")
|
||||||
self._angle += newAngle
|
logger.debug("Setting orientation angle to %f" % newAngle)
|
||||||
logger.debug("Adding angle %f to orientation, new angle is %f." %
|
self._angle = newAngle
|
||||||
(newAngle, self._angle))
|
self._vectorYCoords = None
|
||||||
if len(mydict) > 0:
|
if len(mydict) > 0:
|
||||||
logger.warning("Invalid orientation parameter(s) (ignored): %s" %
|
logger.warning("Invalid orientation parameter(s) (ignored): %s" %
|
||||||
str(mydict))
|
str(mydict))
|
||||||
|
@ -109,8 +109,12 @@ def TestAll (geompy, math):
|
|||||||
sk = geompy.Sketcher3D()
|
sk = geompy.Sketcher3D()
|
||||||
sk.addPointsAbsolute(0,0,0, 70,0,0)
|
sk.addPointsAbsolute(0,0,0, 70,0,0)
|
||||||
sk.addPointsRelative(0, 0, 130)
|
sk.addPointsRelative(0, 0, 130)
|
||||||
sk.addPointAnglesLength("OXY", 50, 0, 100)
|
sk.addPointRadiusAnglesRelative(100, 50, 0,"OXY")
|
||||||
sk.addPointAnglesLength("OXZ", 30, 80, 130)
|
sk.addPointRadiusAnglesRelative(130, 30, 80, "OXZ")
|
||||||
|
sk.addPointRadiusAnglesAbsolute(500, 60, 30,"OXY")
|
||||||
|
sk.addPointRadiusAngleHRelative(100, 50, 0,"OXY")
|
||||||
|
sk.addPointRadiusAngleHRelative(130, 30, 40, "OXZ")
|
||||||
|
sk.addPointRadiusAngleHAbsolute(800, 60, 30,"OXY")
|
||||||
sk.close()
|
sk.close()
|
||||||
Sketcher3d_1 = sk.wire()
|
Sketcher3d_1 = sk.wire()
|
||||||
|
|
||||||
@ -204,7 +208,7 @@ def TestAll (geompy, math):
|
|||||||
Line3 = geompy.MakeLineTwoFaces(prism1_faces[0], prism1_faces[1]) #(2 GEOM_Object)->GEOM_Object
|
Line3 = geompy.MakeLineTwoFaces(prism1_faces[0], prism1_faces[1]) #(2 GEOM_Object)->GEOM_Object
|
||||||
|
|
||||||
#Create advanced objects
|
#Create advanced objects
|
||||||
Copy = geompy.MakeCopy(Box) #(GEOM_Object)->GEOM_Object
|
Copy = geompy.MakeCopy(Box) #(GEOM_Object)->GEOM_Object
|
||||||
Prism = geompy.MakePrismVecH(Face, vz, 100.0) #(2 GEOM_Object, Double)->GEOM_Object
|
Prism = geompy.MakePrismVecH(Face, vz, 100.0) #(2 GEOM_Object, Double)->GEOM_Object
|
||||||
Prism2Ways = geompy.MakePrismVecH2Ways(Face, vz, 10.0) #(2 GEOM_Object, Double)->GEOM_Object
|
Prism2Ways = geompy.MakePrismVecH2Ways(Face, vz, 10.0) #(2 GEOM_Object, Double)->GEOM_Object
|
||||||
PrismTwoPnt = geompy.MakePrism(Face2, p0, pxyz) #(3 GEOM_Object)->GEOM_Object
|
PrismTwoPnt = geompy.MakePrism(Face2, p0, pxyz) #(3 GEOM_Object)->GEOM_Object
|
||||||
@ -214,9 +218,9 @@ def TestAll (geompy, math):
|
|||||||
Revolution = geompy.MakeRevolution(Face, vz, angle2) #
|
Revolution = geompy.MakeRevolution(Face, vz, angle2) #
|
||||||
Revolution2Ways = geompy.MakeRevolution(Face, vz, angle1) #
|
Revolution2Ways = geompy.MakeRevolution(Face, vz, angle1) #
|
||||||
Filling = geompy.MakeFilling(Compound, mindeg, maxdeg,
|
Filling = geompy.MakeFilling(Compound, mindeg, maxdeg,
|
||||||
tol2d, tol3d, nbiter) #(GEOM_Object, 4 Doubles, Short)->GEOM_Object
|
tol2d, tol3d, nbiter) #(GEOM_Object, 4 Doubles, Short)->GEOM_Object
|
||||||
Pipe = geompy.MakePipe(Wire, Edge) #(2 GEOM_Object)->GEOM_Object
|
Pipe = geompy.MakePipe(Wire, Edge) #(2 GEOM_Object)->GEOM_Object
|
||||||
Sewing = geompy.MakeSewing([Face, S], precision) #(List Of GEOM_Object, Double)->GEOM_Object
|
Sewing = geompy.MakeSewing([Face, S], precision) #(List Of GEOM_Object, Double)->GEOM_Object
|
||||||
|
|
||||||
#Transform objects
|
#Transform objects
|
||||||
Translation = geompy.MakeTranslationTwoPoints(Box, px, pz) #(3 GEOM_Object)->GEOM_Object
|
Translation = geompy.MakeTranslationTwoPoints(Box, px, pz) #(3 GEOM_Object)->GEOM_Object
|
||||||
@ -408,6 +412,28 @@ def TestAll (geompy, math):
|
|||||||
id_Pipe = geompy.addToStudy(Pipe, "Pipe")
|
id_Pipe = geompy.addToStudy(Pipe, "Pipe")
|
||||||
id_Sewing = geompy.addToStudy(Sewing, "Sewing")
|
id_Sewing = geompy.addToStudy(Sewing, "Sewing")
|
||||||
|
|
||||||
|
import salome_version
|
||||||
|
if int(salome_version.getXVersion(), 16) >= int('0x060600', 16):
|
||||||
|
[Face5, Face6] = geompy.SubShapes(Box, [31, 33])
|
||||||
|
[b1_e1, b1_e2, b1_e3, b1_e4] = geompy.SubShapes(Box, [12, 22, 25, 29])
|
||||||
|
[b2_e1, b2_e2, b2_e3, b2_e4] = geompy.SubShapes(Box, [ 8, 18, 26, 30])
|
||||||
|
Path1 = geompy.RestorePath(Box, Face5, Face6)
|
||||||
|
Path2 = geompy.RestorePathEdges(Box, [b1_e1, b1_e2, b1_e3, b1_e4], [b2_e1, b2_e2, b2_e3, b2_e4])
|
||||||
|
|
||||||
|
id_Base1 = geompy.addToStudyInFather(Box, Face5, "Base1")
|
||||||
|
id_Base2 = geompy.addToStudyInFather(Box, Face6, "Base2")
|
||||||
|
id_Base1e1 = geompy.addToStudyInFather(Box, b1_e1, "Base1 Edge1")
|
||||||
|
id_Base1e2 = geompy.addToStudyInFather(Box, b1_e2, "Base1 Edge2")
|
||||||
|
id_Base1e3 = geompy.addToStudyInFather(Box, b1_e3, "Base1 Edge3")
|
||||||
|
id_Base1e4 = geompy.addToStudyInFather(Box, b1_e4, "Base1 Edge4")
|
||||||
|
id_Base2e1 = geompy.addToStudyInFather(Box, b2_e1, "Base2 Edge1")
|
||||||
|
id_Base2e2 = geompy.addToStudyInFather(Box, b2_e2, "Base2 Edge2")
|
||||||
|
id_Base2e3 = geompy.addToStudyInFather(Box, b2_e3, "Base2 Edge3")
|
||||||
|
id_Base2e4 = geompy.addToStudyInFather(Box, b2_e4, "Base2 Edge4")
|
||||||
|
id_Path1 = geompy.addToStudy(Path1, "Path1")
|
||||||
|
id_Path2 = geompy.addToStudy(Path2, "Path2")
|
||||||
|
pass
|
||||||
|
|
||||||
id_Translation = geompy.addToStudy(Translation, "Translation")
|
id_Translation = geompy.addToStudy(Translation, "Translation")
|
||||||
id_TranslVect = geompy.addToStudy(TranslVect , "Translation along vector")
|
id_TranslVect = geompy.addToStudy(TranslVect , "Translation along vector")
|
||||||
id_TranslVectD = geompy.addToStudy(TranslVectD, "Translation along vector with defined distance")
|
id_TranslVectD = geompy.addToStudy(TranslVectD, "Translation along vector with defined distance")
|
||||||
|
@ -78,16 +78,25 @@ def TestExportImport (geompy, shape):
|
|||||||
# Import
|
# Import
|
||||||
Import = geompy.ImportFile(fileExportImport, "BREP")
|
Import = geompy.ImportFile(fileExportImport, "BREP")
|
||||||
|
|
||||||
id_Import = geompy.addToStudy(Import, "Import")
|
geompy.addToStudy(Import, "Import")
|
||||||
|
|
||||||
# ImportBREP, ImportIGES, ImportSTEP
|
# ImportBREP, ImportIGES, ImportSTEP
|
||||||
ImportBREP = geompy.ImportBREP(fileExportImportBREP)
|
ImportBREP = geompy.ImportBREP(fileExportImportBREP)
|
||||||
ImportIGES = geompy.ImportIGES(fileExportImportIGES)
|
ImportIGES = geompy.ImportIGES(fileExportImportIGES)
|
||||||
ImportSTEP = geompy.ImportSTEP(fileExportImportSTEP)
|
ImportSTEP = geompy.ImportSTEP(fileExportImportSTEP)
|
||||||
|
|
||||||
id_ImportBREP = geompy.addToStudy(ImportBREP, "ImportBREP")
|
geompy.addToStudy(ImportBREP, "ImportBREP")
|
||||||
id_ImportIGES = geompy.addToStudy(ImportIGES, "ImportIGES")
|
geompy.addToStudy(ImportIGES, "ImportIGES")
|
||||||
id_ImportSTEP = geompy.addToStudy(ImportSTEP, "ImportSTEP")
|
geompy.addToStudy(ImportSTEP, "ImportSTEP")
|
||||||
|
|
||||||
|
# GetIGESUnit and GetSTEPUnit
|
||||||
|
if geompy.GetIGESUnit(fileExportImportIGES) != "M":
|
||||||
|
ImportIGES_scaled = geompy.ImportIGES(fileExportImportIGES, True)
|
||||||
|
geompy.addToStudy(ImportIGES_scaled, "ImportIGES_scaled")
|
||||||
|
|
||||||
|
if geompy.GetSTEPUnit(fileExportImportSTEP) != "M":
|
||||||
|
ImportSTEP_scaled = geompy.ImportSTEP(fileExportImportSTEP, True)
|
||||||
|
geompy.addToStudy(ImportSTEP_scaled, "ImportSTEP_scaled")
|
||||||
|
|
||||||
# Remove files for Export/Import testing
|
# Remove files for Export/Import testing
|
||||||
os.remove(fileExportImport)
|
os.remove(fileExportImport)
|
||||||
|
@ -2867,6 +2867,76 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
|
RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
|
## Build a middle path of a pipe-like shape.
|
||||||
|
# The path shape can be a wire or an edge.
|
||||||
|
# @param theShape It can be closed or unclosed pipe-like shell
|
||||||
|
# or a pipe-like solid.
|
||||||
|
# @param theBase1, theBase2 Two bases of the supposed pipe. This
|
||||||
|
# should be wires or faces of theShape.
|
||||||
|
# @note It is not assumed that exact or approximate copy of theShape
|
||||||
|
# can be obtained by applying existing Pipe operation on the
|
||||||
|
# resulting "Path" wire taking theBase1 as the base - it is not
|
||||||
|
# always possible; though in some particular cases it might work
|
||||||
|
# it is not guaranteed. Thus, RestorePath function should not be
|
||||||
|
# considered as an exact reverse operation of the Pipe.
|
||||||
|
# @return New GEOM.GEOM_Object, containing an edge or wire that represent
|
||||||
|
# source pipe's "path".
|
||||||
|
#
|
||||||
|
# @ref tui_creation_pipe_path "Example"
|
||||||
|
def RestorePath (self, theShape, theBase1, theBase2):
|
||||||
|
"""
|
||||||
|
Build a middle path of a pipe-like shape.
|
||||||
|
The path shape can be a wire or an edge.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
theShape It can be closed or unclosed pipe-like shell
|
||||||
|
or a pipe-like solid.
|
||||||
|
theBase1, theBase2 Two bases of the supposed pipe. This
|
||||||
|
should be wires or faces of theShape.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
New GEOM_Object, containing an edge or wire that represent
|
||||||
|
source pipe's path.
|
||||||
|
"""
|
||||||
|
anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
|
||||||
|
RaiseIfFailed("RestorePath", self.PrimOp)
|
||||||
|
return anObj
|
||||||
|
|
||||||
|
## Build a middle path of a pipe-like shape.
|
||||||
|
# The path shape can be a wire or an edge.
|
||||||
|
# @param theShape It can be closed or unclosed pipe-like shell
|
||||||
|
# or a pipe-like solid.
|
||||||
|
# @param listEdges1, listEdges2 Two bases of the supposed pipe. This
|
||||||
|
# should be lists of edges of theShape.
|
||||||
|
# @note It is not assumed that exact or approximate copy of theShape
|
||||||
|
# can be obtained by applying existing Pipe operation on the
|
||||||
|
# resulting "Path" wire taking theBase1 as the base - it is not
|
||||||
|
# always possible; though in some particular cases it might work
|
||||||
|
# it is not guaranteed. Thus, RestorePath function should not be
|
||||||
|
# considered as an exact reverse operation of the Pipe.
|
||||||
|
# @return New GEOM.GEOM_Object, containing an edge or wire that represent
|
||||||
|
# source pipe's "path".
|
||||||
|
#
|
||||||
|
# @ref tui_creation_pipe_path "Example"
|
||||||
|
def RestorePathEdges (self, theShape, listEdges1, listEdges2):
|
||||||
|
"""
|
||||||
|
Build a middle path of a pipe-like shape.
|
||||||
|
The path shape can be a wire or an edge.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
theShape It can be closed or unclosed pipe-like shell
|
||||||
|
or a pipe-like solid.
|
||||||
|
listEdges1, listEdges2 Two bases of the supposed pipe. This
|
||||||
|
should be lists of edges of theShape.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
New GEOM_Object, containing an edge or wire that represent
|
||||||
|
source pipe's path.
|
||||||
|
"""
|
||||||
|
anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
|
||||||
|
RaiseIfFailed("RestorePath", self.PrimOp)
|
||||||
|
return anObj
|
||||||
|
|
||||||
# end of l3_complex
|
# end of l3_complex
|
||||||
## @}
|
## @}
|
||||||
|
|
||||||
@ -7251,12 +7321,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
# @param theFileName The file, containing the shape.
|
# @param theFileName The file, containing the shape.
|
||||||
# @param theFormatName Specify format for the file reading.
|
# @param theFormatName Specify format for the file reading.
|
||||||
# Available formats can be obtained with InsertOp.ImportTranslators() method.
|
# Available formats can be obtained with InsertOp.ImportTranslators() method.
|
||||||
# If format 'IGES_SCALE' is used instead 'IGES' length unit will be
|
# If format 'IGES_SCALE' is used instead of 'IGES' or
|
||||||
# set to 'meter' and result model will be scaled.
|
# format 'STEP_SCALE' is used instead of 'STEP',
|
||||||
|
# length unit will be set to 'meter' and result model will be scaled.
|
||||||
# @return New GEOM.GEOM_Object, containing the imported shape.
|
# @return New GEOM.GEOM_Object, containing the imported shape.
|
||||||
#
|
#
|
||||||
# @ref swig_Import_Export "Example"
|
# @ref swig_Import_Export "Example"
|
||||||
def ImportFile(self,theFileName, theFormatName):
|
def ImportFile(self, theFileName, theFormatName):
|
||||||
"""
|
"""
|
||||||
Import a shape from the BREP or IGES or STEP file
|
Import a shape from the BREP or IGES or STEP file
|
||||||
(depends on given format) with given name.
|
(depends on given format) with given name.
|
||||||
@ -7264,9 +7335,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
Parameters:
|
Parameters:
|
||||||
theFileName The file, containing the shape.
|
theFileName The file, containing the shape.
|
||||||
theFormatName Specify format for the file reading.
|
theFormatName Specify format for the file reading.
|
||||||
Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
|
Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
|
||||||
If format 'IGES_SCALE' is used instead 'IGES' length unit will be
|
If format 'IGES_SCALE' is used instead of 'IGES' or
|
||||||
set to 'meter' and result model will be scaled.
|
format 'STEP_SCALE' is used instead of 'STEP',
|
||||||
|
length unit will be set to 'meter' and result model will be scaled.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
New GEOM.GEOM_Object, containing the imported shape.
|
New GEOM.GEOM_Object, containing the imported shape.
|
||||||
@ -7277,7 +7349,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
## Deprecated analog of ImportFile()
|
## Deprecated analog of ImportFile()
|
||||||
def Import(self,theFileName, theFormatName):
|
def Import(self, theFileName, theFormatName):
|
||||||
"""
|
"""
|
||||||
Deprecated analog of geompy.ImportFile
|
Deprecated analog of geompy.ImportFile
|
||||||
"""
|
"""
|
||||||
@ -7286,60 +7358,118 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
RaiseIfFailed("Import", self.InsertOp)
|
RaiseIfFailed("Import", self.InsertOp)
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
## Shortcut to ImportFile() for BREP format
|
## Shortcut to ImportFile() for BREP format.
|
||||||
|
# Import a shape from the BREP file with given name.
|
||||||
|
# @param theFileName The file, containing the shape.
|
||||||
|
# @return New GEOM.GEOM_Object, containing the imported shape.
|
||||||
#
|
#
|
||||||
# @ref swig_Import_Export "Example"
|
# @ref swig_Import_Export "Example"
|
||||||
def ImportBREP(self,theFileName):
|
def ImportBREP(self, theFileName):
|
||||||
"""
|
"""
|
||||||
geompy.ImportFile(...) function for BREP format
|
geompy.ImportFile(...) function for BREP format
|
||||||
|
Import a shape from the BREP file with given name.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
theFileName The file, containing the shape.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
New GEOM.GEOM_Object, containing the imported shape.
|
||||||
"""
|
"""
|
||||||
# Example: see GEOM_TestOthers.py
|
# Example: see GEOM_TestOthers.py
|
||||||
return self.ImportFile(theFileName, "BREP")
|
return self.ImportFile(theFileName, "BREP")
|
||||||
|
|
||||||
## Shortcut to ImportFile() for IGES format
|
## Shortcut to ImportFile() for IGES format
|
||||||
|
# Import a shape from the IGES file with given name.
|
||||||
|
# @param theFileName The file, containing the shape.
|
||||||
|
# @param ignoreUnits If True, file length units will be ignored (set to 'meter')
|
||||||
|
# and result model will be scaled, if its units are not meters.
|
||||||
|
# If False (default), file length units will be taken into account.
|
||||||
|
# @return New GEOM.GEOM_Object, containing the imported shape.
|
||||||
#
|
#
|
||||||
# @ref swig_Import_Export "Example"
|
# @ref swig_Import_Export "Example"
|
||||||
def ImportIGES(self,theFileName):
|
def ImportIGES(self, theFileName, ignoreUnits = False):
|
||||||
"""
|
"""
|
||||||
geompy.ImportFile(...) function for IGES format
|
geompy.ImportFile(...) function for IGES format
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
theFileName The file, containing the shape.
|
||||||
|
ignoreUnits If True, file length units will be ignored (set to 'meter')
|
||||||
|
and result model will be scaled, if its units are not meters.
|
||||||
|
If False (default), file length units will be taken into account.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
New GEOM.GEOM_Object, containing the imported shape.
|
||||||
"""
|
"""
|
||||||
# Example: see GEOM_TestOthers.py
|
# Example: see GEOM_TestOthers.py
|
||||||
|
if ignoreUnits:
|
||||||
|
return self.ImportFile(theFileName, "IGES_SCALE")
|
||||||
return self.ImportFile(theFileName, "IGES")
|
return self.ImportFile(theFileName, "IGES")
|
||||||
|
|
||||||
## Return length unit from given IGES file
|
## Return length unit from given IGES file
|
||||||
|
# @param theFileName The file, containing the shape.
|
||||||
|
# @return String, containing the units name.
|
||||||
#
|
#
|
||||||
# @ref swig_Import_Export "Example"
|
# @ref swig_Import_Export "Example"
|
||||||
def GetIGESUnit(self,theFileName):
|
def GetIGESUnit(self, theFileName):
|
||||||
"""
|
"""
|
||||||
Return length unit from given IGES file
|
Return length units from given IGES file
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
theFileName The file, containing the shape.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
String, containing the units name.
|
||||||
"""
|
"""
|
||||||
# Example: see GEOM_TestOthers.py
|
# Example: see GEOM_TestOthers.py
|
||||||
anObj = self.InsertOp.ImportFile(theFileName, "IGES_UNIT")
|
aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
|
||||||
#RaiseIfFailed("Import", self.InsertOp)
|
return aUnitName
|
||||||
# recieve name using returned vertex
|
|
||||||
UnitName = "M"
|
|
||||||
if anObj.GetShapeType() == GEOM.VERTEX:
|
|
||||||
vertices = [anObj]
|
|
||||||
else:
|
|
||||||
vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
|
|
||||||
if len(vertices)>0:
|
|
||||||
p = self.PointCoordinates(vertices[0])
|
|
||||||
if abs(p[0]-0.01) < 1.e-6:
|
|
||||||
UnitName = "CM"
|
|
||||||
elif abs(p[0]-0.001) < 1.e-6:
|
|
||||||
UnitName = "MM"
|
|
||||||
return UnitName
|
|
||||||
|
|
||||||
## Shortcut to ImportFile() for STEP format
|
## Shortcut to ImportFile() for STEP format
|
||||||
|
# Import a shape from the STEP file with given name.
|
||||||
|
# @param theFileName The file, containing the shape.
|
||||||
|
# @param ignoreUnits If True, file length units will be ignored (set to 'meter')
|
||||||
|
# and result model will be scaled, if its units are not meters.
|
||||||
|
# If False (default), file length units will be taken into account.
|
||||||
|
# @return New GEOM.GEOM_Object, containing the imported shape.
|
||||||
#
|
#
|
||||||
# @ref swig_Import_Export "Example"
|
# @ref swig_Import_Export "Example"
|
||||||
def ImportSTEP(self,theFileName):
|
def ImportSTEP(self, theFileName, ignoreUnits = False):
|
||||||
"""
|
"""
|
||||||
geompy.ImportFile(...) function for STEP format
|
geompy.ImportFile(...) function for STEP format
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
theFileName The file, containing the shape.
|
||||||
|
ignoreUnits If True, file length units will be ignored (set to 'meter')
|
||||||
|
and result model will be scaled, if its units are not meters.
|
||||||
|
If False (default), file length units will be taken into account.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
New GEOM.GEOM_Object, containing the imported shape.
|
||||||
"""
|
"""
|
||||||
# Example: see GEOM_TestOthers.py
|
# Example: see GEOM_TestOthers.py
|
||||||
|
if ignoreUnits:
|
||||||
|
return self.ImportFile(theFileName, "STEP_SCALE")
|
||||||
return self.ImportFile(theFileName, "STEP")
|
return self.ImportFile(theFileName, "STEP")
|
||||||
|
|
||||||
|
## Return length unit from given IGES or STEP file
|
||||||
|
# @param theFileName The file, containing the shape.
|
||||||
|
# @return String, containing the units name.
|
||||||
|
#
|
||||||
|
# @ref swig_Import_Export "Example"
|
||||||
|
def GetSTEPUnit(self, theFileName):
|
||||||
|
"""
|
||||||
|
Return length units from given STEP file
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
theFileName The file, containing the shape.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
String, containing the units name.
|
||||||
|
"""
|
||||||
|
# Example: see GEOM_TestOthers.py
|
||||||
|
aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
|
||||||
|
return aUnitName
|
||||||
|
|
||||||
## Read a shape from the binary stream, containing its bounding representation (BRep).
|
## Read a shape from the binary stream, containing its bounding representation (BRep).
|
||||||
# @note This method will not be dumped to the python script by DumpStudy functionality.
|
# @note This method will not be dumped to the python script by DumpStudy functionality.
|
||||||
# @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
|
# @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
|
||||||
@ -7372,7 +7502,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
# Available formats can be obtained with InsertOp.ImportTranslators() method.
|
# Available formats can be obtained with InsertOp.ImportTranslators() method.
|
||||||
#
|
#
|
||||||
# @ref swig_Import_Export "Example"
|
# @ref swig_Import_Export "Example"
|
||||||
def Export(self,theObject, theFileName, theFormatName):
|
def Export(self, theObject, theFileName, theFormatName):
|
||||||
"""
|
"""
|
||||||
Export the given shape into a file with given name.
|
Export the given shape into a file with given name.
|
||||||
|
|
||||||
@ -9003,13 +9133,19 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
RaiseIfFailed("LoadTexture", self.InsertOp)
|
RaiseIfFailed("LoadTexture", self.InsertOp)
|
||||||
return ID
|
return ID
|
||||||
|
|
||||||
## Get entry of the object
|
## Get internal name of the object based on its study entry
|
||||||
|
# @note This method does not provide an unique identifier of the geometry object.
|
||||||
|
# @note This is internal function of GEOM component, though it can be used outside it for
|
||||||
|
# appropriate reason (e.g. for identification of geometry object).
|
||||||
# @param obj geometry object
|
# @param obj geometry object
|
||||||
# @return unique object identifier
|
# @return unique object identifier
|
||||||
# @ingroup l1_geompy_auxiliary
|
# @ingroup l1_geompy_auxiliary
|
||||||
def getObjectID(self, obj):
|
def getObjectID(self, obj):
|
||||||
"""
|
"""
|
||||||
Get entry of the object
|
Get internal name of the object based on its study entry.
|
||||||
|
Note: this method does not provide an unique identifier of the geometry object.
|
||||||
|
It is an internal function of GEOM component, though it can be used outside GEOM for
|
||||||
|
appropriate reason (e.g. for identification of geometry object).
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
obj geometry object
|
obj geometry object
|
||||||
|
@ -121,11 +121,104 @@ class Sketcher3D:
|
|||||||
## Add one straight segment, defined by two angles and length.
|
## Add one straight segment, defined by two angles and length.
|
||||||
# If the first point of sketcher is not yet defined, the
|
# If the first point of sketcher is not yet defined, the
|
||||||
# origin (0, 0, 0) will become the first sketcher point.
|
# origin (0, 0, 0) will become the first sketcher point.
|
||||||
# @param axes can be: "OXY", "OYZ" or "OXZ"
|
# The radius and angles coordinates are defined
|
||||||
|
# in a local coordinate system which origin is the last point of the sketch
|
||||||
|
#
|
||||||
|
# @param length length of the segment
|
||||||
# @param angle1 angle in a plane, defined by the \a axes
|
# @param angle1 angle in a plane, defined by the \a axes
|
||||||
# @param angle2 angle from the plane, defined by the \a axes
|
# @param angle2 angle from the plane, defined by the \a axes
|
||||||
# @param length length of the segment
|
# @param axes can be: "OXY", "OYZ" or "OXZ"
|
||||||
def addPointAnglesLength (self, axes, angle1, angle2, length):
|
def addPointRadiusAnglesRelative (self, length, angle1, angle2, axes="OXY"):
|
||||||
|
"""
|
||||||
|
Add one straight segment, defined by two angles and length.
|
||||||
|
If the first point of sketcher is not yet defined, the
|
||||||
|
origin (0, 0, 0) will become the first sketcher point.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
length length of the segment
|
||||||
|
angle1 angle in a plane, defined by the \a axes
|
||||||
|
angle2 angle from the plane, defined by the \a axes
|
||||||
|
axes can be: "OXY", "OYZ" or "OXZ"
|
||||||
|
|
||||||
|
Example of usage:
|
||||||
|
sk = geompy.Sketcher3D()
|
||||||
|
sk.addPointRadiusAnglesRelative(100, 50, 0, "OXY")
|
||||||
|
a3D_Sketcher_1 = sk.wire()
|
||||||
|
"""
|
||||||
|
self.myCommand = self.myCommand + ":%s"%axes+"SR"+" %s %s %s" % (printVar(angle1), printVar(angle2), printVar(length))
|
||||||
|
pass
|
||||||
|
|
||||||
|
## Add one straight segment, defined by two angles and radius.
|
||||||
|
# If the first point of sketcher is not yet defined, the
|
||||||
|
# origin (0, 0, 0) will become the first sketcher point.
|
||||||
|
# The radius and angles coordinates are defined
|
||||||
|
# in a coordinate system which origin is the global coordinate system origin
|
||||||
|
#
|
||||||
|
# @param radius distance to the coordinate system origin
|
||||||
|
# @param angle1 angle in a plane, defined by the \a axes
|
||||||
|
# @param angle2 angle from the plane, defined by the \a axes
|
||||||
|
# @param axes can be: "OXY", "OYZ" or "OXZ"
|
||||||
|
def addPointRadiusAnglesAbsolute (self, radius, angle1, angle2, axes="OXY"):
|
||||||
|
"""
|
||||||
|
Add one straight segment, defined by two angles and length.
|
||||||
|
If the first point of sketcher is not yet defined, the
|
||||||
|
origin (0, 0, 0) will become the first sketcher point.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
radius distance to the coordinate system origin
|
||||||
|
angle1 angle in a plane, defined by the \a axes
|
||||||
|
angle2 angle from the plane, defined by the \a axes
|
||||||
|
axes can be: "OXY", "OYZ" or "OXZ"
|
||||||
|
|
||||||
|
Example of usage:
|
||||||
|
sk = geompy.Sketcher3D()
|
||||||
|
sk.addPointRadiusAnglesAbsolute(100, 50, 0, "OXY")
|
||||||
|
a3D_Sketcher_1 = sk.wire()
|
||||||
|
"""
|
||||||
|
self.myCommand = self.myCommand + ":%s"%axes+"SA"+" %s %s %s" % (printVar(angle1), printVar(angle2), printVar(radius))
|
||||||
|
pass
|
||||||
|
|
||||||
|
## Add one straight segment, defined by an angle, a height and a radius.
|
||||||
|
# If the first point of sketcher is not yet defined, the
|
||||||
|
# origin (0, 0, 0) will become the first sketcher point.
|
||||||
|
# The radius height and angle coordinates are defined
|
||||||
|
# in a local coordinate system which origin is the last point of the sketch
|
||||||
|
#
|
||||||
|
# @param axes can be: "OXY", "OYZ" or "OXZ"
|
||||||
|
# @param angle angle in a plane, defined by the \a axes
|
||||||
|
# @param height height from the plane, defined by the \a axes
|
||||||
|
# @param radius distance to the coordinate system origin
|
||||||
|
def addPointRadiusAngleHRelative (self, length, angle, height, axes="OXY"):
|
||||||
|
"""
|
||||||
|
Add one straight segment, defined by two angles and length.
|
||||||
|
If the first point of sketcher is not yet defined, the
|
||||||
|
origin (0, 0, 0) will become the first sketcher point.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
radius distance to the coordinate system origin
|
||||||
|
angle angle in a plane, defined by the \a axes
|
||||||
|
height height from the plane, defined by the \a axes
|
||||||
|
axes can be: "OXY", "OYZ" or "OXZ"
|
||||||
|
|
||||||
|
Example of usage:
|
||||||
|
sk = geompy.Sketcher3D()
|
||||||
|
sk.addPointRadiusAngleHRelative(100, 50, 40, "OXY")
|
||||||
|
a3D_Sketcher_1 = sk.wire()
|
||||||
|
"""
|
||||||
|
self.myCommand = self.myCommand + ":%s"%axes+"CR"+" %s %s %s" % (printVar(angle), printVar(height), printVar(length))
|
||||||
|
pass
|
||||||
|
|
||||||
|
## Add one straight segment, defined by an angle, a height and a radius.
|
||||||
|
# If the first point of sketcher is not yet defined, the
|
||||||
|
# origin (0, 0, 0) will become the first sketcher point.
|
||||||
|
# The radius height and angle coordinates are defined
|
||||||
|
# in a coordinate system which origin is the global coordinate system origin
|
||||||
|
#
|
||||||
|
# @param radius distance to the coordinate system origin
|
||||||
|
# @param angle angle in a plane, defined by the \a axes
|
||||||
|
# @param height height from the plane, defined by the \a axes
|
||||||
|
# @param axes can be: "OXY", "OYZ" or "OXZ"
|
||||||
|
def addPointRadiusAngleHAbsolute (self, radius, angle, height, axes="OXY"):
|
||||||
"""
|
"""
|
||||||
Add one straight segment, defined by two angles and length.
|
Add one straight segment, defined by two angles and length.
|
||||||
If the first point of sketcher is not yet defined, the
|
If the first point of sketcher is not yet defined, the
|
||||||
@ -134,15 +227,15 @@ class Sketcher3D:
|
|||||||
Parameters:
|
Parameters:
|
||||||
axes can be: "OXY", "OYZ" or "OXZ"
|
axes can be: "OXY", "OYZ" or "OXZ"
|
||||||
angle1 angle in a plane, defined by the \a axes
|
angle1 angle in a plane, defined by the \a axes
|
||||||
angle2 angle from the plane, defined by the \a axes
|
height height from the plane, defined by the \a axes
|
||||||
length length of the segment
|
radius distance to the coordinate system origin
|
||||||
|
|
||||||
Example of usage:
|
Example of usage:
|
||||||
sk = geompy.Sketcher3D()
|
sk = geompy.Sketcher3D()
|
||||||
sk.addPointAnglesLength("OXY", 50, 0, 100)
|
sk.addPointRadiusAngleHAbsolute( 100, 50, 40, "OXY")
|
||||||
a3D_Sketcher_1 = sk.wire()
|
a3D_Sketcher_1 = sk.wire()
|
||||||
"""
|
"""
|
||||||
self.myCommand = self.myCommand + ":%s %s %s %s" % (axes, printVar(angle1), printVar(angle2), printVar(length))
|
self.myCommand = self.myCommand + ":%s"%axes+"CA"+" %s %s %s" % (printVar(angle), printVar(height), printVar(radius))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
## Set to close the wire
|
## Set to close the wire
|
||||||
|
@ -18,12 +18,11 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
// File : GenerationGUI.cxx
|
// File : GenerationGUI.cxx
|
||||||
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
||||||
//
|
|
||||||
#include "GenerationGUI.h"
|
#include "GenerationGUI.h"
|
||||||
|
|
||||||
#include <GeometryGUI.h>
|
#include <GeometryGUI.h>
|
||||||
@ -36,6 +35,7 @@
|
|||||||
#include "GenerationGUI_RevolDlg.h" // Method REVOL
|
#include "GenerationGUI_RevolDlg.h" // Method REVOL
|
||||||
#include "GenerationGUI_FillingDlg.h" // Method FILLING
|
#include "GenerationGUI_FillingDlg.h" // Method FILLING
|
||||||
#include "GenerationGUI_PipeDlg.h" // Method PIPE
|
#include "GenerationGUI_PipeDlg.h" // Method PIPE
|
||||||
|
#include "GenerationGUI_PipePathDlg.h" // Method RESTORE PATH
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : GenerationGUI()
|
// function : GenerationGUI()
|
||||||
@ -73,6 +73,7 @@ bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
|||||||
case GEOMOp::OpRevolution: aDlg = new GenerationGUI_RevolDlg ( getGeometryGUI(), parent ); break;
|
case GEOMOp::OpRevolution: aDlg = new GenerationGUI_RevolDlg ( getGeometryGUI(), parent ); break;
|
||||||
case GEOMOp::OpFilling: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent ); break;
|
case GEOMOp::OpFilling: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent ); break;
|
||||||
case GEOMOp::OpPipe: aDlg = new GenerationGUI_PipeDlg ( getGeometryGUI(), parent ); break;
|
case GEOMOp::OpPipe: aDlg = new GenerationGUI_PipeDlg ( getGeometryGUI(), parent ); break;
|
||||||
|
case GEOMOp::OpPipePath: aDlg = new GenerationGUI_PipePathDlg( getGeometryGUI(), parent ); break;
|
||||||
|
|
||||||
default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break;
|
default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break;
|
||||||
}
|
}
|
||||||
|
392
src/GenerationGUI/GenerationGUI_PipePathDlg.cxx
Normal file
@ -0,0 +1,392 @@
|
|||||||
|
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
// File : GenerationGUI_PipePathDlg.cxx
|
||||||
|
|
||||||
|
#include "GenerationGUI_PipePathDlg.h"
|
||||||
|
|
||||||
|
#include <DlgRef.h>
|
||||||
|
#include <GeometryGUI.h>
|
||||||
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
|
#include <SUIT_Session.h>
|
||||||
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
#include <SalomeApp_Application.h>
|
||||||
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
#include <TColStd_IndexedMapOfInteger.hxx>
|
||||||
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
#include <TColStd_IndexedMapOfInteger.hxx>
|
||||||
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
|
|
||||||
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : GenerationGUI_PipePathDlg()
|
||||||
|
// purpose : Constructs a GenerationGUI_PipePathDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
GenerationGUI_PipePathDlg::GenerationGUI_PipePathDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
|
bool modal, Qt::WindowFlags fl)
|
||||||
|
: GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl)
|
||||||
|
{
|
||||||
|
QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PIPE_PATH")));
|
||||||
|
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setWindowTitle(tr("GEOM_PIPE_PATH_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
mainFrame()->GroupConstructors->setTitle(tr("GEOM_PIPE_PATH"));
|
||||||
|
mainFrame()->RadioButton1->setIcon(image0);
|
||||||
|
mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
mainFrame()->RadioButton2->close();
|
||||||
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
|
GroupPoints = new DlgRef_3Sel1Check(centralWidget());
|
||||||
|
|
||||||
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
|
GroupPoints->TextLabel1->setText(tr("GEOM_PIPE_LIKE_SHAPE"));
|
||||||
|
GroupPoints->TextLabel2->setText(tr("GEOM_PIPE_BASE1_OBJECT"));
|
||||||
|
GroupPoints->TextLabel3->setText(tr("GEOM_PIPE_BASE2_OBJECT"));
|
||||||
|
GroupPoints->PushButton1->setIcon(image1);
|
||||||
|
GroupPoints->PushButton2->setIcon(image1);
|
||||||
|
GroupPoints->PushButton3->setIcon(image1);
|
||||||
|
GroupPoints->CheckButton1->setText(tr("GEOM_SELECT_UNPUBLISHED_EDGES"));
|
||||||
|
|
||||||
|
QVBoxLayout* layout = new QVBoxLayout (centralWidget());
|
||||||
|
layout->setMargin(0);
|
||||||
|
layout->setSpacing(6);
|
||||||
|
layout->addWidget(GroupPoints);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
setHelpFileName("create_pipe_path_page.html");
|
||||||
|
|
||||||
|
// Initialisation
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~GenerationGUI_PipePathDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
GenerationGUI_PipePathDlg::~GenerationGUI_PipePathDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_PipePathDlg::Init()
|
||||||
|
{
|
||||||
|
// init variables
|
||||||
|
GroupPoints->LineEdit1->setReadOnly(true);
|
||||||
|
GroupPoints->LineEdit2->setReadOnly(true);
|
||||||
|
GroupPoints->LineEdit3->setReadOnly(true);
|
||||||
|
|
||||||
|
GroupPoints->LineEdit1->setText("");
|
||||||
|
GroupPoints->LineEdit2->setText("");
|
||||||
|
GroupPoints->LineEdit3->setText("");
|
||||||
|
|
||||||
|
myShape.nullify();
|
||||||
|
|
||||||
|
GroupPoints->CheckButton1->setEnabled(false);
|
||||||
|
|
||||||
|
showOnlyPreviewControl();
|
||||||
|
|
||||||
|
// signals and slots connections
|
||||||
|
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(SelectionTypeButtonClicked()));
|
||||||
|
|
||||||
|
initName(tr("GEOM_PIPE_PATH"));
|
||||||
|
|
||||||
|
updateGeometry();
|
||||||
|
resize(100,100);
|
||||||
|
|
||||||
|
GroupPoints->PushButton1->click();
|
||||||
|
SelectionIntoArgument();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionBittonClicked()
|
||||||
|
// purpose : Selection type Radio button management
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_PipePathDlg::SelectionTypeButtonClicked()
|
||||||
|
{
|
||||||
|
globalSelection();
|
||||||
|
if (GroupPoints->CheckButton1->isChecked()) {
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TColStd_MapOfInteger aMap;
|
||||||
|
aMap.Add(GEOM_FACE);
|
||||||
|
aMap.Add(GEOM_WIRE);
|
||||||
|
aMap.Add(GEOM_EDGE);
|
||||||
|
globalSelection(aMap);
|
||||||
|
}
|
||||||
|
processPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_PipePathDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
setIsApplyAndClose(true);
|
||||||
|
if (ClickOnApply())
|
||||||
|
ClickOnCancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
bool GenerationGUI_PipePathDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
if (!onAccept())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
initName();
|
||||||
|
// activate selection and connect selection manager
|
||||||
|
GroupPoints->PushButton1->click();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection is changed or on dialog initialization or activation
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_PipePathDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
erasePreview();
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
|
||||||
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
||||||
|
QList<TopAbs_ShapeEnum> types;
|
||||||
|
types << TopAbs_SOLID << TopAbs_SHELL << TopAbs_FACE;
|
||||||
|
myShape = getSelected(types);
|
||||||
|
if (myShape) {
|
||||||
|
QString aName = GEOMBase::GetName(myShape.get());
|
||||||
|
myEditCurrentArgument->setText(aName);
|
||||||
|
if (myBase1Objects.isEmpty())
|
||||||
|
GroupPoints->PushButton2->click();
|
||||||
|
else if (myBase2Objects.isEmpty())
|
||||||
|
GroupPoints->PushButton3->click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
|
||||||
|
myBase1Objects.clear();
|
||||||
|
QList<GEOM::GeomObjPtr> objects = getSelected(TopAbs_SHAPE, -1);
|
||||||
|
for (int i = 0; i < objects.count(); i++) {
|
||||||
|
GEOM::shape_type stype = objects[i]->GetMaxShapeType();
|
||||||
|
if (GEOM::FACE <= stype && stype <= GEOM::EDGE)
|
||||||
|
myBase1Objects << objects[i];
|
||||||
|
}
|
||||||
|
int nbObj = myBase1Objects.count();
|
||||||
|
if (nbObj) {
|
||||||
|
QString aName =
|
||||||
|
nbObj > 1 ? QString("%1_objects").arg(nbObj) : GEOMBase::GetName(myBase1Objects[0].get());
|
||||||
|
myEditCurrentArgument->setText(aName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (myEditCurrentArgument == GroupPoints->LineEdit3) {
|
||||||
|
myBase2Objects.clear();
|
||||||
|
QList<GEOM::GeomObjPtr> objects = getSelected(TopAbs_SHAPE, -1);
|
||||||
|
for (int i = 0; i < objects.count(); i++) {
|
||||||
|
GEOM::shape_type stype = objects[i]->GetMaxShapeType();
|
||||||
|
if (GEOM::FACE <= stype && stype <= GEOM::EDGE)
|
||||||
|
myBase2Objects << objects[i];
|
||||||
|
}
|
||||||
|
int nbObj = myBase2Objects.count();
|
||||||
|
if (nbObj) {
|
||||||
|
QString aName =
|
||||||
|
nbObj > 1 ? QString("%1_objects").arg(nbObj) : GEOMBase::GetName(myBase2Objects[0].get());
|
||||||
|
myEditCurrentArgument->setText(aName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
processPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_PipePathDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||||
|
|
||||||
|
globalSelection(GEOM_ALLSHAPES);
|
||||||
|
|
||||||
|
GroupPoints->PushButton1->setDown(false);
|
||||||
|
GroupPoints->PushButton2->setDown(false);
|
||||||
|
GroupPoints->PushButton3->setDown(false);
|
||||||
|
GroupPoints->LineEdit1->setEnabled(false);
|
||||||
|
GroupPoints->LineEdit2->setEnabled(false);
|
||||||
|
GroupPoints->LineEdit3->setEnabled(false);
|
||||||
|
|
||||||
|
if (send == GroupPoints->PushButton1) {
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
GroupPoints->CheckButton1->setEnabled(false);
|
||||||
|
}
|
||||||
|
else if (send == GroupPoints->PushButton2) {
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
|
||||||
|
if (GroupPoints->CheckButton1->isChecked()) {
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TColStd_MapOfInteger aMap;
|
||||||
|
aMap.Add(GEOM_FACE);
|
||||||
|
aMap.Add(GEOM_WIRE);
|
||||||
|
aMap.Add(GEOM_EDGE);
|
||||||
|
globalSelection(aMap);
|
||||||
|
}
|
||||||
|
GroupPoints->CheckButton1->setEnabled(true);
|
||||||
|
}
|
||||||
|
else if (send == GroupPoints->PushButton3) {
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit3;
|
||||||
|
|
||||||
|
if (GroupPoints->CheckButton1->isChecked()) {
|
||||||
|
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TColStd_MapOfInteger aMap;
|
||||||
|
aMap.Add(GEOM_FACE);
|
||||||
|
aMap.Add(GEOM_WIRE);
|
||||||
|
aMap.Add(GEOM_EDGE);
|
||||||
|
globalSelection(aMap);
|
||||||
|
}
|
||||||
|
GroupPoints->CheckButton1->setEnabled(true);
|
||||||
|
}
|
||||||
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
// enable line edit
|
||||||
|
myEditCurrentArgument->setEnabled(true);
|
||||||
|
myEditCurrentArgument->setFocus();
|
||||||
|
// after setFocus(), because it will be setDown(false) when loses focus
|
||||||
|
send->setDown(true);
|
||||||
|
|
||||||
|
// seems we need it only to avoid preview disappearing, caused by selection mode change
|
||||||
|
processPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_PipePathDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
|
||||||
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
GroupPoints->PushButton1->click();
|
||||||
|
SelectionIntoArgument();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose : when mouse enter onto the QWidget
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_PipePathDlg::enterEvent (QEvent*)
|
||||||
|
{
|
||||||
|
if (!mainFrame()->GroupConstructors->isEnabled())
|
||||||
|
ActivateThisDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : createOperation
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
GEOM::GEOM_IOperations_ptr GenerationGUI_PipePathDlg::createOperation()
|
||||||
|
{
|
||||||
|
return getGeomEngine()->GetI3DPrimOperations(getStudyId());
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : isValid
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
bool GenerationGUI_PipePathDlg::isValid (QString&)
|
||||||
|
{
|
||||||
|
bool ok = myShape && !myBase1Objects.isEmpty() && !myBase2Objects.isEmpty();
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : execute
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
bool GenerationGUI_PipePathDlg::execute (ObjectList& objects)
|
||||||
|
{
|
||||||
|
GEOM::ListOfGO_var aBase1 = new GEOM::ListOfGO();
|
||||||
|
GEOM::ListOfGO_var aBase2 = new GEOM::ListOfGO();
|
||||||
|
|
||||||
|
aBase1->length(myBase1Objects.count());
|
||||||
|
aBase2->length(myBase2Objects.count());
|
||||||
|
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < myBase1Objects.count(); i++)
|
||||||
|
aBase1[i] = myBase1Objects[i].copy();
|
||||||
|
for (i = 0; i < myBase2Objects.count(); i++)
|
||||||
|
aBase2[i] = myBase2Objects[i].copy();
|
||||||
|
|
||||||
|
GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
|
||||||
|
GEOM::GEOM_Object_var anObj = anOper->RestorePathEdges(myShape.get(), aBase1.in(), aBase2.in());
|
||||||
|
|
||||||
|
if (!anObj->_is_nil())
|
||||||
|
objects.push_back(anObj._retn());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_PipePathDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < myBase1Objects.count(); i++)
|
||||||
|
GEOMBase::PublishSubObject(myBase1Objects[i].get());
|
||||||
|
for (i = 0; i < myBase2Objects.count(); i++)
|
||||||
|
GEOMBase::PublishSubObject(myBase2Objects[i].get());
|
||||||
|
}
|
72
src/GenerationGUI/GenerationGUI_PipePathDlg.h
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
// File : GenerationGUI_PipePathDlg.h
|
||||||
|
|
||||||
|
#ifndef GENERATIONGUI_PIPEPATHDLG_H
|
||||||
|
#define GENERATIONGUI_PIPEPATHDLG_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "GEOM_GenericObjPtr.h"
|
||||||
|
|
||||||
|
class DlgRef_3Sel1Check;
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : GenerationGUI_PipePathDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class GenerationGUI_PipePathDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
GenerationGUI_PipePathDlg (GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0);
|
||||||
|
~GenerationGUI_PipePathDlg();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// redefined from GEOMBase_Helper
|
||||||
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
|
virtual bool isValid (QString&);
|
||||||
|
virtual bool execute (ObjectList&);
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
void enterEvent (QEvent*);
|
||||||
|
|
||||||
|
private:
|
||||||
|
GEOM::GeomObjPtr myShape; /* Pipe-like shape */
|
||||||
|
QList<GEOM::GeomObjPtr> myBase1Objects; /* Base 1 edges / wire / face */
|
||||||
|
QList<GEOM::GeomObjPtr> myBase2Objects; /* Base 2 edges / wire / face */
|
||||||
|
|
||||||
|
DlgRef_3Sel1Check* GroupPoints;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
bool ClickOnApply();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void SelectionTypeButtonClicked();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GENERATIONGUI_PIPEPATHDLG_H
|
@ -15,13 +15,12 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
|
||||||
|
|
||||||
# GEOM GENERATIONGUI :
|
# GEOM GENERATIONGUI :
|
||||||
# File : Makefile.am
|
# File : Makefile.am
|
||||||
# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
|
# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
|
||||||
# Package : GenerationGUI
|
# Package : GenerationGUI
|
||||||
#
|
|
||||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||||
|
|
||||||
# Libraries targets
|
# Libraries targets
|
||||||
@ -33,7 +32,8 @@ salomeinclude_HEADERS = \
|
|||||||
GenerationGUI_PrismDlg.h \
|
GenerationGUI_PrismDlg.h \
|
||||||
GenerationGUI_RevolDlg.h \
|
GenerationGUI_RevolDlg.h \
|
||||||
GenerationGUI_FillingDlg.h \
|
GenerationGUI_FillingDlg.h \
|
||||||
GenerationGUI_PipeDlg.h
|
GenerationGUI_PipeDlg.h \
|
||||||
|
GenerationGUI_PipePathDlg.h
|
||||||
|
|
||||||
dist_libGenerationGUI_la_SOURCES = \
|
dist_libGenerationGUI_la_SOURCES = \
|
||||||
GenerationGUI.h \
|
GenerationGUI.h \
|
||||||
@ -41,18 +41,21 @@ dist_libGenerationGUI_la_SOURCES = \
|
|||||||
GenerationGUI_RevolDlg.h \
|
GenerationGUI_RevolDlg.h \
|
||||||
GenerationGUI_FillingDlg.h \
|
GenerationGUI_FillingDlg.h \
|
||||||
GenerationGUI_PipeDlg.h \
|
GenerationGUI_PipeDlg.h \
|
||||||
|
GenerationGUI_PipePathDlg.h \
|
||||||
\
|
\
|
||||||
GenerationGUI.cxx \
|
GenerationGUI.cxx \
|
||||||
GenerationGUI_PrismDlg.cxx \
|
GenerationGUI_PrismDlg.cxx \
|
||||||
GenerationGUI_RevolDlg.cxx \
|
GenerationGUI_RevolDlg.cxx \
|
||||||
GenerationGUI_FillingDlg.cxx \
|
GenerationGUI_FillingDlg.cxx \
|
||||||
GenerationGUI_PipeDlg.cxx
|
GenerationGUI_PipeDlg.cxx \
|
||||||
|
GenerationGUI_PipePathDlg.cxx
|
||||||
|
|
||||||
MOC_FILES = \
|
MOC_FILES = \
|
||||||
GenerationGUI_PrismDlg_moc.cxx \
|
GenerationGUI_PrismDlg_moc.cxx \
|
||||||
GenerationGUI_RevolDlg_moc.cxx \
|
GenerationGUI_RevolDlg_moc.cxx \
|
||||||
GenerationGUI_FillingDlg_moc.cxx \
|
GenerationGUI_FillingDlg_moc.cxx \
|
||||||
GenerationGUI_PipeDlg_moc.cxx
|
GenerationGUI_PipeDlg_moc.cxx \
|
||||||
|
GenerationGUI_PipePathDlg_moc.cxx
|
||||||
|
|
||||||
nodist_libGenerationGUI_la_SOURCES = \
|
nodist_libGenerationGUI_la_SOURCES = \
|
||||||
$(MOC_FILES)
|
$(MOC_FILES)
|
||||||
|
@ -108,10 +108,10 @@ extern "C"
|
|||||||
if (!aModel.IsNull()) {
|
if (!aModel.IsNull()) {
|
||||||
aValue = aModel->GlobalSection().UnitName();
|
aValue = aModel->GlobalSection().UnitName();
|
||||||
|
|
||||||
if (!aValue.IsNull()) {
|
//if (!aValue.IsNull()) {
|
||||||
Handle(TCollection_HAsciiString) aPrefix = new TCollection_HAsciiString ("UNIT_");
|
// Handle(TCollection_HAsciiString) aPrefix = new TCollection_HAsciiString ("UNIT_");
|
||||||
aValue->Prepend(aPrefix);
|
// aValue->Prepend(aPrefix);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -42,14 +42,6 @@
|
|||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static
|
|
||||||
Standard_Boolean IsValid(const TopoDS_Edge& aE,
|
|
||||||
const TopoDS_Vertex& aV,
|
|
||||||
const Standard_Real aTV1,
|
|
||||||
const Standard_Real aTV2);
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function: PreparePaveBlocks
|
// function: PreparePaveBlocks
|
||||||
// purpose:
|
// purpose:
|
||||||
@ -65,14 +57,13 @@ static
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void NMTTools_CheckerSI::PreparePaveBlocks(const Standard_Integer nE)
|
void NMTTools_CheckerSI::PreparePaveBlocks(const Standard_Integer nE)
|
||||||
{
|
{
|
||||||
myIsDone=Standard_False;
|
//Standard_Boolean bIsValid;
|
||||||
//
|
|
||||||
// char buf[32]={"SR"};
|
|
||||||
Standard_Boolean bIsValid;
|
|
||||||
Standard_Integer nV1, nV2, iErr;
|
Standard_Integer nV1, nV2, iErr;
|
||||||
Standard_Real aT1, aT2;
|
Standard_Real aT1, aT2;
|
||||||
TopoDS_Edge aE;
|
TopoDS_Edge aE;
|
||||||
TopoDS_Vertex aV1, aV2;
|
TopoDS_Vertex aV1, aV2;
|
||||||
|
//
|
||||||
|
myIsDone=Standard_False;
|
||||||
//
|
//
|
||||||
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
|
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
|
||||||
// Edge
|
// Edge
|
||||||
@ -99,21 +90,23 @@ static
|
|||||||
aV2=TopoDS::Vertex(myDS->Shape(nV2));
|
aV2=TopoDS::Vertex(myDS->Shape(nV2));
|
||||||
aT2=aPave2.Param();
|
aT2=aPave2.Param();
|
||||||
//
|
//
|
||||||
|
//modified by NIZNHY-PKV Thu Nov 01 13:46:00 2012f
|
||||||
|
//w/a: http://salome.mantis.opencascade.com/view.php?id=21835
|
||||||
|
/*
|
||||||
bIsValid=Standard_True;
|
bIsValid=Standard_True;
|
||||||
if (nV1==nV2) {
|
if (nV1==nV2) {
|
||||||
bIsValid=IsValid(aE, aV1, aT1, aT2);
|
bIsValid=IsValid(aE, aV1, aT1, aT2);
|
||||||
if (!bIsValid) {
|
if (!bIsValid) {
|
||||||
//printf(" pb SR: nV nE: %d nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
|
|
||||||
myStopStatus=1;
|
myStopStatus=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
//modified by NIZNHY-PKV Thu Nov 01 13:46:09 2012t
|
||||||
//
|
//
|
||||||
IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
|
IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
|
||||||
iErr=aSR.ErrorStatus();
|
iErr=aSR.ErrorStatus();
|
||||||
if (!aSR.IsDone()) {
|
if (!aSR.IsDone()) {
|
||||||
//printf(" pb SR: Done nE: %d nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
|
|
||||||
aSR.SetShrunkRange(aRange);
|
aSR.SetShrunkRange(aRange);
|
||||||
//throw BOPTColStd_Failure(buf) ;
|
|
||||||
}
|
}
|
||||||
else if (iErr!=6) {
|
else if (iErr!=6) {
|
||||||
CorrectShrunkRanges (0, aPave1, aSR);
|
CorrectShrunkRanges (0, aPave1, aSR);
|
||||||
@ -124,7 +117,9 @@ static
|
|||||||
} //for (; aPBIt.More(); aPBIt.Next())
|
} //for (; aPBIt.More(); aPBIt.Next())
|
||||||
myIsDone=Standard_True;
|
myIsDone=Standard_True;
|
||||||
}
|
}
|
||||||
|
//modified by NIZNHY-PKV Thu Nov 01 13:46:55 2012f
|
||||||
|
//w/a: http://salome.mantis.opencascade.com/view.php?id=21835
|
||||||
|
/*
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsValid
|
//function : IsValid
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -157,3 +152,5 @@ Standard_Boolean IsValid(const TopoDS_Edge& aE,
|
|||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
//modified by NIZNHY-PKV Thu Nov 01 13:47:07 2012t
|
||||||
|
@ -18,13 +18,11 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
// File: STEPExport.cxx
|
// File: STEPExport.cxx
|
||||||
// Created: Wed May 19 14:53:52 2004
|
// Created: Wed May 19 14:53:52 2004
|
||||||
// Author: Pavel TELKOV
|
// Author: Pavel TELKOV
|
||||||
// <ptv@mutex.nnov.opencascade.com>
|
|
||||||
//
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
#include <Basics_Utils.hxx>
|
#include <Basics_Utils.hxx>
|
||||||
@ -63,36 +61,37 @@
|
|||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
STEPEXPORT_EXPORT
|
STEPEXPORT_EXPORT
|
||||||
int Export(const TopoDS_Shape& theShape, const TCollection_AsciiString& theFileName)
|
int Export(const TopoDS_Shape& theShape, const TCollection_AsciiString& theFileName)
|
||||||
{
|
{
|
||||||
MESSAGE("Export STEP into file " << theFileName.ToCString());
|
MESSAGE("Export STEP into file " << theFileName.ToCString());
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Set "C" numeric locale to save numbers correctly
|
// Set "C" numeric locale to save numbers correctly
|
||||||
Kernel_Utils::Localizer loc;
|
Kernel_Utils::Localizer loc;
|
||||||
|
|
||||||
IFSelect_ReturnStatus status ;
|
IFSelect_ReturnStatus status ;
|
||||||
//VRV: OCC 4.0 migration
|
//VRV: OCC 4.0 migration
|
||||||
STEPControl_Writer aWriter;
|
STEPControl_Writer aWriter;
|
||||||
//VSR: 16/09/09: Convert to METERS
|
//VSR: 16/09/09: Convert to METERS
|
||||||
Interface_Static::SetCVal("xstep.cascade.unit","M");
|
Interface_Static::SetCVal("xstep.cascade.unit","M");
|
||||||
Interface_Static::SetIVal("write.step.nonmanifold", 1);
|
Interface_Static::SetCVal("write.step.unit", "M");
|
||||||
//JFA: PAL6162 status = aWriter.Transfer( theShape, STEPControl_ManifoldSolidBrep );
|
Interface_Static::SetIVal("write.step.nonmanifold", 1);
|
||||||
status = aWriter.Transfer( theShape, STEPControl_AsIs );
|
//JFA: PAL6162 status = aWriter.Transfer( theShape, STEPControl_ManifoldSolidBrep );
|
||||||
//VRV: OCC 4.0 migration
|
status = aWriter.Transfer( theShape, STEPControl_AsIs );
|
||||||
if ( status == IFSelect_RetDone )
|
//VRV: OCC 4.0 migration
|
||||||
|
if ( status == IFSelect_RetDone )
|
||||||
status = aWriter.Write( theFileName.ToCString() );
|
status = aWriter.Write( theFileName.ToCString() );
|
||||||
|
|
||||||
// Return previous locale
|
// Return previous locale
|
||||||
if ( status == IFSelect_RetDone )
|
if ( status == IFSelect_RetDone )
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
catch(Standard_Failure)
|
catch (Standard_Failure)
|
||||||
{
|
{
|
||||||
//THROW_SALOME_CORBA_EXCEPTION("Exception catched in STEPExport", SALOME::BAD_PARAM);
|
//THROW_SALOME_CORBA_EXCEPTION("Exception catched in STEPExport", SALOME::BAD_PARAM);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,16 +122,18 @@ extern "C"
|
|||||||
TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
|
TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
|
||||||
aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
|
aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
|
||||||
if (anUnitLengthNames.Length() > 0) {
|
if (anUnitLengthNames.Length() > 0) {
|
||||||
|
aValue = new TCollection_HAsciiString( anUnitLengthNames.First() );
|
||||||
|
/*
|
||||||
TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
|
TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
|
||||||
if (aLenUnits == "millimetre")
|
if (aLenUnits == "millimetre")
|
||||||
aValue = new TCollection_HAsciiString ("UNIT_MM");
|
aValue = new TCollection_HAsciiString ("MM");
|
||||||
else if (aLenUnits == "centimetre")
|
else if (aLenUnits == "centimetre")
|
||||||
aValue = new TCollection_HAsciiString ("UNIT_CM");
|
aValue = new TCollection_HAsciiString ("CM");
|
||||||
else if (aLenUnits == "metre")
|
else if (aLenUnits == "metre")
|
||||||
aValue = new TCollection_HAsciiString ("UNIT_M");
|
aValue = new TCollection_HAsciiString ("M");
|
||||||
else if (aLenUnits == "INCH")
|
else if (aLenUnits == "INCH")
|
||||||
aValue = new TCollection_HAsciiString ("UNIT_INCH");
|
aValue = new TCollection_HAsciiString ("INCH");
|
||||||
// TODO
|
// TODO (for other units than mm, cm, m or inch)
|
||||||
//else if (aLenUnits == "")
|
//else if (aLenUnits == "")
|
||||||
// aValue = new TCollection_HAsciiString ("");
|
// aValue = new TCollection_HAsciiString ("");
|
||||||
|
|
||||||
@ -141,6 +143,7 @@ extern "C"
|
|||||||
// std::cout << ", " << anUnitLengthNames.Value(ii);
|
// std::cout << ", " << anUnitLengthNames.Value(ii);
|
||||||
//std::cout << std::endl;
|
//std::cout << std::endl;
|
||||||
// tmp end
|
// tmp end
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -197,7 +200,7 @@ extern "C"
|
|||||||
Interface_Static::SetCVal("xstep.cascade.unit", "MM");
|
Interface_Static::SetCVal("xstep.cascade.unit", "MM");
|
||||||
else if (aLenUnits == "centimetre")
|
else if (aLenUnits == "centimetre")
|
||||||
Interface_Static::SetCVal("xstep.cascade.unit", "CM");
|
Interface_Static::SetCVal("xstep.cascade.unit", "CM");
|
||||||
else if (aLenUnits == "metre")
|
else if (aLenUnits == "metre" || aLenUnits.IsEmpty())
|
||||||
Interface_Static::SetCVal("xstep.cascade.unit", "M");
|
Interface_Static::SetCVal("xstep.cascade.unit", "M");
|
||||||
else if (aLenUnits == "INCH")
|
else if (aLenUnits == "INCH")
|
||||||
Interface_Static::SetCVal("xstep.cascade.unit", "INCH");
|
Interface_Static::SetCVal("xstep.cascade.unit", "INCH");
|
||||||
@ -205,9 +208,9 @@ extern "C"
|
|||||||
theError = "The file contains not supported units.";
|
theError = "The file contains not supported units.";
|
||||||
return aResShape;
|
return aResShape;
|
||||||
}
|
}
|
||||||
// TODO
|
// TODO (for other units than mm, cm, m or inch)
|
||||||
//else if (aLenUnits == "")
|
//else if (aLenUnits == "")
|
||||||
// Interface_Static::SetCVal("xstep.cascade.unit", "");
|
// Interface_Static::SetCVal("xstep.cascade.unit", "???");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -26,10 +26,17 @@
|
|||||||
|
|
||||||
#include <ShHealOper_ChangeOrientation.hxx>
|
#include <ShHealOper_ChangeOrientation.hxx>
|
||||||
|
|
||||||
#include <BRep_Builder.hxx>
|
|
||||||
#include <BRepBuilderAPI_Copy.hxx>
|
#include <BRepBuilderAPI_Copy.hxx>
|
||||||
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
|
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <Geom_Curve.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
#include <Geom_TrimmedCurve.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ShHealOper_ChangeOrientation()
|
//function : ShHealOper_ChangeOrientation()
|
||||||
@ -59,7 +66,8 @@ void ShHealOper_ChangeOrientation::Init(const TopoDS_Shape& theShape)
|
|||||||
Standard_Boolean ShHealOper_ChangeOrientation::Perform()
|
Standard_Boolean ShHealOper_ChangeOrientation::Perform()
|
||||||
{
|
{
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
if (myInitShape.ShapeType() == TopAbs_SHELL) {
|
if (myInitShape.ShapeType() == TopAbs_SHELL)
|
||||||
|
{
|
||||||
myResultShape = myInitShape.EmptyCopied();
|
myResultShape = myInitShape.EmptyCopied();
|
||||||
TopoDS_Iterator itr (myInitShape);
|
TopoDS_Iterator itr (myInitShape);
|
||||||
while (itr.More()) {
|
while (itr.More()) {
|
||||||
@ -67,7 +75,8 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform()
|
|||||||
itr.Next();
|
itr.Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (myInitShape.ShapeType() == TopAbs_FACE) {
|
else if (myInitShape.ShapeType() == TopAbs_FACE)
|
||||||
|
{
|
||||||
myResultShape = myInitShape.EmptyCopied();
|
myResultShape = myInitShape.EmptyCopied();
|
||||||
TopoDS_Iterator itr (myInitShape);
|
TopoDS_Iterator itr (myInitShape);
|
||||||
while (itr.More()) {
|
while (itr.More()) {
|
||||||
@ -76,16 +85,43 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform()
|
|||||||
}
|
}
|
||||||
myResultShape.Reverse();
|
myResultShape.Reverse();
|
||||||
}
|
}
|
||||||
else if ( myInitShape.ShapeType() == TopAbs_WIRE || myInitShape.ShapeType() == TopAbs_EDGE) {
|
else if ( myInitShape.ShapeType() == TopAbs_WIRE || myInitShape.ShapeType() == TopAbs_EDGE)
|
||||||
myResultShape = myInitShape.EmptyCopied();
|
{
|
||||||
TopoDS_Iterator itr (myInitShape);
|
TopTools_ListOfShape reversedEdges;
|
||||||
while (itr.More()) {
|
for ( TopExp_Explorer edgeIt( myInitShape, TopAbs_EDGE ); edgeIt.More(); edgeIt.Next() )
|
||||||
B.Add(myResultShape,itr.Value());
|
{
|
||||||
itr.Next();
|
const TopoDS_Edge& edge = TopoDS::Edge( edgeIt.Current() );
|
||||||
|
|
||||||
|
double f,l;
|
||||||
|
Handle(Geom_Curve) curve = BRep_Tool::Curve( edge, f,l );
|
||||||
|
Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(curve);
|
||||||
|
if ( !tc.IsNull() ) curve = tc->BasisCurve();
|
||||||
|
|
||||||
|
f = curve->ReversedParameter( f );
|
||||||
|
l = curve->ReversedParameter( l );
|
||||||
|
curve = curve->Reversed();
|
||||||
|
reversedEdges.Prepend( BRepBuilderAPI_MakeEdge( curve, Min( f, l ), Max( f, l )));
|
||||||
}
|
}
|
||||||
myResultShape.Reverse();
|
if ( myInitShape.ShapeType() == TopAbs_EDGE )
|
||||||
|
{
|
||||||
|
myResultShape = reversedEdges.First();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BRepBuilderAPI_MakeWire wire;
|
||||||
|
wire.Add( reversedEdges );
|
||||||
|
myResultShape = wire;
|
||||||
|
}
|
||||||
|
// myResultShape = myInitShape.EmptyCopied();
|
||||||
|
// TopoDS_Iterator itr (myInitShape);
|
||||||
|
// while (itr.More()) {
|
||||||
|
// B.Add(myResultShape,itr.Value());
|
||||||
|
// itr.Next();
|
||||||
|
// }
|
||||||
|
// myResultShape.Reverse();
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
BRepBuilderAPI_Copy Copy (myInitShape);
|
BRepBuilderAPI_Copy Copy (myInitShape);
|
||||||
if (!Copy.IsDone()) return false;
|
if (!Copy.IsDone()) return false;
|
||||||
|
|
||||||
|