From 87533ec02b1e1d85e797013ee7c377b2b25801be Mon Sep 17 00:00:00 2001 From: skv Date: Thu, 12 Feb 2015 16:59:30 +0300 Subject: [PATCH] 0022776: [CEA 1269] Project a wire or a face on a cylinder --- .../transformation_operations_ex07.py | 16 + .../gui/GEOM/images/proj_on_cyl_dlg.png | Bin 0 -> 25225 bytes .../gui/GEOM/images/proj_on_cyl_preview.png | Bin 0 -> 3218 bytes .../projection_on_cylinder_operation.doc | 40 ++ .../GEOM/input/transformation_operations.doc | 1 + doc/salome/gui/GEOM/input/tui_test_all.doc | 2 +- idl/GEOM_Gen.idl | 25 ++ resources/CMakeLists.txt | 1 + resources/proj_on_cyl.png | Bin 0 -> 764 bytes src/GEOMGUI/GEOM_images.ts | 8 + src/GEOMGUI/GEOM_msg_en.ts | 31 ++ src/GEOMGUI/GeometryGUI.cxx | 4 + src/GEOMGUI/GeometryGUI_Operations.h | 1 + src/GEOMImpl/CMakeLists.txt | 1 + src/GEOMImpl/GEOMImpl_IProjOnCyl.hxx | 61 +++ .../GEOMImpl_ITransformOperations.cxx | 76 ++++ .../GEOMImpl_ITransformOperations.hxx | 6 + src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx | 303 +++++++++++++- src/GEOMImpl/GEOMImpl_ProjectionDriver.hxx | 10 + src/GEOMImpl/GEOMImpl_Types.hxx | 5 +- src/GEOMUtils/CMakeLists.txt | 6 + src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx | 51 +++ src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx | 84 ++++ src/GEOMUtils/GEOMUtils_Trsf2d.cxx | 110 +++++ src/GEOMUtils/GEOMUtils_Trsf2d.hxx | 134 ++++++ src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx | 382 ++++++++++++++++++ src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx | 242 +++++++++++ src/GEOM_I/GEOM_ITransformOperations_i.cc | 34 ++ src/GEOM_I/GEOM_ITransformOperations_i.hh | 5 + src/GEOM_SWIG/GEOM_TestAll.py | 2 + src/GEOM_SWIG/geomBuilder.py | 61 +++ src/TransformationGUI/CMakeLists.txt | 3 + src/TransformationGUI/TransformationGUI.cxx | 4 + .../TransformationGUI_ProjectionOnCylDlg.cxx | 360 +++++++++++++++++ .../TransformationGUI_ProjectionOnCylDlg.h | 78 ++++ 35 files changed, 2143 insertions(+), 4 deletions(-) create mode 100644 doc/salome/gui/GEOM/images/proj_on_cyl_dlg.png create mode 100644 doc/salome/gui/GEOM/images/proj_on_cyl_preview.png create mode 100644 doc/salome/gui/GEOM/input/projection_on_cylinder_operation.doc create mode 100644 resources/proj_on_cyl.png create mode 100644 src/GEOMImpl/GEOMImpl_IProjOnCyl.hxx create mode 100644 src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx create mode 100644 src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx create mode 100644 src/GEOMUtils/GEOMUtils_Trsf2d.cxx create mode 100644 src/GEOMUtils/GEOMUtils_Trsf2d.hxx create mode 100644 src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx create mode 100644 src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx create mode 100644 src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx create mode 100644 src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.h diff --git a/doc/salome/examples/transformation_operations_ex07.py b/doc/salome/examples/transformation_operations_ex07.py index f76bd9036..d323cf0b7 100644 --- a/doc/salome/examples/transformation_operations_ex07.py +++ b/doc/salome/examples/transformation_operations_ex07.py @@ -38,3 +38,19 @@ prj = geompy.MakeProjection(v1, w1) geompy.addToStudy(w1, "w1") geompy.addToStudy(v1, "v1") geompy.addToStudy(prj, "projOnWire") + +#projection of a wire on cylinder +pp1 = geompy.MakeVertex(100, 200, 0) +pp2 = geompy.MakeVertex(100, 200, 80) +pp3 = geompy.MakeVertex(100, 220, 90) +pp4 = geompy.MakeVertex(100, 130, 80) +pp5 = geompy.MakeVertex(100, 90, 80) +cc1 = geompy.MakeInterpol([pp1, pp2, pp3, pp4, pp5], True, False) +ww1 = geompy.MakeWire([cc1], 1.e-7) +vx = geompy.MakeVectorDXDYDZ(100, 0, 0) +pln1 = geompy.MakePlane(pp1, vx, 200) +face1 = geompy.MakeFaceFromSurface(pln1, ww1) +prj_cyl = geompy.MakeProjectionOnCylinder(face1, 100) + +geompy.addToStudy(face1, "pln_face") +geompy.addToStudy(prj_cyl, "projOnCylinder") diff --git a/doc/salome/gui/GEOM/images/proj_on_cyl_dlg.png b/doc/salome/gui/GEOM/images/proj_on_cyl_dlg.png new file mode 100644 index 0000000000000000000000000000000000000000..38d81b51e0461caac799cb46997592cb84b20fa2 GIT binary patch literal 25225 zcmagG1z1$kzBfErNP`keiUQKzDM%`}`T$6SHWO3jRZ| zlM@qy6b})?z{WE@2{B>F1N>ilQ*JcagJk_l)eZtd?|^?J#L}P>fSri;pQS_)mmZ;F zyd>u*;x+}lUfYYP*nhOLurRQ+hkUd((6u-C^2W);-uR8!XDJ!wujqIX$Q#IKVL=7w z+1&*f4TZD&?xQJMRMehdZ$i9-laS+bO#XgDF*V(Y%PH!ki?oCY(zJ&`O7){FoovJ3t)J%kGIbJ|FJp#90?cv;tN`# z=du+sHKm2i==8bO)nh(7OxQTRHj3SMhYn95s}yvr<{CmN>e`xKO{RKY*KB8c3w?L%RjQxPLUv!hgZSprMr&0;(mS}m zlP?~>=;nlhetlrZPfc6fWnLr2WgjNCHQkI89)8v{(AahVvCRDPkU&nZWYP8t+23dI zA?4%8niUJ@eSZ;+TIae^gWa8(8TXsC`gz+pyCmoxg-6!ZE|S6y0FAP zuTT@~TSdj=?(n-k-HQvaXwlIf2R!IvuIbT@SxqM!Yf|_k#jM;)cW0VrSF#)Y8&wP-l-SgZ>UYf4 zu~EuKMRXTo@opdS;^=>P(=((UMYmg#ssvN>w-y$mzCy^tV)Q8r!wOUD^=tYgu=5Eq#PyaAnUc1UC5Cn+N zMD=L%Lv+q&i+H)yX~OW?eo92hUgp*( z`2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~f#x zYd2i#{W;S@fdNrTIUZyWh~?#SE2aQTh%SA9B!0B=4g_FZ`|k9UEnk+@@Pb?fWEO4I zd7=0+@=eX5>WWlZPBl8bABlqi9k%TRapoIgGpN-&M-%ic!3r<#Q0-e+9s%(`1M_2Ty4S465V#R4B_ z;DLW|gTi#VNRsT-vvm)x(wg`ffYMzkDCr09ebt8l1}2*n;gjwHJhcCc3l#}+3*R=;5>c@a>TRIY`2soNGqUE*0UMO zaIH7I@w}@DmE?Ovz!&ZG!5ZHRppw>y%N&Z%{c;YTTva(%W?0zW_OrS1;2rEE*$xIB zh2Qet31oC6*kO&DB)xDb3Fp0}ZKgAWz+%eOcHhA4z}BpqsRS`?mX&81DN@SaW15+r z(d(3k&F#oTL0Tp&&7$;K`R6Di=*WWN+BsJA zsXzZ_As)sW!@h#N@v?&OC$sgV5F~^sfrIkAbzL|=V1%$=F77e3ST(McGe10m~Av$VhX!c!_2|7VCtU6G>Js_jI zdzBudwD=kCJ>?%Y@p3+GxZJ`Nx6&$6Nt~U}x;NgSvbDwhI+ZSZvse2W)Ap;4;uTV5 zM({Xa5ti{4Khb05lYMASEbl$^(ev{Mx6z6wD7a0T7{1?_$Sbq(WzK+S&5-t1te*@-DWZM7$ literal 0 HcmV?d00001 diff --git a/doc/salome/gui/GEOM/input/projection_on_cylinder_operation.doc b/doc/salome/gui/GEOM/input/projection_on_cylinder_operation.doc new file mode 100644 index 000000000..be0c5aa27 --- /dev/null +++ b/doc/salome/gui/GEOM/input/projection_on_cylinder_operation.doc @@ -0,0 +1,40 @@ +/*! + +\page projection_on_cylinder_operation_page Projection on Cylinder + +\n To produce a Projection on Cylinder in the Main Menu select +Operations - > Transformation - > Projection on Cylinder + +\n This operation makes a projection of a Source planar wire or face on +a cylinder defined by its radius. The cylinder's coordinate system is +the same as the global coordinate system. The result represents a wire or +a face that represents a projection of the source shape onto a cylinder. + +To make a projection it is necessary to define: +- \b Object to be projected. It can be either a planar wire or a face; +- \b Radius of the cylinder; +- Starting angle from the cylinder's X axis around Z axis. This is +the angle of the projection starting. +- Length angle in which to project the total length of +the wire. If it is unchecked the projection is not scaled and natural +wire length is kept for the projection. + +\ref restore_presentation_parameters_page "Advanced options". + +\image html proj_on_cyl_dlg.png + +\n Example: + +\image html proj_on_cyl_preview.png "The curve (in red) and its projection on the cylinder" + +\n TUI Command: geompy.MakeProjectionOnCylinder(theObject, theRadius, +theStartAngle=0.0, theAngleLength=-1.0), +where \em theObject is a shape which has to be projected, \em theRadius +is a cylinder radius, \em theStartAngle the starting angle of projection in +radians, \em theAngleLength the projection length angle in radians. +The \em Result will be a \em GEOM_Object. + +Our TUI Scripts provide you with useful examples of the use of +\ref tui_projection "Transformation Operations". + +*/ diff --git a/doc/salome/gui/GEOM/input/transformation_operations.doc b/doc/salome/gui/GEOM/input/transformation_operations.doc index ac745b669..6ce6395ce 100644 --- a/doc/salome/gui/GEOM/input/transformation_operations.doc +++ b/doc/salome/gui/GEOM/input/transformation_operations.doc @@ -17,6 +17,7 @@ which allow to:
  • Create an \subpage offset_operation_page "Offset" of an object.
  • Create a \subpage projection_operation_page "Projection" of an object on a face.
  • Create an \subpage extension_operation_page "Extension" of an edge or a face.
  • +
  • Create a \subpage projection_on_cylinder_operation_page "Projection on cylinder".
  • Create a simultaneous \subpage multi_translation_operation_page "Translation in several directions".
  • Create a simultaneous \subpage multi_rotation_operation_page
  • "Rotation in several directions". diff --git a/doc/salome/gui/GEOM/input/tui_test_all.doc b/doc/salome/gui/GEOM/input/tui_test_all.doc index b1f915ea2..f2407ca29 100644 --- a/doc/salome/gui/GEOM/input/tui_test_all.doc +++ b/doc/salome/gui/GEOM/input/tui_test_all.doc @@ -61,7 +61,7 @@ \until Scale4 \anchor swig_all_trsf_more -\until MakeProjectionOnWire +\until MakeProjectionOnCylinder \anchor swig_ChangeOrientation \until ChangeOrientation diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 9bdfda2b2..eaea44370 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -1420,6 +1420,31 @@ module GEOM * \return theObject. */ GEOM_Object RecomputeObject (in GEOM_Object theObject); + + /*! + * \brief Compute the projection of a wire or a face on a cylinder. + * + * This method computes a wire or a face or a compound of faces + * that represents a projection of the source shape onto cylinder. + * The cylinder's coordinate system is the same as the global coordinate + * system. + * + * \param theObject The object to be projected. It can be either + * a planar wire or a face. + * \param theRadius The radius of the cylinder. + * \param theStartAngle The starting angle from the cylinder's X axis + * around Z axis. The angle from which the projection is started. + * \param theAngleLength The projection length angle. The angle in which + * to project the total length of the wire. If it is negative the + * projection is not scaled and natural wire length is kept for + * the projection. + * \return A wire or a face or a compound of faces that represents a + * projection of the source shape onto a cylinder. + */ + GEOM_Object MakeProjectionOnCylinder (in GEOM_Object theObject, + in double theRadius, + in double theStartAngle, + in double theAngleLength); }; /*! diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 3a1bb3200..cef2c42f2 100755 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -134,6 +134,7 @@ SET( _res_files projection.png projection_on_edge.png projection_on_wire.png + proj_on_cyl.png origin_and_vectors.png partition.png partitionkeep.png diff --git a/resources/proj_on_cyl.png b/resources/proj_on_cyl.png new file mode 100644 index 0000000000000000000000000000000000000000..bd52b718831d99152061ce2253d17bd5eff9f5a9 GIT binary patch literal 764 zcmVPx#24YJ`L;(K)UjSdP6ImMo000SaNLh0L01FZT01FZU(%pXi00007bV*G`2j2n= z4+S=+JI-SO00MkTL_t(I%Y~FXXcSQthQEE-329TL5Yxmav9U6RB4LfuCJ|IrBz8h1 zU}7bP81NCb)6`m6h!{~2aSI{Bc8ZU}PAefK1UBr>W9L4PMP`@X%w|0>%*?&_eE0mE zM~*HwKR+)3-g~sxL{UT-hJ;~A5Cl{zl^lCmvHfReW=4v|A_tFM1;BX$pcZLjWp|#$ zvc7&rf*@dPYbyh8Elf{O%aN&@9h=Te1{Ntxlvn`XE{p-}2ck@b#u&b=J|dsbGc-Pn zh+v#2R+ff#9kBOH<5+8(u7`miO=t_KwPt8yj$97Dt=`94i!p{Mil|nrRI63$^*Xg$ zjia-#a4Mqm^fJIGumSw(04k->)*~Veo}9yakF}ofFK=<^{9}UH5GjjM2~I^=9XDP3 zQ`uyI$~e3T&I#6gN{f>m2l#aXfQJ`Xa4N>?7^fS(vz#PJYq6m%+Ij#^l}Z47D3`HG z)B-u9djpkH)MJfvLZQ&T%$hJA*Kp=P5gKD~en)Cz1d~RXftm*59pYWr{d_ynI*;>$ z^MV)292RjY%p%V9j_}^*CM=%=;Mw&TT_bcx;dH{?&nszu`jPu>6vw@LIRkD=Rf^K^2oeTJ7_=_vDS2{xn>Xch7N|9%6rvMEX?&tu zk?oe7DVwD;i#U_O#|QMXYX?R_1U6QCOU@VeA=YsF#0{Kj;B*7isN;;n8--8HB_~3z zQ0RJDdj*fAQ-k5Dg|xkPq^Y2acN*~?MELvlUDIbR^?45b+zlKA&Zg7jG`(#teTP5= uc%7Lx=?JQ{eRoWeT^6Qiey2XI?EC|R`LFFD53h{?0000g+&7Z literal 0 HcmV?d00001 diff --git a/src/GEOMGUI/GEOM_images.ts b/src/GEOMGUI/GEOM_images.ts index 489aaa5aa..1e906fe81 100644 --- a/src/GEOMGUI/GEOM_images.ts +++ b/src/GEOMGUI/GEOM_images.ts @@ -463,6 +463,10 @@ ICON_DLG_EXTEND_FACE faceextension.png + + ICO_DLG_PROJ_ON_CYL + proj_on_cyl.png + ICON_DLG_PARTITION partition.png @@ -1155,6 +1159,10 @@ ICO_EXTENSION edgeextension.png + + ICO_PROJ_ON_CYL + proj_on_cyl.png + ICO_ORIGIN_AND_VECTORS origin_and_vectors.png diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 4da50d2e7..5142eb365 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -1260,6 +1260,10 @@ Please, select face, shell or solid and try again GEOM_PROJECTION_TITLE Projection + + GEOM_PROJECTION_NAME + Projection + GEOM_PROJ_ON_FACE_SOURCE Source vertex, edge or wire @@ -2844,6 +2848,10 @@ Please, select face, shell or solid and try again MEN_PROJECTION Projection + + MEN_PROJ_ON_CYL + Projection on Cylinder + MEN_OPERATIONS Operations @@ -3804,6 +3812,10 @@ Please, select face, shell or solid and try again STB_PROJECTION Project a point, an edge or a wire on a face + + STB_PROJ_ON_CYL + Project a wire or a face on a cylinder + STB_ORIGIN_AND_VECTORS Create an origin and base Vectors @@ -4424,6 +4436,10 @@ Please, select face, shell or solid and try again TOP_PROJECTION Projection + + TOP_PROJ_ON_CYL + Projection on Cylinder + TOP_ORIGIN_AND_VECTORS Create an origin and base Vectors @@ -7404,4 +7420,19 @@ Do you want to create new material? Materials: %1 of %2 + + TransformationGUI_ProjectionOnCylDlg + + GEOM_PROJ_ON_CYL_TITLE + Projection On A Cylinder + + + GEOM_PROJ_ON_CYL_START_ANGLE + Starting angle + + + GEOM_PROJ_ON_CYL_LENGTH_ANGLE + Length angle + + diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 143f63b05..3e90cd95a 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -587,6 +587,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam ) case GEOMOp::OpScale: // MENU TRANSFORMATION - SCALE case GEOMOp::OpOffset: // MENU TRANSFORMATION - OFFSET case GEOMOp::OpProjection: // MENU TRANSFORMATION - PROJECTION + case GEOMOp::OpProjOnCyl: // MENU TRANSFORMATION - PROJECTION ON CYLINDER case GEOMOp::OpMultiTranslate: // MENU TRANSFORMATION - MULTI-TRANSLATION case GEOMOp::OpMultiRotate: // MENU TRANSFORMATION - MULTI-ROTATION case GEOMOp::OpReimport: // CONTEXT(POPUP) MENU - RELOAD_IMPORTED @@ -966,6 +967,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::OpScale, "SCALE" ); createGeomAction( GEOMOp::OpOffset, "OFFSET" ); createGeomAction( GEOMOp::OpProjection, "PROJECTION" ); + createGeomAction( GEOMOp::OpProjOnCyl, "PROJ_ON_CYL" ); createGeomAction( GEOMOp::OpMultiTranslate, "MUL_TRANSLATION" ); createGeomAction( GEOMOp::OpMultiRotate, "MUL_ROTATION" ); createGeomAction( GEOMOp::OpExtension, "EXTENSION" ); @@ -1211,6 +1213,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( GEOMOp::OpOffset, transId, -1 ); createMenu( GEOMOp::OpProjection, transId, -1 ); createMenu( GEOMOp::OpExtension, transId, -1 ); + createMenu( GEOMOp::OpProjOnCyl, transId, -1 ); createMenu( separator(), transId, -1 ); createMenu( GEOMOp::OpMultiTranslate, transId, -1 ); createMenu( GEOMOp::OpMultiRotate, transId, -1 ); @@ -1386,6 +1389,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( GEOMOp::OpOffset, transTbId ); createTool( GEOMOp::OpProjection, transTbId ); createTool( GEOMOp::OpExtension, transTbId ); + createTool( GEOMOp::OpProjOnCyl, transTbId ); createTool( separator(), transTbId ); createTool( GEOMOp::OpMultiTranslate, transTbId ); createTool( GEOMOp::OpMultiRotate, transTbId ); diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h index 2acdd53f4..915f5d1f1 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -148,6 +148,7 @@ namespace GEOMOp { OpReimport = 3608, // POPUP MENU - RELOAD IMPORTED OpProjection = 3609, // MENU OPERATIONS - TRANSFORMATION - PROJECTION OpExtension = 3610, // MENU OPERATIONS - TRANSFORMATION - EXTENSION + OpProjOnCyl = 3611, // MENU OPERATIONS - TRANSFORMATION - PROJECTION ON CYLINDER // OperationGUI ----------------//-------------------------------- OpPartition = 3700, // MENU OPERATION - PARTITION OpArchimede = 3701, // MENU OPERATION - ARCHIMEDE diff --git a/src/GEOMImpl/CMakeLists.txt b/src/GEOMImpl/CMakeLists.txt index 5cc90b4ed..5c59b2e72 100755 --- a/src/GEOMImpl/CMakeLists.txt +++ b/src/GEOMImpl/CMakeLists.txt @@ -97,6 +97,7 @@ SET(GEOMImpl_HEADERS GEOMImpl_ITranslate.hxx GEOMImpl_IMirror.hxx GEOMImpl_IProjection.hxx + GEOMImpl_IProjOnCyl.hxx GEOMImpl_IOffset.hxx GEOMImpl_IScale.hxx GEOMImpl_IRotate.hxx diff --git a/src/GEOMImpl/GEOMImpl_IProjOnCyl.hxx b/src/GEOMImpl/GEOMImpl_IProjOnCyl.hxx new file mode 100644 index 000000000..9fc6024d1 --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_IProjOnCyl.hxx @@ -0,0 +1,61 @@ +// Copyright (C) 2007-2014 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, or (at your option) any later version. +// +// 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 a function for the Projection on cylinder creation. + +#include "GEOM_Function.hxx" + +#define PROJECTION_ARG_SHAPE 1 +#define PROJECTION_ARG_RADIUS 2 +#define PROJECTION_ARG_START_ANGLE 3 +#define PROJECTION_ARG_ANGLE_LENGTH 4 + +class GEOMImpl_IProjOnCyl +{ + +public: + + GEOMImpl_IProjOnCyl(Handle(GEOM_Function) theFunction): _func(theFunction) {} + + void SetShape (const Handle(GEOM_Function) &theShape) + { _func->SetReference(PROJECTION_ARG_SHAPE, theShape); } + void SetRadius (const Standard_Real theRadius) + { _func->SetReal(PROJECTION_ARG_RADIUS, theRadius); } + void SetStartAngle (const Standard_Real theStartAngle) + { _func->SetReal(PROJECTION_ARG_START_ANGLE, theStartAngle); } + void SetAngleLength (const Standard_Real theAngleLength) + { _func->SetReal(PROJECTION_ARG_ANGLE_LENGTH, theAngleLength); } + + Handle(GEOM_Function) GetShape() + { return _func->GetReference(PROJECTION_ARG_SHAPE); } + Standard_Real GetRadius() + { return _func->GetReal(PROJECTION_ARG_RADIUS ); } + Standard_Real GetStartAngle() + { return _func->GetReal(PROJECTION_ARG_START_ANGLE ); } + Standard_Real GetAngleLength() + { return _func->GetReal(PROJECTION_ARG_ANGLE_LENGTH ); } + + private: + + Handle(GEOM_Function) _func; + +}; diff --git a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx index 766531fdb..5d89b0c0a 100644 --- a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -2267,3 +2268,78 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TransformLikeOtherCopy SetErrorCode(OK); return aCopy; } + +//============================================================================= +/*! + * MakeProjectionOnCylinder + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_ITransformOperations::MakeProjectionOnCylinder + (const Handle(GEOM_Object) &theObject, + const Standard_Real theRadius, + const Standard_Real theStartAngle, + const Standard_Real theAngleLength) +{ + SetErrorCode(KO); + + if (theObject.IsNull()) { + return NULL; + } + + Handle(GEOM_Function) aLastFunction = theObject->GetLastFunction(); + + if (aLastFunction.IsNull()) { + //There is no function which creates an object to be projected + return NULL; + } + + //Add a new Projection object + Handle(GEOM_Object) aResult = + GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION); + + //Add a Projection function + Handle(GEOM_Function) aFunction = aResult->AddFunction + (GEOMImpl_ProjectionDriver::GetID(), PROJECTION_ON_CYLINDER); + + //Check if the function is set correctly + if (aFunction->GetDriverGUID() != GEOMImpl_ProjectionDriver::GetID()) { + return aResult; + } + + GEOMImpl_IProjOnCyl aProj (aFunction); + + aProj.SetShape(aLastFunction); + aProj.SetRadius(theRadius); + aProj.SetStartAngle(theStartAngle); + aProj.SetAngleLength(theAngleLength); + + //Compute the Projection + try { + OCC_CATCH_SIGNALS; + if (!GetSolver()->ComputeFunction(aFunction)) { + SetErrorCode("Projection driver failed"); + return aResult; + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return aResult; + } + + //Make a Python command + GEOM::TPythonDump pd(aFunction); + + pd << aResult << " = geompy.MakeProjectionOnCylinder(" + << theObject << ", " << theRadius << ", " << theStartAngle; + + if (theAngleLength >= 0.) { + pd << ", " << theAngleLength; + } + + pd << ")"; + + SetErrorCode(OK); + + return aResult; +} diff --git a/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx b/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx index 2c44b3854..155dbfdd9 100644 --- a/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx @@ -191,6 +191,12 @@ class GEOMImpl_ITransformOperations : public GEOM_IOperations Standard_EXPORT Handle(GEOM_Object) TransformLikeOtherCopy (Handle(GEOM_Object) theObject, Handle(GEOM_Object) theSample); + Standard_EXPORT Handle(GEOM_Object) MakeProjectionOnCylinder + (const Handle(GEOM_Object) &theObject, + const Standard_Real theRadius, + const Standard_Real theStartAngle, + const Standard_Real theAngleLength); + }; #endif diff --git a/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx b/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx index 064dbb91b..d226969c8 100644 --- a/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx @@ -26,16 +26,26 @@ #include #include +#include #include #include +#include +#include +#include #include +#include #include +#include +#include #include +#include #include #include +#include #include #include +#include #include #include @@ -44,11 +54,14 @@ #include #include #include -#include +#include +#include #include #include +#include #include +#include #include #include @@ -400,6 +413,42 @@ Standard_Integer GEOMImpl_ProjectionDriver::Execute(TFunction_Logbook& log) cons if (!hasValidSolution) { Standard_ConstructionError::Raise("Projection aborted : no projection"); } + } else if (aType == PROJECTION_ON_CYLINDER) { + GEOMImpl_IProjOnCyl aProj (aFunction); + Handle(GEOM_Function) aShapeFunction = aProj.GetShape(); + + if (aShapeFunction.IsNull()) { + return 0; + } + + TopoDS_Shape aShape = aShapeFunction->GetValue(); + + if (aShape.IsNull()) { + return 0; + } + + // Get the face. + const TopAbs_ShapeEnum aType = aShape.ShapeType(); + const Standard_Real aRadius = aProj.GetRadius(); + const Standard_Real aStartAngle = aProj.GetStartAngle(); + const Standard_Real aLengthAngle = aProj.GetAngleLength(); + + if (aType != TopAbs_WIRE && aType != TopAbs_FACE) { + return 0; + } + + if (aRadius <= Precision::Confusion()) { + return 0; + } + + TopoDS_Shape aProjShape = + projectOnCylinder(aShape, aRadius, aStartAngle, aLengthAngle); + + if (aProjShape.IsNull()) { + return 0; + } + + aFunction->SetValue(aProjShape); } return 1; @@ -438,6 +487,21 @@ GetCreationInformation(std::string& theOperationName, AddParam(theParams, "Point", aProj.GetPoint()); AddParam(theParams, "Shape", aProj.GetShape()); + break; + } + case PROJECTION_ON_CYLINDER: + { + GEOMImpl_IProjOnCyl aProj (function); + const Standard_Real aLengthAngle = aProj.GetAngleLength(); + + AddParam(theParams, "Shape", aProj.GetShape()); + AddParam(theParams, "Radius", aProj.GetRadius()); + AddParam(theParams, "Start angle", aProj.GetStartAngle()); + + if (aLengthAngle >= 0.) { + AddParam(theParams, "Length angle", aLengthAngle); + } + break; } default: @@ -447,5 +511,242 @@ GetCreationInformation(std::string& theOperationName, return true; } +//================================================================================ +/*! + * \brief Performs projection of a planar wire or a face on a cylinder. + */ +//================================================================================ + +TopoDS_Shape GEOMImpl_ProjectionDriver::projectOnCylinder + (const TopoDS_Shape &theShape, + const Standard_Real theRadius, + const Standard_Real theStartAngle, + const Standard_Real theAngleLength) const +{ + TopoDS_Shape aResult; + + // Get the face. + const TopAbs_ShapeEnum aType = theShape.ShapeType(); + TopoDS_Face aFace; + + if (aType == TopAbs_WIRE) { + // Try to create a planar face. + TopoDS_Wire aWire = TopoDS::Wire(theShape); + BRepBuilderAPI_MakeFace aMkFace(aWire, Standard_True); + + if (aMkFace.IsDone()) { + aFace = aMkFace.Face(); + } else { + // Check if the wire is a straight line. + TopExp_Explorer anEExp(aWire, TopAbs_EDGE); + TopoDS_Edge anEdge; + + for (; anEExp.More(); anEExp.Next()) { + anEdge = TopoDS::Edge(anEExp.Current()); + + if (!BRep_Tool::Degenerated(anEdge)) { + break; + } + } + + if (anEExp.More()) { + // Not degenerated edge found. Try to create a plane. + Standard_Real aPar[2]; + Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aPar[0], aPar[1]); + gp_Pnt aP0 = aCurve->Value(aPar[0]); + gp_Pnt aP1 = aCurve->Value(0.5*(aPar[1] + aPar[0])); + gp_Vec aX(aP1.XYZ().Subtracted(aP0.XYZ())); + Standard_Real aTolConf = Precision::Confusion(); + + if (aX.Magnitude() > aTolConf) { + aX.Normalize(); + + // Get the plane normal ortogonal to Z axis. + gp_Vec aZ(0., 0., 1.); + gp_Vec aN = aX.Crossed(aZ); + + if (aN.Magnitude() <= aTolConf) { + // aX is parallel to aZ. Get the plane normal ortogonal to Y axis. + gp_Vec aY(0., 1., 0.); + + aN = aX.Crossed(aY); + } + + if (aN.Magnitude() > aTolConf) { + gp_Ax3 anAxis(aP0, gp_Dir(aN), gp_Dir(aX)); + Handle(Geom_Plane) aPlane = new Geom_Plane(anAxis); + BRepBuilderAPI_MakeFace aMkFace(aPlane, aWire); + + if (aMkFace.IsDone()) { + aFace = aMkFace.Face(); + } + } + } + } + } + } else if (aType == TopAbs_FACE) { + aFace = TopoDS::Face(theShape); + } + + if (aFace.IsNull()) { + return aResult; + } + + // Compute 2d translation transformation. + TopoDS_Wire anOuterWire = BRepTools::OuterWire(aFace); + Standard_Real aU[2]; + Standard_Real aV[2]; + BRepTools_WireExplorer aOWExp(anOuterWire, aFace); + + if (!aOWExp.More()) { + // NEVERREACHED + return aResult; + } + + // Compute anisotropic transformation from a face's 2d space + // to cylinder's 2d space. + BRepTools::UVBounds(aFace, anOuterWire, aU[0], aU[1], aV[0], aV[1]); + + TopoDS_Vertex aFirstVertex = aOWExp.CurrentVertex(); + TopoDS_Edge aFirstEdge = aOWExp.Current(); + gp_Pnt aPnt = BRep_Tool::Pnt(aFirstVertex); + BRepAdaptor_Curve2d anAdaptorCurve(aFirstEdge, aFace); + Standard_Real aParam = + BRep_Tool::Parameter(aFirstVertex, aFirstEdge, aFace); + gp_Pnt2d aPntUV = anAdaptorCurve.Value(aParam); + + GEOMUtils::Trsf2d aTrsf2d + (1./theRadius, 0., theStartAngle - aU[0]/theRadius, + 0., 1., aPnt.Z() - 0.5*(aV[1] - aV[0]) - aPntUV.Y()); + + // Compute scaling trsf. + const Standard_Boolean isToScale = theAngleLength >= Precision::Angular(); + gp_Trsf2d aScaleTrsf; + + if (isToScale) { + // Perform 2d scaling. + gp_Pnt2d aMidPnt(0.5*(aU[1] + aU[0]), 0.5*(aV[1] + aV[0])); + const Standard_Real aScaleFactor = theAngleLength*theRadius/(aU[1] - aU[0]); + + aTrsf2d.TransformD0(aMidPnt); + + aScaleTrsf.SetScale(aMidPnt, aScaleFactor); + } + + // Get 2d presentation of a face. + Handle(Geom_Surface) aCylinder = + new Geom_CylindricalSurface(gp_Ax3(), theRadius); + GeomAdaptor_Surface aGACyl(aCylinder); + TopExp_Explorer anExp(aFace, TopAbs_WIRE); + Standard_Real aPar[2]; + TopTools_ListOfShape aWires; + Standard_Real aUResol = aGACyl.UResolution(Precision::Confusion()); + Standard_Real aVResol = aGACyl.VResolution(Precision::Confusion()); + + for (; anExp.More(); anExp.Next()) { + TopoDS_Wire aWire = TopoDS::Wire(anExp.Current()); + BRepTools_WireExplorer aWExp(aWire, aFace); + BRepBuilderAPI_MakeWire aMkWire; + + for (; aWExp.More(); aWExp.Next()) { + TopoDS_Edge anEdge = aWExp.Current(); + Handle(Geom2d_Curve) aCurve = + BRep_Tool::CurveOnSurface(anEdge, aFace, aPar[0], aPar[1]); + + if (aCurve.IsNull()) { + continue; + } + + // Transform the curve to cylinder's parametric space. + GEOMUtils::Handle(HTrsfCurve2d) aTrsfCurve = + new GEOMUtils::HTrsfCurve2d(aCurve, aPar[0], aPar[1], aTrsf2d); + Approx_Curve2d aConv (aTrsfCurve, aPar[0], aPar[1], + aUResol, aVResol, GeomAbs_C1, + 9, 1000); + + if (!aConv.IsDone() && !aConv.HasResult()) { + return aResult; + } + + Handle(Geom2d_Curve) aCylCurve = aConv.Curve(); + + if (isToScale) { + aCylCurve->Transform(aScaleTrsf); + } + + // Create edge and add it to the wire. + BRepBuilderAPI_MakeEdge aMkEdge(aCylCurve, aCylinder); + + if (!aMkEdge.IsDone()) { + return aResult; + } + + aMkWire.Add(aMkEdge.Edge()); + + if (!aMkWire.IsDone()) { + return aResult; + } + } + + if (aWire.IsSame(anOuterWire)) { + // Make the outer wire first. + aWires.Prepend(aMkWire.Wire()); + } else { + aWires.Append(aMkWire.Wire()); + } + } + + // Create a face. + if (aWires.IsEmpty()) { + return aResult; + } + + TopTools_ListIteratorOfListOfShape aWIter(aWires); + TopoDS_Wire aWire = TopoDS::Wire(aWIter.Value()); + BRepBuilderAPI_MakeFace aMkFace(aCylinder, aWire); + + if (!aMkFace.IsDone()) { + return aResult; + } + + for (aWIter.Next(); aWIter.More(); aWIter.Next()) { + aWire = TopoDS::Wire(aWIter.Value()); + aMkFace.Add(aWire); + + if (!aMkFace.IsDone()) { + return aResult; + } + } + + // Build 3D curves. + TopoDS_Face aCylFace = aMkFace.Face(); + TopoDS_Shape aResShape; + + BRepLib::BuildCurves3d(aCylFace); + + // Check shape. + if (aType == TopAbs_WIRE) { + TopExp_Explorer aResExp(aCylFace, TopAbs_WIRE); + + if (aResExp.More()) { + aResShape = aResExp.Current(); + } + } else { + aResShape = aCylFace; + } + + if (aResShape.IsNull() == Standard_False) { + if (!GEOMUtils::CheckShape(aResShape, true)) { + if (!GEOMUtils::FixShapeTolerance(aResShape)) { + return aResult; + } + } + + aResult = aResShape; + } + + return aResult; +} + IMPLEMENT_STANDARD_HANDLE (GEOMImpl_ProjectionDriver,GEOM_BaseDriver); IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_ProjectionDriver,GEOM_BaseDriver); diff --git a/src/GEOMImpl/GEOMImpl_ProjectionDriver.hxx b/src/GEOMImpl/GEOMImpl_ProjectionDriver.hxx index 5766c2392..ee703af55 100644 --- a/src/GEOMImpl/GEOMImpl_ProjectionDriver.hxx +++ b/src/GEOMImpl/GEOMImpl_ProjectionDriver.hxx @@ -58,6 +58,7 @@ #endif class TColStd_SequenceOfExtendedString; +class TopoDS_Shape; #include "GEOM_BaseDriver.hxx" @@ -81,6 +82,15 @@ Standard_EXPORT ~GEOMImpl_ProjectionDriver() {}; bool GetCreationInformation(std::string& theOperationName, std::vector& params); +private: + + TopoDS_Shape projectOnCylinder(const TopoDS_Shape &theShape, + const Standard_Real theRadius, + const Standard_Real theStartAngle, + const Standard_Real theAngleLength) const; + +public: + DEFINE_STANDARD_RTTI( GEOMImpl_ProjectionDriver ) }; diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index f4e151969..393b4303c 100644 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -185,8 +185,9 @@ #define OFFSET_THICKENING 3 #define OFFSET_THICKENING_COPY 4 -#define PROJECTION_COPY 1 -#define PROJECTION_ON_WIRE 2 +#define PROJECTION_COPY 1 +#define PROJECTION_ON_WIRE 2 +#define PROJECTION_ON_CYLINDER 3 #define SCALE_SHAPE 1 #define SCALE_SHAPE_COPY 2 diff --git a/src/GEOMUtils/CMakeLists.txt b/src/GEOMUtils/CMakeLists.txt index 4368a6342..039990ab7 100755 --- a/src/GEOMUtils/CMakeLists.txt +++ b/src/GEOMUtils/CMakeLists.txt @@ -52,6 +52,9 @@ SET(_link_LIBRARIES SET(GEOMUtils_HEADERS GEOMUtils.hxx GEOMUtils_Hatcher.hxx + GEOMUtils_HTrsfCurve2d.hxx + GEOMUtils_Trsf2d.hxx + GEOMUtils_TrsfCurve2d.hxx GEOMUtils_XmlHandler.hxx ) # --- sources --- @@ -59,6 +62,9 @@ SET(GEOMUtils_HEADERS SET(GEOMUtils_SOURCES GEOMUtils.cxx GEOMUtils_Hatcher.cxx + GEOMUtils_HTrsfCurve2d.cxx + GEOMUtils_Trsf2d.cxx + GEOMUtils_TrsfCurve2d.cxx GEOMUtils_XmlHandler.cxx ) diff --git a/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx b/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx new file mode 100644 index 000000000..976d29690 --- /dev/null +++ b/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx @@ -0,0 +1,51 @@ +// Copyright (C) 2007-2014 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, or (at your option) any later version. +// +// 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 + +namespace GEOMUtils { + IMPLEMENT_STANDARD_HANDLE (HTrsfCurve2d, Adaptor2d_HCurve2d); + IMPLEMENT_STANDARD_RTTIEXT(HTrsfCurve2d, Adaptor2d_HCurve2d); +} + +//======================================================================= +//function : TrsfCurve2d +//purpose : +//======================================================================= +GEOMUtils::HTrsfCurve2d::HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve, + const Trsf2d &theTrsf) +: myCurve (theCurve, theTrsf) +{ +} + +//======================================================================= +//function : TrsfCurve2d +//purpose : +//======================================================================= +GEOMUtils::HTrsfCurve2d::HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve, + const Standard_Real theUFirst, + const Standard_Real theULast, + const Trsf2d &theTrsf) +: myCurve (theCurve, theUFirst, theULast, theTrsf) +{ +} diff --git a/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx b/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx new file mode 100644 index 000000000..d37b7f293 --- /dev/null +++ b/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx @@ -0,0 +1,84 @@ +// Copyright (C) 2007-2014 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, or (at your option) any later version. +// +// 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 +// + +#ifndef _GEOMUtils_HTrsfCurve2d_HXX_ +#define _GEOMUtils_HTrsfCurve2d_HXX_ + + +#include + +#include + + +namespace GEOMUtils +{ + + class HTrsfCurve2d; + + DEFINE_STANDARD_HANDLE(HTrsfCurve2d, Adaptor2d_HCurve2d); + + /*! + * This class represents an adaptor curve that represents an original curve + * transformed by an anisotropic transformation. This is a class manipulated + * by handle. + */ + class HTrsfCurve2d : public Adaptor2d_HCurve2d + { + + public: + + /** + * Constructor. Initializes the object with the transformation parameters. + * Input parameters are not checked for validity. It is under responsibility + * of the caller. + */ + Standard_EXPORT HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve, + const Trsf2d &theTrsf); + + /** + * Constructor. Initializes the object with the curve, first and last + * parameters and transformation. Input parameters are not checked + * for validity. It is under responsibility of the caller. + */ + Standard_EXPORT HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve, + const Standard_Real theUFirst, + const Standard_Real theULast, + const Trsf2d &theTrsf); + + /** + * Redefined method from the base class. + */ + const Adaptor2d_Curve2d &Curve2d() const + { return myCurve; } + + private: + + TrsfCurve2d myCurve; + + public: + + DEFINE_STANDARD_RTTI(HTrsfCurve2d); + + }; +} + +#endif diff --git a/src/GEOMUtils/GEOMUtils_Trsf2d.cxx b/src/GEOMUtils/GEOMUtils_Trsf2d.cxx new file mode 100644 index 000000000..4938d4979 --- /dev/null +++ b/src/GEOMUtils/GEOMUtils_Trsf2d.cxx @@ -0,0 +1,110 @@ +// Copyright (C) 2007-2014 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, or (at your option) any later version. +// +// 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 + + +//======================================================================= +//function : Trsf2d +//purpose : +//======================================================================= +GEOMUtils::Trsf2d::Trsf2d(const Standard_Real a11, + const Standard_Real a12, + const Standard_Real a13, + const Standard_Real a21, + const Standard_Real a22, + const Standard_Real a23) +: myA11(a11), + myA12(a12), + myA13(a13), + myA21(a21), + myA22(a22), + myA23(a23) +{ +} + +//======================================================================= +//function : TransformD0 +//purpose : +//======================================================================= +void GEOMUtils::Trsf2d::TransformD0(gp_Pnt2d &thePnt) const +{ + const Standard_Real aX = myA11*thePnt.X() + myA12*thePnt.Y() + myA13; + const Standard_Real aY = myA21*thePnt.X() + myA22*thePnt.Y() + myA23; + + thePnt.SetCoord(aX, aY); +} + +//======================================================================= +//function : TransformD1 +//purpose : +//======================================================================= +void GEOMUtils::Trsf2d::TransformD1(gp_Pnt2d &thePnt, + gp_Vec2d &theVec1) const +{ + TransformVector(thePnt, theVec1); + TransformD0(thePnt); +} + +//======================================================================= +//function : TransformD2 +//purpose : +//======================================================================= +void GEOMUtils::Trsf2d::TransformD2(gp_Pnt2d &thePnt, + gp_Vec2d &theVec1, + gp_Vec2d &theVec2) const +{ + TransformVector(thePnt, theVec1); + TransformVector(thePnt, theVec2); + TransformD0(thePnt); +} + +//======================================================================= +//function : TransformD3 +//purpose : +//======================================================================= +void GEOMUtils::Trsf2d::TransformD3(gp_Pnt2d &thePnt, + gp_Vec2d &theVec1, + gp_Vec2d &theVec2, + gp_Vec2d &theVec3) const +{ + TransformVector(thePnt, theVec1); + TransformVector(thePnt, theVec2); + TransformVector(thePnt, theVec3); + TransformD0(thePnt); +} + +//======================================================================= +//function : TransformVector +//purpose : +//======================================================================= +void GEOMUtils::Trsf2d::TransformVector(const gp_Pnt2d &thePnt, + gp_Vec2d &theVec) const +{ + gp_Pnt2d aP0(thePnt.XY()); + gp_Pnt2d aP1(thePnt.XY().Added(theVec.XY())); + + TransformD0(aP0); + TransformD0(aP1); + theVec.SetXY(aP1.XY().Subtracted(aP0.XY())); +} diff --git a/src/GEOMUtils/GEOMUtils_Trsf2d.hxx b/src/GEOMUtils/GEOMUtils_Trsf2d.hxx new file mode 100644 index 000000000..c287f90d8 --- /dev/null +++ b/src/GEOMUtils/GEOMUtils_Trsf2d.hxx @@ -0,0 +1,134 @@ +// Copyright (C) 2007-2014 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, or (at your option) any later version. +// +// 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 +// + +#ifndef _GEOMUtils_Trsf2d_HXX_ +#define _GEOMUtils_Trsf2d_HXX_ + + +#include +#include +#include +#include +#include + + +/*! + * This class represents a non-persistent transformation in 2D space. + * The transformations can be represented as follow : + * + * V1 V2 T XY XY + * | a11 a12 a13 | | x | | x'| + * | a21 a22 a23 | | y | | y'| + * | 0 0 1 | | 1 | | 1 | + + * where {V1, V2} defines the vectorial part of the transformation + * and T defines the translation part of the transformation. + * This transformation can change the nature of the objects if it is + * anisotropic. + */ +namespace GEOMUtils +{ + class Trsf2d + { + + public: + + /** + * Constructor. Initializes the object with the transformation parameters. + * Input parameters are not checked for validity. It is under responsibility + * of the caller. + */ + Standard_EXPORT Trsf2d(const Standard_Real a11, + const Standard_Real a12, + const Standard_Real a13, + const Standard_Real a21, + const Standard_Real a22, + const Standard_Real a23); + + /** + * Transform the point. The passed parameter is modified to have + * a transformed value. + * + * \param thePnt the point. + */ + Standard_EXPORT void TransformD0(gp_Pnt2d &thePnt)const; + + /** + * Transform the point and the first derivative vector. The passed + * parameters are modified to have a transformed value. + * + * \param thePnt the point. + * \param theVec1 the first derivative vector. + */ + Standard_EXPORT void TransformD1(gp_Pnt2d &thePnt, + gp_Vec2d &theVec1) const; + + /** + * Transform the point, the first and second derivative vectors. The passed + * parameters are modified to have a transformed value. + * + * \param thePnt the point. + * \param theVec1 the first derivative vector. + * \param theVec2 the second derivative vector. + */ + Standard_EXPORT void TransformD2(gp_Pnt2d &thePnt, + gp_Vec2d &theVec1, + gp_Vec2d &theVec2) const; + + /** + * Transform the point, the first, second and third derivative vectors. + * The passed parameters are modified to have a transformed value. + * + * \param thePnt the point. + * \param theVec1 the first derivative vector. + * \param theVec2 the second derivative vector. + * \param theVec2 the third derivative vector. + */ + Standard_EXPORT void TransformD3(gp_Pnt2d &thePnt, + gp_Vec2d &theVec1, + gp_Vec2d &theVec2, + gp_Vec2d &theVec3) const; + + private: + + /** + * Transform the vector. + * + * \param thePnt the point. + * \param theVec the vector. + */ + void TransformVector(const gp_Pnt2d &thePnt, + gp_Vec2d &theVec) const; + + private: + + Standard_Real myA11; + Standard_Real myA12; + Standard_Real myA13; + Standard_Real myA21; + Standard_Real myA22; + Standard_Real myA23; + + }; +} + +#endif diff --git a/src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx b/src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx new file mode 100644 index 000000000..fe0707eb9 --- /dev/null +++ b/src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx @@ -0,0 +1,382 @@ +// Copyright (C) 2007-2014 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, or (at your option) any later version. +// +// 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 + +//======================================================================= +//function : TrsfCurve2d +//purpose : +//======================================================================= +GEOMUtils::TrsfCurve2d::TrsfCurve2d(const Handle(Geom2d_Curve) &theCurve, + const Trsf2d &theTrsf) +: myCurve (theCurve), + myTrsf (theTrsf) +{ +} + +//======================================================================= +//function : TrsfCurve2d +//purpose : +//======================================================================= +GEOMUtils::TrsfCurve2d::TrsfCurve2d(const Handle(Geom2d_Curve) &theCurve, + const Standard_Real theUFirst, + const Standard_Real theULast, + const Trsf2d &theTrsf) +: myCurve (theCurve, theUFirst, theULast), + myTrsf (theTrsf) +{ +} + +//======================================================================= +//function : FirstParameter +//purpose : +//======================================================================= +Standard_Real GEOMUtils::TrsfCurve2d::FirstParameter() const +{ + return myCurve.FirstParameter(); +} + +//======================================================================= +//function : LastParameter +//purpose : +//======================================================================= +Standard_Real GEOMUtils::TrsfCurve2d::LastParameter() const +{ + return myCurve.LastParameter(); +} + +//======================================================================= +//function : Curve +//purpose : +//======================================================================= +const Handle(Geom2d_Curve) &GEOMUtils::TrsfCurve2d::Curve() const +{ + return myCurve.Curve(); +} + +//======================================================================= +//function : GetType +//purpose : +//======================================================================= +GeomAbs_CurveType GEOMUtils::TrsfCurve2d::GetType() const +{ + return GeomAbs_OtherCurve; +} + +//======================================================================= +//function : Load +//purpose : +//======================================================================= +void GEOMUtils::TrsfCurve2d::Load(const Handle(Geom2d_Curve) &C) +{ + myCurve.Load(C); +} + +//======================================================================= +//function : Load +//purpose : +//======================================================================= +void GEOMUtils::TrsfCurve2d::Load(const Handle(Geom2d_Curve) &C, + const Standard_Real UFirst, + const Standard_Real ULast) +{ + myCurve.Load(C, UFirst, ULast); +} + +//======================================================================= +//function : Continuity +//purpose : +//======================================================================= +GeomAbs_Shape GEOMUtils::TrsfCurve2d::Continuity() const +{ + return myCurve.Continuity(); +} + +//======================================================================= +//function : NbIntervals +//purpose : +//======================================================================= +Standard_Integer GEOMUtils::TrsfCurve2d::NbIntervals + (const GeomAbs_Shape S) const +{ + return myCurve.NbIntervals(S); +} + +//======================================================================= +//function : Intervals +//purpose : +//======================================================================= +void GEOMUtils::TrsfCurve2d::Intervals(TColStd_Array1OfReal &T, + const GeomAbs_Shape S) const +{ + myCurve.Intervals(T, S); +} + +//======================================================================= +//function : Trim +//purpose : +//======================================================================= +Handle(Adaptor2d_HCurve2d) GEOMUtils::TrsfCurve2d::Trim + (const Standard_Real First, const Standard_Real Last, + const Standard_Real /*Tol*/) const +{ + Handle(Geom2d_Curve) aCurve = myCurve.Curve(); + GEOMUtils::Handle(HTrsfCurve2d) aAHCurve = + new GEOMUtils::HTrsfCurve2d(aCurve, First, Last, myTrsf); + + return aAHCurve; +} + +//======================================================================= +//function : IsClosed +//purpose : +//======================================================================= +Standard_Boolean GEOMUtils::TrsfCurve2d::IsClosed() const +{ + return myCurve.IsClosed(); +} + +//======================================================================= +//function : IsPeriodic +//purpose : +//======================================================================= +Standard_Boolean GEOMUtils::TrsfCurve2d::IsPeriodic() const +{ + return myCurve.IsPeriodic(); +} + +//======================================================================= +//function : Period +//purpose : +//======================================================================= +Standard_Real GEOMUtils::TrsfCurve2d::Period() const +{ + return myCurve.Period(); +} + +//======================================================================= +//function : Value +//purpose : +//======================================================================= +gp_Pnt2d GEOMUtils::TrsfCurve2d::Value(const Standard_Real U) const +{ + gp_Pnt2d aPnt = myCurve.Value(U); + + myTrsf.TransformD0(aPnt); + + return aPnt; +} + +//======================================================================= +//function : D0 +//purpose : +//======================================================================= +void GEOMUtils::TrsfCurve2d::D0(const Standard_Real U, gp_Pnt2d &P) const +{ + myCurve.D0(U, P); + myTrsf.TransformD0(P); +} + +//======================================================================= +//function : D1 +//purpose : +//======================================================================= +void GEOMUtils::TrsfCurve2d::D1(const Standard_Real U, + gp_Pnt2d &P, gp_Vec2d &V) const +{ + myCurve.D1(U, P, V); + myTrsf.TransformD1(P, V); +} + +//======================================================================= +//function : D2 +//purpose : +//======================================================================= +void GEOMUtils::TrsfCurve2d::D2(const Standard_Real U, gp_Pnt2d &P, + gp_Vec2d &V1, gp_Vec2d &V2) const +{ + myCurve.D2(U, P, V1, V2); + myTrsf.TransformD2(P, V1, V2); +} + +//======================================================================= +//function : D3 +//purpose : +//======================================================================= +void GEOMUtils::TrsfCurve2d::D3(const Standard_Real U, gp_Pnt2d &P, + gp_Vec2d &V1, gp_Vec2d &V2, gp_Vec2d &V3) const +{ + myCurve.D3(U, P, V1, V2, V3); + myTrsf.TransformD3(P, V1, V2, V3); +} + +//======================================================================= +//function : DN +//purpose : +//======================================================================= +gp_Vec2d GEOMUtils::TrsfCurve2d::DN(const Standard_Real U, + const Standard_Integer N) const +{ + gp_Pnt2d aPnt = myCurve.Value(U); + gp_Vec2d aVec = myCurve.DN(U, N); + + myTrsf.TransformD1(aPnt, aVec); +} + +//======================================================================= +//function : Resolution +//purpose : +//======================================================================= +Standard_Real GEOMUtils::TrsfCurve2d::Resolution(const Standard_Real Ruv) const +{ + return Precision::Parametric(Ruv); +} + +//======================================================================= +//function : Line +//purpose : +//======================================================================= +gp_Lin2d GEOMUtils::TrsfCurve2d::Line() const +{ + Standard_NoSuchObject::Raise(); + + return gp_Lin2d(); +} + +//======================================================================= +//function : Circle +//purpose : +//======================================================================= +gp_Circ2d GEOMUtils::TrsfCurve2d::Circle() const +{ + Standard_NoSuchObject::Raise(); + + return gp_Circ2d(); +} + +//======================================================================= +//function : Ellipse +//purpose : +//======================================================================= +gp_Elips2d GEOMUtils::TrsfCurve2d::Ellipse() const +{ + Standard_NoSuchObject::Raise(); + + return gp_Elips2d(); +} + +//======================================================================= +//function : Hyperbola +//purpose : +//======================================================================= +gp_Hypr2d GEOMUtils::TrsfCurve2d::Hyperbola() const +{ + Standard_NoSuchObject::Raise(); + + return gp_Hypr2d(); +} + +//======================================================================= +//function : Parabola +//purpose : +//======================================================================= +gp_Parab2d GEOMUtils::TrsfCurve2d::Parabola() const +{ + Standard_NoSuchObject::Raise(); + + return gp_Parab2d(); +} + +//======================================================================= +//function : Degree +//purpose : +//======================================================================= +Standard_Integer GEOMUtils::TrsfCurve2d::Degree() const +{ + Standard_NoSuchObject::Raise(); + + return 0; +} + +//======================================================================= +//function : IsRational +//purpose : +//======================================================================= +Standard_Boolean GEOMUtils::TrsfCurve2d::IsRational() const +{ + return Standard_False; +} + +//======================================================================= +//function : NbPoles +//purpose : +//======================================================================= +Standard_Integer GEOMUtils::TrsfCurve2d::NbPoles() const +{ + Standard_NoSuchObject::Raise(); + + return 0; +} + +//======================================================================= +//function : NbKnots +//purpose : +//======================================================================= +Standard_Integer GEOMUtils::TrsfCurve2d::NbKnots() const +{ + Standard_NoSuchObject::Raise(); + + return 0; +} + +//======================================================================= +//function : Bezier +//purpose : +//======================================================================= +Handle(Geom2d_BezierCurve) GEOMUtils::TrsfCurve2d::Bezier() const +{ + Standard_NoSuchObject::Raise(); + + return NULL; +} + +//======================================================================= +//function : BSpline +//purpose : +//======================================================================= +Handle(Geom2d_BSplineCurve) GEOMUtils::TrsfCurve2d::BSpline() const +{ + Standard_NoSuchObject::Raise(); + + return NULL; +} + +//======================================================================= +//function : NbSamples +//purpose : +//======================================================================= +Standard_Integer GEOMUtils::TrsfCurve2d::NbSamples() const +{ + return myCurve.NbSamples(); +} diff --git a/src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx b/src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx new file mode 100644 index 000000000..b3bd19433 --- /dev/null +++ b/src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx @@ -0,0 +1,242 @@ +// Copyright (C) 2007-2014 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, or (at your option) any later version. +// +// 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 +// + +#ifndef _GEOMUtils_TrsfCurve2d_HXX_ +#define _GEOMUtils_TrsfCurve2d_HXX_ + + +#include + +#include +#include +#include +#include +#include + + +namespace GEOMUtils +{ + /*! + * This class represents an adaptor curve that represents an original curve + * transformed by an anisotropic transformation. + */ + class TrsfCurve2d : public Adaptor2d_Curve2d + { + + public: + + /** + * Constructor. Initializes the object with the transformation parameters. + * Input parameters are not checked for validity. It is under responsibility + * of the caller. + */ + Standard_EXPORT TrsfCurve2d(const Handle(Geom2d_Curve) &theCurve, + const Trsf2d &theTrsf); + + /** + * Constructor. Initializes the object with the curve, first and last + * parameters and transformation. Input parameters are not checked + * for validity. It is under responsibility of the caller. + */ + Standard_EXPORT TrsfCurve2d(const Handle(Geom2d_Curve) &theCurve, + const Standard_Real theUFirst, + const Standard_Real theULast, + const Trsf2d &theTrsf); + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Real FirstParameter() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Real LastParameter() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT const Handle(Geom2d_Curve)& Curve() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT GeomAbs_CurveType GetType() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT void Load(const Handle(Geom2d_Curve) &C); + + /** + * Redefined method from the base class. + */ + Standard_EXPORT void Load(const Handle(Geom2d_Curve) &C, + const Standard_Real UFirst, + const Standard_Real ULast); + + /** + * Redefined method from the base class. + */ + Standard_EXPORT GeomAbs_Shape Continuity() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Integer NbIntervals(const GeomAbs_Shape S) const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT void Intervals(TColStd_Array1OfReal &T, + const GeomAbs_Shape S) const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Handle(Adaptor2d_HCurve2d) Trim + (const Standard_Real First, const Standard_Real Last, + const Standard_Real ) const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Boolean IsClosed() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Boolean IsPeriodic() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Real Period() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT gp_Pnt2d Value(const Standard_Real U) const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT void D0(const Standard_Real U, gp_Pnt2d &P) const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT void D1(const Standard_Real U, + gp_Pnt2d &P, gp_Vec2d &V) const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT void D2(const Standard_Real U, gp_Pnt2d &P, + gp_Vec2d &V1, gp_Vec2d &V2) const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT void D3(const Standard_Real U, gp_Pnt2d &P, + gp_Vec2d &V1, gp_Vec2d &V2, gp_Vec2d &V3) const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT gp_Vec2d DN(const Standard_Real U, + const Standard_Integer N) const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Real Resolution(const Standard_Real Ruv) const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT gp_Lin2d Line() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT gp_Circ2d Circle() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT gp_Elips2d Ellipse() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT gp_Hypr2d Hyperbola() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT gp_Parab2d Parabola() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Integer Degree() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Boolean IsRational() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Integer NbPoles() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Integer NbKnots() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Handle(Geom2d_BezierCurve) Bezier() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Handle(Geom2d_BSplineCurve) BSpline() const; + + /** + * Redefined method from the base class. + */ + Standard_EXPORT Standard_Integer NbSamples() const; + + private: + + Geom2dAdaptor_Curve myCurve; + Trsf2d myTrsf; + + }; +} + +#endif diff --git a/src/GEOM_I/GEOM_ITransformOperations_i.cc b/src/GEOM_I/GEOM_ITransformOperations_i.cc index 2281957e3..c18c87b6c 100644 --- a/src/GEOM_I/GEOM_ITransformOperations_i.cc +++ b/src/GEOM_I/GEOM_ITransformOperations_i.cc @@ -1392,3 +1392,37 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RecomputeObject return aGEOMObject._retn(); } + +//============================================================================= +/*! + * MakeProjectionOnCylinder + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MakeProjectionOnCylinder + (GEOM::GEOM_Object_ptr theObject, + CORBA::Double theRadius, + CORBA::Double theStartAngle, + CORBA::Double theAngleLength) +{ + GEOM::GEOM_Object_var aGEOMObject; + + //Set a not done flag + GetOperations()->SetNotDone(); + + //Get the object + Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + + if (anObject.IsNull()) { + return aGEOMObject._retn(); + } + + //Perform the transformation + Handle(GEOM_Object) aResObject = GetOperations()->MakeProjectionOnCylinder + (anObject, theRadius, theStartAngle, theAngleLength); + + if (!GetOperations()->IsDone() || aResObject.IsNull()) { + return aGEOMObject._retn(); + } + + return GetObject(aResObject); +} diff --git a/src/GEOM_I/GEOM_ITransformOperations_i.hh b/src/GEOM_I/GEOM_ITransformOperations_i.hh index 40a5903ed..e507c1f77 100644 --- a/src/GEOM_I/GEOM_ITransformOperations_i.hh +++ b/src/GEOM_I/GEOM_ITransformOperations_i.hh @@ -197,6 +197,11 @@ class GEOM_I_EXPORT GEOM_ITransformOperations_i : GEOM::GEOM_Object_ptr RecomputeObject (GEOM::GEOM_Object_ptr theObject); + GEOM::GEOM_Object_ptr MakeProjectionOnCylinder + (GEOM::GEOM_Object_ptr theObject, + CORBA::Double theRadius, + CORBA::Double theStartAngle, + CORBA::Double theAngleLength); ::GEOMImpl_ITransformOperations* GetOperations() { return (::GEOMImpl_ITransformOperations*)GetImpl(); } }; diff --git a/src/GEOM_SWIG/GEOM_TestAll.py b/src/GEOM_SWIG/GEOM_TestAll.py index 3aa3eff61..683918508 100644 --- a/src/GEOM_SWIG/GEOM_TestAll.py +++ b/src/GEOM_SWIG/GEOM_TestAll.py @@ -272,6 +272,7 @@ def TestAll (geompy, math): Position2 = geompy.PositionAlongPath(Box, Arc, 0.5, 1, 0) #(2 GEOM_Object, 1 Double, 2 Bool)->GEOM_Object Offset = geompy.MakeOffset(Box, 10.) #(GEOM_Object, Double)->GEOM_Object ProjOnWire = geompy.MakeProjectionOnWire(p0, Wire) + ProjOnCyl = geompy.MakeProjectionOnCylinder(Wire, 100) Orientation = geompy.ChangeOrientation(Box) ExtEdge = geompy.ExtendEdge(Edge1, -0.3, 1.3) ExtFace = geompy.ExtendFace(Face5, -0.3, 1.3, -0.1, 1.1) @@ -497,6 +498,7 @@ def TestAll (geompy, math): id_Offset = geompy.addToStudy(Offset, "Offset") id_Orientation = geompy.addToStudy(Orientation, "Orientation") id_ProjOnWire = geompy.addToStudy(ProjOnWire[1], "ProjOnWire") + id_ProjOnCyl = geompy.addToStudy(ProjOnCyl, "ProjOnCyl") id_ExtEdge = geompy.addToStudy(ExtEdge, "ExtendedEdge") id_ExtFace = geompy.addToStudy(ExtFace, "ExtendedFace") id_Surface = geompy.addToStudy(Surface, "Surface From Face") diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py index 531c1bf18..5287a1194 100644 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -9403,6 +9403,67 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName) return anObj + ## + # Compute a wire or a face that represents a projection of the source + # shape onto cylinder. The cylinder's coordinate system is the same + # as the global coordinate system. + # + # @param theObject The object to be projected. It can be either + # a planar wire or a face. + # @param theRadius The radius of the cylinder. + # @param theStartAngle The starting angle in radians from + # the cylinder's X axis around Z axis. The angle from which + # the projection is started. + # @param theAngleLength The projection length angle in radians. + # The angle in which to project the total length of the wire. + # If it is negative the projection is not scaled and natural + # wire length is kept for the projection. + # @param theName Object name; when specified, this parameter is used + # for result publication in the study. Otherwise, if automatic + # publication is switched on, default value is used for result name. + # + # @return New GEOM.GEOM_Object, containing the result shape. The result + # represents a wire or a face that represents a projection of + # the source shape onto a cylinder. + # + # @ref tui_projection "Example" + def MakeProjectionOnCylinder (self, theObject, theRadius, + theStartAngle=0.0, theAngleLength=-1.0, + theName=None): + """ + Compute a wire or a face that represents a projection of the source + shape onto cylinder. The cylinder's coordinate system is the same + as the global coordinate system. + + Parameters: + theObject The object to be projected. It can be either + a planar wire or a face. + theRadius The radius of the cylinder. + theStartAngle The starting angle in radians from the cylinder's X axis + around Z axis. The angle from which the projection is started. + theAngleLength The projection length angle in radians. The angle in which + to project the total length of the wire. If it is negative the + projection is not scaled and natural wire length is kept for + the projection. + theName Object name; when specified, this parameter is used + for result publication in the study. Otherwise, if automatic + publication is switched on, default value is used for result name. + + Returns: + New GEOM.GEOM_Object, containing the result shape. The result + represents a wire or a face that represents a projection of + the source shape onto a cylinder. + """ + # Example: see GEOM_TestAll.py + theRadius, theStartAngle, theAngleLength, Parameters = ParseParameters( + theRadius, theStartAngle, theAngleLength) + anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius, + theStartAngle, theAngleLength) + RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp) + anObj.SetParameters(Parameters) + self._autoPublish(anObj, theName, "projection") + return anObj + # end of l3_transform ## @} diff --git a/src/TransformationGUI/CMakeLists.txt b/src/TransformationGUI/CMakeLists.txt index e60a2e84b..2b4b75858 100755 --- a/src/TransformationGUI/CMakeLists.txt +++ b/src/TransformationGUI/CMakeLists.txt @@ -75,6 +75,7 @@ SET(TransformationGUI_HEADERS TransformationGUI_ScaleDlg.h TransformationGUI_OffsetDlg.h TransformationGUI_ProjectionDlg.h + TransformationGUI_ProjectionOnCylDlg.h TransformationGUI_PositionDlg.h ) @@ -89,6 +90,7 @@ SET(_moc_HEADERS TransformationGUI_ScaleDlg.h TransformationGUI_OffsetDlg.h TransformationGUI_ProjectionDlg.h + TransformationGUI_ProjectionOnCylDlg.h TransformationGUI_PositionDlg.h ) @@ -111,6 +113,7 @@ SET(TransformationGUI_SOURCES TransformationGUI_ScaleDlg.cxx TransformationGUI_OffsetDlg.cxx TransformationGUI_ProjectionDlg.cxx + TransformationGUI_ProjectionOnCylDlg.cxx TransformationGUI_PositionDlg.cxx ${_moc_SOURCES} ${_uic_files} diff --git a/src/TransformationGUI/TransformationGUI.cxx b/src/TransformationGUI/TransformationGUI.cxx index 47be80cd1..943e2126b 100644 --- a/src/TransformationGUI/TransformationGUI.cxx +++ b/src/TransformationGUI/TransformationGUI.cxx @@ -49,6 +49,7 @@ #include "TransformationGUI_OffsetDlg.h" // Method OFFSET #include "TransformationGUI_ProjectionDlg.h" // Method PROJECTION #include "TransformationGUI_PositionDlg.h" // Method POSITION +#include "TransformationGUI_ProjectionOnCylDlg.h" // Method PROJECTION ON CYLINDER //======================================================================= // function : TransformationGUI() @@ -102,6 +103,9 @@ bool TransformationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) case GEOMOp::OpProjection: // PROJECTION aDlg = new TransformationGUI_ProjectionDlg( getGeometryGUI(), parent ); break; + case GEOMOp::OpProjOnCyl: // PROJECTION ON CYLINDER + aDlg = new TransformationGUI_ProjectionOnCylDlg( getGeometryGUI(), parent ); + break; case GEOMOp::OpMultiTranslate: // MULTI TRANSLATION aDlg = new TransformationGUI_MultiTranslationDlg( getGeometryGUI(), parent ); break; diff --git a/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx b/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx new file mode 100644 index 000000000..d3efac641 --- /dev/null +++ b/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx @@ -0,0 +1,360 @@ +// Copyright (C) 2007-2014 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, or (at your option) any later version. +// +// 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 : TransformationGUI_ProjectionOnCylDlg.cxx +// Author : Sergey KHROMOV, Open CASCADE S.A.S. + +#include "TransformationGUI_ProjectionOnCylDlg.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +//================================================================================= +// class : TransformationGUI_ProjectionOnCylDlg() +// purpose : Constructs a TransformationGUI_ProjectionOnCylDlg 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. +//================================================================================= +TransformationGUI_ProjectionOnCylDlg::TransformationGUI_ProjectionOnCylDlg +(GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl) + : GEOMBase_Skeleton (theGeometryGUI, parent, modal, fl), + myObjectName (0), + mySelButton (0), + myRadiusSpin (0), + myStartAngleSpin (0), + myUseAngleLen (0), + myAngleLenSpin (0) +{ + SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); + QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICO_DLG_PROJ_ON_CYL"))); + QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); + + setWindowTitle(tr("GEOM_PROJ_ON_CYL_TITLE")); + + /***************************************************************/ + mainFrame()->GroupConstructors->setTitle(tr("GEOM_PROJECTION_TITLE")); + mainFrame()->RadioButton1->setIcon(image0); + mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton2->close(); + mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton3->close(); + + QGroupBox *aGrpParams = + new QGroupBox(tr("GEOM_ARGUMENTS"), centralWidget()); + QGridLayout *aParamsLayout = new QGridLayout(aGrpParams); + QLabel *anObjLbl = new QLabel(tr("GEOM_OBJECT"), aGrpParams); + QLabel *aRadiusLbl = new QLabel(tr("GEOM_RADIUS"), aGrpParams); + QLabel *aStartAngleLbl = + new QLabel(tr("GEOM_PROJ_ON_CYL_START_ANGLE"), aGrpParams); + QLabel *anAngleLenLbl = + new QLabel(tr("GEOM_PROJ_ON_CYL_LENGTH_ANGLE"), aGrpParams); + + myObjectName = new QLineEdit(aGrpParams); + mySelButton = new QPushButton(aGrpParams); + myRadiusSpin = new SalomeApp_DoubleSpinBox(aGrpParams); + myStartAngleSpin = new SalomeApp_DoubleSpinBox(aGrpParams); + myUseAngleLen = new QCheckBox(aGrpParams); + myAngleLenSpin = new SalomeApp_DoubleSpinBox(aGrpParams); + + myObjectName->setReadOnly(true); + mySelButton->setIcon(image1); + mySelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + myUseAngleLen->setChecked(false); + + aParamsLayout->setMargin(9); + aParamsLayout->setSpacing(6); + aParamsLayout->addWidget(anObjLbl, 0, 1); + aParamsLayout->addWidget(mySelButton, 0, 2); + aParamsLayout->addWidget(myObjectName, 0, 3); + aParamsLayout->addWidget(aRadiusLbl, 1, 1); + aParamsLayout->addWidget(myRadiusSpin, 1, 2, 1, 2); + aParamsLayout->addWidget(aStartAngleLbl, 2, 1); + aParamsLayout->addWidget(myStartAngleSpin, 2, 2, 1, 2); + aParamsLayout->addWidget(myUseAngleLen, 3, 0); + aParamsLayout->addWidget(anAngleLenLbl, 3, 1); + aParamsLayout->addWidget(myAngleLenSpin, 3, 2, 1, 2); + + QVBoxLayout* layout = new QVBoxLayout( centralWidget() ); + layout->setMargin( 0 ); layout->setSpacing( 6 ); + layout->addWidget( aGrpParams ); + + /***************************************************************/ + + setHelpFileName("projection_on_cylinder_operation_page.html"); + + Init(); +} + +//================================================================================= +// function : ~TransformationGUI_ProjectionOnCylDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +TransformationGUI_ProjectionOnCylDlg::~TransformationGUI_ProjectionOnCylDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void TransformationGUI_ProjectionOnCylDlg::Init() +{ + showOnlyPreviewControl(); + + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + double aStep = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100); + double aSpecificStep = 5; + double aRadius = 100.0; + double aStartAngle = 0.; + double anAngleLen = 360.; + + initSpinBox(myRadiusSpin, 0.00001, COORD_MAX, aStep, "length_precision"); + initSpinBox(myStartAngleSpin, -180., 180., aSpecificStep, "angle_precision"); + initSpinBox(myAngleLenSpin, 0.00001, COORD_MAX, aSpecificStep, "angle_precision"); + + myRadiusSpin->setValue(aRadius); + myStartAngleSpin->setValue(aStartAngle); + myAngleLenSpin->setValue(anAngleLen); + + myObjectName->setText(""); + myUseAngleLen->setChecked(true); + + // signals and slots connections + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); + + connect(mySelButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(myRadiusSpin, SIGNAL(valueChanged(double)), this, SLOT(processPreview())); + connect(myStartAngleSpin, SIGNAL(valueChanged(double)), this, SLOT(processPreview())); + connect(myAngleLenSpin, SIGNAL(valueChanged(double)), this, SLOT(processPreview())); + connect(myUseAngleLen, SIGNAL(clicked()), this, SLOT(SetUseLengthAngle())); + + connect(myGeomGUI->getApp()->selectionMgr(),SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + + initName(tr("GEOM_PROJECTION_NAME")); + + buttonOk()->setEnabled(false); + buttonApply()->setEnabled(false); + + activateSelection(); + SelectionIntoArgument(); +} + +//================================================================================= +// function : ClickOnOk() +// purpose : +//================================================================================= +void TransformationGUI_ProjectionOnCylDlg::ClickOnOk() +{ + setIsApplyAndClose( true ); + if (ClickOnApply()) + ClickOnCancel(); +} + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +bool TransformationGUI_ProjectionOnCylDlg::ClickOnApply() +{ + if ( !onAccept() ) + return false; + + initName(); + return true; +} + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection is changed or on dialog initialization or activation +//================================================================================= +void TransformationGUI_ProjectionOnCylDlg::SelectionIntoArgument() +{ + erasePreview(); + myObj = GEOM::GEOM_Object::_nil(); + + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + SALOME_ListIO aSelList; + aSelMgr->selectedObjects(aSelList); + + if (aSelList.Extent() == 1) { + // Single object is selected. + GEOM::GEOM_Object_var aSelectedObject = + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + + if (aSelectedObject->_is_nil()) { + // Null object. + myObjectName->setText(""); + buttonOk()->setEnabled(false); + buttonApply()->setEnabled(false); + } else { + // Not Null object. + myObj = aSelectedObject; + myObjectName->setText(GEOMBase::GetName(myObj)); + buttonOk()->setEnabled(true); + buttonApply()->setEnabled(true); + } + } else { + // Not a single object is selected. + myObjectName->setText(""); + buttonOk()->setEnabled(false); + buttonApply()->setEnabled(false); + } + + processPreview(); +} + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void TransformationGUI_ProjectionOnCylDlg::SetEditCurrentArgument() +{ + myObjectName->setFocus(); + myEditCurrentArgument = myObjectName; + SelectionIntoArgument(); +} + +//================================================================================= +// function : SetUseLengthAngle() +// purpose : +//================================================================================= +void TransformationGUI_ProjectionOnCylDlg::SetUseLengthAngle() +{ + myAngleLenSpin->setEnabled(myUseAngleLen->isChecked()); + processPreview(); +} + +//================================================================================= +// function : activateSelection +// purpose : activate selection of wires or faces +//================================================================================= +void TransformationGUI_ProjectionOnCylDlg::activateSelection() +{ + TColStd_MapOfInteger aMap; + + aMap.Add(GEOM_WIRE); + aMap.Add(GEOM_FACE); + globalSelection(aMap); +} + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void TransformationGUI_ProjectionOnCylDlg::ActivateThisDialog() +{ + GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); + + activateSelection(); +} + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void TransformationGUI_ProjectionOnCylDlg::enterEvent (QEvent*) +{ + if (!mainFrame()->GroupConstructors->isEnabled()) + ActivateThisDialog(); +} + +//================================================================================= +// function : createOperation +// purpose : +//================================================================================= +GEOM::GEOM_IOperations_ptr TransformationGUI_ProjectionOnCylDlg::createOperation() +{ + return getGeomEngine()->GetITransformOperations(getStudyId()); +} + +//================================================================================= +// function : isValid +// purpose : +//================================================================================= +bool TransformationGUI_ProjectionOnCylDlg::isValid (QString &msg) +{ + bool isOk = false; + + if (!myObj->_is_nil() && + myRadiusSpin->isValid(msg, !IsPreview()) && + myStartAngleSpin->isValid(msg, !IsPreview())) { + if (myUseAngleLen->isChecked()) { + // Check length angle spin. + isOk = myAngleLenSpin->isValid(msg, !IsPreview()); + } else { + // Don't check length angle spin. + isOk = true; + } + } + + return isOk; +} + +//================================================================================= +// function : execute +// purpose : +//================================================================================= +bool TransformationGUI_ProjectionOnCylDlg::execute (ObjectList& objects) +{ + GEOM::GEOM_ITransformOperations_var anOper = + GEOM::GEOM_ITransformOperations::_narrow(getOperation()); + + double aRadius = myRadiusSpin->value(); + double aStartAngle = myStartAngleSpin->value()*M_PI/180.; + double aLengthAngle = -1.; + + if (myUseAngleLen->isChecked()) { + aLengthAngle = myAngleLenSpin->value()*M_PI/180.; + } + + GEOM::GEOM_Object_var anObj = anOper->MakeProjectionOnCylinder + (myObj, aRadius, aStartAngle, aLengthAngle); + + if (!anObj->_is_nil()) { + objects.push_back(anObj._retn()); + } + + return true; +} diff --git a/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.h b/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.h new file mode 100644 index 000000000..beb16d976 --- /dev/null +++ b/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.h @@ -0,0 +1,78 @@ +// Copyright (C) 2007-2014 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, or (at your option) any later version. +// +// 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 : TransformationGUI_ProjectionOnCylDlg.h +// Author : Sergey KHROMOV, Open CASCADE S.A.S. +// +#ifndef TRANSFORMATIONGUI_PROJECTIONONCYLDLG_H +#define TRANSFORMATIONGUI_PROJECTIONONCYLDLG_H + + +#include "GEOMBase_Skeleton.h" + + +//================================================================================= +// class : TransformationGUI_ProjectionOnCylDlg +// purpose : +//================================================================================= +class TransformationGUI_ProjectionOnCylDlg : public GEOMBase_Skeleton +{ + Q_OBJECT + +public: + TransformationGUI_ProjectionOnCylDlg(GeometryGUI*, QWidget* = 0, + bool = false, Qt::WindowFlags = 0); + ~TransformationGUI_ProjectionOnCylDlg(); + +protected: + // redefined from GEOMBase_Helper + virtual GEOM::GEOM_IOperations_ptr createOperation(); + virtual bool isValid(QString &msg); + virtual bool execute(ObjectList &); + +private: + void Init(); + void enterEvent( QEvent* ); + void activateSelection(); + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + void ActivateThisDialog(); + void SelectionIntoArgument(); + void SetEditCurrentArgument(); + void SetUseLengthAngle(); + +private: + + GEOM::GEOM_Object_var myObj; + QLineEdit *myObjectName; + QPushButton *mySelButton; + SalomeApp_DoubleSpinBox *myRadiusSpin; + SalomeApp_DoubleSpinBox *myStartAngleSpin; + QCheckBox *myUseAngleLen; + SalomeApp_DoubleSpinBox *myAngleLenSpin; + +}; + +#endif // TRANSFORMATIONGUI_PROJECTIONONCYLDLG_H -- 2.30.2