From a647cea48dc31162d36d1f86aea990e4cd49bc89 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 5 Aug 2009 12:59:08 +0000 Subject: [PATCH] Issue 0020336: [CEA 339] specifying a cut line with 2 points --- doc/salome/gui/VISU/images/cutsegment.png | Bin 0 -> 24559 bytes doc/salome/gui/VISU/images/cutsegmenticon.jpg | Bin 0 -> 822 bytes .../gui/VISU/images/cutsegmentprsnt.png | Bin 0 -> 8657 bytes doc/salome/gui/VISU/input/cut_segment.doc | 66 +++ .../gui/VISU/input/field_presentations.doc | 1 + .../gui/VISU/input/table_presentations.doc | 5 +- idl/VISU_Gen.idl | 103 +++- resources/Makefile.am | 3 + resources/SalomeApp.xml | 1 + resources/VISU_en.xml | 2 + resources/VISU_fr.xml | 2 + resources/Visu_cutsegment.png | Bin 0 -> 572 bytes resources/Visu_tree_cutsegment.png | Bin 0 -> 466 bytes resources/Visu_tree_cutsegment_gr.png | Bin 0 -> 511 bytes src/ENGINE/VISU_Engine_i.cc | 12 + src/ENGINE/VISU_Engine_i.hh | 8 + src/PIPELINE/Makefile.am | 4 + src/PIPELINE/VISU_CutLinesBasePL.cxx | 40 ++ src/PIPELINE/VISU_CutLinesBasePL.hxx | 98 ++++ src/PIPELINE/VISU_CutLinesPL.cxx | 3 - src/PIPELINE/VISU_CutLinesPL.hxx | 51 +- src/PIPELINE/VISU_CutSegmentPL.cxx | 216 ++++++++ src/PIPELINE/VISU_CutSegmentPL.hxx | 96 ++++ src/VISUGUI/Makefile.am | 3 + src/VISUGUI/VISU_images.ts | 12 + src/VISUGUI/VISU_msg_en.ts | 71 ++- src/VISUGUI/VisuGUI.cxx | 88 ++- src/VISUGUI/VisuGUI.h | 2 + src/VISUGUI/VisuGUI_ActionsDef.h | 2 + src/VISUGUI/VisuGUI_CutSegmentDlg.cxx | 514 ++++++++++++++++++ src/VISUGUI/VisuGUI_CutSegmentDlg.h | 101 ++++ src/VISUGUI/VisuGUI_Module.cxx | 4 +- src/VISUGUI/VisuGUI_Prs3dTools.h | 4 +- src/VISUGUI/VisuGUI_Selection.cxx | 1 + src/VISUGUI/VisuGUI_TimeAnimation.cxx | 41 +- src/VISUGUI/VisuGUI_Tools.cxx | 1 + src/VISU_I/Makefile.am | 4 + src/VISU_I/VISUConfig.cc | 4 +- src/VISU_I/VISU_ColoredPrs3dFactory.cc | 5 + src/VISU_I/VISU_ColoredPrs3dFactory.hh | 15 +- src/VISU_I/VISU_CutLinesBase_i.cc | 468 ++++++++++++++++ src/VISU_I/VISU_CutLinesBase_i.hh | 140 +++++ src/VISU_I/VISU_CutLines_i.cc | 348 +----------- src/VISU_I/VISU_CutLines_i.hh | 55 +- src/VISU_I/VISU_CutSegment_i.cc | 305 +++++++++++ src/VISU_I/VISU_CutSegment_i.hh | 159 ++++++ src/VISU_I/VISU_DumpPython.cc | 50 ++ src/VISU_I/VISU_Gen_i.cc | 17 + src/VISU_I/VISU_Gen_i.hh | 8 + src/VISU_I/VISU_I.cxx | 1 + src/VISU_I/VISU_PointMap3d_i.cc | 14 +- src/VISU_I/VISU_Table_i.cc | 14 +- src/VISU_I/VISU_TimeAnimation.cxx | 15 + src/VISU_SWIG/batchmode_visu_view3d.py | 43 ++ src/VISU_SWIG/visu.py | 46 ++ src/VISU_SWIG/visu_cache.py | 1 + src/VISU_SWIG/visu_view3d.py | 43 ++ 57 files changed, 2783 insertions(+), 527 deletions(-) create mode 100644 doc/salome/gui/VISU/images/cutsegment.png create mode 100755 doc/salome/gui/VISU/images/cutsegmenticon.jpg create mode 100755 doc/salome/gui/VISU/images/cutsegmentprsnt.png create mode 100644 doc/salome/gui/VISU/input/cut_segment.doc create mode 100644 resources/Visu_cutsegment.png create mode 100644 resources/Visu_tree_cutsegment.png create mode 100644 resources/Visu_tree_cutsegment_gr.png create mode 100644 src/PIPELINE/VISU_CutLinesBasePL.cxx create mode 100644 src/PIPELINE/VISU_CutLinesBasePL.hxx create mode 100644 src/PIPELINE/VISU_CutSegmentPL.cxx create mode 100644 src/PIPELINE/VISU_CutSegmentPL.hxx create mode 100644 src/VISUGUI/VisuGUI_CutSegmentDlg.cxx create mode 100644 src/VISUGUI/VisuGUI_CutSegmentDlg.h create mode 100644 src/VISU_I/VISU_CutLinesBase_i.cc create mode 100644 src/VISU_I/VISU_CutLinesBase_i.hh create mode 100644 src/VISU_I/VISU_CutSegment_i.cc create mode 100644 src/VISU_I/VISU_CutSegment_i.hh diff --git a/doc/salome/gui/VISU/images/cutsegment.png b/doc/salome/gui/VISU/images/cutsegment.png new file mode 100644 index 0000000000000000000000000000000000000000..c75bf7e79b3f16f18b5dc140b52f5fd0481fce3f GIT binary patch literal 24559 zcmb@u1yq#nzBddOiV6w>(jwi`4N5oC4N5oC4Jx7_G14)>(A~{Y(p}QsLwEOk&9k3< z&OYbt_pJ9@>tij~VrH0`>%QXu|J7~4dwGec=mh8}C@4>*Bt?}_P*8_ZQ0{m>d;p$F z*O7UQg7OMQO7xwIYy8%Xi|31x$=~~PQAXIWB41!h3O~n!yVIhEGQFn5dVlY+KluHA znvCj`htU{cyGC+#9!9?wE_y{%dnBJGO`~*&;+HtqAIXVRNDK$Ggt8`^f3Dy3qYI*k z$MmFgi*02q@6N#MZ_kANv6Szcm4_+#JrjQDASSNYJXYy#!`ch|z!-?fY`nybmZt^- zFMWJ^4cq=bUYwe*HkT;Chk7HQFFl=#sq)8KN;b4E` zjX~4#F1MGA{2W)>$!XY`Dd~O62;x^ltn^8<%5WUP_$1H92)RT?(~AmDiwkFSiA-v! zQhO>Drv=WVPTDKCOD1LY0*>m$1bP$H0mEU2RAXHti@n+0{zJ&;3o|QgNqISHg!k)4 zn73k6dDeK3o9#iDMY$GA2U`lNyD1#=#G*gSJPlBgGFIcOg^r>N#&)iBu_ zP=91K7z05tE}t6y$krc&sOzmmE=GBjbgmdQ)6sh)PN@`jXX_MmM_k>;5Y>8hG2Ar% z1rRQSjjnPd{vP&RUG;VX6j8m)@E6f=qg<N=G14iR{ot~hfp%HLe<iIh8TZ`ux zk6q8uy+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p&!r^$H8{s#ToiRqP`=ZEd1dR#3n}gfR*nU zMwzY!Pv+yl2STd|KIK%dxivV{I&!(>Vn+jwMqB(>T}Vk#*uD|~D9Ftp-))(1JWPz? z)FN7TZa85+{LLAoNn1b2NJr^O?nn#~AVBA6%cpLUTOq0aga?XZaGNXfr?j_gIQ%pO zw)s|YgWc22)(GyeYpRMfJ+T=geMXGH5xwOZ7T{Y9IeTdr+K0K0bv1y@5CCb;=iG+e eA}?q*S`?K{eb!##01onpczO7qCZD|g{l5dOn6fhf literal 0 HcmV?d00001 diff --git a/doc/salome/gui/VISU/images/cutsegmenticon.jpg b/doc/salome/gui/VISU/images/cutsegmenticon.jpg new file mode 100755 index 0000000000000000000000000000000000000000..fb551c9095a62f0b85d9f7a969d454608569857e GIT binary patch literal 822 zcmex=``2_j6xdp@o1cgOJMMZh|#U;coyG6VInuyV4pa*FVB^NNrR z{vTivwh= zDOELf4NWZ*Q!{f5ODks=S2uSLPp{yR(6I1`$f)F$)U@=B%&g*)(z5c3%Btp;*0%PJ z&aO$5r%atTea6gLixw|gx@`H1m8&*w-m-Pu_8mKS9XfpE=&|D`PM*4S`O4L6*Kgds z_3+W-Cr_U}fAR9w$4{TXeEs(Q$Io9Ne=#yJL%ap|8JfQYf&OA*VPR%r2lxYE z#}NLy#lXYN2#h>tK?Zw4S;Lmf=hAsU*Lhu4<+_rzZOW|rA1wEuO2G3e2f%h|d6p6ypVUN$-QT=1Lk_MhLI Z|NW5h+xGmQ-)H|b)JVO0u}bj&O#mSIHQN9H literal 0 HcmV?d00001 diff --git a/doc/salome/gui/VISU/images/cutsegmentprsnt.png b/doc/salome/gui/VISU/images/cutsegmentprsnt.png new file mode 100755 index 0000000000000000000000000000000000000000..51cde704d97a7aaec252d83807207508174109b7 GIT binary patch literal 8657 zcma)ic{o&W`1g@7qU=es?`tTbj6oqg-?ArLNSkF6W1EmHlU*d)TC^csi^EvLpd?dv zb!Yali zy2b7Py?elj-dn=~aAEc}wD*G`Hsba_UAj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~O8AUV5HD-z)> literal 0 HcmV?d00001 diff --git a/doc/salome/gui/VISU/input/cut_segment.doc b/doc/salome/gui/VISU/input/cut_segment.doc new file mode 100644 index 00000000..c3133f9f --- /dev/null +++ b/doc/salome/gui/VISU/input/cut_segment.doc @@ -0,0 +1,66 @@ +/*! + +\page cut_segment_page Cut Segment presentation +\image html cutsegmentprsnt.png "Example of Cut Segment presentation" + +\n Cut Segment is a simplified variant of +\ref cut_lines_page "Cut Lines" presentation, which is used to +display a single line instead of set of them. Axis of this line is +defined by coordinates of two points in 3D space. + +To create a Cut Segment presentation: +\par +– Right-click on one of the time stamps of the field in the +Object browser and from the pop-up menu choose Cut Segment, or +\n – Click on one of the time stamps of the field in the Object +browser and select from the main menu Visualization > Cut +Segment, or click "Cut Segment" icon in the Visualization +Toolbar. + +\image html cutsegmenticon.jpg +
"Cut Segment" icon
+ +\image html cutsegment.png + +\par +Cut Segment: this tab of the dialog box contains the +parameters of the cut segment. +
    +
  • Point 1 and Point 2 spin boxes allow to set coordinates +of two points, defining an axis of the segment.
  • +
  • Show preview check box allows to edit the parameters of the +presentation and simultaneously observe the preview of this +presentation in the viewer.
  • +
  • Invert curve check box allows to invert the resulting +curve.
  • +
  • Use absolute length check box allows to see the real length +of the line, instead of [0,1] interval.
  • +
  • Generate Data Table: If this check box is marked, Post-Pro +will automatically generate a data table on the basis of your Cut +Segment presentation. This table will be created in the structure of the +study.
  • +
  • Generate Curve: If this check box is marked, Post Pro +will automatically generate curve line on the basis of values taken +from the generated data table. This curve will be created in the +structure of the study and can be visualized in a XY plot.
  • +
+See more about table presentations and curve lines +\ref table_presentations_page "here". + +\par +Scalar Bar tab allows to define the parameters of the scalar bar +displayed with this presentation (\ref scalar_map_page "see also"). + +After you have finished with setting these parameters, click \b +OK. Your presentation with scalar bar will be immediately displayed in +the viewer: + +Tip: From Cut Segment presentation you can create a +data table. This table will consist of the field scalar values +located on the cut line of the constructed presentation. After that +your data table can be used for construction of a 2d plot of curves +based on the scalar values from the table (see also: +\ref creating_curves_page "Creating curves" and +\ref creating_plot2d_page "Creating Plot 2D presentation"). + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/field_presentations.doc b/doc/salome/gui/VISU/input/field_presentations.doc index 2755401b..45724ebf 100644 --- a/doc/salome/gui/VISU/input/field_presentations.doc +++ b/doc/salome/gui/VISU/input/field_presentations.doc @@ -8,6 +8,7 @@ presentations:
  • \subpage scalar_map_page
  • \subpage iso_surfaces_page
  • \subpage cut_lines_page
  • +
  • \subpage cut_segment_page
  • \subpage cut_planes_page
  • \subpage deformed_shape_page
  • \subpage vectors_page
  • diff --git a/doc/salome/gui/VISU/input/table_presentations.doc b/doc/salome/gui/VISU/input/table_presentations.doc index ee162476..3a57a993 100644 --- a/doc/salome/gui/VISU/input/table_presentations.doc +++ b/doc/salome/gui/VISU/input/table_presentations.doc @@ -15,8 +15,9 @@ from properly defined ACSII files. \note Alternatively, it is possible to create a table from the scalar values applied to the cells forming a \ref cut_lines_page "Cut Lines" -presentation. Simply right-click on the presentation in the Object -Browser or in the viewer and select Create Table from the pop-up menu. +or a \ref cut_segment_page "Cut Segment" presentation. Simply right-click on the +presentation in the Object Browser or in the viewer and select Create Table +from the pop-up menu. Tables are not displayed automatically. To view the imported table, right-click on it in the Object Brower and select Show Table diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index 2e98fc19..1d7e7640 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -98,6 +98,7 @@ module VISU { TPOINTMAP3D, /*!< 3D presentation for table object */ TCUTPLANES, /*!< Cut planes 3D presentation object */ TCUTLINES, /*!< Cut lines 3D presentation object */ + TCUTSEGMENT, /*!< Cut segment 3D presentation object */ TVECTORS, /*!< Vectors 3D presentation object */ TSTREAMLINES, /*!< Streamlines 3D presentation object */ TVISUGEN, /*!< %VISU generator used for performing operations with different %VISU objects */ @@ -1352,6 +1353,42 @@ module VISU { long GetNbPlanes(); }; + //------------------------------------------------------- + /*! \brief Base interface for Cut Lines and Cut Segment tools + * + */ + interface CutLinesBase : ScalarMap { + /*! + * Sets the number of cut lines. + * \param theNb The number of cut lines. + */ + void SetNbLines(in long theNb); + + /*! + * Gets the number of cut lines. + */ + long GetNbLines(); + + /*! Invert all curves of corresponding table + * \param theInvert - Invert all curves, if value is TRUE, else not. + */ + void SetAllCurvesInverted(in boolean theInvert); + + /*! Checks the orientation of all curves + * \retval TRUE - if all curves are inverted, else FALSE + */ + boolean IsAllCurvesInverted(); + + /*! Sets values which cutlines would be shown: aboslute or relative values + * \param theAbsLength - boolean value, TRUE or false. + */ + void SetUseAbsoluteLength(in boolean theAbsLength); + + /*! Checks values of cutlines: using aboslute or relative values + */ + boolean IsUseAbsoluteLength(); + }; + //------------------------------------------------------- /*! \brief Cut lines presentation. * @@ -1367,7 +1404,7 @@ module VISU { * operation is a regular array of lines in space, belonging to the same plane * and having the same orientation. They are located inside or on the mesh. */ - interface CutLines : ScalarMap { + interface CutLines : CutLinesBase { /*! * Sets the type of orientation in 3D space of the base plane of a cut lines presentation. * \param theOrientation The orientation of the base plane in 3D space. @@ -1487,36 +1524,48 @@ module VISU { * \return True if this cutting plane has default position. */ boolean IsDefaultPosition(in long thePlaneNumber); + }; + //------------------------------------------------------- + /*! \brief Cut segment presentation. + * + * Presentation parameters of a Cut segment presentation. + * Cut Segment is a simplified variant of Cut Lines presentation, which is used + * to display a single line instead of set of them. Axis of this line is defined + * by coordinates of two points in 3D space. + */ + interface CutSegment : CutLinesBase { /*! - * Sets the number of cut lines. - * \param theNb The number of cut lines. + * Sets coordinates of the first point of axis of the segment. + * \param theX X coordinate of the point + * \param theY Y coordinate of the point + * \param theZ Z coordinate of the point */ - void SetNbLines(in long theNb); + void SetPoint1(in double theX, in double theY, in double theZ); /*! - * Gets the number of cut lines. - */ - long GetNbLines(); - - /*! Invert all curves of corresponding table - * \param theInvert - Invert all curves, if value is TRUE, else not. - */ - void SetAllCurvesInverted(in boolean theInvert); - - /*! Checks the orientation of all curves - * \retval TRUE - if all curves are inverted, else FALSE + * Gets coordinates of the first point of axis of the segment. + * \param theX X coordinate of the point + * \param theY Y coordinate of the point + * \param theZ Z coordinate of the point */ - boolean IsAllCurvesInverted(); + void GetPoint1(out double theX, out double theY, out double theZ); - /*! Sets values which cutlines would be shown: aboslute or relative values - * \param theAbsLength - boolean value, TRUE or false. + /*! + * Sets coordinates of the second point of axis of the segment. + * \param theX X coordinate of the point + * \param theY Y coordinate of the point + * \param theZ Z coordinate of the point */ - void SetUseAbsoluteLength(in boolean theAbsLength); + void SetPoint2(in double theX, in double theY, in double theZ); - /*! Checks values of cutlines: using aboslute or relative values + /*! + * Gets coordinates of the second point of axis of the segment. + * \param theX X coordinate of the point + * \param theY Y coordinate of the point + * \param theZ Z coordinate of the point */ - boolean IsUseAbsoluteLength(); + void GetPoint2(out double theX, out double theY, out double theZ); }; /*! \brief Interface of the stream lines representation @@ -2275,6 +2324,18 @@ module VISU { in Entity theEntity, in string theFieldName, in long theTimeStampNumber); + /*! + * Creates a presentation of cut segment. + * \param theResult Data generated in other sources. (MED object or file) + * \param theMeshName One of the meshes presented in MED file + * \param theEntity Type of entity where the field is defined + * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector. + * \param theTimeStampNumber Number of iteration on the field + */ + CutSegment CutSegmentOnField(in Result theResult, in string theMeshName, + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); + /*! * Creates a Plot3D presentation. * \param theResult Data generated in other sources. (MED object or file) diff --git a/resources/Makefile.am b/resources/Makefile.am index ae592ccd..c9ae4291 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -43,6 +43,7 @@ Visu_cell_selection.png \ Visu_close.png \ VISU.config \ Visu_cutlines.png \ +Visu_cutsegment.png \ Visu_cutplanes.png \ Visu_deformed_anim.png \ Visu_deformed.png \ @@ -88,6 +89,8 @@ Visu_tree_container.png \ Visu_tree_curve.png \ Visu_tree_cutlines_gr.png \ Visu_tree_cutlines.png \ +Visu_tree_cutsegment_gr.png \ +Visu_tree_cutsegment.png \ Visu_tree_cutplanes_gr.png \ Visu_tree_cutplanes.png \ Visu_tree_deformed_gr.png \ diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 48c8051b..d168f5b7 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -42,6 +42,7 @@ + diff --git a/resources/VISU_en.xml b/resources/VISU_en.xml index db3d178f..7e7e28c6 100644 --- a/resources/VISU_en.xml +++ b/resources/VISU_en.xml @@ -53,6 +53,7 @@ + @@ -116,6 +117,7 @@ + diff --git a/resources/VISU_fr.xml b/resources/VISU_fr.xml index a7c3b3d5..decdc38b 100644 --- a/resources/VISU_fr.xml +++ b/resources/VISU_fr.xml @@ -53,6 +53,7 @@ + @@ -114,6 +115,7 @@ + diff --git a/resources/Visu_cutsegment.png b/resources/Visu_cutsegment.png new file mode 100644 index 0000000000000000000000000000000000000000..bff1ebcd9f5f86d41e3b063b6070e524dff7b4c8 GIT binary patch literal 572 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`j)FbFd;%$g$s6l6(v z^mSxl*w|O|J8&|PuaN8!<|{Ln>}1{rUgjp4pVqfx%F4!u^krkIwsF{%y*i`tRKj>%UJdx8{)K5OApA z{qy^~{`dd&`z7k?>yLjBe=#w=U%t!0$mkSPxw^UE95{Qb}-sKIhL0_ZNmE|IqX_4NjSetw+y@Nzpp&;I%vWr@>3Q(e3!{W$Mn z(aFdnAZ&PS0uuvMM`zzOe zn%u07G0MjFR<`pMWl9SUD zo-(8-y46$xT_hOK$gQ(1q#=YuAez~bU!b1x(PD=^Y%AXLnE^w_Wkmr))wG9#0-qhd zB_#e^>+u4`PP8gGyDVfgYW6Zw_{VZ&edDhUQd|NF41$lAdo%OrTmr^4gQu&X%Q~lo FCIH!_;v)b6 literal 0 HcmV?d00001 diff --git a/resources/Visu_tree_cutsegment.png b/resources/Visu_tree_cutsegment.png new file mode 100644 index 0000000000000000000000000000000000000000..0aea43f3096676f6964c77a7b99a34934f89a82f GIT binary patch literal 466 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx-l>?dU(1xhE&{2`t$$4J+mr9bQH`kL&2{%Rt#v@JV8~)etGphOX zq4DAK{`D4D8CV2_nOlLDb4WR8%mwoP8T|O%`tb4bexCjHHOE)70j+2|IJ;b4Qf^=M zi4Si-yU)pDVB%QL7{9M3vEsuU>%))t_e<`p|J`$$p@HF0=7DB*eu;PXf6smR@;d8@mWS8BzyJSH5W9dw&kiTa8HH0CLpTJYom=~uK1wb4 xwfn>?pbhZ~O-=t41wK3e?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx-l>?mU_B4hE&{25)l;qd7goFef<735m8ar&-eFK9_E;Q_$V7=149x+VM7CBTOz}W zdmn$EiKo8@iC>*bAW{(qBPF3!Nz!8%=B&Zgo(!T*=#ZOiND z8~yq9jTI!pv0VJ!ot>W_AKaYJbAG;k`j4-Ff5*pwjG7bI(b?(A5~Rq(^L=fiAk$F| x289NRk16Sy3+@DK?B+eO?$ETkj7&TXcfK8a`oI3~UtnZ0c)I$ztaD0e0sy@O(}Ms2 literal 0 HcmV?d00001 diff --git a/src/ENGINE/VISU_Engine_i.cc b/src/ENGINE/VISU_Engine_i.cc index 887f2da1..7f8731e6 100644 --- a/src/ENGINE/VISU_Engine_i.cc +++ b/src/ENGINE/VISU_Engine_i.cc @@ -361,6 +361,18 @@ namespace VISU{ } + CutSegment_ptr + VISU_Gen_i + ::CutSegmentOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) + { + return myVisuGen->CutSegmentOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); + } + + Plot3D_ptr VISU_Gen_i ::Plot3DOnField(Result_ptr theResult, diff --git a/src/ENGINE/VISU_Engine_i.hh b/src/ENGINE/VISU_Engine_i.hh index 93847a27..bf44466e 100644 --- a/src/ENGINE/VISU_Engine_i.hh +++ b/src/ENGINE/VISU_Engine_i.hh @@ -138,6 +138,14 @@ namespace VISU const char* theFieldName, CORBA::Long theIteration); + virtual + CutSegment_ptr + CutSegmentOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration); + virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult, diff --git a/src/PIPELINE/Makefile.am b/src/PIPELINE/Makefile.am index d918d23a..133fa81a 100644 --- a/src/PIPELINE/Makefile.am +++ b/src/PIPELINE/Makefile.am @@ -40,7 +40,9 @@ salomeinclude_HEADERS= \ VISU_MeshPL.hxx \ VISU_ScalarMapPL.hxx \ VISU_CutPlanesPL.hxx \ + VISU_CutLinesBasePL.hxx \ VISU_CutLinesPL.hxx \ + VISU_CutSegmentPL.hxx \ VISU_IsoSurfacesPL.hxx \ VISU_DeformedShapePL.hxx \ VISU_VectorsPL.hxx \ @@ -84,7 +86,9 @@ dist_libVisuPipeLine_la_SOURCES= \ VISU_MeshPL.cxx \ VISU_ScalarMapPL.cxx \ VISU_CutPlanesPL.cxx \ + VISU_CutLinesBasePL.cxx \ VISU_CutLinesPL.cxx \ + VISU_CutSegmentPL.cxx \ VISU_IsoSurfacesPL.cxx \ VISU_DeformedShapePL.cxx \ VISU_VectorsPL.cxx \ diff --git a/src/PIPELINE/VISU_CutLinesBasePL.cxx b/src/PIPELINE/VISU_CutLinesBasePL.cxx new file mode 100644 index 00000000..13370909 --- /dev/null +++ b/src/PIPELINE/VISU_CutLinesBasePL.cxx @@ -0,0 +1,40 @@ +// Copyright (C) 2007-2008 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: VISU_CutLinesBasePL.cxx +// Author: Oleg UVAROV +// Module : VISU +// +#include "VISU_CutLinesBasePL.hxx" + +#include + +//---------------------------------------------------------------------------- +vtkStandardNewMacro(VISU_CutLinesBasePL); + + +//---------------------------------------------------------------------------- +VISU_CutLinesBasePL +::VISU_CutLinesBasePL() +{ + SetIsShrinkable(false); + SetIsFeatureEdgesAllowed(false); +} diff --git a/src/PIPELINE/VISU_CutLinesBasePL.hxx b/src/PIPELINE/VISU_CutLinesBasePL.hxx new file mode 100644 index 00000000..d3ed3d0f --- /dev/null +++ b/src/PIPELINE/VISU_CutLinesBasePL.hxx @@ -0,0 +1,98 @@ +// Copyright (C) 2007-2008 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: VISU_CutLinesBasePL.hxx +// Author: Oleg UVAROV +// Module : VISU +// +#ifndef VISU_CutLinesBasePL_HeaderFile +#define VISU_CutLinesBasePL_HeaderFile + +#include "VISUPipeline.hxx" +#include "VISU_CutPlanesPL.hxx" + +//---------------------------------------------------------------------------- +class VISU_PIPELINE_EXPORT VISU_CutLinesBasePL : public VISU_CutPlanesPL +{ +public: + vtkTypeMacro(VISU_CutLinesBasePL,VISU_CutPlanesPL); + + static + VISU_CutLinesBasePL* + New(); + +public: + //! Returns direction that is defined by position & orientation of the basic and tool planes + const vtkFloatingPointType* + GetRealDirLn() + { + return myRealDirLn; + } + + /*! + Returns direction that corresponds to the myRealDirLn, + but has the same direction as main axis. + */ + const vtkFloatingPointType* + GetDirLn() + { + return myDirLn; + } + + /*! + Returns coordinates of 3D point that shows + where is the first intersection of the given mesh. + with the defined direction. + */ + const vtkFloatingPointType* + GetBasePnt() + { + return myBasePnt; + } + + /*! + Returns three floating point numbers that defines the following values: + 1. Distance between the initial point of intersection and origin of coordinates; + 2. Distance between the last point of intersection and origin of coordinates; + 3. Distance between the last point and initial points of intersection. + with the defined direction. + */ + const vtkFloatingPointType* + GetBoundPrjLn() + { + return myBoundPrjLn; + } + +protected: + VISU_CutLinesBasePL(); + + vtkFloatingPointType myDirLn[3]; + vtkFloatingPointType myRealDirLn[3]; + vtkFloatingPointType myBoundPrjLn[3]; + vtkFloatingPointType myBasePnt[3]; + +private: + VISU_CutLinesBasePL(const VISU_CutLinesBasePL&); // Not implemented. + void operator=(const VISU_CutLinesBasePL&); // Not implemented. +}; + + +#endif diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index 7fcfb1fd..f6980dd5 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -39,9 +39,6 @@ vtkStandardNewMacro(VISU_CutLinesPL); VISU_CutLinesPL ::VISU_CutLinesPL() { - SetIsShrinkable(false); - SetIsFeatureEdgesAllowed(false); - myCondition = 1; myPosition = 0; } diff --git a/src/PIPELINE/VISU_CutLinesPL.hxx b/src/PIPELINE/VISU_CutLinesPL.hxx index 5607bf3a..afe46a3c 100644 --- a/src/PIPELINE/VISU_CutLinesPL.hxx +++ b/src/PIPELINE/VISU_CutLinesPL.hxx @@ -28,16 +28,16 @@ #define VISU_CutLinesPL_HeaderFile #include "VISUPipeline.hxx" -#include "VISU_CutPlanesPL.hxx" +#include "VISU_CutLinesBasePL.hxx" class vtkAppendPolyData; //---------------------------------------------------------------------------- -class VISU_PIPELINE_EXPORT VISU_CutLinesPL : public VISU_CutPlanesPL +class VISU_PIPELINE_EXPORT VISU_CutLinesPL : public VISU_CutLinesBasePL { public: - vtkTypeMacro(VISU_CutLinesPL,VISU_CutPlanesPL); + vtkTypeMacro(VISU_CutLinesPL,VISU_CutLinesBasePL); static VISU_CutLinesPL* @@ -82,47 +82,6 @@ public: int thePlaneCondition, vtkFloatingPointType theDisplacement); - //! Returns direction that is defined by position & orientation of the basic and tool planes - const vtkFloatingPointType* - GetRealDirLn() - { - return myRealDirLn; - } - - /*! - Returns direction that corresponds to the myRealDirLn, - but has the same direction as main axis. - */ - const vtkFloatingPointType* - GetDirLn() - { - return myDirLn; - } - - /*! - Returns coordinates of 3D point that shows - where is the first intersection of the given mesh. - with the defined direction. - */ - const vtkFloatingPointType* - GetBasePnt() - { - return myBasePnt; - } - - /*! - Returns three floating point numbers that defines the following values: - 1. Distance between the initial point of intersection and origin of coordinates; - 2. Distance between the last point of intersection and origin of coordinates; - 3. Distance between the last point and initial points of intersection. - with the defined direction. - */ - const vtkFloatingPointType* - GetBoundPrjLn() - { - return myBoundPrjLn; - } - protected: VISU_CutLinesPL(); @@ -131,10 +90,6 @@ protected: DoShallowCopy(VISU_PipeLine *thePipeLine, bool theIsCopyInput); - vtkFloatingPointType myDirLn[3]; - vtkFloatingPointType myRealDirLn[3]; - vtkFloatingPointType myBoundPrjLn[3]; - vtkFloatingPointType myBasePnt[3]; vtkFloatingPointType myPosition; int myCondition; diff --git a/src/PIPELINE/VISU_CutSegmentPL.cxx b/src/PIPELINE/VISU_CutSegmentPL.cxx new file mode 100644 index 00000000..2e1fcfe1 --- /dev/null +++ b/src/PIPELINE/VISU_CutSegmentPL.cxx @@ -0,0 +1,216 @@ +// Copyright (C) 2007-2008 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: VISU_CutSegmentPL.hxx +// Author: Oleg UVAROV +// Module : VISU +// +#include "VISU_CutSegmentPL.hxx" +#include "VISU_PipeLineUtils.hxx" + +#include + +//---------------------------------------------------------------------------- +vtkStandardNewMacro(VISU_CutSegmentPL); + + +//---------------------------------------------------------------------------- +VISU_CutSegmentPL +::VISU_CutSegmentPL() +{ +} + +//---------------------------------------------------------------------------- +void +VISU_CutSegmentPL +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) +{ + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); + + if(VISU_CutSegmentPL *aPipeLine = dynamic_cast(thePipeLine)){ + vtkFloatingPointType x, y, z; + aPipeLine->GetPoint1(x, y, z); + SetPoint1(x, y, z); + aPipeLine->GetPoint2(x, y, z); + SetPoint2(x, y, z); + } +} + +//---------------------------------------------------------------------------- +void +VISU_CutSegmentPL +::Init() +{ + Superclass::Init(); + + vtkFloatingPointType aBounds[6]; + GetMergedInput()->GetBounds(aBounds); + + for( int i = 0; i < 3; i++ ) { + vtkFloatingPointType min = aBounds[ 2*i ]; + vtkFloatingPointType max = aBounds[ 2*i+1 ]; + myPoint1[ i ] = i == 1 ? min : ( min + max ) / 2; + myPoint2[ i ] = i == 1 ? max : ( min + max ) / 2; + } +} + +//---------------------------------------------------------------------------- +void +VISU_CutSegmentPL +::SetPoint1(vtkFloatingPointType theX, + vtkFloatingPointType theY, + vtkFloatingPointType theZ ) +{ + myPoint1[0] = theX; + myPoint1[1] = theY; + myPoint1[2] = theZ; +} + +//---------------------------------------------------------------------------- +void +VISU_CutSegmentPL +::GetPoint1(vtkFloatingPointType& theX, + vtkFloatingPointType& theY, + vtkFloatingPointType& theZ ) +{ + theX = myPoint1[0]; + theY = myPoint1[1]; + theZ = myPoint1[2]; +} + +//---------------------------------------------------------------------------- +void +VISU_CutSegmentPL +::SetPoint2(vtkFloatingPointType theX, + vtkFloatingPointType theY, + vtkFloatingPointType theZ ) +{ + myPoint2[0] = theX; + myPoint2[1] = theY; + myPoint2[2] = theZ; +} + +//---------------------------------------------------------------------------- +void +VISU_CutSegmentPL +::GetPoint2(vtkFloatingPointType& theX, + vtkFloatingPointType& theY, + vtkFloatingPointType& theZ ) +{ + theX = myPoint2[0]; + theY = myPoint2[1]; + theZ = myPoint2[2]; +} + +//---------------------------------------------------------------------------- +vtkDataSet* +VISU_CutSegmentPL +::InsertCustomPL() +{ + return myAppendPolyData->GetOutput(); +} + +//---------------------------------------------------------------------------- +void +VISU_CutSegmentPL +::Update() +{ + vtkDataSet* aMergedInput = GetMergedInput(); + if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343 + throw std::runtime_error("Impossible to build presentation"); + + vtkFloatingPointType aVector12[3], aVector21[3]; + VISU::Sub( myPoint2, myPoint1, aVector12 ); + VISU::Sub( myPoint1, myPoint2, aVector21 ); + + double aPrecision = 1.0 / VTK_LARGE_FLOAT; + double aNorm = vtkMath::Normalize( aVector12 ); + if( aNorm < aPrecision ) + return; + + // compute two vectors which are orthogonal to the line between the input points + // these vectors could be used as normals of two planes, intersected exactly at this line + // origin of these planes should be places at one of the input points + vtkFloatingPointType aVector1[3], aVector2[3]; + vtkMath::Perpendiculars( aVector12, aVector1, aVector2, 0 ); + + ClearAppendPolyData(myAppendPolyData); + + SetPartPosition(1); + + vtkFloatingPointType aBounds[6]; + GetMergedInput()->GetBounds(aBounds); + + // check if the input is planar - in this case one cut plane will be enough + // (besides, the second cut corrupts the resulting output, splitting it to points) + bool isPlanar = true; + vtkFloatingPointType aNormal[3] = { 0.0, 0.0, 0.0 }; + if( fabs( aBounds[0] - aBounds[1] ) < aPrecision ) + aNormal[0] = 1.0; + else if( fabs( aBounds[2] - aBounds[3] ) < aPrecision ) + aNormal[1] = 1.0; + else if( fabs( aBounds[4] - aBounds[5] ) < aPrecision ) + aNormal[2] = 1.0; + else + isPlanar = false; + + if( isPlanar ) { + // choose a vector which is not collinear with normal of the plane + vtkFloatingPointType aCross[3]; + vtkMath::Cross( aVector1, aNormal, aCross ); + bool isFirst = vtkMath::Norm( aCross ) > aPrecision; + VISU_CutPlanesPL::CutWithPlane(myAppendPolyData, GetMergedInput(), isFirst ? aVector1 : aVector2, myPoint1); + myAppendPolyData->Update(); + } + else { + vtkAppendPolyData *anAppendPolyData = vtkAppendPolyData::New(); + + VISU_CutPlanesPL::CutWithPlane(anAppendPolyData, GetMergedInput(), aVector1, myPoint1); + vtkDataSet *aDataSet = anAppendPolyData->GetOutput(); + aDataSet->Update(); + + VISU_CutPlanesPL::CutWithPlane(myAppendPolyData, aDataSet, aVector2, myPoint1); + myAppendPolyData->Update(); + + anAppendPolyData->Delete(); + } + + // calculate values for building of table + for (int i = 0; i<3 ; i++) { + myRealDirLn[i] = myDirLn[i] = aVector12[i]; + if(myDirLn[i] < 0.0) + myDirLn[i] = -1.0*myDirLn[i]; //enk:: correction of bug Bug PAL10401 + } + + GetBoundProject(myBoundPrjLn, + aBounds, + myDirLn); + + VISU::Mul(myDirLn, + myBoundPrjLn[0], + myBasePnt); + + CorrectPnt(myBasePnt, + aBounds); + + VISU_ScalarMapPL::Update(); +} diff --git a/src/PIPELINE/VISU_CutSegmentPL.hxx b/src/PIPELINE/VISU_CutSegmentPL.hxx new file mode 100644 index 00000000..9ead72e3 --- /dev/null +++ b/src/PIPELINE/VISU_CutSegmentPL.hxx @@ -0,0 +1,96 @@ +// Copyright (C) 2007-2008 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: VISU_CutSegmentPL.hxx +// Author: Oleg UVAROV +// Module : VISU +// +#ifndef VISU_CutSegmentPL_HeaderFile +#define VISU_CutSegmentPL_HeaderFile + +#include "VISUPipeline.hxx" +#include "VISU_CutLinesBasePL.hxx" + + +//---------------------------------------------------------------------------- +class VISU_PIPELINE_EXPORT VISU_CutSegmentPL : public VISU_CutLinesBasePL +{ +public: + vtkTypeMacro(VISU_CutSegmentPL,VISU_CutLinesBasePL); + + static + VISU_CutSegmentPL* + New(); + + virtual + void + SetPoint1(vtkFloatingPointType theX, + vtkFloatingPointType theY, + vtkFloatingPointType theZ); + + virtual + void + GetPoint1(vtkFloatingPointType& theX, + vtkFloatingPointType& theY, + vtkFloatingPointType& theZ); + + virtual + void + SetPoint2(vtkFloatingPointType theX, + vtkFloatingPointType theY, + vtkFloatingPointType theZ); + + virtual + void + GetPoint2(vtkFloatingPointType& theX, + vtkFloatingPointType& theY, + vtkFloatingPointType& theZ); + +public: + virtual + void + Init(); + + vtkDataSet* + InsertCustomPL(); + + virtual + void + Update(); + +protected: + VISU_CutSegmentPL(); + + virtual + void + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); + + vtkFloatingPointType myPoint1[3]; + vtkFloatingPointType myPoint2[3]; + +private: + VISU_CutSegmentPL(const VISU_CutSegmentPL&); // Not implemented. + void operator=(const VISU_CutSegmentPL&); // Not implemented. +}; + + +#endif diff --git a/src/VISUGUI/Makefile.am b/src/VISUGUI/Makefile.am index 29cb40ee..ab4caa67 100644 --- a/src/VISUGUI/Makefile.am +++ b/src/VISUGUI/Makefile.am @@ -56,6 +56,7 @@ salomeinclude_HEADERS= \ VisuGUI_DeformedShapeDlg.h \ VisuGUI_IsoSurfacesDlg.h \ VisuGUI_CutLinesDlg.h \ + VisuGUI_CutSegmentDlg.h \ VisuGUI_CutPlanesDlg.h \ VisuGUI_StreamLinesDlg.h \ VisuGUI_VectorsDlg.h \ @@ -101,6 +102,7 @@ dist_libVISU_la_SOURCES= \ VisuGUI_DeformedShapeDlg.cxx \ VisuGUI_IsoSurfacesDlg.cxx \ VisuGUI_CutLinesDlg.cxx \ + VisuGUI_CutSegmentDlg.cxx \ VisuGUI_CutPlanesDlg.cxx \ VisuGUI_StreamLinesDlg.cxx \ VisuGUI_VectorsDlg.cxx \ @@ -148,6 +150,7 @@ MOC_FILES= \ VisuGUI_DeformedShapeDlg_moc.cxx \ VisuGUI_IsoSurfacesDlg_moc.cxx \ VisuGUI_CutLinesDlg_moc.cxx \ + VisuGUI_CutSegmentDlg_moc.cxx \ VisuGUI_CutPlanesDlg_moc.cxx \ VisuGUI_StreamLinesDlg_moc.cxx \ VisuGUI_VectorsDlg_moc.cxx \ diff --git a/src/VISUGUI/VISU_images.ts b/src/VISUGUI/VISU_images.ts index 143e7563..a5b74650 100644 --- a/src/VISUGUI/VISU_images.ts +++ b/src/VISUGUI/VISU_images.ts @@ -53,6 +53,10 @@ ICON_CUT_LINES Visu_cutlines.png + + ICON_CUT_SEGMENT + Visu_cutsegment.png + ICON_CUT_PLANES Visu_cutplanes.png @@ -231,6 +235,14 @@ ICON_TREE_CUT_LINES_GROUPS Visu_tree_cutlines_gr.png + + ICON_TREE_CUT_SEGMENT + Visu_tree_cutsegment.png + + + ICON_TREE_CUT_SEGMENT_GROUPS + Visu_tree_cutsegment_gr.png + ICON_TREE_CUT_PLANES Visu_tree_cutplanes.png diff --git a/src/VISUGUI/VISU_msg_en.ts b/src/VISUGUI/VISU_msg_en.ts index 6e63b378..16a5edf9 100644 --- a/src/VISUGUI/VISU_msg_en.ts +++ b/src/VISUGUI/VISU_msg_en.ts @@ -133,14 +133,22 @@ number of time stamps or number of components is not the same! VISU_COS_SWEEP Cosinusoidal ( (1 - cos(t))/2 ) - - VISU_CUT_LINES_PREF - Cut Lines preferences - VISU_CUT_LINES Cut Lines + + VISU_CUT_LINES_SEGMENT + Cut Lines/Segment + + + VISU_CUT_LINES_SEGMENT_PREF + Cut Lines/Segment preferences + + + VISU_CUT_SEGMENT + Cut Segment + VISU_CUT_PLANES Cut Planes @@ -1037,6 +1045,10 @@ Please, refer to the documentation. MEN_CUT_LINES Cut Lines + + MEN_CUT_SEGMENT + Cut Segment + MEN_CUT_PLANES Cut Planes @@ -1780,6 +1792,57 @@ Please, provide non-empty resulting presentation. Orientation + + VisuGUI_CutSegmentDlg + + LBL_ABSOLUTE_LENGTH + Use absolute length + + + LBL_CUT_SEGMENT + Cut Segment + + + LBL_GENERATE_CURVES + Generate Curve + + + LBL_GENERATE_TABLE + Generate Data Table + + + LBL_INVERT_CURVES + Invert curve + + + LBL_POINT_1 + Point 1: + + + LBL_POINT_2 + Point 2: + + + LBL_SEGMENT + Segment + + + LBL_SHOW_PREVIEW + Show preview + + + LBL_X + X + + + LBL_Y + Y + + + LBL_Z + Z + + VisuGUI_CutPlanesDlg diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index afaa6c43..bbaaa4e7 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -139,6 +139,9 @@ #include "VISU_CutLines_i.hh" #include "VisuGUI_CutLinesDlg.h" +#include "VISU_CutSegment_i.hh" +#include "VisuGUI_CutSegmentDlg.h" + #include "VISU_StreamLines_i.hh" #include "VisuGUI_StreamLinesDlg.h" @@ -599,14 +602,26 @@ void VisuGUI::OnLoadComponentData() void CreateCurves( SalomeApp_Module* theModule, - VISU::CutLines_i* thePrs, + VISU::CutLinesBase_i* thePrs, QDialog* theDlg, const bool theCreate = true ) { if ( !thePrs ) return; - VisuGUI_CutLinesDlg* aCutDlg = dynamic_cast( theDlg ); - if ( !aCutDlg ) + + // temporary code, to be revised (VisuGUI_CutLinesDlg and VisuGUI_CutSegmentDlg classes + // should have common intermediate interface with at least two methods called below) + bool isGenerateTable = false; + bool isGenerateCurves = false; + if ( VisuGUI_CutLinesDlg* aCutDlg = dynamic_cast( theDlg ) ) { + isGenerateTable = aCutDlg->isGenerateTable(); + isGenerateCurves = aCutDlg->isGenerateCurves(); + } + else if ( VisuGUI_CutSegmentDlg* aCutDlg = dynamic_cast( theDlg ) ) { + isGenerateTable = aCutDlg->isGenerateTable(); + isGenerateCurves = aCutDlg->isGenerateCurves(); + } + else return; _PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) ); @@ -650,9 +665,9 @@ CreateCurves( SalomeApp_Module* theModule, } } - if ( aCutDlg->isGenerateTable() ) { + if ( isGenerateTable ) { GetVisuGen( theModule )->CreateTable( thePrs->GetEntry().c_str() ); - if ( aCutDlg->isGenerateCurves() ) { + if ( isGenerateCurves ) { if ( aSObject ) { _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject); @@ -795,6 +810,15 @@ VisuGUI emit presentationCreated(aPrs); } +void +VisuGUI +::OnCreateCutSegment() +{ + Prs3d_i* aPrs = CreatePrs3d(this); + if (aPrs) + emit presentationCreated(aPrs); +} + void VisuGUI ::OnCreateStreamLines() @@ -1080,6 +1104,16 @@ VisuGUI EditPrs3d(this, anIO, aPrs3d); } +//---------------------------------------------------------------------------- +void +VisuGUI +::OnEditCutSegment() +{ + Handle(SALOME_InteractiveObject) anIO; + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO)) + EditPrs3d(this, anIO, aPrs3d); +} + //---------------------------------------------------------------------------- void VisuGUI @@ -1464,7 +1498,9 @@ VisuGUI _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject; VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase; - if((aBase && aBase->GetType() == VISU::TCUTLINES) || IsSObjectTable(aSObject)) { + if(aBase && + (aBase->GetType() == VISU::TCUTLINES || aBase->GetType() == VISU::TCUTSEGMENT) || + IsSObjectTable(aSObject)) { GetVisuGen( this )->CreateTable( aSObject->GetID().c_str() ); UpdateObjBrowser(this); } @@ -1884,7 +1920,7 @@ VisuGUI QString aStr = aSel.parameter(i, "type" ).toString(); if (aStr == "VISU::TSCALARMAP" || aStr == "VISU::TISOSURFACES" || aStr == "VISU::TDEFORMEDSHAPE" || aStr == "VISU::TCUTPLANES" || - aStr == "VISU::TCUTLINES" || aStr == "VISU::TVECTORS" || + aStr == "VISU::TCUTLINES" || aStr == "VISU::TCUTSEGMENT" || aStr == "VISU::TVECTORS" || aStr == "VISU::TSTREAMLINES" || aStr == "VISU::TPLOT3D" || aStr == "VISU::TSCALARMAPONDEFORMEDSHAPE" || aStr == "VISU::TCOLOREDPRS3DHOLDER" || aStr == "VISU::TTABLE" || aStr == "VISU::TCURVE" || aStr == "VISU::TCONTAINER" || @@ -2097,6 +2133,9 @@ VisuGUI case VISU::TCUTLINES: TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; + case VISU::TCUTSEGMENT: + TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); + break; case VISU::TISOSURFACES: TSameAsFactory().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false); break; @@ -2380,6 +2419,11 @@ VisuGUI tr("MEN_CUT_LINES"), "", 0, aParent, false, this, SLOT(OnCreateCutLines())); + aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_SEGMENT")); + createAction( VISU_CUT_SEGMENT, tr("MEN_CUT_SEGMENT"), QIcon(aPixmap), + tr("MEN_CUT_SEGMENT"), "", 0, aParent, false, + this, SLOT(OnCreateCutSegment())); + aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D")); createAction( VISU_PLOT_3D, tr("MEN_PLOT_3D"), QIcon(aPixmap), tr("MEN_PLOT_3D"), "", 0, aParent, false, @@ -2585,6 +2629,10 @@ VisuGUI tr("MEN_EDIT_PRS"), "", 0, aParent, false, this, SLOT(OnEditCutLines())); + createAction( VISU_EDIT_CUTSEGMENT, tr("MEN_EDIT_PRS"), QIcon(), + tr("MEN_EDIT_PRS"), "", 0, aParent, false, + this, SLOT(OnEditCutSegment())); + createAction( VISU_EDIT_ISOSURFACES, tr("MEN_EDIT_PRS"), QIcon(), tr("MEN_EDIT_PRS"), "", 0, aParent, false, this, SLOT(OnEditIsoSurfaces())); @@ -2745,6 +2793,7 @@ VisuGUI createMenu( VISU_ISO_SURFACES, aMenuId, 10 ); // iso surfaces createMenu( VISU_CUT_PLANES, aMenuId, 10 ); // cut planes createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines + createMenu( VISU_CUT_SEGMENT, aMenuId, 10 ); // cut segment createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d createMenu( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aMenuId, 10 ); // scalar map on deformed shape @@ -2777,6 +2826,7 @@ VisuGUI createTool( VISU_ISO_SURFACES, aToolId ); createTool( VISU_CUT_PLANES, aToolId ); createTool( VISU_CUT_LINES, aToolId ); + createTool( VISU_CUT_SEGMENT, aToolId ); createTool( VISU_STREAM_LINES, aToolId ); createTool( VISU_PLOT_3D, aToolId ); createTool( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aToolId ); @@ -2820,6 +2870,7 @@ VisuGUI mgr->insert( action( VISU_ISO_SURFACES ), -1, -1, -1 ); // iso surface mgr->insert( action( VISU_CUT_PLANES ), -1, -1, -1 ); // cut planes mgr->insert( action( VISU_CUT_LINES ), -1, -1, -1 ); // cut lines + mgr->insert( action( VISU_CUT_SEGMENT ), -1, -1, -1 ); // cut segment mgr->insert( action( VISU_DEFORMED_SHAPE ), -1, -1, -1 ); // deformed shape mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines @@ -2836,6 +2887,7 @@ VisuGUI mgr->insert( action( VISU_EDIT_DEFORMEDSHAPE ), -1, -1, -1 ); mgr->insert( action( VISU_EDIT_CUTPLANES ), -1, -1, -1 ); mgr->insert( action( VISU_EDIT_CUTLINES ), -1, -1, -1 ); + mgr->insert( action( VISU_EDIT_CUTSEGMENT ), -1, -1, -1 ); mgr->insert( action( VISU_EDIT_ISOSURFACES ), -1, -1, -1 ); mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 ); mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 ); @@ -2938,10 +2990,10 @@ VisuGUI // Rules QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' " - "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' " + "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' " "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'"); QString aSimplePrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' " - "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' " + "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' " "'VISU::TSCALARMAPONDEFORMEDSHAPE'"); // VISU root commands @@ -2956,6 +3008,7 @@ VisuGUI mgr->setRule( action( VISU_ISO_SURFACES ), aRule ); mgr->setRule( action( VISU_CUT_PLANES ), aRule ); mgr->setRule( action( VISU_CUT_LINES ), aRule ); + mgr->setRule( action( VISU_CUT_SEGMENT ), aRule ); mgr->setRule( action( VISU_PLOT_3D ), aRule ); aRule += " and nbComponents>1"; mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule ); @@ -3039,7 +3092,7 @@ VisuGUI " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}"; QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}"; QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' " - "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}"; + "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}"; QString aFeatureEdgesType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}"; @@ -3112,6 +3165,8 @@ VisuGUI "selcount=1 and type='VISU::TCUTPLANES'" ); mgr->setRule( action( VISU_EDIT_CUTLINES ), "selcount=1 and type='VISU::TCUTLINES'" ); + mgr->setRule( action( VISU_EDIT_CUTSEGMENT ), + "selcount=1 and type='VISU::TCUTSEGMENT'" ); mgr->setRule( action( VISU_EDIT_ISOSURFACES ), "selcount=1 and type='VISU::TISOSURFACES'" ); mgr->setRule( action( VISU_EDIT_VECTORS ), @@ -3123,7 +3178,7 @@ VisuGUI mgr->setRule( action( VISU_EDIT_POINTMAP3D ), "selcount=1 and type='VISU::TPOINTMAP3D'" ); - aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0"; + aRule = "selcount=1 and $type in {'VISU::TCUTLINES' 'VISU::TCUTSEGMENT'} and nbNamedChildren=0"; mgr->setRule( action( VISU_CREATE_TABLE ), aRule ); aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "})"; @@ -3686,10 +3741,10 @@ void VisuGUI::createPreferences() setPreferenceProperty( bhh, "max", 100 ); // TAB: "CutLines" - int cutLineTab = addPreference( tr( "VISU_CUT_LINES" ) ); + int cutLineTab = addPreference( tr( "VISU_CUT_LINES_SEGMENT" ) ); // group: "CutLines preferences" - int cutLineGr = addPreference( tr( "VISU_CUT_LINES_PREF" ), cutLineTab ); + int cutLineGr = addPreference( tr( "VISU_CUT_LINES_SEGMENT_PREF" ), cutLineTab ); setPreferenceProperty( cutLineGr, "columns", 1 ); addPreference( tr( "Show preview" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "show_preview" ); addPreference( tr( "Invert all curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "invert_all_curves" ); @@ -3851,6 +3906,13 @@ void VisuGUI::createPreferences() setPreferenceProperty( sp, "hstretch", 0 ); setPreferenceProperty( sp, "vstretch", 0 ); + int cut_segment_represent = addPreference( tr( "VISU_CUT_SEGMENT" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_segment_represent" ); + setPreferenceProperty( cut_segment_represent, "strings", modes3 ); + setPreferenceProperty( cut_segment_represent, "indexes", indices3 ); + sp = addPreference( "", representGr, LightApp_Preferences::Space ); + setPreferenceProperty( sp, "hstretch", 0 ); + setPreferenceProperty( sp, "vstretch", 0 ); + int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" ); setPreferenceProperty( deformed_shape_represent, "strings", modes0 ); setPreferenceProperty( deformed_shape_represent, "indexes", indices0 ); diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index 58d8f2ce..dff83e2f 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -110,6 +110,7 @@ protected slots: void OnCreateIsoSurfaces(); void OnCreateCutPlanes(); void OnCreateCutLines(); + void OnCreateCutSegment(); void OnCreateStreamLines(); void OnCreatePlot3D(); void OnCreateManyMesh(); @@ -120,6 +121,7 @@ protected slots: void OnEditDeformedShape(); void OnEditCutPlanes(); void OnEditCutLines(); + void OnEditCutSegment(); void OnEditIsoSurfaces(); void OnEditVectors(); void OnEditStreamLines(); diff --git a/src/VISUGUI/VisuGUI_ActionsDef.h b/src/VISUGUI/VisuGUI_ActionsDef.h index 184aee88..e0bc6e7b 100644 --- a/src/VISUGUI/VisuGUI_ActionsDef.h +++ b/src/VISUGUI/VisuGUI_ActionsDef.h @@ -39,6 +39,7 @@ #define VISU_CUT_PLANES 4015 #define VISU_STREAM_LINES 4016 #define VISU_CUT_LINES 4017 +#define VISU_CUT_SEGMENT 40181 // like in VISU_en.xml #define VISU_PLOT2D 4018 #define VISU_PLOT_3D 4019 #define VISU_DEFORMED_SHAPE_AND_SCALAR_MAP 40110 @@ -96,6 +97,7 @@ #define VISU_EDIT_DEFORMEDSHAPE 40621 #define VISU_EDIT_CUTPLANES 40622 #define VISU_EDIT_CUTLINES 40623 +#define VISU_EDIT_CUTSEGMENT 406231 #define VISU_EDIT_ISOSURFACES 40624 #define VISU_EDIT_VECTORS 40625 #define VISU_EDIT_STREAMLINES 40626 diff --git a/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx b/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx new file mode 100644 index 00000000..764f8104 --- /dev/null +++ b/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx @@ -0,0 +1,514 @@ +// Copyright (C) 2007-2008 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 : VisuGUI_CutSegmentDlg.cxx +// Author : Oleg UVAROV +// Module : VISU +// +#include "VisuGUI_CutSegmentDlg.h" + +#include "VisuGUI.h" +#include "VisuGUI_Tools.h" +#include "VisuGUI_ViewTools.h" +#include "VisuGUI_InputPane.h" + +#include "VISU_Gen_i.hh" +#include "VISU_CutSegment_i.hh" +#include "VISU_ColoredPrs3dFactory.hh" + +#include "VISU_PipeLine.hxx" +#include "VISU_CutSegmentPL.hxx" + +#include "SVTK_ViewWindow.h" + +#include "LightApp_Application.h" +#include "SalomeApp_Study.h" + +#include "SUIT_ResourceMgr.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +VisuGUI_CutSegmentDlg::VisuGUI_CutSegmentDlg (SalomeApp_Module* theModule) + : VisuGUI_ScalarBarBaseDlg(theModule), + myPreviewActor(0), + myPreviewActorGlyphs(0), + myPreviewActorPoints(0) +{ + setWindowTitle("Cut Segment Definition"); + setSizeGripEnabled(true); + + QVBoxLayout* aMainLayout = new QVBoxLayout (this); + aMainLayout->setMargin( 7 ); + aMainLayout->setSpacing(5); + + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + hasInit = false; + + // Tab pane + myTabBox = new QTabWidget(this); + + // Cut Segment + QFrame* aCutSegmentPane = new QFrame( this ); + + QGroupBox* aSegmentBox = new QGroupBox( tr( "LBL_SEGMENT" ), aCutSegmentPane ); + + QLabel* aPoint1Label = new QLabel( tr( "LBL_POINT_1" ), aSegmentBox ); + QLabel* aPoint1XLabel = new QLabel( tr( "LBL_X" ), aSegmentBox ); + QLabel* aPoint1YLabel = new QLabel( tr( "LBL_Y" ), aSegmentBox ); + QLabel* aPoint1ZLabel = new QLabel( tr( "LBL_Z" ), aSegmentBox ); + QLabel* aPoint2Label = new QLabel( tr( "LBL_POINT_2" ), aSegmentBox ); + QLabel* aPoint2XLabel = new QLabel( tr( "LBL_X" ), aSegmentBox ); + QLabel* aPoint2YLabel = new QLabel( tr( "LBL_Y" ), aSegmentBox ); + QLabel* aPoint2ZLabel = new QLabel( tr( "LBL_Z" ), aSegmentBox ); + for( int i = 0; i < 3; i++ ) { + myPoint1.append( new QtxDoubleSpinBox( aSegmentBox ) ); + myPoint2.append( new QtxDoubleSpinBox( aSegmentBox ) ); + } + + QListIterator anIter( myPoint1 + myPoint2 ); + while( anIter.hasNext() ) { + QtxDoubleSpinBox* aSpinBox = anIter.next(); + aSpinBox->setDecimals( 6 ); + aSpinBox->setMinimumWidth( 100 ); + } + + QGridLayout* aSegmentBoxLayout = new QGridLayout( aSegmentBox ); + aSegmentBoxLayout->addWidget( aPoint1Label, 0, 0 ); + aSegmentBoxLayout->addWidget( aPoint1XLabel, 0, 1 ); + aSegmentBoxLayout->addWidget( myPoint1[0], 0, 2 ); + aSegmentBoxLayout->addWidget( aPoint1YLabel, 0, 3 ); + aSegmentBoxLayout->addWidget( myPoint1[1], 0, 4 ); + aSegmentBoxLayout->addWidget( aPoint1ZLabel, 0, 5 ); + aSegmentBoxLayout->addWidget( myPoint1[2], 0, 6 ); + aSegmentBoxLayout->addWidget( aPoint2Label, 1, 0 ); + aSegmentBoxLayout->addWidget( aPoint2XLabel, 1, 1 ); + aSegmentBoxLayout->addWidget( myPoint2[0], 1, 2 ); + aSegmentBoxLayout->addWidget( aPoint2YLabel, 1, 3 ); + aSegmentBoxLayout->addWidget( myPoint2[1], 1, 4 ); + aSegmentBoxLayout->addWidget( aPoint2ZLabel, 1, 5 ); + aSegmentBoxLayout->addWidget( myPoint2[2], 1, 6 ); + + myPreviewCheck = new QCheckBox( tr( "LBL_SHOW_PREVIEW" ), aCutSegmentPane ); + myPreviewCheck->setChecked( aResourceMgr->booleanValue( "VISU", "show_preview", false ) ); + + myAllCurvesInvertedCheck = new QCheckBox( tr( "LBL_INVERT_CURVES" ), aCutSegmentPane ); + myAllCurvesInvertedCheck->setChecked( false ); + + myUseAbsoluteLengthCheck = new QCheckBox( tr( "LBL_ABSOLUTE_LENGTH" ), aCutSegmentPane ); + myUseAbsoluteLengthCheck->setChecked( false ); + + myCreateTable = new QCheckBox( tr("LBL_GENERATE_TABLE"), aCutSegmentPane ); + myCreateTable->setChecked( aResourceMgr->booleanValue( "VISU", "generate_data_table", true ) ); + + QWidget* aCheckPane = new QWidget( aCutSegmentPane ); + myCurvesCheck = new QCheckBox( tr( "LBL_GENERATE_CURVES" ), aCheckPane ); + myCurvesCheck->setChecked( aResourceMgr->booleanValue( "VISU", "generate_curves", true ) ); + myCurvesCheck->setEnabled( aResourceMgr->booleanValue( "VISU", "generate_data_table", true ) ); + + QHBoxLayout* aCheckLayout = new QHBoxLayout( aCheckPane ); + aCheckLayout->setMargin( 0 ); + aCheckLayout->setSpacing( 0 ); + aCheckLayout->insertSpacing( 0, 20 ); + aCheckLayout->addWidget( myCurvesCheck ); + + QVBoxLayout* aCutSegmentLayout = new QVBoxLayout( aCutSegmentPane ); + aCutSegmentLayout->setMargin( 5 ); + aCutSegmentLayout->setSpacing( 6 ); + aCutSegmentLayout->addWidget( aSegmentBox ); + aCutSegmentLayout->addWidget( myPreviewCheck ); + aCutSegmentLayout->addWidget( myAllCurvesInvertedCheck ); + aCutSegmentLayout->addWidget( myUseAbsoluteLengthCheck ); + aCutSegmentLayout->addWidget( myCreateTable ); + aCutSegmentLayout->addWidget( aCheckPane ); + aCutSegmentLayout->addStretch(); + + myTabBox->addTab( aCutSegmentPane, tr("LBL_CUT_SEGMENT") ); + + myInputPane = new VisuGUI_InputPane(VISU::TCUTSEGMENT, theModule, this); + myTabBox->addTab(GetScalarPane(), "Scalar Bar"); + myTabBox->addTab(myInputPane, "Input"); + + aMainLayout->addWidget(myTabBox); + + // Dialog buttons + QFrame* aBtnBox = new QFrame(this); + QHBoxLayout* aHBLay = new QHBoxLayout( aBtnBox ); + aBtnBox->setFrameStyle(QFrame::Box | QFrame::Sunken); + aBtnBox->setLineWidth( 1 ); + aHBLay->setSpacing( 5 ); + aHBLay->setMargin( 11 ); + + QPushButton* aOkBtn = new QPushButton (tr("BUT_OK"), aBtnBox); + aOkBtn->setAutoDefault( TRUE ); + aOkBtn->setDefault( true ); + aHBLay->addWidget(aOkBtn); + + aHBLay->addStretch(); + + QPushButton* aCloseBtn = new QPushButton(tr("BUT_CANCEL"), aBtnBox); + aHBLay->addWidget(aCloseBtn); + + QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox); + aHBLay->addWidget(aHelpBtn); + + aMainLayout->addWidget(aBtnBox); + + // signals and slots connections + connect(myPreviewCheck, SIGNAL(toggled(bool)) , this, SLOT(onPreviewCheck(bool))); + connect(myAllCurvesInvertedCheck, SIGNAL(toggled(bool)),this, SLOT(onAllCurvesInvertedCheck(bool))); + for( int i = 0; i < 3; i++ ) { + connect(myPoint1[ i ], SIGNAL(valueChanged(double)), this, SLOT(onPointModified())); + connect(myPoint2[ i ], SIGNAL(valueChanged(double)), this, SLOT(onPointModified())); + } + connect(myCreateTable , SIGNAL(toggled(bool)), myCurvesCheck, SLOT(setEnabled(bool))); + + connect(aOkBtn, SIGNAL(clicked()), this, SLOT(accept())); + connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject())); + connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); +} + +/*! + Destructor +*/ +VisuGUI_CutSegmentDlg::~VisuGUI_CutSegmentDlg() +{ + deletePlanes(); + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) + vf->Repaint(); +} + +//------------------------------------------------------------------------------ +void VisuGUI_CutSegmentDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs, + bool theInit ) +{ + if( theInit ) + myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); + + VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit); + + hasInit = true; + myCutSegment = VISU::TSameAsFactory().Create(myPrsCopy, VISU::ColoredPrs3d_i::EDoNotPublish); + myCutSegment->CopyCurvesInverted(myPrsCopy->GetCurvesInverted()); + myAllCurvesInvertedCheck->setChecked( myCutSegment->IsAllCurvesInverted() ); + myUseAbsoluteLengthCheck->setChecked( myCutSegment->IsUseAbsoluteLength() ); + + vtkDataSet* anInput = myCutSegment->GetPipeLine()->GetInput(); + anInput->Update(); + + vtkFloatingPointType bounds[6]; + anInput->GetBounds( bounds ); + + for( int i = 0; i < 3; i++ ) { + double min = bounds[ 2*i ], max = bounds[ 2*i+1 ]; + myPoint1[ i ]->setRange( min, max ); + myPoint2[ i ]->setRange( min, max ); + + myPoint1[ i ]->setSingleStep( ( max - min ) / 10 ); + myPoint2[ i ]->setSingleStep( ( max - min ) / 10 ); + } + + double p1[3], p2[3]; + myPrsCopy->GetPoint1( p1[0], p1[1], p1[2] ); + myPrsCopy->GetPoint2( p2[0], p2[1], p2[2] ); + + for( int i = 0; i < 3; i++ ) { + myPoint1[i]->setValue( p1[i] ); + myPoint2[i]->setValue( p2[i] ); + } + + // Draw Preview + if (myPreviewCheck->isChecked()) { + createPlanes(); + } + + if( !theInit ) + return; + + myInputPane->initFromPrsObject( myPrsCopy ); + myTabBox->setCurrentIndex( 0 ); +} + +//------------------------------------------------------------------------------ +int VisuGUI_CutSegmentDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs) +{ + if(!myInputPane->check() || !GetScalarPane()->check()) + return 0; + + int anIsOk = myInputPane->storeToPrsObject( myPrsCopy ); + anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy ); + + myPrsCopy->SetAllCurvesInverted( myAllCurvesInvertedCheck->isChecked() ); + myPrsCopy->SetUseAbsoluteLength( myUseAbsoluteLengthCheck->isChecked() ); + + double p1[3], p2[3]; + for( int i = 0; i < 3; i++ ) { + p1[i] = myPoint1[i]->value(); + p2[i] = myPoint2[i]->value(); + } + myPrsCopy->SetPoint1( p1[0], p1[1], p1[2] ); + myPrsCopy->SetPoint2( p2[0], p2[1], p2[2] ); + + VISU::TSameAsFactory().Copy(myPrsCopy, thePrs); + + return anIsOk; +} + +//------------------------------------------------------------------------------ +void VisuGUI_CutSegmentDlg::createPlanes() +{ + SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); + if (aView == NULL) return; + if (!(bool)myCutSegment) return; + if (myPreviewActor != 0) return; + + storeToPrsObject(myCutSegment); + myCutSegment->GetPipeLine()->Update(); + vtkAppendPolyData* aPolyData = myCutSegment->GetSpecificPL()->GetAppendPolyData(); + vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New(); + aPlaneMapper->SetInput(aPolyData->GetOutput()); + aPlaneMapper->ScalarVisibilityOff(); + + myPreviewActorGlyphs = SALOME_Actor::New(); + myPreviewActorGlyphs->PickableOff(); + updateGlyphs(false); + + myPreviewActorPoints = SALOME_Actor::New(); + myPreviewActorPoints->PickableOff(); + updatePoints(false); + + myPreviewActor = SALOME_Actor::New(); + myPreviewActor->PickableOff(); + myPreviewActor->SetMapper(aPlaneMapper); + aPlaneMapper->Delete(); + aView->AddActor(myPreviewActor); + aView->AddActor(myPreviewActorGlyphs); + aView->AddActor(myPreviewActorPoints); + aView->getRenderer()->Render(); + aView->onFitAll(); +} + +//------------------------------------------------------------------------------ +void VisuGUI_CutSegmentDlg::deletePlanes() +{ + if (myPreviewActor == 0) return; + vtkRenderer* aRend = myPreviewActor->GetRenderer(); + vtkRenderer* aRendGlyphs = myPreviewActorGlyphs->GetRenderer(); + vtkRenderer* aRendPoints = myPreviewActorPoints->GetRenderer(); + + vtkRenderWindow* aWnd1 = aRend->GetRenderWindow(); + vtkRenderWindow* aWnd2 = aRendGlyphs->GetRenderWindow(); + vtkRenderWindow* aWnd3 = aRendPoints->GetRenderWindow(); + if(aRend && aWnd1) + myPreviewActor->RemoveFromRender(aRend); + if(aRendGlyphs && aWnd2) + myPreviewActorGlyphs->RemoveFromRender(aRendGlyphs); + if(aRendPoints && aWnd3) + myPreviewActorPoints->RemoveFromRender(aRendPoints); + + myPreviewActor->Delete(); + myPreviewActorGlyphs->Delete(); + myPreviewActorPoints->Delete(); + myPreviewActor = 0; + myPreviewActorGlyphs = 0; + myPreviewActorPoints = 0; +} + +//------------------------------------------------------------------------------ +void VisuGUI_CutSegmentDlg::updateGlyphs(bool update){ + if (myPreviewActorGlyphs == 0 ) return; + const vtkFloatingPointType *aDirLn = myCutSegment->GetSpecificPL()->GetRealDirLn(); + vtkFloatingPointType aSecondPnt[3]; + vtkFloatingPointType aBoundCenter[3]; + + vtkAppendPolyData* aPolyData = myCutSegment->GetSpecificPL()->GetAppendPolyData(); + vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New(); + aPlaneMapper->SetInput(aPolyData->GetOutput()); + vtkFloatingPointType bounds[6]; + aPlaneMapper->GetBounds(bounds); + + for(int i=0; i<3; i++) aBoundCenter[i] = (bounds[i*2] + bounds[i*2+1])/2.0; + for(int i=0; i<3; i++){ + if (!myAllCurvesInvertedCheck->isChecked()) + aSecondPnt[i] = aDirLn[i]; + else + aSecondPnt[i] = - aDirLn[i]; + } + + vtkFloatingPointType max_bound = 0; + max_bound < bounds[1]-bounds[0] ? max_bound = bounds[1] - bounds[0] : max_bound = max_bound; + max_bound < bounds[3]-bounds[2] ? max_bound = bounds[3] - bounds[2] : max_bound = max_bound; + max_bound < bounds[5]-bounds[4] ? max_bound = bounds[5] - bounds[4] : max_bound = max_bound; + + vtkPolyData* profile = vtkPolyData::New(); + vtkPoints* aPoints = vtkPoints::New(); + vtkGlyph3D* glyphs = vtkGlyph3D::New(); + vtkFloatArray *aFloatArray = vtkFloatArray::New(); + vtkGlyphSource2D* source = vtkGlyphSource2D::New(); + + source->FilledOn(); + source->SetGlyphTypeToArrow(); + + aPoints->InsertNextPoint(aBoundCenter); + profile->SetPoints(aPoints); + + aFloatArray->SetNumberOfComponents(3); + for(int i=0; i<3 ;i++) + aFloatArray->InsertNextValue(aSecondPnt[i]); + + vtkDataSetAttributes* aDataSetAttributes; + aDataSetAttributes = profile->GetPointData(); + aDataSetAttributes->SetVectors(aFloatArray); + + glyphs->SetScaleFactor(0.25*max_bound); + glyphs->SetVectorModeToUseVector(); + glyphs->SetScaleModeToScaleByVector(); + glyphs->SetInput(profile); + glyphs->SetSource(source->GetOutput()); + + vtkPolyDataMapper* aGlyphsMapper = vtkPolyDataMapper::New(); + aGlyphsMapper->ScalarVisibilityOff(); + aGlyphsMapper->SetInput(glyphs->GetOutput()); + + myPreviewActorGlyphs->SetMapper(aGlyphsMapper); + + profile->Delete(); + glyphs->Delete(); + aPoints->Delete(); + aGlyphsMapper->Delete(); + aFloatArray->Delete(); + source->Delete(); + aPlaneMapper->Delete(); + + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) + if (update) + vf->Repaint(); +} + +//------------------------------------------------------------------------------ +void VisuGUI_CutSegmentDlg::updatePoints( bool update ) +{ + if( !myPreviewActorPoints ) + return; + + vtkFloatingPointType aPoint1[3], aPoint2[3]; + myCutSegment->GetSpecificPL()->GetPoint1( aPoint1[0], aPoint1[1], aPoint1[2] ); + myCutSegment->GetSpecificPL()->GetPoint2( aPoint2[0], aPoint2[1], aPoint2[2] ); + + vtkPoints* aPoints = vtkPoints::New(); + aPoints->InsertNextPoint( aPoint1 ); + aPoints->InsertNextPoint( aPoint2 ); + + vtkCellArray* aVerts = vtkCellArray::New(); + for( int i = 0, n = aPoints->GetNumberOfPoints(); i < n; i++ ) + aVerts->InsertNextCell( 1, &i ); + + vtkPolyData* aProfile = vtkPolyData::New(); + aProfile->SetPoints( aPoints ); + aProfile->SetVerts( aVerts ); + + vtkPolyDataMapper* aPointsMapper = vtkPolyDataMapper::New(); + aPointsMapper->ScalarVisibilityOff(); + aPointsMapper->SetInput( aProfile ); + + myPreviewActorPoints->SetMapper( aPointsMapper ); + myPreviewActorPoints->GetProperty()->SetRepresentationToPoints(); + myPreviewActorPoints->GetProperty()->SetPointSize( 5 ); + + aProfile->Delete(); + aPoints->Delete(); + aVerts->Delete(); + + if( SVTK_ViewWindow* vf = VISU::GetActiveViewWindow() ) + if( update ) + vf->Repaint(); +} + +//------------------------------------------------------------------------------ +void VisuGUI_CutSegmentDlg::accept() +{ + VisuGUI_ScalarBarBaseDlg::accept(); +} + +//------------------------------------------------------------------------------ +void VisuGUI_CutSegmentDlg::reject() +{ + VisuGUI_ScalarBarBaseDlg::reject(); +} + +//------------------------------------------------------------------------------ +void VisuGUI_CutSegmentDlg::onPreviewCheck (bool thePreview) +{ + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { + if (thePreview) { + createPlanes(); + } else { + deletePlanes(); + vf->Repaint(); + } + } +} + +//------------------------------------------------------------------------------ +void VisuGUI_CutSegmentDlg::onAllCurvesInvertedCheck(bool theInvert) +{ + bool anIsAllCurvesInverted = myAllCurvesInvertedCheck->isChecked(); + + myCutSegment->SetAllCurvesInverted( anIsAllCurvesInverted ); + myPrsCopy->SetAllCurvesInverted( anIsAllCurvesInverted ); + + updateGlyphs(true); + updatePoints(true); +} + +//------------------------------------------------------------------------------ +void VisuGUI_CutSegmentDlg::onPointModified () +{ + if (!(bool)myCutSegment) return; + SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); + if (aView) { + if (myPreviewCheck->isChecked()) { + deletePlanes(); + createPlanes(); + } + } +} + +//------------------------------------------------------------------------------ +QString VisuGUI_CutSegmentDlg::GetContextHelpFilePath() +{ + return "cut_segment_page.html"; +} diff --git a/src/VISUGUI/VisuGUI_CutSegmentDlg.h b/src/VISUGUI/VisuGUI_CutSegmentDlg.h new file mode 100644 index 00000000..b57762f1 --- /dev/null +++ b/src/VISUGUI/VisuGUI_CutSegmentDlg.h @@ -0,0 +1,101 @@ +// Copyright (C) 2007-2008 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 : VisuGUI_CutSegmentDlg.h +// Author : Oleg UVAROV +// Module : VISU +// +#ifndef VISUGUI_CUTSEGMENTDLG_H +#define VISUGUI_CUTSEGMENTDLG_H + +#include "VisuGUI_CutPlanesDlg.h" + +#include +#include + +class QTabWidget; + +class SalomeApp_Module; +class VisuGUI_InputPane; + +namespace VISU +{ + class CutSegment_i; +} + +class VisuGUI_CutSegmentDlg: public VisuGUI_ScalarBarBaseDlg +{ + Q_OBJECT + +public: + VisuGUI_CutSegmentDlg (SalomeApp_Module* theModule); + ~VisuGUI_CutSegmentDlg(); + + virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, + bool theInit ); + + virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); + + bool isGenerateTable() { return myCreateTable->isChecked(); } + bool isGenerateCurves() { return myCreateTable->isChecked() && myCurvesCheck->isChecked(); } + +protected: + virtual QString GetContextHelpFilePath(); + +protected slots: + void accept(); + void reject(); + +private slots: + void onPreviewCheck(bool thePreview); + void onAllCurvesInvertedCheck(bool theInvert); + void onPointModified(); + +private: + void createPlanes(); + void deletePlanes(); + void updateGlyphs(bool update); + void updatePoints(bool update); + + QCheckBox* myCreateTable; + QCheckBox* myCurvesCheck; + + bool hasInit; + + QList myPoint1; + QList myPoint2; + + SALOME::GenericObjPtr myCutSegment; + + QTabWidget* myTabBox; + VisuGUI_InputPane* myInputPane; + + SALOME_Actor* myPreviewActor; + SALOME_Actor* myPreviewActorGlyphs; + SALOME_Actor* myPreviewActorPoints; + QCheckBox* myPreviewCheck; + QCheckBox* myAllCurvesInvertedCheck; + QCheckBox* myUseAbsoluteLengthCheck; + + SALOME::GenericObjPtr myPrsCopy; +}; + +#endif // VISUGUI_CUTSEGMENTDLG_H diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 86299587..1e9b560c 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -68,7 +68,7 @@ #include "VISU_Gen_i.hh" #include "VISU_Result_i.hh" -#include "VISU_CutLines_i.hh" +#include "VISU_CutLinesBase_i.hh" #include "VISU_Actor.h" #include "VISU_ScalarMapAct.h" @@ -151,7 +151,7 @@ using namespace std; void CreateCurves( SalomeApp_Module* theModule, - VISU::CutLines_i* thePrs, + VISU::CutLinesBase_i* thePrs, QDialog* theDlg, const bool theCreate = true ); diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index c9864171..96aab243 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -81,7 +81,7 @@ namespace VISU // Optionally, create table and curves for cut lines QApplication::setOverrideCursor(Qt::WaitCursor); CreateCurves( theModule, - dynamic_cast( aPrs3d ), + dynamic_cast( aPrs3d ), aDlg, false ); // in edition mode QApplication::restoreOverrideCursor(); @@ -245,7 +245,7 @@ namespace VISU // Optionally, create table and curves for cut lines QApplication::setOverrideCursor(Qt::WaitCursor); CreateCurves( theModule, - dynamic_cast( aPrs3d ), + dynamic_cast( aPrs3d ), aDlg, true ); // in creation mode UpdateObjBrowser(theModule,true,theTimeStamp); diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index 3828a0ca..381ad9bc 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -122,6 +122,7 @@ QString VisuGUI_Selection::type( const int ind ) const ENUM2STRING( aResStr, VISU::TSCALARMAPONDEFORMEDSHAPE ); ENUM2STRING( aResStr, VISU::TCUTPLANES ); ENUM2STRING( aResStr, VISU::TCUTLINES ); + ENUM2STRING( aResStr, VISU::TCUTSEGMENT ); ENUM2STRING( aResStr, VISU::TVECTORS ); ENUM2STRING( aResStr, VISU::TSTREAMLINES ); ENUM2STRING( aResStr, VISU::TPLOT3D ); diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 48022226..c0a9c0e5 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -32,6 +32,7 @@ #include "VisuGUI_DeformedShapeDlg.h" #include "VisuGUI_CutPlanesDlg.h" #include "VisuGUI_CutLinesDlg.h" +#include "VisuGUI_CutSegmentDlg.h" #include "VisuGUI_Plot3DDlg.h" #include "VisuGUI_VectorsDlg.h" #include "VisuGUI_IsoSurfacesDlg.h" @@ -47,6 +48,7 @@ #include "VISU_CutPlanes_i.hh" #include "VISU_Plot3D_i.hh" #include "VISU_CutLines_i.hh" +#include "VISU_CutSegment_i.hh" #include "VISU_Vectors_i.hh" #include "VISU_StreamLines_i.hh" #include "VISU_DeformedShapeAndScalarMap_i.hh" @@ -903,12 +905,13 @@ enum PrsComboItem { TISOSURFACES_ITEM = 1, // VISU::TISOSURFACES TCUTPLANES_ITEM = 2, // VISU::TCUTPLANES TCUTLINES_ITEM = 3, // VISU::TCUTLINES - TPLOT3D_ITEM = 4, // VISU::TPLOT3D - TDEFORMEDSHAPE_ITEM = 5, // VISU::TDEFORMEDSHAPE - TVECTORS_ITEM = 6, // VISU::TVECTORS - TSTREAMLINES_ITEM = 7, // VISU::TSTREAMLINES - TGAUSSPOINTS_ITEM = 8, // VISU::TGAUSSPOINTS - TDEFORMEDSHAPEANDSCALARMAP_ITEM = 9 // VISU::TDEFORMEDSHAPEANDSCALARMAP + TCUTSEGMENT_ITEM = 4, // VISU::TCUTSEGMENT + TPLOT3D_ITEM = 5, // VISU::TPLOT3D + TDEFORMEDSHAPE_ITEM = 6, // VISU::TDEFORMEDSHAPE + TVECTORS_ITEM = 7, // VISU::TVECTORS + TSTREAMLINES_ITEM = 8, // VISU::TSTREAMLINES + TGAUSSPOINTS_ITEM = 9, // VISU::TGAUSSPOINTS + TDEFORMEDSHAPEANDSCALARMAP_ITEM = 10 // VISU::TDEFORMEDSHAPEANDSCALARMAP }; //------------------------------------------------------------------------ @@ -956,7 +959,11 @@ void SetupDlg::onFieldChange (int theIndex) myTypeId2ComboId[TCUTLINES_ITEM] = myComboId2TypeId.size(); myComboId2TypeId.push_back(TCUTLINES_ITEM);; - myTypeCombo->addItem("Plot 3D"); // item 4 + myTypeCombo->addItem("Cut Segment"); // item 4 + myTypeId2ComboId[TCUTSEGMENT_ITEM] = myComboId2TypeId.size(); + myComboId2TypeId.push_back(TCUTSEGMENT_ITEM);; + + myTypeCombo->addItem("Plot 3D"); // item 5 myTypeId2ComboId[TPLOT3D_ITEM] = myComboId2TypeId.size(); myComboId2TypeId.push_back(TPLOT3D_ITEM);; @@ -996,25 +1003,25 @@ void SetupDlg::onFieldChange (int theIndex) } if (anEnableItems) { - myTypeCombo->addItem("Deformed Shape"); // item 5 + myTypeCombo->addItem("Deformed Shape"); // item 6 myTypeId2ComboId[TDEFORMEDSHAPE_ITEM] = myComboId2TypeId.size(); myComboId2TypeId.push_back(TDEFORMEDSHAPE_ITEM);; - myTypeCombo->addItem("Vectors"); // item 6 + myTypeCombo->addItem("Vectors"); // item 7 myTypeId2ComboId[TVECTORS_ITEM] = myComboId2TypeId.size(); myComboId2TypeId.push_back(TVECTORS_ITEM);; - myTypeCombo->addItem("Stream Lines"); // item 7 + myTypeCombo->addItem("Stream Lines"); // item 8 myTypeId2ComboId[TSTREAMLINES_ITEM] = myComboId2TypeId.size(); myComboId2TypeId.push_back(TSTREAMLINES_ITEM);; - myTypeCombo->addItem("Deformed shape and Scalar map"); // item 9 + myTypeCombo->addItem("Deformed shape and Scalar map"); // item 10 myTypeId2ComboId[TDEFORMEDSHAPEANDSCALARMAP_ITEM] = myComboId2TypeId.size(); myComboId2TypeId.push_back(TDEFORMEDSHAPEANDSCALARMAP_ITEM);; } if(anEnableGP){ - myTypeCombo->addItem("Gauss Points"); // item 8 + myTypeCombo->addItem("Gauss Points"); // item 9 myTypeId2ComboId[TGAUSSPOINTS_ITEM] = myComboId2TypeId.size(); myComboId2TypeId.push_back(TGAUSSPOINTS_ITEM);; } @@ -1032,6 +1039,9 @@ void SetupDlg::onFieldChange (int theIndex) case VISU::TCUTLINES: //Cut Lines myTypeCombo->setCurrentIndex(myTypeId2ComboId[TCUTLINES_ITEM]); break; + case VISU::TCUTSEGMENT: //Cut Segment + myTypeCombo->setCurrentIndex(myTypeId2ComboId[TCUTSEGMENT_ITEM]); + break; case VISU::TPLOT3D: //Plot 3D myTypeCombo->setCurrentIndex(myTypeId2ComboId[TPLOT3D_ITEM]); break; @@ -1078,6 +1088,9 @@ void SetupDlg::onTypeChanged (int theIndex) case TCUTLINES_ITEM: //Cut Lines aData.myPrsType = VISU::TCUTLINES; break; + case TCUTSEGMENT_ITEM: //Cut Segment + aData.myPrsType = VISU::TCUTSEGMENT; + break; case TPLOT3D_ITEM: //Plot 3D aData.myPrsType = VISU::TPLOT3D; break; @@ -1195,6 +1208,10 @@ void SetupDlg::onPreferencesDlg() c.suspend(); EditPrs(myModule,aData,myAnimator); break; + case TCUTSEGMENT_ITEM: //Cut Segment + c.suspend(); + EditPrs(myModule,aData,myAnimator); + break; case TPLOT3D_ITEM: //Plot 3D c.suspend(); EditPrs(myModule,aData,myAnimator); diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index dc16a187..4748228c 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -1355,6 +1355,7 @@ namespace VISU case VISU::TDEFORMEDSHAPE: case VISU::TCUTPLANES: case VISU::TCUTLINES: + case VISU::TCUTSEGMENT: case VISU::TVECTORS: case VISU::TSTREAMLINES: case VISU::TPLOT3D: diff --git a/src/VISU_I/Makefile.am b/src/VISU_I/Makefile.am index 56aad839..960e39b7 100644 --- a/src/VISU_I/Makefile.am +++ b/src/VISU_I/Makefile.am @@ -47,7 +47,9 @@ salomeinclude_HEADERS = \ VISU_DeformedShape_i.hh \ VISU_Plot3D_i.hh \ VISU_CutPlanes_i.hh \ + VISU_CutLinesBase_i.hh \ VISU_CutLines_i.hh \ + VISU_CutSegment_i.hh \ VISU_Prs3dUtils.hh \ VISU_Vectors_i.hh \ VISU_StreamLines_i.hh \ @@ -83,7 +85,9 @@ libVISUEngineImpl_la_SOURCES = \ VISU_DeformedShape_i.cc \ VISU_Plot3D_i.cc \ VISU_CutPlanes_i.cc \ + VISU_CutLinesBase_i.cc \ VISU_CutLines_i.cc \ + VISU_CutSegment_i.cc \ VISU_Vectors_i.cc \ VISU_StreamLines_i.cc \ VISU_DeformedShapeAndScalarMap_i.cc \ diff --git a/src/VISU_I/VISUConfig.cc b/src/VISU_I/VISUConfig.cc index 88234240..84739c38 100644 --- a/src/VISU_I/VISUConfig.cc +++ b/src/VISU_I/VISUConfig.cc @@ -223,8 +223,8 @@ namespace VISU return VISU::TPLOT3D; if ( theComment == "CUTPLANES" ) return VISU::TCUTPLANES; - if ( theComment == "CUTLINES" ) - return VISU::TCUTLINES; + if ( theComment == "CUTSEGMENT" ) + return VISU::TCUTSEGMENT; if ( theComment == "VECTORS" ) return VISU::TVECTORS; if ( theComment == "STREAMLINES" ) diff --git a/src/VISU_I/VISU_ColoredPrs3dFactory.cc b/src/VISU_I/VISU_ColoredPrs3dFactory.cc index bb3a816a..26327b58 100644 --- a/src/VISU_I/VISU_ColoredPrs3dFactory.cc +++ b/src/VISU_I/VISU_ColoredPrs3dFactory.cc @@ -110,6 +110,8 @@ namespace VISU return VISU::CreatePrs3dByEnum(theStudy, thePublishInStudyMode); case TCUTLINES: return VISU::CreatePrs3dByEnum(theStudy, thePublishInStudyMode); + case TCUTSEGMENT: + return VISU::CreatePrs3dByEnum(theStudy, thePublishInStudyMode); case TVECTORS: return VISU::CreatePrs3dByEnum(theStudy, thePublishInStudyMode); } @@ -221,6 +223,9 @@ namespace VISU case TCUTLINES: aMemory = CheckIsPossible(theInput, theMemoryCheck); break; + case TCUTSEGMENT: + aMemory = CheckIsPossible(theInput, theMemoryCheck); + break; case TVECTORS: aMemory = CheckIsPossible(theInput, theMemoryCheck); break; diff --git a/src/VISU_I/VISU_ColoredPrs3dFactory.hh b/src/VISU_I/VISU_ColoredPrs3dFactory.hh index 4b5c2b41..e3633e40 100644 --- a/src/VISU_I/VISU_ColoredPrs3dFactory.hh +++ b/src/VISU_I/VISU_ColoredPrs3dFactory.hh @@ -39,6 +39,7 @@ #include "VISU_StreamLines_i.hh" #include "VISU_Vectors_i.hh" #include "VISU_CutLines_i.hh" +#include "VISU_CutSegment_i.hh" #include "VISU_CutPlanes_i.hh" #include "VISU_DeformedShape_i.hh" #include "VISU_IsoSurfaces_i.hh" @@ -61,9 +62,10 @@ namespace VISU TList > > > > > > > > > > + TList > > > > > > > > > > > TColoredPrs3dTypeList; @@ -76,9 +78,10 @@ namespace VISU TList, TList, TList, - TList, - TList, - TNullType> > > > > > > > > > > + TList, + TList, + TList, + TNullType> > > > > > > > > > > > TColoredPrs3dEnumList; diff --git a/src/VISU_I/VISU_CutLinesBase_i.cc b/src/VISU_I/VISU_CutLinesBase_i.cc new file mode 100644 index 00000000..5c474f90 --- /dev/null +++ b/src/VISU_I/VISU_CutLinesBase_i.cc @@ -0,0 +1,468 @@ +// Copyright (C) 2007-2008 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 : VISU_CutLinesBase_i.cc +// Author : Oleg UVAROV +// Module : VISU +// +#include "VISU_CutLinesBase_i.hh" +#include "VISU_Prs3dUtils.hh" +#include "VISU_Result_i.hh" + +#include "VISU_Actor.h" +#include "VISU_CutLinesBasePL.hxx" +#include "VISU_Convertor.hxx" +#include "VISU_PipeLineUtils.hxx" + +#include "SUIT_ResourceMgr.h" + +#include + +static vtkFloatingPointType EPS_machine = 1.0E-7; + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +using namespace std; + +//--------------------------------------------------------------- +VISU::CutLinesBase_i:: +CutLinesBase_i(EPublishInStudyMode thePublishInStudyMode) : + ColoredPrs3d_i(thePublishInStudyMode), + ScalarMap_i(thePublishInStudyMode), + myUseAbsLength( false ), + myCutLinesBasePL(NULL) +{} + + +//--------------------------------------------------------------- +void +VISU::CutLinesBase_i +::SameAs(const Prs3d_i* theOrigin) +{ + TSuperClass::SameAs(theOrigin); + + if(const CutLinesBase_i* aPrs3d = dynamic_cast(theOrigin)){ + CutLinesBase_i* anOrigin = const_cast(aPrs3d); + myUseAbsLength = anOrigin->IsUseAbsoluteLength(); + CopyCurvesInverted(anOrigin->GetCurvesInverted()); + } +} + + +//--------------------------------------------------------------- +/*! Copy map to /a myMapCurvesInverted. + * \param theCurves - map + */ +void +VISU::CutLinesBase_i +::CopyCurvesInverted(const TCurvesInv& theCurves) +{ + myMapCurvesInverted = theCurves; +} + + +//--------------------------------------------------------------- +VISU::Storable* +VISU::CutLinesBase_i +::Create(const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber) +{ + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + SetUseAbsoluteLength( aResourceMgr->booleanValue( "VISU", "use_absolute_length", false ) ); + SetAllCurvesInverted( aResourceMgr->booleanValue( "VISU", "invert_all_curves", false ) ); + return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber); +} + + +//--------------------------------------------------------------- +VISU::Storable* +VISU::CutLinesBase_i +::Restore(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap) +{ + if(!TSuperClass::Restore(theSObject, theMap)) + return NULL; + + SetNbLines(VISU::Storable::FindValue(theMap,"myNbLines").toInt()); + + SetUseAbsoluteLength(VISU::Storable::FindValue(theMap,"myUseAbsLength").toInt()); + + // Restoring the map - \a myMapCurvesInverted + QStringList aMapCurvesInverted = VISU::Storable::FindValue(theMap,"myMapCurvesInverted").split("|",QString::SkipEmptyParts ); + if (aMapCurvesInverted.count() == GetNbLines()){ + for(int i = 0, iEnd = GetNbLines(); i < iEnd ; i++){ + if(aMapCurvesInverted[i].toInt()) + SetCurveInverted(i,true); + else + SetCurveInverted(i,false); + } + } else { + for(int i = 0, iEnd = GetNbLines(); i < iEnd ; i++) + SetCurveInverted(i,false); + } + + return this; +} + + +//--------------------------------------------------------------- +void +VISU::CutLinesBase_i +::ToStream(std::ostringstream& theStr) +{ + TSuperClass::ToStream(theStr); + + Storable::DataToStream( theStr, "myNbLines", GetNbLines() ); + + Storable::DataToStream( theStr, "myUseAbsLength", IsUseAbsoluteLength()); + + // Storing the map - \a myMapCurvesInverted + QString aStrCurvesInverted; + for(int i = 0, iEnd = GetNbLines(); i < iEnd; i++) + aStrCurvesInverted.append(QString::number(IsCurveInverted(i)) + "|"); + Storable::DataToStream( theStr, "myMapCurvesInverted", (const char*)aStrCurvesInverted.toLatin1()); +} + + +//--------------------------------------------------------------- +VISU::CutLinesBase_i +::~CutLinesBase_i() +{ + if(MYDEBUG) MESSAGE("CutLinesBase_i::~CutLinesBase_i()"); +} + + +//--------------------------------------------------------------- +void +VISU::CutLinesBase_i +::SetNbLines(CORBA::Long theNb) +{ + VISU::TSetModified aModified(this); + + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificPL(), &VISU_CutLinesBasePL::SetNbParts, theNb)); +} + +//--------------------------------------------------------------- +CORBA::Long +VISU::CutLinesBase_i +::GetNbLines() +{ + return myCutLinesBasePL->GetNbParts(); +} + +//--------------------------------------------------------------- +/*! Invert all curves of corresponding table + * see void VISU::CutLinesBase_i::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert) + * \param theInvert - Invert all curves, if value is TRUE, else not. + */ +void +VISU::CutLinesBase_i +::SetAllCurvesInverted(CORBA::Boolean theInvert) +{ + for(int i=0; i < GetNbLines(); i++) + SetCurveInverted(i, theInvert); +} + +//--------------------------------------------------------------- +/*! Checks the orientation of all curves + * \retval TRUE - if all curves are inverted, else FALSE + */ +CORBA::Boolean +VISU::CutLinesBase_i +::IsAllCurvesInverted() +{ + for (int i=0; i(thePipeLine); + + TSuperClass::CreatePipeLine(myCutLinesBasePL); +} + + +//--------------------------------------------------------------- +void +VISU::CutLinesBase_i +::BuildTableOfReal(SALOMEDS::SObject_var theSObject) +{ + try{ + if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal"); + Update(); + SALOMEDS::GenericAttribute_var anAttr; + SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder(); + anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal"); + SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr); + + typedef set TXCont; + typedef map TXYMap; + typedef map TXYMapCont; + typedef map TLineIdCont; + + QString aTitle( GetScalarBarTitle().c_str() ); + aTitle = aTitle.simplified(); + aTableOfReal->SetTitle( aTitle.toLatin1().data() ); + + int iLineEnd = myCutLinesBasePL->GetAppendPolyData()->GetNumberOfInputConnections(0); + if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLineEnd = "<GetDirLn(); + const vtkFloatingPointType *aBasePnt = myCutLinesBasePL->GetBasePnt(); + const vtkFloatingPointType *aBoundPrjLn = myCutLinesBasePL->GetBoundPrjLn(); + for(int iLine = 0, jLine = 0; iLine < iLineEnd; iLine++){ + vtkDataSet *aDataSet = myCutLinesBasePL->GetAppendPolyData()->GetInput(iLine); + aDataSet->Update(); + int aNbPoints = aDataSet->GetNumberOfPoints(); + if(!aNbPoints) continue; + vtkPointData *aPointData = aDataSet->GetPointData(); + vtkDataArray *aScalars = aPointData->GetScalars(); + vtkCellDataToPointData *aFilter = NULL; + if(!aScalars) { + aFilter = vtkCellDataToPointData::New(); + aFilter->SetInput(aDataSet); + aFilter->PassCellDataOn(); + aDataSet = aFilter->GetOutput(); + aDataSet->Update(); + } + aPointData = aDataSet->GetPointData(); + aScalars = aPointData->GetScalars(); + if(!aScalars) continue; + if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "< XKeys; + for (;aXYMapIter != aXYMap.end() ; aXYMapIter++) XKeys.push_back(aXYMapIter->first); + XKeys.sort(); + if (XKeys.size() > 1) { + vtkFloatingPointType a_first_indx = XKeys.front(); + vtkFloatingPointType a_last_indx = XKeys.back(); + if (a_first_indx > a_last_indx){ + XKeys.reverse(); + vtkFloatingPointType tmp = a_first_indx; + a_first_indx = a_last_indx; + a_last_indx = tmp; + } + std::list::const_iterator aIter = XKeys.begin(); + for (int k=0;k= 0 and aDist<=1.0 + vtkFloatingPointType aTopBnd = aBoundPrjLn[2]; + if( !IsUseAbsoluteLength() ){ + aTopBnd = 1.0; + } + aNewXYMap[aTopBnd - *aIter] = aXYMap[*aIter]; + } + TXYMap::const_iterator aNewXYMapIter = aNewXYMap.begin(); + aXYMap.clear(); + for (;aNewXYMapIter != aNewXYMap.end();aNewXYMapIter++) { + aXYMap[aNewXYMapIter->first] = aNewXYMapIter->second; + } + } + } + } + //Resorting of theXYMap + TXYMapCont::iterator aXYMapContIter = aXYMapCont.begin(); + for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){ + TXYMap& aXYMap = aXYMapContIter->second, aNewXYMap; + if(aXYMap.size() > 2){ + // Try to smooth the values of the line by applying linear approximation + TXYMap::const_iterator aXYMapIter[2] = {aXYMap.begin(), ++aXYMap.begin()}; + aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second; + aXCont.insert(aXYMapIter[0]->first); + for(; aXYMapIter[1] != aXYMap.end(); aXYMapIter[0]++, aXYMapIter[1]++){ + vtkFloatingPointType aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0}; + aY[2] = (aY[0] + aY[1])/2.0; + vtkFloatingPointType aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0}; + aX[2] = (aX[0] + aX[1])/2.0; + aNewXYMap[aX[2]] = aY[2]; + aXCont.insert(aX[2]); + } + aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second; + aXCont.insert(aXYMapIter[0]->first); + aXYMap = aNewXYMap; + }else{ + TXYMap::const_iterator aXYMapIter = aXYMap.begin(); + for(; aXYMapIter != aXYMap.end(); aXYMapIter++) + aXCont.insert(aXYMapIter->first); + } + } + if(aXCont.size() == 0) + throw std::runtime_error("CutPlanes_i::BuildTableOfReal aXCont.size() == 0 !!!"); + QString aString; + int iEnd = aXCont.size(); + aTableOfReal->SetNbColumns(iEnd); + TXCont::const_iterator aXContIter = aXCont.begin(); + for(long i = 0; aXContIter != aXCont.end(); aXContIter++, i++){ + vtkFloatingPointType aDist = *aXContIter; + aTableOfReal->PutValue(aDist,1,i+1); + aString.sprintf("%d",i); + aTableOfReal->SetColumnTitle(i+1,(const char*)aString.toLatin1()); + if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal aDist = "<first; + long iLineId = aLineIdCont[iLine]; + const TXYMap& aXYMap = aXYMapCont[iLine]; + TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist); + // Can we find some value that belong to the line and have the same X coordinate? + if(aXYMapIter == aXYMap.end()) continue; + vtkFloatingPointType aVal = aXYMapIter->second; + aTableOfReal->PutValue(aVal,iLineId+2,i+1); + } + } + { + aTableOfReal->SetRowTitle(1,"X"); + aTableOfReal->SetRowUnit(1,"-"); + QString aUnitName = GetField()->myUnitNames[0].c_str(); + int aScalarMode = myCutLinesBasePL->GetScalarMode(); + if(aScalarMode != 0) + aUnitName = GetField()->myUnitNames[aScalarMode-1].c_str(); + aUnitName = aUnitName.simplified(); + if(aUnitName.isEmpty()) aUnitName = "-"; + TXYMapCont::const_iterator aXYMapContIter = aXYMapCont.begin(); + for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){ + long iLine = aXYMapContIter->first; + long iLineId = aLineIdCont[iLine]; + aString.sprintf("Y%d",iLine); + if(MYDEBUG) + MESSAGE("CutPlanes_i::BuildTableOfReal - SetRowTitle("<SetRowTitle(iLineId+2,(const char*)aString.toLatin1()); + aTableOfReal->SetRowUnit(iLineId+2,(const char*)aUnitName.toLatin1()); + } + } + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"< TCurvesInv; + TCurvesInv + GetCurvesInverted() + { + return myMapCurvesInverted; + } + + void + CopyCurvesInverted(const TCurvesInv& theCurves); + + VISU_CutLinesBasePL* + GetSpecificPL() const + { + return myCutLinesBasePL; + } + + protected: + //! Extends VISU_ColoredPrs3d_i::CreatePipeLine + virtual + void + CreatePipeLine(VISU_PipeLine* thePipeLine); + + VISU_CutLinesBasePL *myCutLinesBasePL; + TCurvesInv myMapCurvesInverted; + CORBA::Boolean myUseAbsLength; + + public: + //! Extends VISU_ColoredPrs3d_i::Create + virtual + Storable* + Create(const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber); + + //! Extends VISU_ColoredPrs3d_i::ToStream + virtual + void + ToStream(std::ostringstream& theStr); + + //! Extends VISU_ColoredPrs3d_i::Restore + virtual + Storable* + Restore(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap); + + virtual + void + SameAs(const Prs3d_i* theOrigin); + + void BuildTableOfReal(SALOMEDS::SObject_var theSObject); + }; +} + +#endif diff --git a/src/VISU_I/VISU_CutLines_i.cc b/src/VISU_I/VISU_CutLines_i.cc index 76dfaab6..a1dccb01 100644 --- a/src/VISU_I/VISU_CutLines_i.cc +++ b/src/VISU_I/VISU_CutLines_i.cc @@ -38,8 +38,6 @@ #include -static vtkFloatingPointType EPS_machine = 1.0E-7; - #ifdef _DEBUG_ static int MYDEBUG = 0; #else @@ -103,7 +101,7 @@ VISU::CutLines_i:: CutLines_i(EPublishInStudyMode thePublishInStudyMode) : ColoredPrs3d_i(thePublishInStudyMode), ScalarMap_i(thePublishInStudyMode), - myUseAbsLength( false ), + CutLinesBase_i(thePublishInStudyMode), myCutLinesPL(NULL) {} @@ -114,24 +112,6 @@ VISU::CutLines_i ::SameAs(const Prs3d_i* theOrigin) { TSuperClass::SameAs(theOrigin); - - if(const CutLines_i* aPrs3d = dynamic_cast(theOrigin)){ - CutLines_i* anOrigin = const_cast(aPrs3d); - myUseAbsLength = anOrigin->IsUseAbsoluteLength(); - CopyCurvesInverted(anOrigin->GetCurvesInverted()); - } -} - - -//--------------------------------------------------------------- -/*! Copy map to /a myMapCurvesInverted. - * \param theCurves - map - */ -void -VISU::CutLines_i -::CopyCurvesInverted(const TCurvesInv& theCurves) -{ - myMapCurvesInverted = theCurves; } @@ -143,9 +123,6 @@ VISU::CutLines_i const std::string& theFieldName, CORBA::Long theTimeStampNumber) { - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - SetUseAbsoluteLength( aResourceMgr->booleanValue( "VISU", "use_absolute_length", false ) ); - SetAllCurvesInverted( aResourceMgr->booleanValue( "VISU", "invert_all_curves", false ) ); return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber); } @@ -159,7 +136,6 @@ VISU::CutLines_i if(!TSuperClass::Restore(theSObject, theMap)) return NULL; - SetNbLines(VISU::Storable::FindValue(theMap,"myNbLines").toInt()); SetDisplacement(VISU::Storable::FindValue(theMap,"myDisplacement[0]").toDouble()); SetDisplacement2(VISU::Storable::FindValue(theMap,"myDisplacement[1]").toDouble()); SetOrientation(CutPlanes::Orientation(VISU::Storable::FindValue(theMap,"myBasePlane[0]").toInt()), @@ -168,7 +144,6 @@ VISU::CutLines_i SetOrientation2(CutPlanes::Orientation(VISU::Storable::FindValue(theMap,"myBasePlane[1]").toInt()), Storable::FindValue(theMap,"aRot[1][0]").toDouble(), Storable::FindValue(theMap,"aRot[1][1]").toDouble()); - SetUseAbsoluteLength(VISU::Storable::FindValue(theMap,"myUseAbsLength").toInt()); if (VISU::Storable::FindValue(theMap,"myBasePlaneCondition").toInt()) SetDefault(); @@ -181,20 +156,6 @@ VISU::CutLines_i if(aCondList[i].toInt() == 0) SetLinePosition(i,aPosList[i].toDouble()); - // Restoring the map - \a myMapCurvesInverted - QStringList aMapCurvesInverted = VISU::Storable::FindValue(theMap,"myMapCurvesInverted").split("|",QString::SkipEmptyParts ); - if (aMapCurvesInverted.count() == GetNbLines()){ - for(int i = 0, iEnd = GetNbLines(); i < iEnd ; i++){ - if(aMapCurvesInverted[i].toInt()) - SetCurveInverted(i,true); - else - SetCurveInverted(i,false); - } - } else { - for(int i = 0, iEnd = GetNbLines(); i < iEnd ; i++) - SetCurveInverted(i,false); - } - return this; } @@ -206,9 +167,6 @@ VISU::CutLines_i { TSuperClass::ToStream(theStr); - int aNbLines = GetNbLines(); - - Storable::DataToStream( theStr, "myNbLines", aNbLines ); Storable::DataToStream( theStr, "myDisplacement[0]", GetDisplacement() ); Storable::DataToStream( theStr, "myDisplacement[1]", GetDisplacement2() ); Storable::DataToStream( theStr, "myBasePlane[0]", int(GetOrientationType()) ); @@ -228,13 +186,6 @@ VISU::CutLines_i Storable::DataToStream( theStr, "myLinePosition", (const char*)aStrPos.toLatin1()); Storable::DataToStream( theStr, "myLineCondition", (const char*)aStrCon.toLatin1()); - Storable::DataToStream( theStr,"myUseAbsLength", IsUseAbsoluteLength()); - - // Storing the map - \a myMapCurvesInverted - QString aStrCurvesInverted; - for(int i = 0, iEnd = GetNbLines(); i < iEnd; i++) - aStrCurvesInverted.append(QString::number(IsCurveInverted(i)) + "|"); - Storable::DataToStream( theStr, "myMapCurvesInverted", (const char*)aStrCurvesInverted.toLatin1()); } @@ -489,107 +440,6 @@ VISU::CutLines_i return myCutLinesPL->IsPartDefault(thePlaneNumber); } -//--------------------------------------------------------------- -/*! Invert all curves of corresponding table - * see void VISU::CutLines_i::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert) - * \param theInvert - Invert all curves, if value is TRUE, else not. - */ -void -VISU::CutLines_i -::SetAllCurvesInverted(CORBA::Boolean theInvert) -{ - for(int i=0; i < GetNbLines(); i++) - SetCurveInverted(i, theInvert); -} - -//--------------------------------------------------------------- -/*! Checks the orientation of all curves - * \retval TRUE - if all curves are inverted, else FALSE - */ -CORBA::Boolean -VISU::CutLines_i -::IsAllCurvesInverted() -{ - for (int i=0; i - (GetSpecificPL(), &VISU_CutLinesPL::SetNbParts, theNb)); -} - -//--------------------------------------------------------------- -CORBA::Long -VISU::CutLines_i -::GetNbLines() -{ - return myCutLinesPL->GetNbParts(); -} - - //--------------------------------------------------------------- void VISU::CutLines_i @@ -627,199 +477,3 @@ VISU::CutLines_i } return NULL; } - -//--------------------------------------------------------------- -void -VISU::CutLines_i -::BuildTableOfReal(SALOMEDS::SObject_var theSObject) -{ - try{ - if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal"); - Update(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder(); - anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal"); - SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr); - - typedef set TXCont; - typedef map TXYMap; - typedef map TXYMapCont; - typedef map TLineIdCont; - - QString aTitle( GetScalarBarTitle().c_str() ); - aTitle = aTitle.simplified(); - aTableOfReal->SetTitle( aTitle.toLatin1().data() ); - - int iLineEnd = myCutLinesPL->GetAppendPolyData()->GetNumberOfInputConnections(0); - if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLineEnd = "<GetDirLn(); - const vtkFloatingPointType *aBasePnt = myCutLinesPL->GetBasePnt(); - const vtkFloatingPointType *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn(); - for(int iLine = 0, jLine = 0; iLine < iLineEnd; iLine++){ - vtkDataSet *aDataSet = myCutLinesPL->GetAppendPolyData()->GetInput(iLine); - aDataSet->Update(); - int aNbPoints = aDataSet->GetNumberOfPoints(); - if(!aNbPoints) continue; - vtkPointData *aPointData = aDataSet->GetPointData(); - vtkDataArray *aScalars = aPointData->GetScalars(); - vtkCellDataToPointData *aFilter = NULL; - if(!aScalars) { - aFilter = vtkCellDataToPointData::New(); - aFilter->SetInput(aDataSet); - aFilter->PassCellDataOn(); - aDataSet = aFilter->GetOutput(); - aDataSet->Update(); - } - aPointData = aDataSet->GetPointData(); - aScalars = aPointData->GetScalars(); - if(!aScalars) continue; - if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "< XKeys; - for (;aXYMapIter != aXYMap.end() ; aXYMapIter++) XKeys.push_back(aXYMapIter->first); - XKeys.sort(); - if (XKeys.size() > 1) { - vtkFloatingPointType a_first_indx = XKeys.front(); - vtkFloatingPointType a_last_indx = XKeys.back(); - if (a_first_indx > a_last_indx){ - XKeys.reverse(); - vtkFloatingPointType tmp = a_first_indx; - a_first_indx = a_last_indx; - a_last_indx = tmp; - } - std::list::const_iterator aIter = XKeys.begin(); - for (int k=0;k= 0 and aDist<=1.0 - vtkFloatingPointType aTopBnd = aBoundPrjLn[2]; - if( !IsUseAbsoluteLength() ){ - aTopBnd = 1.0; - } - aNewXYMap[aTopBnd - *aIter] = aXYMap[*aIter]; - } - TXYMap::const_iterator aNewXYMapIter = aNewXYMap.begin(); - aXYMap.clear(); - for (;aNewXYMapIter != aNewXYMap.end();aNewXYMapIter++) { - aXYMap[aNewXYMapIter->first] = aNewXYMapIter->second; - } - } - } - } - //Resorting of theXYMap - TXYMapCont::iterator aXYMapContIter = aXYMapCont.begin(); - for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){ - TXYMap& aXYMap = aXYMapContIter->second, aNewXYMap; - if(aXYMap.size() > 2){ - // Try to smooth the values of the line by applying linear approximation - TXYMap::const_iterator aXYMapIter[2] = {aXYMap.begin(), ++aXYMap.begin()}; - aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second; - aXCont.insert(aXYMapIter[0]->first); - for(; aXYMapIter[1] != aXYMap.end(); aXYMapIter[0]++, aXYMapIter[1]++){ - vtkFloatingPointType aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0}; - aY[2] = (aY[0] + aY[1])/2.0; - vtkFloatingPointType aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0}; - aX[2] = (aX[0] + aX[1])/2.0; - aNewXYMap[aX[2]] = aY[2]; - aXCont.insert(aX[2]); - } - aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second; - aXCont.insert(aXYMapIter[0]->first); - aXYMap = aNewXYMap; - }else{ - TXYMap::const_iterator aXYMapIter = aXYMap.begin(); - for(; aXYMapIter != aXYMap.end(); aXYMapIter++) - aXCont.insert(aXYMapIter->first); - } - } - if(aXCont.size() == 0) - throw std::runtime_error("CutPlanes_i::BuildTableOfReal aXCont.size() == 0 !!!"); - QString aString; - int iEnd = aXCont.size(); - aTableOfReal->SetNbColumns(iEnd); - TXCont::const_iterator aXContIter = aXCont.begin(); - for(long i = 0; aXContIter != aXCont.end(); aXContIter++, i++){ - vtkFloatingPointType aDist = *aXContIter; - aTableOfReal->PutValue(aDist,1,i+1); - aString.sprintf("%d",i); - aTableOfReal->SetColumnTitle(i+1,(const char*)aString.toLatin1()); - if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal aDist = "<first; - long iLineId = aLineIdCont[iLine]; - const TXYMap& aXYMap = aXYMapCont[iLine]; - TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist); - // Can we find some value that belong to the line and have the same X coordinate? - if(aXYMapIter == aXYMap.end()) continue; - vtkFloatingPointType aVal = aXYMapIter->second; - aTableOfReal->PutValue(aVal,iLineId+2,i+1); - } - } - { - aTableOfReal->SetRowTitle(1,"X"); - aTableOfReal->SetRowUnit(1,"-"); - QString aUnitName = GetField()->myUnitNames[0].c_str(); - int aScalarMode = myCutLinesPL->GetScalarMode(); - if(aScalarMode != 0) - aUnitName = GetField()->myUnitNames[aScalarMode-1].c_str(); - aUnitName = aUnitName.simplified(); - if(aUnitName.isEmpty()) aUnitName = "-"; - TXYMapCont::const_iterator aXYMapContIter = aXYMapCont.begin(); - for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){ - long iLine = aXYMapContIter->first; - long iLineId = aLineIdCont[iLine]; - aString.sprintf("Y%d",iLine); - if(MYDEBUG) - MESSAGE("CutPlanes_i::BuildTableOfReal - SetRowTitle("<SetRowTitle(iLineId+2,(const char*)aString.toLatin1()); - aTableOfReal->SetRowUnit(iLineId+2,(const char*)aUnitName.toLatin1()); - } - } - }catch(std::exception& exc){ - INFOS("Follow exception was occured :\n"< TCurvesInv; - TCurvesInv - GetCurvesInverted() - { - return myMapCurvesInverted; - } - - void - CopyCurvesInverted(const TCurvesInv& theCurves); - VISU_CutLinesPL* GetSpecificPL() const { @@ -209,8 +166,6 @@ namespace VISU GetIconName(); VISU_CutLinesPL *myCutLinesPL; - TCurvesInv myMapCurvesInverted; - CORBA::Boolean myUseAbsLength; public: //! Extends VISU_ColoredPrs3d_i::IsPossible @@ -251,8 +206,6 @@ namespace VISU VISU_Actor* CreateActor(); - void BuildTableOfReal(SALOMEDS::SObject_var theSObject); - static const std::string myComment; virtual diff --git a/src/VISU_I/VISU_CutSegment_i.cc b/src/VISU_I/VISU_CutSegment_i.cc new file mode 100644 index 00000000..4e01b20b --- /dev/null +++ b/src/VISU_I/VISU_CutSegment_i.cc @@ -0,0 +1,305 @@ +// Copyright (C) 2007-2008 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 : VISU_CutSegment_i.cc +// Author : Oleg UVAROV +// Module : VISU +// +#include "VISU_CutSegment_i.hh" +#include "VISU_Prs3dUtils.hh" +#include "VISU_Result_i.hh" + +#include "VISU_Actor.h" +#include "VISU_CutSegmentPL.hxx" +#include "VISU_Convertor.hxx" +#include "VISU_PipeLineUtils.hxx" + +#include "SUIT_ResourceMgr.h" +#include "SALOME_Event.h" + +#include + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +using namespace std; + +//--------------------------------------------------------------- +size_t +VISU::CutSegment_i +::IsPossible(Result_i* theResult, + const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber, + bool theIsMemoryCheck) +{ + return TSuperClass::IsPossible(theResult, + theMeshName, + theEntity, + theFieldName, + theTimeStampNumber, + theIsMemoryCheck); +} + +//--------------------------------------------------------------- +int VISU::CutSegment_i::myNbPresent = 0; + +//--------------------------------------------------------------- +QString +VISU::CutSegment_i::GenerateName() +{ + return VISU::GenerateName("CutSegment",myNbPresent++); +} + +//--------------------------------------------------------------- +const string VISU::CutSegment_i::myComment = "CUTSEGMENT"; + +//--------------------------------------------------------------- +const char* +VISU::CutSegment_i +::GetComment() const +{ + return myComment.c_str(); +} + +//---------------------------------------------------------------------------- +const char* +VISU::CutSegment_i +::GetIconName() +{ + if (!IsGroupsUsed()) + return "ICON_TREE_CUT_SEGMENT"; + else + return "ICON_TREE_CUT_SEGMENT_GROUPS"; +} + +//--------------------------------------------------------------- +VISU::CutSegment_i:: +CutSegment_i(EPublishInStudyMode thePublishInStudyMode) : + ColoredPrs3d_i(thePublishInStudyMode), + ScalarMap_i(thePublishInStudyMode), + CutLinesBase_i(thePublishInStudyMode), + myCutSegmentPL(NULL) +{} + + +//--------------------------------------------------------------- +void +VISU::CutSegment_i +::SameAs(const Prs3d_i* theOrigin) +{ + TSuperClass::SameAs(theOrigin); +} + + +//--------------------------------------------------------------- +VISU::Storable* +VISU::CutSegment_i +::Create(const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber) +{ + return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber); +} + + +//--------------------------------------------------------------- +VISU::Storable* +VISU::CutSegment_i +::Restore(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap) +{ + if(!TSuperClass::Restore(theSObject, theMap)) + return NULL; + + SetPoint1(VISU::Storable::FindValue(theMap,"myPoint1[0]").toDouble(), + VISU::Storable::FindValue(theMap,"myPoint1[1]").toDouble(), + VISU::Storable::FindValue(theMap,"myPoint1[2]").toDouble()); + SetPoint2(VISU::Storable::FindValue(theMap,"myPoint2[0]").toDouble(), + VISU::Storable::FindValue(theMap,"myPoint2[1]").toDouble(), + VISU::Storable::FindValue(theMap,"myPoint2[2]").toDouble()); + + return this; +} + + +//--------------------------------------------------------------- +void +VISU::CutSegment_i +::ToStream(std::ostringstream& theStr) +{ + TSuperClass::ToStream(theStr); + + double aCoord[3]; + GetPoint1( aCoord[0], aCoord[1], aCoord[2] ); + Storable::DataToStream( theStr, "myPoint1[0]", aCoord[0] ); + Storable::DataToStream( theStr, "myPoint1[1]", aCoord[1] ); + Storable::DataToStream( theStr, "myPoint1[2]", aCoord[2] ); + + GetPoint2( aCoord[0], aCoord[1], aCoord[2] ); + Storable::DataToStream( theStr, "myPoint2[0]", aCoord[0] ); + Storable::DataToStream( theStr, "myPoint2[1]", aCoord[1] ); + Storable::DataToStream( theStr, "myPoint2[2]", aCoord[2] ); +} + + +//--------------------------------------------------------------- +VISU::CutSegment_i +::~CutSegment_i() +{ + if(MYDEBUG) MESSAGE("CutSegment_i::~CutSegment_i()"); +} + + +//--------------------------------------------------------------- +struct TSetPoint1Event: public SALOME_Event +{ + VISU_CutSegmentPL* myCutSegmentPL; + CORBA::Double myX, myY, myZ; + TSetPoint1Event(VISU_CutSegmentPL* theCutSegment, + CORBA::Double theX, + CORBA::Double theY, + CORBA::Double theZ): + myCutSegmentPL(theCutSegment), + myX(theX), + myY(theY), + myZ(theZ) + {} + + virtual + void + Execute() + { + myCutSegmentPL->SetPoint1(myX, myY, myZ); + } +}; + +void +VISU::CutSegment_i +::SetPoint1(CORBA::Double theX, + CORBA::Double theY, + CORBA::Double theZ) +{ + VISU::TSetModified aModified(this); + + ProcessVoidEvent(new TSetPoint1Event(myCutSegmentPL, theX, theY, theZ)); +} + + +//--------------------------------------------------------------- +void +VISU::CutSegment_i +::GetPoint1(CORBA::Double& theX, + CORBA::Double& theY, + CORBA::Double& theZ) +{ + myCutSegmentPL->GetPoint1(theX, theY, theZ); +} + + +//--------------------------------------------------------------- +struct TSetPoint2Event: public SALOME_Event +{ + VISU_CutSegmentPL* myCutSegmentPL; + CORBA::Double myX, myY, myZ; + TSetPoint2Event(VISU_CutSegmentPL* theCutSegment, + CORBA::Double theX, + CORBA::Double theY, + CORBA::Double theZ): + myCutSegmentPL(theCutSegment), + myX(theX), + myY(theY), + myZ(theZ) + {} + + virtual + void + Execute() + { + myCutSegmentPL->SetPoint2(myX, myY, myZ); + } +}; + +void +VISU::CutSegment_i +::SetPoint2(CORBA::Double theX, + CORBA::Double theY, + CORBA::Double theZ) +{ + VISU::TSetModified aModified(this); + + ProcessVoidEvent(new TSetPoint2Event(myCutSegmentPL, theX, theY, theZ)); +} + + +//--------------------------------------------------------------- +void +VISU::CutSegment_i +::GetPoint2(CORBA::Double& theX, + CORBA::Double& theY, + CORBA::Double& theZ) +{ + myCutSegmentPL->GetPoint2(theX, theY, theZ); +} + + +//--------------------------------------------------------------- +void +VISU::CutSegment_i +::CreatePipeLine(VISU_PipeLine* thePipeLine) +{ + if(!thePipeLine){ + myCutSegmentPL = VISU_CutSegmentPL::New(); + }else + myCutSegmentPL = dynamic_cast(thePipeLine); + + TSuperClass::CreatePipeLine(myCutSegmentPL); +} + + +//---------------------------------------------------------------------------- +bool +VISU::CutSegment_i +::CheckIsPossible() +{ + return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true); +} + + +//--------------------------------------------------------------- +VISU_Actor* +VISU::CutSegment_i +::CreateActor() +{ + if(VISU_Actor* anActor = TSuperClass::CreateActor()){ + anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "cut_segment_represent", 2); + anActor->SetRepresentation(aDispMode); + return anActor; + } + return NULL; +} diff --git a/src/VISU_I/VISU_CutSegment_i.hh b/src/VISU_I/VISU_CutSegment_i.hh new file mode 100644 index 00000000..6f7abdc2 --- /dev/null +++ b/src/VISU_I/VISU_CutSegment_i.hh @@ -0,0 +1,159 @@ +// Copyright (C) 2007-2008 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 : VISU_CutSegment_i.hh +// Author : Oleg UVAROV +// Module : VISU +// +#ifndef VISU_CutSegment_i_HeaderFile +#define VISU_CutSegment_i_HeaderFile + +#include "VISU_I.hxx" +#include "VISU_CutLinesBase_i.hh" + +class VISU_CutSegmentPL; + +namespace VISU +{ + //---------------------------------------------------------------------------- + class VISU_I_EXPORT CutSegment_i : public virtual POA_VISU::CutSegment, + public virtual CutLinesBase_i + { + static int myNbPresent; + CutSegment_i(const CutSegment_i&); + + public: + //---------------------------------------------------------------------------- + typedef CutLinesBase_i TSuperClass; + typedef VISU::CutSegment TInterface; + + explicit + CutSegment_i(EPublishInStudyMode thePublishInStudyModep); + + virtual + ~CutSegment_i(); + + virtual + VISU::VISUType + GetType() + { + return VISU::TCUTSEGMENT; + } + + virtual + void + SetPoint1(CORBA::Double theX, + CORBA::Double theY, + CORBA::Double theZ ); + + virtual + void + GetPoint1(CORBA::Double& theX, + CORBA::Double& theY, + CORBA::Double& theZ ); + + virtual + void + SetPoint2(CORBA::Double theX, + CORBA::Double theY, + CORBA::Double theZ ); + + virtual + void + GetPoint2(CORBA::Double& theX, + CORBA::Double& theY, + CORBA::Double& theZ ); + + VISU_CutSegmentPL* + GetSpecificPL() const + { + return myCutSegmentPL; + } + + protected: + //! Extends VISU_ColoredPrs3d_i::CreatePipeLine + virtual + void + CreatePipeLine(VISU_PipeLine* thePipeLine); + + //! Extends VISU_ColoredPrs3d_i::CheckIsPossible + virtual + bool + CheckIsPossible(); + + virtual + const char* + GetIconName(); + + VISU_CutSegmentPL *myCutSegmentPL; + + public: + //! Extends VISU_ColoredPrs3d_i::IsPossible + static + size_t + IsPossible(Result_i* theResult, + const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber, + bool theIsMemoryCheck); + + //! Extends VISU_ColoredPrs3d_i::Create + virtual + Storable* + Create(const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber); + + //! Extends VISU_ColoredPrs3d_i::ToStream + virtual + void + ToStream(std::ostringstream& theStr); + + //! Extends VISU_ColoredPrs3d_i::Restore + virtual + Storable* + Restore(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap); + + virtual + void + SameAs(const Prs3d_i* theOrigin); + + //! Extends VISU_ColoredPrs3d_i::CreateActor + virtual + VISU_Actor* + CreateActor(); + + static const std::string myComment; + + virtual + const char* + GetComment() const; + + virtual + QString + GenerateName(); + }; +} + +#endif diff --git a/src/VISU_I/VISU_DumpPython.cc b/src/VISU_I/VISU_DumpPython.cc index 14e0e6f3..4d008943 100644 --- a/src/VISU_I/VISU_DumpPython.cc +++ b/src/VISU_I/VISU_DumpPython.cc @@ -35,6 +35,7 @@ #include "VISU_DeformedShape_i.hh" #include "VISU_CutPlanes_i.hh" #include "VISU_CutLines_i.hh" +#include "VISU_CutSegment_i.hh" #include "VISU_Vectors_i.hh" #include "VISU_StreamLines_i.hh" #include "VISU_Plot3D_i.hh" @@ -782,6 +783,31 @@ namespace VISU } + //--------------------------------------------------------------------------- + std::string + CutSegmentToPython(SALOMEDS::SObject_ptr theSObject, + VISU::CutSegment_i* theServant, + std::ostream& theStr, + const std::string& theName, + TColoredPrs3dFactory& thePrsFactory, + std::string thePrefix) + { + thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix); + theStr<GetPoint1(x1, y1, z1); + theServant->GetPoint2(x2, y2, z2); + theStr<IsUseAbsoluteLength(); + theStr<(GetServant(anObj).in())){ + TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutSegmentOnField", theArgumentName); + thePrefix = CutSegmentToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix); + + theArgumentName = aName; + DumpChildrenToPython(theStudy, + theIsPublished, + theIsValidScript, + theSObject, + theStr, + theName2EntryMap, + theEntry2NameMap, + theArgumentName, + thePrefix); + + theStr<(GetServant(anObj).in())) { TCreateFromResult aPrsFactory(theSObject, aServant, aName, "Plot3DOnField", theArgumentName); @@ -1916,6 +1961,11 @@ namespace VISU CutLinesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3); break; } + case VISU::TCUTSEGMENT: + if(CutSegment_i* aServant = dynamic_cast(aDevice)){ + CutSegmentToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3); + break; + } case VISU::TPLOT3D: if(Plot3D_i* aServant = dynamic_cast(aDevice)){ Plot3DToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3); diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 9862db83..0dd7a7b5 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -210,6 +210,7 @@ namespace VISU Storable::RegistryStorableEngine(DeformedShape_i::myComment.c_str(),&(StorableEngine)); Storable::RegistryStorableEngine(CutPlanes_i::myComment.c_str(),&(StorableEngine)); Storable::RegistryStorableEngine(CutLines_i::myComment.c_str(),&(StorableEngine)); + Storable::RegistryStorableEngine(CutSegment_i::myComment.c_str(),&(StorableEngine)); Storable::RegistryStorableEngine(IsoSurfaces_i::myComment.c_str(),&(StorableEngine)); Storable::RegistryStorableEngine(StreamLines_i::myComment.c_str(),&(StorableEngine)); Storable::RegistryStorableEngine(Plot3D_i::myComment.c_str(),&(StorableEngine)); @@ -1109,6 +1110,22 @@ namespace VISU theIteration)._retn(); } + //--------------------------------------------------------------- + CutSegment_ptr + VISU_Gen_i + ::CutSegmentOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) + { + return Prs3dOnField(theResult, + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); + } + //--------------------------------------------------------------- struct CreateTableEvent: public SALOME_Event { diff --git a/src/VISU_I/VISU_Gen_i.hh b/src/VISU_I/VISU_Gen_i.hh index baee2831..26a42a5b 100644 --- a/src/VISU_I/VISU_Gen_i.hh +++ b/src/VISU_I/VISU_Gen_i.hh @@ -231,6 +231,14 @@ namespace VISU const char* theFieldName, CORBA::Long theIteration); + virtual + CutSegment_ptr + CutSegmentOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration); + virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult, diff --git a/src/VISU_I/VISU_I.cxx b/src/VISU_I/VISU_I.cxx index 825aec9f..49d32432 100644 --- a/src/VISU_I/VISU_I.cxx +++ b/src/VISU_I/VISU_I.cxx @@ -39,6 +39,7 @@ #include "VISU_Plot3D_i.hh" #include "VISU_CutPlanes_i.hh" #include "VISU_CutLines_i.hh" +#include "VISU_CutSegment_i.hh" #include "VISU_Vectors_i.hh" #include "VISU_StreamLines_i.hh" #include "VISU_GaussPoints_i.hh" diff --git a/src/VISU_I/VISU_PointMap3d_i.cc b/src/VISU_I/VISU_PointMap3d_i.cc index f03b72ca..aebf5c9c 100644 --- a/src/VISU_I/VISU_PointMap3d_i.cc +++ b/src/VISU_I/VISU_PointMap3d_i.cc @@ -26,7 +26,7 @@ // #include "VISU_PointMap3d_i.hh" -#include "VISU_CutLines_i.hh" +#include "VISU_CutLinesBase_i.hh" #include "VISU_Result_i.hh" #include "VISU_ViewManager_i.hh" #include "VISU_ScalarBarActor.hxx" @@ -174,12 +174,12 @@ VISU::Storable* VISU::PointMap3d_i::Create() if ( GetName() == "" ) { if ( !mySObj->_is_nil() ) { - CutLines_i* pCutLines = NULL; + CutLinesBase_i* pCutLines = NULL; CORBA::Object_var anObj = SObjectToObject(mySObj); if(!CORBA::is_nil(anObj)){ - VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj); + VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj); if(!aCutLines->_is_nil()) - pCutLines = dynamic_cast(GetServant(aCutLines).in()); + pCutLines = dynamic_cast(GetServant(aCutLines).in()); } if (!pCutLines) if (mySObj->GetName()) SetName(mySObj->GetName(), false); @@ -487,12 +487,12 @@ VISU::Storable* VISU::PointMap3d_i::Build( int theRestoring ) SALOMEDS::SObject_var SO = mySObj; if ( !SO->_is_nil() ) { - CutLines_i* pCutLines = NULL; + CutLinesBase_i* pCutLines = NULL; CORBA::Object_var anObj = SObjectToObject(SO); if(!CORBA::is_nil(anObj)){ - VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj); + VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj); if(!aCutLines->_is_nil()) - pCutLines = dynamic_cast(GetServant(aCutLines).in()); + pCutLines = dynamic_cast(GetServant(aCutLines).in()); } SALOMEDS::Study_var aStudy = GetStudyDocument(); SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder(); diff --git a/src/VISU_I/VISU_Table_i.cc b/src/VISU_I/VISU_Table_i.cc index 2516a24d..cf044b28 100644 --- a/src/VISU_I/VISU_Table_i.cc +++ b/src/VISU_I/VISU_Table_i.cc @@ -26,7 +26,7 @@ // #include "VISU_Table_i.hh" -#include "VISU_CutLines_i.hh" +#include "VISU_CutLinesBase_i.hh" #include "VISU_Result_i.hh" #include "VISU_ViewManager_i.hh" @@ -183,12 +183,12 @@ VISU::Storable* VISU::Table_i::Create() // mpv (PAL 5357): if name attribute already exist at this label, use it as name of table if ( GetName() == "" ) if ( !mySObj->_is_nil() ) { - CutLines_i* pCutLines = NULL; + CutLinesBase_i* pCutLines = NULL; CORBA::Object_var anObj = SObjectToObject(mySObj); if(!CORBA::is_nil(anObj)){ - VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj); + VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj); if(!aCutLines->_is_nil()) - pCutLines = dynamic_cast(GetServant(aCutLines).in()); + pCutLines = dynamic_cast(GetServant(aCutLines).in()); } if (!pCutLines) if (mySObj->GetName()) SetName(mySObj->GetName(), false); @@ -209,12 +209,12 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring ) SALOMEDS::SObject_var SO = mySObj; if ( !SO->_is_nil() ) { - CutLines_i* pCutLines = NULL; + CutLinesBase_i* pCutLines = NULL; CORBA::Object_var anObj = SObjectToObject(SO); if(!CORBA::is_nil(anObj)){ - VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj); + VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj); if(!aCutLines->_is_nil()) - pCutLines = dynamic_cast(GetServant(aCutLines).in()); + pCutLines = dynamic_cast(GetServant(aCutLines).in()); } SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder(); SALOMEDS::GenericAttribute_var anAttr; diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index 3437df86..20fb195c 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -42,6 +42,7 @@ #include "VISU_CutPlanes_i.hh" #include "VISU_Plot3D_i.hh" #include "VISU_CutLines_i.hh" +#include "VISU_CutSegment_i.hh" #include "VISU_Vectors_i.hh" #include "VISU_StreamLines_i.hh" #include "VISU_GaussPoints_i.hh" @@ -567,6 +568,15 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) myTimeMaxVal, aSequence); break; + case VISU::TCUTSEGMENT: // Cut Segment + GeneratePresentations(myStudy, + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); + break; case VISU::TPLOT3D: // Plot3d GeneratePresentations(myStudy, aData, @@ -1688,6 +1698,9 @@ std::string GetPresentationComment (VISU::VISUType thePrsType) case VISU::TCUTLINES: aPrsCmt = VISU::CutLines_i::myComment; break; + case VISU::TCUTSEGMENT: + aPrsCmt = VISU::CutSegment_i::myComment; + break; case VISU::TPLOT3D: aPrsCmt = VISU::Plot3D_i::myComment; break; @@ -1910,6 +1923,8 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField) aData.myPrsType = VISU::TCUTPLANES; else if (strName == VISU::CutLines_i::myComment.c_str()) aData.myPrsType = VISU::TCUTLINES; + else if (strName == VISU::CutSegment_i::myComment.c_str()) + aData.myPrsType = VISU::TCUTSEGMENT; else if (strName == VISU::Plot3D_i::myComment.c_str()) aData.myPrsType = VISU::TPLOT3D; else if (strName == VISU::DeformedShape_i::myComment.c_str()) diff --git a/src/VISU_SWIG/batchmode_visu_view3d.py b/src/VISU_SWIG/batchmode_visu_view3d.py index 3bab3fb3..77dbab75 100644 --- a/src/VISU_SWIG/batchmode_visu_view3d.py +++ b/src/VISU_SWIG/batchmode_visu_view3d.py @@ -248,6 +248,49 @@ myView.Display(aContainer) +myView = myViewManager.Create3DView(); +myView.SetTitle("The viewer for CutSegment") +print "myViewManager.Create3DView()" +time.sleep(aDelay) + +print "myView.SetBackground(...)" +aColor = SALOMEDS.Color(0.0,0.7,0.3) +myView.SetBackground(aColor); +time.sleep(aDelay) + +aCutSegment = myVisu.CutSegmentOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId) +aCutSegment.SetPoint1(0.0,0.0,0.0) +aCutSegment.SetPoint2(0.4,0.05,1.0) + +myView.DisplayOnly(aCutSegment); +myView.FitAll(); +print "myView.DisplayOnly(aCutSegment)" +time.sleep(aDelay) + +aSObj = myStudy.FindObjectIOR(aCutSegment.GetID()) +aTable = myVisu.CreateTable( aSObj.GetID() ) +print "myVisu.CreateTable(...)" + +aTableView = myViewManager.CreateTableView(aTable) +aTableView.SetTitle('Changed Title') + +aContainer = myVisu.CreateContainer() +print "myVisu.CreateContainer(...)" + +aCurve = myVisu.CreateCurve( aTable, 1, 2 ) +print aCurve +aContainer.AddCurve(aCurve) + + +myView = myViewManager.CreateXYPlot(); +myView.SetTitle("The viewer for Curve from CutSegment") +print "myViewManager.CreateXYPlot()" +time.sleep(aDelay) + +myView.Display(aContainer) + + + myView = myViewManager.Create3DView(); myView.SetTitle("The viewer for Animation") print "myViewManager.Create3DView()" diff --git a/src/VISU_SWIG/visu.py b/src/VISU_SWIG/visu.py index 42fead87..14c06e43 100644 --- a/src/VISU_SWIG/visu.py +++ b/src/VISU_SWIG/visu.py @@ -559,6 +559,22 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi else : aVISUObjList.append(aPrsObj) + if HasValue(thePrsTypeList,VISU.TCUTSEGMENT) : + print " Creating CutSegmentOnField", + aPrsObj = theVisu.CutSegmentOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId) + if aPrsObj is None : print "Error" + else : + print ",OK" + theView.DisplayOnly(aPrsObj) + theView.FitAll() + aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TCUTSEGMENT." + thePictureExt + aPictureName = re.sub("\s+","_", aPictureName) + theView.SavePicture(aPictureName) + if theIsAutoDelete : + aPrsObj.RemoveFromStudy() + else : + aVISUObjList.append(aPrsObj) + if HasValue(thePrsTypeList,VISU.TPLOT3D) : print " Creating Plot3DOnField", aPrsObj = theVisu.Plot3DOnField(theResult,aMeshName,anEntity, @@ -900,6 +916,36 @@ def dump_cutlines_parameters(theObject): print "GetRotateY() = ", str(theObject.GetRotateY()) print "GetRotateY2() = ", str(theObject.GetRotateY2()) +# ---------------------- +# CUT SEGMENT +# ---------------------- +def try_cutsegment_parameters(thePattern): + + if thePattern is None : return None + import copy + import random + + anObj = try_scalarmap_parameters(thePattern) + + anObj.SetPoint1(random.randint(-100,100)*random.random(), + random.randint(-100,100)*random.random(), + random.randint(-100,100)*random.random()) + anObj.SetPoint2(random.randint(-100,100)*random.random(), + random.randint(-100,100)*random.random(), + random.randint(-100,100)*random.random()) + + return anObj + +def dump_cutsegment_parameters(theObject): + dump_scalarmap_parameters(theObject) + + x1 = y1 = z1 = 0 + x2 = y2 = z2 = 0 + theObject.GetPoint1(x1, y1, z1) + theObject.GetPoint1(x2, y2, z2) + print "GetPoint1() = " + str(x1) + ", " + str(y1) + ", " + str(z1) + print "GetPoint2() = " + str(x2) + ", " + str(y2) + ", " + str(z2) + # ---------------------- # STREAM LINES # ---------------------- diff --git a/src/VISU_SWIG/visu_cache.py b/src/VISU_SWIG/visu_cache.py index 432a14fa..6bb81639 100644 --- a/src/VISU_SWIG/visu_cache.py +++ b/src/VISU_SWIG/visu_cache.py @@ -72,6 +72,7 @@ PRS3D_TYPE_LIST.append(VISU.TSCALARMAP) PRS3D_TYPE_LIST.append(VISU.TISOSURFACES) PRS3D_TYPE_LIST.append(VISU.TCUTPLANES) PRS3D_TYPE_LIST.append(VISU.TCUTLINES) +PRS3D_TYPE_LIST.append(VISU.TCUTSEGMENT) PRS3D_TYPE_LIST.append(VISU.TPLOT3D) PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPE) PRS3D_TYPE_LIST.append(VISU.TVECTORS) diff --git a/src/VISU_SWIG/visu_view3d.py b/src/VISU_SWIG/visu_view3d.py index fa68e6f8..bc95a9e6 100644 --- a/src/VISU_SWIG/visu_view3d.py +++ b/src/VISU_SWIG/visu_view3d.py @@ -255,6 +255,49 @@ myView.Display(aContainer) +myView = myViewManager.Create3DView(); +myView.SetTitle("The viewer for CutSegment") +print "myViewManager.Create3DView()" +time.sleep(aDelay) + +print "myView.SetBackground(...)" +aColor = SALOMEDS.Color(0.0,0.7,0.3) +myView.SetBackground(aColor); +time.sleep(aDelay) + +aCutSegment = myVisu.CutSegmentOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId) +aCutSegment.SetPoint1(0.0,0.0,0.0) +aCutSegment.SetPoint2(0.4,0.05,1.0) + +myView.DisplayOnly(aCutSegment); +myView.FitAll(); +print "myView.DisplayOnly(aCutSegment)" +time.sleep(aDelay) + +aSObj = myStudy.FindObjectIOR(aCutSegment.GetID()) +aTable = myVisu.CreateTable( aSObj.GetID() ) +print "myVisu.CreateTable(...)" + +aTableView = myViewManager.CreateTableView(aTable) +aTableView.SetTitle('Changed Title') + +aContainer = myVisu.CreateContainer() +print "myVisu.CreateContainer(...)" + +aCurve = myVisu.CreateCurve( aTable, 1, 2 ) +print aCurve +aContainer.AddCurve(aCurve) + + +myView = myViewManager.CreateXYPlot(); +myView.SetTitle("The viewer for Curve from CutSegment") +print "myViewManager.CreateXYPlot()" +time.sleep(aDelay) + +myView.Display(aContainer) + + + myView = myViewManager.Create3DView(); myView.SetTitle("The viewer for Animation") print "myViewManager.Create3DView()" -- 2.39.2