From 44f9ad210fa4ea6548b4a71ca3b62f747de0104e Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 18 Oct 2012 13:04:45 +0000 Subject: [PATCH] Mantis issue 0021565: [CEA 557] Opposite of the pipe --- doc/salome/gui/GEOM/images/pipe_path.png | Bin 0 -> 9274 bytes doc/salome/gui/GEOM/images/pipe_path_dlg.png | Bin 0 -> 24830 bytes .../gui/GEOM/input/creating_complex_obj.doc | 2 +- .../gui/GEOM/input/creating_pipe_path.doc | 44 ++ .../gui/GEOM/input/tui_complex_objs.doc | 87 +++- idl/GEOM_Gen.idl | 51 ++- src/GEOMGUI/GEOM_images.ts | 8 + src/GEOMGUI/GEOM_msg_en.ts | 32 ++ src/GEOMGUI/GeometryGUI.cxx | 266 ++++++------ src/GEOMGUI/GeometryGUI_Operations.h | 1 + src/GEOMImpl/GEOMImpl_Gen.cxx | 3 +- src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx | 174 +++++++- src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx | 14 +- src/GEOMImpl/GEOMImpl_IPipePath.hxx | 61 +++ src/GEOMImpl/GEOMImpl_PipeDriver.cxx | 29 +- src/GEOMImpl/GEOMImpl_PipePathDriver.cxx | 242 +++++++++++ src/GEOMImpl/GEOMImpl_PipePathDriver.hxx | 167 ++++++++ src/GEOMImpl/GEOMImpl_ShapeDriver.cxx | 123 +++--- src/GEOMImpl/GEOMImpl_ShapeDriver.hxx | 12 +- src/GEOMImpl/GEOMImpl_Types.hxx | 6 + src/GEOMImpl/Makefile.am | 3 + src/GEOM_I/GEOM_I3DPrimOperations_i.cc | 80 +++- src/GEOM_I/GEOM_I3DPrimOperations_i.hh | 8 +- src/GEOM_SWIG/geompyDC.py | 70 ++++ src/GenerationGUI/GenerationGUI.cxx | 5 +- .../GenerationGUI_PipePathDlg.cxx | 392 ++++++++++++++++++ src/GenerationGUI/GenerationGUI_PipePathDlg.h | 72 ++++ src/GenerationGUI/Makefile.am | 13 +- 28 files changed, 1717 insertions(+), 248 deletions(-) create mode 100644 doc/salome/gui/GEOM/images/pipe_path.png create mode 100644 doc/salome/gui/GEOM/images/pipe_path_dlg.png create mode 100644 doc/salome/gui/GEOM/input/creating_pipe_path.doc create mode 100644 src/GEOMImpl/GEOMImpl_IPipePath.hxx create mode 100644 src/GEOMImpl/GEOMImpl_PipePathDriver.cxx create mode 100644 src/GEOMImpl/GEOMImpl_PipePathDriver.hxx create mode 100644 src/GenerationGUI/GenerationGUI_PipePathDlg.cxx create mode 100644 src/GenerationGUI/GenerationGUI_PipePathDlg.h diff --git a/doc/salome/gui/GEOM/images/pipe_path.png b/doc/salome/gui/GEOM/images/pipe_path.png new file mode 100644 index 0000000000000000000000000000000000000000..92d5d626ae8c928f2e1152d04f392a910a72a99f GIT binary patch literal 9274 zcmbVSc|4R~)F*@@l9D|niIQxIG4>_PB#NO%7^IT5tTSjqDNObyl#m)mqoSCZq8R%= zLX2%}V`pZ}nBjf;z5l*{y?;EP=YH;U@44rm`#s<1oO|!HD-Kq|2c!;gad8RTSeswv z;^JlkPqDy0pyt%IXD@)4V30L5l#A=ouYV7BrrIHCF0KiGCBHirm1KYZoS594!M@qc8))Ed=glPhjbEX4->w7${( zVE?gWdPkZ&j@~>16^73qA6Q=ePTQ;~FO(yY17DYlTVTA$ZMeA z*q_(k+;a??TEG^M%<`K?ZHuMRh>t&Uc$|4@;5PXS|p`r6m?Y)kmtc&Ed4+_*z`L(Y@bxHN?vmm=wxmZq}*R=ISK*@(x z$wLp%6U?f9MVV0{wagP8~RQ1gdR@~41StA#x_@=YC;0r(pU2>HIips zmRO&r>>b6ia^9E2D~+n(m1f2?s)6~y2eERH`H_;75`B-|#-uzeHuPd6Rk!&+=_Xsb zJvpnx2A`prC5(jp5Ca@J{078O>W+4ZAcTt zFzqtB^@TXsc3TSyzPj9VuCiai1XBy?DubXH_gpuV@AHVWp>SNV*w=`U7IK1jPT>o( zl(?aR(9Pm<;;PSsIIXKH>#EykaGZUow6JQb{h(M;od~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id#Cs z^Yon`XF;W0)Kp+ktdab54Oyk~gazo(VcWs#hd4|!%(jO_8@m(MvK82#T`Et@a_C(2 zcbLvXo1E0CtDQQW&*W| z7*gU@^|gJkWLfHiwFJ&G1kBk=hZr#{`xit^Bfw8Q1SZuK*ntAzLz97K+v!xDCu`;9 z{YAk-LH90FL=OJP+Kn@D+$XYyit=Bxru!GD3hc`Q9)gp$3NgnTW1p<)Ovx!cdCE85 zTkgj_bL}KG5g&DlV<7+>eM^{acZ(v^f3^HL&uEP*E|>!D#N1wi0yki|PN$&xxps(A hT-B-n|H7`k+aW1#8=pJPz-1sV8w&^XD$`q!{s-GzELi{m literal 0 HcmV?d00001 diff --git a/doc/salome/gui/GEOM/images/pipe_path_dlg.png b/doc/salome/gui/GEOM/images/pipe_path_dlg.png new file mode 100644 index 0000000000000000000000000000000000000000..e2f969d8c56f9707f73cc59ceb4cfdf57748aa65 GIT binary patch literal 24830 zcmb@t1yCH_x-L91m=H8*a0_n1o#5{7!QI^xf&@)~0Ko!;;1=8=xVw9BcZUJ~#rK_E z=j^@Du6u9QPYp%WJ<_v!_4_`yLKNi0kq~eZAP@+Wq=bkP1o9{j{MJApgFU400!hK2 z=k^ksP7nxk+r#gpSXyK}u#?tVRKr=s#L39f!rs}!&K9C>VQXyXMl5V?;N-+jtmsVd zS4!7~*FO@_Sj+B{e9Cbi+viNLAtVl{=_ab#@U!VDK@ zjf#p&QALN6ry?(6UsIt1fyp+PH}&KzhNF7?D#eP8TA%91rA5Sf}dBV(&t_{DeT7k`Z%beMVIwam$V=H#o}pmFtD z8U5PN4CSS?ad6{JUB9O)X%|%aNPzsARU8?4Ja~*!8$OONqvpsbXNWky>sPAJd?sEB z$I`)q@RF@-Hz}%OeeY39nb)9R)D-JVap}jBRBo=BTMvi*-Fx2%)Z-I_&#$HzN0O(< z$omI;?q1OYp zU*z7$uSR74r0_gR@+q6vwjDo}9MTn{)is>9dRD~JMRZXl`S};n(9rid*JB3*%@|h? zY4BX?ZSI!LQ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i zr^UN+#zIdHj5a}Ez}~?=F3&L6%INj#=fV>m@`@^X)17f)=WleM=vR#2`s6N2oAjhE zP~<+>aE2?@&6lY$?nM>zkZ~JWrQpQ|zZCJ_-Esk`lT`V@(3iD|fkVr;D!8R~tn=qLRX zgs%aS8W+z{qy>;A>mGT3{H7QMeaq74_Wm}jbT+c%cf45Z=wv-$<2Mgs{_oG~Zc`f_ zH2Rc$IO_iQx9VDRauA5QAIn|(U4y(-h_>~oHHd)Pf8*eWdl)@RdE?y%8R8em)QcKx z_sb#Ddq)sN8Vui&|N9kw6gF?ch)~qw{|NZ6XYS)1vfvz}{(80Dn3`AP*nz$ih=9B1 qmuA)P)J6PSfRX(HgLe`ecl~RoiI!3)F2Ia61VTj#qnL{}5BdjRk!S7z literal 0 HcmV?d00001 diff --git a/doc/salome/gui/GEOM/input/creating_complex_obj.doc b/doc/salome/gui/GEOM/input/creating_complex_obj.doc index 0d0404336..46c4baa90 100644 --- a/doc/salome/gui/GEOM/input/creating_complex_obj.doc +++ b/doc/salome/gui/GEOM/input/creating_complex_obj.doc @@ -14,7 +14,7 @@ axis, creating a body of revolution.
  • \subpage create_filling_page "Create a surface" from a set of edges.
  • \subpage create_extrusion_alongpath_page "Extrude an object along a path", creating a more complex trajectory object.
  • - +
  • \subpage create_pipe_path_page "Restore Path" of a pipe-like shape.
  • */ diff --git a/doc/salome/gui/GEOM/input/creating_pipe_path.doc b/doc/salome/gui/GEOM/input/creating_pipe_path.doc new file mode 100644 index 000000000..abf97b5ec --- /dev/null +++ b/doc/salome/gui/GEOM/input/creating_pipe_path.doc @@ -0,0 +1,44 @@ +/*! + +\page create_pipe_path_page Restore Path + +To generate a \b Path in the Main Menu select New Entity - > Generation - > Restore Path + +\image html pipe_path_dlg.png + +\n To obtain a \b Path of a pipe-like shape, you should define the +Pipe-like shell or solid and two pipe \b Bases, each of them can +be set as a wire, a face or a list of edges.
    +\n Select unpublished edges checkbox - if checked, allows +selection of edges in the viewer, that are not published in the Object +Browser.
    +\n The \b Result of the operation will be a GEOM_Object (edge or wire).
    + +\n Advanced options: +
      +
    • \ref preview_anchor "Preview"
    • +

    + +\note It is not assumed that exact or approximate copy of the Shape + can be obtained by applying existing Pipe operation on the + resulting "Path" wire taking the first Base 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.
    + +\n Example: + +\image html pipe_path.png "Path (red) between two faces (green)" + +\n TUI Command: geompy.RestorePath(aShape, aBase1, aBase2) +\n Arguments: 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 TUI Command: geompy.RestorePathEdges(aShape, listEdges1, listEdges2) +\n Arguments: 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 TUI Scripts provide you with useful examples of creation of +\ref tui_creation_pipe_path "Complex Geometric Objects". + +*/ diff --git a/doc/salome/gui/GEOM/input/tui_complex_objs.doc b/doc/salome/gui/GEOM/input/tui_complex_objs.doc index 7dcf151c1..2cdcf156a 100644 --- a/doc/salome/gui/GEOM/input/tui_complex_objs.doc +++ b/doc/salome/gui/GEOM/input/tui_complex_objs.doc @@ -623,31 +623,78 @@ from math import pi spring = MakeSpring(50, 100, 2*pi, 1, 5, pi/2) \endcode -

    Creation of Tangent Plane On Face

    + +\anchor tui_creation_pipe_path +

    Creation of a Middle Path

    + \code import salome import geompy - # Create Vertexes for curve - Vertex_1 = geompy.MakeVertex(0, 0, 0) - Vertex_2 = geompy.MakeVertex(0, 90, 30) - Vertex_3 = geompy.MakeVertex(100, 90, 0) - Vertex_4 = geompy.MakeVertex(-100, 90, 0) - # Create curve - Curve_1 = geompy.MakeInterpol([Vertex_4, Vertex_2, Vertex_3, Vertex_1]) - # Create Face by Extrusion of the Curve - Extrusion_1 = geompy.MakePrismDXDYDZ(Curve_1, 0, 30, -60) - # Make Tangent on this Extrusion (Face) - Tangent_1 = geompy.MakeTangentPlaneOnFace(Extrusion_1, 0.7, 0.5, 150) - # Publish in the study - geompy.addToStudy( Vertex_1, "Vertex_1" ) - geompy.addToStudy( Vertex_2, "Vertex_2" ) - geompy.addToStudy( Vertex_3, "Vertex_3" ) - geompy.addToStudy( Vertex_4, "Vertex_4" ) - geompy.addToStudy( Curve_1, "Curve_1" ) - geompy.addToStudy( Extrusion_1, "Extrusion_1" ) - geompy.addToStudy( Tangent_1, "Tangent_1" ) +# 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 +

    Creation of Tangent Plane On Face

    +\code +import salome +import geompy + +# Create Vertexes for curve +Vertex_1 = geompy.MakeVertex(0, 0, 0) +Vertex_2 = geompy.MakeVertex(0, 90, 30) +Vertex_3 = geompy.MakeVertex(100, 90, 0) +Vertex_4 = geompy.MakeVertex(-100, 90, 0) +# Create curve +Curve_1 = geompy.MakeInterpol([Vertex_4, Vertex_2, Vertex_3, Vertex_1]) +# Create Face by Extrusion of the Curve +Extrusion_1 = geompy.MakePrismDXDYDZ(Curve_1, 0, 30, -60) +# Make Tangent on this Extrusion (Face) +Tangent_1 = geompy.MakeTangentPlaneOnFace(Extrusion_1, 0.7, 0.5, 150) +# Publish in the study +geompy.addToStudy( Vertex_1, "Vertex_1" ) +geompy.addToStudy( Vertex_2, "Vertex_2" ) +geompy.addToStudy( Vertex_3, "Vertex_3" ) +geompy.addToStudy( Vertex_4, "Vertex_4" ) +geompy.addToStudy( Curve_1, "Curve_1" ) +geompy.addToStudy( Extrusion_1, "Extrusion_1" ) +geompy.addToStudy( Tangent_1, "Tangent_1" ) +\endcode */ diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 8f90021eb..9c6896aad 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -715,6 +715,11 @@ module GEOM in double theTrimSize); }; + /*! + * \brief Interface for shapes transforming. + * + * Translation, rotation, scaling, mirroring, offset, projection, recomputing. + */ interface GEOM_ITransformOperations : GEOM_IOperations { /*! @@ -1077,7 +1082,8 @@ module GEOM * \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 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. */ GEOM_Object PositionAlongPath (in GEOM_Object theObject, @@ -1105,7 +1111,6 @@ module GEOM GEOM_Object RecomputeObject (in GEOM_Object theObject); }; - // # GEOM_I3DPrimOperations: /*! * \brief Interface for 3D primitives creation * @@ -1485,9 +1490,49 @@ module GEOM in GEOM_Object thePath, 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: * diff --git a/src/GEOMGUI/GEOM_images.ts b/src/GEOMGUI/GEOM_images.ts index 96b164f7b..9cd7e615e 100644 --- a/src/GEOMGUI/GEOM_images.ts +++ b/src/GEOMGUI/GEOM_images.ts @@ -363,6 +363,10 @@ ICON_DLG_PARTITION_PLANE partitionplane.png + + ICON_DLG_PIPE_PATH + pipe.png + ICON_DLG_PIPE pipe.png @@ -995,6 +999,10 @@ ICO_PIPE pipe.png + + ICO_PIPE_PATH + pipe.png + ICO_PLANE plane.png diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 19b71ca9e..20c80d6b6 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -1278,6 +1278,26 @@ Please, select face, shell or solid and try again GEOM_PIPE_TITLE Pipe Construction + + GEOM_PIPE_PATH + Path + + + GEOM_PIPE_PATH_TITLE + Restore Path + + + GEOM_PIPE_LIKE_SHAPE + Pipe-like shell or solid + + + GEOM_PIPE_BASE1_OBJECT + First base face/wire/edges + + + GEOM_PIPE_BASE2_OBJECT + Last base face/wire/edges + GEOM_PROFILE Profile @@ -2714,6 +2734,10 @@ Please, select face, shell or solid and try again MEN_PIPE Extrusion Along Path + + MEN_PIPE_PATH + Restore Path + MEN_PLANE Plane @@ -3494,6 +3518,10 @@ Please, select face, shell or solid and try again STB_PIPE Create a shape by extrusion along a path + + STB_PIPE_PATH + Restore path from a pipe-like shape + STB_PLANE Create a plane @@ -4114,6 +4142,10 @@ Please, select face, shell or solid and try again TOP_PIPE Extrusion along path + + TOP_PIPE_PATH + Restore path + TOP_PLANE Create a plane diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index cfb646deb..d13a0fd99 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -107,7 +107,6 @@ #include - #include "GEOMImpl_Types.hxx" extern "C" { @@ -135,7 +134,7 @@ GEOM::GEOM_Gen_var GeometryGUI::GetGeomGen() bool GeometryGUI::InitGeomGen() { GeometryGUI aGG; - if( CORBA::is_nil( myComponentGeom ) ) return false; + if ( CORBA::is_nil( myComponentGeom ) ) return false; return true; } @@ -173,12 +172,12 @@ SALOMEDS::Study_var GeometryGUI::ClientStudyToStudy (_PTR(Study) theStudy) return aDSStudy._retn(); } -void GeometryGUI::Modified( bool theIsUpdateActions ) +void GeometryGUI::Modified (bool theIsUpdateActions) { - if( SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ) ) { - if( SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ) ) { + if ( SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ) ) { + if ( SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ) ) { appStudy->Modified(); - if( theIsUpdateActions ) + if ( theIsUpdateActions ) app->updateActions(); } } @@ -281,17 +280,17 @@ void GeometryGUI::ActiveWorkingPlane() bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); - if( ViewOCC ) { + if ( ViewOCC ) { OCCViewer_ViewWindow* vw = dynamic_cast( window ); if ( vw ) { Handle(V3d_View) view3d = vw->getViewPort()->getView(); view3d->SetProj(DZ.X(), DZ.Y(), DZ.Z()); view3d->SetUp(DY.X(), DY.Y(), DY.Z()); - vw->onViewFitAll(); + vw->onViewFitAll(); } } - else if( ViewVTK ) { + else if ( ViewVTK ) { SVTK_ViewWindow* vw = dynamic_cast( window ); if ( vw ) { vtkCamera* camera = vw->getRenderer()->GetActiveCamera(); @@ -473,6 +472,7 @@ void GeometryGUI::OnGUIEvent( int id ) case GEOMOp::OpRevolution: // MENU GENERATION - REVOLUTION case GEOMOp::OpFilling: // MENU GENERATION - FILLING case GEOMOp::OpPipe: // MENU GENERATION - PIPE + case GEOMOp::OpPipePath: // MENU GENERATION - RESTORE PATH libName = "GenerationGUI"; break; case GEOMOp::Op2dSketcher: // MENU ENTITY - SKETCHER @@ -596,15 +596,15 @@ void GeometryGUI::OnGUIEvent( int id ) // call method of corresponding GUI library if ( library ) { library->OnGUIEvent( id, desk ); - + // Update a list of materials for "Preferences" dialog if ( id == GEOMOp::OpMaterialProperties ) { LightApp_Preferences* pref = preferences(); if ( pref ) { - Material_ResourceMgr aMatResMgr; - setPreferenceProperty( pref->rootItem()->findItem( tr( "PREF_MATERIAL" ), true )->id(), - "strings", - aMatResMgr.materials() ); + Material_ResourceMgr aMatResMgr; + setPreferenceProperty( pref->rootItem()->findItem( tr( "PREF_MATERIAL" ), true )->id(), + "strings", + aMatResMgr.materials() ); } } } @@ -689,11 +689,11 @@ void GeometryGUI::createGeomAction( const int id, const QString& label, const QS void GeometryGUI::createOriginAndBaseVectors() { SalomeApp_Study* appStudy = dynamic_cast( application()->activeStudy() ); - if( appStudy ) { + if ( appStudy ) { _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() ); - if( !aBasicOperations->_is_nil() ) { + if ( !aBasicOperations->_is_nil() ) { SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); double aLength = aResourceMgr->doubleValue( "Geometry", "base_vectors_length", 1.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::OpFilling, "FILLING" ); createGeomAction( GEOMOp::OpPipe, "PIPE" ); + createGeomAction( GEOMOp::OpPipePath, "PIPE_PATH" ); createGeomAction( GEOMOp::OpGroupCreate, "GROUP_CREATE" ); createGeomAction( GEOMOp::OpGroupEdit, "GROUP_EDIT" ); @@ -950,6 +951,9 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( GEOMOp::OpRevolution, genId, -1 ); createMenu( GEOMOp::OpFilling, 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 ); @@ -983,9 +987,9 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( GEOMOp::OpShell, buildId, -1 ); createMenu( GEOMOp::OpSolid, buildId, -1 ); createMenu( GEOMOp::OpCompound, buildId, -1 ); - + createMenu( separator(), newEntId, -1 ); - + createMenu( GEOMOp::OpPictureImport, newEntId, -1 ); #ifdef WITH_OPENCV createMenu( GEOMOp::OpFeatureDetect, newEntId, -1 ); @@ -1110,7 +1114,7 @@ void GeometryGUI::initialize( CAM_Application* app ) */ // ---- create toolbars -------------------------- - + int basicTbId = createTool( tr( "TOOL_BASIC" ) ); createTool( GEOMOp::OpPoint, basicTbId ); createTool( GEOMOp::OpLine, basicTbId ); @@ -1124,11 +1128,11 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( GEOMOp::OpPlane, basicTbId ); createTool( GEOMOp::OpLCS, basicTbId ); createTool( GEOMOp::OpOriginAndVectors, basicTbId ); - + // int sketchTbId = createTool( tr( "TOOL_SKETCH" ) ); // createTool( GEOMOp::Op2dSketcher, sketchTbId ); // createTool( GEOMOp::Op3dSketcher, sketchTbId ); - + int primTbId = createTool( tr( "TOOL_PRIMITIVES" ) ); createTool( GEOMOp::OpBox, primTbId ); createTool( GEOMOp::OpCylinder, primTbId ); @@ -1138,26 +1142,29 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( GEOMOp::OpRectangle, primTbId ); createTool( GEOMOp::OpDisk, primTbId ); createTool( GEOMOp::OpPipeTShape, primTbId ); //rnc - + int blocksTbId = createTool( tr( "TOOL_BLOCKS" ) ); createTool( GEOMOp::OpDividedDisk, blocksTbId ); createTool( GEOMOp::OpDividedCylinder, blocksTbId ); - + // int advancedTbId = createTool( tr( "TOOL_ADVANCED" ) ); //rnc // createTool( GEOMOp::OpPipeTShape, advancedTbId ); - + int boolTbId = createTool( tr( "TOOL_BOOLEAN" ) ); createTool( GEOMOp::OpFuse, boolTbId ); createTool( GEOMOp::OpCommon, boolTbId ); createTool( GEOMOp::OpCut, boolTbId ); createTool( GEOMOp::OpSection, boolTbId ); - - int genTbId = createTool( tr( "TOOL_GENERATION" ) ); + + int genTbId = createTool( tr( "TOOL_GENERATION" ) ); createTool( GEOMOp::OpPrism, genTbId ); createTool( GEOMOp::OpRevolution, genTbId ); createTool( GEOMOp::OpFilling, genTbId ); createTool( GEOMOp::OpPipe, genTbId ); - +#if OCC_VERSION_LARGE > 0x06050300 + createTool( GEOMOp::OpPipePath, genTbId ); +#endif + int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ) ); createTool( GEOMOp::OpTranslate, transTbId ); createTool( GEOMOp::OpRotate, transTbId ); @@ -1169,14 +1176,14 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( separator(), transTbId ); createTool( GEOMOp::OpMultiTranslate, transTbId ); createTool( GEOMOp::OpMultiRotate, transTbId ); - + int operTbId = createTool( tr( "TOOL_OPERATIONS" ) ); createTool( GEOMOp::OpExplode, operTbId ); createTool( GEOMOp::OpPartition, operTbId ); createTool( GEOMOp::OpArchimede, operTbId ); createTool( GEOMOp::OpShapesOnShape, operTbId ); createTool( GEOMOp::OpSharedShapes, operTbId ); - + int featTbId = createTool( tr( "TOOL_FEATURES" ) ); createTool( GEOMOp::OpFillet1d, featTbId ); createTool( GEOMOp::OpFillet2d, featTbId ); @@ -1184,7 +1191,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( GEOMOp::OpChamfer, featTbId ); createTool( GEOMOp::OpExtrudedBoss, featTbId ); createTool( GEOMOp::OpExtrudedCut, featTbId ); - + int buildTbId = createTool( tr( "TOOL_BUILD" ) ); createTool( GEOMOp::OpEdge, buildTbId ); createTool( GEOMOp::OpWire, buildTbId ); @@ -1219,7 +1226,7 @@ void GeometryGUI::initialize( CAM_Application* app ) #ifdef WITH_OPENCV createTool( GEOMOp::OpFeatureDetect, picturesTbId ); #endif - + // 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 @@// @@ -1261,7 +1268,7 @@ void GeometryGUI::initialize( CAM_Application* app ) mgr->setRule(action(GEOMOp::OpBringToFront), bringRule, QtxPopupMgr::VisibleRule ); mgr->setRule(action(GEOMOp::OpBringToFront), "topLevel=true", QtxPopupMgr::ToggleRule ); 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 mgr->insert( separator(), -1, -1 ); // ----------- 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->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->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->insert( action( GEOMOp::OpSetTexture ), -1, -1 ); // texture 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->setRule( action( GEOMOp::OpIsosWidth ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule ); - + mgr->insert( separator(), -1, -1 ); // ----------- mgr->insert( action( GEOMOp::OpAutoColor ), -1, -1 ); // auto color 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->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->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 ) ) ); - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - if(resMgr) { + if (resMgr) { GEOM_AISShape::setTopLevelDisplayMode((GEOM_AISShape::TopLevelDispMode)resMgr->integerValue("Geometry", "toplevel_dm", 0)); QColor c = resMgr->colorValue( "Geometry", "toplevel_color", QColor( 170, 85, 0 ) ); 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) PyGILState_STATE gstate = PyGILState_Ensure(); - PyObject* pluginsmanager=PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager"); - if(pluginsmanager==NULL) + PyObject* pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager"); + if (pluginsmanager == NULL) PyErr_Print(); - else - { - 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()); - if(result==NULL) - PyErr_Print(); - Py_XDECREF(result); - } + else { + 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()); + if (result == NULL) + PyErr_Print(); + Py_XDECREF(result); + } PyGILState_Release(gstate); // end of GEOM plugins loading @@ -1466,13 +1473,13 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) // 0020836 (Basic vectors and origin) 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( application()->activeStudy() ); - if( appStudy ) { + if ( appStudy ) { _PTR(Study) studyDS = appStudy->studyDS(); - if( studyDS ) { + if ( studyDS ) { _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(); } } @@ -1481,7 +1488,6 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) return true; } - //======================================================================= // function : GeometryGUI::deactivateModule() // purpose : Called when GEOM module is deactivated @@ -1571,7 +1577,7 @@ void GeometryGUI::onViewManagerAdded( SUIT_ViewManager* vm ) this, SLOT( OnMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) ); connect( vm, SIGNAL( mouseRelease ( SUIT_ViewWindow*, QMouseEvent* ) ), this, SLOT( OnMouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ) ); - + LightApp_SelectionMgr* sm = getApp()->selectionMgr(); myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) ); @@ -1741,31 +1747,30 @@ void GeometryGUI::createPreferences() LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" ); int material = addPreference( tr( "PREF_MATERIAL" ), genGroup, - LightApp_Preferences::Selector, - "Geometry", "material" ); - + LightApp_Preferences::Selector, + "Geometry", "material" ); + const int nb = 4; int wd[nb]; int iter=0; 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, - LightApp_Preferences::IntSpin, "Geometry", "isolines_width" ); + LightApp_Preferences::IntSpin, "Geometry", "isolines_width" ); 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" ); + LightApp_Preferences::IntSpin, "Geometry", "measures_line_width" ); - for(int i = 0; i < nb; i++) { - setPreferenceProperty( wd[i], "min", 1 ); + for (int i = 0; i < nb; i++) { + setPreferenceProperty( wd[i], "min", 1 ); setPreferenceProperty( wd[i], "max", 5 ); } - // Quantities with individual precision settings int precGroup = addPreference( tr( "GEOM_PREF_GROUP_PRECISION" ), tabId ); setPreferenceProperty( precGroup, "columns", 2 ); @@ -1819,7 +1824,6 @@ void GeometryGUI::createPreferences() setPreferenceProperty( dispmode, "strings", aModesList ); setPreferenceProperty( dispmode, "indexes", anIndexesList ); - // Set property for top level display mode QStringList aTopModesList; aTopModesList.append( tr("MEN_SHOW_ADD_WACTOR") ); @@ -1891,7 +1895,6 @@ void GeometryGUI::createPreferences() addPreference( tr( "PREF_AUTO_CREATE" ), originGroup, LightApp_Preferences::Bool, "Geometry", "auto_create_base_objects" ); - int operationsGroup = addPreference( tr( "PREF_GROUP_OPERATIONS" ), tabId ); setPreferenceProperty( operationsGroup, "columns", 2 ); @@ -1906,18 +1909,20 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par if (param == QString("SettingsGeomStep")) { double spin_step = aResourceMgr->doubleValue(section, param, 100.); 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 ) ); 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)); } - } + } } LightApp_Displayer* GeometryGUI::displayer() { - if( !myDisplayer ) + if ( !myDisplayer ) myDisplayer = new GEOM_Displayer( dynamic_cast( getApp()->activeStudy() ) ); return myDisplayer; } @@ -1926,6 +1931,7 @@ void GeometryGUI::setLocalSelectionMode(const int mode) { myLocalSelectionMode = mode; } + int GeometryGUI::getLocalSelectionMode() const { return myLocalSelectionMode; @@ -1986,7 +1992,7 @@ void GeometryGUI::storeVisualParameters (int savePoint) std::string entry = ip->encodeEntry(o_it.key().toLatin1().data(), componentName); _PTR(GenericAttribute) anAttr; - if( !obj->FindAttribute(anAttr, "AttributeIOR")) + if (!obj->FindAttribute(anAttr, "AttributeIOR")) continue; std::string param,occParam = vType.toLatin1().data(); @@ -1994,17 +2000,17 @@ void GeometryGUI::storeVisualParameters (int savePoint) occParam += QString::number(aMgrId).toLatin1().data(); occParam += NAME_SEPARATOR; - if(aProps.contains(VISIBILITY_PROP)) { + if (aProps.contains(VISIBILITY_PROP)) { param = occParam + VISIBILITY_PROP; 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; 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(); QString colorStr = QString::number(c.red()/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()); } - if(vType == SVTK_Viewer::Type()) { - if(aProps.contains(OPACITY_PROP)) { + if (vType == SVTK_Viewer::Type()) { + if (aProps.contains(OPACITY_PROP)) { param = occParam + OPACITY_PROP; ip->setParameter(entry, param, QString::number(1. - aProps.value(TRANSPARENCY_PROP).toDouble()).toLatin1().data()); } } else if (vType == SOCC_Viewer::Type()) { - if(aProps.contains(TRANSPARENCY_PROP)) { + if (aProps.contains(TRANSPARENCY_PROP)) { param = occParam + TRANSPARENCY_PROP; 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; - Standard_Boolean val = aProps.value(TOP_LEVEL_PROP).value(); - if (val == Standard_True) - ip->setParameter(entry, param, "1"); - } + Standard_Boolean val = aProps.value(TOP_LEVEL_PROP).value(); + if (val == Standard_True) + ip->setParameter(entry, param, "1"); + } } - if(aProps.contains(ISOS_PROP)) { + if (aProps.contains(ISOS_PROP)) { param = occParam + ISOS_PROP; 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; 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; 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" - if(aProps.contains(MARKER_TYPE_PROP)) { + if (aProps.contains(MARKER_TYPE_PROP)) { param = occParam + MARKER_TYPE_PROP; 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; 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; - 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 )) { - param = occParam + ISOS_WIDTH_PROP; - ip->setParameter(entry, param, aProps.value(ISOS_WIDTH_PROP).toString().toLatin1().data()); + + if (aProps.contains(ISOS_WIDTH_PROP)) { + param = occParam + ISOS_WIDTH_PROP; + ip->setParameter(entry, param, aProps.value(ISOS_WIDTH_PROP).toString().toLatin1().data()); } } // object iterator } // for (views) @@ -2141,52 +2147,42 @@ void GeometryGUI::restoreVisualParameters (int savePoint) if (!ok) // bad conversion of view index to integer continue; - if((viewIndex + 1) > aListOfMap.count()) { + if ((viewIndex + 1) > aListOfMap.count()) { aListOfMap.resize(viewIndex + 1); } QString val((*valuesIt).c_str()); - if(paramNameStr == VISIBILITY_PROP){ + if (paramNameStr == VISIBILITY_PROP) { 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()); - - } else if(paramNameStr == TRANSPARENCY_PROP) { + } else if (paramNameStr == TRANSPARENCY_PROP) { aListOfMap[viewIndex].insert( TRANSPARENCY_PROP, val.toDouble() ); - - } else if(paramNameStr == TOP_LEVEL_PROP) { - aListOfMap[viewIndex].insert( TRANSPARENCY_PROP, val == "1" ? Standard_True : Standard_False ); - - } else if(paramNameStr == DISPLAY_MODE_PROP) { + } else if (paramNameStr == TOP_LEVEL_PROP) { + aListOfMap[viewIndex].insert( TRANSPARENCY_PROP, val == "1" ? Standard_True : Standard_False ); + } else if (paramNameStr == DISPLAY_MODE_PROP) { aListOfMap[viewIndex].insert( DISPLAY_MODE_PROP, val.toInt()); - - } else if(paramNameStr == ISOS_PROP) { + } else if (paramNameStr == ISOS_PROP) { aListOfMap[viewIndex].insert( ISOS_PROP, val); - - } else if(paramNameStr == COLOR_PROP) { + } else if (paramNameStr == COLOR_PROP) { 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)); 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()); - - } else if(paramNameStr == DEFLECTION_COEFF_PROP) { + } else if (paramNameStr == DEFLECTION_COEFF_PROP) { 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); - } else if(paramNameStr == MATERIAL_PROP) { + } else if (paramNameStr == MATERIAL_PROP) { aListOfMap[viewIndex].insert( MATERIAL_PROP, val); - } else if(paramNameStr == EDGE_WIDTH_PROP) { - aListOfMap[viewIndex].insert( EDGE_WIDTH_PROP , val); - } else if(paramNameStr == ISOS_WIDTH_PROP) { - aListOfMap[viewIndex].insert( ISOS_WIDTH_PROP , val); + } else if (paramNameStr == EDGE_WIDTH_PROP) { + aListOfMap[viewIndex].insert( EDGE_WIDTH_PROP, val); + } else if (paramNameStr == ISOS_WIDTH_PROP) { + aListOfMap[viewIndex].insert( ISOS_WIDTH_PROP, val); } - - - } // for names/parameters iterator QList lst = getApp()->viewManagers(); @@ -2202,7 +2198,6 @@ void GeometryGUI::restoreVisualParameters (int savePoint) displayer()->Display(entry, true, dynamic_cast(vmodel)); } } - } // for entries iterator // update all VTK and OCC views @@ -2243,7 +2238,7 @@ void GeometryGUI::onViewAboutToShow() /*! \brief Return action by id \param id identifier of the action - \return action + \return action */ QAction* GeometryGUI::getAction(const int id) { return action(id); @@ -2261,32 +2256,32 @@ QAction* GeometryGUI::getAction(const int id) { bool GeometryGUI::renameAllowed( const QString& entry) const { SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - SalomeApp_Study* appStudy = app ? dynamic_cast( app->activeStudy() ) : 0; + SalomeApp_Study* appStudy = app ? dynamic_cast( app->activeStudy() ) : 0; SalomeApp_DataObject* obj = appStudy ? dynamic_cast(appStudy->findObjectByEntry(entry)) : 0; - + return (app && appStudy && obj && !appStudy->isComponent(entry) && !obj->isReference()); } - /*! Rename object by entry. \param entry entry of the object \param name new name of the object \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; - - 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( app->activeStudy() ) : 0; - - if(!appStudy) + + if (!appStudy) return result; - + _PTR(Study) aStudy = appStudy->studyDS(); - - if(!aStudy) + + if (!aStudy) return result; bool aLocked = (_PTR(AttributeStudyProperties)(appStudy->studyDS()->GetProperties()))->IsLocked(); @@ -2311,4 +2306,3 @@ bool GeometryGUI::renameObject( const QString& entry, const QString& name) { } return result; } - diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h index 75e45e43f..e17172e49 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -98,6 +98,7 @@ namespace GEOMOp { OpRevolution = 3201, // MENU NEW ENTITY - GENERATION - REVOLUTION OpFilling = 3202, // MENU NEW ENTITY - GENERATION - FILLING OpPipe = 3203, // MENU NEW ENTITY - GENERATION - EXTRUSION ALONG PATH + OpPipePath = 3204, // MENU NEW ENTITY - GENERATION - RESTORE PATH // EntityGUI -------------------//-------------------------------- Op2dSketcher = 3300, // MENU NEW ENTITY - SKETCHER Op3dSketcher = 3301, // MENU NEW ENTITY - 3D SKETCHER diff --git a/src/GEOMImpl/GEOMImpl_Gen.cxx b/src/GEOMImpl/GEOMImpl_Gen.cxx index 884da5cb1..f8f02247d 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.cxx +++ b/src/GEOMImpl/GEOMImpl_Gen.cxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifdef WNT #pragma warning( disable:4786 ) @@ -54,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -122,6 +122,7 @@ GEOMImpl_Gen::GEOMImpl_Gen() 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_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_RevolutionDriver::GetID(), new GEOMImpl_RevolutionDriver()); TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SphereDriver::GetID(), new GEOMImpl_SphereDriver()); diff --git a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx index dc2ab3599..b4103f9fa 100644 --- a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx @@ -18,7 +18,6 @@ // 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 @@ -49,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -69,6 +69,7 @@ #include #include #include +#include #include @@ -2176,7 +2177,6 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath( } - //============================================================================= /*! * MakePipeBiNormalAlongVector @@ -2236,3 +2236,173 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Han SetErrorCode(OK); 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(aFail->GetMessageString()); + 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(aFail->GetMessageString()); + 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; +} diff --git a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx index c567d0333..6cd2dd25d 100644 --- a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMImpl_I3DPrimOperations_HXX_ #define _GEOMImpl_I3DPrimOperations_HXX_ @@ -131,14 +130,21 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations { bool theWithContact, bool theWithCorrections); - Standard_EXPORT Handle(GEOM_Object) MakePipeShellsWithoutPath( - const Handle(TColStd_HSequenceOfTransient)& theBases, - const Handle(TColStd_HSequenceOfTransient)& theLocations); + Standard_EXPORT Handle(GEOM_Object) MakePipeShellsWithoutPath + (const Handle(TColStd_HSequenceOfTransient)& theBases, + const Handle(TColStd_HSequenceOfTransient)& theLocations); Standard_EXPORT Handle(GEOM_Object) MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase, Handle(GEOM_Object) thePath, 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 diff --git a/src/GEOMImpl/GEOMImpl_IPipePath.hxx b/src/GEOMImpl/GEOMImpl_IPipePath.hxx new file mode 100644 index 000000000..028ab2f53 --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_IPipePath.hxx @@ -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 diff --git a/src/GEOMImpl/GEOMImpl_PipeDriver.cxx b/src/GEOMImpl/GEOMImpl_PipeDriver.cxx index 21475ee42..400c2a03c 100644 --- a/src/GEOMImpl/GEOMImpl_PipeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PipeDriver.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -41,15 +42,14 @@ #include #include +#include +#include #include #include #include +#include #include #include -#include -#include -#include -#include #include #include @@ -68,6 +68,8 @@ #include #include +#include + #include #include #include @@ -88,6 +90,7 @@ #include #include + #include #include #include @@ -100,7 +103,7 @@ //======================================================================= 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; } @@ -2277,23 +2280,23 @@ static TopoDS_Shape CreatePipeBiNormalAlongVector(const TopoDS_Wire& aWirePath, //function : Execute //purpose : //======================================================================= -Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const +Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const { - //cout<<"PipeDriver::Execute"<GetType(); + + GEOMImpl_IPipe* aCI = 0; if (aType == PIPE_BASE_PATH) - aCI = new GEOMImpl_IPipe(aFunction); + aCI = new GEOMImpl_IPipe (aFunction); else if (aType == PIPE_DIFFERENT_SECTIONS) - aCI = new GEOMImpl_IPipeDiffSect(aFunction); + aCI = new GEOMImpl_IPipeDiffSect (aFunction); else if (aType == PIPE_SHELL_SECTIONS) - aCI = new GEOMImpl_IPipeShellSect(aFunction); + aCI = new GEOMImpl_IPipeShellSect (aFunction); 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) - aCI = new GEOMImpl_IPipeBiNormal(aFunction); + aCI = new GEOMImpl_IPipeBiNormal (aFunction); else return 0; diff --git a/src/GEOMImpl/GEOMImpl_PipePathDriver.cxx b/src/GEOMImpl/GEOMImpl_PipePathDriver.cxx new file mode 100644 index 000000000..5acf28f12 --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_PipePathDriver.cxx @@ -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 + +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if OCC_VERSION_LARGE > 0x06050300 +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include + +#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; +} diff --git a/src/GEOMImpl/GEOMImpl_PipePathDriver.hxx b/src/GEOMImpl/GEOMImpl_PipePathDriver.hxx new file mode 100644 index 000000000..36bf36314 --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_PipePathDriver.hxx @@ -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 +#endif +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_GUID_HeaderFile +#include +#endif + +#ifndef _Handle_TFunction_Driver_HeaderFile +#include +#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 +#endif +#ifndef _TFunction_Logbook_HeaderFile +#include +#endif +#ifndef _Standard_CString_HeaderFile +#include +#endif + +#include +#include +#include + +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 diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx index c83f91417..12962ffc7 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx @@ -133,66 +133,12 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const if (aType == WIRE_EDGES) { 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(); if (aTolerance < Precision::Confusion()) aTolerance = Precision::Confusion(); - aFW->ClosedWireMode() = Standard_False; - 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 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(); + aShape = MakeWireFromEdges(aShapes, aTolerance); } else if (aType == FACE_WIRE) { Handle(GEOM_Function) aRefBase = aCI.GetBase(); @@ -610,6 +556,73 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const 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 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, const Standard_Real LinTol, const Standard_Real AngTol) diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.hxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.hxx index 653ad7e13..87c55c501 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.hxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.hxx @@ -120,6 +120,8 @@ class Handle(GEOMImpl_ShapeDriver) : public Handle(TFunction_Driver) { #include #include +#include +#include class TColStd_SequenceOfExtendedString; @@ -151,9 +153,13 @@ public: Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const { return Standard_True; } Standard_EXPORT static const Standard_GUID& GetID(); - Standard_EXPORT static TopoDS_Edge MakeEdgeFromWire(const TopoDS_Shape& aWire, - const Standard_Real LinTol, - const Standard_Real AngTol); + Standard_EXPORT static TopoDS_Edge MakeEdgeFromWire (const TopoDS_Shape& aWire, + const Standard_Real LinTol, + const Standard_Real AngTol); + + Standard_EXPORT static TopoDS_Wire MakeWireFromEdges + (const Handle(TColStd_HSequenceOfTransient)& theEdgesFuncs, + const Standard_Real theTolerance); // Type management // diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index 5182f8cdc..4aeed6398 100755 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -100,6 +100,8 @@ #define GEOM_EXTRUDED_BOSS 47 +#define GEOM_PIPE_PATH 48 + //GEOM_Function types #define COPY_WITH_REF 1 @@ -214,6 +216,10 @@ #define PIPE_SHELLS_WITHOUT_PATH 4 #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_SMOOTHED 2 diff --git a/src/GEOMImpl/Makefile.am b/src/GEOMImpl/Makefile.am index 69cda82da..8ce12ca2e 100644 --- a/src/GEOMImpl/Makefile.am +++ b/src/GEOMImpl/Makefile.am @@ -83,6 +83,7 @@ salomeinclude_HEADERS = \ GEOMImpl_ITorus.hxx \ GEOMImpl_IPrism.hxx \ GEOMImpl_IPipe.hxx \ + GEOMImpl_IPipePath.hxx \ GEOMImpl_IRevolution.hxx \ GEOMImpl_IMeasure.hxx \ GEOMImpl_IShapes.hxx \ @@ -111,6 +112,7 @@ salomeinclude_HEADERS = \ GEOMImpl_TorusDriver.hxx \ GEOMImpl_PrismDriver.hxx \ GEOMImpl_PipeDriver.hxx \ + GEOMImpl_PipePathDriver.hxx \ GEOMImpl_ThruSectionsDriver.hxx \ GEOMImpl_RevolutionDriver.hxx \ GEOMImpl_ShapeDriver.hxx \ @@ -185,6 +187,7 @@ dist_libGEOMimpl_la_SOURCES = \ GEOMImpl_TorusDriver.cxx \ GEOMImpl_PrismDriver.cxx \ GEOMImpl_PipeDriver.cxx \ + GEOMImpl_PipePathDriver.cxx \ GEOMImpl_ThruSectionsDriver.cxx \ GEOMImpl_RevolutionDriver.cxx \ GEOMImpl_ShapeDriver.cxx \ diff --git a/src/GEOM_I/GEOM_I3DPrimOperations_i.cc b/src/GEOM_I/GEOM_I3DPrimOperations_i.cc index 76febf836..95948ed24 100644 --- a/src/GEOM_I/GEOM_I3DPrimOperations_i.cc +++ b/src/GEOM_I/GEOM_I3DPrimOperations_i.cc @@ -18,7 +18,6 @@ // 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 @@ -1096,7 +1095,6 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath return GetObject(anObject); } - //============================================================================= /*! * MakePipeBiNormalAlongVector @@ -1127,3 +1125,81 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector 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); +} diff --git a/src/GEOM_I/GEOM_I3DPrimOperations_i.hh b/src/GEOM_I/GEOM_I3DPrimOperations_i.hh index 05a748932..5b274671b 100644 --- a/src/GEOM_I/GEOM_I3DPrimOperations_i.hh +++ b/src/GEOM_I/GEOM_I3DPrimOperations_i.hh @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _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 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() { return (::GEOMImpl_I3DPrimOperations*)GetImpl(); } }; diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 0dd628e5a..8833a4de9 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -2867,6 +2867,76 @@ class geompyDC(GEOM._objref_GEOM_Gen): RaiseIfFailed("MakePipeBiNormalAlongVector", 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 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 ## @} diff --git a/src/GenerationGUI/GenerationGUI.cxx b/src/GenerationGUI/GenerationGUI.cxx index b341a92b0..3f94071ec 100644 --- a/src/GenerationGUI/GenerationGUI.cxx +++ b/src/GenerationGUI/GenerationGUI.cxx @@ -18,12 +18,11 @@ // 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.cxx // Author : Damien COQUERET, Open CASCADE S.A.S. -// + #include "GenerationGUI.h" #include @@ -36,6 +35,7 @@ #include "GenerationGUI_RevolDlg.h" // Method REVOL #include "GenerationGUI_FillingDlg.h" // Method FILLING #include "GenerationGUI_PipeDlg.h" // Method PIPE +#include "GenerationGUI_PipePathDlg.h" // Method RESTORE PATH //======================================================================= // 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::OpFilling: aDlg = new GenerationGUI_FillingDlg ( 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; } diff --git a/src/GenerationGUI/GenerationGUI_PipePathDlg.cxx b/src/GenerationGUI/GenerationGUI_PipePathDlg.cxx new file mode 100644 index 000000000..b2d2d8d6b --- /dev/null +++ b/src/GenerationGUI/GenerationGUI_PipePathDlg.cxx @@ -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 +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +//================================================================================= +// 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 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 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 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()); +} diff --git a/src/GenerationGUI/GenerationGUI_PipePathDlg.h b/src/GenerationGUI/GenerationGUI_PipePathDlg.h new file mode 100644 index 000000000..2c900bbc3 --- /dev/null +++ b/src/GenerationGUI/GenerationGUI_PipePathDlg.h @@ -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 myBase1Objects; /* Base 1 edges / wire / face */ + QList 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 diff --git a/src/GenerationGUI/Makefile.am b/src/GenerationGUI/Makefile.am index 35afde04d..cda0fad02 100644 --- a/src/GenerationGUI/Makefile.am +++ b/src/GenerationGUI/Makefile.am @@ -15,13 +15,12 @@ # 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 GENERATIONGUI : # File : Makefile.am # Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com) # Package : GenerationGUI -# + include $(top_srcdir)/adm_local/unix/make_common_starter.am # Libraries targets @@ -33,7 +32,8 @@ salomeinclude_HEADERS = \ GenerationGUI_PrismDlg.h \ GenerationGUI_RevolDlg.h \ GenerationGUI_FillingDlg.h \ - GenerationGUI_PipeDlg.h + GenerationGUI_PipeDlg.h \ + GenerationGUI_PipePathDlg.h dist_libGenerationGUI_la_SOURCES = \ GenerationGUI.h \ @@ -41,18 +41,21 @@ dist_libGenerationGUI_la_SOURCES = \ GenerationGUI_RevolDlg.h \ GenerationGUI_FillingDlg.h \ GenerationGUI_PipeDlg.h \ + GenerationGUI_PipePathDlg.h \ \ GenerationGUI.cxx \ GenerationGUI_PrismDlg.cxx \ GenerationGUI_RevolDlg.cxx \ GenerationGUI_FillingDlg.cxx \ - GenerationGUI_PipeDlg.cxx + GenerationGUI_PipeDlg.cxx \ + GenerationGUI_PipePathDlg.cxx MOC_FILES = \ GenerationGUI_PrismDlg_moc.cxx \ GenerationGUI_RevolDlg_moc.cxx \ GenerationGUI_FillingDlg_moc.cxx \ - GenerationGUI_PipeDlg_moc.cxx + GenerationGUI_PipeDlg_moc.cxx \ + GenerationGUI_PipePathDlg_moc.cxx nodist_libGenerationGUI_la_SOURCES = \ $(MOC_FILES) -- 2.39.2