Merge from V6_main 28/02/2013

This commit is contained in:
vsr 2013-02-28 14:00:05 +00:00
parent 465e84c52e
commit 2488be88d9
79 changed files with 1363 additions and 1532 deletions

View File

@ -21,7 +21,7 @@
CURRENT_DIR=`pwd`
CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
cd ${CONF_DIR}
python $KERNEL_ROOT_DIR/salome_adm/cmake_files/am2cmake.py --geom
python $KERNEL_ROOT_DIR/salome_adm/cmake_files/deprecated/am2cmake.py --geom
status=$?
cd ${CURRENT_DIR}
exit $status

View File

@ -17,4 +17,4 @@
@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
@REM
%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --geom
%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\deprecated\am2cmake.py --geom

View File

@ -5,7 +5,7 @@ import salome
gg = salome.ImportComponentGUI("GEOM")
# Create a 3D sketcher (wire) on the given points coordinates
sketcher1 = geompy.Make3DSketcher([ 0,0,0, 50,50,50, 0,50,0, 50,0,50, 10,20,100, 0,0,0 ])
sketcher1 = geompy.Make3DSketcher([ 0,0,0, 50,50,50, 0,50,0, 50,0,25, 10,20,100, 0,0,0 ])
# add object in the study
id_sketcher1 = geompy.addToStudy(sketcher1, "Sketcher1")
@ -24,7 +24,7 @@ sk = geompy.Sketcher3D()
sk.addPointsAbsolute(1,2,3, 7,0,0, 10,-3.5,-11)
# add one segment, defined by two angles in "OXY" coordinate system and length
sk.addPointAnglesLength("OXY", 45, 0, 100)
sk.addPointRadiusAnglesRelative(45, 0, 100, "OXY")
# add three points with relative coordinates
# three segments will be added by this command

View File

@ -26,7 +26,8 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
pyexamplesdir = $(docdir)/examples/GEOM
BAD_TESTS =
BAD_TESTS = \
repairing_operations_ex09.py
GOOD_TESTS = \
3dsketcher.py \
@ -95,7 +96,6 @@ GOOD_TESTS = \
repairing_operations_ex06.py \
repairing_operations_ex07.py \
repairing_operations_ex08.py \
repairing_operations_ex09.py \
repairing_operations_ex10.py \
repairing_operations_ex11.py \
sketcher.py \
@ -135,7 +135,7 @@ pyexamples_SCRIPTS = $(BAD_TESTS) $(GOOD_TESTS)
EXTRA_DIST += $(pyexamples_SCRIPTS) testme.py
check-local:
installcheck-local:
@for f in $(GOOD_TESTS) ; do \
python $(top_srcdir)/doc/salome/examples/testme.py $(top_srcdir)/doc/salome/examples/$$f || exit 1; \
env GEOM_ROOT_DIR=$(prefix) python -B $(top_srcdir)/doc/salome/examples/testme.py $(top_srcdir)/doc/salome/examples/$$f || exit 1; \
done

View File

@ -53,8 +53,11 @@ pnt1 = geompy.MakeVertex(0, 0, 0)
pnt2 = geompy.MakeVertex(10, 0, 0)
pnt3 = geompy.MakeVertex(20, 10, 0)
arc = geompy.MakeArc(pnt1, pnt2, pnt3)
Angle = geompy.GetAngle(OX, arc)
if (math.fabs(Angle + 1.0) > 1e-6 or geompy.MeasuOp.IsDone()):
print "Error. Angle must not be computed on curvilinear edges"
try:
Angle = geompy.GetAngle(OX, arc)
pass
except:
# It is a correct case, because GetAngle() must not be computed on curvilinear edges.
pass
assert (not geompy.MeasuOp.IsDone() ), 'Angle must not be computed on curvilinear edges.'

View File

@ -4,7 +4,7 @@ import geompy
import salome
# create a box
box = geompy.MakeBoxDXDYDZ(200, 200, 200)
check_box = geompy.MakeBoxDXDYDZ(200, 200, 200)
# build all possible propagation groups
listChains = geompy.Propagate(check_box)

View File

@ -2,19 +2,25 @@
import geompy
import salome
import math
gg = salome.ImportComponentGUI("GEOM")
# create path
WirePath = geompy.MakeSketcher("Sketcher:F 0 0:TT 100 0:R 0:C 100 90:T 0 200", [0, 0, 0, 0, 0, 1, 1, 0, -0])
# get sub-shapes
edges = geompy.SubShapeAll(WirePath, geompy.ShapeType["EDGE"])
vertices = geompy.SubShapeAll(WirePath, geompy.ShapeType["VERTEX"])
#=======================================================
# Create shell sections
#=======================================================
ps = [Vertex_1,Vertex_2,Vertex_3,Vertex_4]
theLocations = [Vertex_1, Vertex_2, Vertex_3, Vertex_4]
ps = [vertices[0],vertices[1],vertices[2],vertices[3]]
theLocations = [vertices[0],vertices[1],vertices[2],vertices[3]]
VC = geompy.MakeCompound(theLocations)
geompy.addToStudy(VC,"VC")
vs = [Edge_1,Edge_1,Edge_3,Edge_3]
vs = [edges[0],edges[0],edges[2],edges[2]]
hs = [20,40,30,20]
shells = []
subbases = []
@ -49,30 +55,30 @@ faces = []
w = geompy.MakeSketcher("Sketcher:F 20 20:TT 0 20:TT 0 0:TT 20 0",
[c1[0], c1[1], c1[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,-1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f1 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F -20 0:TT 0 0:TT 0 20:TT -20 20",
[c1[0], c1[1], c1[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,-1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f2 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F 20 0:TT 0 0:TT 0 -20:TT 20 -20",
[c1[0], c1[1], c1[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,-1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f3 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F -20 -20:TT 0 -20:TT 0 0:TT -20 0",
[c1[0], c1[1], c1[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,-1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f4 = geompy.MakeFace(w,1)
faces.append(f1)
@ -94,30 +100,30 @@ nz = c3[2] - c2[2]
w = geompy.MakeSketcher("Sketcher:F 20 20:TT 0 20:TT 0 0:TT 20 0",
[c2[0], c2[1], c2[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f1 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F -20 0:TT 0 0:TT 0 20:TT -20 20",
[c2[0], c2[1], c2[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f2 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F 20 0:TT 0 0:TT 0 -20:TT 20 -20",
[c2[0], c2[1], c2[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f3 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F -20 -20:TT 0 -20:TT 0 0:TT -20 0",
[c2[0], c2[1], c2[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f4 = geompy.MakeFace(w,1)
faces.append(f1)
@ -163,19 +169,19 @@ fs.append(ff)
aPartition = geompy.MakePartition(shellsph,fs)
fs = geompy.SubShapeAllSortedCentres(aPartition, geompy.ShapeType["FACE"])
faces.append(fs[0])
faces.append(fs[1])
faces.append(fs[2])
faces.append(fs[3])
for face in fs:
if ( 4 == geompy.NbShapes(face, geompy.ShapeType["VERTEX"]) ):
faces.append(face)
pass
pass
shell = geompy.MakeSewing(faces,1.e-6)
shells.append(shell)
faces = geompy.SubShapeAllSortedCentres(shell, geompy.ShapeType["FACE"])
subbases.append(faces[2])
#===========================================================
# Create Pipe
#===========================================================
subbases = []
Pipe = geompy.MakePipeWithShellSections(shells, subbases, theLocations, WirePath,
theWithContact=0, theWithCorrection=0)

View File

@ -31,5 +31,5 @@ id_disk3 = geompy.addToStudy(disk3,"Disk3")
# display disks
gg.createAndDisplayGO(id_vxy)
gg.createAndDisplayGO(id_disk1)
gg.createAndDisplayGO(id_diks2)
gg.createAndDisplayGO(id_diks3)
gg.createAndDisplayGO(id_disk2)
gg.createAndDisplayGO(id_disk3)

View File

@ -2,6 +2,7 @@
import geompy
import salome
import GEOM
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
@ -21,20 +22,19 @@ cone = geompy.MakeCone(p1, v, 70, 0, 80)
cut = geompy.MakeCut(cone, cylinder)
# get faces as sub-shapes
faces = []
faces = geompy.SubShapeAllSortedCentres(cut, geompy.ShapeType["FACE"])
f_2 = geompy.GetSubShapeID(cut, faces[2])
# remove one face from the shape
cut_without_f_2 = geompy.SuppressFaces(cut, [f_2])
# get wires as sub-shapes
wires = []
wires = geompy.SubShapeAllSortedCentres(cut_without_f_2, geompy.ShapeType["WIRE"])
w_0 = geompy.GetSubShapeID(cut_without_f_2, wires[0])
# get edges as sub-shapes
edges = geompy.SubShapeAllSortedCentres(faces[2], geompy.ShapeType["EDGE"])
edge = geompy.GetInPlace(cut_without_f_2, edges[0], True)
e_2 = geompy.GetSubShapeID(cut_without_f_2, edge)
# suppress the selected wire
result = geompy.SuppressHoles(cut_without_f_2, [w_0])
# suppress a hole using the selected edge
result = geompy.SuppressHoles(cut_without_f_2, [e_2])
# add objects in the study
id_cut = geompy.addToStudy(cut, "Cut")

View File

@ -1,9 +1,10 @@
# Limit Tolerance
import geompy
import salome
gg = salome.ImportComponentGUI("GEOM")
# import initial topology
# import initial topology with bad tolerances (more than 1e-07)
shape1 = geompy.ImportBREP("my_shape_1.brep")
shape2 = geompy.ImportBREP("my_shape_2.brep")

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
import unittest, sys
import unittest, sys, os
class SalomeSession(object):
def __init__(self, script):
@ -10,11 +10,10 @@ class SalomeSession(object):
sys.argv += ["--modules=GEOM"]
sys.argv += ["--execute=%s" % script]
clt, d = runSalome.main()
self.port = d['port']
return
def __del__(self):
port = self.port
port = os.getenv('NSPORT')
import killSalomeWithPort
killSalomeWithPort.killMyPort(port)
return

View File

@ -2,8 +2,9 @@
import salome
import geompy
import GEOM
texture = geompy.LoadTexture("/users/user/mytexture.dat")
texture = geompy.LoadTexture(os.getenv("DATA_DIR")+"/Textures/texture1.dat")
v1 = geompy.MakeVertex(0, 0, 0)
v2 = geompy.MakeVertex(100, 0, 0)

View File

@ -43,7 +43,7 @@ FILE_PATTERNS = *.doc
EXCLUDE_PATTERNS = creating_adv_obj.doc
EXCLUDE =
IMAGE_PATH = @srcdir@/images
EXAMPLE_PATH = @top_srcdir@/src/GEOM_SWIG @top_srcdir@/doc/salome/examples
EXAMPLE_PATH = @top_srcdir@/doc/salome/examples @top_srcdir@/src/GEOM_SWIG
#---------------------------------------------------------------------------
#HTML related options
@ -81,3 +81,8 @@ TAGFILES = geompy_doc.tag=../GEOM/geompy_doc #rnv: 07.04.2011 Workaroun
#because it wrongly defines location of the html files for search.
ALLEXTERNALS = NO
SEARCHENGINE = YES
#---------------------------------------------------------------------------
#Custom commands
#---------------------------------------------------------------------------
ALIASES += tui_script{1}="\include \1 <a href=\"../../examples/GEOM/\1\">Download this script</a>"

View File

@ -41,7 +41,7 @@ WARNINGS = YES
INPUT = @srcdir@/input
FILE_PATTERNS = tui_*.doc
IMAGE_PATH = @srcdir@/images
EXAMPLE_PATH = @top_srcdir@/src/GEOM_SWIG
EXAMPLE_PATH = @top_srcdir@/doc/salome/examples @top_srcdir@/src/GEOM_SWIG
#---------------------------------------------------------------------------
#HTML related options
@ -71,3 +71,8 @@ GENERATE_RTF = NO
#---------------------------------------------------------------------------
GENERATE_TAGFILE = tui_examples.tag
SEARCHENGINE = YES
#---------------------------------------------------------------------------
#Custom commands
#---------------------------------------------------------------------------
ALIASES += tui_script{1}="\include \1 <a href=\"../../examples/GEOM/\1\">Download this script</a>"

View File

@ -1,7 +1,6 @@
/*!
\page tui_3dsketcher_page 3D Sketcher
\include 3dsketcher.py
<a href="../../examples/GEOM/3dsketcher.py">Download this script</a>
\tui_script{3dsketcher.py}
*/

View File

@ -4,18 +4,15 @@
\anchor tui_creation_pipetshape
<br><h2>Creation of PipeTShape</h2>
\include advanced_geom_objs_ex01.py
<a href="../../examples/GEOM/advanced_geom_objs_ex01.py">Download this script</a>
\tui_script{advanced_geom_objs_ex01.py}
\anchor tui_creation_divideddisk
<br><h2>Creation of DividedDisk</h2>
\include advanced_geom_objs_ex02.py
<a href="../../examples/GEOM/advanced_geom_objs_ex02.py">Download this script</a>
\tui_script{advanced_geom_objs_ex02.py}
\anchor tui_creation_dividedcylinder
<br><h2>Creation of DividedCylinder</h2>
\include advanced_geom_objs_ex03.py
<a href="../../examples/GEOM/advanced_geom_objs_ex03.py">Download this script</a>
\tui_script{advanced_geom_objs_ex03.py}
<!--@@ insert new functions before this line @@ do not remove this line @@-->
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_angle_page Angle
\include angle.py
<a href="../../examples/GEOM/angle.py">Download this script</a>
\tui_script{angle.py}
*/

View File

@ -4,47 +4,38 @@
\anchor tui_creation_point
<br><h2>Creation of a Point</h2>
\include basic_geom_objs_ex01.py
<a href="../../examples/GEOM/basic_geom_objs_ex01.py">Download this script</a>
\tui_script{basic_geom_objs_ex01.py}
\anchor tui_creation_line
<br><h2>Creation of a Line</h2>
\include basic_geom_objs_ex02.py
<a href="../../examples/GEOM/basic_geom_objs_ex02.py">Download this script</a>
\tui_script{basic_geom_objs_ex02.py}
\anchor tui_creation_circle
<br><h2>Creation of a Circle</h2>
\include basic_geom_objs_ex03.py
<a href="../../examples/GEOM/basic_geom_objs_ex03.py">Download this script</a>
\tui_script{basic_geom_objs_ex03.py}
\anchor tui_creation_ellipse
<br><h2>Creation of an Ellipse</h2>
\include basic_geom_objs_ex04.py
<a href="../../examples/GEOM/basic_geom_objs_ex04.py">Download this script</a>
\tui_script{basic_geom_objs_ex04.py}
\anchor tui_creation_arc
<br><h2>Creation of an Arc</h2>
\include basic_geom_objs_ex05.py
<a href="../../examples/GEOM/basic_geom_objs_ex05.py">Download this script</a>
\tui_script{basic_geom_objs_ex05.py}
\anchor tui_creation_curve
<br><h2>Creation of a Curve</h2>
\include basic_geom_objs_ex06.py
<a href="../../examples/GEOM/basic_geom_objs_ex06.py">Download this script</a>
\tui_script{basic_geom_objs_ex06.py}
\anchor tui_creation_vector
<br><h2>Creation of a Vector</h2>
\include basic_geom_objs_ex07.py
<a href="../../examples/GEOM/basic_geom_objs_ex07.py">Download this script</a>
\tui_script{basic_geom_objs_ex07.py}
\anchor tui_creation_plane
<br><h2>Creation of a Plane</h2>
\include basic_geom_objs_ex08.py
<a href="../../examples/GEOM/basic_geom_objs_ex08.py">Download this script</a>
\tui_script{basic_geom_objs_ex08.py}
\anchor tui_creation_lcs
<br><h2>Creation of a Local Coordinate System</h2>
\include basic_geom_objs_ex09.py
<a href="../../examples/GEOM/basic_geom_objs_ex09.py">Download this script</a>
\tui_script{basic_geom_objs_ex09.py}
*/

View File

@ -4,17 +4,14 @@
\anchor tui_partition
<br><h2>Partition</h2>
\include basic_operations_ex01.py
<a href="../../examples/GEOM/basic_operations_ex01.py">Download this script</a>
\tui_script{basic_operations_ex01.py}
\anchor tui_archimede
<br><h2>Archimede</h2>
\include basic_operations_ex02.py
<a href="../../examples/GEOM/basic_operations_ex02.py">Download this script</a>
\tui_script{basic_operations_ex02.py}
\anchor tui_restore_prs_params
<br><h2>Restore presentation parameters and sub-shapes</h2>
\include basic_operations_ex03.py
<a href="../../examples/GEOM/basic_operations_ex03.py">Download this script</a>
\tui_script{basic_operations_ex03.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_basic_properties_page Basic Properties
\include basic_properties.py
<a href="../../examples/GEOM/basic_properties.py">Download this script</a>
\tui_script{basic_properties.py}
*/

View File

@ -4,17 +4,14 @@
\anchor tui_multi_transformation
<br><h2>Multi Transformation</h2>
\include blocks_operations_ex01.py
<a href="../../examples/GEOM/blocks_operations_ex01.py">Download this script</a>
\tui_script{blocks_operations_ex01.py}
\anchor tui_explode_on_blocks
<br><h2>Explode on Blocks</h2>
\include blocks_operations_ex02.py
<a href="../../examples/GEOM/blocks_operations_ex02.py">Download this script</a>
\tui_script{blocks_operations_ex02.py}
\anchor tui_propagate
<br><h2>Propagate</h2>
\include blocks_operations_ex03.py
<a href="../../examples/GEOM/blocks_operations_ex03.py">Download this script</a>
\tui_script{blocks_operations_ex03.py}
*/

View File

@ -4,22 +4,18 @@
\anchor tui_fuse
<br><h2>Fuse</h2>
\include boolean_operations_ex01.py
<a href="../../examples/GEOM/boolean_operations_ex01.py">Download this script</a>
\tui_script{boolean_operations_ex01.py}
\anchor tui_common
<br><h2>Common</h2>
\include boolean_operations_ex02.py
<a href="../../examples/GEOM/boolean_operations_ex02.py">Download this script</a>
\tui_script{boolean_operations_ex02.py}
\anchor tui_cut
<br><h2>Cut</h2>
\include boolean_operations_ex03.py
<a href="../../examples/GEOM/boolean_operations_ex03.py">Download this script</a>
\tui_script{boolean_operations_ex03.py}
\anchor tui_section
<br><h2>Section</h2>
\include boolean_operations_ex04.py
<a href="../../examples/GEOM/boolean_operations_ex04.py">Download this script</a>
\tui_script{boolean_operations_ex04.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_bounding_box_page Bounding Box
\include bounding_box.py
<a href="../../examples/GEOM/bounding_box.py">Download this script</a>
\tui_script{bounding_box.py}
*/

View File

@ -3,11 +3,9 @@
\page tui_building_by_blocks_page Building by Blocks
<br><h2>Quadrangle Face</h2>
\include building_by_blocks_ex01.py
<a href="../../examples/GEOM/building_by_blocks_ex01.py">Download this script</a>
\tui_script{building_by_blocks_ex01.py}
<br><h2>Hexagonal Solid</h2>
\include building_by_blocks_ex02.py
<a href="../../examples/GEOM/building_by_blocks_ex02.py">Download this script</a>
\tui_script{building_by_blocks_ex02.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_center_of_mass_page Center of masses
\include center_of_mass.py
<a href="../../examples/GEOM/center_of_mass.py">Download this script</a>
\tui_script{center_of_mass.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_check_compound_of_blocks_page Check Compound of Blocks
\include check_compound_of_blocks.py
<a href="../../examples/GEOM/check_compound_of_blocks.py">Download this script</a>
\tui_script{check_compound_of_blocks.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_check_self_intersections_page Detect Self-intersections
\include check_self_intersections.py
<a href="../../examples/GEOM/check_self_intersections.py">Download this script</a>
\tui_script{check_self_intersections.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_check_shape_page Check Shape
\include check_shape.py
<a href="../../examples/GEOM/check_shape.py">Download this script</a>
\tui_script{check_shape.py}
*/

View File

@ -4,51 +4,42 @@
\anchor tui_creation_prism
<br><h2>Creation of a Prism</h2>
\include complex_objs_ex01.py
<a href="../../examples/GEOM/complex_objs_ex01.py">Download this script</a>
\tui_script{complex_objs_ex01.py}
\anchor tui_creation_revolution
<br><h2>Creation of a Revolution</h2>
\include complex_objs_ex02.py
<a href="../../examples/GEOM/complex_objs_ex02.py">Download this script</a>
\tui_script{complex_objs_ex02.py}
\anchor tui_creation_filling
<br><h2>Creation of a Filling</h2>
\include complex_objs_ex03.py
<a href="../../examples/GEOM/complex_objs_ex03.py">Download this script</a>
\tui_script{complex_objs_ex03.py}
\anchor tui_creation_pipe
<br><h2>Creation of a Pipe</h2>
\include complex_objs_ex04.py
<a href="../../examples/GEOM/complex_objs_ex04.py">Download this script</a>
\tui_script{complex_objs_ex04.py}
\anchor tui_creation_pipe_with_diff_sec
<br><h2>Creation of a PipeWithDifferentSections</h2>
\include complex_objs_ex05.py
<a href="../../examples/GEOM/complex_objs_ex05.py">Download this script</a>
\tui_script{complex_objs_ex05.py}
\anchor tui_creation_pipe_with_shell_sec
<br><h2>Creation of a PipeWithShellSections</h2>
\include complex_objs_ex06.py
<a href="../../examples/GEOM/complex_objs_ex06.py">Download this script</a>
\tui_script{complex_objs_ex06.py}
\anchor tui_creation_pipe_without_path
<br><h2>Creation of a PipeShellsWithoutPath</h2>
\include complex_objs_ex07.py
<a href="../../examples/GEOM/complex_objs_ex07.py">Download this script</a>
\tui_script{complex_objs_ex07.py}
\anchor tui_creation_pipe_binormal_along_vector
<br><h2>Creation of a PipeBiNormalAlongVector</h2>
\include complex_objs_ex08.py
<a href="../../examples/GEOM/complex_objs_ex08.py">Download this script</a>
\tui_script{complex_objs_ex08.py}
\anchor tui_creation_pipe_path
<br><h2>Creation of a Middle Path</h2>
\include complex_objs_ex09.py
<a href="../../examples/GEOM/complex_objs_ex09.py">Download this script</a>
\tui_script{complex_objs_ex09.py}
\anchor tui_creation_tangent_plane_on_face
<br><h2>Creation of Tangent Plane On Face</h2>
\include complex_objs_ex10.py
<a href="../../examples/GEOM/complex_objs_ex10.py">Download this script</a>
\tui_script{complex_objs_ex10.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_free_boundaries_page Check Free Boundaries
\include free_boundaries.py
<a href="../../examples/GEOM/free_boundaries.py">Download this script</a>
\tui_script{free_boundaries.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_free_faces_page Check Free Faces
\include free_faces.py
<a href="../../examples/GEOM/free_faces.py">Download this script</a>
\tui_script{free_faces.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_get_non_blocks_page Get Non Blocks
\include get_non_blocks.py
<a href="../../examples/GEOM/get_non_blocks.py">Download this script</a>
\tui_script{get_non_blocks.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_import_export_page Import/Export
\include import_export.py
<a href="../../examples/GEOM/import_export.py">Download this script</a>
\tui_script{import_export.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_inertia_page Inertia
\include inertia.py
<a href="../../examples/GEOM/inertia.py">Download this script</a>
\tui_script{inertia.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_min_distance_page Minimal Distance
\include min_distance.py
<a href="../../examples/GEOM/min_distance.py">Download this script</a>
\tui_script{min_distance.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_normal_face_page Normal to a Face
\include normal_face.py
<a href="../../examples/GEOM/normal_face.py">Download this script</a>
\tui_script{normal_face.py}
*/

View File

@ -3,7 +3,6 @@
\page tui_notebook_geom_page Using SALOME NoteBook
\anchor tui_notebook_geom
\include notebook_geom.py
<a href="../../examples/GEOM/notebook_geom.py">Download this script</a>
\tui_script{notebook_geom.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_point_coordinates_page Point Coordinates
\include point_coordinates.py
<a href="../../examples/GEOM/point_coordinates.py">Download this script</a>
\tui_script{point_coordinates.py}
*/

View File

@ -4,37 +4,30 @@
\anchor tui_creation_box
<br><h2>Creation of a Box</h2>
\include primitives_ex01.py
<a href="../../examples/GEOM/primitives_ex01.py">Download this script</a>
\tui_script{primitives_ex01.py}
\anchor tui_creation_cylinder
<br><h2>Creation of a Cylinder</h2>
\include primitives_ex02.py
<a href="../../examples/GEOM/primitives_ex02.py">Download this script</a>
\tui_script{primitives_ex02.py}
\anchor tui_creation_sphere
<br><h2>Creation of a Sphere</h2>
\include primitives_ex03.py
<a href="../../examples/GEOM/primitives_ex03.py">Download this script</a>
\tui_script{primitives_ex03.py}
\anchor tui_creation_torus
<br><h2>Creation of a Torus</h2>
\include primitives_ex04.py
<a href="../../examples/GEOM/primitives_ex04.py">Download this script</a>
\tui_script{primitives_ex04.py}
\anchor tui_creation_cone
<br><h2>Creation of a Cone</h2>
\include primitives_ex05.py
<a href="../../examples/GEOM/primitives_ex05.py">Download this script</a>
\tui_script{primitives_ex05.py}
\anchor tui_creation_disk
<br><h2>Creation of a Disk</h2>
\include primitives_ex06.py
<a href="../../examples/GEOM/primitives_ex06.py">Download this script</a>
\tui_script{primitives_ex06.py}
\anchor tui_creation_squareface
<br><h2>Creation of a Rectangle</h2>
\include primitives_ex07.py
<a href="../../examples/GEOM/primitives_ex07.py">Download this script</a>
\tui_script{primitives_ex07.py}
*/

View File

@ -4,57 +4,46 @@
\anchor tui_shape_processing
<br><h2>Shape Processing</h2>
\include repairing_operations_ex01.py
<a href="../../examples/GEOM/repairing_operations_ex01.py">Download this script</a>
\tui_script{repairing_operations_ex01.py}
\anchor tui_suppress_faces
<br><h2>Suppress Faces</h2>
\include repairing_operations_ex02.py
<a href="../../examples/GEOM/repairing_operations_ex02.py">Download this script</a>
\tui_script{repairing_operations_ex02.py}
\anchor tui_close_contour
<br><h2>Close Contour</h2>
\include repairing_operations_ex03.py
<a href="../../examples/GEOM/repairing_operations_ex03.py">Download this script</a>
\tui_script{repairing_operations_ex03.py}
\anchor tui_suppress_internal_wires
<br><h2>Suppress Internal Wires</h2>
\include repairing_operations_ex04.py
<a href="../../examples/GEOM/repairing_operations_ex04.py">Download this script</a>
\tui_script{repairing_operations_ex04.py}
\anchor tui_suppress_holes
<br><h2>Suppress Holes</h2>
\include repairing_operations_ex05.py
<a href="../../examples/GEOM/repairing_operations_ex05.py">Download this script</a>
\tui_script{repairing_operations_ex05.py}
\anchor tui_sewing
<br><h2>Sewing</h2>
\include repairing_operations_ex06.py
<a href="../../examples/GEOM/repairing_operations_ex06.py">Download this script</a>
\tui_script{repairing_operations_ex06.py}
\anchor tui_glue_faces
<br><h2>Glue Faces</h2>
\include repairing_operations_ex07.py
<a href="../../examples/GEOM/repairing_operations_ex07.py">Download this script</a>
\tui_script{repairing_operations_ex07.py}
\anchor tui_glue_edges
<br><h2>Glue Edges</h2>
\include repairing_operations_ex08.py
<a href="../../examples/GEOM/repairing_operations_ex08.py">Download this script</a>
\tui_script{repairing_operations_ex08.py}
\anchor tui_limit_tolerance
<br><h2>Limit Tolerance</h2>
\include repairing_operations_ex09.py
<a href="../../examples/GEOM/repairing_operations_ex09.py">Download this script</a>
\tui_script{repairing_operations_ex09.py}
\anchor tui_add_point_on_edge
<br><h2>Add Point on Edge</h2>
\include repairing_operations_ex10.py
<a href="../../examples/GEOM/repairing_operations_ex10.py">Download this script</a>
\tui_script{repairing_operations_ex10.py}
\anchor tui_fuse_collinear_edges
<br><h2>Fuse Collinear Edges within a Wire</h2>
\include repairing_operations_ex11.py
<a href="../../examples/GEOM/repairing_operations_ex11.py">Download this script</a>
\tui_script{repairing_operations_ex11.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_sketcher_page 2D Sketcher
\include sketcher.py
<a href="../../examples/GEOM/sketcher.py">Download this script</a>
\tui_script{sketcher.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_tolerance_page Tolerance
\include tolerance.py
<a href="../../examples/GEOM/tolerance.py">Download this script</a>
\tui_script{tolerance.py}
*/

View File

@ -4,32 +4,26 @@
\anchor tui_creation_edge
<br><h2>Creation of an Edge</h2>
\include topological_geom_objs_ex01.py
<a href="../../examples/GEOM/topological_geom_objs_ex01.py">Download this script</a>
\tui_script{topological_geom_objs_ex01.py}
\anchor tui_creation_wire
<br><h2>Creation of a Wire</h2>
\include topological_geom_objs_ex02.py
<a href="../../examples/GEOM/topological_geom_objs_ex02.py">Download this script</a>
\tui_script{topological_geom_objs_ex02.py}
\anchor tui_creation_face
<br><h2>Creation of a Face</h2>
\include topological_geom_objs_ex03.py
<a href="../../examples/GEOM/topological_geom_objs_ex03.py">Download this script</a>
\tui_script{topological_geom_objs_ex03.py}
\anchor tui_creation_shell
<br><h2>Creation of a Shell</h2>
\include topological_geom_objs_ex04.py
<a href="../../examples/GEOM/topological_geom_objs_ex04.py">Download this script</a>
\tui_script{topological_geom_objs_ex04.py}
\anchor tui_creation_solid
<br><h2>Creation of a Solid</h2>
\include topological_geom_objs_ex05.py
<a href="../../examples/GEOM/topological_geom_objs_ex05.py">Download this script</a>
\tui_script{topological_geom_objs_ex05.py}
\anchor tui_creation_compound
<br><h2>Creation of a Compound</h2>
\include topological_geom_objs_ex06.py
<a href="../../examples/GEOM/topological_geom_objs_ex06.py">Download this script</a>
\tui_script{topological_geom_objs_ex06.py}
*/

View File

@ -4,67 +4,54 @@
\anchor tui_translation
<br><h2>Translation</h2>
\include transformation_operations_ex01.py
<a href="../../examples/GEOM/transformation_operations_ex01.py">Download this script</a>
\tui_script{transformation_operations_ex01.py}
\anchor tui_rotation
<br><h2>Rotation</h2>
\include transformation_operations_ex02.py
<a href="../../examples/GEOM/transformation_operations_ex02.py">Download this script</a>
\tui_script{transformation_operations_ex02.py}
\anchor tui_modify_location
<br><h2>Modify Location</h2>
\include transformation_operations_ex03.py
<a href="../../examples/GEOM/transformation_operations_ex03.py">Download this script</a>
\tui_script{transformation_operations_ex03.py}
\anchor tui_mirror
<br><h2>Mirror Image</h2>
\include transformation_operations_ex04.py
<a href="../../examples/GEOM/transformation_operations_ex04.py">Download this script</a>
\tui_script{transformation_operations_ex04.py}
\anchor tui_scale
<br><h2>Scale Transform</h2>
\include transformation_operations_ex05.py
<a href="../../examples/GEOM/transformation_operations_ex05.py">Download this script</a>
\tui_script{transformation_operations_ex05.py}
\anchor tui_offset
<br><h2>Offset Surface</h2>
\include transformation_operations_ex06.py
<a href="../../examples/GEOM/transformation_operations_ex06.py">Download this script</a>
\tui_script{transformation_operations_ex06.py}
\anchor tui_projection
<br><h2>Projection</h2>
\include transformation_operations_ex07.py
<a href="../../examples/GEOM/transformation_operations_ex07.py">Download this script</a>
\tui_script{transformation_operations_ex07.py}
\anchor tui_multi_translation
<br><h2>Multi Translation</h2>
\include transformation_operations_ex08.py
<a href="../../examples/GEOM/transformation_operations_ex08.py">Download this script</a>
\tui_script{transformation_operations_ex08.py}
\anchor tui_multi_rotation
<br><h2>Multi Rotation</h2>
\include transformation_operations_ex09.py
<a href="../../examples/GEOM/transformation_operations_ex09.py">Download this script</a>
\tui_script{transformation_operations_ex09.py}
\anchor tui_fillet2d
<br><h2>Fillet 2D</h2>
\include transformation_operations_ex10.py
<a href="../../examples/GEOM/transformation_operations_ex10.py">Download this script</a>
\tui_script{transformation_operations_ex10.py}
\anchor tui_fillet1d
<br><h2>Fillet 1D</h2>
\include transformation_operations_ex11.py
<a href="../../examples/GEOM/transformation_operations_ex11.py">Download this script</a>
\tui_script{transformation_operations_ex11.py}
\anchor tui_fillet
<br><h2>Fillet</h2>
\include transformation_operations_ex12.py
<a href="../../examples/GEOM/transformation_operations_ex12.py">Download this script</a>
\tui_script{transformation_operations_ex12.py}
\anchor tui_chamfer
<br><h2>Chamfer</h2>
\include transformation_operations_ex13.py
<a href="../../examples/GEOM/transformation_operations_ex13.py">Download this script</a>
\tui_script{transformation_operations_ex13.py}
*/

View File

@ -4,22 +4,18 @@
\anchor tui_change_disp_mode
<br><h2>Changing Display Mode</h2>
\include viewing_geom_objs_ex01.py
<a href="../../examples/GEOM/viewing_geom_objs_ex01.py">Download this script</a>
\tui_script{viewing_geom_objs_ex01.py}
\anchor tui_change_color
<br><h2> Changing Color</h2>
\include viewing_geom_objs_ex02.py
<a href="../../examples/GEOM/viewing_geom_objs_ex02.py">Download this script</a>
\tui_script{viewing_geom_objs_ex02.py}
\anchor tui_change_transparency
<br><h2>Changing Transparency</h2>
\include viewing_geom_objs_ex03.py
<a href="../../examples/GEOM/viewing_geom_objs_ex03.py">Download this script</a>
\tui_script{viewing_geom_objs_ex03.py}
\anchor tui_point_marker
<br><h2>Set Point Marker</h2>
\include viewing_geom_objs_ex04.py
<a href="../../examples/GEOM/viewing_geom_objs_ex04.py">Download this script</a>
\tui_script{viewing_geom_objs_ex04.py}
*/

View File

@ -1,7 +1,6 @@
/*!
\page tui_whatis_page What Is
\include whatis.py
<a href="../../examples/GEOM/whatis.py">Download this script</a>
\tui_script{whatis.py}
*/

View File

@ -5,35 +5,29 @@
<br>
\anchor tui_create_groups_anchor
<h2>Creation of a group</h2>
\include working_with_groups_ex01.py
<a href="../../examples/GEOM/working_with_groups_ex01.py">Download this script</a>
\tui_script{working_with_groups_ex01.py}
\anchor tui_edit_groups_anchor
<br><h2>Adding an object to the group</h2>
\include working_with_groups_ex02.py
<a href="../../examples/GEOM/working_with_groups_ex02.py">Download this script</a>
\tui_script{working_with_groups_ex02.py}
<br><h2>Removing an object from the group</h2>
\include working_with_groups_ex03.py
<a href="../../examples/GEOM/working_with_groups_ex03.py">Download this script</a>
\tui_script{working_with_groups_ex03.py}
<br>
\anchor tui_union_groups_anchor
<h2>Union Groups</h2>
\include working_with_groups_ex04.py
<a href="../../examples/GEOM/working_with_groups_ex04.py">Download this script</a>
\tui_script{working_with_groups_ex04.py}
<br>
\anchor tui_intersect_groups_anchor
<h2>Intersect Groups</h2>
\include working_with_groups_ex05.py
<a href="../../examples/GEOM/working_with_groups_ex05.py">Download this script</a>
\tui_script{working_with_groups_ex05.py}
<br>
\anchor tui_cut_groups_anchor
<h2>Cut Groups</h2>
\include working_with_groups_ex06.py
<a href="../../examples/GEOM/working_with_groups_ex06.py">Download this script</a>
\tui_script{working_with_groups_ex06.py}
*/

View File

@ -1541,6 +1541,19 @@ module GEOM
in GEOM_Object thePath,
in GEOM_Object theVec);
/*!
* \brief Make a thick solid from a surface shape (face or shell)
* \param theObject Surface from which the thick solid is made
* \param theThickness Value of the thickness
* \return New GEOM_Object, containing the created pipe if isCopy = true
* or the modified object if isCopy = false
*/
GEOM_Object MakeThickening (in GEOM_Object theObject,
in double theThickness,
in boolean isCopy);
/*!
* \brief Build a middle path of a pipe-like shape.
*

View File

@ -204,7 +204,7 @@ void DisplayGUI::EraseAll()
SUIT_ViewManager* vman = vw->getViewManager();
if ( vman->getType() == OCCViewer_Viewer::Type() ||
vman->getType() == SVTK_Viewer::Type() ) {
GEOM_Displayer( appStudy ).EraseAll();
GEOM_Displayer( appStudy ).EraseAll(true);
}
}
}
@ -406,59 +406,29 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
{
SUIT_OverrideCursor();
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
if ( !viewWindow )
viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
aView->SetDisplayMode( mode );
GeometryGUI::Modified();
}
else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
AIS_DisplayMode newmode;
switch (mode) {
case 0:
newmode = AIS_WireFrame;
break;
case 1:
newmode = AIS_Shaded;
break;
case 2:
newmode = AIS_DisplayMode( GEOM_AISShape::ShadingWithEdges );
break;
case 3:
newmode = AIS_DisplayMode( GEOM_AISShape::TexturedShape );
break;
default:
break;
}
AIS_ListOfInteractive List;
ic->DisplayedObjects( List );
AIS_ListOfInteractive List1;
ic->ObjectsInCollector( List1 );
List.Append( List1 );
AIS_ListIteratorOfListOfInteractive ite( List );
while( ite.More() ) {
if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( ite.Value() );
if(aSh->isTopLevel()) {
aSh->setPrevDisplayMode(Standard_Integer( newmode ));
}
else {
ic->SetDisplayMode( aSh, Standard_Integer( newmode ),true );
}
}
ite.Next();
}
ic->SetDisplayMode( newmode, Standard_False );
GeometryGUI::Modified();
viewWindow = app->desktop()->activeWindow();
SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
if ( !aStudy ) return;
GEOM_Displayer displayer( aStudy );
int mgrId = viewWindow->getViewManager()->getGlobalId();
SALOME_ListIO anIOlst;
displayer.GetActiveView()->GetVisible( anIOlst );
for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) {
Handle( SALOME_InteractiveObject ) io = It.Value();
aStudy->setObjectProperty( mgrId, io->getEntry(), GEOM::propertyName( GEOM::DisplayMode ), mode );
displayer.Redisplay( io, false );
}
displayer.UpdateViewer();
GeometryGUI::Modified();
}
//=====================================================================================
@ -469,46 +439,31 @@ void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow )
{
SUIT_OverrideCursor();
if ( !viewWindow )
viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
viewWindow->setProperty( "VectorsMode", mode );
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
vtkActorCollection* allActors = vw->getRenderer()->GetActors();
allActors->InitTraversal();
while (vtkActor* actor = allActors->GetNextActor()) {
if (actor->GetVisibility()) { // only for visible actors
GEOM_Actor* aGeomActor = 0;
if ( actor->IsA( "GEOM_Actor" ) ) {
aGeomActor = GEOM_Actor::SafeDownCast( actor );
if ( aGeomActor )
aGeomActor->SetVectorMode( mode );
}
}
}
GeometryGUI::Modified();
}
else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
viewWindow->setProperty( "VectorsMode", mode );
OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
AIS_ListOfInteractive List;
ic->DisplayedObjects( List );
AIS_ListOfInteractive List1;
ic->ObjectsInCollector( List1 );
List.Append( List1 );
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
AIS_ListIteratorOfListOfInteractive ite( List );
while( ite.More() ) {
if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( ite.Value() );
aSh->SetDisplayVectors(mode);
ic->RecomputePrsOnly(ite.Value());
}
ite.Next();
}
GeometryGUI::Modified();
SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
if ( !aStudy ) return;
if ( !viewWindow )
viewWindow = app->desktop()->activeWindow();
GEOM_Displayer displayer( aStudy );
viewWindow->setProperty( "VectorsMode", mode );
int aMgrId = viewWindow->getViewManager()->getGlobalId();
SALOME_ListIO anIOlst;
displayer.GetActiveView()->GetVisible( anIOlst );
for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) {
Handle( SALOME_InteractiveObject ) io = It.Value();
aStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::EdgesDirection ), mode );
displayer.Redisplay( io, false );
}
displayer.UpdateViewer();
GeometryGUI::Modified();
}
//=====================================================================================
@ -538,103 +493,34 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if ( !aSelMgr ) return;
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
if(!aStudy)
return;
SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
if ( !aStudy ) return;
SUIT_OverrideCursor();
SALOME_ListIO aList;
SALOME_ListIO selected;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
SVTK_View* aView = vw->getView();
int mgrId = viewWindow->getViewManager()->getGlobalId();
bool vectorMode = false;
GEOM_Displayer displayer( aStudy );
aSelMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO It( aList );
int mgrId = viewWindow->getViewManager()->getGlobalId();
for( ;It.More(); It.Next() ) {
SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(vw->getViewManager()->getViewModel());
SVTK_Prs* vtkPrs =
stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
if ( vtkPrs && !vtkPrs->IsNull() ) {
if (mode == 0 )
aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
else if ( mode == 1 )
aView->ChangeRepresentationToSurface( vtkPrs->GetObjects() );
else if ( mode == 2 )
aView->ChangeRepresentationToSurfaceWithEdges( vtkPrs->GetObjects() );
else if ( mode == 4 ) {
vtkActorCollection* anActors = vtkPrs->GetObjects();
anActors->InitTraversal();
while (vtkActor* anAct = anActors->GetNextActor()) {
GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(anAct);
vectorMode = !aGeomActor->GetVectorMode();
aGeomActor->SetVectorMode(vectorMode);
}
}
if(mode == 0 || mode == 1 || mode == 2) {
aStudy->setObjectProperty(mgrId,It.Value()->getEntry(),GEOM::propertyName( GEOM::DisplayMode ), mode);
}
else if (mode == 4) {
aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),GEOM::propertyName( GEOM::EdgesDirection ), vectorMode);
}
}
QVariant v = aStudy->getObjectProperty( mgrId, selected.First()->getEntry(), GEOM::propertyName( GEOM::EdgesDirection ), QVariant() );
bool vectorMode = v.isValid() ? !v.toBool() : false;
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
Handle( SALOME_InteractiveObject ) io = It.Value();
if ( mode == 0 || mode == 1 || mode == 2 || mode == 3 ) {
aStudy->setObjectProperty( mgrId, io->getEntry(), GEOM::propertyName( GEOM::DisplayMode ), mode );
}
aView->Repaint();
GeometryGUI::Modified();
}
else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
aSelMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO It( aList );
int mgrId = viewWindow->getViewManager()->getGlobalId();
bool vectorMode = 0;
for( ;It.More(); It.Next() ) {
SOCC_Viewer* soccViewer = (SOCC_Viewer*)(viewWindow->getViewManager()->getViewModel());
SOCC_Prs* occPrs = dynamic_cast<SOCC_Prs*>( soccViewer->CreatePrs( It.Value()->getEntry() ) );
if ( occPrs && !occPrs->IsNull() ) {
AIS_ListOfInteractive shapes; occPrs->GetObjects( shapes );
AIS_ListIteratorOfListOfInteractive interIter( shapes );
for ( ; interIter.More(); interIter.Next() ) {
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
if ( !aSh.IsNull() ) {
if(!aSh->isTopLevel()) {
if ( mode == 0 )
ic->SetDisplayMode( interIter.Value(), AIS_WireFrame, false );
else if ( mode == 1 )
ic->SetDisplayMode( interIter.Value(), AIS_Shaded, false );
else if ( mode == 2 )
ic->SetDisplayMode( interIter.Value(), GEOM_AISShape::ShadingWithEdges, false );
else if ( mode == 3 )
ic->SetDisplayMode( interIter.Value(), AIS_ExactHLR, false );
} else {
aSh->setPrevDisplayMode(mode);
}
if (mode == 4 ) {
vectorMode = !aSh->isShowVectors();
aSh->SetDisplayVectors(vectorMode);
ic->RecomputePrsOnly(interIter.Value());
}
}
}
if(mode == 0 || mode == 1 || mode == 2 || mode == 3) {
aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),GEOM::propertyName( GEOM::DisplayMode ), mode);
}
else if (mode == 4) {
aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),GEOM::propertyName( GEOM::EdgesDirection ), vectorMode);
}
}
else if ( mode == 4 ) {
aStudy->setObjectProperty( mgrId, io->getEntry(), GEOM::propertyName( GEOM::EdgesDirection ), vectorMode );
}
ic->UpdateCurrentViewer();
GeometryGUI::Modified();
displayer.Redisplay( io, false );
}
displayer.UpdateViewer();
GeometryGUI::Modified();
}
//=====================================================================================

View File

@ -21,6 +21,20 @@
#include "DlgRef.h"
//////////////////////////////////////////
// DlgRef_1Check1Spin1Check
//////////////////////////////////////////
DlgRef_1Check1Spin1Check::DlgRef_1Check1Spin1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Check1Spin1Check::~DlgRef_1Check1Spin1Check()
{
}
//////////////////////////////////////////
// DlgRef_1List1Spin1Btn
//////////////////////////////////////////

View File

@ -32,6 +32,23 @@
# define DLGREF_EXPORT
#endif
//////////////////////////////////////////
// DlgRef_1Check1Spin1Check
//////////////////////////////////////////
#include "ui_DlgRef_1Check1Spin1Check_QTD.h"
class DLGREF_EXPORT DlgRef_1Check1Spin1Check : public QWidget,
public Ui::DlgRef_1Check1Spin1Check_QTD
{
Q_OBJECT
public:
DlgRef_1Check1Spin1Check( QWidget* = 0, Qt::WindowFlags = 0 );
~DlgRef_1Check1Spin1Check();
};
//////////////////////////////////////////
// DlgRef_1List1Spin1Btn
//////////////////////////////////////////

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DlgRef_1Check1Spin1Check_QTD</class>
<widget class="QWidget" name="DlgRef_1Check1Spin1Check_QTD">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>165</width>
<height>94</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QGroupBox" name="GroupBox1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkButton1">
<property name="text">
<string>CheckBox</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="checkButton2">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="TextLabel1">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TL1</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>SalomeApp_DoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header location="global">SalomeApp_DoubleSpinBox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>SpinBox_DX</tabstop>
<tabstop>checkButton2</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -34,6 +34,7 @@ MOC_FILES = \
DlgRef_moc.cxx
UIC_FILES = \
ui_DlgRef_1Check1Spin1Check_QTD.h \
ui_DlgRef_1List1Spin1Btn_QTD.h \
ui_DlgRef_1Sel1Check1List_QTD.h \
ui_DlgRef_1Sel1Check1Sel_QTD.h \

View File

@ -728,13 +728,7 @@ void GEOMBase::ShowErrorMessage( const QString& errorCode, const QString& commen
//=======================================================================
GEOM::GEOM_Object_ptr GEOMBase::GetObjectFromIOR( const QString& IOR )
{
GEOM::GEOM_Object_var geomObj;
if ( !IOR.isEmpty() ) {
CORBA::Object_var corbaObj = SalomeApp_Application::orb()->string_to_object( IOR.toLatin1().constData() );
if ( !CORBA::is_nil( corbaObj ) )
geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
}
return geomObj._retn();
return GeometryGUI::GetObjectFromIOR (IOR);
}
//=======================================================================
@ -743,12 +737,7 @@ GEOM::GEOM_Object_ptr GEOMBase::GetObjectFromIOR( const QString& IOR )
//=======================================================================
QString GEOMBase::GetIORFromObject( GEOM::GEOM_Object_ptr object )
{
QString IOR;
if ( !CORBA::is_nil( object ) ) {
CORBA::String_var anIOR = SalomeApp_Application::orb()->object_to_string( object );
IOR = anIOR.in();
}
return IOR;
return GeometryGUI::GetIORFromObject (object);
}
//=======================================================================

View File

@ -676,30 +676,7 @@ GEOM_Displayer* GEOMBase_Helper::getDisplayer()
//================================================================
void GEOMBase_Helper::clearShapeBuffer( GEOM::GEOM_Object_ptr theObj )
{
if ( CORBA::is_nil( theObj ) )
return;
CORBA::String_var IOR = SalomeApp_Application::orb()->object_to_string( theObj );
TCollection_AsciiString asciiIOR( (char *)IOR.in() );
GEOM_Client::get_client().RemoveShapeFromBuffer( asciiIOR );
if ( !getStudy() || !getStudy()->studyDS() )
return;
_PTR(Study) aStudy = getStudy()->studyDS();
_PTR(SObject) aSObj ( aStudy->FindObjectIOR( std::string( IOR ) ) );
if ( !aSObj )
return;
_PTR(ChildIterator) anIt ( aStudy->NewChildIterator( aSObj ) );
for ( anIt->InitEx( true ); anIt->More(); anIt->Next() ) {
_PTR(GenericAttribute) anAttr;
if ( anIt->Value()->FindAttribute(anAttr, "AttributeIOR") ) {
_PTR(AttributeIOR) anIOR ( anAttr );
TCollection_AsciiString asciiIOR( (char*)anIOR->Value().c_str() );
GEOM_Client::get_client().RemoveShapeFromBuffer( asciiIOR );
}
}
GeometryGUI::ClearShapeBuffer(theObj);
}
//================================================================

View File

@ -1080,12 +1080,20 @@ Please, select face, shell or solid and try again</translation>
</message>
<message>
<source>GEOM_MINDIST_NO_SOL</source>
<translation>No solution found</translation>
<translation type="unfinished">No solution found</translation>
</message>
<message>
<source>GEOM_MINDIST_OBJ</source>
<translation>Objects And Results</translation>
</message>
<message>
<source>GEOM_MINDIST_PUBLISH_TITLE</source>
<translation type="unfinished">Multiple solutions found</translation>
</message>
<message>
<source>GEOM_MINDIST_PUBLISH_TEXT</source>
<translation type="unfinished">Do you want to publish in the study all found solutions? If No, only the currently selected solution will be published.</translation>
</message>
<message>
<source>GEOM_MINDIST_TITLE</source>
<translation>Minimun Distance Between Two Objects</translation>

View File

@ -1070,10 +1070,26 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
<source>GEOM_MIN</source>
<translation>Min :</translation>
</message>
<message>
<source>GEOM_MINDIST_NAME</source>
<translation type="unfinished">MinDist</translation>
</message>
<message>
<source>GEOM_MINDIST_NO_SOL</source>
<translation type="unfinished">No solution found</translation>
</message>
<message>
<source>GEOM_MINDIST_OBJ</source>
<translation>Objets et résultats</translation>
</message>
<message>
<source>GEOM_MINDIST_PUBLISH_TITLE</source>
<translation type="unfinished">Multiple solutions found</translation>
</message>
<message>
<source>GEOM_MINDIST_PUBLISH_TEXT</source>
<translation type="unfinished">Do you want to publish in the study all found solutions? If No, only the currently selected solution will be published.</translation>
</message>
<message>
<source>GEOM_MINDIST_TITLE</source>
<translation>Distance minimale entre deux objets</translation>

View File

@ -2326,6 +2326,118 @@ QAction* GeometryGUI::getAction(const int id) {
return action(id);
}
/*!
\brief GEOM module message handler
This method can be re-implemented in the subclasses.
This is a GEOM module message handler.
\param msg the message received.
*/
void GeometryGUI::message(const QString& msg)
{
// dispatch message
QStringList data = msg.split("/");
const int nbStrings = data.count();
if (nbStrings > 0) {
if (data[0] == "modified") {
// get mesh entry
QString anIOR = nbStrings > 1 ? data[1] : QString();
if ( anIOR.isEmpty() ) {
return;
}
// Get the geom object.
GEOM::GEOM_Object_ptr anObj = GeometryGUI::GetObjectFromIOR (anIOR);
// Clear the shape buffer
GeometryGUI::ClearShapeBuffer (anObj);
}
}
}
/*!
\brief Clears the shape buffer.
This is a static method. It clears the shape buffer.
\param theObj the object
*/
void GeometryGUI::ClearShapeBuffer( GEOM::GEOM_Object_ptr theObj )
{
if ( CORBA::is_nil( theObj ) )
return;
CORBA::String_var IOR = SalomeApp_Application::orb()->object_to_string( theObj );
TCollection_AsciiString asciiIOR( (char *)IOR.in() );
GEOM_Client::get_client().RemoveShapeFromBuffer( asciiIOR );
SALOMEDSClient_StudyManager *aManager = SalomeApp_Application::studyMgr();
if (!aManager)
return;
_PTR(Study) aStudy = aManager->GetStudyByID(theObj->GetStudyID());
if ( !aStudy )
return;
_PTR(SObject) aSObj ( aStudy->FindObjectIOR( std::string( IOR ) ) );
if ( !aSObj )
return;
_PTR(ChildIterator) anIt ( aStudy->NewChildIterator( aSObj ) );
for ( anIt->InitEx( true ); anIt->More(); anIt->Next() ) {
_PTR(GenericAttribute) anAttr;
if ( anIt->Value()->FindAttribute(anAttr, "AttributeIOR") ) {
_PTR(AttributeIOR) anIOR ( anAttr );
TCollection_AsciiString asciiIOR( (char*)anIOR->Value().c_str() );
GEOM_Client::get_client().RemoveShapeFromBuffer( asciiIOR );
}
}
}
/*!
\brief Returns the object from IOR.
This is a static method. It returns the object from its IOR.
\param IOR object IOR
\return GEOM object.
*/
GEOM::GEOM_Object_ptr GeometryGUI::GetObjectFromIOR( const QString& IOR )
{
GEOM::GEOM_Object_var geomObj;
if ( !IOR.isEmpty() ) {
CORBA::Object_var corbaObj = SalomeApp_Application::orb()->string_to_object
( IOR.toLatin1().constData() );
if ( !CORBA::is_nil( corbaObj ) )
geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
}
return geomObj._retn();
}
/*!
\brief Returns IOR of the object.
This is a static method. It returns the object's IOR.
\param object the GEOM object.
\return object's IOR.
*/
QString GeometryGUI::GetIORFromObject( GEOM::GEOM_Object_ptr object )
{
QString IOR;
if ( !CORBA::is_nil( object ) ) {
CORBA::String_var anIOR =
SalomeApp_Application::orb()->object_to_string( object );
IOR = anIOR.in();
}
return IOR;
}
/*!
\brief Check if this object is can't be renamed in place

View File

@ -135,6 +135,14 @@ public:
QAction* getAction(const int id);
virtual void message( const QString& msg);
static void ClearShapeBuffer( GEOM::GEOM_Object_ptr );
static GEOM::GEOM_Object_ptr
GetObjectFromIOR( const QString& IOR );
static QString GetIORFromObject( GEOM::GEOM_Object_ptr object );
public slots:
virtual bool deactivateModule( SUIT_Study* );
virtual bool activateModule( SUIT_Study* );

View File

@ -53,6 +53,7 @@
#include <GEOMImpl_ShapeDriver.hxx>
#include <GEOMImpl_FillingDriver.hxx>
#include <GEOMImpl_ThruSectionsDriver.hxx>
#include <GEOMImpl_OffsetDriver.hxx>
#include <GEOMImpl_IBox.hxx>
#include <GEOMImpl_IFace.hxx>
@ -69,6 +70,7 @@
#include <GEOMImpl_IPipeDiffSect.hxx>
#include <GEOMImpl_IPipeShellSect.hxx>
#include <GEOMImpl_IPipeBiNormal.hxx>
#include <GEOMImpl_IOffset.hxx>
#include <GEOMImpl_IPipePath.hxx>
#include <Precision.hxx>
@ -2237,6 +2239,76 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Han
return aPipe;
}
//=============================================================================
/*!
* MakeThickening
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening(Handle(GEOM_Object) theObject,
double theOffset,
bool copy = true)
{
SetErrorCode(KO);
if (theObject.IsNull()) return NULL;
Handle(GEOM_Function) anOriginal = theObject->GetLastFunction();
if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be offset
//Add a new Offset function
Handle(GEOM_Function) aFunction;
Handle(GEOM_Object) aCopy;
if (copy)
{
//Add a new Copy object
aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_OffsetDriver::GetID(), OFFSET_THICKENING_COPY);
}
else
aFunction = theObject->AddFunction(GEOMImpl_OffsetDriver::GetID(), OFFSET_THICKENING);
if (aFunction.IsNull()) return NULL;
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_OffsetDriver::GetID()) return NULL;
GEOMImpl_IOffset aTI (aFunction);
aTI.SetShape(anOriginal);
aTI.SetValue(theOffset);
//Compute the offset
try {
#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Offset driver failed");
return NULL;
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
//Make a Python command
if(copy)
{
GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeThickSolid("
<< theObject << ", " << theOffset << ")";
SetErrorCode(OK);
return aCopy;
}
else
{
GEOM::TPythonDump(aFunction) << "geompy.Thicken("
<< theObject << ", " << theOffset << ")";
SetErrorCode(OK);
return theObject;
}
}
//=============================================================================
/*!
* RestorePath

View File

@ -68,7 +68,8 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
Standard_EXPORT Handle(GEOM_Object) MakePrismVecH (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theVec,
double theH, double theScaleFactor = -1.0);
double theH,
double theScaleFactor = -1.0);
Standard_EXPORT Handle(GEOM_Object) MakePrismVecH2Ways (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theVec, double theH);
@ -138,6 +139,10 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
Handle(GEOM_Object) thePath,
Handle(GEOM_Object) theVec);
Standard_EXPORT Handle(GEOM_Object) MakeThickening (Handle(GEOM_Object) theObject,
double theOffset,
bool isCopy);
Standard_EXPORT Handle(GEOM_Object) RestorePath (Handle(GEOM_Object) theShape,
Handle(GEOM_Object) theBase1,
Handle(GEOM_Object) theBase2);

View File

@ -80,6 +80,12 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::CreateGroup
{
SetErrorCode(KO);
if ( theShapeType != TopAbs_VERTEX && theShapeType != TopAbs_EDGE &&
theShapeType != TopAbs_FACE && theShapeType != TopAbs_SOLID ) {
SetErrorCode( "Error: You could create group only next type: vertex, edge, face or solid" );
return NULL;
}
Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1,1);
anArray->SetValue(1, -1);
@ -113,6 +119,11 @@ void GEOMImpl_IGroupOperations::AddObject(Handle(GEOM_Object) theGroup, int theS
SetErrorCode(KO);
if(theGroup.IsNull()) return;
if ( theGroup->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return;
}
Handle(GEOM_Function) aFunction = theGroup->GetLastFunction();
if(aFunction.IsNull()) return;
@ -129,6 +140,13 @@ void GEOMImpl_IGroupOperations::AddObject(Handle(GEOM_Object) theGroup, int theS
TopTools_IndexedMapOfShape aMapOfShapes;
TopExp::MapShapes(aMainShape, aMapOfShapes);
TopAbs_ShapeEnum aGroupType = GetType(theGroup);
TopAbs_ShapeEnum aShapeType = aMapOfShapes.FindKey(theSubShapeID).ShapeType();
if ( aGroupType != aShapeType ) {
SetErrorCode( "Error: You could perform this operation only with object the same type as the type of group." );
return;
}
if (theSubShapeID < 1 || aMapOfShapes.Extent() < theSubShapeID) {
SetErrorCode("Invalid sub-shape index: out of range");
return;
@ -184,6 +202,11 @@ void GEOMImpl_IGroupOperations::RemoveObject (Handle(GEOM_Object) theGroup, int
SetErrorCode(KO);
if(theGroup.IsNull()) return;
if ( theGroup->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return;
}
Handle(GEOM_Function) aFunction = theGroup->GetLastFunction();
if(aFunction.IsNull()) return;
@ -263,6 +286,11 @@ void GEOMImpl_IGroupOperations::UnionList (Handle(GEOM_Object) theGroup,
SetErrorCode(KO);
if (theGroup.IsNull()) return;
if ( theGroup->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return;
}
Standard_Integer aLen = theSubShapes->Length();
if (aLen < 1) {
//SetErrorCode("The list is empty");
@ -413,6 +441,11 @@ void GEOMImpl_IGroupOperations::DifferenceList (Handle(GEOM_Object) theGroup,
SetErrorCode(KO);
if (theGroup.IsNull()) return;
if ( theGroup->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return;
}
Standard_Integer aLen = theSubShapes->Length();
if (aLen < 1) {
//SetErrorCode("The list is empty");
@ -558,6 +591,11 @@ void GEOMImpl_IGroupOperations::UnionIDs (Handle(GEOM_Object) theGroup,
SetErrorCode(KO);
if (theGroup.IsNull()) return;
if ( theGroup->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return;
}
Standard_Integer aLen = theSubShapes->Length();
if (aLen < 1) {
//SetErrorCode("The list is empty");
@ -657,6 +695,11 @@ void GEOMImpl_IGroupOperations::DifferenceIDs (Handle(GEOM_Object) theGroup,
SetErrorCode(KO);
if (theGroup.IsNull()) return;
if ( theGroup->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return;
}
Standard_Integer aLen = theSubShapes->Length();
if (aLen < 1) {
//SetErrorCode("The list is empty");
@ -760,6 +803,11 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::UnionGroups (Handle(GEOM_Object)
SetErrorCode(KO);
if (theGroup1.IsNull() || theGroup2.IsNull()) return NULL;
if ( theGroup1->GetType() != GEOM_GROUP || theGroup2->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return NULL;
}
// Get group type
TopAbs_ShapeEnum aType1 = GetType(theGroup1);
TopAbs_ShapeEnum aType2 = GetType(theGroup2);
@ -866,6 +914,11 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::IntersectGroups (Handle(GEOM_Obje
SetErrorCode(KO);
if (theGroup1.IsNull() || theGroup2.IsNull()) return NULL;
if ( theGroup1->GetType() != GEOM_GROUP || theGroup2->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return NULL;
}
// Get group type
TopAbs_ShapeEnum aType1 = GetType(theGroup1);
TopAbs_ShapeEnum aType2 = GetType(theGroup2);
@ -972,6 +1025,11 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::CutGroups (Handle(GEOM_Object) th
SetErrorCode(KO);
if (theGroup1.IsNull() || theGroup2.IsNull()) return NULL;
if ( theGroup1->GetType() != GEOM_GROUP || theGroup2->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return NULL;
}
// Get group type
TopAbs_ShapeEnum aType1 = GetType(theGroup1);
TopAbs_ShapeEnum aType2 = GetType(theGroup2);
@ -1092,7 +1150,10 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::UnionListOfGroups
// Iterate on the initial groups
for (i = 1; i <= aLen; i++) {
Handle(GEOM_Object) aGr_i = Handle(GEOM_Object)::DownCast(theGList->Value(i));
if ( aGr_i->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return NULL;
}
// Get group type
aType_i = GetType(aGr_i);
if (i == 1)
@ -1204,7 +1265,10 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::IntersectListOfGroups
// Iterate on the initial groups
for (i = 1; i <= aLen; i++) {
Handle(GEOM_Object) aGr_i = Handle(GEOM_Object)::DownCast(theGList->Value(i));
if ( aGr_i->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return NULL;
}
// Get group type
aType_i = GetType(aGr_i);
if (i == 1)
@ -1342,7 +1406,10 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::CutListOfGroups
// 1. Collect indices to be excluded (from theGList2) into the mapIDs
for (i = 1; i <= aLen2; i++) {
Handle(GEOM_Object) aGr_i = Handle(GEOM_Object)::DownCast(theGList2->Value(i));
if ( aGr_i->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return NULL;
}
// Get group type
aType_i = GetType(aGr_i);
if (i == 1)
@ -1393,7 +1460,10 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::CutListOfGroups
// 2. Collect indices from theGList1, avoiding indices from theGList2 (mapIDs)
for (i = 1; i <= aLen1; i++) {
Handle(GEOM_Object) aGr_i = Handle(GEOM_Object)::DownCast(theGList1->Value(i));
if ( aGr_i->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return NULL;
}
// Get group type
aType_i = GetType(aGr_i);
if (i == 1 && aLen2 < 1)
@ -1513,7 +1583,10 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::GetMainShape (Handle(GEOM_Object)
SetErrorCode(KO);
if(theGroup.IsNull()) return NULL;
if ( theGroup->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return NULL;
}
Handle(GEOM_Function) aGroupFunction = theGroup->GetFunction(1);
if (aGroupFunction.IsNull()) return NULL;
@ -1543,7 +1616,10 @@ Handle(TColStd_HArray1OfInteger) GEOMImpl_IGroupOperations::GetObjects(Handle(GE
SetErrorCode(KO);
if(theGroup.IsNull()) return NULL;
if ( theGroup->GetType() != GEOM_GROUP ) {
SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
return NULL;
}
Handle(GEOM_Function) aFunction = theGroup->GetLastFunction();
if(aFunction.IsNull()) return NULL;

View File

@ -78,19 +78,19 @@ Standard_Integer GEOMImpl_OffsetDriver::Execute(TFunction_Logbook& log) const
TopoDS_Shape aShape;
if (aType == OFFSET_SHAPE || aType == OFFSET_SHAPE_COPY) {
Handle(GEOM_Function) aRefShape = aCI.GetShape();
TopoDS_Shape aShapeBase = aRefShape->GetValue();
Standard_Real anOffset = aCI.GetValue();
Standard_Real aTol = Precision::Confusion();
Handle(GEOM_Function) aRefShape = aCI.GetShape();
TopoDS_Shape aShapeBase = aRefShape->GetValue();
Standard_Real anOffset = aCI.GetValue();
Standard_Real aTol = Precision::Confusion();
if (Abs(anOffset) < aTol) {
if (Abs(anOffset) < aTol) {
TCollection_AsciiString aMsg ("Absolute value of offset can not be less than the tolerance value (");
aMsg += TCollection_AsciiString(aTol);
aMsg += ")";
StdFail_NotDone::Raise(aMsg.ToCString());
}
}
if (aType == OFFSET_SHAPE || aType == OFFSET_SHAPE_COPY) {
BRepOffsetAPI_MakeOffsetShape MO (aShapeBase,
aCI.GetValue(),
aTol);
@ -114,7 +114,17 @@ Standard_Integer GEOMImpl_OffsetDriver::Execute(TFunction_Logbook& log) const
else {
StdFail_NotDone::Raise("Offset construction failed");
}
} else {
}
else if (aType == OFFSET_THICKENING || aType == OFFSET_THICKENING_COPY)
{
BRepOffset_MakeOffset myOffsetShape(aShapeBase, anOffset, aTol, BRepOffset_Skin,
Standard_False, Standard_False, GeomAbs_Intersection, Standard_True);
if (!myOffsetShape.IsDone())
{
StdFail_NotDone::Raise("Thickening construction failed");
}
aShape = myOffsetShape.Shape();
}
if (aShape.IsNull()) return 0;

View File

@ -97,12 +97,6 @@
#include "utilities.h"
//////////////////////////////////////////////////////////////////////////
// Uncomment below macro to perform gluing in the end of MakePipe operation
// as fix of issue 0020207.
//////////////////////////////////////////////////////////////////////////
//#define GLUE_0020207
//=======================================================================
//function : GetID
@ -2483,23 +2477,22 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
}
// Glue (for bug 0020207)
// No gluing is needed as the bug 0020207 is fixed in OCCT.
#ifdef GLUE_0020207
TopExp_Explorer anExpV (aShape, TopAbs_VERTEX);
if (anExpV.More()) {
Standard_Real aVertMaxTol = -RealLast();
for (; anExpV.More(); anExpV.Next()) {
TopoDS_Vertex aVertex = TopoDS::Vertex(anExpV.Current());
Standard_Real aTol = BRep_Tool::Tolerance(aVertex);
if (aTol > aVertMaxTol)
aVertMaxTol = aTol;
if (aType != PIPE_BASE_PATH &&
aType != PIPE_SHELLS_WITHOUT_PATH) {
TopExp_Explorer anExpV (aShape, TopAbs_VERTEX);
if (anExpV.More()) {
Standard_Real aVertMaxTol = -RealLast();
for (; anExpV.More(); anExpV.Next()) {
TopoDS_Vertex aVertex = TopoDS::Vertex(anExpV.Current());
Standard_Real aTol = BRep_Tool::Tolerance(aVertex);
if (aTol > aVertMaxTol)
aVertMaxTol = aTol;
}
aVertMaxTol += Precision::Confusion();
aShape = GEOMImpl_GlueDriver::GlueFaces(aShape, aVertMaxTol, Standard_True);
//aShape = GEOMImpl_GlueDriver::GlueFaces(aShape, Precision::Confusion(), Standard_True);
}
aVertMaxTol += Precision::Confusion();
aShape = GEOMImpl_GlueDriver::GlueFaces(aShape, aVertMaxTol, Standard_True);
//aShape = GEOMImpl_GlueDriver::GlueFaces(aShape, Precision::Confusion(), Standard_True);
}
#endif
TopoDS_Shape aRes = GEOMUtils::CompsolidToCompound(aShape);
aFunction->SetValue(aRes);

View File

@ -102,6 +102,8 @@
#define GEOM_PIPE_PATH 48
#define GEOM_THICKENING 49
//GEOM_Function types
#define COPY_WITH_REF 1
@ -164,6 +166,8 @@
#define OFFSET_SHAPE 1
#define OFFSET_SHAPE_COPY 2
#define OFFSET_THICKENING 3
#define OFFSET_THICKENING_COPY 4
#define PROJECTION_COPY 1

View File

@ -60,8 +60,6 @@ public:
enum ActionType { SHOWDLG, INCR, DECR };
static void SetColor( const QString&, const QColor&, bool );
private:
// Import and export topology methods
bool Import();
@ -99,18 +97,6 @@ private:
_PTR(Study),
QList<SALOME_View*>,
GEOM_Displayer* );
static void setVtkColor( SalomeApp_Study* study,
int mgrId,
SVTK_View* view,
const Handle_SALOME_InteractiveObject& IO,
const QColor& color );
static void setOccColor( SalomeApp_Study* study,
int mgrId,
const Handle_AIS_InteractiveContext& ic,
const Handle_SALOME_InteractiveObject& IO,
const QColor& color );
};
#endif // GEOMTOOLSGUI_H

File diff suppressed because it is too large Load Diff

View File

@ -85,6 +85,11 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
// generic method to be put in a super class
void register_name(char * name);
// Get ORB object
CORBA::ORB_ptr GetORB() { return CORBA::ORB::_duplicate(_orb); }
// Get Naming Service object
SALOME_NamingService* GetNS() { return name_service; }
//-----------------------------------------------------------------------//
// Inherited methods from SALOMEDS::Driver //

View File

@ -30,6 +30,8 @@
#include "GEOM_Engine.hxx"
#include "GEOM_Object.hxx"
#define SUBSHAPE_ERROR "Sub shape cannot be transformed"
//=============================================================================
/*!
* constructor:
@ -1126,6 +1128,56 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
return GetObject(anObject);
}
//=============================================================================
/*!
* MakeThickening
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThickening
(GEOM::GEOM_Object_ptr theObject,
CORBA::Double theOffset,
CORBA::Boolean doCopy)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
if (CORBA::is_nil(theObject)) return aGEOMObject._retn();
//check if the object is a sub-shape
if (!theObject->IsMainShape() && !doCopy) {
GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
return aGEOMObject._retn();
}
if (!doCopy)
aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
//Get the basic object
Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
if (aBasicObject.IsNull()) return aGEOMObject._retn();
//Create the thickened shape
if (doCopy)
{
Handle(GEOM_Object) anObject = GetOperations()->MakeThickening(
aBasicObject, theOffset, doCopy);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
else
{
GetOperations()->MakeThickening(aBasicObject, theOffset, doCopy);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
}
//=============================================================================
/*!
* RestorePath

View File

@ -187,6 +187,10 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
GEOM::GEOM_Object_ptr thePath,
GEOM::GEOM_Object_ptr theVec);
GEOM::GEOM_Object_ptr MakeThickening (GEOM::GEOM_Object_ptr theObject,
CORBA::Double theOffset,
CORBA::Boolean isCopy);
GEOM::GEOM_Object_ptr RestorePath (GEOM::GEOM_Object_ptr theShape,
GEOM::GEOM_Object_ptr theBase1,
GEOM::GEOM_Object_ptr theBase2);

View File

@ -99,6 +99,9 @@ void GEOM_IGroupOperations_i::AddObject(GEOM::GEOM_Object_ptr theGroup, CORBA::L
if (aGroupRef.IsNull()) return;
GetOperations()->AddObject(aGroupRef, theSubShapeId);
// Update GUI.
UpdateGUIForObject(theGroup);
}
//=============================================================================
@ -116,6 +119,9 @@ void GEOM_IGroupOperations_i::RemoveObject(GEOM::GEOM_Object_ptr theGroup, CORBA
if (aGroupRef.IsNull()) return;
GetOperations()->RemoveObject(aGroupRef, theSubShapeId);
// Update GUI.
UpdateGUIForObject(theGroup);
}
//=============================================================================

View File

@ -23,6 +23,8 @@
#include "GEOM_IOperations_i.hh"
#include "GEOM_Engine.hxx"
#include "GEOM_Gen_i.hh"
#include <SALOME_NamingService.hxx>
#include "utilities.h"
#include "OpUtil.hxx"
@ -32,6 +34,8 @@
#include <TCollection_AsciiString.hxx>
#include <TDF_Tool.hxx>
#include CORBA_SERVER_HEADER(SALOME_Session)
//=============================================================================
/*!
* default constructor:
@ -155,3 +159,32 @@ Handle(GEOM_Object) GEOM_IOperations_i::GetObjectImpl(GEOM::GEOM_Object_ptr theO
}
return anImpl;
}
//=============================================================================
/*!
* UpdateGUIForObject
*/
//=============================================================================
void GEOM_IOperations_i::UpdateGUIForObject(GEOM::GEOM_Object_ptr theObj)
{
if (!CORBA::is_nil (theObj)) {
// Cast _engine to GEOM_Gen_i type.
PortableServer::Servant aServant = myPOA->reference_to_servant(_engine.in());
GEOM_Gen_i *anEngine = dynamic_cast<GEOM_Gen_i *>(aServant);
if (anEngine) {
SALOME_NamingService *aNameService = anEngine->GetNS();
CORBA::Object_var aSessionObj = aNameService->Resolve("/Kernel/Session");
SALOME::Session_var aSession = SALOME::Session::_narrow(aSessionObj);
if (!aSession->_is_nil())
{
std::string aMsg("GEOM/modified/");
CORBA::String_var anIOR = anEngine->GetORB()->object_to_string(theObj);
aMsg += anIOR.in();
aSession->emitMessageOneWay(aMsg.c_str());
}
}
}
}

View File

@ -59,6 +59,8 @@ class GEOM_I_EXPORT GEOM_IOperations_i : public virtual POA_GEOM::GEOM_IOperatio
::GEOM_IOperations* GetImpl() { return _impl; }
virtual void UpdateGUIForObject(GEOM::GEOM_Object_ptr theObj);
private:
::GEOM_IOperations* _impl;

View File

@ -100,6 +100,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints
//Perform the translation
GetOperations()->TranslateTwoPoints(anObject, aPoint1, aPoint2);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -169,6 +172,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ
//Perform the translation
GetOperations()->TranslateDXDYDZ(anObject, theDX, theDY, theDZ);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -233,6 +239,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector
//Perform the translation
GetOperations()->TranslateVector(anObject, aVector);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -310,6 +319,10 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance
}
GetOperations()->TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -347,6 +360,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr
//Perform the rotation
GetOperations()->Rotate(anObject, anAxis, theAngle);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -413,6 +429,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane
//Perform the mirror
GetOperations()->MirrorPlane(anObject, aPlane);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -479,6 +498,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis
//Perform the mirror
GetOperations()->MirrorAxis(anObject, aAxis);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -545,6 +567,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint
//Perform the mirror
GetOperations()->MirrorPoint(anObject, aPoint);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -607,6 +632,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape
//Create the offset shape
GetOperations()->OffsetShape(aBasicObject, theOffset);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -700,6 +728,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape
//Perform the scale
GetOperations()->ScaleShape(anObject, aPoint, theFactor);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -778,6 +809,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes
GetOperations()->ScaleShapeAlongAxes
(anObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/false);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -860,6 +894,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape
//Perform the Position
GetOperations()->PositionShape(anObject, aStartLCS, aEndLCS);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}
@ -933,6 +970,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionAlongPath
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
if (!theCopy) {
// Update GUI.
UpdateGUIForObject(theObject);
}
return GetObject(anObject);
}
@ -1209,6 +1251,9 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePoints
//Perform the translation
GetOperations()->RotateThreePoints(anObject, aCentPoint, aPoint1, aPoint2);
// Update GUI.
UpdateGUIForObject(theObject);
return aGEOMObject._retn();
}

View File

@ -3715,6 +3715,61 @@ class geompyDC(GEOM._objref_GEOM_Gen):
self._autoPublish(anObj, theName, "pipe")
return anObj
## Makes a thick solid from a face or a shell
# @param theShape Face or Shell to be thicken
# @param theThickness Thickness of the resulting solid
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @return New GEOM.GEOM_Object, containing the created solid
#
def MakeThickSolid(self, theShape, theThickness, theName=None):
"""
Make a thick solid from a face or a shell
Parameters:
theShape Face or Shell to be thicken
theThickness Thickness of the resulting solid
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
Returns:
New GEOM.GEOM_Object, containing the created solid
"""
# Example: see GEOM_TestAll.py
anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
RaiseIfFailed("MakeThickening", self.PrimOp)
self._autoPublish(anObj, theName, "pipe")
return anObj
## Modifies a face or a shell to make it a thick solid
# @param theShape Face or Shell to be thicken
# @param theThickness Thickness of the resulting solid
#
# @return The modified shape
#
def Thicken(self, theShape, theThickness):
"""
Modifies a face or a shell to make it a thick solid
Parameters:
theBase Base shape to be extruded.
thePath Path shape to extrude the base shape along it.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
Returns:
The modified shape
"""
# Example: see GEOM_TestAll.py
anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
RaiseIfFailed("MakeThickening", 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

View File

@ -45,8 +45,8 @@ class Sketcher3D:
sk = geompy.Sketcher3D()
sk.addPointsAbsolute(0,0,0, 70,0,0)
sk.addPointsRelative(0, 0, 130)
sk.addPointAnglesLength("OXY", 50, 0, 100)
sk.addPointAnglesLength("OXZ", 30, 80, 130)
sk.addPointRadiusAnglesRelative(50, 0, 100, 'OXY')
sk.addPointRadiusAnglesRelative(30, 80, 130, 'OXZ')
sk.close()
a3D_Sketcher_1 = sk.wire()
"""

View File

@ -110,11 +110,18 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg (GeometryGUI* theGeometryGUI, QWi
GroupDXDYDZ->CheckBox1->setText(tr("GEOM_BOTHWAY"));
GroupDXDYDZ->CheckBox2->setText(tr("GEOM_SCALE_PRISM"));
GroupThickening = new DlgRef_1Check1Spin1Check(centralWidget());
GroupThickening->GroupBox1->setTitle("Thickening");
GroupThickening->checkButton1->setText("Add thickness (edges or wires only)");
GroupThickening->checkButton2->setText("Thicken towards outside");
GroupThickening->TextLabel1->setText("Thickness");
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
layout->setMargin(0); layout->setSpacing(6);
layout->addWidget(GroupVecH);
layout->addWidget(Group2Points);
layout->addWidget(GroupDXDYDZ);
layout->addWidget(GroupThickening);
/***************************************************************/
setHelpFileName("create_extrusion_page.html");
@ -146,6 +153,9 @@ void GenerationGUI_PrismDlg::Init()
double aScaleStep = 0.5;
double aScaleMin = Precision::Confusion() * 10.0;
double aThickness = 10;
double aThicknessMin = Precision::Confusion() * 10.0;
initSpinBox(GroupVecH->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision" );
GroupVecH->SpinBox_DX->setValue(100.0);
@ -164,6 +174,9 @@ void GenerationGUI_PrismDlg::Init()
Group2Points->SpinBox1->setValue(aScaleFactor);
GroupDXDYDZ->SpinBox_SC->setValue(aScaleFactor);
initSpinBox(GroupThickening->SpinBox_DX, aThicknessMin, COORD_MAX, step, "length_precision" );
GroupThickening->SpinBox_DX->setValue(aThickness);
// hide not used controls
Group2Points->TextLabel5->hide();
Group2Points->TextLabel6->hide();
@ -191,6 +204,19 @@ void GenerationGUI_PrismDlg::Init()
GroupDXDYDZ->LineEdit1->setText("");
GroupThickening->SpinBox_DX->hide();
GroupThickening->checkButton2->hide();
GroupThickening->TextLabel1->hide();
GroupVecH->TextLabel4->hide();
GroupVecH->SpinBox_DY->hide();
Group2Points->TextLabel4->hide();
Group2Points->SpinBox1->hide();
GroupDXDYDZ->TextLabel5->hide();
GroupDXDYDZ->SpinBox_SC->hide();
myBaseObjects.clear();
myPoint1.nullify();
myPoint2.nullify();
@ -212,14 +238,14 @@ void GenerationGUI_PrismDlg::Init()
connect(GroupVecH->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(GroupVecH->CheckBox2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
connect(GroupVecH->CheckBox3, SIGNAL(toggled(bool)), this, SLOT(onScalePrism()));
connect(GroupVecH->CheckBox3, SIGNAL(toggled(bool)), this, SLOT(onScalePrism(bool)));
connect(GroupVecH->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(Group2Points->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group2Points->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group2Points->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group2Points->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(Group2Points->CheckBox2, SIGNAL(toggled(bool)), this, SLOT(onScalePrism()));
connect(Group2Points->CheckBox2, SIGNAL(toggled(bool)), this, SLOT(onScalePrism(bool)));
connect(Group2Points->SpinBox1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDXDYDZ->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
@ -228,7 +254,11 @@ void GenerationGUI_PrismDlg::Init()
connect(GroupDXDYDZ->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDXDYDZ->SpinBox_SC, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDXDYDZ->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(GroupDXDYDZ->CheckBox2, SIGNAL(toggled(bool)), this, SLOT(onScalePrism()));
connect(GroupDXDYDZ->CheckBox2, SIGNAL(toggled(bool)), this, SLOT(onScalePrism(bool)));
connect(GroupThickening->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupThickening->checkButton1, SIGNAL(toggled(bool)), this, SLOT(onAddThickening(bool)));
connect(GroupThickening->checkButton2, SIGNAL(toggled(bool)), this, SLOT(onChangeDirection(bool)));
initName(tr("GEOM_EXTRUSION"));
@ -335,11 +365,19 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
myEditCurrentArgument == Group2Points->LineEdit1 ||
myEditCurrentArgument == GroupDXDYDZ->LineEdit1 ) {
myBaseObjects.clear();
GroupThickening->checkButton1->setEnabled(true);
QList<GEOM::GeomObjPtr> objects = getSelected( TopAbs_SHAPE, -1 );
for ( int i = 0; i < objects.count(); i++ ) {
GEOM::shape_type stype = objects[i]->GetMaxShapeType();
if ( stype < GEOM::SHELL || stype > GEOM::VERTEX )
continue;
if ( stype > GEOM::EDGE || stype < GEOM::WIRE )
{
GroupThickening->checkButton1->setChecked(false);
GroupThickening->checkButton1->setEnabled(false);
}
myBaseObjects << objects[i];
}
if ( !myBaseObjects.isEmpty() ) {
@ -561,17 +599,50 @@ void GenerationGUI_PrismDlg::onBothway()
// function : onScalePrism()
// purpose :
//=================================================================================
void GenerationGUI_PrismDlg::onScalePrism()
void GenerationGUI_PrismDlg::onScalePrism(bool isChecked)
{
GroupVecH->TextLabel4->setEnabled(GroupVecH->CheckBox3->isChecked());
GroupVecH->SpinBox_DY->setEnabled(GroupVecH->CheckBox3->isChecked());
GroupVecH->TextLabel4->setVisible(isChecked);
GroupVecH->SpinBox_DY->setVisible(isChecked);
Group2Points->TextLabel4->setEnabled(Group2Points->CheckBox2->isChecked());
Group2Points->SpinBox1->setEnabled(Group2Points->CheckBox2->isChecked());
Group2Points->TextLabel4->setVisible(isChecked);
Group2Points->SpinBox1->setVisible(isChecked);
GroupDXDYDZ->TextLabel5->setEnabled(GroupDXDYDZ->CheckBox2->isChecked());
GroupDXDYDZ->SpinBox_SC->setEnabled(GroupDXDYDZ->CheckBox2->isChecked());
GroupDXDYDZ->TextLabel5->setVisible(isChecked);
GroupDXDYDZ->SpinBox_SC->setVisible(isChecked);
GroupVecH->TextLabel4->setEnabled(isChecked);
GroupVecH->SpinBox_DY->setEnabled(isChecked);
Group2Points->TextLabel4->setEnabled(isChecked);
Group2Points->SpinBox1->setEnabled(isChecked);
GroupDXDYDZ->TextLabel5->setEnabled(isChecked);
GroupDXDYDZ->SpinBox_SC->setEnabled(isChecked);
processPreview();
}
//=================================================================================
// function : onAddThickening(bool)
// purpose :
//=================================================================================
void GenerationGUI_PrismDlg::onAddThickening(bool isChecked)
{
GroupThickening->SpinBox_DX->setVisible(isChecked);
GroupThickening->checkButton2->setVisible(isChecked);
GroupThickening->TextLabel1->setVisible(isChecked);
updateGeometry();
resize(minimumSizeHint());
processPreview();
}
//=================================================================================
// function : onChangeDirection(bool)
// purpose :
//=================================================================================
void GenerationGUI_PrismDlg::onChangeDirection(bool isChecked)
{
processPreview();
}
@ -585,6 +656,7 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
GEOM::GEOM_Object_var anObj;
GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
GEOM::GEOM_I3DPrimOperations_var anotherOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
for (int i = 0; i < myBaseObjects.count(); i++) {
switch (getConstructorId()) {
@ -642,6 +714,18 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
break;
}
if(GroupThickening->checkButton1->isChecked())
{
double aThickness = 0.0;
if(GroupThickening->checkButton2->isChecked() ^ GroupVecH->CheckBox2->isChecked()) // if "towards outside" XOR "reversed" is checked
aThickness = -1.0*(GroupThickening->SpinBox_DX->value()); // change the offset sign to negative
else
aThickness = GroupThickening->SpinBox_DX->value();
anObj = anotherOper->MakeThickening(anObj, aThickness, /*copy=*/false);
}
if (!anObj->_is_nil())
objects.push_back(anObj._retn());
}

View File

@ -33,6 +33,7 @@
class DlgRef_2Sel1Spin3Check1Spin;
class DlgRef_3Sel2Check3Spin;
class DlgRef_1Sel3Spin2Check1Spin;
class DlgRef_1Check1Spin1Check;
//=================================================================================
// class : GenerationGUI_PrismDlg
@ -66,6 +67,7 @@ private:
DlgRef_2Sel1Spin3Check1Spin* GroupVecH;
DlgRef_3Sel2Check3Spin* Group2Points;
DlgRef_1Sel3Spin2Check1Spin* GroupDXDYDZ;
DlgRef_1Check1Spin1Check* GroupThickening;
private slots:
void ClickOnOk();
@ -78,7 +80,9 @@ private slots:
void SetDoubleSpinBoxStep( double );
void onReverse();
void onBothway();
void onScalePrism();
void onScalePrism(bool);
void onAddThickening( bool );
void onChangeDirection( bool );
};
#endif // GENERATIONGUI_PRISMDLG_H

View File

@ -36,6 +36,7 @@
#include <SUIT_ViewWindow.h>
#include <SUIT_ViewManager.h>
#include <SUIT_OverrideCursor.h>
#include <SUIT_MessageBox.h>
#include <SOCC_Prs.h>
#include <SOCC_ViewModel.h>
#include <SalomeApp_Tools.h>
@ -433,9 +434,37 @@ bool MeasureGUI_DistanceDlg::execute (ObjectList& objects)
int nbSols = anOper->ClosestPoints(myObj1, myObj2, aDbls);
if (anOper->IsDone()) {
for (int i = 0; i < nbSols; i++) {
GEOM::GEOM_Object_var anObj1 = aBasicOper->MakePointXYZ(aDbls[i*6 + 0], aDbls[i*6 + 1], aDbls[i*6 + 2]);
GEOM::GEOM_Object_var anObj2 = aBasicOper->MakePointXYZ(aDbls[i*6 + 3], aDbls[i*6 + 4], aDbls[i*6 + 5]);
bool doPublishAll = true;
if (nbSols > 1) {
QMessageBox::StandardButton anAnswer =
SUIT_MessageBox::question(this, tr("GEOM_MINDIST_PUBLISH_TITLE"),
tr("GEOM_MINDIST_PUBLISH_TEXT"),
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
QMessageBox::No);
if (anAnswer == QMessageBox::No)
doPublishAll = false;
else if (anAnswer != QMessageBox::Yes)
return true;
}
if (doPublishAll) {
for (int i = 0; i < nbSols; i++) {
GEOM::GEOM_Object_var anObj1 =
aBasicOper->MakePointXYZ(aDbls[i*6 + 0], aDbls[i*6 + 1], aDbls[i*6 + 2]);
GEOM::GEOM_Object_var anObj2 =
aBasicOper->MakePointXYZ(aDbls[i*6 + 3], aDbls[i*6 + 4], aDbls[i*6 + 5]);
if (!anObj1->_is_nil() && !anObj2->_is_nil()) {
objects.push_back(anObj1._retn());
objects.push_back(anObj2._retn());
}
}
}
else {
int i = myGrp->ComboBox1->currentIndex();
GEOM::GEOM_Object_var anObj1 =
aBasicOper->MakePointXYZ(aDbls[i*6 + 0], aDbls[i*6 + 1], aDbls[i*6 + 2]);
GEOM::GEOM_Object_var anObj2 =
aBasicOper->MakePointXYZ(aDbls[i*6 + 3], aDbls[i*6 + 4], aDbls[i*6 + 5]);
if (!anObj1->_is_nil() && !anObj2->_is_nil()) {
objects.push_back(anObj1._retn());