From: admin Date: Mon, 12 Sep 2005 06:03:16 +0000 (+0000) Subject: This commit was generated by cvs2git to create tag X-Git-Tag: BR-D5-38-2003_D2005-12-09 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cbb41c3f8478b33dfeedc613a3440046f6bcdd7d;p=modules%2Fvisu.git This commit was generated by cvs2git to create tag 'BR-D5-38-2003_D2005-12-09'. Sprout from BR-D5-38-2003 2005-09-12 06:03:15 UTC apo 'To introduce segmentation functionality' Delete: LICENCE adm_local/unix/config_files/check_GUI.m4 adm_local/unix/config_files/check_Med.m4 adm_local/unix/make_commence.in adm_local/unix/make_omniorb.in configure.in.base doc/Makefile.in doc/salome/VISU_index.html doc/salome/gui/Makefile.in doc/salome/gui/VISU/animation.gif doc/salome/gui/VISU/createfieldprsnt.gif doc/salome/gui/VISU/createpresent.gif doc/salome/gui/VISU/createtable.gif doc/salome/gui/VISU/i_blue.jpg doc/salome/gui/VISU/image15.gif doc/salome/gui/VISU/image16.gif doc/salome/gui/VISU/image17.gif doc/salome/gui/VISU/image19.jpg doc/salome/gui/VISU/image20.jpg doc/salome/gui/VISU/image21.jpg doc/salome/gui/VISU/importmed.gif doc/salome/gui/VISU/launchvisu.gif doc/salome/gui/VISU/more.jpg doc/salome/gui/VISU/note1.gif doc/salome/gui/VISU/pics/animatdef.jpg doc/salome/gui/VISU/pics/animation.jpg doc/salome/gui/VISU/pics/animationparam.jpg doc/salome/gui/VISU/pics/begining.jpg doc/salome/gui/VISU/pics/cellsel.jpg doc/salome/gui/VISU/pics/cellselection.jpg doc/salome/gui/VISU/pics/cutlinesicn.jpg doc/salome/gui/VISU/pics/cutlinesicon.jpg doc/salome/gui/VISU/pics/cutlinesprsnt.jpg doc/salome/gui/VISU/pics/cutplpresent.jpg doc/salome/gui/VISU/pics/defshapeicon.jpg doc/salome/gui/VISU/pics/display.jpg doc/salome/gui/VISU/pics/display1.jpg doc/salome/gui/VISU/pics/end.jpg doc/salome/gui/VISU/pics/iso.jpg doc/salome/gui/VISU/pics/isosurf.jpg doc/salome/gui/VISU/pics/next.jpg doc/salome/gui/VISU/pics/points.jpg doc/salome/gui/VISU/pics/pointselection.jpg doc/salome/gui/VISU/pics/previous.jpg doc/salome/gui/VISU/pics/run.jpg doc/salome/gui/VISU/pics/scalarmapicon.jpg doc/salome/gui/VISU/pics/scalingicon.jpg doc/salome/gui/VISU/pics/selection1.jpg doc/salome/gui/VISU/pics/selmode.jpg doc/salome/gui/VISU/pics/shrink.jpg doc/salome/gui/VISU/pics/speed.jpg doc/salome/gui/VISU/pics/streamlinesicon.jpg doc/salome/gui/VISU/pics/streamlinesprsnt.jpg doc/salome/gui/VISU/pics/surface.jpg doc/salome/gui/VISU/pics/vecticon.jpg doc/salome/gui/VISU/pics/vectorsprsnt.jpg doc/salome/gui/VISU/pics/visuicon.jpg doc/salome/gui/VISU/pics/wireframe.jpg doc/salome/gui/VISU/ss_btn_related_topics.gif doc/salome/gui/VISU/texture_horiz_ltbluebubbles.jpg doc/salome/gui/VISU/tip1.gif doc/salome/gui/VISU/whestart.ico doc/salome/gui/VISU/whgdata/whexpbar.gif doc/salome/gui/VISU/whrstart.ico doc/salome/gui/VISU/whstart.ico doc/salome/gui/VISU/wht_fts_h.gif doc/salome/gui/VISU/wht_fts_n.gif doc/salome/gui/VISU/wht_glo_h.gif doc/salome/gui/VISU/wht_glo_n.gif doc/salome/gui/VISU/wht_go.gif doc/salome/gui/VISU/wht_hide.gif doc/salome/gui/VISU/wht_idx_h.gif doc/salome/gui/VISU/wht_idx_n.gif doc/salome/gui/VISU/wht_logo1.gif doc/salome/gui/VISU/wht_logo2.gif doc/salome/gui/VISU/wht_next.gif doc/salome/gui/VISU/wht_next_g.gif doc/salome/gui/VISU/wht_prev.gif doc/salome/gui/VISU/wht_prev_g.gif doc/salome/gui/VISU/wht_spac.gif doc/salome/gui/VISU/wht_sync.gif doc/salome/gui/VISU/wht_tab0.gif doc/salome/gui/VISU/wht_tab1.gif doc/salome/gui/VISU/wht_tab2.gif doc/salome/gui/VISU/wht_tab3.gif doc/salome/gui/VISU/wht_tab4.gif doc/salome/gui/VISU/wht_tab5.gif doc/salome/gui/VISU/wht_tab6.gif doc/salome/gui/VISU/wht_tab7.gif doc/salome/gui/VISU/wht_tab8.gif doc/salome/gui/VISU/wht_toc1.gif doc/salome/gui/VISU/wht_toc2.gif doc/salome/gui/VISU/wht_toc3.gif doc/salome/gui/VISU/wht_toc4.gif doc/salome/gui/VISU/wht_toc_h.gif doc/salome/gui/VISU/wht_toc_n.gif doc/salome/gui/VISU/wht_ws.gif doc/salome/gui/VISU/wht_ws_g.gif doc/salome/tui/Makefile.in doc/salome/tui/VISU/HTML/VISU_Gen.html doc/salome/tui/VISU/doxyfile doc/salome/tui/VISU/sources/Application-About.png doc/salome/tui/VISU/sources/Application-About1.jpg doc/salome/tui/VISU/sources/application.gif doc/salome/tui/VISU/sources/application.jpg doc/salome/tui/VISU/sources/bg_salome.gif doc/salome/tui/VISU/sources/logocorp.gif doc/salome/tui/VISU/sources/myheader.html doc/salome/tui/VISU/sources/occ.gif doc/salome/tui/VISU/sources/static/DataStruct.gif doc/salome/tui/VISU/sources/static/PrsObj.gif doc/salome/tui/VISU/sources/static/View.gif doc/salome/tui/VISU/sources/static/doxygen.css doc/salome/tui/VISU/sources/static/examples_VISU.html doc/salome/tui/VISU/sources/static/overview_VISU.html doc/salome/tui/VISU/sources/static/page2.html doc/salome/tui/VISU/sources/static/treeview.js idl/Makefile.in resources/ModuleVisu.png resources/VISU.config resources/VISU_en.xml resources/VISU_fr.xml resources/Visu_anim.png resources/Visu_cutlines.png resources/Visu_cutplane.png resources/Visu_deformed.png resources/Visu_deformed_anim.png resources/Visu_eraseall.png resources/Visu_graduated_axes.png resources/Visu_isosurfaces.png resources/Visu_plot2d.png resources/Visu_plot3d.png resources/Visu_points.png resources/Visu_sameas.png resources/Visu_scalars.png resources/Visu_scalars_anim.png resources/Visu_scaling.png resources/Visu_selectall.png resources/Visu_selectionactor.png resources/Visu_selectioncell.png resources/Visu_selectionedge.png resources/Visu_selectionpoint.png resources/Visu_selectonly.png resources/Visu_streamlines.png resources/Visu_surface.png resources/Visu_tree_visu.png resources/Visu_vectors.png resources/Visu_wireframe.png src/ENGINE/Makefile.in src/GUITOOLS/Makefile.in src/GUITOOLS/VisuGUI_TableDlg.cxx src/GUITOOLS/VisuGUI_TableDlg.h src/OBJECT/VISU_MeshAct.cxx src/OBJECT/VISU_MeshAct.h src/OBJECT/VISU_ScalarMapAct.cxx src/OBJECT/VISU_VectorsAct.cxx src/OBJECT/VISU_VectorsAct.h src/PIPELINE/SALOME_ExtractGeometry.cxx src/PIPELINE/SALOME_ExtractGeometry.h src/PIPELINE/VISU_CutLinesPL.cxx src/PIPELINE/VISU_CutLinesPL.hxx src/PIPELINE/VISU_CutPlanesPL.cxx src/PIPELINE/VISU_CutPlanesPL.hxx src/PIPELINE/VISU_DeformedShapePL.cxx src/PIPELINE/VISU_DeformedShapePL.hxx src/PIPELINE/VISU_Extractor.cxx src/PIPELINE/VISU_Extractor.hxx src/PIPELINE/VISU_FieldTransform.cxx src/PIPELINE/VISU_FieldTransform.hxx src/PIPELINE/VISU_IsoSurfacesPL.cxx src/PIPELINE/VISU_IsoSurfacesPL.hxx src/PIPELINE/VISU_LookupTable.cxx src/PIPELINE/VISU_LookupTable.hxx src/PIPELINE/VISU_MeshPL.cxx src/PIPELINE/VISU_MeshPL.hxx src/PIPELINE/VISU_PipeLineUtils.cxx src/PIPELINE/VISU_PipeLineUtils.hxx src/PIPELINE/VISU_Plot3DPL.cxx src/PIPELINE/VISU_Plot3DPL.hxx src/PIPELINE/VISU_ScalarBarActor.cxx src/PIPELINE/VISU_ScalarBarActor.hxx src/PIPELINE/VISU_StreamLinesPL.cxx src/PIPELINE/VISU_StreamLinesPL.hxx src/PIPELINE/VISU_UsedPointsFilter.cxx src/PIPELINE/VISU_UsedPointsFilter.hxx src/PIPELINE/VISU_VectorsPL.cxx src/PIPELINE/VISU_VectorsPL.hxx src/VISUGUI/VISU_icons.po src/VISUGUI/VISU_images.po src/VISUGUI/VisuGUI.h src/VISUGUI/VisuGUI_CubeAxesDlg.cxx src/VISUGUI/VisuGUI_CubeAxesDlg.h src/VISUGUI/VisuGUI_CursorDlg.cxx src/VISUGUI/VisuGUI_CursorDlg.h src/VISUGUI/VisuGUI_CutPlanesDlg.h src/VISUGUI/VisuGUI_EditContainerDlg.cxx src/VISUGUI/VisuGUI_EditContainerDlg.h src/VISUGUI/VisuGUI_FileDlg.cxx src/VISUGUI/VisuGUI_FileDlg.h src/VISUGUI/VisuGUI_FontWg.cxx src/VISUGUI/VisuGUI_FontWg.h src/VISUGUI/VisuGUI_NameDlg.cxx src/VISUGUI/VisuGUI_NameDlg.h src/VISUGUI/VisuGUI_NonIsometricDlg.h src/VISUGUI/VisuGUI_OffsetDlg.cxx src/VISUGUI/VisuGUI_Plot3DDlg.cxx src/VISUGUI/VisuGUI_Plot3DDlg.h src/VISUGUI/VisuGUI_PopupTools.h src/VISUGUI/VisuGUI_ScalarBarDlg.cxx src/VISUGUI/VisuGUI_ScalarBarDlg.h src/VISUGUI/VisuGUI_SweepPrefDlg.cxx src/VISUGUI/VisuGUI_SweepPrefDlg.h src/VISUGUI/VisuGUI_TimeAnimation.cxx src/VISUGUI/VisuGUI_TimeAnimation.h src/VISU_I/VISUConfig.hh src/VISU_I/VISU_Mesh_i.hh src/VISU_I/VISU_PrsObject_i.cc src/VISU_I/VISU_PrsObject_i.hh src/VISU_I/VISU_Result_i.hh src/VISU_I/VISU_Table_i.cc src/VISU_I/VISU_Table_i.hh src/VISU_I/VISU_TimeAnimation.h src/VISU_I/VISU_ViewManager_i.hh src/VISU_SWIG/VISU_Gen_s.hh src/VISU_SWIG/VISU_shared_modules.py src/VISU_SWIG/batch_test_events.py src/VISU_SWIG/batchmode_visu.py src/VISU_SWIG/batchmode_visu_table.py src/VISU_SWIG/batchmode_visu_view.py src/VISU_SWIG/libVISU_Swig.i src/VISU_SWIG/test_events.py src/VISU_SWIG/visu_big_table.py src/VISU_SWIG/visu_gui.py src/VISU_SWIG/visu_split_views.py src/VISU_SWIG/visu_table.py src/VISU_SWIG/visu_view.py --- diff --git a/LICENCE b/LICENCE deleted file mode 100644 index b1e3f5a2..00000000 --- a/LICENCE +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/adm_local/unix/config_files/check_GUI.m4 b/adm_local/unix/config_files/check_GUI.m4 deleted file mode 100755 index d2c8eb8a..00000000 --- a/adm_local/unix/config_files/check_GUI.m4 +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -#------------------------------------------------------------ -# Check availability of Salome binary distribution -# -# Author : Marc Tajchman (CEA, 2002) -#------------------------------------------------------------ - -AC_DEFUN([CHECK_SALOME_GUI],[ - -AC_CHECKING(for SalomeGUI) - -SalomeGUI_ok=yes - -AC_ARG_WITH(gui, - --with-salome_gui=DIR root directory path of SALOME GUI installation, - SALOME_GUI_DIR="$withval",SALOME_GUI_DIR="") - -if test "x$SALOME_GUI_DIR" = "x" ; then - if test "x$GUI_ROOT_DIR" != "x" ; then - SALOME_GUI_DIR=$GUI_ROOT_DIR - else - # search Salome binaries in PATH variable - AC_PATH_PROG(TEMP, libSalomeApp.so) - if test "x$TEMP" != "x" ; then - SALOME_GUI_DIR=`dirname $TEMP` - else - fi - fi -fi - -if test -f ${SALOME_GUI_DIR}/lib/salome/libSalomeApp.so ; then - SalomeGUI_ok=yes - AC_MSG_RESULT(Using SALOME GUI distribution in ${SALOME_GUI_DIR}) - GUI_ROOT_DIR=${SALOME_GUI_DIR} - AC_SUBST(GUI_ROOT_DIR) -else - AC_MSG_WARN("Cannot find compiled SALOME GUI distribution") -fi - -AC_MSG_RESULT(for SALOME GUI: $SalomeGUI_ok) - -])dnl - diff --git a/adm_local/unix/config_files/check_Med.m4 b/adm_local/unix/config_files/check_Med.m4 deleted file mode 100644 index 727bf438..00000000 --- a/adm_local/unix/config_files/check_Med.m4 +++ /dev/null @@ -1,45 +0,0 @@ -# Check availability of Med binary distribution -# -# Author : Nicolas REJNERI (OPEN CASCADE, 2003) -# - -AC_DEFUN([CHECK_MED],[ - -AC_CHECKING(for Med) - -Med_ok=no - -AC_ARG_WITH(med, - [ --with-med=DIR root directory path of MED installation ], - MED_DIR="$withval",MED_DIR="") - -if test "x$MED_DIR" == "x" ; then - -# no --with-med-dir option used - - if test "x$MED_ROOT_DIR" != "x" ; then - - # MED_ROOT_DIR environment variable defined - MED_DIR=$MED_ROOT_DIR - - fi -# -fi - -if test -f ${MED_DIR}/idl/salome/MED.idl ; then - Med_ok=yes - AC_MSG_RESULT(Using Med module distribution in ${MED_DIR}) - - if test "x$MED_ROOT_DIR" == "x" ; then - MED_ROOT_DIR=${MED_DIR} - fi - AC_SUBST(MED_ROOT_DIR) - -else - AC_MSG_WARN("Cannot find Med module sources") -fi - -AC_MSG_RESULT(for Med: $Med_ok) - -])dnl - diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in deleted file mode 100644 index 549610f5..00000000 --- a/adm_local/unix/make_commence.in +++ /dev/null @@ -1,259 +0,0 @@ -# common directories to put headerfiles -inc_builddir=$(top_builddir)/include/salome - -@SET_MAKE@ -SHELL=/bin/sh - -# header missing - -HAVE_SSTREAM=@HAVE_SSTREAM@ - - -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker $(top_builddir)/lib/salome -# add libstdc++ to link c++ library with libtool ! -LDFLAGS+= -lstdc++ - -CP=@CP@ - -# CPP - -CPP=@CPP@ -CXXCPP=@CXXCPP@ -CPPFLAGS=@CPPFLAGS@ -I$(inc_builddir) -I$(srcdir) -I. - -# C - -CC = @CC@ -CFLAGS = @CFLAGS@ -C_DEPEND_FLAG = @C_DEPEND_FLAG@ - -# C++ - -CXX = @CXX@ -CXXFLAGS = @CXXFLAGS@ -CXX_DEPEND_FLAG = @CXX_DEPEND_FLAG@ - -# BOOST Library - -BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ - -# JAVA - -JAVA_INCLUDES = @JAVA_INCLUDES@ -JAVA_LIBS = @JAVA_LIBS@ -JAVA_LDPATH = @JAVA_LDPATH@ - -# PYTHON - -PYTHON = @PYTHON@ -PYTHONHOME = @PYTHONHOME@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_VERSION = @PYTHON_VERSION@ -PYTHON_SITE = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages -PYTHON_SITE_INSTALL = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome -# QT - -QT_ROOT = @QT_ROOT@ -QT_INCLUDES = @QT_INCLUDES@ -QT_MT_INCLUDES = @QT_INCLUDES@ -DQT_THREAD_SUPPORT -QT_LIBS = @QT_LIBS@ -QT_MT_LIBS = @QT_MT_LIBS@ - -MOC = @MOC@ -UIC = @UIC@ - -# msg2qm -MSG2QM = @MSG2QM@ - - -#QWT - -QWT_INCLUDES=@QWT_INCLUDES@ -QWT_LIBS=@QWT_LIBS@ - -# SIP -SIP = @SIP@ -SIP_INCLUDES = @SIP_INCLUDES@ -SIP_LIBS = @SIP_LIBS@ - -# PYQT -PYQT_SIPS = @PYQT_SIPS@ -PYQT_LIBS = @PYQT_LIBS@ - -# openGL -OGL_INCLUDES=@OGL_INCLUDES@ -OGL_LIBS=@OGL_LIBS@ - -# VTK -VTK_INCLUDES=@VTK_INCLUDES@ -VTK_LIBS=@VTK_LIBS@ - -# HDF5 - -HDF5_INCLUDES=@HDF5_INCLUDES@ -HDF5_LIBS=@HDF5_LIBS@ -HDF5_MT_LIBS=@HDF5_MT_LIBS@ - -# OpenCasCade - -OCC_INCLUDES=@CAS_CPPFLAGS@ -OCC_CXXFLAGS=@CAS_CXXFLAGS@ - -#OCC_KERNEL_LIBS=@CAS_KERNEL@ -#OCC_OCAF_LIBS=@CAS_OCAF@ -#OCC_VIEWER_LIBS=@CAS_VIEWER@ -#OCC_MODELER_LIBS=@CAS_MODELER@ -#OCC_DATAEXCHANGE_LIBS=@CAS_DATAEXCHANGE@ -#OCC_LIBS=@CAS_LDFLAGS@ -CAS_KERNEL=@CAS_KERNEL@ -CAS_OCAF=@CAS_OCAF@ -CAS_VIEWER=@CAS_VIEWER@ -CAS_MODELER=@CAS_MODELER@ -CAS_DATAEXCHANGE=@CAS_DATAEXCHANGE@ -CAS_LDPATH=@CAS_LDPATH@ -# MPICH - -MPICH_INCLUDES=@MPICH_INCLUDES@ -MPICH_LIBS=@MPICH_LIBS@ - -# Swig C++ Python - -SWIG = @SWIG@ -SWIG_FLAGS = @SWIG_FLAGS@ -I$(inc_builddir) -I$(srcdir) -I. - -# OMNIORB - -OMNIORB_ROOT = @OMNIORB_ROOT@ -OMNIORB_INCLUDES = @OMNIORB_INCLUDES@ -OMNIORB_LIBS = @OMNIORB_LIBS@ -OMNIORB_CXXFLAGS = @OMNIORB_CXXFLAGS@ - -OMNIORB_IDL = @OMNIORB_IDL@ -OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@ -OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/salome/idl \ - -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome - -OMNIORB_IDL_CLN_H = @OMNIORB_IDL_CLN_H@ -OMNIORB_IDL_CLN_CXX = @OMNIORB_IDL_CLN_CXX@ -OMNIORB_IDL_CLN_OBJ = @OMNIORB_IDL_CLN_OBJ@ - -OMNIORB_IDL_SRV_H = @OMNIORB_IDL_SRV_H@ -OMNIORB_IDL_SRV_CXX = @OMNIORB_IDL_SRV_CXX@ -OMNIORB_IDL_SRV_OBJ = @OMNIORB_IDL_SRV_OBJ@ - -# Default ORB - -CORBA_ROOT = @CORBA_ROOT@ -CORBA_INCLUDES = @CORBA_INCLUDES@ -CORBA_LIBS = @CORBA_LIBS@ -CORBA_CXXFLAGS = @CORBA_CXXFLAGS@ - -IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl/salome \ - -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome -IDLPYFLAGS = @IDLPYFLAGS@ - -IDL = @IDL@ - -IDL_CLN_H = @IDL_CLN_H@ -IDL_CLN_CXX = @IDL_CLN_CXX@ -IDL_CLN_OBJ = @IDL_CLN_OBJ@ - -IDL_SRV_H = @IDL_SRV_H@ -IDL_SRV_CXX = @IDL_SRV_CXX@ -IDL_SRV_OBJ = @IDL_SRV_OBJ@ - -CPPFLAGS+= $(CORBA_INCLUDES) -CXXFLAGS+= $(CORBA_CXXFLAGS) - -# add corba libs when link salome application ! -#LDFLAGS+= $(CORBA_LIBS) -LIBS+=$(CORBA_LIBS) - -DOXYGEN = @DOXYGEN@ - -## Shared libraries -LT_STATIC_EXEC=@LT_STATIC_EXEC@ -DYNAMIC_DIRS=@DYNAMIC_DIRS@ -LT_LIB=libtool -LT=$(top_builddir)/libtool -LT_COMPILE=$(LT) --mode=compile $(CC) -LT_LINK_LIB=$(LT_LIB) --mode=link $(CC) -rpath $(libdir) -LT_LINK_EXE=$(LT) --mode=link $(CC) $(LT_STATIC_EXEC) -dlopen self -rpath $(bindir) $(DYNAMIC_DIRS) -LT_RUN=$(LT) --mode=execute -LT_INSTALL_PROG=$(LT) --mode=install $(INSTALL_PROGRAM) -LT_INSTALL_LIB=$(LT) --mode=install $(INSTALL_DATA) -LT_UNINSTALL=$(LT) --mode=uninstall $(RM) - -INSTALL=@INSTALL@ -INSTALL_PROGRAM=@INSTALL_PROGRAM@ -INSTALL_DATA=@INSTALL_DATA@ - -# create a symbolic link (or a copie ?) -LN_S=@LN_S@ - -## Installation points -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@/salome -libdir=@libdir@/salome -# warning : if user give this path in configure we could have salome/salome :-( -includedir=@includedir@/salome -datadir=@datadir@/salome -idldir=${prefix}/idl/salome -sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules -incmakedir=${prefix}/salome_adm/unix - -docdir=${prefix}/doc/salome - -# -# begin of package rules -# - -.PHONY: all lib bin inc resources data docs tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean - -.SUFFIXES: .cxx .cc .c .f .o .lo .idl .py .i .ui .po .qm - -all: - $(MAKE) inc - $(MAKE) depend_idl - $(MAKE) depend - $(MAKE) lib - $(MAKE) bin - $(MAKE) resources - $(MAKE) data - -# -# add target to build administrative files -# - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) ; ./config.status - -$(top_builddir)/config.status: $(top_srcdir)/configure - cd $(top_builddir) ; ./config.status --recheck - -# VPATH contain $(srcdir), so make configure is good in top_srcdir and we must add target configure otherwise :-) -ifneq ($(top_srcdir),$(srcdir)) -configure: $(top_srcdir)/configure -endif - -$(top_srcdir)/configure: $(top_srcdir)/configure.in $(top_srcdir)/aclocal.m4 - cd $(top_srcdir) ; autoconf - -$(top_srcdir)/configure.in: $(top_srcdir)/configure.in.base - cd $(top_srcdir) && ./build_configure - - -ACLOCAL_SRC = \ -ac_cxx_bool.m4 check_corba.m4 check_vtk.m4 \ -ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \ -ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \ -ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \ -ac_cxx_partial_specialization.m4 check_opengl.m4 python.m4 \ -ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \ -ac_cc_warnings.m4 check_qt.m4 check_swig.m4 - -$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) - cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files diff --git a/adm_local/unix/make_omniorb.in b/adm_local/unix/make_omniorb.in deleted file mode 100644 index 7caf4b7c..00000000 --- a/adm_local/unix/make_omniorb.in +++ /dev/null @@ -1,59 +0,0 @@ -#======================================================================= -# Begin specific part to omniorb -# (include from file adm/unix/make_omniorb generated by -# adm/unix/make_omniorb.in) -#======================================================================= -# -* Makefile *- -# -# Author : Patrick GOLDBRONN (CEA) -# Date : 29/06/2001 -# $Header$ -# - -# Client and server object are the same with omniorb -# There are one header file and one source file generate - -#IDLOBJ=$(IDLSRC:%.idl=%$(IDL_CLN_OBJ)) - -# dependancies between idl and it's generated files -%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${KERNEL_ROOT_DIR}/idl/salome/%.idl - $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< - -%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${GUI_ROOT_DIR}/idl/salome/%.idl - $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< - -%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${MED_ROOT_DIR}/idl/salome/%.idl - $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< - -%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${top_srcdir}/idl/%.idl - $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< - -# dependncies between idl files -depend_idl: .depidl - -# we use cpp to generate dependencies between idl files. -# we change cpp output to keep only idl file and transform it to get a suitable rule -.depidl: $(IDL_FILES) - @touch $@ - @for dep in $? dummy; do \ - if [ $$dep != "dummy" ]; then \ - echo Building dependencies for $$dep; \ - basedep=`basename $$dep .idl`; \ - header="$$basedep"$(IDL_CLN_H); \ - sed '\%^'"$$header"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \ - $(CPP) $(C_DEPEND_FLAG) -I$(srcdir) $$dep 2>/dev/null | \ - sed `echo "s%$$basedep\\.idl%$$header:%g"` | \ - sed 's% $(srcdir)/% %g' | \ - sed 's% $(top_srcdir)/% %g' | \ - sed 's% $(top_builddir)/% %g' | \ - sed 's%^.*:\.o: *%%' | sed 's%^ *\\ *%%'| sed 's%^ *\(.*\):%\1:%' | \ - sed 's/\.idl/$(IDL_CLN_H)/' >>$@; \ - echo '' >>$@; \ - fi; \ - done ; - --include .depidl - -#======================================================================= -# End specific part to omniorb -#======================================================================= diff --git a/configure.in.base b/configure.in.base deleted file mode 100644 index 1396ae1e..00000000 --- a/configure.in.base +++ /dev/null @@ -1,392 +0,0 @@ -# -# PLEASE DO NOT MODIFY configure.in FILE -# -# ALL CHANGES WILL BE DISCARDED BY THE NEXT -# build_configure COMMAND -# -# CHANGES MUST BE MADE IN configure.in.base FILE -# -# -# Author : Marc Tajchman (CEA) -# Date : 28/06/2001 -# Modified by : Patrick GOLDBRONN (CEA) -# Modified by : Marc Tajchman (CEA) -# -# Created from configure.in.base -# - -AC_INIT(src) -AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files) -AC_CANONICAL_HOST - -PACKAGE=salome -AC_SUBST(PACKAGE) - -VERSION=0.0.1 -AC_SUBST(VERSION) - -dnl -dnl Initialize source and build root directories -dnl - -ROOT_BUILDDIR=`pwd` -ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` -cd $ROOT_SRCDIR -ROOT_SRCDIR=`pwd` -cd $ROOT_BUILDDIR - -AC_SUBST(ROOT_SRCDIR) -AC_SUBST(ROOT_BUILDDIR) - -echo -echo Source root directory : $ROOT_SRCDIR -echo Build root directory : $ROOT_BUILDDIR -echo -echo - -if test -z "$AR"; then - AC_CHECK_PROGS(AR,ar xar,:,$PATH) -fi -AC_SUBST(AR) - -dnl Export the AR macro so that it will be placed in the libtool file -dnl correctly. -export AR - -echo -echo --------------------------------------------- -echo testing make -echo --------------------------------------------- -echo - -AC_PROG_MAKE_SET -AC_PROG_INSTALL -dnl -dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques ! - -AC_ENABLE_DEBUG(yes) -AC_DISABLE_PRODUCTION - -echo --------------------------------------------- -echo testing libtool -echo --------------------------------------------- - -dnl first, we set static to no! -dnl if we want it, use --enable-static -AC_ENABLE_STATIC(no) - -AC_LIBTOOL_DLOPEN -AC_PROG_LIBTOOL - -dnl Fix up the INSTALL macro if it s a relative path. We want the -dnl full-path to the binary instead. -case "$INSTALL" in - *install-sh*) - INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh - ;; -esac - -echo -echo --------------------------------------------- -echo testing C/C++ -echo --------------------------------------------- -echo - -cc_ok=no -dnl inutil car libtool -dnl AC_PROG_CC -AC_PROG_CXX -AC_DEPEND_FLAG -# AC_CC_WARNINGS([ansi]) -cc_ok=yes - -dnl Library libdl : -AC_CHECK_LIB(dl,dlopen) - -dnl add library libm : -AC_CHECK_LIB(m,ceil) - -dnl -dnl Well we use sstream which is not in gcc pre-2.95.3 -dnl We must test if it exists. If not, add it in include ! -dnl - -AC_CXX_USE_STD_IOSTREAM -AC_CXX_HAVE_SSTREAM - -echo -echo --------------------------------------------- -echo BOOST Library -echo --------------------------------------------- -echo - -CHECK_BOOST - -dnl -dnl --------------------------------------------- -dnl testing MPICH -dnl --------------------------------------------- -dnl - -CHECK_MPICH - -echo -echo --------------------------------------------- -echo testing LEX \& YACC -echo --------------------------------------------- -echo - -lex_yacc_ok=no -AC_PROG_YACC -AC_PROG_LEX -lex_yacc_ok=yes - -echo -echo --------------------------------------------- -echo testing python -echo --------------------------------------------- -echo - -CHECK_PYTHON - -dnl echo -dnl echo --------------------------------------------- -dnl echo testing java -dnl echo --------------------------------------------- -dnl echo - -dnl CHECK_JAVA - -echo -echo --------------------------------------------- -echo testing swig -echo --------------------------------------------- -echo - -CHECK_SWIG - -echo -echo --------------------------------------------- -echo testing threads -echo --------------------------------------------- -echo - -ENABLE_PTHREADS - -echo -echo --------------------------------------------- -echo testing omniORB -echo --------------------------------------------- -echo - -CHECK_OMNIORB - -dnl echo -dnl echo --------------------------------------------- -dnl echo testing mico -dnl echo --------------------------------------------- -dnl echo - -dnl CHECK_MICO - -echo -echo --------------------------------------------- -echo default ORB : omniORB -echo --------------------------------------------- -echo - -DEFAULT_ORB=omniORB -CHECK_CORBA - -AC_SUBST_FILE(CORBA) -corba=make_$ORB -CORBA=adm_local/unix/$corba - -echo -echo --------------------------------------------- -echo testing openGL -echo --------------------------------------------- -echo - -CHECK_OPENGL - -echo -echo --------------------------------------------- -echo testing QT -echo --------------------------------------------- -echo - -CHECK_QT - -echo -echo --------------------------------------------- -echo testing msg2qm -echo --------------------------------------------- -echo - -CHECK_MSG2QM - -echo -echo --------------------------------------------- -echo testing VTK -echo --------------------------------------------- -echo - -CHECK_VTK - -echo -echo --------------------------------------------- -echo testing HDF5 -echo --------------------------------------------- -echo - -CHECK_HDF5 - -echo -echo --------------------------------------------- -echo Testing OpenCascade -echo --------------------------------------------- -echo - -CHECK_CAS - -echo -echo --------------------------------------------- -echo Testing qwt -echo --------------------------------------------- -echo - -CHECK_QWT - -echo -echo --------------------------------------------- -echo Testing html generators -echo --------------------------------------------- -echo - -CHECK_HTML_GENERATORS - -echo -echo --------------------------------------------- -echo Testing Kernel -echo --------------------------------------------- -echo - -CHECK_KERNEL - -echo -echo --------------------------------------------- -echo Testing Med -echo --------------------------------------------- -echo - -CHECK_MED - -echo -echo --------------------------------------------- -echo Summary -echo --------------------------------------------- -echo - -echo Configure -variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok Med_ok" - -for var in $variables -do - printf " %10s : " `echo \$var | sed -e "s,_ok,,"` - eval echo \$$var -done - -echo -echo "Default ORB : $DEFAULT_ORB" -echo - -dnl generals files which could be included in every makefile - -AC_SUBST_FILE(COMMENCE) COMMENCE=adm_local/unix/make_commence -AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude -AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module - -dnl les dependences -AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend - -dnl We don t need to say when we re entering directories if we re using -dnl GNU make becuase make does it for us. -if test "X$GMAKE" = "Xyes"; then - AC_SUBST(SETX) SETX=":" -else - AC_SUBST(SETX) SETX="set -x" -fi - -# make other build directories -for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl -do -# if test ! -d $rep ; then -# eval mkdir $rep -# fi - $INSTALL -d $rep -done - -echo -echo --------------------------------------------- -echo copying resource files, shell scripts, and -echo xml files -echo --------------------------------------------- -echo - - -dnl copy resources directories - -#for i in `find $ROOT_SRCDIR -name 'resources' -print` -#do -# local_res=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"` -# local_res_dir=`echo $local_res | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` -# mkdir -p $local_res_dir -# cd $local_res_dir -# ln -fs $i -# echo $local_res -# cd $ROOT_BUILDDIR -#done - -dnl copy shells and utilities contained in the bin directory -dnl excluding .in files (treated in AC-OUTPUT below) and CVS -dnl directory - -mkdir -p bin/salome -cd bin/salome -for i in $ROOT_SRCDIR/bin/* -do - local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"` - case "$local_bin" in - *.in | *~) ;; - ./bin/CVS | ./bin/salome) ;; - *) /usr/bin/install $i .; echo $local_bin ;; - esac -done -cd $ROOT_BUILDDIR - -AC_SUBST_FILE(ENVSCRIPT) ENVSCRIPT=salome_adm/unix/envScript - -dnl copy xml files to the build tree (lib directory) -dnl pourquoi ???? - -#cd lib -#for i in `find $ROOT_SRCDIR -name "*.xml" -print` -#do -# ln -fs $i -# echo `echo $i | sed -e "s,$ROOT_SRCDIR,.,"` -#done -#cd $ROOT_BUILDDIR - - -echo -echo --------------------------------------------- -echo generating Makefiles and configure files -echo --------------------------------------------- -echo - -AC_OUTPUT_COMMANDS([ \ - chmod +x ./bin/* \ -]) - -## do not delete this line diff --git a/doc/Makefile.in b/doc/Makefile.in deleted file mode 100644 index 7295ede7..00000000 --- a/doc/Makefile.in +++ /dev/null @@ -1,40 +0,0 @@ - -# -* Makefile *- -# -# Author : Patrick GOLDBRONN (CEA) -# Date : 30/11/2001 -# $Header$ -# -# source path -top_srcdir=@top_srcdir@ -top_builddir=.. -srcdir=@srcdir@ -VPATH=.:@srcdir@ - -SUBDIRS= salome - -@COMMENCE@ - -docs: - @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ - done -clean: - @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ - done - -distclean: clean - @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ - done - -install: - @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ - done - -uninstall: - @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ - done diff --git a/doc/salome/VISU_index.html b/doc/salome/VISU_index.html deleted file mode 100644 index 84118080..00000000 --- a/doc/salome/VISU_index.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - Post-Pro Module Documentation - - - -
  -
-
                   -   
- - - - - - - - - -
- - - -
- -
-
-
-

Post-Pro MODULE Documentation

-
-
- - - - - -
-
- -
-

Application-About.png -     

-
- -
- - - - -
-
-
-
-
- -
- -
GUI Documentation
- -
- -
- -

-
- -
- -
TUI Documentation
- -
- -
- -

-
-
-
-
-
-
- - diff --git a/doc/salome/gui/Makefile.in b/doc/salome/gui/Makefile.in deleted file mode 100644 index e03160f1..00000000 --- a/doc/salome/gui/Makefile.in +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : Makefile.in -# Author : Vasily Rusyaev (Open Cascade NN) -# Module : doc -# $Header: - -top_srcdir=@top_srcdir@ -top_builddir=../../.. -srcdir=@srcdir@ -VPATH=.:@srcdir@ - -@COMMENCE@ - -docs: - cp -fr $(srcdir)/VISU ./ - -find $(PWD) -name CVS -exec rm -rf {} \; - -clean: - rm -fr `ls | grep -v "Makefile"` - -distclean: clean - rm -fr VISU - -install: - mkdir -p $(docdir)/gui - cp -rf VISU $(docdir)/gui - -find $(PWD) -name CVS -exec rm -rf {} \; - -uninstall: - rm -rf $(docdir)/gui/VISU diff --git a/doc/salome/gui/VISU/animation.gif b/doc/salome/gui/VISU/animation.gif deleted file mode 100755 index 3f41856f..00000000 Binary files a/doc/salome/gui/VISU/animation.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/createfieldprsnt.gif b/doc/salome/gui/VISU/createfieldprsnt.gif deleted file mode 100755 index 3e65e1fc..00000000 Binary files a/doc/salome/gui/VISU/createfieldprsnt.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/createpresent.gif b/doc/salome/gui/VISU/createpresent.gif deleted file mode 100755 index 807cd7e2..00000000 Binary files a/doc/salome/gui/VISU/createpresent.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/createtable.gif b/doc/salome/gui/VISU/createtable.gif deleted file mode 100755 index 2216f37d..00000000 Binary files a/doc/salome/gui/VISU/createtable.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/i_blue.jpg b/doc/salome/gui/VISU/i_blue.jpg deleted file mode 100755 index ed3acfac..00000000 Binary files a/doc/salome/gui/VISU/i_blue.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/image15.gif b/doc/salome/gui/VISU/image15.gif deleted file mode 100755 index c752772f..00000000 Binary files a/doc/salome/gui/VISU/image15.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/image16.gif b/doc/salome/gui/VISU/image16.gif deleted file mode 100755 index cd27cf1f..00000000 Binary files a/doc/salome/gui/VISU/image16.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/image17.gif b/doc/salome/gui/VISU/image17.gif deleted file mode 100755 index 6c6272e6..00000000 Binary files a/doc/salome/gui/VISU/image17.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/image19.jpg b/doc/salome/gui/VISU/image19.jpg deleted file mode 100755 index d24fdaee..00000000 Binary files a/doc/salome/gui/VISU/image19.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/image20.jpg b/doc/salome/gui/VISU/image20.jpg deleted file mode 100755 index a2a345f3..00000000 Binary files a/doc/salome/gui/VISU/image20.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/image21.jpg b/doc/salome/gui/VISU/image21.jpg deleted file mode 100755 index c1bc42f8..00000000 Binary files a/doc/salome/gui/VISU/image21.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/importmed.gif b/doc/salome/gui/VISU/importmed.gif deleted file mode 100755 index bc4549a7..00000000 Binary files a/doc/salome/gui/VISU/importmed.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/launchvisu.gif b/doc/salome/gui/VISU/launchvisu.gif deleted file mode 100755 index 4d8d76d8..00000000 Binary files a/doc/salome/gui/VISU/launchvisu.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/more.jpg b/doc/salome/gui/VISU/more.jpg deleted file mode 100755 index 1ed8250e..00000000 Binary files a/doc/salome/gui/VISU/more.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/note1.gif b/doc/salome/gui/VISU/note1.gif deleted file mode 100755 index b53e21d0..00000000 Binary files a/doc/salome/gui/VISU/note1.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/animatdef.jpg b/doc/salome/gui/VISU/pics/animatdef.jpg deleted file mode 100755 index ed9b4693..00000000 Binary files a/doc/salome/gui/VISU/pics/animatdef.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/animation.jpg b/doc/salome/gui/VISU/pics/animation.jpg deleted file mode 100755 index eac0b736..00000000 Binary files a/doc/salome/gui/VISU/pics/animation.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/animationparam.jpg b/doc/salome/gui/VISU/pics/animationparam.jpg deleted file mode 100755 index 06da5a36..00000000 Binary files a/doc/salome/gui/VISU/pics/animationparam.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/begining.jpg b/doc/salome/gui/VISU/pics/begining.jpg deleted file mode 100755 index 9c624022..00000000 Binary files a/doc/salome/gui/VISU/pics/begining.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/cellsel.jpg b/doc/salome/gui/VISU/pics/cellsel.jpg deleted file mode 100755 index 8e7f8d93..00000000 Binary files a/doc/salome/gui/VISU/pics/cellsel.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/cellselection.jpg b/doc/salome/gui/VISU/pics/cellselection.jpg deleted file mode 100755 index 26c83e5d..00000000 Binary files a/doc/salome/gui/VISU/pics/cellselection.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/cutlinesicn.jpg b/doc/salome/gui/VISU/pics/cutlinesicn.jpg deleted file mode 100755 index eb43365c..00000000 Binary files a/doc/salome/gui/VISU/pics/cutlinesicn.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/cutlinesicon.jpg b/doc/salome/gui/VISU/pics/cutlinesicon.jpg deleted file mode 100755 index cd866735..00000000 Binary files a/doc/salome/gui/VISU/pics/cutlinesicon.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/cutlinesprsnt.jpg b/doc/salome/gui/VISU/pics/cutlinesprsnt.jpg deleted file mode 100755 index 22191fa9..00000000 Binary files a/doc/salome/gui/VISU/pics/cutlinesprsnt.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/cutplpresent.jpg b/doc/salome/gui/VISU/pics/cutplpresent.jpg deleted file mode 100755 index c318c2ec..00000000 Binary files a/doc/salome/gui/VISU/pics/cutplpresent.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/defshapeicon.jpg b/doc/salome/gui/VISU/pics/defshapeicon.jpg deleted file mode 100755 index 5d59f160..00000000 Binary files a/doc/salome/gui/VISU/pics/defshapeicon.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/display.jpg b/doc/salome/gui/VISU/pics/display.jpg deleted file mode 100755 index 2b8f9c21..00000000 Binary files a/doc/salome/gui/VISU/pics/display.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/display1.jpg b/doc/salome/gui/VISU/pics/display1.jpg deleted file mode 100755 index 19c9e364..00000000 Binary files a/doc/salome/gui/VISU/pics/display1.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/end.jpg b/doc/salome/gui/VISU/pics/end.jpg deleted file mode 100755 index 3aef5d1b..00000000 Binary files a/doc/salome/gui/VISU/pics/end.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/iso.jpg b/doc/salome/gui/VISU/pics/iso.jpg deleted file mode 100755 index 0c1d46f2..00000000 Binary files a/doc/salome/gui/VISU/pics/iso.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/isosurf.jpg b/doc/salome/gui/VISU/pics/isosurf.jpg deleted file mode 100755 index 88d5ac72..00000000 Binary files a/doc/salome/gui/VISU/pics/isosurf.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/next.jpg b/doc/salome/gui/VISU/pics/next.jpg deleted file mode 100755 index 958ff001..00000000 Binary files a/doc/salome/gui/VISU/pics/next.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/points.jpg b/doc/salome/gui/VISU/pics/points.jpg deleted file mode 100755 index 6164f769..00000000 Binary files a/doc/salome/gui/VISU/pics/points.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/pointselection.jpg b/doc/salome/gui/VISU/pics/pointselection.jpg deleted file mode 100755 index fd227511..00000000 Binary files a/doc/salome/gui/VISU/pics/pointselection.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/previous.jpg b/doc/salome/gui/VISU/pics/previous.jpg deleted file mode 100755 index 4b4106b8..00000000 Binary files a/doc/salome/gui/VISU/pics/previous.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/run.jpg b/doc/salome/gui/VISU/pics/run.jpg deleted file mode 100755 index d8805928..00000000 Binary files a/doc/salome/gui/VISU/pics/run.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/scalarmapicon.jpg b/doc/salome/gui/VISU/pics/scalarmapicon.jpg deleted file mode 100755 index fff992d5..00000000 Binary files a/doc/salome/gui/VISU/pics/scalarmapicon.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/scalingicon.jpg b/doc/salome/gui/VISU/pics/scalingicon.jpg deleted file mode 100755 index 5acd2f57..00000000 Binary files a/doc/salome/gui/VISU/pics/scalingicon.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/selection1.jpg b/doc/salome/gui/VISU/pics/selection1.jpg deleted file mode 100755 index c93668ce..00000000 Binary files a/doc/salome/gui/VISU/pics/selection1.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/selmode.jpg b/doc/salome/gui/VISU/pics/selmode.jpg deleted file mode 100755 index c74a3c35..00000000 Binary files a/doc/salome/gui/VISU/pics/selmode.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/shrink.jpg b/doc/salome/gui/VISU/pics/shrink.jpg deleted file mode 100755 index 0985b855..00000000 Binary files a/doc/salome/gui/VISU/pics/shrink.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/speed.jpg b/doc/salome/gui/VISU/pics/speed.jpg deleted file mode 100755 index 3076f301..00000000 Binary files a/doc/salome/gui/VISU/pics/speed.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/streamlinesicon.jpg b/doc/salome/gui/VISU/pics/streamlinesicon.jpg deleted file mode 100755 index 3d90087e..00000000 Binary files a/doc/salome/gui/VISU/pics/streamlinesicon.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/streamlinesprsnt.jpg b/doc/salome/gui/VISU/pics/streamlinesprsnt.jpg deleted file mode 100755 index 08846927..00000000 Binary files a/doc/salome/gui/VISU/pics/streamlinesprsnt.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/surface.jpg b/doc/salome/gui/VISU/pics/surface.jpg deleted file mode 100755 index 6f9a0240..00000000 Binary files a/doc/salome/gui/VISU/pics/surface.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/vecticon.jpg b/doc/salome/gui/VISU/pics/vecticon.jpg deleted file mode 100755 index 40c36af4..00000000 Binary files a/doc/salome/gui/VISU/pics/vecticon.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/vectorsprsnt.jpg b/doc/salome/gui/VISU/pics/vectorsprsnt.jpg deleted file mode 100755 index f8b359ed..00000000 Binary files a/doc/salome/gui/VISU/pics/vectorsprsnt.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/visuicon.jpg b/doc/salome/gui/VISU/pics/visuicon.jpg deleted file mode 100755 index 8489eef2..00000000 Binary files a/doc/salome/gui/VISU/pics/visuicon.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/wireframe.jpg b/doc/salome/gui/VISU/pics/wireframe.jpg deleted file mode 100755 index aa84b51c..00000000 Binary files a/doc/salome/gui/VISU/pics/wireframe.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/ss_btn_related_topics.gif b/doc/salome/gui/VISU/ss_btn_related_topics.gif deleted file mode 100755 index 5158bc46..00000000 Binary files a/doc/salome/gui/VISU/ss_btn_related_topics.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/texture_horiz_ltbluebubbles.jpg b/doc/salome/gui/VISU/texture_horiz_ltbluebubbles.jpg deleted file mode 100755 index a10d494a..00000000 Binary files a/doc/salome/gui/VISU/texture_horiz_ltbluebubbles.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/tip1.gif b/doc/salome/gui/VISU/tip1.gif deleted file mode 100755 index bb74c875..00000000 Binary files a/doc/salome/gui/VISU/tip1.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/whestart.ico b/doc/salome/gui/VISU/whestart.ico deleted file mode 100755 index 110f1835..00000000 Binary files a/doc/salome/gui/VISU/whestart.ico and /dev/null differ diff --git a/doc/salome/gui/VISU/whgdata/whexpbar.gif b/doc/salome/gui/VISU/whgdata/whexpbar.gif deleted file mode 100755 index e677dc6f..00000000 Binary files a/doc/salome/gui/VISU/whgdata/whexpbar.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/whrstart.ico b/doc/salome/gui/VISU/whrstart.ico deleted file mode 100755 index bffcd6eb..00000000 Binary files a/doc/salome/gui/VISU/whrstart.ico and /dev/null differ diff --git a/doc/salome/gui/VISU/whstart.ico b/doc/salome/gui/VISU/whstart.ico deleted file mode 100755 index 365eceac..00000000 Binary files a/doc/salome/gui/VISU/whstart.ico and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_fts_h.gif b/doc/salome/gui/VISU/wht_fts_h.gif deleted file mode 100755 index feb79ae8..00000000 Binary files a/doc/salome/gui/VISU/wht_fts_h.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_fts_n.gif b/doc/salome/gui/VISU/wht_fts_n.gif deleted file mode 100755 index 8483be43..00000000 Binary files a/doc/salome/gui/VISU/wht_fts_n.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_glo_h.gif b/doc/salome/gui/VISU/wht_glo_h.gif deleted file mode 100755 index 12223e5c..00000000 Binary files a/doc/salome/gui/VISU/wht_glo_h.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_glo_n.gif b/doc/salome/gui/VISU/wht_glo_n.gif deleted file mode 100755 index 32803ebd..00000000 Binary files a/doc/salome/gui/VISU/wht_glo_n.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_go.gif b/doc/salome/gui/VISU/wht_go.gif deleted file mode 100755 index 106f1d16..00000000 Binary files a/doc/salome/gui/VISU/wht_go.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_hide.gif b/doc/salome/gui/VISU/wht_hide.gif deleted file mode 100755 index 6ec602dc..00000000 Binary files a/doc/salome/gui/VISU/wht_hide.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_idx_h.gif b/doc/salome/gui/VISU/wht_idx_h.gif deleted file mode 100755 index 2df1b16a..00000000 Binary files a/doc/salome/gui/VISU/wht_idx_h.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_idx_n.gif b/doc/salome/gui/VISU/wht_idx_n.gif deleted file mode 100755 index fd193a0f..00000000 Binary files a/doc/salome/gui/VISU/wht_idx_n.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_logo1.gif b/doc/salome/gui/VISU/wht_logo1.gif deleted file mode 100755 index 2ef5700f..00000000 Binary files a/doc/salome/gui/VISU/wht_logo1.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_logo2.gif b/doc/salome/gui/VISU/wht_logo2.gif deleted file mode 100755 index 2ac62e86..00000000 Binary files a/doc/salome/gui/VISU/wht_logo2.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_next.gif b/doc/salome/gui/VISU/wht_next.gif deleted file mode 100755 index 8ea834d5..00000000 Binary files a/doc/salome/gui/VISU/wht_next.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_next_g.gif b/doc/salome/gui/VISU/wht_next_g.gif deleted file mode 100755 index c0e97584..00000000 Binary files a/doc/salome/gui/VISU/wht_next_g.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_prev.gif b/doc/salome/gui/VISU/wht_prev.gif deleted file mode 100755 index b7eaba83..00000000 Binary files a/doc/salome/gui/VISU/wht_prev.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_prev_g.gif b/doc/salome/gui/VISU/wht_prev_g.gif deleted file mode 100755 index 86479091..00000000 Binary files a/doc/salome/gui/VISU/wht_prev_g.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_spac.gif b/doc/salome/gui/VISU/wht_spac.gif deleted file mode 100755 index fc256098..00000000 Binary files a/doc/salome/gui/VISU/wht_spac.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_sync.gif b/doc/salome/gui/VISU/wht_sync.gif deleted file mode 100755 index 0ef17473..00000000 Binary files a/doc/salome/gui/VISU/wht_sync.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_tab0.gif b/doc/salome/gui/VISU/wht_tab0.gif deleted file mode 100755 index 955c42f4..00000000 Binary files a/doc/salome/gui/VISU/wht_tab0.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_tab1.gif b/doc/salome/gui/VISU/wht_tab1.gif deleted file mode 100755 index b3ec41d6..00000000 Binary files a/doc/salome/gui/VISU/wht_tab1.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_tab2.gif b/doc/salome/gui/VISU/wht_tab2.gif deleted file mode 100755 index 08fb0ce4..00000000 Binary files a/doc/salome/gui/VISU/wht_tab2.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_tab3.gif b/doc/salome/gui/VISU/wht_tab3.gif deleted file mode 100755 index 1819c8e8..00000000 Binary files a/doc/salome/gui/VISU/wht_tab3.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_tab4.gif b/doc/salome/gui/VISU/wht_tab4.gif deleted file mode 100755 index 1a6fc4f4..00000000 Binary files a/doc/salome/gui/VISU/wht_tab4.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_tab5.gif b/doc/salome/gui/VISU/wht_tab5.gif deleted file mode 100755 index 93401926..00000000 Binary files a/doc/salome/gui/VISU/wht_tab5.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_tab6.gif b/doc/salome/gui/VISU/wht_tab6.gif deleted file mode 100755 index fe312d23..00000000 Binary files a/doc/salome/gui/VISU/wht_tab6.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_tab7.gif b/doc/salome/gui/VISU/wht_tab7.gif deleted file mode 100755 index 3b95ae24..00000000 Binary files a/doc/salome/gui/VISU/wht_tab7.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_tab8.gif b/doc/salome/gui/VISU/wht_tab8.gif deleted file mode 100755 index c80acc8d..00000000 Binary files a/doc/salome/gui/VISU/wht_tab8.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_toc1.gif b/doc/salome/gui/VISU/wht_toc1.gif deleted file mode 100755 index 515c352d..00000000 Binary files a/doc/salome/gui/VISU/wht_toc1.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_toc2.gif b/doc/salome/gui/VISU/wht_toc2.gif deleted file mode 100755 index 2e3d6c8f..00000000 Binary files a/doc/salome/gui/VISU/wht_toc2.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_toc3.gif b/doc/salome/gui/VISU/wht_toc3.gif deleted file mode 100755 index 330f3691..00000000 Binary files a/doc/salome/gui/VISU/wht_toc3.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_toc4.gif b/doc/salome/gui/VISU/wht_toc4.gif deleted file mode 100755 index 3f9a0368..00000000 Binary files a/doc/salome/gui/VISU/wht_toc4.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_toc_h.gif b/doc/salome/gui/VISU/wht_toc_h.gif deleted file mode 100755 index fe20f686..00000000 Binary files a/doc/salome/gui/VISU/wht_toc_h.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_toc_n.gif b/doc/salome/gui/VISU/wht_toc_n.gif deleted file mode 100755 index ce283101..00000000 Binary files a/doc/salome/gui/VISU/wht_toc_n.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_ws.gif b/doc/salome/gui/VISU/wht_ws.gif deleted file mode 100755 index 563db8bf..00000000 Binary files a/doc/salome/gui/VISU/wht_ws.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/wht_ws_g.gif b/doc/salome/gui/VISU/wht_ws_g.gif deleted file mode 100755 index 3056b754..00000000 Binary files a/doc/salome/gui/VISU/wht_ws_g.gif and /dev/null differ diff --git a/doc/salome/tui/Makefile.in b/doc/salome/tui/Makefile.in deleted file mode 100644 index 44faf46d..00000000 --- a/doc/salome/tui/Makefile.in +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : Makefile.in -# Author : Vasily Rusyaev (Open Cascade NN) -# Module : doc -# $Header: - -top_srcdir=@top_srcdir@ -top_builddir=../../.. -root_srcdir=@ROOT_SRCDIR@ -srcdir=@srcdir@ -VPATH=.:@srcdir@ -doxygen=@DOXYGEN@ - -@COMMENCE@ - -docs: - cp -fr $(srcdir)/VISU ./INPUT; \ - cd INPUT; \ - sed 's|../../../share/salome|$(root_srcdir)|' ./doxyfile > ./doxyfile1; \ - mv -f doxyfile1 doxyfile; \ - $(doxygen) ./doxyfile; \ - cd ..; \ - cp -fr $(srcdir)/VISU/sources/static/*.* ./VISU/ - cp -fr $(srcdir)/VISU/sources/ VISU/ - cp -fr $(srcdir)/VISU/HTML/ VISU/ - rm -fr INPUT - -clean: - rm -fr VISU - -distclean: clean - rm -fr INPUT - -install: - $(INSTALL) -d $(docdir); \ - mkdir -p $(docdir)/tui - cp -fr VISU $(docdir)/tui - -uninstall: - rm -fr $(docdir)/tui/VISU diff --git a/doc/salome/tui/VISU/HTML/VISU_Gen.html b/doc/salome/tui/VISU/HTML/VISU_Gen.html deleted file mode 100644 index 5d4af0b6..00000000 --- a/doc/salome/tui/VISU/HTML/VISU_Gen.html +++ /dev/null @@ -1,1070 +0,0 @@ - - - - - - - - - - - - - - - - -
interface Base
IDL file
Python
IdType GetID ( )
return_value = GetID ( )
VISUType GetType ( )
return_value = GetType ( )

- - - - - - - -
interface PrsObject
IDL file
Python

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface Table
IDL file
Python
void SetTitle ( in string theTitle )
SetTitle ( theTitle )
string GetTitle ( )
return_value = GetTitle ( )
void SetOrientation ( in Orientation theOrientation )
SetOrientation ( theOrientation )
Orientation GetOrientation ( )
return_value = GetOrientation ( )
long GetNbRows ( )
return_value = GetNbRows ( )
long GetNbColumns ( )
return_value = GetNbColumns ( )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface Curve
IDL file
Python
void SetTitle ( in string theTitle )
SetTitle ( theTitle )
string GetTitle ( )
return_value = GetTitle ( )
void SetColor ( in Color theColor )
SetColor ( theColor )
Color GetColor ( )
return_value = GetColor ( )
void SetMarker ( in MarkerType theType )
SetMarker ( theType )
MarkerType GetMarker ( )
return_value = GetMarker ( )
void SetLine ( in LineType theType, in long theLineWidth )
SetLine ( theType, theLineWidth )
LineType GetLine ( )
return_value = GetLine ( )
long GetLineWidth ( )
return_value = GetLineWidth ( )

- - - - - - - - - - - - - - - - - - - - - - - -
interface Container
IDL file
Python
void AddCurve ( in Curve theCurve )
AddCurve ( theCurve )
void RemoveCurve ( in Curve theCurve )
RemoveCurve ( theCurve )
long GetNbCurves ( )
return_value = GetNbCurves ( )
void Clear ( )
Clear ( )

- - - - - - - -
interface Prs3d
IDL file
Python

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface Mesh
IDL file
Python
void SetCellColor ( in Color theColor )
SetCellColor ( theColor )
Color GetCellColor ( )
return_value = GetCellColor ( )
void SetNodeColor ( in Color theColor )
SetNodeColor ( theColor )
Color GetNodeColor ( )
return_value = GetNodeColor ( )
void SetLinkColor ( in Color theColor )
SetLinkColor ( theColor )
Color GetLinkColor ( )
return_value = GetLinkColor ( )
void SetPresentationType ( in PresentationType theType )
SetPresentationType ( theType )
PresentationType GetPresentationType ( )
return_value = GetPresentationType ( )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface ScalarMap
IDL file
Python
void SetScalarMode ( in long theScalarMode )
SetScalarMode ( theScalarMode )
long GetScalarMode ( )
return_value = GetScalarMode ( )
void SetScaling ( in Scaling theScaling )
SetScaling ( theScaling )
Scaling GetScaling ( )
return_value = GetScaling ( )
void SetRange ( in double theMin, in double theMax )
SetRange ( theMin, theMax )
double GetMin ( )
return_value = GetMin ( )
double GetMax ( )
return_value = GetMax ( )
void SetBarOrientation ( in Orientation theOrientation )
SetBarOrientation ( theOrientation )
Orientation GetBarOrientation ( )
return_value = GetBarOrientation ( )
void SetPosition ( in double X, in double Y )
SetPosition ( X, Y )
double GetPosX ( )
return_value = GetPosX ( )
double GetPosY ( )
return_value = GetPosY ( )
void SetSize ( in double theWidth, in double theHeight )
SetSize ( theWidth, theHeight )
double GetWidth ( )
return_value = GetWidth ( )
double GetHeight ( )
return_value = GetHeight ( )
void SetNbColors ( in long theNbColors )
SetNbColors ( theNbColors )
long GetNbColors ( )
return_value = GetNbColors ( )
void SetLabels ( in long theNbLabels )
SetLabels ( theNbLabels )
long GetLabels ( )
return_value = GetLabels ( )
void SetTitle ( in string theName )
SetTitle ( theName )
string GetTitle ( )
return_value = GetTitle ( )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface DeformedShape
IDL file
Python
void SetScale ( in double theScale )
SetScale ( theScale )
double GetScale ( )
return_value = GetScale ( )
boolean IsColored ( )
return_value = IsColored ( )
void ShowColored ( in boolean theColored )
ShowColored ( theColored )
Color GetColor ( )
return_value = GetColor ( )
void SetColor ( in Color theColor )
SetColor ( theColor )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface CutPlanes
IDL file
Python
void SetOrientation ( in Orientation theOrientation, in double theXAngle, in double theYAngle )
SetOrientation ( theOrientation, theXAngle, theYAngle )
Orientation GetOrientationType ( )
return_value = GetOrientationType ( )
double GetRotateX ( )
return_value = GetRotateX ( )
double GetRotateY ( )
return_value = GetRotateY ( )
void SetDisplacement ( in double theDisp )
SetDisplacement ( theDisp )
double GetDisplacement ( )
return_value = GetDisplacement ( )
void SetPlanePosition ( in long thePlaneNumber, in double thePlanePosition )
SetPlanePosition ( thePlaneNumber, thePlanePosition )
void SetDefault ( in long thePlaneNumber )
SetDefault ( thePlaneNumber )
double GetPlanePosition ( in long thePlaneNumber )
return_value = GetPlanePosition ( thePlaneNumber )
boolean IsDefault ( in long thePlaneNumber )
return_value = IsDefault ( thePlaneNumber )
void SetNbPlanes ( in long theNb )
SetNbPlanes ( theNb )
long GetNbPlanes ( )
return_value = GetNbPlanes ( )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface CutLines
IDL file
Python
void SetOrientation ( in Orientation theOrientation, in double theXAngle, in double theYAngle )
SetOrientation ( theOrientation, theXAngle, theYAngle )
void SetOrientation2 ( in Orientation theOrientation, in double theXAngle, in double theYAngle )
SetOrientation2 ( theOrientation, theXAngle, theYAngle )
Orientation GetOrientationType ( )
return_value = GetOrientationType ( )
Orientation GetOrientationType2 ( )
return_value = GetOrientationType2 ( )
double GetRotateX ( )
return_value = GetRotateX ( )
double GetRotateX2 ( )
return_value = GetRotateX2 ( )
double GetRotateY ( )
return_value = GetRotateY ( )
double GetRotateY2 ( )
return_value = GetRotateY2 ( )
void SetDisplacement ( in double theDisp )
SetDisplacement ( theDisp )
void SetDisplacement2 ( in double theDisp )
SetDisplacement2 ( theDisp )
double GetDisplacement ( )
return_value = GetDisplacement ( )
double GetDisplacement2 ( )
return_value = GetDisplacement2 ( )
void SetBasePlanePosition ( in double thePlanePosition )
SetBasePlanePosition ( thePlanePosition )
double GetBasePlanePosition ( )
return_value = GetBasePlanePosition ( )
void SetLinePosition ( in long thePlaneNumber, in double thePlanePosition )
SetLinePosition ( thePlaneNumber, thePlanePosition )
double GetLinePosition ( in long thePlaneNumber )
return_value = GetLinePosition ( thePlaneNumber )
void SetDefault ( )
SetDefault ( )
boolean IsDefault ( )
return_value = IsDefault ( )
void SetDefaultPosition ( in long thePlaneNumber )
SetDefaultPosition ( thePlaneNumber )
boolean IsDefaultPosition ( in long thePlaneNumber )
return_value = IsDefaultPosition ( thePlaneNumber )
void SetNbLines ( in long theNb )
SetNbLines ( theNb )
long GetNbLines ( )
return_value = GetNbLines ( )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface StreamLines
IDL file
Python
boolean SetParams ( in double theIntStep, in double thePropogationTime, in double theStepLength, in Prs3d thePrs3d, in double thePercents, in Direction theDirection )
return_value = SetParams ( theIntStep, thePropogationTime, theStepLength, thePrs3d, thePercents, theDirection )
double GetIntegrationStep ( )
return_value = GetIntegrationStep ( )
double GetPropagationTime ( )
return_value = GetPropagationTime ( )
double GetStepLength ( )
return_value = GetStepLength ( )
Prs3d GetSource ( )
return_value = GetSource ( )
double GetUsedPoints ( )
return_value = GetUsedPoints ( )
Direction GetDirection ( )
return_value = GetDirection ( )

- - - - - - - - - - - - - - - -
interface IsoSurfaces
IDL file
Python
void SetNbSurfaces ( in long theNb )
SetNbSurfaces ( theNb )
long GetNbSurfaces ( )
return_value = GetNbSurfaces ( )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface Vectors
IDL file
Python
void SetLineWidth ( in double theWidth )
SetLineWidth ( theWidth )
double GetLineWidth ( )
return_value = GetLineWidth ( )
void SetGlyphType ( in GlyphType theType )
SetGlyphType ( theType )
GlyphType GetGlyphType ( )
return_value = GetGlyphType ( )
void SetGlyphPos ( in GlyphPos thePos )
SetGlyphPos ( thePos )
GlyphPos GetGlyphPos ( )
return_value = GetGlyphPos ( )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface Animation
IDL file
Python
void addField ( in SObject theObject )
addField ( theObject )
void generatePresentations ( in long theFieldNum )
generatePresentations ( theFieldNum )
boolean generateFrames ( )
return_value = generateFrames ( )
void clearView ( )
clearView ( )
void startAnimation ( )
startAnimation ( )
void stopAnimation ( )
stopAnimation ( )
void nextFrame ( )
nextFrame ( )
void prevFrame ( )
prevFrame ( )
void firstFrame ( )
firstFrame ( )
void lastFrame ( )
lastFrame ( )
void gotoFrame ( in long theFrame )
gotoFrame ( theFrame )
long getNbFields ( )
return_value = getNbFields ( )
long getNbFrames ( )
return_value = getNbFrames ( )
boolean isRunning ( )
return_value = isRunning ( )
long getCurrentFrame ( )
return_value = getCurrentFrame ( )
ScalarMap getPresentation ( in long theField, in long theFrame )
return_value = getPresentation ( theField, theFrame )
void setPresentationType ( in long theFieldNum, in VISUType theType )
setPresentationType ( theFieldNum, theType )
VISUType getPresentationType ( in long theFieldNum )
return_value = getPresentationType ( theFieldNum )
void setSpeed ( in long theSpeed )
setSpeed ( theSpeed )
long getSpeed ( )
return_value = getSpeed ( )
boolean isProportional ( )
return_value = isProportional ( )
void setAnimationRange ( in double theMin, in double theMax )
setAnimationRange ( theMin, theMax )
double getMinRange ( )
return_value = getMinRange ( )
double getMaxRange ( )
return_value = getMaxRange ( )
boolean isRangeDefined ( )
return_value = isRangeDefined ( )
void dumpTo ( in string thePath )
dumpTo ( thePath )
boolean isCycling ( )
return_value = isCycling ( )
double getMinTime ( )
return_value = getMinTime ( )
double getMaxTime ( )
return_value = getMaxTime ( )
void setProportional ( in boolean theProp )
setProportional ( theProp )
void setCycling ( in boolean theCycle )
setCycling ( theCycle )

- - - - - - - - - - - -
interface Result
IDL file
Python
boolean BuildAll ( )
return_value = BuildAll ( )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface VISU_Gen
IDL file
Python
void SetCurrentStudy ( in Study theStudy )
SetCurrentStudy ( theStudy )
Study GetCurrentStudy ( )
return_value = GetCurrentStudy ( )
ViewManager GetViewManager ( )
return_value = GetViewManager ( )
SObject ImportTables ( in string theFileName )
return_value = ImportTables ( theFileName )
boolean ExportTableToFile ( in SObject theTable, in string theFileName )
return_value = ExportTableToFile ( theTable, theFileName )
Result ImportFile ( in string theFileName )
return_value = ImportFile ( theFileName )
Result CopyAndImportFile ( in string theFileName )
return_value = CopyAndImportFile ( theFileName )
Result ImportMed ( in SObject theMedSObject )
return_value = ImportMed ( theMedSObject )
Result ImportMedField ( in FIELD theField )
return_value = ImportMedField ( theField )
Mesh MeshOnEntity ( in Result theResult, in string theMeshName, in Entity theEntity )
return_value = MeshOnEntity ( theResult, theMeshName, theEntity )
Mesh FamilyMeshOnEntity ( in Result theResult, in string theMeshName, in Entity theEntity, in string theFamilyName )
return_value = FamilyMeshOnEntity ( theResult, theMeshName, theEntity, theFamilyName )
Mesh GroupMesh ( in Result theResult, in string theMeshName, in string theGroupName )
return_value = GroupMesh ( theResult, theMeshName, theGroupName )
ScalarMap ScalarMapOnField ( in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration )
return_value = ScalarMapOnField ( theResult, theMeshName, theEntity, theFieldName, theIteration )
DeformedShape DeformedShapeOnField ( in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration )
return_value = DeformedShapeOnField ( theResult, theMeshName, theEntity, theFieldName, theIteration )
Vectors VectorsOnField ( in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration )
return_value = VectorsOnField ( theResult, theMeshName, theEntity, theFieldName, theIteration )
IsoSurfaces IsoSurfacesOnField ( in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration )
return_value = IsoSurfacesOnField ( theResult, theMeshName, theEntity, theFieldName, theIteration )
StreamLines StreamLinesOnField ( in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration )
return_value = StreamLinesOnField ( theResult, theMeshName, theEntity, theFieldName, theIteration )
CutPlanes CutPlanesOnField ( in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration )
return_value = CutPlanesOnField ( theResult, theMeshName, theEntity, theFieldName, theIteration )
CutLines CutLinesOnField ( in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration )
return_value = CutLinesOnField ( theResult, theMeshName, theEntity, theFieldName, theIteration )
Table CreateTable ( in string theTableEntry )
return_value = CreateTable ( theTableEntry )
Curve CreateCurve ( in Table theTable, in long theHRow, in long theVRow )
return_value = CreateCurve ( theTable, theHRow, theVRow )
Container CreateContainer ( )
return_value = CreateContainer ( )
Animation CreateAnimation ( in View3D theView3d )
return_value = CreateAnimation ( theView3d )
void DeleteResult ( in Result theResult )
DeleteResult ( theResult )
void DeletePrs3d ( in Prs3d thePrs3d )
DeletePrs3d ( thePrs3d )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface View
IDL file
Python
void ShowPart ( in ViewRepresentation ViewRepr, in boolean state )
ShowPart ( ViewRepr, state )
boolean IsPartShown ( in ViewRepresentation ViewRepr )
return_value = IsPartShown ( ViewRepr )
void SetViewWidth ( in long Width )
SetViewWidth ( Width )
void SetViewHeight ( in long Height )
SetViewHeight ( Height )
long GetViewWidth ( )
return_value = GetViewWidth ( )
long GetViewHeight ( )
return_value = GetViewHeight ( )
void SetViewPositionHorizontal ( in ViewPosition ViewPosHor )
SetViewPositionHorizontal ( ViewPosHor )
void SetViewPositionVertical ( in ViewPosition ViewPosVer )
SetViewPositionVertical ( ViewPosVer )
void SetRelativePosition ( in double x, in double y )
SetRelativePosition ( x, y )
void SetRelativeSize ( in double x, in double y )
SetRelativeSize ( x, y )
void SetTitle ( in string theTitle )
SetTitle ( theTitle )
string GetTitle ( )
return_value = GetTitle ( )
void SetBackground ( in Color theColor )
SetBackground ( theColor )
Color GetBackground ( )
return_value = GetBackground ( )
void Minimize ( )
Minimize ( )
void Restore ( )
Restore ( )
void Maximize ( )
Maximize ( )
void EraseAll ( )
EraseAll ( )
void DisplayAll ( )
DisplayAll ( )
void Erase ( in PrsObject thePrsObj )
Erase ( thePrsObj )
void Display ( in PrsObject thePrsObj )
Display ( thePrsObj )
void DisplayOnly ( in PrsObject thePrsObj )
DisplayOnly ( thePrsObj )
void Update ( )
Update ( )
boolean SavePicture ( in string theFileName )
return_value = SavePicture ( theFileName )

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface View3D
IDL file
Python
void FitAll ( )
FitAll ( )
void SetView ( in ViewType theType )
SetView ( theType )
void SetPointOfView ( in XYZ theCoord )
SetPointOfView ( theCoord )
XYZ GetPointOfView ( )
return_value = GetPointOfView ( )
void SetViewUp ( in XYZ theDir )
SetViewUp ( theDir )
XYZ GetViewUp ( )
return_value = GetViewUp ( )
void SetFocalPoint ( in XYZ theDir )
SetFocalPoint ( theDir )
XYZ GetFocalPoint ( )
return_value = GetFocalPoint ( )
void SetParallelScale ( in double theScale )
SetParallelScale ( theScale )
double GetParallelScale ( )
return_value = GetParallelScale ( )
void ScaleView ( in Axis theAxis, in double theParam )
ScaleView ( theAxis, theParam )
void RemoveScale ( )
RemoveScale ( )
boolean SaveViewParams ( in string theName )
return_value = SaveViewParams ( theName )
boolean RestoreViewParams ( in string theName )
return_value = RestoreViewParams ( theName )

- - - - - - - -
interface TableView
IDL file
Python

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface XYPlot
IDL file
Python
void SetSubTitle ( in string theTitle )
SetSubTitle ( theTitle )
string GetSubTitle ( )
return_value = GetSubTitle ( )
void SetCurveType ( in CurveType theType )
SetCurveType ( theType )
CurveType GetCurveType ( )
return_value = GetCurveType ( )
void SetMarkerSize ( in long theSize )
SetMarkerSize ( theSize )
long GetMarkerSize ( )
return_value = GetMarkerSize ( )
void EnableXGrid ( in boolean theMajor, in long theNumMajor, in boolean theMinor, in long theNumMinor )
EnableXGrid ( theMajor, theNumMajor, theMinor, theNumMinor )
void EnableYGrid ( in boolean theMajor, in long theNumMajor, in boolean theMinor, in long theNumMinor )
EnableYGrid ( theMajor, theNumMajor, theMinor, theNumMinor )
void SetHorScaling ( in Scaling theScaling )
SetHorScaling ( theScaling )
Scaling GetHorScaling ( )
return_value = GetHorScaling ( )
void SetVerScaling ( in Scaling theScaling )
SetVerScaling ( theScaling )
Scaling GetVerScaling ( )
return_value = GetVerScaling ( )
void SetXTitle ( in string theTitle )
SetXTitle ( theTitle )
string GetXTitle ( )
return_value = GetXTitle ( )
void SetYTitle ( in string theTitle )
SetYTitle ( theTitle )
string GetYTitle ( )
return_value = GetYTitle ( )
void ShowLegend ( in boolean theShowing )
ShowLegend ( theShowing )
void FitAll ( )
FitAll ( )

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
interface ViewManager
IDL file
Python
View GetCurrentView ( )
return_value = GetCurrentView ( )
View3D Create3DView ( )
return_value = Create3DView ( )
TableView CreateTableView ( in Table theTable )
return_value = CreateTableView ( theTable )
XYPlot CreateXYPlot ( )
return_value = CreateXYPlot ( )
void Destroy ( in View theView )
Destroy ( theView )

-
diff --git a/doc/salome/tui/VISU/doxyfile b/doc/salome/tui/VISU/doxyfile deleted file mode 100755 index 3ee35aea..00000000 --- a/doc/salome/tui/VISU/doxyfile +++ /dev/null @@ -1,200 +0,0 @@ -# Doxyfile 1.3-rc1 - -#--------------------------------------------------------------------------- -# General configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "SALOME - VISU - v.2.1.0" -PROJECT_NUMBER = id#1.1 -OUTPUT_DIRECTORY = ../ -OUTPUT_LANGUAGE = English -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = NO -ALWAYS_DETAILED_SEC = YES -INLINE_INHERITED_MEMB = YES -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = YES -SHORT_NAMES = NO -HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = YES -SHOW_INCLUDE_FILES = YES -JAVADOC_AUTOBRIEF = YES -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = NO -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 5 -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ALIASES = -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 25 -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = YES -SHOW_USED_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = log.txt -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = ../../../share/salome/idl/VISU_Gen.idl -FILE_PATTERNS = -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = sources/ -INPUT_FILTER = -FILTER_SOURCE_FILES = YES -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = VISU -HTML_FILE_EXTENSION = .html -HTML_HEADER = sources/myheader.html -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = YES -TOC_EXPAND = YES -DISABLE_INDEX = YES -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_SCHEMA = -XML_DTD = -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = NO -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = NO -HAVE_DOT = YES -CLASS_GRAPH = YES -COLLABORATION_GRAPH = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DOT_IMAGE_FORMAT = jpg -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1200 -GENERATE_LEGEND = NO -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO -CGI_NAME = search.cgi -CGI_URL = -DOC_URL = -DOC_ABSPATH = -BIN_ABSPATH = /usr/local/bin/ -EXT_DOC_PATHS = diff --git a/doc/salome/tui/VISU/sources/Application-About.png b/doc/salome/tui/VISU/sources/Application-About.png deleted file mode 100755 index 7b58330d..00000000 Binary files a/doc/salome/tui/VISU/sources/Application-About.png and /dev/null differ diff --git a/doc/salome/tui/VISU/sources/Application-About1.jpg b/doc/salome/tui/VISU/sources/Application-About1.jpg deleted file mode 100755 index cf7ab8ba..00000000 Binary files a/doc/salome/tui/VISU/sources/Application-About1.jpg and /dev/null differ diff --git a/doc/salome/tui/VISU/sources/application.gif b/doc/salome/tui/VISU/sources/application.gif deleted file mode 100644 index 0b05d5c1..00000000 Binary files a/doc/salome/tui/VISU/sources/application.gif and /dev/null differ diff --git a/doc/salome/tui/VISU/sources/application.jpg b/doc/salome/tui/VISU/sources/application.jpg deleted file mode 100755 index a6979ab9..00000000 Binary files a/doc/salome/tui/VISU/sources/application.jpg and /dev/null differ diff --git a/doc/salome/tui/VISU/sources/bg_salome.gif b/doc/salome/tui/VISU/sources/bg_salome.gif deleted file mode 100644 index c7e03068..00000000 Binary files a/doc/salome/tui/VISU/sources/bg_salome.gif and /dev/null differ diff --git a/doc/salome/tui/VISU/sources/logocorp.gif b/doc/salome/tui/VISU/sources/logocorp.gif deleted file mode 100755 index 7697e083..00000000 Binary files a/doc/salome/tui/VISU/sources/logocorp.gif and /dev/null differ diff --git a/doc/salome/tui/VISU/sources/myheader.html b/doc/salome/tui/VISU/sources/myheader.html deleted file mode 100755 index 83ca543c..00000000 --- a/doc/salome/tui/VISU/sources/myheader.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Main Page - - - -  -
- - - - - - -
-
-
- - - - diff --git a/doc/salome/tui/VISU/sources/occ.gif b/doc/salome/tui/VISU/sources/occ.gif deleted file mode 100755 index ce017c8a..00000000 Binary files a/doc/salome/tui/VISU/sources/occ.gif and /dev/null differ diff --git a/doc/salome/tui/VISU/sources/static/DataStruct.gif b/doc/salome/tui/VISU/sources/static/DataStruct.gif deleted file mode 100755 index bec28ad2..00000000 Binary files a/doc/salome/tui/VISU/sources/static/DataStruct.gif and /dev/null differ diff --git a/doc/salome/tui/VISU/sources/static/PrsObj.gif b/doc/salome/tui/VISU/sources/static/PrsObj.gif deleted file mode 100755 index a8aa81fe..00000000 Binary files a/doc/salome/tui/VISU/sources/static/PrsObj.gif and /dev/null differ diff --git a/doc/salome/tui/VISU/sources/static/View.gif b/doc/salome/tui/VISU/sources/static/View.gif deleted file mode 100755 index b6aa909e..00000000 Binary files a/doc/salome/tui/VISU/sources/static/View.gif and /dev/null differ diff --git a/doc/salome/tui/VISU/sources/static/doxygen.css b/doc/salome/tui/VISU/sources/static/doxygen.css deleted file mode 100755 index 0a8e93d5..00000000 --- a/doc/salome/tui/VISU/sources/static/doxygen.css +++ /dev/null @@ -1,49 +0,0 @@ -H1 { text-align: center; } -CAPTION { font-weight: bold } -A.qindex {} -A.qindexRef {} -A.el { text-decoration: none; font-weight: bold } -A.elRef { font-weight: bold } -A.code { text-decoration: none; font-weight: normal; color: #4444ee } -A.codeRef { font-weight: normal; color: #4444ee } -A:hover { text-decoration: none; background-color: lightblue } -DL.el { margin-left: -1cm } -DIV.fragment { width: 100%; border: none; background-color: #CCCCCC } -DIV.ah { background-color: #CCCCCC; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -TD.md { background-color: lightblue; font-weight: bold; } -TD.mdname1 { background-color: lightblue; font-weight: bold; color: #602020; } -TD.mdname { background-color: lightblue; font-weight: bold; color: #602020; width: 600px; } -DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } -DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } -BODY { background: url(sources/bg_salome.gif) } -TD.indexkey { - background-color: #CCCCCC; - font-weight: bold; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px -} -TD.indexvalue { - background-color: #CCCCCC; - font-style: italic; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px -} -span.keyword { color: #008000 } -span.keywordtype { color: #604020 } -span.keywordflow { color: #e08000 } -span.comment { color: #800000 } -span.preprocessor { color: #806020 } -span.stringliteral { color: #002080 } -span.charliteral { color: #008080 } diff --git a/doc/salome/tui/VISU/sources/static/examples_VISU.html b/doc/salome/tui/VISU/sources/static/examples_VISU.html deleted file mode 100755 index 40e26ee9..00000000 --- a/doc/salome/tui/VISU/sources/static/examples_VISU.html +++ /dev/null @@ -1,1270 +0,0 @@ - - - - - - - - Main Page - - - - -   -
- - - - - - - - -
- - -
-
- -

Examples

-      Interfaces:
-
- VISU::Base

- VISU::VISU_Gen
- VISU::PrsObject
-

- VISU::Result
-
- VISU::Prs3d

- VISU::Mesh
- VISU::ScalarMap
- VISU::CutPlanes
- VISU::CutLines
- VISU::IsoSurfaces
- VISU::DeformedShape
- VISU::Vectors
- VISU::StreamLines
-
- VISU::Table
- VISU::Curve
- VISU::Container
-
- VISU::ViewManager

- VISU::View
- VISU::View3D
- VISU::TableView
- VISU::XYPlot
- -

Base

- - - - - - - - - - - - -
IdType - VISU::Base::GetID   -
-
- -

#Returns ID of the object. That is IOR of CORBA representation a VISU -object.
-

- -

aSObject = myLocalStudy.FindObjectIOR(theResult.GetID())
-

- - - - - - - - - - - -
VISUType - VISU::Base::GetType   -
- -

#Returns the type of the presentable object. It can be used for quick -class definition of an VISU object
-
- if aVISUObject.GetType() == VISU.TSCALARMAP :
-     #do something ...
-

- -


-

-

VISU_Gen
-

- - - - - - - - - - - - - -
void VISU::VISU_Gen::SetCurrentStudy - in SALOMEDS::Study   theStudy -
-
-
- -

- - - - - - - -
- - - - - - - - - - - -
SALOMEDS::Study -VISU::VISU_Gen::GetCurrentStudy   -
-
-
-
- #It is very important to set SALOMEDS::Study for VISU Engine before you -start any work with them.
- #Every object that you will create will be assigned to the study you set -before.
- #It can be done like this:
-

- -

aStudy = myStudyManager.NewStudy("A foo Study")
- if aStudy is None : raise RuntimeError, "Error"
- else : print "OK"
-     theVisuGen.SetCurrentStudy(aStudy)
-     #to do every things you like
-     ...
-

- -

- - - - - - - -
- - - - - - - - - - - -
ViewManager -VISU::VISU_Gen::GetViewManager   -
-
-
- - - - - - - - - -
  -

Gets the ViewManager which is used for creation of post-processing -presentations.

-
-
- #In order to display any VISU::PrsObject in propriate viewer you must take -VISU::ViewManager interface
-

- -

aViewManager = myVisuGen.GetViewManager()
- #to do something for displaing some presentation
- ...
-

- -

- - - - - - - -
- - - - - - - - - - - - -
SALOMEDS::SObject -VISU::VISU_Gen::ImportTables in string   theFileName -
-
-
- - - - - - - - - -
  -

Imports tables from a file and create TableAttribute in Sudy -

-
-
- #It is possible to import some ASCII files that include text table representation. -One file can consist from more than one table.
-

- -

aSObject = myVisuGen.ImportTables("/MyPresicousFileOfTables.txt")
-

- -

- - - - - - - -
- - - - - - - - - - - - -
Result -VISU::VISU_Gen::ImportFile in string   theFileName -
-
-
- - - - - - - - - -
  -

Imports data from a file.

-
-
- #It is possible import a med files to VISU
-

- -

aResult = myVisuGen.ImportFile("/ItIsDreamOfMyLife.med")
-

- -

- - - - - - - -
- - - - - - - - - - - - -
Result -VISU::VISU_Gen::ImportMed in SALOMEDS::SObject   theMedSObject -
-
-
- - - - - - - - - -
  -

Imports data from a MED object.

-
-
- #
-

- -

- - - - - - - -
- - - - - - - - - - - - -
Result -VISU::VISU_Gen::ImportMedField in SALOME_MED::FIELD   theField -
-
-
- - - - - - - - - -
  -

Imports data from a MED field.

-
-

- -

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Mesh -VISU::VISU_Gen::MeshOnEntity in Result   theResult, -

-

-
in string   theMeshName, -

-

-
in Entity   theEntity

-

-
-
- - - - - - - - - -
  -

Creates a Mesh on the basis of the data generated in other sources -(MED object or file).

-
-

- -

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Mesh -VISU::VISU_Gen::FamilyMeshOnEntity in Result   theResult, -

-

-
in string   theMeshName, -

-

-
in Entity   theEntity, -

-

-
in string   theFamilyName

-

-
-
-

- -

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Mesh -VISU::VISU_Gen::GroupMesh in Result   theResult, -

-

-
in string   theMeshName, -

-

-
in string   theGroupName

-

-
-
-

- -

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ScalarMap -VISU::VISU_Gen::ScalarMapOnField in Result   theResult, -

-

-
in string   theMeshName, -

-

-
in Entity   theEntity, -

-

-
in string   theFieldName, -

-

-
in double   theIteration

-

-
-
- - - - - - - - - -
  -

Creates a scalar bar presentation.

- -
-
Parameters:
-
- - - - - - - - - - - - - - - - - - - - - - - - -
theResult  Data generated in other sources. (MED object or file) -
theMeshName  One of the meshes presented in MED file
theEntity  Type of entity where the field is defined
theFieldName  Group of data attributed to the MESH. The data can -be scalar or vector.
theIteration  Number of iteration on the field
-
-
-
-

- -

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DeformedShape -VISU::VISU_Gen::DeformedShapeOnField in Result   theResult, -

-

-
in string   theMeshName, -

-

-
in Entity   theEntity, -

-

-
in string   theFieldName, -

-

-
in double   theIteration

-

-
-
- - - - - - - - - -
  -

Creates a deformed shape presentation.

- -
-
Parameters:
-
- - - - - - - - - - - - - - - - - - - - - - - - -
theResult  Data generated in other sources. (MED object or file) -
theMeshName  One of the meshes presented in MED file
theEntity  Type of entity where the field is defined
theFieldName  Group of data attributed to the MESH. The data can -be scalar or vector.
theIteration  Number of iteration on the field
-
-
-
-

- -

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Vectors -VISU::VISU_Gen::VectorsOnField in Result   theResult, -

-

-
in string   theMeshName, -

-

-
in Entity   theEntity, -

-

-
in string   theFieldName, -

-

-
in double   theIteration

-

-
-
- - - - - - - - - -
  -

Creates a vector presentation.

- -
-
Parameters:
-
- - - - - - - - - - - - - - - - - - - - - - - - -
theResult  Data generated in other sources. (MED object or file) -
theMeshName  One of the meshes presented in MED file
theEntity  Type of entity where the field is defined
theFieldName  Group of data attributed to the MESH. The data can -be scalar or vector.
theIteration  Number of iteration on the field
-
-
-
-

- -

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IsoSurfaces -VISU::VISU_Gen::IsoSurfacesOnField in Result   theResult, -

-

-
in string   theMeshName, -

-

-
in Entity   theEntity, -

-

-
in string   theFieldName, -

-

-
in double   theIteration

-

-
-
- - - - - - - - - -
  -

Creates an iso surface presentation.

- -
-
Parameters:
-
- - - - - - - - - - - - - - - - - - - - - - - - -
theResult  Data generated in other sources. (MED object or file) -
theMeshName  One of the meshes presented in MED file
theEntity  Type of entity where the field is defined
theFieldName  Group of data attributed to the MESH. The data can -be scalar or vector.
theIteration  Number of iteration on the field
-
-
-
-

- -

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StreamLines -VISU::VISU_Gen::StreamLinesOnField in Result   theResult, -

-

-
in string   theMeshName, -

-

-
in Entity   theEntity, -

-

-
in string   theFieldName, -

-

-
in double   theIteration

-

-
-
- - - - - - - - - -
  -

Creates an stream lines presentation.

- -
-
Parameters:
-
- - - - - - - - - - - - - - - - - - - - - - - - -
theResult  Data generated in other sources. (MED object or file) -
theMeshName  One of the meshes presented in MED file
theEntity  Type of entity where the field is defined
theFieldName  Group of data attributed to the MESH. The data can -be scalar or vector.
theIteration  Number of iteration on the field
-
-
-
-

- -

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CutPlanes -VISU::VISU_Gen::CutPlanesOnField in Result   theResult, -

-

-
in string   theMeshName, -

-

-
in Entity   theEntity, -

-

-
in string   theFieldName, -

-

-
in double   theIteration

-

-
-
- - - - - -
  -

Creates a presentation of cut planes.

- -
-
Parameters:
-
- - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/salome/tui/VISU/sources/static/overview_VISU.html b/doc/salome/tui/VISU/sources/static/overview_VISU.html deleted file mode 100755 index 844abd40..00000000 --- a/doc/salome/tui/VISU/sources/static/overview_VISU.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - Main Page - - - -  -
theResult  Data generated in other sources. (MED object or file) -
theMeshName  One of the meshes presented in MED file
theEntity  Type of entity where the field is defined
theFieldName 
- - - - - - -
-
-
- - -

General overview -

-

Table of contents

- - -
-

1. Introduction

-

Post-processing module VISU for SALOME is destined for visualization of data - produced by other components. VISU provides various forms of data visualization - including:

- -
    -
  • Data tables,
  • -
  • XY plots based on data from tables,
  • -
  • 3D presentations,
  • -
      -
    • Scalar Map,
    • -
    • Deformed Shape,
    • -
    • Vectors,
    • -
    • Iso Surfaces,
    • -
    • Cut Planes,
    • -
    • Stream Lines,
    • -
    • Cut Lines.
    • -
    -
-Back to the contents -

2. Defintions

-

The following terms are used for presentation of the VISU module:

-
-
Study
-
manages data produced by various component of SALOME platform. More detailed description of the SALOME Study can be found in the document named "Data Structure and Persistence Specifications".
-
Component
-
a SALOME software module that implements predefined interfaces. -The component provides the data for the SALOME study in a form of links (stored in the Study) -to the specific data stored in the component. All components are CORBA servers and it allows them -to be running on different host stations.
-
Geometry
a coherent set of data produced by component GEOM or any other geometry tool -and imported using geometry exchange interface (like BRep, IGES and so on).
-
Mesh
a collection of elements used as a support for numeric simulation.
-
Field
the set of results of the same type allocated to mesh elements. -Fields can be one of next types: scalars, vectors, tensors, matrices, character strings.
-
-Back to the contents -

3. Forms of data visualization

-

3.1 Data tables

-

Table represents data in spreadsheet-like form. For these purposes the QTable - widget will be provided. This widget can be reused in any module for any dialog - box as a control. For post-processing data visualization needs this widget is - used inside of Table window (based on non-modal window frame). Data represented - in Table window of post-processing module is be editable.

-

3.2 XY plots

-

XY plot represents calculation data in form of 2D (XY) plotting. -XY plot view is shown in a separated view window (non-modal dialog box), which can be moved in any position of the screen for convenience. -The QWT extension of QT toolkit is used for XY plotting. -QWT provides unlimited number of displayed curves (data sets) and supports logarithmic scale, zooming, and selection.

- -

3.3 3D presentations

-

A 3D presentation shows geometry, mesh and fields in 3D space. -Provides selection, rotation, zooming, scaling, and panning of 3d scene. -Color bar for scalar data presentation is supplied. -For 3D presentation window of the current implementation of VTK viewer in study window is used.

-Back to the contents -

4. Data structure

-

Source data for post-processing module can be imported from MED file or MED object in study data structure (CORBA object) can be used for this purposes.

-

In case of import MED file the data from this file will be converted in form of VTK Data Source format and stored in VISU data structure. In case of using of MED object from study the label in VISU data structure will be created with reference to the corresponded MED object.

-

Available result data is displayed under corresponded MED data label. For every result the number of presentations can be created dependently on result type.

-

Presentation is represented in data structure in form of list of presentation creation parameters. This could be:

-
    -
  • Presentation type (table, XY plot, 3d view);
  • -
  • Presentation subtype (for example for 3d: scalar map, iso-surfaces, combined view and so on);
  • -
  • Parameters of the presentation dependently on its type (number of colors, type of scale, font parameters, grid parameters and so on).
  • -
-

Parameters of presentation are persistent data, which will be stored in study file.

- - -
-Back to the contents -

5. VISU module features and services

-

The functionality of the VISU module is provided by a set of classes which are combined into -the VISU package. -

The API reference of the VISU component can be found here.

-

5.1 Base class

-

This is a root class for all objects of the VISU module.

-

The API reference for this class can be found here.

- -

5.2 ViewManager class

-

This class is used for management of the view windows (creation and deletion).

-

The API reference for this class can be found here.

- -

5.3 View class

-

View class is a base for all other classes, necessary for creation of different views .

- -
-

The API reference for this class can be found here.

- -

5.3.1 3dView class

-

This class provides a set of methods for creation of a 3d view window.

-

The API reference for this class can be found here.

- -

5.3.2 TableView class

-

This class provides a set of methods for creation of a Table view window.

-

The API reference for this class can be found here.

- -

5.3.3 XYPlotView class

-

This class provides a set of methods for creation of a XYPlot view window.

-

The API reference for this class can be found here.

- -

5.4 Result class

-

This class serves for inner representation of data generated in other sources. -(MED object or file) This data is needed for further construction of graphical presentations.

-

The API reference for this class can be found here.

-

5.5 PrsObject class

-

It is the root class of all presentable objects.

-
-

The API reference for this class can be found here.

- -

5.5.1 Curve class

-

Manages presentation parameters of one curve. -This object can be used for presentation of set of curves using Container class.

-

The API reference for this class can be found here.

- -

5.5.2 Table class

-

Manages presentation parameters of a table.

-

The API reference for this class can be found here.

- -

5.5.3 Container class

-

This class is provided in order to create one presentation using several presentable objects. This can provide combination of a set of curves to display them in XY plot view. -

-

The API reference for this class can be found here.

- -

5.5.4 Prs3d class

-

Root class for all 3D presentations.

-

The API reference for this class can be found here.

- -

5.5.5 Mesh class

-

Manages presentation parameters of a 3D presentattion of a mesh. -This object can be used for presentation of set of curves using Container class.

-

The API reference for this class can be found here.

- -

5.5.6 ScalarMap class

-

Manages presentation parameters of the scalar bar.

-

The API reference for this class can be found here.

- -

5.5.7 CutLines class

-

Manages presentation parameters of the cut lines presentation.

-

The API reference for this class can be found here.

- -

5.5.8 CutPlanes class

-

Manages presentation parameters of the cut planes presentation.

-

The API reference for this class can be found here.

- -

5.5.9 IsoSurfaces class

-

Manages presentation parameters of the iso surfaces presentation.

-

The API reference for this class can be found here.

- -

5.5.10 DeformedShape class

-

Manages presentation parameters of the deformed shape presentation.

-

The API reference for this class can be found here.

- -

5.5.11 Vectors class

-

Manages presentation parameters of the vector presentation.

-

The API reference for this class can be found here.

- -

5.5.12 StreamLines class

-

Manages presentation parameters of the streamlines presentation.

-

The API reference for this class can be found here.

- -

5.6 Animation class

-

This class provides a set of methods used for:

-
    -
  • generating different animations,
  • -
  • setting the parameters of the animations,
  • -
  • playing these animations in the VISU module.
  • -
-

The API reference for this class can be found here.

- -

5.7 VISU_Gen class

-

This is the main clas of the VISU component in SALOME application. It is used for , -using the views provided by ViewManager. This class provides a set of methods used for:

-
    -
  • creation of all types of post-processing presentations from given Result and Table object reference
  • -
  • creation of animations
  • - -
-

The API reference for this class can be found here.

-Back to the contents - - diff --git a/doc/salome/tui/VISU/sources/static/page2.html b/doc/salome/tui/VISU/sources/static/page2.html deleted file mode 100755 index d31cf0c4..00000000 --- a/doc/salome/tui/VISU/sources/static/page2.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Main Page - - - -  -
- - - - - - -
-
-
- - - - - - - - diff --git a/doc/salome/tui/VISU/sources/static/treeview.js b/doc/salome/tui/VISU/sources/static/treeview.js deleted file mode 100644 index 55eb43d0..00000000 --- a/doc/salome/tui/VISU/sources/static/treeview.js +++ /dev/null @@ -1,505 +0,0 @@ -//**************************************************************** -// You are free to copy the "Folder-Tree" script as long as you -// keep this copyright notice: -// Script found in: http://www.geocities.com/Paris/LeftBank/2178/ -// Author: Marcelino Alves Martins (martins@hks.com) December '97. -//**************************************************************** - -//Log of changes: -// 17 Feb 98 - Fix initialization flashing problem with Netscape -// -// 27 Jan 98 - Root folder starts open; support for USETEXTLINKS; -// make the ftien4 a js file -// -// DvH: Dec 2000 - Made some minor changes to support external -// references - -// Definition of class Folder -// ***************************************************************** - -function Folder(folderDescription, tagName, hreference) //constructor -{ - //constant data - this.desc = folderDescription - this.tagName = tagName - this.hreference = hreference - this.id = -1 - this.navObj = 0 - this.iconImg = 0 - this.nodeImg = 0 - this.isLastNode = 0 - - //dynamic data - this.isOpen = true - this.iconSrc = "ftv2folderopen.png" - this.children = new Array - this.nChildren = 0 - - //methods - this.initialize = initializeFolder - this.setState = setStateFolder - this.addChild = addChild - this.createIndex = createEntryIndex - this.hide = hideFolder - this.display = display - this.renderOb = drawFolder - this.totalHeight = totalHeight - this.subEntries = folderSubEntries - this.outputLink = outputFolderLink -} - -function setStateFolder(isOpen) -{ - var subEntries - var totalHeight - var fIt = 0 - var i=0 - - if (isOpen == this.isOpen) - return - - if (browserVersion == 2) - { - totalHeight = 0 - for (i=0; i < this.nChildren; i++) - totalHeight = totalHeight + this.children[i].navObj.clip.height - subEntries = this.subEntries() - if (this.isOpen) - totalHeight = 0 - totalHeight - for (fIt = this.id + subEntries + 1; fIt < nEntries; fIt++) - indexOfEntries[fIt].navObj.moveBy(0, totalHeight) - } - this.isOpen = isOpen - propagateChangesInState(this) -} - -function propagateChangesInState(folder) -{ - var i=0 - - if (folder.isOpen) - { - if (folder.nodeImg) - if (folder.isLastNode) - folder.nodeImg.src = "ftv2mlastnode.png" - else - folder.nodeImg.src = "ftv2mnode.png" - folder.iconImg.src = "ftv2folderopen.png" - for (i=0; i 0) - auxEv = "" - else - auxEv = "" - - if (level>0) - if (lastNode) //the last 'brother' in the children array - { - this.renderOb(leftSide + auxEv + "") -// leftSide = leftSide + "" - this.isLastNode = 1 - } - else - { - this.renderOb(leftSide + auxEv + "") - leftSide = leftSide + "" - this.isLastNode = 0 - } - else - this.renderOb("") - - if (nc > 0) - { - level = level + 1 - for (i=0 ; i < this.nChildren; i++) - { - if (i == this.nChildren-1) - this.children[i].initialize(level, 1, leftSide) - else - this.children[i].initialize(level, 0, leftSide) - } - } -} - -function drawFolder(leftSide) -{ - if (browserVersion == 2) { - if (!doc.yPos) - doc.yPos=8 - doc.write("") - } - if (browserVersion == 3) - { - doc.write("
") - } - - doc.write("\n") - doc.write("\n\n") - doc.write("\n
") - doc.write(leftSide) - this.outputLink() - doc.write("") - doc.write("") - if (USETEXTLINKS) - { - this.outputLink() - doc.write(this.desc + "") - } - else - doc.write(this.desc) - -/*! - if (this.tagName!="") - { - doc.write(" [external]") - } -*/ - doc.write("
\n") - - if (browserVersion == 2) { - doc.write("") - } - if (browserVersion == 3) { - doc.write("
") - } - - if (browserVersion == 1) { - this.navObj = doc.all["folder"+this.id] - this.iconImg = doc.all["folderIcon"+this.id] - this.nodeImg = doc.all["nodeIcon"+this.id] - } else if (browserVersion == 2) { - this.navObj = doc.layers["folder"+this.id] - this.iconImg = this.navObj.document.images["folderIcon"+this.id] - this.nodeImg = this.navObj.document.images["nodeIcon"+this.id] - doc.yPos=doc.yPos+this.navObj.clip.height - } else if (browserVersion == 3) { - this.navObj = doc.getElementById("folder"+this.id) - this.iconImg = doc.images.namedItem("folderIcon"+this.id) - this.nodeImg = doc.images.namedItem("nodeIcon"+this.id) - } -} - -function outputFolderLink() -{ - if (this.hreference) - { - doc.write(" 0) - doc.write("onClick='javascript:clickOnFolder("+this.id+")'") - doc.write(">") - } - else - doc.write("") -} - -function addChild(childNode) -{ - this.children[this.nChildren] = childNode - this.nChildren++ - return childNode -} - -function folderSubEntries() -{ - var i = 0 - var se = this.nChildren - - for (i=0; i < this.nChildren; i++){ - if (this.children[i].children) //is a folder - se = se + this.children[i].subEntries() - } - - return se -} - - -// Definition of class Item (a document or link inside a Folder) -// ************************************************************* - -function Item(itemDescription, tagName, itemLink) // Constructor -{ - // constant data - this.desc = itemDescription - this.tagName = tagName - this.link = itemLink - this.id = -1 //initialized in initalize() - this.navObj = 0 //initialized in render() - this.iconImg = 0 //initialized in render() - this.iconSrc = "ftv2doc.png" - - // methods - this.initialize = initializeItem - this.createIndex = createEntryIndex - this.hide = hideItem - this.display = display - this.renderOb = drawItem - this.totalHeight = totalHeight -} - -function hideItem() -{ - if (browserVersion == 1 || browserVersion == 3) { - if (this.navObj.style.display == "none") - return - this.navObj.style.display = "none" - } else { - if (this.navObj.visibility == "hidden") - return - this.navObj.visibility = "hidden" - } -} - -function initializeItem(level, lastNode, leftSide) -{ - this.createIndex() - - if (level>0) - if (lastNode) //the last 'brother' in the children array - { - this.renderOb(leftSide + "") - leftSide = leftSide + "" - } - else - { - this.renderOb(leftSide + "") - leftSide = leftSide + "" - } - else - this.renderOb("") -} - -function drawItem(leftSide) -{ - if (browserVersion == 2) - doc.write("") - if (browserVersion == 3) - doc.write("
") - - doc.write("\n\n") - doc.write("\n
") - doc.write(leftSide) - if (this.link!="") - { - doc.write("") - } - doc.write("") - if (this.link!="") - { - doc.write("") - } - doc.write("") - if (USETEXTLINKS && this.link!="") - doc.write("" + this.desc + "") - else - doc.write(this.desc) -/*! - if (this.tagName!="") - { - doc.write(" [external]"); - } -*/ - doc.write("\n
\n") - - if (browserVersion == 2) - doc.write("") - if (browserVersion == 3) - doc.write("
") - - if (browserVersion == 1) { - this.navObj = doc.all["item"+this.id] - this.iconImg = doc.all["itemIcon"+this.id] - } else if (browserVersion == 2) { - this.navObj = doc.layers["item"+this.id] - this.iconImg = this.navObj.document.images["itemIcon"+this.id] - doc.yPos=doc.yPos+this.navObj.clip.height - } else if (browserVersion == 3) { - this.navObj = doc.getElementById("item"+this.id) - this.iconImg = doc.images.namedItem("itemIcon"+this.id) - } -} - - -// Methods common to both objects (pseudo-inheritance) -// ******************************************************** - -function display() -{ - if (browserVersion == 1 || browserVersion == 3) - this.navObj.style.display = "block" - else - this.navObj.visibility = "show" -} - -function createEntryIndex() -{ - this.id = nEntries - indexOfEntries[nEntries] = this - nEntries++ -} - -// total height of subEntries open -function totalHeight() //used with browserVersion == 2 -{ - var h = this.navObj.clip.height - var i = 0 - - if (this.isOpen) //is a folder and _is_ open - for (i=0 ; i < this.nChildren; i++) - h = h + this.children[i].totalHeight() - - return h -} - - -// Events -// ********************************************************* - -function clickOnFolder(folderId) -{ - var clicked = indexOfEntries[folderId] - - if (!clicked.isOpen) - clickOnNode(folderId) - - return - - if (clicked.isSelected) - return -} - -function clickOnNode(folderId) -{ - var clickedFolder = 0 - var state = 0 - - clickedFolder = indexOfEntries[folderId] - state = clickedFolder.isOpen - - clickedFolder.setState(!state) //open<->close -} - -function initializeDocument() -{ - doc = document; - if (doc.all) - browserVersion = 1 //IE4 - else - if (doc.layers) - browserVersion = 2 //NS4 - else if(navigator.userAgent.toLowerCase().indexOf('gecko') != -1) - browserVersion = 3 //mozilla - else - browserVersion = 0 //other - - foldersTree.initialize(0, 1, "") - foldersTree.display() - - if (browserVersion > 0) - { - if(browserVersion != 3) - doc.write(" ") - - // close the whole tree - clickOnNode(0) - // open the root folder - clickOnNode(0) - } -} - -// Auxiliary Functions for Folder-Treee backward compatibility -// ********************************************************* - -function gFld(description, tagName, hreference) -{ - folder = new Folder(description, tagName, hreference) - return folder -} - -function gLnk(description, tagName, linkData) -{ - fullLink = "" - - if (linkData!="") - { - fullLink = "'"+linkData+"' target=\"basefrm\"" - } - - linkItem = new Item(description, tagName, fullLink) - return linkItem -} - -function insFld(parentFolder, childFolder) -{ - return parentFolder.addChild(childFolder) -} - -function insDoc(parentFolder, document) -{ - parentFolder.addChild(document) -} - -// Global variables -// **************** - -USETEXTLINKS = 1 -indexOfEntries = new Array -nEntries = 0 -doc = document -browserVersion = 0 -selectedFolder=0 diff --git a/idl/Makefile.in b/idl/Makefile.in deleted file mode 100644 index b032d41d..00000000 --- a/idl/Makefile.in +++ /dev/null @@ -1,68 +0,0 @@ -# -# generate dependencies for idl file : -# - -# source path -top_srcdir=@top_srcdir@ -top_builddir=.. -srcdir=@srcdir@ -VPATH=.:${KERNEL_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome - -@COMMENCE@ - -IDL_FILES = \ - VISU_Gen.idl - -PY_CLIENT_IDL = $(IDL_FILES) - -# we copy all idl file in $(top_builddir)/idl -inc: $(top_builddir)/idl/salome $(IDL_FILES:%=$(top_builddir)/idl/salome/%) - -$(top_builddir)/idl/salome: - mkdir $@ - -$(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%) -# $(CP) $< $@ - cp -f $^ $(top_builddir)/idl/salome - - -lib: pyidl - -PYTHON_BUILD_SITE=$(top_builddir)/lib/python$(PYTHON_VERSION)/site-packages/@PACKAGE@ - -pyidl: $(PYTHON_BUILD_SITE) $(IDL_FILES:%.idl=$(PYTHON_BUILD_SITE)/%_idl.py) - -$(PYTHON_BUILD_SITE): - $(INSTALL) -d $@ - -$(PYTHON_BUILD_SITE)/%_idl.py: $(top_builddir)/idl/salome/%.idl - $(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_BUILD_SITE) $< - - -# install python client (generated from idl file -install: install-pyidl install-idl - -# create directory $(idldir) and copy idl files into it -install-idl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%) - $(INSTALL) -d $(idldir) - $(INSTALL_DATA) $^ $(idldir) - - -install-pyidl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%) - $(INSTALL) -d $(PYTHON_SITE_INSTALL) - @for file in $^ dummy; do \ - if [ $$file != "dummy" ]; then \ - $(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_SITE_INSTALL) $$file ; \ - fi ; \ - done ; - -#@ CONCLUDE @ - -cleandep: - -$(RM) .dep* - -distclean: - -$(RM) *.py - -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/salome/%) - -$(RM) Makefile - diff --git a/resources/ModuleVisu.png b/resources/ModuleVisu.png deleted file mode 100644 index 7990d934..00000000 Binary files a/resources/ModuleVisu.png and /dev/null differ diff --git a/resources/VISU.config b/resources/VISU.config deleted file mode 100644 index 69253976..00000000 --- a/resources/VISU.config +++ /dev/null @@ -1 +0,0 @@ -language=en \ No newline at end of file diff --git a/resources/VISU_en.xml b/resources/VISU_en.xml deleted file mode 100644 index 4e3aedae..00000000 --- a/resources/VISU_en.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - title="Visu component" - date="24/07/2001" - author="Laurent CORNABE" - appId="Visu for Salome" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/VISU_fr.xml b/resources/VISU_fr.xml deleted file mode 100644 index b10a3084..00000000 --- a/resources/VISU_fr.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - title="Visu component" - date="24/07/2001" - author="Laurent CORNABE" - appId="Visu for Salome" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/Visu_anim.png b/resources/Visu_anim.png deleted file mode 100644 index 86a5ffb9..00000000 Binary files a/resources/Visu_anim.png and /dev/null differ diff --git a/resources/Visu_cutlines.png b/resources/Visu_cutlines.png deleted file mode 100644 index 3ae88008..00000000 Binary files a/resources/Visu_cutlines.png and /dev/null differ diff --git a/resources/Visu_cutplane.png b/resources/Visu_cutplane.png deleted file mode 100644 index 5e92cf65..00000000 Binary files a/resources/Visu_cutplane.png and /dev/null differ diff --git a/resources/Visu_deformed.png b/resources/Visu_deformed.png deleted file mode 100644 index def8c330..00000000 Binary files a/resources/Visu_deformed.png and /dev/null differ diff --git a/resources/Visu_deformed_anim.png b/resources/Visu_deformed_anim.png deleted file mode 100644 index 4cee8007..00000000 Binary files a/resources/Visu_deformed_anim.png and /dev/null differ diff --git a/resources/Visu_eraseall.png b/resources/Visu_eraseall.png deleted file mode 100644 index 9cf15188..00000000 Binary files a/resources/Visu_eraseall.png and /dev/null differ diff --git a/resources/Visu_graduated_axes.png b/resources/Visu_graduated_axes.png deleted file mode 100755 index 9c9f3d20..00000000 Binary files a/resources/Visu_graduated_axes.png and /dev/null differ diff --git a/resources/Visu_isosurfaces.png b/resources/Visu_isosurfaces.png deleted file mode 100644 index 2946029d..00000000 Binary files a/resources/Visu_isosurfaces.png and /dev/null differ diff --git a/resources/Visu_plot2d.png b/resources/Visu_plot2d.png deleted file mode 100644 index e6d2089f..00000000 Binary files a/resources/Visu_plot2d.png and /dev/null differ diff --git a/resources/Visu_plot3d.png b/resources/Visu_plot3d.png deleted file mode 100644 index ea7b5745..00000000 Binary files a/resources/Visu_plot3d.png and /dev/null differ diff --git a/resources/Visu_points.png b/resources/Visu_points.png deleted file mode 100644 index 92d535ba..00000000 Binary files a/resources/Visu_points.png and /dev/null differ diff --git a/resources/Visu_sameas.png b/resources/Visu_sameas.png deleted file mode 100644 index 3611ef44..00000000 Binary files a/resources/Visu_sameas.png and /dev/null differ diff --git a/resources/Visu_scalars.png b/resources/Visu_scalars.png deleted file mode 100644 index f048e920..00000000 Binary files a/resources/Visu_scalars.png and /dev/null differ diff --git a/resources/Visu_scalars_anim.png b/resources/Visu_scalars_anim.png deleted file mode 100644 index e6188160..00000000 Binary files a/resources/Visu_scalars_anim.png and /dev/null differ diff --git a/resources/Visu_scaling.png b/resources/Visu_scaling.png deleted file mode 100644 index 5d344363..00000000 Binary files a/resources/Visu_scaling.png and /dev/null differ diff --git a/resources/Visu_selectall.png b/resources/Visu_selectall.png deleted file mode 100644 index ec589031..00000000 Binary files a/resources/Visu_selectall.png and /dev/null differ diff --git a/resources/Visu_selectionactor.png b/resources/Visu_selectionactor.png deleted file mode 100644 index 6d6cdfbd..00000000 Binary files a/resources/Visu_selectionactor.png and /dev/null differ diff --git a/resources/Visu_selectioncell.png b/resources/Visu_selectioncell.png deleted file mode 100644 index f83268fe..00000000 Binary files a/resources/Visu_selectioncell.png and /dev/null differ diff --git a/resources/Visu_selectionedge.png b/resources/Visu_selectionedge.png deleted file mode 100644 index bd6d9df9..00000000 Binary files a/resources/Visu_selectionedge.png and /dev/null differ diff --git a/resources/Visu_selectionpoint.png b/resources/Visu_selectionpoint.png deleted file mode 100644 index 0ac7cd43..00000000 Binary files a/resources/Visu_selectionpoint.png and /dev/null differ diff --git a/resources/Visu_selectonly.png b/resources/Visu_selectonly.png deleted file mode 100644 index 3d7b24ea..00000000 Binary files a/resources/Visu_selectonly.png and /dev/null differ diff --git a/resources/Visu_streamlines.png b/resources/Visu_streamlines.png deleted file mode 100644 index 344ca199..00000000 Binary files a/resources/Visu_streamlines.png and /dev/null differ diff --git a/resources/Visu_surface.png b/resources/Visu_surface.png deleted file mode 100644 index 98de1fdb..00000000 Binary files a/resources/Visu_surface.png and /dev/null differ diff --git a/resources/Visu_tree_visu.png b/resources/Visu_tree_visu.png deleted file mode 100644 index 56ce446c..00000000 Binary files a/resources/Visu_tree_visu.png and /dev/null differ diff --git a/resources/Visu_vectors.png b/resources/Visu_vectors.png deleted file mode 100644 index caac1595..00000000 Binary files a/resources/Visu_vectors.png and /dev/null differ diff --git a/resources/Visu_wireframe.png b/resources/Visu_wireframe.png deleted file mode 100644 index 8406b9b9..00000000 Binary files a/resources/Visu_wireframe.png and /dev/null differ diff --git a/src/ENGINE/Makefile.in b/src/ENGINE/Makefile.in deleted file mode 100644 index d26a08ba..00000000 --- a/src/ENGINE/Makefile.in +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : Makefile.in -# Author : Alexey Petrov -# Module : VISU -# $Header: - -top_srcdir=@top_srcdir@ -top_builddir=../.. -srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/idl - - -@COMMENCE@ - -# Libraries targets -LIB = libVISUEngine.la -LIB_SRC = VISU_Engine_i.cc - -LIB_MOC = - -LIB_SERVER_IDL = VISU_Gen.idl SALOME_Component.idl \ - SALOME_Exception.idl SALOME_GenericObj.idl \ - SALOME_Session.idl MED.idl -LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Comm.idl - -# Executables targets -BIN = -BIN_SRC = - -BIN_CLIENT_IDL = -BIN_SERVER_IDL = - -EXPORT_HEADERS = - -# additionnal information to compil and link file -CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome - -LDFLAGS += -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeContainer - -LIBS+= - -# additional file to be cleaned -MOSTLYCLEAN = -CLEAN = -DISTCLEAN = - -@CONCLUDE@ \ No newline at end of file diff --git a/src/GUITOOLS/Makefile.in b/src/GUITOOLS/Makefile.in deleted file mode 100644 index eb8eeac4..00000000 --- a/src/GUITOOLS/Makefile.in +++ /dev/null @@ -1,66 +0,0 @@ -# VISU VISUGUI : GUI of VISU component -# -# Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -# -# -# File : Makefile.in -# Author : Marc Tajchman (CEA) -# Module : VISU -# $Header$ - -top_srcdir=@top_srcdir@ -top_builddir=../.. -srcdir=@srcdir@ -VPATH=.:@srcdir@ - -@COMMENCE@ - -# header files -EXPORT_HEADERS= \ - VisuGUI_TableDlg.h - -# .po files to transform in .qm -#PO_FILES = \ -# VISU_msg_en.po VISU_images.po - -# Libraries targets -LIB = libVISUGUITOOLS.la - -LIB_SRC = VisuGUI_TableDlg.cxx - -LIB_MOC = VisuGUI_TableDlg.h - -LIB_CLIENT_IDL = SALOME_Exception.idl - -LIB_SERVER_IDL = - -# additionnal information to compil and link file - -CPPFLAGS += -ftemplate-depth-32 $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) \ - $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QWT_INCLUDES) \ - -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) - -CXXFLAGS += -ftemplate-depth-32 $(OCC_CXXFLAGS) \ - -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome - -LDFLAGS += $(QWT_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome - -@CONCLUDE@ diff --git a/src/GUITOOLS/VisuGUI_TableDlg.cxx b/src/GUITOOLS/VisuGUI_TableDlg.cxx deleted file mode 100644 index 24443ef7..00000000 --- a/src/GUITOOLS/VisuGUI_TableDlg.cxx +++ /dev/null @@ -1,885 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_TableDlg.cxx -// Author : Vadim SANDLER -// Module : SALOME - -#include "VisuGUI_TableDlg.h" - -#include "SUIT_Tools.h" -#include "SUIT_MessageBox.h" - -#include "SALOMEDSClient_Study.hxx" -#include "SALOMEDSClient_GenericAttribute.hxx" -#include "SALOMEDSClient_AttributeTableOfInteger.hxx" -#include "SALOMEDSClient_AttributeTableOfReal.hxx" -#include "SALOMEDSClient_StudyBuilder.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include "utilities.h" -using namespace std; - -#define MARGIN_SIZE 11 -#define SPACING_SIZE 6 -#define SPACER_SIZE 5 -#define MIN_TABLE_WIDTH 200 -#define MIN_TABLE_HEIGHT 200 - - -class VisuGUI_Table : public QTable { -public: - VisuGUI_Table( Orientation orient, QWidget* parent = 0, const char* name = 0 ) - : QTable( parent, name ), myValidator( 0 ), myOrientation( orient ) {} - VisuGUI_Table( Orientation orient, int numRows, int numCols, QWidget* parent = 0, const char* name = 0 ) - : QTable( numRows, numCols, parent, name ), myValidator( 0 ), myOrientation( orient ) {} - - void setValidator( QValidator* v = 0 ) { myValidator = v; } - bool isEditing() const { return QTable::isEditing(); } - -protected: - QWidget* createEditor ( int row, int col, bool initFromCell ) const - { - bool testUnits = ( myOrientation == Horizontal && col == 0 ) || ( myOrientation == Vertical && row == 0 ); - QWidget* wg = QTable::createEditor( row, col, initFromCell ); - if ( wg && wg->inherits("QLineEdit") && myValidator && !testUnits ) - (( QLineEdit*)wg)->setValidator( myValidator ); - return wg; - } - -protected: - QValidator* myValidator; - Orientation myOrientation; -}; - -/*! - Constructor -*/ -VisuGUI_TableDlg::VisuGUI_TableDlg( QWidget* parent, - _PTR(SObject) obj, - bool edit, - int which, - Orientation orient, - bool showColumnTitles ) - : QDialog( parent, "", false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), - myIntTable( 0 ), myRealTable( 0 ) -{ - setCaption( edit ? tr( "EDIT_TABLE_TLT" ) : tr( "VIEW_TABLE_TLT" ) ); - setSizeGripEnabled( true ); - - myObject = obj; - bool bHasIntTable = false; - bool bHasRealTable = false; - if ( myObject ) { - _PTR(GenericAttribute) anAttr; - bHasIntTable = myObject->FindAttribute( anAttr, "AttributeTableOfInteger"); - bHasRealTable = myObject->FindAttribute( anAttr, "AttributeTableOfReal"); - } - - QVBoxLayout* mainLayout = new QVBoxLayout( this ); - mainLayout->setMargin( MARGIN_SIZE ); - mainLayout->setSpacing( SPACING_SIZE ); - - bool bDoInt = which == ttInt || which == ttBoth || which == ttAuto && bHasIntTable; - bool bDoReal = which == ttReal || which == ttBoth || which == ttAuto && bHasRealTable; - - QWidget* top; - QVBoxLayout* tl; - if ( bDoInt && bDoReal ) { - top = new QTabWidget( this, "TabWidget" ); - ( ( QTabWidget* ) top) ->setMargin( MARGIN_SIZE ); - } - else { - top = new QWidget( this, "DumbWidget" ); - tl = new QVBoxLayout( top ); tl->setMargin( 0 ); tl->setSpacing( SPACING_SIZE ); - } - - if ( bDoInt ) { - myIntTable = new VisuGUI_TableWidget( top, "myIntTable", edit, orient, showColumnTitles ); - myIntTable->getTable()->setValidator( new QIntValidator( this ) ); - if ( bDoInt && bDoReal ) - ( ( QTabWidget* )top )->addTab( myIntTable, tr( "TABLE_OF_INTEGER_TLT" ) ); - else - tl->addWidget( myIntTable ); - } - if ( bDoReal ) { - myRealTable = new VisuGUI_TableWidget( top, "myRealTable", edit, orient, showColumnTitles ); - myRealTable->getTable()->setValidator( new QDoubleValidator( this ) ); - if ( bDoInt && bDoReal ) - ( ( QTabWidget* )top )->addTab( myRealTable, tr( "TABLE_OF_REAL_TLT" ) ); - else - tl->addWidget( myRealTable ); - } - if ( !bDoInt && !bDoReal ) { - QLabel *dumbLabel = new QLabel( tr( "ERR_TABLE_NOT_AVAILABLE" ), top, "DumbLabel" ); - dumbLabel->setAlignment( AlignCenter ); - tl->addWidget( dumbLabel ); - } - - QHBoxLayout* btnLayout = new QHBoxLayout; - btnLayout->setMargin( 0 ); btnLayout->setSpacing( SPACING_SIZE ); - - myOKBtn = new QPushButton( tr( "BUT_OK" ), this ); - if ( edit ) { - myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this ); - btnLayout->addWidget( myOKBtn ); - btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); - btnLayout->addWidget( myCancelBtn ); - connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( onOK() ) ); - connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); - } - else { - btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); - btnLayout->addWidget( myOKBtn ); - btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); - connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); - } - - mainLayout->addWidget( top ); - mainLayout->addLayout( btnLayout ); - - initDlg(); - resize( 500, 400 ); - SUIT_Tools::centerWidget( this, parent ); -} - -/*! - Destructor -*/ -VisuGUI_TableDlg::~VisuGUI_TableDlg() -{ -} - -/*! - button slot, saves table(s) - Called only in create/edit mode ( parameter for constructor is true ) -*/ -void VisuGUI_TableDlg::onOK() -{ - myOKBtn->setFocus(); // accept possible changes - bool done = true; - - if ( myObject ) { - _PTR(Study) study = myObject->GetStudy(); - _PTR(AttributeTableOfInteger) tblIntAttr; - _PTR(AttributeTableOfReal) tblRealAttr; - - if ( study ) { - _PTR(StudyBuilder) builder = study->NewBuilder(); - builder->NewCommand(); // start transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!! - try { - if ( myIntTable ) { - builder->RemoveAttribute( myObject, "AttributeTableOfInteger" ); - tblIntAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfInteger" ); - - int i; - int nbRows = myIntTable->getNumRows(); - int nbCols = myIntTable->getNumCols(); - QString tlt = myIntTable->getTableTitle(); - QStringList rowTitles, colTitles, units; - myIntTable->getRowTitles( rowTitles ); - myIntTable->getColTitles( colTitles ); - myIntTable->getUnits( units ); - - if ( nbRows > 0) { - // data - int nRow = 0; - tblIntAttr->SetNbColumns( nbCols ); - for ( i = 0; i < nbRows; i++ ) { - QStringList data; - myIntTable->getRowData( i, data ); - bool bEmptyRow = true; - for ( int j = 0; j < data.count(); j++ ) { - if ( !data[ j ].isNull() ) { - tblIntAttr->PutValue( data[ j ].toInt(), nRow+1, j+1 ); - bEmptyRow = false; - } - } - if ( !bEmptyRow ) { // Skip rows with no data !!! - // set row title - tblIntAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : rowTitles[ i ].latin1() ); - // set row unit - tblIntAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : units[ i ].latin1() ); - nRow++; - } - } - if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!! - // column titles - for ( i = 0; i < colTitles.count(); i++ ) - tblIntAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : colTitles[ i ].latin1() ); - } - } - // title - tblIntAttr->SetTitle( myIntTable->getTableTitle().latin1() ); - } - if ( myRealTable ) { - builder->RemoveAttribute( myObject, "AttributeTableOfReal" ); - tblRealAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfReal" ); - - int i; - int nbRows = myRealTable->getNumRows(); - int nbCols = myRealTable->getNumCols(); - QString tlt = myRealTable->getTableTitle(); - QStringList rowTitles, colTitles, units; - myRealTable->getRowTitles( rowTitles ); - myRealTable->getColTitles( colTitles ); - myRealTable->getUnits( units ); - - if ( nbRows > 0) { - // data - int nRow = 0; - tblRealAttr->SetNbColumns( nbCols ); - for ( i = 0; i < nbRows; i++ ) { - QStringList data; - myRealTable->getRowData( i, data ); - bool bEmptyRow = true; - for ( int j = 0; j < data.count(); j++ ) { - if ( !data[ j ].isNull() ) { - tblRealAttr->PutValue( data[ j ].toDouble(), nRow+1, j+1 ); - bEmptyRow = false; - } - } - if ( !bEmptyRow ) { // Skip rows with no data !!! - // set row title - tblRealAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : rowTitles[ i ].latin1() ); - // set row unit - tblRealAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : units[ i ].latin1() ); - nRow++; - } - } - if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!! - // column titles - for ( i = 0; i < colTitles.count(); i++ ) - tblRealAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : colTitles[ i ].latin1() ); - } - } - // title - tblRealAttr->SetTitle( myRealTable->getTableTitle().latin1() ); - } - if ( myIntTable || myRealTable) - builder->CommitCommand(); // commit transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! - else - builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! - } - catch( ... ) { - MESSAGE("VisuGUI_TableDlg::onOK : Exception has been caught !!!"); - builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! - done = false; - SUIT_MessageBox::error1 ( this, tr("ERR_ERROR"), tr("ERR_APP_EXCEPTION"), tr ("BUT_OK") ); - } - } - } - if ( done ) - accept(); -} - -/*! - Populates table with data -*/ -void VisuGUI_TableDlg::initDlg() -{ - int i, j; - if ( myObject ) { - _PTR(GenericAttribute) anAttr; - _PTR(AttributeTableOfInteger) tblIntAttr; - _PTR(AttributeTableOfReal) tblRealAttr; - if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger") ) { - tblIntAttr = anAttr; - } - if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal") ) { - tblRealAttr = anAttr; - } - // Table of integer - if ( tblIntAttr && myIntTable ) { - try { - // title - myIntTable->setTableTitle( tblIntAttr->GetTitle().c_str() ); - // nb of rows & cols - int nbRows = tblIntAttr->GetNbRows() ; - int nbCols = tblIntAttr->GetNbColumns(); - myIntTable->setNumRows( nbRows ); - myIntTable->setNumCols( nbCols ); - // rows titles - QStringList strlist; - vector rowTitles = tblIntAttr->GetRowTitles(); - for ( i = 0; i < nbRows; i++ ) { - if ( rowTitles.size() > 0 ) - strlist.append( rowTitles[i].c_str() ); - else - strlist.append( "" ); - } - myIntTable->setRowTitles( strlist ); - // columns titles - strlist.clear(); - vector colTitles = tblIntAttr->GetColumnTitles(); - for ( i = 0; i < nbCols; i++ ) { - if ( colTitles.size() > 0 ) - strlist.append( colTitles[i].c_str() ); - else - strlist.append( "" ); - } - myIntTable->setColTitles( strlist ); - // units - strlist.clear(); - vector rowUnits = tblIntAttr->GetRowUnits(); - if ( rowUnits.size() > 0 ) { - for ( i = 0; i < nbRows; i++ ) - strlist.append( rowUnits[i].c_str() ); - myIntTable->setUnits( strlist ); - } - // data - for ( i = 1; i <= nbRows; i++ ) { - strlist.clear(); - for ( j = 1; j <= nbCols; j++ ) { - if ( tblIntAttr->HasValue( i, j ) ) - strlist.append( QString::number( tblIntAttr->GetValue( i, j ) ) ); - else - strlist.append( QString::null ); - } - myIntTable->setRowData( i-1, strlist ); - } - myIntTable->adjustTable(); - } - catch( ... ) { - MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!"); - } - } - // Table of real - if ( tblRealAttr && myRealTable ) { - try { - // title - myRealTable->setTableTitle( tblRealAttr->GetTitle().c_str() ); - // nb of rows & cols - int nbRows = tblRealAttr->GetNbRows() ; - int nbCols = tblRealAttr->GetNbColumns(); - myRealTable->setNumRows( nbRows ); - myRealTable->setNumCols( nbCols ); - // rows titles - QStringList strlist; - vector rowTitles = tblRealAttr->GetRowTitles(); - for ( i = 0; i < nbRows; i++ ) { - if ( rowTitles.size() > 0 ) - strlist.append( rowTitles[i].c_str() ); - else - strlist.append( "" ); - } - myRealTable->setRowTitles( strlist ); - // columns titles - strlist.clear(); - vector colTitles = tblRealAttr->GetColumnTitles(); - for ( i = 0; i < nbCols; i++ ) { - if ( colTitles.size() > 0 ) - strlist.append( colTitles[i].c_str() ); - else - strlist.append( "" ); - } - myRealTable->setColTitles( strlist ); - // units - strlist.clear(); - vector rowUnits = tblRealAttr->GetRowUnits(); - if ( rowUnits.size() > 0 ) { - for ( i = 0; i < nbRows; i++ ) - strlist.append( rowUnits[i].c_str() ); - myRealTable->setUnits( strlist ); - } - // data - for ( i = 1; i <= nbRows; i++ ) { - strlist.clear(); - for ( j = 1; j <= nbCols; j++ ) { - if ( tblRealAttr->HasValue( i, j ) ) - strlist.append( QString::number( tblRealAttr->GetValue( i, j ) ) ); - else - strlist.append( QString::null ); - } - myRealTable->setRowData( i-1, strlist ); - } - myRealTable->adjustTable(); - } - catch( ... ) { - MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!"); - } - } - } -} - -/*! - Constructor -*/ -VisuGUI_TableWidget::VisuGUI_TableWidget( QWidget* parent, - const char* name, - bool edit, - Orientation orient, - bool showColumnTitles ) - : QWidget( parent, name ), myOrientation( orient ) -{ - QGridLayout* mainLayout = new QGridLayout( this ); - mainLayout->setMargin( 0 ); - mainLayout->setSpacing( SPACING_SIZE ); - - myTitleEdit = new QLineEdit( this, "TitleEdit" ); - myTitleEdit->setAlignment( AlignCenter ); - myTitleEdit->setReadOnly( !edit ); - QFont fnt = myTitleEdit->font(); - fnt.setBold( true ); - myTitleEdit->setFont( fnt ); - - myTable = new VisuGUI_Table( orient, this, "Table" ); - myTable->setNumRows( 5 ); - myTable->setNumCols( 5 ); - myTable->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); - myTable->setMinimumSize( MIN_TABLE_WIDTH, MIN_TABLE_HEIGHT ); - myTable->setSelectionMode( QTable::Single ); - myTable->setShowGrid( true ); - myTable->setColumnMovingEnabled( false ); - myTable->setRowMovingEnabled( false ); - myTable->setReadOnly( !edit ); - myTable->setDragEnabled( false ); - setUnitsTitle( tr( "UNITS_TLT" ) ); - - if ( !showColumnTitles ) { - if ( myOrientation == Horizontal ) { - myTable->horizontalHeader()->hide(); - myTable->setTopMargin( 0 ); - } - else { - myTable->verticalHeader()->hide(); - myTable->setLeftMargin( 0 ); - } - } - - mainLayout->addWidget( myTitleEdit, 0, 0 ); - mainLayout->addWidget( myTable, 1, 0 ); - - if ( edit ) { - myAddRowBtn = new QPushButton( tr( "ADD_ROW_BTN" ), this, "AddRowBtn" ); - myDelRowBtn = new QPushButton( tr( "REMOVE_ROW_BTN" ), this, "DelRowBtn" ); - myAddColBtn = new QPushButton( tr( "ADD_COLUMN_BTN" ), this, "AddColBtn" ); - myDelColBtn = new QPushButton( tr( "REMOVE_COLUMN_BTN" ), this, "DelColBtn" ); - myAdjustBtn = new QPushButton( tr( "ADJUST_CELLS_BTN" ), this, "AdjustBtn" ); - mySelectAllBtn = new QPushButton( tr( "SELECT_ALL_BTN" ), this, "SelectAllBtn" ); - myClearBtn = new QPushButton( tr( "CLEAR_BTN"), this, "ClearBtn" ); - QVBoxLayout* btnLayout = new QVBoxLayout; btnLayout->setMargin( 0 ); btnLayout->setSpacing( SPACING_SIZE ); - btnLayout->addWidget( myAddRowBtn ); - btnLayout->addWidget( myDelRowBtn ); - btnLayout->addWidget( myAddColBtn ); - btnLayout->addWidget( myDelColBtn ); - btnLayout->addStretch(); - btnLayout->addWidget( myAdjustBtn ); - btnLayout->addStretch(); - btnLayout->addWidget( mySelectAllBtn ); - btnLayout->addWidget( myClearBtn ); - mainLayout->addLayout( btnLayout, 1, 1 ); - connect( myTable, SIGNAL( selectionChanged() ), this, SLOT( updateButtonsState() ) ); - connect( myTable, SIGNAL( currentChanged( int, int) ), this, SLOT( updateButtonsState() ) ); - connect( myAddRowBtn, SIGNAL( clicked() ), this, SLOT( addRow() ) ); - connect( myAddColBtn, SIGNAL( clicked() ), this, SLOT( addCol() ) ); - connect( myDelRowBtn, SIGNAL( clicked() ), this, SLOT( delRow() ) ); - connect( myDelColBtn, SIGNAL( clicked() ), this, SLOT( delCol() ) ); - connect( myAdjustBtn, SIGNAL( clicked() ), this, SLOT( adjustTable() ) ); - connect( mySelectAllBtn, SIGNAL( clicked() ), this, SLOT( selectAll() ) ); - connect( myClearBtn, SIGNAL( clicked() ), this, SLOT( clearTable() ) ); - myTable->horizontalHeader()->installEventFilter( this ); - myTable->verticalHeader()->installEventFilter( this ); - myTable->installEventFilter( this ); - } - updateButtonsState(); -} -/*! - Destructor -*/ -VisuGUI_TableWidget::~VisuGUI_TableWidget() -{ -} -/*! - Sets table title -*/ -void VisuGUI_TableWidget::setTableTitle( const QString& title ) -{ - myTitleEdit->setText( title ); -} -/*! - Gets table title -*/ -QString VisuGUI_TableWidget::getTableTitle() -{ - return myTitleEdit->text(); -} -/*! - Sets total number of rows -*/ -void VisuGUI_TableWidget::setNumRows( const int num ) -{ - myOrientation == Horizontal ? myTable->setNumRows( num ) : myTable->setNumCols( num ); -} -/*! - Gets total number of rows -*/ -int VisuGUI_TableWidget::getNumRows() -{ - return myOrientation == Horizontal ? myTable->numRows() : myTable->numCols(); -} -/*! - Sets total number of columns -*/ -void VisuGUI_TableWidget::setNumCols( const int num ) -{ - // !!! first column contains units !!! - myOrientation == Horizontal ? myTable->setNumCols( num+1 ) : myTable->setNumRows( num+1 ); -// myOrientation == Horizontal ? myTable->setColumnReadOnly( 0, true ) : myTable->setRowReadOnly( 0, true ); -} -/*! - Gets total number of columns -*/ -int VisuGUI_TableWidget::getNumCols() -{ - // !!! first column contains units !!! - return myOrientation == Horizontal ? myTable->numCols()-1 : myTable->numRows()-1; -} -/*! - Sets rows titles -*/ -void VisuGUI_TableWidget::setRowTitles( QStringList& tlts ) -{ - for ( int i = 0; i < tlts.count(); i++ ) { - myOrientation == Horizontal ? - myTable->verticalHeader()->setLabel( i, tlts[i] ) : - myTable->horizontalHeader()->setLabel( i, tlts[i] ); - } -} -/*! - Gets rows titles -*/ -void VisuGUI_TableWidget::getRowTitles( QStringList& tlts ) -{ - tlts.clear(); - if ( myOrientation == Horizontal ) { - for ( int i = 0; i < myTable->numRows(); i++ ) { - tlts.append( myTable->verticalHeader()->label( i ) ); - } - } - else { - for ( int i = 0; i < myTable->numCols(); i++ ) { - tlts.append( myTable->horizontalHeader()->label( i ) ); - } - } -} -/*! - Sets columns titles -*/ -void VisuGUI_TableWidget::setColTitles( QStringList& tlts ) -{ - // !!! first column contains units !!! - for ( int i = 0; i < tlts.count(); i++ ) { - myOrientation == Horizontal ? - myTable->horizontalHeader()->setLabel( i+1, tlts[i].isNull() ? "" : tlts[i] ) : - myTable->verticalHeader()->setLabel( i+1, tlts[i].isNull() ? "" : tlts[i] ); - } - setUnitsTitle( tr( "UNITS_TLT" ) ); -} -/*! - Sets columns titles -*/ -void VisuGUI_TableWidget::getColTitles( QStringList& tlts ) -{ - // !!! first column contains units !!! - tlts.clear(); - if ( myOrientation == Horizontal ) { - for ( int i = 1; i < myTable->numCols(); i++ ) { - tlts.append( myTable->horizontalHeader()->label( i ) ); - } - } - else { - for ( int i = 1; i < myTable->numRows(); i++ ) { - tlts.append( myTable->verticalHeader()->label( i ) ); - } - } -} -/*! - Sets units title -*/ -void VisuGUI_TableWidget::setUnitsTitle( const QString& tlt ) { - // !!! first column contains units !!! - myOrientation == Horizontal ? myTable->horizontalHeader()->setLabel( 0, tlt.isNull() ? "" : tlt ) : myTable->verticalHeader()->setLabel( 0, tlt.isNull() ? "" : tlt ); -} -/*! - Sets units -*/ -void VisuGUI_TableWidget::setUnits( QStringList& units ) -{ - for ( int i = 0; i < units.count(); i++ ) { - myOrientation == Horizontal ? myTable->setText( i, 0, units[i].isNull() ? "" : units[i] ) : myTable->setText( 0, i, units[i].isNull() ? "" : units[i] ); - } -} -/*! - Gets units -*/ -void VisuGUI_TableWidget::getUnits( QStringList& units ) -{ - units.clear(); - if ( myOrientation == Horizontal ) { - for ( int i = 0; i < myTable->numRows(); i++ ) - units.append( myTable->text( i, 0 ).isNull() ? QString("") : myTable->text( i, 0 ) ); - } - else { - for ( int i = 0; i < myTable->numCols(); i++ ) - units.append( myTable->text( 0, i ).isNull() ? QString("") : myTable->text( 0, i ) ); - } -} -/*! - Sets row data -*/ -void VisuGUI_TableWidget::setRowData( int row, QStringList& data ) -{ - if ( row >= 0 && row < getNumRows() ) { - for ( int i = 0; i < data.count(); i++ ) { - if ( data[i].isNull() ) { - myOrientation == Horizontal ? myTable->clearCell( row, i+1 ) : - myTable->clearCell( i+1, row ); - } - else { - myOrientation == Horizontal ? myTable->setText( row, i+1, data[i] ) : - myTable->setText( i+1, row, data[i] ); - } - } - } -} -/*! - Gets row data -*/ -void VisuGUI_TableWidget::getRowData( int row, QStringList& data ) -{ - data.clear(); - if ( row >= 0 && row < getNumRows() ) { - if ( myOrientation == Horizontal ) { - for ( int i = 1; i < myTable->numCols(); i++ ) - data.append( myTable->text( row, i ) ); - } - else { - for ( int i = 1; i < myTable->numRows(); i++ ) - data.append( myTable->text( i, row ) ); - } - } -} -/*! - Adjusts table cell to see contents, button slot -*/ -void VisuGUI_TableWidget::adjustTable() -{ - int i; - for ( i = 0; i < myTable->numRows(); i++ ) - myTable->adjustRow( i ); - for ( i = 0; i < myTable->numCols(); i++ ) - myTable->adjustColumn( i ); -} -/*! - Called when selection changed in table -*/ -void VisuGUI_TableWidget::updateButtonsState() -{ - if ( myTable->isReadOnly() ) - return; - bool bDR = false; // - bool bDC = false; // - bool bSA = false; // button slot -*/ -void VisuGUI_TableWidget::selectAll() -{ - myTable->clearSelection(); - QTableSelection ts; - ts.init( 0, 0 ); ts.expandTo( myTable->numRows()-1, myTable->numCols()-1 ); - myTable->addSelection( ts ); - updateButtonsState(); -} -/*! - button slot -*/ -void VisuGUI_TableWidget::clearTable() -{ - int nbSel = myTable->numSelections(); - for ( int i = 0; i < nbSel; i++ ) { - QTableSelection ts = myTable->selection( i ); - for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) { - if ( myOrientation == Vertical && j == 0 ) { -// continue; // UNITS - } - for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) { - if ( myOrientation == Horizontal && k == 0 ) { -// continue; // UNITS - } - myTable->clearCell( j, k ); - } - } - } - if ( nbSel == 0 ) - myTable->clearCell( myTable->currentRow(), myTable->currentColumn() ); - myTable->clearSelection(); - updateButtonsState(); -} -/*! - Event filter - handles titles editing -*/ -bool VisuGUI_TableWidget::eventFilter( QObject* o, QEvent* e ) -{ - if ( e->type() == QEvent::MouseButtonDblClick) { - QMouseEvent* me = ( QMouseEvent* )e; - if ( me->button() == LeftButton && !myTable->isReadOnly() ) { - if ( o == myTable->horizontalHeader() ) { - for ( int i = 0; i < myTable->horizontalHeader()->count(); i++ ) { - QRect rect = myTable->horizontalHeader()->sectionRect( i ); - rect.addCoords( 1, 1, -1, -1 ); - if ( rect.contains( myTable->horizontalHeader()->mapFromGlobal( me->globalPos() ) ) ) { - if ( myOrientation == Vertical || i != 0 ) { - bool bOk; - QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ), - tr( "TITLE_LBL" ), - QLineEdit::Normal, - myTable->horizontalHeader()->label( i ), - &bOk, - this ); - if ( bOk && !tlt.isNull() ) - myTable->horizontalHeader()->setLabel( i, tlt ); - break; - } - } - } - } - if ( o == myTable->verticalHeader() ) { - for ( int i = 0; i < myTable->verticalHeader()->count(); i++ ) { - QRect rect = myTable->verticalHeader()->sectionRect( i ); - rect.addCoords( 1, 1, -1, -1 ); - if ( rect.contains( myTable->verticalHeader()->mapFromGlobal( me->globalPos() ) ) ) { - if ( myOrientation == Horizontal || i != 0 ) { - bool bOk; - QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ), - tr( "TITLE_LBL" ), - QLineEdit::Normal, - myTable->verticalHeader()->label( i ), - &bOk, - this ); - if ( bOk && !tlt.isNull() ) - myTable->verticalHeader()->setLabel( i, tlt ); - break; - } - } - } - } - } - } - else if ( e->type() == QEvent::KeyRelease && o == myTable ) { - QKeyEvent* ke = (QKeyEvent*)e; - if ( ke->key() == Key_Delete && !myTable->isEditing() ) { - clearTable(); - } - else if ( ke->key() == Key_Backspace && !myTable->isEditing() ) { - clearTable(); - int i = myTable->currentRow(); - int j = myTable->currentColumn() - 1; - if ( j < 0 ) { j = myTable->numCols()-1; i--; } - if ( i >= 0 && j >= 0 ) - myTable->setCurrentCell( i, j ); - } - } - return QWidget::eventFilter( o, e ); -} - - - diff --git a/src/GUITOOLS/VisuGUI_TableDlg.h b/src/GUITOOLS/VisuGUI_TableDlg.h deleted file mode 100644 index 82481f9e..00000000 --- a/src/GUITOOLS/VisuGUI_TableDlg.h +++ /dev/null @@ -1,110 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_TableDlg.h -// Author : Vadim SANDLER -// Module : VISU - -#ifndef VisuGUI_TABLE_DLG_H -#define VisuGUI_TABLE_DLG_H - -#include -#include -#include - -class VisuGUI_Table; -class VisuGUI_TableWidget; - -#include - -class VisuGUI_TableDlg : public QDialog -{ - Q_OBJECT - -public: - - enum { ttNone, ttInt, ttReal, ttBoth, ttAuto }; - - VisuGUI_TableDlg( QWidget* parent, - _PTR(SObject) obj, - bool edit = false, - int which = ttAuto, - Orientation orient = Horizontal, - bool showColumnTitles = true ); - ~VisuGUI_TableDlg(); - -public slots: - void onOK(); - -private: - void initDlg(); - -private: - VisuGUI_TableWidget* myIntTable; - VisuGUI_TableWidget* myRealTable; - QPushButton* myOKBtn; - QPushButton* myCancelBtn; - - _PTR(SObject) myObject; -}; - -class VisuGUI_TableWidget : public QWidget -{ - Q_OBJECT -public: - VisuGUI_TableWidget( QWidget* parent = 0, - const char* name = 0, - bool edit = false, - Orientation orient = Horizontal, - bool showColumnTitles = true ); - ~VisuGUI_TableWidget(); - - void setTableTitle( const QString& title ); - QString getTableTitle(); - void setNumRows( const int num ); - int getNumRows(); - void setNumCols( const int num ); - int getNumCols(); - void setRowTitles( QStringList& tlts ); - void getRowTitles( QStringList& tlts ); - void setColTitles( QStringList& tlts ); - void getColTitles( QStringList& tlts ); - void setUnitsTitle( const QString& tlt ); - void setUnits( QStringList& units ); - void getUnits( QStringList& units ); - void setRowData( int row, QStringList& data ); - void getRowData( int row, QStringList& data ); - - VisuGUI_Table* getTable() { return myTable; } - QLineEdit* getTitleEdit() { return myTitleEdit; } - - bool eventFilter( QObject* o, QEvent* e); - -public slots: - void updateButtonsState(); - void addRow(); - void addCol(); - void delRow(); - void delCol(); - void adjustTable(); - void selectAll(); - void clearTable(); - -private: - QLineEdit* myTitleEdit; - VisuGUI_Table* myTable; - QPushButton* myAddRowBtn; - QPushButton* myAddColBtn; - QPushButton* myDelRowBtn; - QPushButton* myDelColBtn; - QPushButton* myAdjustBtn; - QPushButton* mySelectAllBtn; - QPushButton* myClearBtn; - Orientation myOrientation; -}; - -#endif // VisuGUI_TABLE_DLG_H - diff --git a/src/OBJECT/VISU_MeshAct.cxx b/src/OBJECT/VISU_MeshAct.cxx deleted file mode 100644 index 68f7446a..00000000 --- a/src/OBJECT/VISU_MeshAct.cxx +++ /dev/null @@ -1,389 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VISU_MeshAct.cxx -// Author : Laurent CORNABE with the help of Nicolas REJNERI -// Module : VISU -// $Header$ - -#include "VISU_MeshAct.h" -#include "VTKViewer_PassThroughFilter.h" - -#include -#include -#include - -#include -#include -#include -#include -#include - -vtkStandardNewMacro(VISU_MeshAct); - -VISU_MeshAct::VISU_MeshAct(){ - - vtkMatrix4x4 *m; - m = vtkMatrix4x4::New(); - - mySurfaceActor = VISU_Actor::New(); - mySurfaceActor->SetParent(this); - mySurfaceActor->GetProperty()->FrontfaceCullingOff(); - mySurfaceActor->GetProperty()->BackfaceCullingOff(); - mySurfaceActor->SetUserMatrix(m); - mySurfaceActor->SetRepresentation(2); //SURFACE - - myEdgeActor = VISU_Actor::New(); - myEdgeActor->SetParent(this); - myEdgeActor->PickableOff(); - myEdgeActor->GetProperty()->FrontfaceCullingOff(); - myEdgeActor->GetProperty()->BackfaceCullingOff(); - myEdgeActor->SetUserMatrix(m); - myEdgeActor->SetRepresentation(1); //WIREFRAME - - myNodeActor = VISU_Actor::New(); - myNodeActor->SetParent(this); - myNodeActor->PickableOff(); - myNodeActor->GetProperty()->SetPointSize(SALOME_POINT_SIZE); - myNodeActor->GetProperty()->FrontfaceCullingOff(); - myNodeActor->GetProperty()->BackfaceCullingOff(); - myNodeActor->SetUserMatrix(m); - myNodeActor->SetRepresentation(0); //POINT - - m->Delete(); - SetRepresentation(2); //SURFACE -} - -VISU_MeshAct::~VISU_MeshAct(){ - mySurfaceActor->Delete(); - myEdgeActor->Delete(); - myNodeActor->Delete(); -} - -void VISU_MeshAct::setIO(const Handle(SALOME_InteractiveObject)& theIO){ - VISU_Actor::setIO(theIO); - mySurfaceActor->setIO(theIO); - myEdgeActor->setIO(theIO); - myNodeActor->setIO(theIO); -} - -void VISU_MeshAct::SetPrs3d(VISU::Prs3d_i* thePrs3d){ - if(thePrs3d){ - VISU_Actor::SetPrs3d(thePrs3d); - mySurfaceActor->SetPrs3d(thePrs3d); - myEdgeActor->SetPrs3d(thePrs3d); - myNodeActor->SetPrs3d(thePrs3d); - } -} - -void VISU_MeshAct::AddToRender(vtkRenderer* theRenderer){ - VISU_Actor::AddToRender(theRenderer); - theRenderer->AddActor(myEdgeActor); -} - -void VISU_MeshAct::RemoveFromRender(vtkRenderer* theRenderer){ - VISU_Actor::RemoveFromRender(theRenderer); - theRenderer->RemoveActor(myEdgeActor); -} - -void VISU_MeshAct::SetPipeLine(VISU_PipeLine* thePipeLine) { - VISU_Actor::SetPipeLine(thePipeLine); - mySurfaceActor->SetPipeLine(thePipeLine); - myEdgeActor->SetPipeLine(thePipeLine); - myNodeActor->SetPipeLine(thePipeLine); -} - -void VISU_MeshAct::SetTransform(VTKViewer_Transform* theTransform){ - VISU_Actor::SetTransform(theTransform); - mySurfaceActor->SetTransform(theTransform); - myEdgeActor->SetTransform(theTransform); - myNodeActor->SetTransform(theTransform); -} - -void VISU_MeshAct::SetShrinkable(bool theIsShrinkable){ - VISU_Actor::SetShrinkable(theIsShrinkable); - mySurfaceActor->SetShrinkable(theIsShrinkable); - myEdgeActor->SetShrinkable(theIsShrinkable); - myNodeActor->SetShrinkable(theIsShrinkable); -} - -void VISU_MeshAct::SetShrinkFactor(float theValue){ - VISU_Actor::SetShrinkFactor(theValue); - mySurfaceActor->SetShrinkFactor(theValue); - myEdgeActor->SetShrinkFactor(theValue); -} - -vtkProperty* VISU_MeshAct::GetSurfaceProperty(){ - return mySurfaceActor->GetProperty(); -} - -void VISU_MeshAct::SetSurfaceProperty(vtkProperty* theProperty){ - mySurfaceActor->SetProperty(theProperty); -} - -vtkProperty* VISU_MeshAct::GetEdgeProperty(){ - return myEdgeActor->GetProperty(); -} - -void VISU_MeshAct::SetEdgeProperty(vtkProperty* theProperty){ - myEdgeActor->SetProperty(theProperty); -} - -vtkProperty* VISU_MeshAct::GetNodeProperty(){ - return myNodeActor->GetProperty(); -} - -void VISU_MeshAct::SetNodeProperty(vtkProperty* theProperty){ - myNodeActor->SetProperty(theProperty); -} - -void VISU_MeshAct::SetOpacity(float theValue){ - GetSurfaceProperty()->SetOpacity(theValue); -} - -float VISU_MeshAct::GetOpacity(){ - return GetSurfaceProperty()->GetOpacity(); -} - -void VISU_MeshAct::SetLineWidth(float theLineWidth){ - GetEdgeProperty()->SetLineWidth(theLineWidth); -} - -float VISU_MeshAct::GetLineWidth(){ - return GetEdgeProperty()->GetLineWidth(); -} - -void VISU_MeshAct::SetShrink(){ - if(myRepresentation == VTK_POINTS) - return; - VISU_Actor::SetShrink(); - mySurfaceActor->SetShrink(); - myEdgeActor->SetShrink(); - //SetRepresentation(GetRepresentation()); -} - -void VISU_MeshAct::UnShrink(){ - VISU_Actor::UnShrink(); - mySurfaceActor->UnShrink(); - myEdgeActor->UnShrink(); - //SetRepresentation(GetRepresentation()); -} - -void VISU_MeshAct::SetRepresentation(int theMode) -{ - SALOME_Actor::SetRepresentation(theMode); - - if (!GetVisibility()) return; // Fix IPAL9555 - - mySurfaceActor->VisibilityOff(); - myEdgeActor->VisibilityOff(); - myNodeActor->VisibilityOff(); - myEdgeActor->PickableOff(); - myNodeActor->PickableOff(); - switch (theMode) { - case VTK_POINTS: - myNodeActor->VisibilityOn(); - myNodeActor->PickableOn(); - break; - case VTK_WIREFRAME: - myEdgeActor->VisibilityOn(); - myEdgeActor->SetRepresentation(1); - myEdgeActor->PickableOn(); - break; - case VTK_SURFACE: - mySurfaceActor->VisibilityOn(); - break; - case 3: //INSIDEFRAME - myEdgeActor->VisibilityOn(); - myEdgeActor->SetRepresentation(3); - myEdgeActor->PickableOn(); - break; - case 4: //SURFACEFRAME - myEdgeActor->VisibilityOn(); - myEdgeActor->SetRepresentation(1); - mySurfaceActor->VisibilityOn(); - break; - } - if (myRepresentation == VTK_POINTS) - UnShrink(); -} - -void VISU_MeshAct::SetVisibility(int theMode){ - VISU_Actor::SetVisibility(theMode); - if(GetVisibility()) - SetRepresentation(GetRepresentation()); - else{ - myNodeActor->VisibilityOff(); - myEdgeActor->VisibilityOff(); - mySurfaceActor->VisibilityOff(); - } -} - -// From vtkLODActor -void VISU_MeshAct::Render(vtkRenderer *ren, vtkMapper *vtkNotUsed(m)) -{ - float myTime, bestTime, tempTime; - vtkMatrix4x4 *matrix; - vtkMapper *mapper, *bestMapper; - - if (this->Mapper == NULL) - { - vtkErrorMacro("No mapper for actor."); - return; - } - - // first time through create lods if non have been added - if (this->LODMappers->GetNumberOfItems() == 0) - { - this->CreateOwnLODs(); - } - - // If the actor has changed or the primary mapper has changed ... - // Is this the correct test? - if (this->MediumMapper) - { - if (this->GetMTime() > this->BuildTime || - this->Mapper->GetMTime() > this->BuildTime) - { - this->UpdateOwnLODs(); - } - } - - // figure out how much time we have to render - myTime = this->AllocatedRenderTime; - - // Figure out which resolution to use - // none is a valid resolution. Do we want to have a lowest: - // bbox, single point, ... - // There is no order to the list, so it is assumed that mappers that take - // longer to render are better quality. - // Timings might become out of date, but we rely on - - bestMapper = this->Mapper; - bestTime = bestMapper->GetTimeToDraw(); - if (bestTime > myTime) - { - this->LODMappers->InitTraversal(); - while ((mapper = this->LODMappers->GetNextItem()) != NULL && - bestTime != 0.0) - { - tempTime = mapper->GetTimeToDraw(); - - // If the LOD has never been rendered, select it! - if (tempTime == 0.0) - { - bestMapper = mapper; - bestTime = 0.0; - } - else - { - if (bestTime > myTime && tempTime < bestTime) - { - bestMapper = mapper; - bestTime = tempTime; - } - if (tempTime > bestTime && tempTime < myTime) - { - bestMapper = mapper; - bestTime = tempTime; - } - } - } - } - - switch(GetRepresentation()){ - case 0: //POINTS - myNodeActor->GetProperty()->Render(this, ren); - break; - case 1: //WIREFRAME - //PAL5268: myEdgeActor->GetProperty()->Render(this, ren); - break; - case 2: //SURFACE - mySurfaceActor->GetProperty()->Render(this, ren); - break; - case 3: //INSIDEFRAME - //PAL5268: myEdgeActor->GetProperty()->Render(this, ren); - break; - case 4: //SURFACEFRAME - //PAL5268: myEdgeActor->GetProperty()->Render(this, ren); - mySurfaceActor->GetProperty()->Render(this, ren); - break; - } - - // render the texture - if (this->Texture) - { - this->Texture->Render(ren); - } - - switch(GetRepresentation()){ - case 0: //POINTS - matrix = myNodeActor->GetUserMatrix(); - break; - case 1: //WIREFRAME - matrix = myEdgeActor->GetUserMatrix(); - break; - case 2: //SURFACE - matrix = mySurfaceActor->GetUserMatrix(); - break; - case 3: //INSIDEFRAME - matrix = myEdgeActor->GetUserMatrix(); - break; - case 4: //SURFACEFRAME - matrix = myEdgeActor->GetUserMatrix(); - this->GetMatrix(matrix); - matrix = mySurfaceActor->GetUserMatrix(); - break; - } - this->GetMatrix(matrix); - - switch(GetRepresentation()){ - case 0: //POINTS - myNodeActor->Render(ren,bestMapper); - break; - case 1: //WIREFRAME - //PAL5268: myEdgeActor->Render(ren,bestMapper); - break; - case 2: //SURFACE - mySurfaceActor->Render(ren,bestMapper); - break; - case 3: //INSIDEFRAME - //PAL5268: myEdgeActor->Render(ren,bestMapper); - break; - case 4: //SURFACEFRAME - //PAL5268: myEdgeActor->Render(ren,bestMapper); - mySurfaceActor->Render(ren,bestMapper); - break; - } - - this->EstimatedRenderTime = bestMapper->GetTimeToDraw(); -} - -// From vtkLODActor -void VISU_MeshAct::Modified() -{ - myNodeActor->Modified(); - //PAL5268: myEdgeActor->Modified(); - mySurfaceActor->Modified(); - this->vtkActor::Modified(); -} diff --git a/src/OBJECT/VISU_MeshAct.h b/src/OBJECT/VISU_MeshAct.h deleted file mode 100644 index bacc15c3..00000000 --- a/src/OBJECT/VISU_MeshAct.h +++ /dev/null @@ -1,83 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VISU_MeshAct.h -// Author : Laurent CORNABE with the help of Nicolas REJNERI -// Module : VISU -// $Header$ - -#ifndef VISU_MeshAct_HeaderFile -#define VISU_MeshAct_HeaderFile - -#include "VISU_Actor.h" -class vtkDataSetMapper; - -class VTKOCC_EXPORT VISU_MeshAct : public VISU_Actor { - public: - vtkTypeMacro(VISU_MeshAct,VISU_Actor); - static VISU_MeshAct* New(); - ~VISU_MeshAct(); - - virtual void setIO(const Handle(SALOME_InteractiveObject)& theIO); - virtual void SetPrs3d(VISU::Prs3d_i* thePrs3d); - - virtual void AddToRender(vtkRenderer* theRenderer); - virtual void RemoveFromRender(vtkRenderer* theRenderer); - - virtual void SetPipeLine(VISU_PipeLine* thePipeLine) ; - virtual void SetTransform(VTKViewer_Transform* theTransform); - - virtual vtkProperty* GetSurfaceProperty(); - virtual void SetSurfaceProperty(vtkProperty* theProperty); - - virtual vtkProperty* GetEdgeProperty(); - virtual void SetEdgeProperty(vtkProperty* theProperty); - - virtual vtkProperty* GetNodeProperty(); - virtual void SetNodeProperty(vtkProperty* theProperty); - - virtual void SetOpacity(float theValue); - virtual float GetOpacity(); - - virtual void SetLineWidth(float theLineWidth); - virtual float GetLineWidth(); - - virtual void SetRepresentation(int theMode); - - virtual void SetVisibility(int theMode); - - virtual void SetShrinkable(bool theIsShrinkable); - virtual void SetShrinkFactor(float theFactor = 0.8); - - virtual void SetShrink(); - virtual void UnShrink(); - - virtual void Render(vtkRenderer *, vtkMapper *); - void Modified(); - - protected: - VISU_MeshAct(); - VISU_Actor *mySurfaceActor, *myEdgeActor, *myNodeActor; -}; - -#endif diff --git a/src/OBJECT/VISU_ScalarMapAct.cxx b/src/OBJECT/VISU_ScalarMapAct.cxx deleted file mode 100644 index 01449f79..00000000 --- a/src/OBJECT/VISU_ScalarMapAct.cxx +++ /dev/null @@ -1,80 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VISU_MeshAct.hxx -// Author : Laurent CORNABE with the help of Nicolas REJNERI -// Module : VISU -// $Header$ - -#include "VISU_ScalarMapAct.h" -#include "VISU_LookupTable.hxx" -#include "VISU_ScalarBarActor.hxx" - -#include -#include - -vtkStandardNewMacro(VISU_ScalarMapAct); - -VISU_ScalarMapAct::VISU_ScalarMapAct(){ - myScalarBar = VISU_ScalarBarActor::New(); - - vtkProperty* aProperty = GetProperty(); - //aProperty->SetAmbient(0.5); - //aProperty->SetDiffuse(0.2); - //aProperty->SetSpecular(0.2); - aProperty->SetAmbient(1.0); - aProperty->SetDiffuse(0.0); - aProperty->SetSpecular(0.0); - - myProperty->DeepCopy(aProperty); -} - -VISU_ScalarMapAct::~VISU_ScalarMapAct(){ - myScalarBar->Delete(); -} - -void VISU_ScalarMapAct::AddToRender(vtkRenderer* theRenderer){ - SALOME_Actor::AddToRender(theRenderer); - if(myScalarBar) - theRenderer->AddActor2D(myScalarBar); -} - -void VISU_ScalarMapAct::RemoveFromRender(vtkRenderer* theRenderer){ - SALOME_Actor::RemoveFromRender(theRenderer); - if(myScalarBar) - theRenderer->RemoveActor(myScalarBar); -} - -void VISU_ScalarMapAct::SetVisibility(int theMode){ - SALOME_Actor::SetVisibility(theMode); - if(myScalarBar) myScalarBar->SetVisibility(myBarVisibility && theMode); -} - -int VISU_ScalarMapAct::GetVisibility(){ - return SALOME_Actor::GetVisibility(); -} - -void VISU_ScalarMapAct::SetBarVisibility(bool theMode){ - myBarVisibility = theMode; - if(myScalarBar) myScalarBar->SetVisibility(myBarVisibility); -} diff --git a/src/OBJECT/VISU_VectorsAct.cxx b/src/OBJECT/VISU_VectorsAct.cxx deleted file mode 100644 index 4cb16c27..00000000 --- a/src/OBJECT/VISU_VectorsAct.cxx +++ /dev/null @@ -1,82 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VISU_VectorsAct.cxx -// Author : Laurent CORNABE with help of Nicolas REJNERI -// Module : VISU -// $Header$ - -#include "VISU_VectorsAct.h" -#include "VISU_VectorsPL.hxx" -#include "VTKViewer_PassThroughFilter.h" - -// VTK Includes -#include -#include -#include -#include - -using namespace std; - -//======================================================================= - -vtkStandardNewMacro(VISU_VectorsAct); - - -VISU_VectorsAct::VISU_VectorsAct(){} - - -VISU_VectorsAct::~VISU_VectorsAct(){} - - -void VISU_VectorsAct::SetPipeLine(VISU_PipeLine* thePipeLine) { - if((myPipeLine = dynamic_cast(thePipeLine))){ - VISU_Actor::SetPipeLine(myPipeLine); - myPipeLine->Delete(); - } -} - - -void VISU_VectorsAct::SetTransform(VTKViewer_Transform* theTransform){ - myPipeLine->SetTransform(theTransform); - Modified(); -} - - -void VISU_VectorsAct::SetMapper(vtkMapper* theMapper){ - if(theMapper){ - myPassFilter[0]->SetInput(theMapper->GetInput()); - myPassFilter[0]->Update(); - myPassFilter[1]->SetInput(myPassFilter[0]->GetPolyDataOutput()); - myPassFilter[1]->Update(); - myPassFilter[2]->SetInput(myPassFilter[1]->GetPolyDataOutput()); - myPassFilter[2]->Update(); - myPassFilter[3]->SetInput(myPassFilter[2]->GetPolyDataOutput()); - myPassFilter[3]->Update(); - if(vtkDataSetMapper* aMapper = dynamic_cast(theMapper)) - aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput()); - else if(vtkPolyDataMapper* aMapper = dynamic_cast(theMapper)) - aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput()); - } - vtkLODActor::SetMapper(theMapper); -} diff --git a/src/OBJECT/VISU_VectorsAct.h b/src/OBJECT/VISU_VectorsAct.h deleted file mode 100644 index ae5bc694..00000000 --- a/src/OBJECT/VISU_VectorsAct.h +++ /dev/null @@ -1,55 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VISU_VectorsAct.h -// Author : Laurent CORNABE with help of Nicolas REJNERI -// Module : VISU -// $Header$ - -#ifndef VISU_VectorsAct_HeaderFile -#define VISU_VectorsAct_HeaderFile - -#include "VISU_ScalarMapAct.h" - -class VTKViewer_Transform; -class VISU_VectorsPL; - -class VTKOCC_EXPORT VISU_VectorsAct : public VISU_ScalarMapAct { - public: - vtkTypeMacro(VISU_VectorsAct,VISU_ScalarMapAct); - static VISU_VectorsAct* New(); - ~VISU_VectorsAct(); - - virtual void SetPipeLine(VISU_PipeLine* thePipeLine); - - virtual void SetTransform(VTKViewer_Transform* theTransform); - - virtual void SetMapper(vtkMapper* theMapper); - - protected: - VISU_VectorsAct(); - - VISU_VectorsPL* myPipeLine; -}; - -#endif diff --git a/src/PIPELINE/SALOME_ExtractGeometry.cxx b/src/PIPELINE/SALOME_ExtractGeometry.cxx deleted file mode 100755 index 13655093..00000000 --- a/src/PIPELINE/SALOME_ExtractGeometry.cxx +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org - - -#include "SALOME_ExtractGeometry.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -using namespace std; - -#if defined __GNUC__ - #if __GNUC__ == 2 - #define __GNUC_2__ - #endif -#endif - - -vtkStandardNewMacro(SALOME_ExtractGeometry); - - -SALOME_ExtractGeometry::SALOME_ExtractGeometry() -{} - -SALOME_ExtractGeometry::~SALOME_ExtractGeometry() -{} - -vtkIdType SALOME_ExtractGeometry::GetElemObjId(int theVtkID) -{ - if (myElemVTK2ObjIds.empty()) - return theVtkID; - - if (theVtkID < 0 || myElemVTK2ObjIds.size() <= theVtkID) - return -1; - -#if defined __GNUC_2__ - return myElemVTK2ObjIds[theVtkID]; -#else - return myElemVTK2ObjIds.at(theVtkID); -#endif -} - - -vtkIdType SALOME_ExtractGeometry::GetNodeObjId(int theVtkID) -{ - if (myNodeVTK2ObjIds.empty()) - return theVtkID; - - if (theVtkID < 0 || myNodeVTK2ObjIds.size() <= theVtkID) - return -1; - -#if defined __GNUC_2__ - return myNodeVTK2ObjIds[theVtkID]; -#else - return myNodeVTK2ObjIds.at(theVtkID); -#endif -} - - -void SALOME_ExtractGeometry::SetImplicitBoolean(vtkImplicitBoolean* theImplicitBoolean) -{ - myImplicitBoolean = theImplicitBoolean; - SetImplicitFunction(theImplicitBoolean); -} - - -void SALOME_ExtractGeometry::SetStoreMapping(bool theStoreMapping) -{ - myStoreMapping = theStoreMapping; - Modified(); -} - - -void SALOME_ExtractGeometry::Execute() -{ - if(myImplicitBoolean.GetPointer()){ - if(vtkImplicitFunctionCollection* aFunction = myImplicitBoolean->GetFunction()){ - if(aFunction->GetNumberOfItems() == 0){ - myElemVTK2ObjIds.clear(); - myNodeVTK2ObjIds.clear(); - - vtkDebugMacro(<< "Extracting geometry - ShallowCopy"); - GetOutput()->ShallowCopy(GetInput()); - Modified(); - return; - } - } - } - Execute2(); -} - -void SALOME_ExtractGeometry::Execute2() -{ - vtkIdType ptId, numPts, numCells, i, cellId, newCellId, newId, *pointMap; - vtkIdList *cellPts; - vtkCell *cell; - int numCellPts; - float *x; - float multiplier; - vtkPoints *newPts; - vtkIdList *newCellPts; - vtkDataSet *input = this->GetInput(); - vtkPointData *pd = input->GetPointData(); - vtkCellData *cd = input->GetCellData(); - vtkUnstructuredGrid *output = this->GetOutput(); - vtkPointData *outputPD = output->GetPointData(); - vtkCellData *outputCD = output->GetCellData(); - int npts; - numCells = input->GetNumberOfCells(); - numPts = input->GetNumberOfPoints(); - - vtkDebugMacro(<< "Extracting geometry"); - - if ( ! this->ImplicitFunction ) - { - vtkErrorMacro(<<"No implicit function specified"); - return; - } - - newCellPts = vtkIdList::New(); - newCellPts->Allocate(VTK_CELL_SIZE); - - if ( this->ExtractInside ) - { - multiplier = 1.0; - } - else - { - multiplier = -1.0; - } - - // Loop over all points determining whether they are inside the - // implicit function. Copy the points and point data if they are. - // - pointMap = new vtkIdType[numPts]; // maps old point ids into new - for (i=0; i < numPts; i++) - { - pointMap[i] = -1; - } - - output->Allocate(numCells/4); //allocate storage for geometry/topology - newPts = vtkPoints::New(); - newPts->Allocate(numPts/4,numPts); - outputPD->CopyAllocate(pd); - outputCD->CopyAllocate(cd); - vtkFloatArray *newScalars = NULL; - - if(myStoreMapping){ - myElemVTK2ObjIds.clear(); - myElemVTK2ObjIds.reserve(numCells); - myNodeVTK2ObjIds.clear(); - myNodeVTK2ObjIds.reserve(numPts); - } - - if ( ! this->ExtractBoundaryCells ) - { - for ( ptId=0; ptId < numPts; ptId++ ) - { - x = input->GetPoint(ptId); - if ( (this->ImplicitFunction->FunctionValue(x)*multiplier) < 0.0 ) - { - newId = newPts->InsertNextPoint(x); - pointMap[ptId] = newId; - myNodeVTK2ObjIds.push_back(ptId); - outputPD->CopyData(pd,ptId,newId); - } - } - } - else - { - // To extract boundary cells, we have to create supplemental information - if ( this->ExtractBoundaryCells ) - { - float val; - newScalars = vtkFloatArray::New(); - newScalars->SetNumberOfValues(numPts); - - for (ptId=0; ptId < numPts; ptId++ ) - { - x = input->GetPoint(ptId); - val = this->ImplicitFunction->FunctionValue(x) * multiplier; - newScalars->SetValue(ptId, val); - if ( val < 0.0 ) - { - newId = newPts->InsertNextPoint(x); - pointMap[ptId] = newId; - myNodeVTK2ObjIds.push_back(ptId); - outputPD->CopyData(pd,ptId,newId); - } - } - } - } - - // Now loop over all cells to see whether they are inside implicit - // function (or on boundary if ExtractBoundaryCells is on). - // - for (cellId=0; cellId < numCells; cellId++) - { - cell = input->GetCell(cellId); - cellPts = cell->GetPointIds(); - numCellPts = cell->GetNumberOfPoints(); - - newCellPts->Reset(); - if ( ! this->ExtractBoundaryCells ) //requires less work - { - for ( npts=0, i=0; i < numCellPts; i++, npts++) - { - ptId = cellPts->GetId(i); - if ( pointMap[ptId] < 0 ) - { - break; //this cell won't be inserted - } - else - { - newCellPts->InsertId(i,pointMap[ptId]); - } - } - } //if don't want to extract boundary cells - - else //want boundary cells - { - for ( npts=0, i=0; i < numCellPts; i++ ) - { - ptId = cellPts->GetId(i); - if ( newScalars->GetValue(ptId) <= 0.0 ) - { - npts++; - } - } - if ( npts > 0 ) - { - for ( i=0; i < numCellPts; i++ ) - { - ptId = cellPts->GetId(i); - if ( pointMap[ptId] < 0 ) - { - x = input->GetPoint(ptId); - newId = newPts->InsertNextPoint(x); - pointMap[ptId] = newId; - myNodeVTK2ObjIds.push_back(ptId); - outputPD->CopyData(pd,ptId,newId); - } - newCellPts->InsertId(i,pointMap[ptId]); - } - }//a boundary or interior cell - }//if mapping boundary cells - - if ( npts >= numCellPts || (this->ExtractBoundaryCells && npts > 0) ) - { - newCellId = output->InsertNextCell(cell->GetCellType(),newCellPts); - myElemVTK2ObjIds.push_back(cellId); - outputCD->CopyData(cd,cellId,newCellId); - } - }//for all cells - - // Update ourselves and release memory - // - delete [] pointMap; - newCellPts->Delete(); - output->SetPoints(newPts); - newPts->Delete(); - - if ( this->ExtractBoundaryCells ) - { - newScalars->Delete(); - } - - output->Squeeze(); -} diff --git a/src/PIPELINE/SALOME_ExtractGeometry.h b/src/PIPELINE/SALOME_ExtractGeometry.h deleted file mode 100755 index 74c1ec30..00000000 --- a/src/PIPELINE/SALOME_ExtractGeometry.h +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org - -#ifndef SALOME_ExtractGeometry_H -#define SALOME_ExtractGeometry_H - -#include -#include -#include - -#include - -//class vtkImplicitBoolean; - -class SALOME_ExtractGeometry : public vtkExtractGeometry -{ -public: - vtkTypeMacro(SALOME_ExtractGeometry,vtkExtractGeometry); - - static SALOME_ExtractGeometry *New(); - - void SetImplicitBoolean(vtkImplicitBoolean* theImplicitBoolean); - vtkImplicitBoolean* GetImplicitBoolean() const { - return myImplicitBoolean.GetPointer(); - } - - void SetStoreMapping(bool theStoreMapping); - bool GetStoreMapping() const { - return myStoreMapping; - } - - virtual vtkIdType GetNodeObjId(int theID); - virtual vtkIdType GetElemObjId(int theID); - -protected: - SALOME_ExtractGeometry(); - ~SALOME_ExtractGeometry(); - - virtual void Execute(); - void Execute2(); - -private: - bool myStoreMapping; - typedef std::vector TVectorId; - TVectorId myElemVTK2ObjIds; - TVectorId myNodeVTK2ObjIds; - - vtkSmartPointer myImplicitBoolean; - - SALOME_ExtractGeometry(const SALOME_ExtractGeometry&); // Not implemented. - void operator=(const SALOME_ExtractGeometry&); // Not implemented. -}; - -#endif diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx deleted file mode 100644 index 2207f492..00000000 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ /dev/null @@ -1,133 +0,0 @@ -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.cxx -// Author: Alexey PETROV -// Module : VISU - - -#include "VISU_CutLinesPL.hxx" -#include "VISU_PipeLineUtils.hxx" -#include "VTKViewer_GeometryFilter.h" - -#include - -using namespace std; - -vtkStandardNewMacro(VISU_CutLinesPL); - -VISU_CutLinesPL::VISU_CutLinesPL(){} - -void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_CutPlanesPL::ShallowCopy(thePipeLine); - if(VISU_CutLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ - SetOrientation(aPipeLine->GetPlaneOrientation(1), - aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1); - SetDisplacement(aPipeLine->GetDisplacement(1),1); - SetDefault(); - if (!aPipeLine->IsDefault()) SetPosition(aPipeLine->GetPosition()); - } -} - -void VISU_CutLinesPL::Init(){ - VISU_CutPlanesPL::Init(); - - myBasePlane[0] = XY; - myBasePlane[1] = YZ; - myDisplacement[0] = myDisplacement[1] = 0.5; - myAng[0][0] = myAng[0][1] = myAng[0][2] = 0.0; - myAng[1][0] = myAng[1][1] = myAng[1][2] = 0.0; - - myCondition = 1; - myPosition = 0; -} - - -void VISU_CutLinesPL::SetPosition(float thePosition){ - myPosition = thePosition; - myCondition = 0; - Modified(); -} -float VISU_CutLinesPL::GetPosition(){ - float aPosition = myPosition; - if(myCondition){ - float aDir[3], aBounds[6], aBoundPrj[3]; - GetInput2()->GetBounds(aBounds); - GetDir(aDir,myAng[0],myBasePlane[0]); - GetBoundProject(aBoundPrj,aBounds,aDir); - aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[0]; - } - return aPosition; -} - -void VISU_CutLinesPL::SetDefault(){ - myCondition = 1; - Modified(); -} -int VISU_CutLinesPL::IsDefault(){ - return myCondition; -} - - -void VISU_CutLinesPL::Update(){ - ClearAppendPolyData(myAppendPolyData); - SetPartPosition(1); - vtkAppendPolyData *anAppendPolyData = vtkAppendPolyData::New(); - //Build base plane - float aDir[2][3], aBaseBounds[6]; - GetInput2()->GetBounds(aBaseBounds); - GetDir(aDir[0],myAng[0],myBasePlane[0]); - vtkUnstructuredGrid* anUnstructuredGrid = - myFieldTransform->GetUnstructuredGridOutput(); - CutWithPlanes(anAppendPolyData,anUnstructuredGrid,1,aDir[0],aBaseBounds, - myPosition,myCondition,myDisplacement[0]); - //Build lines - float aBounds[6]; - vtkDataSet *aDataSet = anAppendPolyData->GetOutput(); - aDataSet->Update(); - if(aDataSet->GetNumberOfCells() == 0) - aDataSet = anUnstructuredGrid; - aDataSet->GetBounds(aBounds); - GetDir(aDir[1],myAng[1],myBasePlane[1]); - VISU_CutPlanesPL::CutWithPlanes(myAppendPolyData,aDataSet,GetNbParts(),aDir[1],aBounds, - myPartPosition,myPartCondition,myDisplacement[1]); - anAppendPolyData->Register(myAppendPolyData); - anAppendPolyData->Delete(); - //Calculate values for building of table - vtkMath::Cross(aDir[0],aDir[1],myDirLn); - GetBoundProject(myBoundPrjLn, aBaseBounds, myDirLn); - VISU::Mul(myDirLn,myBoundPrjLn[0],myBasePnt); - CorrectPnt(myBasePnt,aBaseBounds); - - VISU_ScalarMapPL::Update(); -} - - -void VISU_CutLinesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - float thePartPosition, int thePartCondition, - float theDisplacement) -{ - vector aPartPosition(1,thePartPosition); - vector aPartCondition(1,thePartCondition); - VISU_CutPlanesPL::CutWithPlanes(theAppendPolyData,theDataSet,theNbPlanes,theDir,theBounds, - aPartPosition,aPartCondition,theDisplacement); -} diff --git a/src/PIPELINE/VISU_CutLinesPL.hxx b/src/PIPELINE/VISU_CutLinesPL.hxx deleted file mode 100644 index cc316781..00000000 --- a/src/PIPELINE/VISU_CutLinesPL.hxx +++ /dev/null @@ -1,69 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.hxx -// Author: Alexey PETROV -// Module : VISU - -#ifndef VISU_CutLinesPL_HeaderFile -#define VISU_CutLinesPL_HeaderFile - -#include "VISU_CutPlanesPL.hxx" - -class vtkAppendPolyData; - -class VISU_CutLinesPL : public VISU_CutPlanesPL{ -protected: - VISU_CutLinesPL(); - VISU_CutLinesPL(const VISU_CutLinesPL&); -public: - vtkTypeMacro(VISU_CutLinesPL,VISU_CutPlanesPL); - static VISU_CutLinesPL* New(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - - virtual void SetPosition(float thePosition); - virtual float GetPosition(); - - virtual void SetDefault(); - virtual int IsDefault(); - -public: - virtual void Init(); - virtual void Update(); - - static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - float thePlanePosition, int thePlaneCondition, - float theDisplacement); - - const float* GetDirLn(){ return myDirLn;} - const float* GetBoundPrjLn(){ return myBoundPrjLn;} - const float* GetBasePnt(){ return myBasePnt;} - -protected: - float myDirLn[3], myBoundPrjLn[3], myBasePnt[3]; - float myPosition; - int myCondition; -}; - - -#endif diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx deleted file mode 100644 index 32fb5612..00000000 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ /dev/null @@ -1,321 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.cxx -// Author: Alexey PETROV -// Module : VISU - - -#include "VISU_CutPlanesPL.hxx" -#include "VISU_PipeLineUtils.hxx" -#include "VTKViewer_GeometryFilter.h" - -#include -#include -#include - -using namespace std; - -static float EPS = 1.0E-3; - -vtkStandardNewMacro(VISU_CutPlanesPL); - -VISU_CutPlanesPL::VISU_CutPlanesPL(){ - myAppendPolyData = vtkAppendPolyData::New(); - myIsShrinkable = false; -} - -VISU_CutPlanesPL::~VISU_CutPlanesPL(){ - myAppendPolyData->Delete(); -} - -void VISU_CutPlanesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_ScalarMapPL::ShallowCopy(thePipeLine); - if(VISU_CutPlanesPL *aPipeLine = dynamic_cast(thePipeLine)){ - SetOrientation(aPipeLine->GetPlaneOrientation(), - aPipeLine->GetRotateX(),aPipeLine->GetRotateY()); - SetDisplacement(aPipeLine->GetDisplacement()); - SetNbParts(aPipeLine->GetNbParts()); - for (int i = 0, iend = GetNbParts(); i < iend; i++) - if(!aPipeLine->IsPartDefault(i)) SetPartPosition(i, aPipeLine->GetPartPosition(i)); - } -} - -void VISU_CutPlanesPL::Init(){ - VISU_ScalarMapPL::Init(); - - SetNbParts(10); - myBasePlane[0] = YZ; - myDisplacement[0] = 0.5; - myAng[0][0] = myAng[0][1] = myAng[0][2] = 0.0; -} - -VISU_ScalarMapPL::THook* VISU_CutPlanesPL::DoHook(){ - return myAppendPolyData->GetOutput(); -} - -void VISU_CutPlanesPL::Update(){ - ClearAppendPolyData(myAppendPolyData); - SetPartPosition(); - float aDir[3]; - GetDir(aDir,myAng[0],myBasePlane[0]); - float aBounds[6]; - GetInput2()->GetBounds(aBounds); - vtkDataSet* aDataSet = myFieldTransform->GetUnstructuredGridOutput(); - CutWithPlanes(myAppendPolyData,aDataSet,myNbParts,aDir,aBounds, - myPartPosition,myPartCondition,myDisplacement[0]); - - VISU_ScalarMapPL::Update(); -} - -void VISU_CutPlanesPL::SetPartPosition(int theNum){ - for(int i = 0; i < myNbParts; i++) - myPartPosition[i] = GetPartPosition(i,theNum); -} - -void VISU_CutPlanesPL::ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData){ - int iEnd = theAppendPolyData->GetNumberOfInputs(); - for(int i = iEnd-1; i >= 0; i--) - theAppendPolyData->RemoveInput(theAppendPolyData->GetInput(i)); -} - -float* VISU_CutPlanesPL::GetRx(float theRx[3][3], float thaAng){ - theRx[0][0] = 1.0; theRx[0][1] = 0.0; theRx[0][2] = 0.0; - theRx[1][0] = 0.0; theRx[1][1] = cos(thaAng); theRx[1][2] = -sin(thaAng); - theRx[2][0] = 0.0; theRx[2][1] = sin(thaAng); theRx[2][2] = cos(thaAng); - return theRx[0]; -} - - -float* VISU_CutPlanesPL::GetRy(float theRy[3][3], float thaAng){ - theRy[0][0] = cos(thaAng); theRy[0][1] = 0.0; theRy[0][2] = sin(thaAng); - theRy[1][0] = 0.0; theRy[1][1] = 1.0; theRy[1][2] = 0.0; - theRy[2][0] = -sin(thaAng); theRy[2][1] = 0.0; theRy[2][2] = cos(thaAng); - return theRy[0]; -} - - -float* VISU_CutPlanesPL::GetRz(float theRz[3][3], float thaAng){ - theRz[0][0] = cos(thaAng); theRz[0][1] = -sin(thaAng); theRz[0][2] = 0.0; - theRz[1][0] = sin(thaAng); theRz[1][1] = cos(thaAng); theRz[1][2] = 0.0; - theRz[2][0] = 0.0; theRz[2][1] = 0.0; theRz[2][2] = 1.0; - return theRz[0]; -} - - -void VISU_CutPlanesPL::CorrectPnt(float thePnt[3], const float BoundPrj[6]){ - for(int i = 0, j = 0; i < 3; ++i, j=2*i){ - if(thePnt[i] < BoundPrj[j]) thePnt[i] = BoundPrj[j]; - if(thePnt[i] > BoundPrj[j+1]) thePnt[i] = BoundPrj[j+1]; - } -} - -void VISU_CutPlanesPL::GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]){ - float BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]}, - {BoundBox[1],BoundBox[2],BoundBox[4]}, - {BoundBox[0],BoundBox[3],BoundBox[4]}, - {BoundBox[1],BoundBox[3],BoundBox[4]}, - {BoundBox[0],BoundBox[2],BoundBox[5]}, - {BoundBox[1],BoundBox[2],BoundBox[5]}, - {BoundBox[0],BoundBox[3],BoundBox[5]}, - {BoundBox[1],BoundBox[3],BoundBox[5]}}; - BoundPrj[0] = vtkMath::Dot(Dir,BoundPoints[0]), BoundPrj[1] = BoundPrj[0]; - for(int i = 1; i < 8; i++){ - float tmp = vtkMath::Dot(Dir,BoundPoints[i]); - if(BoundPrj[1] < tmp) BoundPrj[1] = tmp; - if(BoundPrj[0] > tmp) BoundPrj[0] = tmp; - } - BoundPrj[2] = BoundPrj[1] - BoundPrj[0]; - BoundPrj[1] = BoundPrj[0] + (1.0 - EPS)*BoundPrj[2]; - BoundPrj[0] = BoundPrj[0] + EPS*BoundPrj[2]; - BoundPrj[2] = BoundPrj[1] - BoundPrj[0]; -} - - -void VISU_CutPlanesPL::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, - float theXAng, float theYAng, int theNum) -{ - myBasePlane[theNum] = theOrient; - switch(myBasePlane[theNum]){ - case XY: myAng[theNum][0] = theXAng; break; - case YZ: myAng[theNum][1] = theXAng; break; - case ZX: myAng[theNum][2] = theXAng; break; - } - switch(myBasePlane[theNum]){ - case XY: myAng[theNum][1] = theYAng; break; - case YZ: myAng[theNum][2] = theYAng; break; - case ZX: myAng[theNum][0] = theYAng; break; - } -} - - -const VISU_CutPlanesPL::PlaneOrientation& VISU_CutPlanesPL::GetPlaneOrientation(int theNum){ - return myBasePlane[theNum]; -} - -float VISU_CutPlanesPL::GetRotateX(int theNum){ - switch(myBasePlane[theNum]){ - case XY: return myAng[theNum][0]; - case YZ: return myAng[theNum][1]; - case ZX: return myAng[theNum][2]; - } - return 0; -} - -float VISU_CutPlanesPL::GetRotateY(int theNum){ - switch(myBasePlane[theNum]){ - case XY: return myAng[theNum][1]; - case YZ: return myAng[theNum][2]; - case ZX: return myAng[theNum][0]; - } - return 0; -} - - -void VISU_CutPlanesPL::SetNbParts(int theNb) { - myNbParts = theNb; - myPartPosition.resize(myNbParts); - myPartCondition.resize(myNbParts,1); - Modified(); -} - - -void VISU_CutPlanesPL::SetPartPosition(int thePartNumber, float thePartPosition){ - if(thePartNumber >= myNbParts) return; - myPartPosition[thePartNumber] = thePartPosition; - myPartCondition[thePartNumber] = 0; - Modified(); -} -float VISU_CutPlanesPL::GetPartPosition(int thePartNumber, int theNum){ - if(thePartNumber >= myNbParts) return 0; - float aPosition = myPartPosition[thePartNumber]; - if(myPartCondition[thePartNumber]){ - float aDir[3], aBounds[6], aBoundPrj[3]; - GetInput2()->GetBounds(aBounds); - GetDir(aDir,myAng[theNum],myBasePlane[theNum]); - GetBoundProject(aBoundPrj,aBounds,aDir); - if (myNbParts > 1){ - float aDBoundPrj = aBoundPrj[2]/(myNbParts - 1); - float aDisplacement = aDBoundPrj * myDisplacement[theNum]; - float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; - aPosition = aStartPosition + thePartNumber*aDBoundPrj; - }else - aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum]; - } - return aPosition; -} - - -void VISU_CutPlanesPL::SetPartDefault(int thePartNumber){ - if(thePartNumber >= myNbParts) return; - myPartPosition[thePartNumber] = GetPartPosition(thePartNumber); - myPartCondition[thePartNumber] = 1; - Modified(); -} -int VISU_CutPlanesPL::IsPartDefault(int thePartNumber){ - if(thePartNumber >= myNbParts) return 1; - return myPartCondition[thePartNumber]; -} - - -void VISU_CutPlanesPL::GetDir(float theDir[3], - const float theAng[3], - const PlaneOrientation& theBasePlane) -{ - int iPlane = 0; - float aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3]; - switch(theBasePlane){ - case XY: - if(fabs(theAng[0]) > EPS) GetRx(aRx,theAng[0]); else vtkMath::Identity3x3(aRx); - if(fabs(theAng[1]) > EPS) GetRy(aRy,theAng[1]); else vtkMath::Identity3x3(aRy); - vtkMath::Multiply3x3(aRx,aRy,aRotation); - iPlane = 2; - break; - case YZ: - if(fabs(theAng[1]) > EPS) GetRy(aRy,theAng[1]); else vtkMath::Identity3x3(aRy); - if(fabs(theAng[2]) > EPS) GetRz(aRz,theAng[2]); else vtkMath::Identity3x3(aRz); - vtkMath::Multiply3x3(aRy,aRz,aRotation); - iPlane = 0; - break; - case ZX: - if(fabs(theAng[2]) > EPS) GetRz(aRz,theAng[2]); else vtkMath::Identity3x3(aRz); - if(fabs(theAng[0]) > EPS) GetRx(aRx,theAng[0]); else vtkMath::Identity3x3(aRx); - vtkMath::Multiply3x3(aRz,aRx,aRotation); - iPlane = 1; - break; - } - for(int i = 0; i < 3; i++) - theDir[i] = aRotation[i][iPlane]; -} - - -void VISU_CutPlanesPL::CutWithPlane(vtkAppendPolyData* theAppendPolyData, - vtkDataSet* theDataSet, - float theDir[3], float theOrig[3]) -{ - vtkCutter *aCutPlane = vtkCutter::New(); - aCutPlane->SetInput(theDataSet); - vtkPlane *aPlane = vtkPlane::New(); - aPlane->SetOrigin(theOrig); - - aPlane->SetNormal(theDir); - aCutPlane->SetCutFunction(aPlane); - aPlane->Delete(); - theAppendPolyData->AddInput(aCutPlane->GetOutput()); - aCutPlane->Register(theAppendPolyData); - aCutPlane->Delete(); -} - - -void VISU_CutPlanesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - const vector& thePlanePosition, - const vector& thePlaneCondition, - float theDisplacement) -{ - float aBoundPrj[3], aOrig[3], aPosition; - GetBoundProject(aBoundPrj, theBounds, theDir); - if(theNbPlanes > 1){ - float aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1); - float aDisplacement = aDBoundPrj*theDisplacement; - float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; - for (int i = 0; i < theNbPlanes; i++){ - aPosition = aStartPosition + i*aDBoundPrj; - if(thePlaneCondition[i]){ - aPosition = aStartPosition + i*aDBoundPrj; - }else - aPosition = thePlanePosition[i]; - VISU::Mul(theDir,aPosition,aOrig); - CutWithPlane(theAppendPolyData,theDataSet,theDir,aOrig); - } - }else{ - if(thePlaneCondition[0]) - aPosition = aBoundPrj[0] + aBoundPrj[2]*theDisplacement; - else - aPosition = thePlanePosition[0]; - VISU::Mul(theDir,aPosition,aOrig); - CutWithPlane(theAppendPolyData,theDataSet,theDir,aOrig); - } - vtkPolyData *aPolyData = theAppendPolyData->GetOutput(); - aPolyData->Update(); - theAppendPolyData->Update(); -} diff --git a/src/PIPELINE/VISU_CutPlanesPL.hxx b/src/PIPELINE/VISU_CutPlanesPL.hxx deleted file mode 100644 index b561f512..00000000 --- a/src/PIPELINE/VISU_CutPlanesPL.hxx +++ /dev/null @@ -1,104 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_CutPlanesPL.hxx -// Author: Alexey PETROV -// Module : VISU - -#ifndef VISU_CutPlanesPL_HeaderFile -#define VISU_CutPlanesPL_HeaderFile - -#include "VISU_ScalarMapPL.hxx" - -#include - -class vtkAppendPolyData; - -class VISU_CutPlanesPL : public VISU_ScalarMapPL{ -protected: - VISU_CutPlanesPL(); - VISU_CutPlanesPL(const VISU_CutPlanesPL&); -public: - vtkTypeMacro(VISU_CutPlanesPL,VISU_ScalarMapPL); - static VISU_CutPlanesPL* New(); - virtual ~VISU_CutPlanesPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - - enum PlaneOrientation {XY, YZ, ZX}; - virtual void SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, - float theXAng, float theYAng, int theNum = 0); - - virtual const PlaneOrientation& GetPlaneOrientation(int theNum = 0); - virtual float GetRotateX(int theNum = 0); - virtual float GetRotateY(int theNum = 0); - - virtual float GetDisplacement(int theNum = 0) { return myDisplacement[theNum];} - virtual void SetDisplacement(float theDisp, int theNum = 0) { myDisplacement[theNum] = theDisp;} - - virtual void SetPartPosition(int thePartNumber, float thePartPosition); - virtual float GetPartPosition(int thePartNumber, int theNum = 0); - - virtual void SetPartDefault(int thePartNumber); - virtual int IsPartDefault(int thePartNumber); - - virtual void SetNbParts(int theNb); - virtual int GetNbParts(){ return myNbParts;} - -public: - virtual void Init(); - virtual void Update(); - virtual vtkAppendPolyData* GetAppendPolyData() { return myAppendPolyData; } - -public: - static float* GetRx(float theRx[3][3], float thaAng); - static float* GetRy(float theRy[3][3], float thaAng); - static float* GetRz(float theRz[3][3], float thaAng); - - static void CorrectPnt(float thePnt[3], const float BoundPrj[6]); - static void GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]); - - static void GetDir(float theDir[3], - const float theAng[3], - const PlaneOrientation& theBasePlane); - - static void ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData); - - static void CutWithPlane(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - float theDir[3], float theOrig[3]); - static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - const std::vector& thePlanePosition, - const std::vector& thePlaneCondition, - float theDisplacement); -protected: - virtual THook* DoHook(); - void SetPartPosition(int theNum = 0); - - int myNbParts; - PlaneOrientation myBasePlane[2]; - float myAng[2][3], myDisplacement[2]; - vtkAppendPolyData *myAppendPolyData; - std::vector myPartPosition; - std::vector myPartCondition; -}; - -#endif diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx deleted file mode 100644 index c276548d..00000000 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ /dev/null @@ -1,107 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.cxx -// Author: Alexey PETROV -// Module : VISU - - -#include "VISU_DeformedShapePL.hxx" -#include "VISU_PipeLineUtils.hxx" -#include "VTKViewer_Transform.h" - -#include - -vtkStandardNewMacro(VISU_DeformedShapePL); - -VISU_DeformedShapePL::VISU_DeformedShapePL(){ - myWarpVector = vtkWarpVector::New(); - myCellDataToPointData = vtkCellDataToPointData::New(); -} - -VISU_DeformedShapePL::~VISU_DeformedShapePL(){ - myWarpVector->UnRegisterAllOutputs(); - myWarpVector->Delete(); - - myCellDataToPointData->UnRegisterAllOutputs(); - myCellDataToPointData->Delete(); -} - -void VISU_DeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_ScalarMapPL::ShallowCopy(thePipeLine); - if(VISU_DeformedShapePL *aPipeLine = dynamic_cast(thePipeLine)){ - SetScale(aPipeLine->GetScale()); - } -} - -float VISU_DeformedShapePL::GetScaleFactor(vtkDataSet* theDataSet){ - if(!theDataSet) return 0.0; - theDataSet->Update(); - int aNbCells = theDataSet->GetNumberOfCells(); - int aNbPoints = theDataSet->GetNumberOfPoints(); - int aNbElem = aNbCells? aNbCells: aNbPoints; - float* aBounds = theDataSet->GetBounds(); - float aVolume = 1, aVol, idim = 0; - for(int i = 0; i < 6; i += 2){ - aVol = fabs(aBounds[i+1] - aBounds[i]); - if(aVol > 0) { - idim++; - aVolume *= aVol; - } - } - aVolume /= aNbElem; - return pow(aVolume,float(1.0/idim)); -} - - -void VISU_DeformedShapePL::SetScale(float theScale) { - if(myScaleFactor == theScale) return; - myScaleFactor = theScale; - myWarpVector->SetScaleFactor(myScaleFactor); - Modified(); -} -float VISU_DeformedShapePL::GetScale() { - return myWarpVector->GetScaleFactor(); -} - -void VISU_DeformedShapePL::Init(){ - VISU_ScalarMapPL::Init(); - float aScalarRange[2]; - GetSourceRange(aScalarRange); - SetScale(GetScaleFactor(GetInput2())/aScalarRange[1]); -} - -VISU_ScalarMapPL::THook* VISU_DeformedShapePL::DoHook(){ - VISU::CellDataToPoint(myWarpVector,myCellDataToPointData,GetInput2(),myFieldTransform); - return myWarpVector->GetOutput(); -} - -void VISU_DeformedShapePL::Update(){ - VISU_ScalarMapPL::Update(); -} - -void VISU_DeformedShapePL::SetMapScale(float theMapScale){ - VISU_ScalarMapPL::SetMapScale(theMapScale); - - myWarpVector->SetScaleFactor(myScaleFactor*theMapScale); - Modified(); -} diff --git a/src/PIPELINE/VISU_DeformedShapePL.hxx b/src/PIPELINE/VISU_DeformedShapePL.hxx deleted file mode 100644 index 9c2f95a7..00000000 --- a/src/PIPELINE/VISU_DeformedShapePL.hxx +++ /dev/null @@ -1,65 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.hxx -// Author: Alexey PETROV -// Module : VISU - -#ifndef VISU_DeformedShapePL_HeaderFile -#define VISU_DeformedShapePL_HeaderFile - -#include "VISU_ScalarMapPL.hxx" - -class vtkCellDataToPointData; -class SALOME_Transform; -class vtkWarpVector; - -class VISU_DeformedShapePL : public VISU_ScalarMapPL{ -protected: - VISU_DeformedShapePL(); - VISU_DeformedShapePL(const VISU_DeformedShapePL&); -public: - vtkTypeMacro(VISU_DeformedShapePL,VISU_ScalarMapPL); - static VISU_DeformedShapePL* New(); - virtual ~VISU_DeformedShapePL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - - virtual void SetScale(float theScale); - virtual float GetScale(); - -public: - virtual void Init(); - virtual void Update(); - virtual void SetMapScale(float theMapScale = 1.0); - - static float GetScaleFactor(vtkDataSet* theDataSet); - -protected: - virtual THook* DoHook(); - - float myScaleFactor; - vtkWarpVector *myWarpVector; - vtkCellDataToPointData* myCellDataToPointData; -}; - - -#endif diff --git a/src/PIPELINE/VISU_Extractor.cxx b/src/PIPELINE/VISU_Extractor.cxx deleted file mode 100644 index f4bcfabb..00000000 --- a/src/PIPELINE/VISU_Extractor.cxx +++ /dev/null @@ -1,107 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_Extractor.cxx -// Module : VISU - -#include "VISU_Extractor.hxx" -#include "VISU_PipeLineUtils.hxx" - -#include - -#include -#include -#include -#include -#include - -using namespace std; - - -vtkStandardNewMacro(VISU_Extractor); - -VISU_Extractor::VISU_Extractor(){ - myScalarMode = 0; -} - -VISU_Extractor::~VISU_Extractor(){ -} - -void VISU_Extractor::SetScalarMode(int theScalarMode){ - if(myScalarMode != theScalarMode){ - myScalarMode = theScalarMode; - Modified(); - } -} - - -template void -execute(int theNbComp, int theScalarMode, TypeData* theInputData, TypeData* theOutputData){ - vtkDataArray *inVectors = theInputData->GetVectors(); - if ( !inVectors || theNbComp < 1 ) - return; - vtkFloatArray *newScalars = vtkFloatArray::New(); - ostringstream aName; - aName<GetName(); aName<<", "; aName<SetName(aName.str().c_str()); - newScalars->SetNumberOfComponents(1); - newScalars->SetNumberOfTuples(theNbComp); - for (int ptId = 0; ptId < theNbComp; ptId++) { - float v[3], s; - inVectors->GetTuple(ptId,v); - if ( theScalarMode < 1 || theScalarMode > 3) - s = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); - else - s = v[theScalarMode - 1]; - newScalars->SetTuple1(ptId, s); - } - theOutputData->SetScalars(newScalars); - //theOutputData->SetActiveScalars(newScalars->GetName()); - newScalars->Delete(); -} - - -void VISU_Extractor::Execute(){ - vtkDataSet *input = this->GetInput(), *output = this->GetOutput(); - output->CopyStructure(input); - output->GetPointData()->CopyAllOff(); - output->GetCellData()->CopyAllOff(); - if(input->GetPointData()->GetNumberOfArrays()){ - output->GetPointData()->CopyVectorsOn(); - int nbComp = input->GetNumberOfPoints(); - vtkPointData *inData = input->GetPointData(), *outData = output->GetPointData(); - if(inData->GetAttribute(vtkDataSetAttributes::VECTORS)) - execute(nbComp,myScalarMode,inData,outData); - else - output->GetPointData()->CopyScalarsOn(); - outData->PassData(inData); - }else{ - output->GetCellData()->CopyVectorsOn(); - int nbComp = input->GetNumberOfCells(); - vtkCellData *inData = input->GetCellData(), *outData = output->GetCellData(); - if(inData->GetAttribute(vtkDataSetAttributes::VECTORS)) - execute(nbComp,myScalarMode,inData,outData); - else - output->GetCellData()->CopyScalarsOn(); - outData->PassData(inData); - } -} diff --git a/src/PIPELINE/VISU_Extractor.hxx b/src/PIPELINE/VISU_Extractor.hxx deleted file mode 100644 index 7ab876d6..00000000 --- a/src/PIPELINE/VISU_Extractor.hxx +++ /dev/null @@ -1,50 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_Extractor.hxx -// Author : Alexey PETROV -// Module : VISU - -#ifndef VISU_Extractor_HeaderFile -#define VISU_Extractor_HeaderFile - -#include - -class VTK_EXPORT VISU_Extractor : public vtkPointSetToPointSetFilter{ -public: - vtkTypeMacro(VISU_Extractor,vtkPointSetToPointSetFilter); - static VISU_Extractor *New(); - - virtual int GetScalarMode(){ return myScalarMode;} - virtual void SetScalarMode(int theScalarMode = 0); - -protected: - VISU_Extractor(); - VISU_Extractor(const VISU_Extractor&); - ~VISU_Extractor(); - - virtual void Execute(); - - int myScalarMode; -}; - -#endif diff --git a/src/PIPELINE/VISU_FieldTransform.cxx b/src/PIPELINE/VISU_FieldTransform.cxx deleted file mode 100644 index 5fd70742..00000000 --- a/src/PIPELINE/VISU_FieldTransform.cxx +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VISU_FieldTransform.cxx -// Module : VISU - -#include "VISU_FieldTransform.hxx" -#include "VTKViewer_Transform.h" - -#include -#include -#include -#include -#include -#include - -using namespace std; - -vtkStandardNewMacro(VISU_FieldTransform); - -double VISU_FieldTransform::Ident(double theArg){ - return theArg; -} -double VISU_FieldTransform::Log10(double theArg){ - if(theArg <= 0.0) return -VTK_LARGE_FLOAT; - return log10(theArg); -} - - -VISU_FieldTransform::VISU_FieldTransform(){ - myFunction = &Ident; - myTransform = NULL; -} - -VISU_FieldTransform::~VISU_FieldTransform() { - SetSpaceTransform(NULL); -} - - -void VISU_FieldTransform::Update(){ - if(myTransform && myTransform->GetMTime() > vtkSource::GetMTime()) - Modified(); - vtkSource::Update(); -} - -unsigned long VISU_FieldTransform::GetMTime(){ - if(myTransform && myTransform->GetMTime() > vtkSource::GetMTime()) - return myTransform->GetMTime(); - return vtkSource::GetMTime(); -} - -void VISU_FieldTransform::SetScalarTransform(TTransformFun theFunction) { - myFunction = theFunction; - if(myFunction == NULL) myFunction = &Ident; - Modified(); -} - -void VISU_FieldTransform::SetSpaceTransform(VTKViewer_Transform* theTransform){ - if(myTransform != theTransform){ - if (myTransform != NULL) myTransform->UnRegister(this); - myTransform = theTransform; - if (myTransform != NULL) myTransform->Register(this); - this->Modified(); - } -} - - -void VISU_FieldTransform::SetScalarRange(float theScalarRange[2]) { - myScalarRange[0] = theScalarRange[0]; - myScalarRange[1] = theScalarRange[1]; - Modified(); -} -void VISU_FieldTransform::SetScalarMin(float theValue){ - float aScalarRange[2] = {theValue, GetScalarRange()[1]}; - SetScalarRange(aScalarRange); -} -void VISU_FieldTransform::SetScalarMax(float theValue){ - float aScalarRange[2] = {GetScalarRange()[0], theValue}; - SetScalarRange(aScalarRange); -} - - -template void -ExecVectors(VISU_FieldTransform::TTransformFun theFunction, - VTKViewer_Transform* theTransform, - float theScalarRange[2], int theNbComponent, - TypeData* theInputData, TypeData* theOutputData) -{ - vtkDataArray *inVectors = theInputData->GetVectors(); - if ( !inVectors || theNbComponent < 1 ) return; - vtkFloatArray *newVectors = vtkFloatArray::New(); - newVectors->SetNumberOfComponents(3); - newVectors->SetNumberOfTuples(theNbComponent); - float aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])}; - float *V, v[3], vMag, aDelta = aScalarRange[1] - aScalarRange[0]; - float aScale[3] = {1.0, 1.0, 1.0}; - if(theTransform){ - aScale[0] = theTransform->GetScale()[0]; - aScale[1] = theTransform->GetScale()[1]; - aScale[2] = theTransform->GetScale()[2]; - } - if(theFunction == &(VISU_FieldTransform::Ident)){ - for (int ptId = 0; ptId < theNbComponent; ptId++) { - V = inVectors->GetTuple3(ptId); - v[0] = V[0]*aScale[0]; - v[1] = V[1]*aScale[1]; - v[2] = V[2]*aScale[2]; - newVectors->SetTuple3(ptId, v[0], v[1], v[2]); - } - }else{ - for (int ptId = 0; ptId < theNbComponent; ptId++) { - V = inVectors->GetTuple3(ptId); - vMag = vtkMath::Norm(V); - vMag = ((*theFunction)(vMag) - aScalarRange[0]) / aDelta * theScalarRange[1] / vMag; - if(vMag <= 0.0) vMag = 0.0; - v[0] = V[0]*vMag*aScale[0]; - v[1] = V[1]*vMag*aScale[1]; - v[2] = V[2]*vMag*aScale[2]; - newVectors->SetTuple3(ptId, v[0], v[1], v[2]); - } - } - theOutputData->SetVectors(newVectors); - newVectors->Delete(); -} - -template void -ExecScalars(VISU_FieldTransform::TTransformFun theFunction, float theScalarRange[2], - int theNbComponent, TypeData* theInputData, TypeData* theOutputData) -{ - vtkDataArray *inScalars = theInputData->GetScalars(); - if ( !inScalars || theNbComponent < 1 ) - return; - vtkFloatArray *newScalars = vtkFloatArray::New(); - newScalars->SetNumberOfComponents(1); - newScalars->SetNumberOfTuples(theNbComponent); - float aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])}; - for (int ptId = 0; ptId < theNbComponent; ptId++) { - float s = (*theFunction)(inScalars->GetTuple1(ptId )); - if(s < aScalarRange[0]) s = aScalarRange[0]; - newScalars->SetTuple1(ptId, s); - } - theOutputData->SetScalars(newScalars); - newScalars->Delete(); -} - -void VISU_FieldTransform::Execute(){ - vtkDataSet *input = this->GetInput(), *output = this->GetOutput(); - output->CopyStructure(input); - if(myFunction != &Ident || (myTransform && !myTransform->IsIdentity())){ - output->GetPointData()->CopyAllOff(); - output->GetCellData()->CopyAllOff(); - - ExecScalars(myFunction,myScalarRange,input->GetNumberOfPoints(),input->GetPointData(),output->GetPointData()); - ExecVectors(myFunction,myTransform,myScalarRange,input->GetNumberOfPoints(),input->GetPointData(),output->GetPointData()); - - ExecScalars(myFunction,myScalarRange,input->GetNumberOfCells(),input->GetCellData(),output->GetCellData()); - ExecVectors(myFunction,myTransform,myScalarRange,input->GetNumberOfCells(),input->GetCellData(),output->GetCellData()); - }else{ - output->GetPointData()->CopyAllOn(); - output->GetCellData()->CopyAllOn(); - - output->GetPointData()->PassData(input->GetPointData()); - output->GetCellData()->PassData(input->GetCellData()); - } -} diff --git a/src/PIPELINE/VISU_FieldTransform.hxx b/src/PIPELINE/VISU_FieldTransform.hxx deleted file mode 100644 index 1a22f59a..00000000 --- a/src/PIPELINE/VISU_FieldTransform.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_Extractor.hxx -// Author : Alexey PETROV -// Module : VISU - -#ifndef VISU_FieldTransform_HeaderFile -#define VISU_FieldTransform_HeaderFile - -#include - -class VTKViewer_Transform; - -class VTK_EXPORT VISU_FieldTransform : public vtkDataSetToDataSetFilter{ -public: - vtkTypeMacro(VISU_FieldTransform,vtkDataSetToDataSetFilter); - static VISU_FieldTransform *New(); - - virtual void Update(); - virtual unsigned long GetMTime(); - - static double Ident(double theArg); - static double Log10(double theArg); - typedef double (*TTransformFun)(double); - void SetScalarTransform(TTransformFun theFunction); - TTransformFun GetScalarTransform() { return myFunction;} - - void SetSpaceTransform(VTKViewer_Transform* theTransform); - VTKViewer_Transform* GetSpaceTransform() { return myTransform;} - - float* GetScalarRange(){ return myScalarRange; } - void SetScalarRange(float theScalarRange[2]); - void SetScalarMin(float theValue); - void SetScalarMax(float theValue); - -protected: - VISU_FieldTransform(); - virtual ~VISU_FieldTransform(); - VISU_FieldTransform(const VISU_FieldTransform&) {}; - void operator=(const VISU_FieldTransform&) {}; - void Execute(); - - VTKViewer_Transform *myTransform; - TTransformFun myFunction; - float myScalarRange[2]; -}; - -#endif diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.cxx b/src/PIPELINE/VISU_IsoSurfacesPL.cxx deleted file mode 100644 index 7462ff51..00000000 --- a/src/PIPELINE/VISU_IsoSurfacesPL.cxx +++ /dev/null @@ -1,120 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File: VISU_PipeLine.cxx -// Author: Alexey PETROV -// Module : VISU - - -#include "VISU_IsoSurfacesPL.hxx" -#include "VISU_PipeLineUtils.hxx" - -#include - -vtkStandardNewMacro(VISU_IsoSurfacesPL); - -VISU_IsoSurfacesPL::VISU_IsoSurfacesPL(){ - myContourFilter = vtkContourFilter::New(); - myCellDataToPointData = vtkCellDataToPointData::New(); - myIsShrinkable = false; -} - -VISU_IsoSurfacesPL::~VISU_IsoSurfacesPL(){ - myContourFilter->UnRegisterAllOutputs(); - myContourFilter->Delete(); - - myCellDataToPointData->UnRegisterAllOutputs(); - myCellDataToPointData->Delete(); -} - -void VISU_IsoSurfacesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_ScalarMapPL::ShallowCopy(thePipeLine); - if(VISU_IsoSurfacesPL *aPipeLine = dynamic_cast(thePipeLine)){ - SetNbParts(aPipeLine->GetNbParts()); - float aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()}; - SetRange(aRange); - } -} - -int VISU_IsoSurfacesPL::GetNbParts() { - return myContourFilter->GetNumberOfContours(); -} -void VISU_IsoSurfacesPL::SetNbParts(int theNb) { - myContourFilter->SetNumberOfContours(theNb); - Modified(); -} - - -void VISU_IsoSurfacesPL::SetScaling(int theScaling) { - VISU_ScalarMapPL::SetScaling(theScaling); - SetRange(myRange); -} -void VISU_IsoSurfacesPL::SetRange(float theRange[2]){ - if(theRange[0] <= theRange[1]){ - myRange[0] = theRange[0]; myRange[1] = theRange[1]; - float aRange[2] = {myRange[0], myRange[1]}; - if(GetScaling() == VTK_SCALE_LOG10) - VISU_LookupTable::ComputeLogRange(theRange,aRange); - myContourFilter->GenerateValues(GetNbParts(),aRange); - Modified(); - } -} -float VISU_IsoSurfacesPL::GetMin() { - return myRange[0]; -} -float VISU_IsoSurfacesPL::GetMax() { - return myRange[1]; -} - - -void VISU_IsoSurfacesPL::Init(){ - VISU_ScalarMapPL::Init(); - - SetNbParts(10); - float aScalarRange[2]; - GetSourceRange(aScalarRange); - SetRange(aScalarRange); -} - -VISU_ScalarMapPL::THook* VISU_IsoSurfacesPL::DoHook(){ - return myContourFilter->GetOutput(); -} - - -void VISU_IsoSurfacesPL::Update(){ - VISU::CellDataToPoint(myContourFilter,myCellDataToPointData,GetInput2(),myFieldTransform); - SetMapScale(); - - VISU_ScalarMapPL::Update(); -} - -void VISU_IsoSurfacesPL::SetMapScale(float theMapScale){ - VISU_ScalarMapPL::SetMapScale(theMapScale); - - float aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()}; - float aNewRange[2] = {aRange[0], aRange[1]}; - if(GetScaling() == VTK_SCALE_LOG10) - VISU_LookupTable::ComputeLogRange(aRange,aNewRange); - myContourFilter->GenerateValues(GetNbParts(),aNewRange); - Modified(); -} diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.hxx b/src/PIPELINE/VISU_IsoSurfacesPL.hxx deleted file mode 100644 index 68732e37..00000000 --- a/src/PIPELINE/VISU_IsoSurfacesPL.hxx +++ /dev/null @@ -1,67 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.hxx -// Author: Alexey PETROV -// Module : VISU - -#ifndef VISU_IsoSurfacesPL_HeaderFile -#define VISU_IsoSurfacesPL_HeaderFile - -#include "VISU_ScalarMapPL.hxx" - -class vtkContourFilter; -class vtkCellDataToPointData; - -class VISU_IsoSurfacesPL : public VISU_ScalarMapPL{ -protected: - VISU_IsoSurfacesPL(); - VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&); -public: - vtkTypeMacro(VISU_IsoSurfacesPL,VISU_ScalarMapPL); - static VISU_IsoSurfacesPL* New(); - virtual ~VISU_IsoSurfacesPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - - virtual int GetNbParts(); - virtual void SetNbParts(int theNb = 10); - - virtual void SetScaling(int theScaling = VTK_SCALE_LINEAR); - virtual void SetRange(float theRange[2]); - virtual float GetMin(); - virtual float GetMax(); - -public: - virtual void Init(); - virtual void Update(); - virtual THook* DoHook(); - virtual void SetMapScale(float theMapScale = 1.0); - -protected: - int myNbParts; - float myRange[2]; - vtkCellDataToPointData* myCellDataToPointData; - vtkContourFilter *myContourFilter; -}; - - -#endif diff --git a/src/PIPELINE/VISU_LookupTable.cxx b/src/PIPELINE/VISU_LookupTable.cxx deleted file mode 100644 index 06f21c5a..00000000 --- a/src/PIPELINE/VISU_LookupTable.cxx +++ /dev/null @@ -1,579 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_LookupTable.cxx -// Author : Vitaliy Smetannikov -// Module : VISU - -#include "VISU_LookupTable.hxx" - -#include -#include -#include - -using namespace std; - -VISU_LookupTable *VISU_LookupTable::New() { - vtkObject* ret = vtkObjectFactory::CreateInstance("VISU_LookupTable"); - if(ret) - return (VISU_LookupTable*)ret; - return new VISU_LookupTable; -} - -VISU_LookupTable::VISU_LookupTable(int sze, int ext) - : vtkLookupTable(sze, ext), myScale(1.0) {} - -int VISU_LookupTable::ComputeLogRange(float inRange[2], float outRange[2]){ - if(inRange[0] >= inRange[1]) - return -1; - if(0.0 <= inRange[0] && 0.0 < inRange[1]){ - if(inRange[0] != 0.0) - outRange[0] = log10((double)inRange[0]); - else - outRange[0] = log10((double)inRange[1]*1.0E-6); - outRange[1] = log10((double)inRange[1]); - return 0; - }else if(inRange[0] < 0.0 && inRange[1] <= 0.0){ - outRange[0] = log10((double)-inRange[0]); - outRange[1] = log10((double)-inRange[1]); - return 1; - }else - return -1; -} - -unsigned char* VISU_LookupTable::MapValue(float v) { - if(GetScale() == VTK_SCALE_LOG10) { - float aLowBound = log10(this->TableRange[0]); - v = pow(10.0f,aLowBound + (v - aLowBound)*myScale); - return vtkLookupTable::MapValue(v); - }else{ - v = this->TableRange[0] + (v - this->TableRange[0])*myScale; - return vtkLookupTable::MapValue(v); - } -} - -// Apply log to value, with appropriate constraints. -inline float VISU_ApplyLogScale(float v, float range[2], - float logRange[2]) -{ - // is the range set for negative numbers? - if (range[0] < 0) - { - if (v < 0) - { - v = log10(-static_cast(v)); - } - else if (range[0] > range[1]) - { - v = logRange[0]; - } - else - { - v = logRange[1]; - } - } - else - { - if (v > 0) - { - v = log10(static_cast(v)); - } - else if (range[0] < range[1]) - { - v = logRange[0]; - } - else - { - v = logRange[1]; - } - } - return v; -} - -// Apply shift/scale to the scalar value v and do table lookup. -inline unsigned char *VISU_LinearLookup(float v, - unsigned char *table, - float maxIndex, - float shift, float scale) -{ - float findx = (v + shift)*scale; - if (findx < 0) - { - findx = 0; - } - if (findx > maxIndex) - { - findx = maxIndex; - } - return &table[4*static_cast(findx)]; - /* round - return &table[4*(int)(findx + 0.5f)]; - */ -} - -// accelerate the mapping by copying the data in 32-bit chunks instead -// of 8-bit chunks -template -void VISU_LookupTableMapData(vtkLookupTable *self, T *input, - unsigned char *output, int length, - int inIncr, int outFormat, float theMapScale) -{ - int i = length; - float *range = self->GetTableRange(); - float maxIndex = self->GetNumberOfColors() - 1; - float shift, scale; - unsigned char *table = self->GetPointer(0); - unsigned char *cptr; - float alpha; - - if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required - { - if (self->GetScale() == VTK_SCALE_LOG10) - { - float val; - float logRange[2]; - VISU_LookupTable::ComputeLogRange(range, logRange); - shift = -logRange[0]; - if (logRange[1] <= logRange[0]) - { - scale = VTK_LARGE_FLOAT; - } - else - { - scale = (maxIndex + 1)/(logRange[1] - logRange[0]); - } - /* correct scale - scale = maxIndex/(logRange[1] - logRange[0]); - */ - if (outFormat == VTK_RGBA) - { - while (--i >= 0) - { - val = VISU_ApplyLogScale(*input, range, logRange); - cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale); - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = *cptr++; - input += inIncr; - } - } - else if (outFormat == VTK_RGB) - { - while (--i >= 0) - { - val = VISU_ApplyLogScale(*input, range, logRange); - cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale); - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = *cptr++; - input += inIncr; - } - } - else if (outFormat == VTK_LUMINANCE_ALPHA) - { - while (--i >= 0) - { - val = VISU_ApplyLogScale(*input, range, logRange); - cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale); - *output++ = static_cast(cptr[0]*0.30 + cptr[1]*0.59 + - cptr[2]*0.11 + 0.5); - *output++ = cptr[3]; - input += inIncr; - } - } - else // outFormat == VTK_LUMINANCE - { - while (--i >= 0) - { - val = VISU_ApplyLogScale(*input, range, logRange); - cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale); - *output++ = static_cast(cptr[0]*0.30 + cptr[1]*0.59 + - cptr[2]*0.11 + 0.5); - input += inIncr; - } - } - }//if log scale - - else //not log scale - { - shift = -range[0]; - if (range[1] <= range[0]) - { - scale = VTK_LARGE_FLOAT; - } - else - { - scale = (maxIndex + 1)/(range[1] - range[0]); - } - /* correct scale - scale = maxIndex/(range[1] - range[0]); - */ - - if (outFormat == VTK_RGBA) - { - while (--i >= 0) - { - cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale); - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = *cptr++; - input += inIncr; - } - } - else if (outFormat == VTK_RGB) - { - while (--i >= 0) - { - cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale); - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = *cptr++; - input += inIncr; - } - } - else if (outFormat == VTK_LUMINANCE_ALPHA) - { - while (--i >= 0) - { - cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale); - *output++ = static_cast(cptr[0]*0.30 + cptr[1]*0.59 + - cptr[2]*0.11 + 0.5); - *output++ = cptr[3]; - input += inIncr; - } - } - else // outFormat == VTK_LUMINANCE - { - while (--i >= 0) - { - cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale); - *output++ = static_cast(cptr[0]*0.30 + cptr[1]*0.59 + - cptr[2]*0.11 + 0.5); - input += inIncr; - } - } - }//if not log lookup - }//if blending not needed - - else //blend with the specified alpha - { - if (self->GetScale() == VTK_SCALE_LOG10) - { - float val; - float logRange[2]; - VISU_LookupTable::ComputeLogRange(range, logRange); - shift = -logRange[0]; - if (logRange[1] <= logRange[0]) - { - scale = VTK_LARGE_FLOAT; - } - else - { - scale = (maxIndex + 1)/(logRange[1] - logRange[0]); - } - /* correct scale - scale = maxIndex/(logRange[1] - logRange[0]); - */ - if (outFormat == VTK_RGBA) - { - while (--i >= 0) - { - val = VISU_ApplyLogScale(*input, range, logRange); - cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale); - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = static_cast((*cptr)*alpha); cptr++; - input += inIncr; - } - } - else if (outFormat == VTK_RGB) - { - while (--i >= 0) - { - val = VISU_ApplyLogScale(*input, range, logRange); - cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale); - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = *cptr++; - input += inIncr; - } - } - else if (outFormat == VTK_LUMINANCE_ALPHA) - { - while (--i >= 0) - { - val = VISU_ApplyLogScale(*input, range, logRange); - cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale); - *output++ = static_cast(cptr[0]*0.30 + cptr[1]*0.59 + - cptr[2]*0.11 + 0.5); - *output++ = static_cast(alpha*cptr[3]); - input += inIncr; - } - } - else // outFormat == VTK_LUMINANCE - { - while (--i >= 0) - { - val = VISU_ApplyLogScale(*input, range, logRange); - cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale); - *output++ = static_cast(cptr[0]*0.30 + cptr[1]*0.59 + - cptr[2]*0.11 + 0.5); - input += inIncr; - } - } - }//log scale with blending - - else //no log scale with blending - { - shift = -range[0]; - if (range[1] <= range[0]) - { - scale = VTK_LARGE_FLOAT; - } - else - { - scale = (maxIndex + 1)/(range[1] - range[0]); - } - /* correct scale - scale = maxIndex/(range[1] - range[0]); - */ - - if (outFormat == VTK_RGBA) - { - while (--i >= 0) - { - cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale); - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = static_cast((*cptr)*alpha); cptr++; - input += inIncr; - } - } - else if (outFormat == VTK_RGB) - { - while (--i >= 0) - { - cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale); - *output++ = *cptr++; - *output++ = *cptr++; - *output++ = *cptr++; - input += inIncr; - } - } - else if (outFormat == VTK_LUMINANCE_ALPHA) - { - while (--i >= 0) - { - cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale); - *output++ = static_cast(cptr[0]*0.30 + cptr[1]*0.59 + - cptr[2]*0.11 + 0.5); - *output++ = static_cast(cptr[3]*alpha); - input += inIncr; - } - } - else // outFormat == VTK_LUMINANCE - { - while (--i >= 0) - { - cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale); - *output++ = static_cast(cptr[0]*0.30 + cptr[1]*0.59 + - cptr[2]*0.11 + 0.5); - input += inIncr; - } - } - }//no log scale - }//alpha blending -} - -// Although this is a relatively expensive calculation, -// it is only done on the first render. Colors are cached -// for subsequent renders. -template -void VISU_LookupTableMapMag(vtkLookupTable *self, T *input, - unsigned char *output, int length, - int inIncr, int outFormat, float theMapScale) -{ - double tmp, sum; - double *mag; - int i, j; - - mag = new double[length]; - for (i = 0; i < length; ++i) - { - sum = 0; - for (j = 0; j < inIncr; ++j) - { - tmp = (double)(*input); - sum += (tmp * tmp); - ++input; - } - mag[i] = sqrt(sum); - } - - VISU_LookupTableMapData(self, mag, output, length, 1, outFormat, theMapScale); - - delete [] mag; -} - - -void VISU_LookupTable::MapScalarsThroughTable2(void *input, - unsigned char *output, - int inputDataType, - int numberOfValues, - int inputIncrement, - int outputFormat) -{ - if (this->UseMagnitude && inputIncrement > 1) - { - switch (inputDataType) - { - case VTK_BIT: - vtkErrorMacro("Cannot comput magnitude of bit array."); - break; - case VTK_CHAR: - VISU_LookupTableMapMag(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - return; - case VTK_UNSIGNED_CHAR: - VISU_LookupTableMapMag(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - return; - case VTK_SHORT: - VISU_LookupTableMapMag(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - return; - case VTK_UNSIGNED_SHORT: - VISU_LookupTableMapMag(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - return; - case VTK_INT: - VISU_LookupTableMapMag(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - return; - case VTK_UNSIGNED_INT: - VISU_LookupTableMapMag(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - return; - case VTK_LONG: - VISU_LookupTableMapMag(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - return; - case VTK_UNSIGNED_LONG: - VISU_LookupTableMapMag(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - return; - case VTK_FLOAT: - VISU_LookupTableMapMag(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - return; - case VTK_DOUBLE: - VISU_LookupTableMapMag(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - return; - default: - vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType"); - return; - } - } - - switch (inputDataType) - { - case VTK_BIT: - { - vtkIdType i, id; - vtkBitArray *bitArray = vtkBitArray::New(); - bitArray->SetVoidArray(input,numberOfValues,1); - vtkUnsignedCharArray *newInput = vtkUnsignedCharArray::New(); - newInput->SetNumberOfValues(numberOfValues); - for (id=i=0; iSetValue(i, bitArray->GetValue(id)); - } - VISU_LookupTableMapData(this, - static_cast(newInput->GetPointer(0)), - output,numberOfValues, - inputIncrement,outputFormat,myScale); - newInput->Delete(); - bitArray->Delete(); - } - break; - - case VTK_CHAR: - VISU_LookupTableMapData(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - break; - - case VTK_UNSIGNED_CHAR: - VISU_LookupTableMapData(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - break; - - case VTK_SHORT: - VISU_LookupTableMapData(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - break; - - case VTK_UNSIGNED_SHORT: - VISU_LookupTableMapData(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - break; - - case VTK_INT: - VISU_LookupTableMapData(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - break; - - case VTK_UNSIGNED_INT: - VISU_LookupTableMapData(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - break; - - case VTK_LONG: - VISU_LookupTableMapData(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - break; - - case VTK_UNSIGNED_LONG: - VISU_LookupTableMapData(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - break; - - case VTK_FLOAT: - VISU_LookupTableMapData(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - break; - - case VTK_DOUBLE: - VISU_LookupTableMapData(this,static_cast(input),output, - numberOfValues,inputIncrement,outputFormat,myScale); - break; - - default: - vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType"); - return; - } -} - diff --git a/src/PIPELINE/VISU_LookupTable.hxx b/src/PIPELINE/VISU_LookupTable.hxx deleted file mode 100644 index 769ba892..00000000 --- a/src/PIPELINE/VISU_LookupTable.hxx +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VISU_LookupTable.h -// Author : Vitaliy Smetannikov -// Module : VISU - -#ifndef VISU_LookupTable_H -#define VISU_LookupTable_H - -#include - -class VISU_LookupTable: public vtkLookupTable { - public: - vtkTypeMacro(VISU_LookupTable,vtkLookupTable); - static VISU_LookupTable *New(); - - virtual void MapScalarsThroughTable2(void *input, unsigned char *output, - int inputDataType, int numberOfValues, - int inputIncrement, int outputIncrement); - - float GetMapScale() { return myScale; } - void SetMapScale(float theScale = 1.0) { myScale = theScale; Modified(); } - - static int ComputeLogRange(float inRange[2], float outRange[2]); - unsigned char *MapValue(float v); - - protected: - VISU_LookupTable(int sze=256, int ext=256); - ~VISU_LookupTable() {}; - - float myScale; -}; -#endif // VISU_LookupTable_H diff --git a/src/PIPELINE/VISU_MeshPL.cxx b/src/PIPELINE/VISU_MeshPL.cxx deleted file mode 100644 index b5d3fbc2..00000000 --- a/src/PIPELINE/VISU_MeshPL.cxx +++ /dev/null @@ -1,51 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File: VISU_PipeLine.cxx -// Author: Alexey PETROV -// Module : VISU - - -#include "VISU_MeshPL.hxx" -#include "VTKViewer_GeometryFilter.h" - -#include -#include -#include -#include - -vtkStandardNewMacro(VISU_MeshPL); - -VISU_MeshPL::VISU_MeshPL() -{ - myIsShrinkable = true; -} - -void VISU_MeshPL::Build() -{ - myMapper->SetInput(GetInput2()); -} - -void VISU_MeshPL::Init() -{ -} diff --git a/src/PIPELINE/VISU_MeshPL.hxx b/src/PIPELINE/VISU_MeshPL.hxx deleted file mode 100644 index 27be219c..00000000 --- a/src/PIPELINE/VISU_MeshPL.hxx +++ /dev/null @@ -1,45 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.hxx -// Author: Alexey PETROV -// Module : VISU - -#ifndef VISU_MeshPL_HeaderFile -#define VISU_MeshPL_HeaderFile - -#include "VISU_PipeLine.hxx" - -class VISU_MeshPL : public VISU_PipeLine{ -protected: - VISU_MeshPL(); - VISU_MeshPL(const VISU_MeshPL&); -public: - vtkTypeMacro(VISU_MeshPL,VISU_PipeLine); - static VISU_MeshPL* New(); - -public: - virtual void Build(); - virtual void Init(); -}; - -#endif diff --git a/src/PIPELINE/VISU_PipeLineUtils.cxx b/src/PIPELINE/VISU_PipeLineUtils.cxx deleted file mode 100644 index f60c2cca..00000000 --- a/src/PIPELINE/VISU_PipeLineUtils.cxx +++ /dev/null @@ -1,36 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.hxx -// Author: Alexey PETROV -// Module : VISU - -#include "VISU_PipeLineUtils.hxx" - -void VISU::Mul(const float A[3], float b, float C[3]){ // A*b; - for(int i = 0; i < 3; i++) C[i] = A[i]*b; -} - -void VISU::Sub(const float A[3], const float B[3], float C[3]){ //A-B - for(int i = 0; i < 3; i++) C[i] = A[i] - B[i]; -} - diff --git a/src/PIPELINE/VISU_PipeLineUtils.hxx b/src/PIPELINE/VISU_PipeLineUtils.hxx deleted file mode 100644 index df7c8219..00000000 --- a/src/PIPELINE/VISU_PipeLineUtils.hxx +++ /dev/null @@ -1,90 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.hxx -// Author: Alexey PETROV -// Module : VISU - -#ifndef VISU_PipeLineUtils_HeaderFile -#define VISU_PipeLineUtils_HeaderFile - -#include "VISU_FieldTransform.hxx" -#include "VISU_LookupTable.hxx" -#include "VISU_Extractor.hxx" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#ifndef MESSAGE -#define MESSAGE(msg) std::cout<<__FILE__<<"["<<__LINE__<<"]::"< void CellDataToPoint(TItem* theTItem, - vtkCellDataToPointData *theFilter, - vtkDataSet* theDataSet, - VISU_FieldTransform *theFieldTransform) - { - if(theDataSet->GetCellData()->GetNumberOfArrays()){ - theFilter->SetInput(theFieldTransform->GetUnstructuredGridOutput()); - theFilter->PassCellDataOn(); - theTItem->SetInput(theFilter->GetUnstructuredGridOutput()); - }else - theTItem->SetInput(theFieldTransform->GetUnstructuredGridOutput()); - } - - template void ToCellCenters(TItem* theTItem, - vtkCellCenters *theFilter, - vtkDataSet* theDataSet, - VISU_FieldTransform *theFieldTransform) - { - if(theDataSet->GetCellData()->GetNumberOfArrays()){ - theFilter->SetInput(theFieldTransform->GetUnstructuredGridOutput()); - theFilter->VertexCellsOn(); - theTItem->SetInput(theFilter->GetOutput()); - }else - theTItem->SetInput(theFieldTransform->GetUnstructuredGridOutput()); - } -} - -#endif - diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx deleted file mode 100644 index a7e8287e..00000000 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ /dev/null @@ -1,401 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.cxx -// Author: Alexey PETROV -// Module : VISU - - -#include "VISU_Plot3DPL.hxx" -#include "VISU_CutPlanesPL.hxx" -#include "VISU_PipeLineUtils.hxx" - -#include -#include -#include - -#include -#include -#include -#include -#include - -using namespace std; - -vtkStandardNewMacro(VISU_Plot3DPL); - -VISU_Plot3DPL::VISU_Plot3DPL(): - myCellDataToPointData(vtkCellDataToPointData::New(),true), - myAppendPolyData(vtkAppendPolyData::New(),true), - myGeometryFilter(vtkGeometryFilter::New(),true), - myContourFilter(vtkContourFilter::New(),true), - myWarpScalar(vtkWarpScalar::New(),true), - myOrientation(VISU_CutPlanesPL::YZ), - myIsRelative(true), - myIsContour(false), - myPosition(0.5), - myScaleFactor(1.) -{ - myAngle[0] = myAngle[1] = myAngle[2] = 0.; - SetNumberOfContours(32); - myIsShrinkable = false; -} - -VISU_Plot3DPL::~VISU_Plot3DPL() -{ -} - -void -VISU_Plot3DPL:: -ShallowCopy(VISU_PipeLine *thePipeLine) -{ - VISU_ScalarMapPL::ShallowCopy(thePipeLine); - if(VISU_Plot3DPL *aPipeLine = dynamic_cast(thePipeLine)){ - SetOrientation (aPipeLine->GetPlaneOrientation(), - aPipeLine->GetRotateX(), aPipeLine->GetRotateY()); - SetPlanePosition (aPipeLine->GetPlanePosition(), - aPipeLine->IsPositionRelative() ); - SetScaleFactor( aPipeLine->GetScaleFactor() ); - SetContourPrs( aPipeLine->GetIsContourPrs() ); - SetNumberOfContours( aPipeLine->GetNumberOfContours() ); - } -} - -VISU_CutPlanesPL::PlaneOrientation -VISU_Plot3DPL:: -GetOrientation(vtkDataSet* theDataSet) -{ - theDataSet->Update(); - - float aBounds[6]; - theDataSet->GetBounds(aBounds); - float aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]}; - - if(aDelta[0] >= aDelta[1] && aDelta[0] >= aDelta[2]) - if(aDelta[1] >= aDelta[2]) - return VISU_CutPlanesPL::XY; - else - return VISU_CutPlanesPL::ZX; - - if(aDelta[1] >= aDelta[0] && aDelta[1] >= aDelta[2]) - if(aDelta[0] >= aDelta[2]) - return VISU_CutPlanesPL::XY; - else - return VISU_CutPlanesPL::YZ; - - if(aDelta[2] >= aDelta[0] && aDelta[2] >= aDelta[1]) - if(aDelta[0] >= aDelta[1]) - return VISU_CutPlanesPL::ZX; - else - return VISU_CutPlanesPL::YZ; - - return VISU_CutPlanesPL::XY; -} - -float -VISU_Plot3DPL:: -GetScaleFactor(vtkDataSet* theDataSet) -{ - theDataSet->Update(); - float aLength = theDataSet->GetLength(); // diagonal length - - float aScalarRange[2]; - GetSourceRange(aScalarRange); - - static float EPS = 0.3; - float aRange = aScalarRange[1]; - if(aRange > 0.0) - return aLength / aRange * EPS; - - return 0.0; -} - -void -VISU_Plot3DPL:: -Init() -{ - VISU_ScalarMapPL::Init(); - - myOrientation = GetOrientation(GetInput2()); - SetScaleFactor(GetScaleFactor(GetInput2())); -} - -VISU_ScalarMapPL::THook* -VISU_Plot3DPL:: -DoHook() -{ - return myAppendPolyData->GetOutput(); -} - -void -VISU_Plot3DPL:: -Update() -{ - float aPlaneNormal[3]; - float anOrigin[3]; - GetBasePlane( anOrigin, aPlaneNormal ); - - vtkPolyData* aPolyData = 0; - vtkCutter *aCutPlane = 0; - vtkUnstructuredGrid* anUnstructuredGrid = - myFieldTransform->GetUnstructuredGridOutput(); - - if ( !IsPlanarInput() ) - { - aCutPlane = vtkCutter::New(); - aCutPlane->SetInput(anUnstructuredGrid); - - vtkPlane *aPlane = vtkPlane::New(); - aPlane->SetOrigin(anOrigin); - aPlane->SetNormal(aPlaneNormal); - - aCutPlane->SetCutFunction(aPlane); - aPlane->Delete(); - - aPolyData = aCutPlane->GetOutput(); - aPolyData->Update(); - } - - if ( !aPolyData || aPolyData->GetNumberOfCells() == 0 ) { - myGeometryFilter->SetInput(anUnstructuredGrid); - aPolyData = myGeometryFilter->GetOutput(); - aPolyData->Update(); - } - if ( !myIsContour ) // surface prs - { - if(aPolyData->GetCellData()->GetNumberOfArrays()) { - myCellDataToPointData->SetInput(aPolyData); - myCellDataToPointData->PassCellDataOn(); - myWarpScalar->SetInput(myCellDataToPointData->GetPolyDataOutput()); - }else - myWarpScalar->SetInput(aPolyData); - } - else // contour prs - { - if(aPolyData->GetCellData()->GetNumberOfArrays()) { - myCellDataToPointData->SetInput(aPolyData); - myCellDataToPointData->PassCellDataOn(); - myContourFilter->SetInput(myCellDataToPointData->GetOutput()); - }else - myContourFilter->SetInput(aPolyData); - - float aScalarRange[2]; - GetSourceRange(aScalarRange); - - myContourFilter->GenerateValues(GetNumberOfContours(),aScalarRange); - myWarpScalar->SetInput(myContourFilter->GetOutput()); - } - - VISU_CutPlanesPL::ClearAppendPolyData(myAppendPolyData); - myAppendPolyData->AddInput(myWarpScalar->GetPolyDataOutput()); - - if ( aCutPlane ) - aCutPlane->Delete(); - - myWarpScalar->SetNormal(aPlaneNormal); - - VISU_ScalarMapPL::Update(); -} - -void -VISU_Plot3DPL:: -SetNumberOfContours(int theNumber) -{ - myContourFilter->SetNumberOfContours(theNumber); -} - -int -VISU_Plot3DPL:: -GetNumberOfContours() const -{ - return myContourFilter->GetNumberOfContours(); -} - -void -VISU_Plot3DPL:: -SetScaleFactor(float theScaleFactor) -{ - myScaleFactor = theScaleFactor; - myWarpScalar->SetScaleFactor(theScaleFactor); -} - -float -VISU_Plot3DPL:: -GetScaleFactor() const -{ - return myScaleFactor; -} - -void -VISU_Plot3DPL:: -SetPlanePosition(float thePosition, - bool theIsRelative) -{ - myIsRelative = theIsRelative; - myPosition = thePosition; -} - -bool -VISU_Plot3DPL:: -IsPositionRelative() const -{ - return myIsRelative; -} - -VISU_CutPlanesPL::PlaneOrientation -VISU_Plot3DPL:: -GetPlaneOrientation() const -{ - return myOrientation; -} - - -float -VISU_Plot3DPL:: -GetRotateX() -{ - switch(myOrientation){ - case VISU_CutPlanesPL::XY: return myAngle[0]; - case VISU_CutPlanesPL::YZ: return myAngle[1]; - case VISU_CutPlanesPL::ZX: return myAngle[2]; - } - return 0; -} - -float -VISU_Plot3DPL:: -GetRotateY(){ - switch(myOrientation){ - case VISU_CutPlanesPL::XY: return myAngle[1]; - case VISU_CutPlanesPL::YZ: return myAngle[2]; - case VISU_CutPlanesPL::ZX: return myAngle[0]; - } - return 0; -} - -void -VISU_Plot3DPL:: -SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation, - float theXAngle, - float theYAngle) -{ - switch(theOrientation){ - case VISU_CutPlanesPL::XY: myAngle[0] = theXAngle; break; - case VISU_CutPlanesPL::YZ: myAngle[1] = theXAngle; break; - case VISU_CutPlanesPL::ZX: myAngle[2] = theXAngle; break; - } - switch(theOrientation){ - case VISU_CutPlanesPL::XY: myAngle[1] = theYAngle; break; - case VISU_CutPlanesPL::YZ: myAngle[2] = theYAngle; break; - case VISU_CutPlanesPL::ZX: myAngle[0] = theYAngle; break; - } - myOrientation = theOrientation; -} - -float -VISU_Plot3DPL:: -GetPlanePosition() const -{ - return myPosition; -} - -//======================================================================= -//function : GetBasePlane -//purpose : -//======================================================================= - -void VISU_Plot3DPL::GetBasePlane(float theOrigin[3], - float theNormal[3], - bool theCenterOrigine ) const -{ - VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation); - - float aPosition = myPosition; - float aBounds[6], aBoundPrj[3]; - if ( myIsRelative ) - { - GetInput()->GetBounds(aBounds); - VISU_CutPlanesPL::GetBoundProject(aBoundPrj,aBounds,theNormal); - aPosition = aBoundPrj[0] + aBoundPrj[2]*myPosition; - } - VISU::Mul(theNormal,aPosition,theOrigin); - - if ( theCenterOrigine ) { - // move theOrigin to the center of aBounds projections to the plane - GetInput2()->GetBounds(aBounds); - float boundPoints[8][3] = { - {aBounds[0],aBounds[2],aBounds[4]}, - {aBounds[1],aBounds[2],aBounds[4]}, - {aBounds[0],aBounds[3],aBounds[4]}, - {aBounds[1],aBounds[3],aBounds[4]}, - {aBounds[0],aBounds[2],aBounds[5]}, - {aBounds[1],aBounds[2],aBounds[5]}, - {aBounds[0],aBounds[3],aBounds[5]}, - {aBounds[1],aBounds[3],aBounds[5]}}; - float newOrigin[3] = { 0,0,0 }; - for(int i = 0; i < 8; i++) { - float proj[3]; - vtkPlane::ProjectPoint( boundPoints[i], theOrigin, theNormal, proj ); - newOrigin[0] += proj[0]; - newOrigin[1] += proj[1]; - newOrigin[2] += proj[2]; - } - theOrigin[0] = newOrigin[0] / 8.; - theOrigin[1] = newOrigin[1] / 8.; - theOrigin[2] = newOrigin[2] / 8.; - } -} - -//======================================================================= -//function : GetMinMaxPosition -//purpose : return absolute position range -//======================================================================= - -void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const -{ - float aBounds[6], aBoundPrj[3], aNormal[3]; - VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation); - GetInput()->GetBounds(aBounds); - VISU_CutPlanesPL::GetBoundProject(aBoundPrj,aBounds,aNormal); - minPos = aBoundPrj[0]; - maxPos = aBoundPrj[1]; -} - -//======================================================================= -//function : SetMapScale -//purpose : -//======================================================================= - -void VISU_Plot3DPL::SetMapScale(float theMapScale) -{ - VISU_ScalarMapPL::SetMapScale(theMapScale); - - if ( myIsContour ) { - float aRange[2]; - GetSourceRange(aRange); - float aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] }; - myContourFilter->GenerateValues(GetNumberOfContours(),aNewRange); - } - myWarpScalar->SetScaleFactor(myScaleFactor*theMapScale); - - Modified(); -} diff --git a/src/PIPELINE/VISU_Plot3DPL.hxx b/src/PIPELINE/VISU_Plot3DPL.hxx deleted file mode 100644 index 9df47b2d..00000000 --- a/src/PIPELINE/VISU_Plot3DPL.hxx +++ /dev/null @@ -1,128 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_CutPlanesPL.hxx -// Author: Alexey PETROV -// Module : VISU - -#ifndef VISU_Plot3DPL_HeaderFile -#define VISU_Plot3DPL_HeaderFile - -#include "VISU_ScalarMapPL.hxx" -#include "VISU_CutPlanesPL.hxx" - -class vtkWarpScalar; -class vtkContourFilter; -class vtkGeometryFilter; -class vtkCellDataToPointData; - -class VISU_Plot3DPL : public VISU_ScalarMapPL{ -protected: - VISU_Plot3DPL(); - VISU_Plot3DPL(const VISU_Plot3DPL&); - -public: - vtkTypeMacro(VISU_Plot3DPL,VISU_ScalarMapPL); - static VISU_Plot3DPL* New(); - virtual ~VISU_Plot3DPL(); - - virtual - void - ShallowCopy(VISU_PipeLine *thePipeLine); - - VISU_CutPlanesPL::PlaneOrientation - GetPlaneOrientation() const; - - float - GetRotateX(); - - float - GetRotateY(); - - void - SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation, - float theXAngle = 0.0, - float theYAngle = 0.0); - - float - GetPlanePosition() const; - - bool - IsPositionRelative() const; - - void - SetPlanePosition(float thePosition, - bool theIsRelative); - - void - SetScaleFactor(float theScaleFactor); - - float - GetScaleFactor() const; - - void - SetContourPrs (bool theIsContourPrs ) { myIsContour = theIsContourPrs; } - - bool - GetIsContourPrs() { return myIsContour; } - - void - SetNumberOfContours(int theNumber); - - int - GetNumberOfContours() const; - - void GetBasePlane (float theOrigin[3], - float theNormal[3], - bool theCenterOrigine = false ) const; - - void GetMinMaxPosition( float& minPos, float& maxPos ) const; - -public: - virtual void Init(); - virtual void Update(); - - static - VISU_CutPlanesPL::PlaneOrientation - GetOrientation(vtkDataSet* theDataSet); - - float - GetScaleFactor(vtkDataSet* theDataSet); - - void SetMapScale(float theMapScale); - -protected: - virtual THook* DoHook(); - - float myAngle[3]; - bool myIsRelative, myIsContour; - float myPosition, myScaleFactor; - VISU_CutPlanesPL::PlaneOrientation myOrientation; - - TVTKSmartPtr myCellDataToPointData; - TVTKSmartPtr myAppendPolyData; - TVTKSmartPtr myGeometryFilter; - TVTKSmartPtr myContourFilter; - TVTKSmartPtr myWarpScalar; -}; - -#endif diff --git a/src/PIPELINE/VISU_ScalarBarActor.cxx b/src/PIPELINE/VISU_ScalarBarActor.cxx deleted file mode 100644 index afa44bd7..00000000 --- a/src/PIPELINE/VISU_ScalarBarActor.cxx +++ /dev/null @@ -1,607 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.hxx -// Author: Alexey PETROV -// Module : VISU - -#include "VISU_ScalarBarActor.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -vtkCxxRevisionMacro(VISU_ScalarBarActor, "$Revision$"); - -vtkCxxSetObjectMacro(VISU_ScalarBarActor,LookupTable,VISU_LookupTable); -vtkCxxSetObjectMacro(VISU_ScalarBarActor,LabelTextProperty,vtkTextProperty); -vtkCxxSetObjectMacro(VISU_ScalarBarActor,TitleTextProperty,vtkTextProperty); - -//------------------------------------------------------------------------------ -VISU_ScalarBarActor* VISU_ScalarBarActor::New(){ - vtkObject* ret = vtkObjectFactory::CreateInstance("VISU_ScalarBarActor"); - if(ret) - return (VISU_ScalarBarActor*)ret; - return new VISU_ScalarBarActor; -} - -VISU_ScalarBarActor::VISU_ScalarBarActor() -{ - this->LookupTable = NULL; - this->Position2Coordinate->SetValue(0.17, 0.8); - - this->PositionCoordinate->SetCoordinateSystemToNormalizedViewport(); - this->PositionCoordinate->SetValue(0.82,0.1); - - this->MaximumNumberOfColors = 64; - this->NumberOfLabels = 5; - this->NumberOfLabelsBuilt = 0; - this->Orientation = VTK_ORIENT_VERTICAL; - this->Title = NULL; - - this->LabelTextProperty = vtkTextProperty::New(); - this->LabelTextProperty->SetFontSize(12); - this->LabelTextProperty->SetBold(1); - this->LabelTextProperty->SetItalic(1); - this->LabelTextProperty->SetShadow(1); - this->LabelTextProperty->SetFontFamilyToArial(); - - this->TitleTextProperty = vtkTextProperty::New(); - this->TitleTextProperty->ShallowCopy(this->LabelTextProperty); - - this->LabelFormat = new char[8]; - sprintf(this->LabelFormat,"%s","%-#6.3g"); - - this->TitleMapper = vtkTextMapper::New(); - this->TitleActor = vtkActor2D::New(); - this->TitleActor->SetMapper(this->TitleMapper); - this->TitleActor->GetPositionCoordinate()-> - SetReferenceCoordinate(this->PositionCoordinate); - - this->TextMappers = NULL; - this->TextActors = NULL; - - this->ScalarBar = vtkPolyData::New(); - this->ScalarBarMapper = vtkPolyDataMapper2D::New(); - this->ScalarBarMapper->SetInput(this->ScalarBar); - this->ScalarBarActor = vtkActor2D::New(); - this->ScalarBarActor->SetMapper(this->ScalarBarMapper); - this->ScalarBarActor->GetPositionCoordinate()-> - SetReferenceCoordinate(this->PositionCoordinate); - this->LastOrigin[0] = 0; - this->LastOrigin[1] = 0; - this->LastSize[0] = 0; - this->LastSize[1] = 0; -} - -void VISU_ScalarBarActor::ReleaseGraphicsResources(vtkWindow *win) -{ - this->TitleActor->ReleaseGraphicsResources(win); - if (this->TextMappers != NULL ) - { - for (int i=0; i < this->NumberOfLabelsBuilt; i++) - { - this->TextActors[i]->ReleaseGraphicsResources(win); - } - } - this->ScalarBarActor->ReleaseGraphicsResources(win); -} - -VISU_ScalarBarActor::~VISU_ScalarBarActor() -{ - if (this->LabelFormat) - { - delete [] this->LabelFormat; - this->LabelFormat = NULL; - } - - this->TitleMapper->Delete(); - this->TitleActor->Delete(); - - if (this->TextMappers != NULL ) - { - for (int i=0; i < this->NumberOfLabelsBuilt; i++) - { - this->TextMappers[i]->Delete(); - this->TextActors[i]->Delete(); - } - delete [] this->TextMappers; - delete [] this->TextActors; - } - - this->ScalarBar->Delete(); - this->ScalarBarMapper->Delete(); - this->ScalarBarActor->Delete(); - - if (this->Title) - { - delete [] this->Title; - this->Title = NULL; - } - - this->SetLookupTable(NULL); - this->SetLabelTextProperty(NULL); - this->SetTitleTextProperty(NULL); -} - -int VISU_ScalarBarActor::RenderOverlay(vtkViewport *viewport) -{ - int renderedSomething = 0; - int i; - - // Everything is built, just have to render - if (this->Title != NULL) - { - renderedSomething += this->TitleActor->RenderOverlay(viewport); - } - this->ScalarBarActor->RenderOverlay(viewport); - if( this->TextActors == NULL) - { - vtkWarningMacro(<<"Need a mapper to render a scalar bar"); - return renderedSomething; - } - - for (i=0; iNumberOfLabels; i++) - { - renderedSomething += this->TextActors[i]->RenderOverlay(viewport); - } - - renderedSomething = (renderedSomething > 0)?(1):(0); - - return renderedSomething; -} - -int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) -{ - int renderedSomething = 0; - int i; - int size[2]; - - if (!this->LookupTable) - { - vtkWarningMacro(<<"Need a mapper to render a scalar bar"); - return 0; - } - - if (!this->TitleTextProperty) - { - vtkErrorMacro(<<"Need title text property to render a scalar bar"); - return 0; - } - - if (!this->LabelTextProperty) - { - vtkErrorMacro(<<"Need label text property to render a scalar bar"); - return 0; - } - - // Check to see whether we have to rebuild everything - int positionsHaveChanged = 0; - if (viewport->GetMTime() > this->BuildTime || - (viewport->GetVTKWindow() && - viewport->GetVTKWindow()->GetMTime() > this->BuildTime)) - { - // if the viewport has changed we may - or may not need - // to rebuild, it depends on if the projected coords chage - int *barOrigin; - barOrigin = this->PositionCoordinate->GetComputedViewportValue(viewport); - size[0] = - this->Position2Coordinate->GetComputedViewportValue(viewport)[0] - - barOrigin[0]; - size[1] = - this->Position2Coordinate->GetComputedViewportValue(viewport)[1] - - barOrigin[1]; - if (this->LastSize[0] != size[0] || - this->LastSize[1] != size[1] || - this->LastOrigin[0] != barOrigin[0] || - this->LastOrigin[1] != barOrigin[1]) - { - positionsHaveChanged = 1; - } - } - - // Check to see whether we have to rebuild everything - if (positionsHaveChanged || - this->GetMTime() > this->BuildTime || - this->LookupTable->GetMTime() > this->BuildTime || - this->LabelTextProperty->GetMTime() > this->BuildTime || - this->TitleTextProperty->GetMTime() > this->BuildTime) - { - - // Delete previously constructed objects - // - if (this->TextMappers != NULL ) - { - for (i=0; i < this->NumberOfLabelsBuilt; i++) - { - this->TextMappers[i]->Delete(); - this->TextActors[i]->Delete(); - } - delete [] this->TextMappers; - delete [] this->TextActors; - } - - // Build scalar bar object; determine its type - // - VISU_LookupTable *lut = this->LookupTable; //SALOME specific - int isLogTable = lut->GetScale() == VTK_SCALE_LOG10; - - // we hard code how many steps to display - int numColors = this->MaximumNumberOfColors; - float *range = lut->GetRange(); - - int numPts = 2*(numColors + 1); - vtkPoints *pts = vtkPoints::New(); - pts->SetNumberOfPoints(numPts); - vtkCellArray *polys = vtkCellArray::New(); - polys->Allocate(polys->EstimateSize(numColors,4)); - vtkUnsignedCharArray *colors = vtkUnsignedCharArray::New(); - colors->SetNumberOfComponents(3); - colors->SetNumberOfTuples(numColors); - - this->ScalarBarActor->SetProperty(this->GetProperty()); - this->ScalarBar->Initialize(); - this->ScalarBar->SetPoints(pts); - this->ScalarBar->SetPolys(polys); - this->ScalarBar->GetCellData()->SetScalars(colors); - pts->Delete(); polys->Delete(); colors->Delete(); - - // get the viewport size in display coordinates - int *barOrigin, barWidth, barHeight; - barOrigin = this->PositionCoordinate->GetComputedViewportValue(viewport); - size[0] = - this->Position2Coordinate->GetComputedViewportValue(viewport)[0] - - barOrigin[0]; - size[1] = - this->Position2Coordinate->GetComputedViewportValue(viewport)[1] - - barOrigin[1]; - this->LastOrigin[0] = barOrigin[0]; - this->LastOrigin[1] = barOrigin[1]; - this->LastSize[0] = size[0]; - this->LastSize[1] = size[1]; - - // Update all the composing objects - this->TitleActor->SetProperty(this->GetProperty()); - this->TitleMapper->SetInput(this->Title); - if (this->TitleTextProperty->GetMTime() > this->BuildTime) - { - // Shallow copy here so that the size of the title prop is not affected - // by the automatic adjustment of its text mapper's size (i.e. its - // mapper's text property is identical except for the font size - // which will be modified later). This allows text actors to - // share the same text property, and in that case specifically allows - // the title and label text prop to be the same. - this->TitleMapper->GetTextProperty()->ShallowCopy(this->TitleTextProperty); - this->TitleMapper->GetTextProperty()->SetJustificationToCentered(); - } - - // find the best size for the title font - int titleSize[2]; - this->SizeTitle(titleSize, size, viewport); - - // find the best size for the ticks - int labelSize[2]; - this->AllocateAndSizeLabels(labelSize, size, viewport,range); - this->NumberOfLabelsBuilt = this->NumberOfLabels; - - // generate points - float x[3]; x[2] = 0.0; - float delta, val; - if ( this->Orientation == VTK_ORIENT_VERTICAL ) - { - barWidth = size[0] - 4 - labelSize[0]; - barHeight = (int)(0.86*size[1]); - delta=(float)barHeight/numColors; - for (i=0; iSetPoint(2*i,x); - x[0] = barWidth; - pts->SetPoint(2*i+1,x); - } - } - else - { - barWidth = size[0]; - barHeight = (int)(0.4*size[1]); - delta=(float)barWidth/numColors; - for (i=0; iSetPoint(2*i,x); - x[1] = 0; - pts->SetPoint(2*i+1,x); - } - } - - //polygons & cell colors - unsigned char *rgba, *rgb; - vtkIdType ptIds[4]; - for (i=0; iInsertNextCell(4,ptIds); - - if ( isLogTable ){ //SALOME specific - float rgbval = log10(range[0]) + - i*(log10(range[1])-log10(range[0]))/(numColors -1); - rgba = lut->MapValue(rgbval); - }else{ - rgba = lut->MapValue(range[0] + (range[1] - range[0])* - ((float)i /(numColors-1.0))); - } - - rgb = colors->GetPointer(3*i); //write into array directly - rgb[0] = rgba[0]; - rgb[1] = rgba[1]; - rgb[2] = rgba[2]; - } - - // Now position everything properly - // - if (this->Orientation == VTK_ORIENT_VERTICAL) - { - int sizeTextData[2]; - - // center the title - this->TitleActor->SetPosition(size[0]/2, 0.9*size[1]); - - for (i=0; i < this->NumberOfLabels; i++) - { - val = (float)i/(this->NumberOfLabels-1) *barHeight; - this->TextMappers[i]->GetSize(viewport,sizeTextData); - this->TextMappers[i]->GetTextProperty()->SetJustificationToLeft(); - this->TextActors[i]->SetPosition(barWidth+3, - val - sizeTextData[1]/2); - } - } - else - { - this->TitleActor->SetPosition(size[0]/2, - barHeight + labelSize[1] + 0.1*size[1]); - for (i=0; i < this->NumberOfLabels; i++) - { - this->TextMappers[i]->GetTextProperty()->SetJustificationToCentered(); - val = (float)i/(this->NumberOfLabels-1) * barWidth; - this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]); - } - } - - this->BuildTime.Modified(); - } - - // Everything is built, just have to render - if (this->Title != NULL) - { - renderedSomething += this->TitleActor->RenderOpaqueGeometry(viewport); - } - this->ScalarBarActor->RenderOpaqueGeometry(viewport); - for (i=0; iNumberOfLabels; i++) - { - renderedSomething += this->TextActors[i]->RenderOpaqueGeometry(viewport); - } - - renderedSomething = (renderedSomething > 0)?(1):(0); - - return renderedSomething; -} - -void VISU_ScalarBarActor::PrintSelf(ostream& os, vtkIndent indent) -{ - this->Superclass::PrintSelf(os,indent); - - if ( this->LookupTable ) - { - os << indent << "Lookup Table:\n"; - this->LookupTable->PrintSelf(os,indent.GetNextIndent()); - } - else - { - os << indent << "Lookup Table: (none)\n"; - } - - if (this->TitleTextProperty) - { - os << indent << "Title Text Property:\n"; - this->TitleTextProperty->PrintSelf(os,indent.GetNextIndent()); - } - else - { - os << indent << "Title Text Property: (none)\n"; - } - - if (this->LabelTextProperty) - { - os << indent << "Label Text Property:\n"; - this->LabelTextProperty->PrintSelf(os,indent.GetNextIndent()); - } - else - { - os << indent << "Label Text Property: (none)\n"; - } - - os << indent << "Title: " << (this->Title ? this->Title : "(none)") << "\n"; - os << indent << "Maximum Number Of Colors: " - << this->MaximumNumberOfColors << "\n"; - os << indent << "Number Of Labels: " << this->NumberOfLabels << "\n"; - os << indent << "Number Of Labels Built: " << this->NumberOfLabelsBuilt << "\n"; - - os << indent << "Orientation: "; - if ( this->Orientation == VTK_ORIENT_HORIZONTAL ) - { - os << "Horizontal\n"; - } - else - { - os << "Vertical\n"; - } - - os << indent << "Label Format: " << this->LabelFormat << "\n"; -} - -void VISU_ScalarBarActor::ShallowCopy(vtkProp *prop) -{ - VISU_ScalarBarActor *a = VISU_ScalarBarActor::SafeDownCast(prop); - if ( a != NULL ) - { - this->SetPosition2(a->GetPosition2()); - this->SetLookupTable(a->GetLookupTable()); - this->SetMaximumNumberOfColors(a->GetMaximumNumberOfColors()); - this->SetOrientation(a->GetOrientation()); - this->SetLabelTextProperty(a->GetLabelTextProperty()); - this->SetTitleTextProperty(a->GetTitleTextProperty()); - this->SetLabelFormat(a->GetLabelFormat()); - this->SetTitle(a->GetTitle()); - this->GetPositionCoordinate()->SetCoordinateSystem( - a->GetPositionCoordinate()->GetCoordinateSystem()); - this->GetPositionCoordinate()->SetValue( - a->GetPositionCoordinate()->GetValue()); - this->GetPosition2Coordinate()->SetCoordinateSystem( - a->GetPosition2Coordinate()->GetCoordinateSystem()); - this->GetPosition2Coordinate()->SetValue( - a->GetPosition2Coordinate()->GetValue()); - } - - // Now do superclass - this->vtkActor2D::ShallowCopy(prop); -} - -void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size, - vtkViewport *viewport, - float *range) -{ - labelSize[0] = labelSize[1] = 0; - - this->TextMappers = new vtkTextMapper * [this->NumberOfLabels]; - this->TextActors = new vtkActor2D * [this->NumberOfLabels]; - - char string[512]; - - float val; - int i; - - // TODO: this should be optimized, maybe by keeping a list of - // allocated mappers, in order to avoid creation/destruction of - // their underlying text properties (i.e. each time a mapper is - // created, text properties are created and shallow-assigned a font size - // which value might be "far" from the target font size). - - VISU_LookupTable *lut = this->LookupTable; //SALOME specific - int isLogTable = lut->GetScale() == VTK_SCALE_LOG10; - - for (i=0; i < this->NumberOfLabels; i++) - { - this->TextMappers[i] = vtkTextMapper::New(); - - if(isLogTable && 0 < i && i < this->NumberOfLabels - 1){ // SALOME specific - float lval = log10(range[0]) + (float)i/(this->NumberOfLabels-1) * - (log10(range[1])-log10(range[0])); - val = pow(10,lval); - }else{ - val = range[0] + (float)i/(this->NumberOfLabels-1) * (range[1]-range[0]); - } - sprintf(string, this->LabelFormat, val); - this->TextMappers[i]->SetInput(string); - - // Shallow copy here so that the size of the label prop is not affected - // by the automatic adjustment of its text mapper's size (i.e. its - // mapper's text property is identical except for the font size - // which will be modified later). This allows text actors to - // share the same text property, and in that case specifically allows - // the title and label text prop to be the same. - this->TextMappers[i]->GetTextProperty()->ShallowCopy( - this->LabelTextProperty); - - this->TextActors[i] = vtkActor2D::New(); - this->TextActors[i]->SetMapper(this->TextMappers[i]); - this->TextActors[i]->SetProperty(this->GetProperty()); - this->TextActors[i]->GetPositionCoordinate()-> - SetReferenceCoordinate(this->PositionCoordinate); - } - - if (this->NumberOfLabels) - { - int targetWidth, targetHeight; - - if ( this->Orientation == VTK_ORIENT_VERTICAL ) - { - targetWidth = (int)(0.6*size[0]); - targetHeight = (int)(0.86*size[1]/this->NumberOfLabels); - } - else - { - targetWidth = (int)(size[0]*0.8/this->NumberOfLabels); - targetHeight = (int)(0.25*size[1]); - } - - vtkTextMapper::SetMultipleConstrainedFontSize(viewport, - targetWidth, - targetHeight, - this->TextMappers, - this->NumberOfLabels, - labelSize); - } -} - -void VISU_ScalarBarActor::SizeTitle(int *titleSize, int *size, - vtkViewport *viewport) -{ - titleSize[0] = titleSize[1] = 0; - - if (this->Title == NULL || !strlen(this->Title)) - { - return; - } - - int targetWidth, targetHeight; - - targetWidth = size[0]; - if ( this->Orientation == VTK_ORIENT_VERTICAL ) - { - targetHeight = (int)(0.1*size[1]); - } - else - { - targetHeight = (int)(0.25*size[1]); - } - - this->TitleMapper->SetConstrainedFontSize( - viewport, targetWidth, targetHeight); - - this->TitleMapper->GetSize(viewport, titleSize); -} diff --git a/src/PIPELINE/VISU_ScalarBarActor.hxx b/src/PIPELINE/VISU_ScalarBarActor.hxx deleted file mode 100644 index be2f62ce..00000000 --- a/src/PIPELINE/VISU_ScalarBarActor.hxx +++ /dev/null @@ -1,164 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.hxx -// Author: Alexey PETROV -// Module : VISU - -#ifndef VISU_ScalarBarActor_HeaderFile -#define VISU_ScalarBarActor_HeaderFile - -#include "VISU_LookupTable.hxx" - -#include - -class vtkPolyData; -class vtkPolyDataMapper2D; -class vtkScalarsToColors; -class vtkTextMapper; -class vtkTextProperty; - -#ifndef VTK_ORIENT_HORIZONTAL -#define VTK_ORIENT_HORIZONTAL 0 -#endif - -#ifndef VTK_ORIENT_VERTICAL -#define VTK_ORIENT_VERTICAL 1 -#endif - -class VISU_ScalarBarActor : public vtkActor2D -{ -public: - vtkTypeRevisionMacro(VISU_ScalarBarActor,vtkActor2D); - void PrintSelf(ostream& os, vtkIndent indent); - - // Description: - // Instantiate object with 64 maximum colors; 5 labels; %%-#6.3g label - // format, no title, and vertical orientation. The initial scalar bar - // size is (0.05 x 0.8) of the viewport size. - static VISU_ScalarBarActor *New(); - - // Description: - // Draw the scalar bar and annotation text to the screen. - int RenderOpaqueGeometry(vtkViewport* viewport); - int RenderTranslucentGeometry(vtkViewport*) { return 0; }; - int RenderOverlay(vtkViewport* viewport); - - // Description: - // Release any graphics resources that are being consumed by this actor. - // The parameter window could be used to determine which graphic - // resources to release. - virtual void ReleaseGraphicsResources(vtkWindow *); - - // Description: - // Set/Get the vtkLookupTable to use. The lookup table specifies the number - // of colors to use in the table (if not overridden), as well as the scalar - // range. - virtual void SetLookupTable(VISU_LookupTable*); - vtkGetObjectMacro(LookupTable,VISU_LookupTable); - - // Description: - // Set/Get the maximum number of scalar bar segments to show. This may - // differ from the number of colors in the lookup table, in which case - // the colors are samples from the lookup table. - vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_LARGE_INTEGER); - vtkGetMacro(MaximumNumberOfColors, int); - - // Description: - // Set/Get the number of annotation labels to show. - vtkSetClampMacro(NumberOfLabels, int, 0, 64); - vtkGetMacro(NumberOfLabels, int); - - // Description: - // Control the orientation of the scalar bar. - vtkSetClampMacro(Orientation,int,VTK_ORIENT_HORIZONTAL, VTK_ORIENT_VERTICAL); - vtkGetMacro(Orientation, int); - void SetOrientationToHorizontal() - {this->SetOrientation(VTK_ORIENT_HORIZONTAL);}; - void SetOrientationToVertical() {this->SetOrientation(VTK_ORIENT_VERTICAL);}; - - // Description: - // Set/Get the title text property. - virtual void SetTitleTextProperty(vtkTextProperty *p); - vtkGetObjectMacro(TitleTextProperty,vtkTextProperty); - - // Description: - // Set/Get the labels text property. - virtual void SetLabelTextProperty(vtkTextProperty *p); - vtkGetObjectMacro(LabelTextProperty,vtkTextProperty); - - // Description: - // Set/Get the format with which to print the labels on the scalar - // bar. - vtkSetStringMacro(LabelFormat); - vtkGetStringMacro(LabelFormat); - - // Description: - // Set/Get the title of the scalar bar actor, - vtkSetStringMacro(Title); - vtkGetStringMacro(Title); - - // Description: - // Shallow copy of a scalar bar actor. Overloads the virtual vtkProp method. - void ShallowCopy(vtkProp *prop); - -protected: - VISU_ScalarBarActor(); - ~VISU_ScalarBarActor(); - - VISU_LookupTable *LookupTable; - vtkTextProperty *TitleTextProperty; - vtkTextProperty *LabelTextProperty; - - int MaximumNumberOfColors; - int NumberOfLabels; - int NumberOfLabelsBuilt; - int Orientation; - char *Title; - char *LabelFormat; - - vtkTextMapper **TextMappers; - virtual void AllocateAndSizeLabels(int *labelSize, int *size, - vtkViewport *viewport, float *range); - -private: - vtkTextMapper *TitleMapper; - vtkActor2D *TitleActor; - - vtkActor2D **TextActors; - - vtkPolyData *ScalarBar; - vtkPolyDataMapper2D *ScalarBarMapper; - vtkActor2D *ScalarBarActor; - - vtkTimeStamp BuildTime; - int LastSize[2]; - int LastOrigin[2]; - - void SizeTitle(int *titleSize, int *size, vtkViewport *viewport); - -private: - VISU_ScalarBarActor(const VISU_ScalarBarActor&); // Not implemented. - void operator=(const VISU_ScalarBarActor&); // Not implemented. -}; - -#endif diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx deleted file mode 100644 index 9b9f781e..00000000 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ /dev/null @@ -1,404 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.cxx -// Author: Alexey PETROV -// Module : VISU - - -#include "VISU_StreamLinesPL.hxx" -#include "VISU_PipeLineUtils.hxx" -#include "VISU_UsedPointsFilter.hxx" -#include "VTKViewer_GeometryFilter.h" - -#include - -#include -#include -#include - -#ifdef _DEBUG_ -static int MYDEBUG = 1; -#else -static int MYDEBUG = 0; -#endif - -static float EPS = 1.0e-7; -static float aMinNbOfSteps = 1.0E+2; -//static float aMaxNbOfSteps = 1.0E+3; -static float aCoeffOfIntStep = 1.0E+1; - - -vtkStandardNewMacro(VISU_StreamLinesPL); - -VISU_StreamLinesPL::VISU_StreamLinesPL(){ - myStream = vtkStreamLine::New(); - myCenters = vtkCellCenters::New(); - myGeomFilter = VTKViewer_GeometryFilter::New(); - myPointsFilter = VISU_UsedPointsFilter::New(); - myPercents = 0.3; - mySource = NULL; -} - -VISU_StreamLinesPL::~VISU_StreamLinesPL(){ - myPointsFilter->UnRegisterAllOutputs(); - myPointsFilter->Delete(); - - myCenters->UnRegisterAllOutputs(); - myCenters->Delete(); - - myGeomFilter->UnRegisterAllOutputs(); - myGeomFilter->Delete(); - - myStream->UnRegisterAllOutputs(); - myStream->Delete(); -} - -void VISU_StreamLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_DeformedShapePL::ShallowCopy(thePipeLine); - if(VISU_StreamLinesPL *aPipeLine = dynamic_cast(thePipeLine)) - SetParams(aPipeLine->GetIntegrationStep(), - aPipeLine->GetPropagationTime(), - aPipeLine->GetStepLength(), - aPipeLine->GetSource(), - aPipeLine->GetUsedPoints(), - aPipeLine->GetDirection()); -} - - -float VISU_StreamLinesPL::GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength, - float thePropogationTime, float thePercents) -{ - static float aStreamPointSize = sizeof(float)*15 + sizeof(vtkIdType)*2; - static float aStreamArraySize = aStreamPointSize*1024; // == 69632 - - float aNbCells = thePercents*theNbOfPoints*2.0; - float aNbPointsPerCell = thePropogationTime/theStepLength; - float aCellsSize = aNbCells*(1+aNbPointsPerCell); - float aPointsSize = aCellsSize*3.0*sizeof(float); - - float aConnectivitySize = aCellsSize*sizeof(vtkIdType); - float aTypesSize = aNbCells*sizeof(char); - float aLocationsSize = aNbCells*sizeof(int); - //float aNbCellsPerPoint = aCellsSize / aNbCells - 1; - float aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize; - - float anAssignedDataSize = aCellsSize*4.0*sizeof(float); - float anOutputDataSetSize = aMeshSize + anAssignedDataSize; - - float aResult = aStreamArraySize*aNbCells + anOutputDataSetSize; - return aResult; -} - -int VISU_StreamLinesPL::FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength, - float& thePropogationTime, float& thePercents) -{ - static float aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0; - vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints(); - float aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents); - int isPoss = CheckAvailableMemory(aSize); - if(!isPoss){ - float aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime); - float aMinStepLength = GetMinStepLength(theDataSet); - float aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease; - for(int i = 2, aStepChanged = 1, aPerecentsChanged = 1; aStepChanged || aPerecentsChanged; i++){ - float aStepLength = theStepLength + aDeltaStepLength; - if(aStepLength < aMaxStepLength) theStepLength = aStepLength; - else if(aStepChanged){ - aStepLength = aMaxStepLength; - aStepChanged = 0; - } - float aPercents = thePercents /= aPercentsDecrease; - if(aPercents*aNbOfPoints > 1) thePercents = aPercents; - else if(aPerecentsChanged) { - thePercents = 1.1 / aNbOfPoints; - aPerecentsChanged = 0; - } - aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents); - if(CheckAvailableMemory(aSize)){ - isPoss = i; - break; - } - } - } - if(MYDEBUG) MESSAGE("FindPossibleParams - aSize = "< - -using namespace std; - -class vtkPointSet; -class vtkCellCenters; -class VTKViewer_GeometryFilter; -class VISU_UsedPointsFilter; - -class VISU_StreamLinesPL : public VISU_DeformedShapePL{ -protected: - VISU_StreamLinesPL(); - VISU_StreamLinesPL(const VISU_StreamLinesPL&); -public: - vtkTypeMacro(VISU_StreamLinesPL,VISU_DeformedShapePL); - static VISU_StreamLinesPL* New(); - virtual ~VISU_StreamLinesPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - - virtual int SetParams(float theIntStep, - float thePropogationTime, - float theStepLength, - vtkPointSet* theSource = NULL, - float thePercents = 0.3, - int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS, - int isOnlyTry = false); - virtual vtkPointSet* GetSource(); - virtual float GetUsedPoints(); - virtual float GetIntegrationStep(); - virtual float GetPropagationTime(); - virtual float GetStepLength(); - virtual int GetDirection(); - - virtual vtkDataSet* GetStreamerSource(); - virtual float GetVelocityCoeff(); - - virtual float GetMaxIntegrationStep(); - virtual float GetMinIntegrationStep(); - - virtual float GetMinStepLength(); - virtual float GetMaxStepLength(); - - virtual float GetMinPropagationTime(); - virtual float GetMaxPropagationTime(); - virtual float GetBasePropagationTime(); - -public: - virtual THook* DoHook(); - virtual void Init(); - virtual void Update(); - virtual void SetMapScale(float theMapScale = 1.0); - -public: - static float GetMaxIntegrationStep(vtkPointSet* theDataSet); - static float GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3); - static float GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3); - - static float GetMinPropagationTime(vtkPointSet* theDataSet); - static float GetMaxPropagationTime(vtkPointSet* theDataSet); - static float GetBasePropagationTime(vtkPointSet* theDataSet); - - static float GetMinStepLength(vtkPointSet* theDataSet); - static float GetMaxStepLength(vtkPointSet* theDataSet); - static float GetBaseStepLength(vtkPointSet* theDataSet); - - static float GetVelocityCoeff(vtkPointSet* theDataSet); - - static int IsPossible(vtkPointSet* theDataSet, float thePercents = 0.3); - -protected: - static float GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength, - float thePropogationTime, float thePercents = 0.3); - static int FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength, - float& thePropogationTime, float& thePercents); - - static float CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents = 0.3); - static float CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet); - static float CorrectStepLength(float theStep, vtkPointSet* theDataSet); - - vtkStreamLine* myStream; - vtkPointSet* mySource; - vtkCellCenters* myCenters; - VTKViewer_GeometryFilter *myGeomFilter; - VISU_UsedPointsFilter *myPointsFilter; - float myPercents; -}; - - -#endif - diff --git a/src/PIPELINE/VISU_UsedPointsFilter.cxx b/src/PIPELINE/VISU_UsedPointsFilter.cxx deleted file mode 100644 index 311248cf..00000000 --- a/src/PIPELINE/VISU_UsedPointsFilter.cxx +++ /dev/null @@ -1,70 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_StreamLinesPL.cxx -// Author: Alexey PETROV -// Module : VISU - - -#include "VISU_UsedPointsFilter.hxx" - -#include -#include -#include -#include -#include -#include - -vtkStandardNewMacro(VISU_UsedPointsFilter); - -VISU_UsedPointsFilter::VISU_UsedPointsFilter(){ - PercentsOfUsedPoints = 1.0; -} - -VISU_UsedPointsFilter::~VISU_UsedPointsFilter(){} - -void VISU_UsedPointsFilter::Execute(){ - vtkPointSet *anInput = this->GetInput(), *anOutput = this->GetOutput(); - anOutput->GetPointData()->CopyAllOff(); - anOutput->GetCellData()->CopyAllOff(); - anOutput->CopyStructure(anInput); - - vtkPoints* aPoints = vtkPoints::New(); - vtkIdList *anIdList = vtkIdList::New(); - vtkIdType iEnd = anInput->GetNumberOfPoints(); - for(vtkIdType i = 0; i < iEnd; i++){ - anInput->GetPointCells(i,anIdList); - if(anIdList->GetNumberOfIds() > 0) - aPoints->InsertNextPoint(anInput->GetPoint(i)); - } - vtkPoints* aNewPoints = vtkPoints::New(); - iEnd = aPoints->GetNumberOfPoints(); - if (PercentsOfUsedPoints > 0){ - vtkIdType anOffset = vtkIdType(1.0/PercentsOfUsedPoints); - if(anOffset < 1) anOffset = 1; - for(vtkIdType i = 0; i < iEnd; i += anOffset) - aNewPoints->InsertNextPoint(aPoints->GetPoint(i)); - } - anOutput->SetPoints(aNewPoints); - aNewPoints->Delete(); - aPoints->Delete(); -} diff --git a/src/PIPELINE/VISU_UsedPointsFilter.hxx b/src/PIPELINE/VISU_UsedPointsFilter.hxx deleted file mode 100644 index 273ab3d2..00000000 --- a/src/PIPELINE/VISU_UsedPointsFilter.hxx +++ /dev/null @@ -1,49 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_UsedPointsFilter.hxx -// Author: Alexey PETROV -// Module : VISU - -#ifndef VISU_UsedPointsFilter_HeaderFile -#define VISU_UsedPointsFilter_HeaderFile - -#include - -class VISU_UsedPointsFilter : public vtkPointSetToPointSetFilter{ -protected: - VISU_UsedPointsFilter(); - VISU_UsedPointsFilter(const VISU_UsedPointsFilter&); - - virtual void Execute(); - float PercentsOfUsedPoints; - -public: - vtkTypeMacro(VISU_UsedPointsFilter,vtkPointSetToPointSetFilter); - static VISU_UsedPointsFilter* New(); - virtual ~VISU_UsedPointsFilter(); - - vtkSetMacro(PercentsOfUsedPoints,float); - vtkGetMacro(PercentsOfUsedPoints,float); -}; - -#endif diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx deleted file mode 100644 index c34d36d9..00000000 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ /dev/null @@ -1,183 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.cxx -// Author: Alexey PETROV -// Module : VISU - - -#include "VISU_VectorsPL.hxx" -#include "VISU_PipeLineUtils.hxx" -#include "VTKViewer_TransformFilter.h" -#include "VTKViewer_Transform.h" - -#include -#include -#include -#include - -vtkStandardNewMacro(VISU_VectorsPL); - -VISU_VectorsPL::VISU_VectorsPL(){ - myGlyph = vtkGlyph3D::New(); - - myGlyphSource = vtkGlyphSource2D::New(); - myConeSource = vtkConeSource::New(); - myLineSource = vtkLineSource::New(); - - myCenters = vtkCellCenters::New(); - myTransformFilter = VTKViewer_TransformFilter::New(); - myIsShrinkable = false; -} - -VISU_VectorsPL::~VISU_VectorsPL(){ - myGlyph->UnRegisterAllOutputs(); - myGlyph->Delete(); - - myCenters->UnRegisterAllOutputs(); - myCenters->Delete(); - - myGlyphSource->UnRegisterAllOutputs(); - myGlyphSource->Delete(); - - myConeSource->UnRegisterAllOutputs(); - myConeSource->Delete(); - - myLineSource->UnRegisterAllOutputs(); - myLineSource->Delete(); - - myTransformFilter->UnRegisterAllOutputs(); - myTransformFilter->Delete(); -} - -void VISU_VectorsPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_DeformedShapePL::ShallowCopy(thePipeLine); - if(VISU_VectorsPL *aPipeLine = dynamic_cast(thePipeLine)){ - SetGlyphType(aPipeLine->GetGlyphType()); - SetGlyphPos(aPipeLine->GetGlyphPos()); - } -} - - -void VISU_VectorsPL::SetTransform(VTKViewer_Transform* theTransform){ - myFieldTransform->SetSpaceTransform(theTransform); - myTransformFilter->SetTransform(theTransform); - myTransformFilter->Modified(); -} -VTKViewer_Transform* VISU_VectorsPL::GetTransform(){ - return myFieldTransform->GetSpaceTransform(); -} - - -void VISU_VectorsPL::SetScale(float theScale) { - if(myScaleFactor == theScale) return; - myScaleFactor = theScale; - myGlyph->SetScaleFactor(myScaleFactor); - Modified(); -} -float VISU_VectorsPL::GetScale() { - return myGlyph->GetScaleFactor(); -} - - -void VISU_VectorsPL::Init(){ - VISU_DeformedShapePL::Init(); - - myTypeGlyph = ARROW; - myPosGlyph = TAIL; -} - - -VISU_ScalarMapPL::THook* VISU_VectorsPL::DoHook(){ - VISU::ToCellCenters(myTransformFilter,myCenters,GetInput2(),myFieldTransform); - myGlyph->SetInput(myTransformFilter->GetOutput()); - myGlyph->SetVectorModeToUseVector(); - myGlyph->SetScaleModeToScaleByVector(); - myGlyph->SetColorModeToColorByScalar(); - return myGlyph->GetOutput(); -} - - -void VISU_VectorsPL::Update(){ - switch (myTypeGlyph) { - case ARROW: { - myGlyphSource->SetGlyphTypeToArrow(); - myGlyphSource->SetFilled(0); - switch (myPosGlyph) { - case TAIL: - myGlyphSource->SetCenter(0.5, 0.0, 0.0); - break; - case HEAD: - myGlyphSource->SetCenter(-0.5, 0.0, 0.0); - break; - case CENTER: - myGlyphSource->SetCenter(0.0, 0.0, 0.0); - } -// if(myPosGlyph == TAIL) -// myGlyphSource->SetCenter(0.5, 0.0, 0.0); -// else if(myPosGlyph == HEAD) -// myGlyphSource->SetCenter(-0.5, 0.0, 0.0); - myGlyph->SetSource(myGlyphSource->GetOutput()); - } - break; - case CONE2: - case CONE6: { - if (myTypeGlyph == CONE2) - myConeSource->SetResolution(3); - else - myConeSource->SetResolution(7); - myConeSource->SetHeight(1.0); - myConeSource->SetRadius(.1); - - switch (myPosGlyph) { - case TAIL: - myConeSource->SetCenter(0.5, 0.0, 0.0); - break; - case HEAD: - myConeSource->SetCenter(-0.5, 0.0, 0.0); - break; - case CENTER: - myConeSource->SetCenter(0.0, 0.0, 0.0); - } -// if(myPosGlyph == TAIL) -// myConeSource->SetCenter(0.5, 0.0, 0.0); -// else if(myPosGlyph == HEAD) -// myConeSource->SetCenter(-0.5, 0.0, 0.0); - myGlyph->SetSource(myConeSource->GetOutput()); - } - break; - case NONE: - default: { - myGlyph->SetSource(myLineSource->GetOutput()); - } - } - - VISU_DeformedShapePL::Update(); -} - - -void VISU_VectorsPL::SetMapScale(float theMapScale){ - VISU_ScalarMapPL::SetMapScale(theMapScale); - - myGlyph->SetScaleFactor(myScaleFactor*theMapScale); - myGlyph->Modified(); -} diff --git a/src/PIPELINE/VISU_VectorsPL.hxx b/src/PIPELINE/VISU_VectorsPL.hxx deleted file mode 100644 index 8b24ece6..00000000 --- a/src/PIPELINE/VISU_VectorsPL.hxx +++ /dev/null @@ -1,87 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File: VISU_PipeLine.hxx -// Author: Alexey PETROV -// Module : VISU - -#ifndef VISU_VectorsPL_HeaderFile -#define VISU_VectorsPL_HeaderFile - -#include "VISU_DeformedShapePL.hxx" - -class VTKViewer_TransformFilter; -class VTKViewer_Transform; -class vtkCellCenters; - -class vtkGlyphSource2D; -class vtkConeSource; -class vtkLineSource; - -class vtkGlyph3D; - -class VISU_VectorsPL : public VISU_DeformedShapePL{ -protected: - VISU_VectorsPL(); - VISU_VectorsPL(const VISU_VectorsPL&); -public: - vtkTypeMacro(VISU_VectorsPL,VISU_DeformedShapePL); - static VISU_VectorsPL* New(); - virtual ~VISU_VectorsPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - - virtual void SetScale(float theScale); - virtual float GetScale(); - - enum GlyphType{ ARROW, CONE2, CONE6, NONE}; - virtual void SetGlyphType(GlyphType theType) { myTypeGlyph = theType;} - virtual GlyphType GetGlyphType() { return myTypeGlyph;} - - enum GlyphPos{ CENTER, TAIL,HEAD}; - virtual void SetGlyphPos(GlyphPos thePos) { myPosGlyph = thePos;} - virtual GlyphPos GetGlyphPos() { return myPosGlyph;} - -public: - virtual THook* DoHook(); - virtual void Init(); - virtual void Update(); - - virtual void SetTransform(VTKViewer_Transform* theTransform); - virtual VTKViewer_Transform* GetTransform(); - - virtual void SetMapScale(float theMapScale = 1.0); - -protected: - GlyphType myTypeGlyph; - GlyphPos myPosGlyph; - vtkGlyph3D *myGlyph; - - vtkGlyphSource2D *myGlyphSource; - vtkLineSource *myLineSource; - vtkConeSource *myConeSource; - - vtkCellCenters* myCenters; - VTKViewer_TransformFilter *myTransformFilter; -}; - - -#endif diff --git a/src/VISUGUI/VISU_icons.po b/src/VISUGUI/VISU_icons.po deleted file mode 100644 index 4422d48d..00000000 --- a/src/VISUGUI/VISU_icons.po +++ /dev/null @@ -1,58 +0,0 @@ -# VISU VISUGUI : GUI of VISU component -# -# Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -# -# -# File : VisuGUI_icons.po -# Module : VISU - -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" -"PO-Revision-Date: YYYY-MM-DD\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - - -msgid "ICON_OBJBROWSER_Visu" -msgstr "Visu_tree_visu.png" - -msgid "ICON_SCALAR_MAP" -msgstr "Visu_scalars.png" - -msgid "ICON_DEFORMED_SHAPE" -msgstr "Visu_deformed.png" - -msgid "ICON_VECTORS" -msgstr "Visu_vectors.png" - -msgid "ICON_ISO_SURFACES" -msgstr "Visu_isosurfaces.png" - -msgid "ICON_CUT_PLANES" -msgstr "Visu_cutplane.png" - -msgid "ICON_CUT_LINES" -msgstr "Visu_cutlines.png" - -msgid "ICON_STREAM_LINES" -msgstr "Visu_streamlines.png" diff --git a/src/VISUGUI/VISU_images.po b/src/VISUGUI/VISU_images.po deleted file mode 100644 index 0f7909b9..00000000 --- a/src/VISUGUI/VISU_images.po +++ /dev/null @@ -1,98 +0,0 @@ -# VISU VISUGUI : GUI of VISU component -# -# Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -# -# -# File : VisuGUI_icons.po -# Module : VISU - -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" -"PO-Revision-Date: 2005-05-10 15:20+0400\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - - -msgid "ICON_OBJBROWSER_Visu" -msgstr "Visu_tree_visu.png" - -msgid "ICON_SCALAR_MAP" -msgstr "Visu_scalars.png" - -msgid "ICON_DEFORMED_SHAPE" -msgstr "Visu_deformed.png" - -msgid "ICON_VECTORS" -msgstr "Visu_vectors.png" - -msgid "ICON_ISO_SURFACES" -msgstr "Visu_isosurfaces.png" - -msgid "ICON_CUT_PLANES" -msgstr "Visu_cutplane.png" - -msgid "ICON_CUT_LINES" -msgstr "Visu_cutlines.png" - -msgid "ICON_STREAM_LINES" -msgstr "Visu_streamlines.png" - -msgid "ICON_PLOT2D" -msgstr "Visu_plot2d.png" - -# Representation menu - -msgid "ICON_POINTS" -msgstr "Visu_points.png" - -msgid "ICON_WIREFRAME" -msgstr "Visu_wireframe.png" - -msgid "ICON_SURFACE" -msgstr "Visu_surface.png" - -msgid "ICON_ERASE_ALL" -msgstr "Visu_eraseall.png" - -msgid "ICON_GLOBAL_SELECTION" -msgstr "Visu_selectall.png" - -msgid "ICON_PARTIAL_SELECTION" -msgstr "Visu_selectonly.png" - -msgid "ICON_SCALING" -msgstr "Visu_scaling.png" - -# - -msgid "ICON_TIMEANIMATION" -msgstr "Visu_anim.png" - -msgid "ICON_SWEEP" -msgstr "Visu_scalars_anim.png" - -msgid "ICON_PLOT_3D" -msgstr "Visu_plot3d.png" - -msgid "ICON_CUBE_AXES" -msgstr "Visu_graduated_axes.png" diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h deleted file mode 100644 index 2e985a1e..00000000 --- a/src/VISUGUI/VisuGUI.h +++ /dev/null @@ -1,152 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI.h -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -#ifndef VisuGUI_HeaderFile -#define VisuGUI_HeaderFile - -#include "SalomeApp_Module.h" - -class SUIT_ViewManager; - -class VisuGUI: public SalomeApp_Module -{ - Q_OBJECT; - -public: - - VisuGUI(); - virtual ~VisuGUI(); - - virtual void initialize( CAM_Application* ); - virtual void windows( QMap& ) const; - virtual void viewManagers( QStringList& ) const; - - virtual QString engineIOR() const; - - virtual void studyActivated(); - - virtual void contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, QString& theTitle ); - - virtual void createPreferences(); - virtual void preferencesChanged( const QString&, const QString& ); - - virtual - SUIT_ViewManager* - getViewManager(const QString& theType, - const bool theIsCreate); - -public slots: - virtual bool deactivateModule( SUIT_Study* ); - virtual bool activateModule( SUIT_Study* ); - -protected slots: - void OnImportFromFile(); - void OnExploreMEDFile(); - void OnImportTableFromFile(); - void OnExportTableToFile(); - void OnImportMedField(); - - void OnCreateMesh(); - void OnCreateScalarMap(); - void OnCreateDeformedShape(); - void OnCreateVectors(); - void OnCreateIsoSurfaces(); - void OnCreateCutPlanes(); - void OnCreateCutLines(); - void OnCreateStreamLines(); - void OnCreatePlot3D(); - void OnCreateManyMesh(); - void OnCreatePlot2dView(); - - void OnEditScalarMap(); - void OnEditDeformedShape(); - void OnEditCutPlanes(); - void OnEditCutLines(); - void OnEditIsoSurfaces(); - void OnEditVectors(); - void OnEditStreamLines(); - void OnEditPlot3D(); - - virtual void OnDisplayPrs(); - virtual void OnDisplayOnlyPrs(); - virtual void OnErasePrs(); - virtual void OnEraseAll(); - - void OnMakeSurfaceframe(); - void OnMakeInsideframe(); - void OnMakeWireframe(); - void OnMakeSurface(); - void OnMakePoints(); - void OnMakeShrink(); - - void OnChangeColor(); - void OnChangeWireframeColor(); - void OnChangeOpacity(); - void OnChangeLines(); - - void OnShowTable(); - void OnCreateTable(); - void OnDeleteObjects(); - void OnPlotData(); - void OnCurveProperties(); - void OnClearContainer(); - void OnEditContainer(); - - void OnMergeScalarBars(); - void OnFreeScalarBars(); - - void OnSaveViewParams(); - void OnRestoreViewParams(); - - void OnRename(); - void OnClippingPlanes(); - void OnSweep(); - void OnTimeAnimation(); - void OnShowAnimation(); - - void OnCopyPresentation(); - - void OnSelectionInfo(); - - void OnTranslatePrs(); - void OnArrangeActors(); - - void OnScaling(); - void OnCubeAxes(); - -protected: - virtual SalomeApp_Selection* createSelection() const; - -private: - void createActions(); - void createMenus(); - void createToolBars(); - void createPopupMenus(); -}; - -#endif diff --git a/src/VISUGUI/VisuGUI_CubeAxesDlg.cxx b/src/VISUGUI/VisuGUI_CubeAxesDlg.cxx deleted file mode 100755 index 97640bd6..00000000 --- a/src/VISUGUI/VisuGUI_CubeAxesDlg.cxx +++ /dev/null @@ -1,594 +0,0 @@ -// VISU VISUGUI : GUI for SMESH component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_CubeAxesDlg.cxx -// Author : Sergey LITONIN -// Module : VISU - -#include "VisuGUI_CubeAxesDlg.h" - -#include "VisuGUI.h" -#include "VisuGUI_Tools.h" -#include "VisuGUI_FontWg.h" - -#include "SVTK_ViewWindow.h" -#include "SVTK_CubeAxesActor2D.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/*! - * Class : AxisWg - * Description : Tab of dialog - */ - -//======================================================================= -// name : VisuGUI_AxisWg::AxisWg -// Purpose : Constructor -//======================================================================= -VisuGUI_AxisWg::VisuGUI_AxisWg (QWidget* theParent) -: QFrame(theParent) -{ - QValueList< QLabel* > aLabels; - - // "Name" grp - - myNameGrp = new QGroupBox(3, Qt::Vertical, tr("AXIS_NAME"), this); - myIsNameVisible = new QCheckBox(tr("IS_VISIBLE"), myNameGrp); - - QHBox* aHBox = new QHBox(myNameGrp); - aHBox->setSpacing(5); - QLabel* aLabel = new QLabel(tr("NAME"), aHBox); - myAxisName = new QLineEdit(aHBox); - aLabels.append(aLabel); - - aHBox = new QHBox(myNameGrp); - aHBox->setSpacing(5); - aLabel = new QLabel(tr("FONT"), aHBox); - myNameFont = new VisuGUI_FontWg(aHBox); - aLabels.append(aLabel); - - - // "Labels" grp - - myLabelsGrp = new QGroupBox(4, Qt::Vertical, tr("LABELS"), this); - myIsLabelsVisible = new QCheckBox(tr("IS_VISIBLE"), myLabelsGrp); - - aHBox = new QHBox(myLabelsGrp); - aHBox->setSpacing(5); - aLabel = new QLabel(tr("NUMBER"), aHBox); - myLabelNumber = new QLineEdit(aHBox); - myLabelNumber->setValidator(new QIntValidator(0, 25, this)); - myLabelNumber->installEventFilter(this); - aLabels.append(aLabel); - - aHBox = new QHBox(myLabelsGrp); - aHBox->setSpacing(5); - aLabel = new QLabel(tr("OFFSET"), aHBox); - myLabelOffset = new QLineEdit(aHBox); - aLabels.append(aLabel); - - aHBox = new QHBox(myLabelsGrp); - aHBox->setSpacing(5); - aLabel = new QLabel(tr("FONT"), aHBox); - myLabelsFont = new VisuGUI_FontWg(aHBox); - aLabels.append(aLabel); - - // "Tick marks" grp - - myTicksGrp = new QGroupBox(2, Qt::Vertical, tr("TICK_MARKS"), this); - myIsTicksVisible = new QCheckBox(tr("IS_VISIBLE"), myTicksGrp); - - aHBox = new QHBox(myTicksGrp); - aHBox->setSpacing(5); - aLabel = new QLabel(tr("LENGTH"), aHBox); - myTickLength = new QLineEdit(aHBox); - aLabels.append(aLabel); - - // Layout - - QVBoxLayout* aLay = new QVBoxLayout(this, 0, 5); - aLay->addWidget(myNameGrp); - aLay->addWidget(myLabelsGrp); - aLay->addWidget(myTicksGrp); - - // init - myIsNameVisible->setChecked(true); - myIsLabelsVisible->setChecked(true); - myIsTicksVisible->setChecked(true); - updateControlState(); - - // Adjust label widths - QValueList< QLabel* >::iterator anIter; - int aMaxWidth = 0; - for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++) - aMaxWidth = QMAX(aMaxWidth, (*anIter)->sizeHint().width()); - for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++) - (*anIter)->setFixedWidth(aMaxWidth); - - // connect signals and slots - connect(myIsNameVisible, SIGNAL(stateChanged(int)), SLOT(onNameChecked())); - connect(myIsLabelsVisible, SIGNAL(stateChanged(int)), SLOT(onLabelsChecked())); - connect(myIsTicksVisible, SIGNAL(stateChanged(int)), SLOT(onTicksChecked())); -} - -VisuGUI_AxisWg::~VisuGUI_AxisWg() -{ -} - -void VisuGUI_AxisWg::updateControlState() -{ - onNameChecked(); - onLabelsChecked(); - onTicksChecked(); -} - -bool VisuGUI_AxisWg::eventFilter(QObject* o, QEvent* e) -{ - if (e->type() == QEvent::FocusOut) { - bool isOK = false; - int k = myLabelNumber->text().toInt(&isOK); - if (isOK && k > 25) myLabelNumber->setText("25"); - } - return false; -} - -//======================================================================= -// name : VisuGUI_AxisWg::onNameChecked -// Purpose : -//======================================================================= -void VisuGUI_AxisWg::setEnabled(QGroupBox* theGrp, const bool theState) -{ - QObjectList aChildren(*theGrp->children()); - QObject* anObj; - for(anObj = aChildren.first(); anObj !=0; anObj = aChildren.next()) - if (anObj !=0 && anObj->inherits("QHBox")) - ((QHBox*)anObj)->setEnabled(theState); -} - -//======================================================================= -// Labels : VisuGUI_AxisWg::onLabelsChecked -// Purpose : -//======================================================================= -void VisuGUI_AxisWg::onLabelsChecked() -{ - setEnabled(myLabelsGrp, myIsLabelsVisible->isChecked()); -} - -//======================================================================= -// Labels : VisuGUI_AxisWg::onTicksChecked -// Purpose : -//======================================================================= -void VisuGUI_AxisWg::onTicksChecked() -{ - setEnabled(myTicksGrp, myIsTicksVisible->isChecked()); -} - -//======================================================================= -// name : VisuGUI_AxisWg::onNameChecked -// Purpose : -//======================================================================= -void VisuGUI_AxisWg::onNameChecked() -{ - setEnabled(myNameGrp, myIsNameVisible->isChecked()); -} - -//======================================================================= -// name : VisuGUI_AxisWg::UseName -// Purpose : -//======================================================================= -void VisuGUI_AxisWg::UseName(const bool toUse) -{ - myIsNameVisible->setChecked(toUse); -} - -//======================================================================= -// name : VisuGUI_AxisWg::SetName -// Purpose : -//================================================== ===================== -void VisuGUI_AxisWg::SetName(const QString& theName) -{ - myAxisName->setText(theName); -} - -//======================================================================= -// name : VisuGUI_AxisWg::SetNameFont -// Purpose : -//======================================================================= -void VisuGUI_AxisWg::SetNameFont(const QColor& theColor, - const int theFont, - const bool theIsBold, - const bool theIsItalic, - const bool theIsShadow) -{ - myNameFont->SetData(theColor, theFont, theIsBold, theIsItalic, theIsShadow); -} - -//======================================================================= -// name : VisuGUI_AxisWg::SetNameFont -// Purpose : -//======================================================================= -bool VisuGUI_AxisWg::ReadData(vtkAxisActor2D* theActor) -{ - if (theActor == 0) - return false; - - // Name - - bool useName = theActor->GetTitleVisibility(); - QString aTitle(theActor->GetTitle()); - - QColor aTitleColor(255, 255, 255); - int aTitleFontFamily = VTK_ARIAL; - bool isTitleBold = false; - bool isTitleItalic = false; - bool isTitleShadow = false; - - vtkTextProperty* aTitleProp = theActor->GetTitleTextProperty(); - if (aTitleProp !=0) - { - float c[ 3 ]; - aTitleProp->GetColor(c); - aTitleColor.setRgb((int)(c[ 0 ] * 255), (int)(c[ 1 ] * 255), (int)(c[ 2 ] * 255)); - aTitleFontFamily = aTitleProp->GetFontFamily(); - isTitleBold = aTitleProp->GetBold() ? true : false; - isTitleItalic = aTitleProp->GetItalic() ? true : false; - isTitleShadow = aTitleProp->GetShadow() ? true : false; - } - - myIsNameVisible->setChecked(useName); - myAxisName->setText(aTitle); - myNameFont->SetData(aTitleColor, aTitleFontFamily, isTitleBold, isTitleItalic, isTitleShadow); - - // Labels - - bool useLabels = theActor->GetLabelVisibility(); - int nbLabels = theActor->GetNumberOfLabels(); - int anOffset = theActor->GetTickOffset(); - - QColor aLabelsColor(255, 255, 255); - int aLabelsFontFamily = VTK_ARIAL; - bool isLabelsBold = false; - bool isLabelsItalic = false; - bool isLabelsShadow = false; - - vtkTextProperty* aLabelsProp = theActor->GetLabelTextProperty(); - if (aLabelsProp !=0) - { - float c[ 3 ]; - aLabelsProp->GetColor(c); - aLabelsColor.setRgb((int)(c[ 0 ] * 255), (int)(c[ 1 ] * 255), (int)(c[ 2 ] * 255)); - aLabelsFontFamily = aLabelsProp->GetFontFamily(); - isLabelsBold = aLabelsProp->GetBold() ? true : false; - isLabelsItalic = aLabelsProp->GetItalic() ? true : false; - isLabelsShadow = aLabelsProp->GetShadow() ? true : false; - } - - myIsLabelsVisible->setChecked(useLabels); - myLabelNumber->setText(QString("%1").arg(nbLabels)); - myLabelOffset->setText(QString("%1").arg(anOffset)); - myLabelsFont->SetData(aLabelsColor, aLabelsFontFamily, isLabelsBold, isLabelsItalic, isLabelsShadow); - - // Tick marks - bool useTickMarks = theActor->GetTickVisibility(); - int aTickLength = theActor->GetTickLength(); - - myIsTicksVisible->setChecked(useTickMarks); - myTickLength->setText(QString("%1").arg(aTickLength)); - - return true; -} - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::Apply -// Purpose : -//======================================================================= -bool VisuGUI_AxisWg::Apply(vtkAxisActor2D* theActor) -{ - if (theActor == 0) - return false; - - // Name - - theActor->SetTitleVisibility(myIsNameVisible->isChecked() ? 1 : 0); - theActor->SetTitle(myAxisName->text().latin1()); - - QColor aTitleColor(255, 255, 255); - int aTitleFontFamily = VTK_ARIAL; - bool isTitleBold = false; - bool isTitleItalic = false; - bool isTitleShadow = false; - - myNameFont->GetData(aTitleColor, aTitleFontFamily, isTitleBold, isTitleItalic, isTitleShadow); - vtkTextProperty* aTitleProp = theActor->GetTitleTextProperty(); - if (aTitleProp) - { - aTitleProp->SetColor(aTitleColor.red() / 255., - aTitleColor.green() / 255., - aTitleColor.blue() / 255.); - aTitleProp->SetFontFamily(aTitleFontFamily); - - aTitleProp->SetBold(isTitleBold ? 1 : 0); - aTitleProp->SetItalic(isTitleItalic ? 1 : 0); - aTitleProp->SetShadow(isTitleShadow ? 1 : 0); - - theActor->SetTitleTextProperty(aTitleProp); - } - - // Labels - - theActor->SetLabelVisibility(myIsLabelsVisible->isChecked() ? 1 : 0); - - bool isOk = false; - int nbLabels = myLabelNumber->text().toInt(&isOk); - if (isOk) - theActor->SetNumberOfLabels(nbLabels); - - int anOffset = myLabelOffset->text().toInt(&isOk); - if (isOk) - theActor->SetTickOffset(anOffset); - - QColor aLabelsColor(255, 255, 255); - int aLabelsFontFamily = VTK_ARIAL; - bool isLabelsBold = false; - bool isLabelsItalic = false; - bool isLabelsShadow = false; - - myLabelsFont->GetData(aLabelsColor, aLabelsFontFamily, isLabelsBold, isLabelsItalic, isLabelsShadow); - vtkTextProperty* aLabelsProp = theActor->GetLabelTextProperty(); - if (aLabelsProp) - { - aLabelsProp->SetColor(aLabelsColor.red() / 255., - aLabelsColor.green() / 255., - aLabelsColor.blue() / 255.); - aLabelsProp->SetFontFamily(aLabelsFontFamily); - - aLabelsProp->SetBold(isLabelsBold ? 1 : 0); - aLabelsProp->SetItalic(isLabelsItalic ? 1 : 0); - aLabelsProp->SetShadow(isLabelsShadow ? 1 : 0); - - aLabelsProp->Modified(); - theActor->SetLabelTextProperty(aLabelsProp); - } - - - // Tick marks - theActor->SetTickVisibility(myIsTicksVisible->isChecked()); - int aTickLength = myTickLength->text().toInt(&isOk); - if (isOk) - theActor->SetTickLength(aTickLength); - - return true; -} - -/* - Class : VisuGUI_CubeAxesDlg - Description : Dialog for specifynig cube axes properties -*/ - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::VisuGUI_CubeAxesDlg -// Purpose : Constructor -//======================================================================= -VisuGUI_CubeAxesDlg::VisuGUI_CubeAxesDlg(QWidget* theParent) -: QDialog(theParent, "VisuGUI_CubeAxesDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose) -{ - setCaption(tr("CAPTION")); - - QVBoxLayout* aLay = new QVBoxLayout(this, 5, 5); - aLay->addWidget(createMainFrame(this)); - aLay->addWidget(createButtonFrame(this)); - - Init(); - -//if (VISU::GetDesktop()->getMainFrame()) -// connect(VISU::GetDesktop()->getMainFrame(), SIGNAL(windowActivated(QWidget*)), -// SLOT(onWindowActivated(QWidget*))); -} - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::createMainFrame -// Purpose : Create frame containing dialog's input fields -//======================================================================= -QWidget* VisuGUI_CubeAxesDlg::createMainFrame(QWidget* theParent) -{ - QFrame* aFrame = new QFrame(theParent); - - myTabWg = new QTabWidget(aFrame); - - myAxes[ 0 ] = new VisuGUI_AxisWg(myTabWg); - myAxes[ 1 ] = new VisuGUI_AxisWg(myTabWg); - myAxes[ 2 ] = new VisuGUI_AxisWg(myTabWg); - - myTabWg->addTab(myAxes[ 0 ], tr("X_AXIS")); - myTabWg->addTab(myAxes[ 1 ], tr("Y_AXIS")); - myTabWg->addTab(myAxes[ 2 ], tr("Z_AXIS")); - - myTabWg->setMargin(5); - - myIsVisible = new QCheckBox(tr("IS_VISIBLE"), aFrame); - - QVBoxLayout* aLay = new QVBoxLayout(aFrame, 0, 5); - aLay->addWidget(myTabWg); - aLay->addWidget(myIsVisible); - - return aFrame; -} - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::createButtonFrame -// Purpose : Create frame containing buttons -//======================================================================= -QWidget* VisuGUI_CubeAxesDlg::createButtonFrame(QWidget* theParent) -{ - QFrame* aFrame = new QFrame(theParent); - aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken); - - myOkBtn = new QPushButton(tr("BUT_OK"), aFrame); - myApplyBtn = new QPushButton(tr("BUT_APPLY"), aFrame); - myCloseBtn = new QPushButton(tr("BUT_CLOSE"), aFrame); - - QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); - - QHBoxLayout* aLay = new QHBoxLayout(aFrame, 5, 5); - - aLay->addWidget(myOkBtn); - aLay->addWidget(myApplyBtn); - aLay->addItem(aSpacer); - aLay->addWidget(myCloseBtn); - - connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); - connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); - connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); - - return aFrame; -} - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::~VisuGUI_CubeAxesDlg -// Purpose : Destructor -//======================================================================= -VisuGUI_CubeAxesDlg::~VisuGUI_CubeAxesDlg() -{ -} - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::Init -// Purpose : Init dialog fields, connect signals and slots, show dialog -//======================================================================= -bool VisuGUI_CubeAxesDlg::Init() -{ - SVTK_ViewWindow* aFrame = VISU::GetViewWindow(); - if (aFrame == 0) - return false; - - SVTK_CubeAxesActor2D* anActor = aFrame->GetCubeAxes(); - if (anActor == 0) - return false; - - myAxes[ 0 ]->ReadData(anActor->GetXAxisActor2D()); - myAxes[ 1 ]->ReadData(anActor->GetYAxisActor2D()); - myAxes[ 2 ]->ReadData(anActor->GetZAxisActor2D()); - - myIsVisible->setChecked(anActor->GetVisibility() ? true : false); - - return true; - -} - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::isValid -// Purpose : Verify validity of entry data -//======================================================================= -bool VisuGUI_CubeAxesDlg::isValid() const -{ - return true; -} - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::onApply -// Purpose : Verify validity of entry data -//======================================================================= -bool VisuGUI_CubeAxesDlg::onApply() -{ - bool isOk = true; - - try - { - SVTK_ViewWindow* aFrame = VISU::GetViewWindow(); - if (aFrame == 0) - return false; - - SVTK_CubeAxesActor2D* anActor = aFrame->GetCubeAxes(); - if (anActor == 0) - return false; - - isOk = isOk && myAxes[ 0 ]->Apply(anActor->GetXAxisActor2D()); - isOk = isOk && myAxes[ 1 ]->Apply(anActor->GetYAxisActor2D()); - isOk = isOk && myAxes[ 2 ]->Apply(anActor->GetZAxisActor2D()); - - - //anActor->SetXLabel(myAxes[ 0 ]->myAxisName->text()); - //anActor->SetYLabel(myAxes[ 1 ]->myAxisName->text()); - //anActor->SetZLabel(myAxes[ 2 ]->myAxisName->text()); - - //anActor->SetNumberOfLabels(anActor->GetXAxisActor2D()->GetNumberOfLabels()); - if (myIsVisible->isChecked()) - anActor->VisibilityOn(); - else - anActor->VisibilityOff(); - - if (isOk) - aFrame->Repaint(); - } - catch(...) - { - isOk = false; - } - - return isOk; -} - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::onOk -// Purpose : SLOT called when "Ok" button pressed. -//======================================================================= -void VisuGUI_CubeAxesDlg::onOk() -{ - if (onApply()) - onClose(); -} - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::onClose -// Purpose : SLOT called when "Close" button pressed. Close dialog -//======================================================================= -void VisuGUI_CubeAxesDlg::onClose() -{ - reject(); -} - -//======================================================================= -// name : VisuGUI_CubeAxesDlg::onClose -// Purpose : SLOT called when "Close" button pressed. Close dialog -//======================================================================= -void VisuGUI_CubeAxesDlg::onWindowActivated (QWidget*) -{ - SVTK_ViewWindow* aFrame = VISU::GetViewWindow(); - if (aFrame) - Init(); - else - onClose(); -} diff --git a/src/VISUGUI/VisuGUI_CubeAxesDlg.h b/src/VISUGUI/VisuGUI_CubeAxesDlg.h deleted file mode 100755 index 59bcbb0c..00000000 --- a/src/VISUGUI/VisuGUI_CubeAxesDlg.h +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_CubeAxesDlg.h -// Author : Sergey LITONIN -// Module : VISU - - -#ifndef VisuGUI_CubeAxesDlg_H -#define VisuGUI_CubeAxesDlg_H - -#include -#include - -class QWidget; -class QFrame; -class QPushButton; -class QTabWidget; -class QCheckBox; -class QLineEdit; -class VisuGUI_FontWg; -class QGroupBox; -class VisuGUI_AxisWg; -class vtkAxisActor2D; - -/*! - * Class : VisuGUI_CubeAxesDlg - * Description : Dialog for specifynig cube axes properties - */ -class VisuGUI_CubeAxesDlg : public QDialog -{ - Q_OBJECT - -public: - VisuGUI_CubeAxesDlg( QWidget* ); - virtual ~VisuGUI_CubeAxesDlg(); - - bool Init(); - -private slots: - void onOk(); - bool onApply(); - void onClose(); - - void onWindowActivated( QWidget* ); - -private: - QWidget* createButtonFrame( QWidget* ); - QWidget* createMainFrame ( QWidget* ); - bool isValid() const; - -private: - QTabWidget* myTabWg; - QCheckBox* myIsVisible; - - QPushButton* myOkBtn; - QPushButton* myApplyBtn; - QPushButton* myCloseBtn; - VisuGUI_AxisWg* myAxes[ 3 ]; -}; - -/*! - * Class : VisuGUI_AxisWg - * Description : Tab of dialog - */ -class VisuGUI_AxisWg : public QFrame -{ - Q_OBJECT - -public: - VisuGUI_AxisWg( QWidget* ); - ~VisuGUI_AxisWg(); - - void UseName( const bool ); - void SetName( const QString& ); - void SetNameFont( const QColor&, const int, const bool, const bool, const bool ); - bool ReadData( vtkAxisActor2D* ); - bool Apply( vtkAxisActor2D* ); - -protected: - bool eventFilter(QObject*, QEvent*); - -private slots: - void onNameChecked(); - void onLabelsChecked(); - void onTicksChecked(); - -private: - void updateControlState(); - void setEnabled( QGroupBox*, const bool ); - -private: - // name - QGroupBox* myNameGrp; - QCheckBox* myIsNameVisible; - QLineEdit* myAxisName; - VisuGUI_FontWg* myNameFont; - - // labels - QGroupBox* myLabelsGrp; - QCheckBox* myIsLabelsVisible; - QLineEdit* myLabelNumber; - QLineEdit* myLabelOffset; - VisuGUI_FontWg* myLabelsFont; - - // tick marks - QGroupBox* myTicksGrp; - QCheckBox* myIsTicksVisible; - QLineEdit* myTickLength; - - friend class VisuGUI_CubeAxesDlg; -}; - -#endif diff --git a/src/VISUGUI/VisuGUI_CursorDlg.cxx b/src/VISUGUI/VisuGUI_CursorDlg.cxx deleted file mode 100644 index e1adefcf..00000000 --- a/src/VISUGUI/VisuGUI_CursorDlg.cxx +++ /dev/null @@ -1,109 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_CursorDlg.cxx -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -using namespace std; -#include "VisuGUI_CursorDlg.h" -#include - -/*! - Constructor -*/ -VisuGUI_CursorDlg::VisuGUI_CursorDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - if ( !name ) - setName( "VisuGUI_CursorDlg" ); - setCaption( name ); - setSizeGripEnabled( TRUE ); - - QGridLayout* TopLayout = new QGridLayout( this ); - TopLayout->setSpacing( 6 ); - TopLayout->setMargin( 11 ); - - TopGroupBox = new QGroupBox( this, "TopGroupBox" ); - TopGroupBox->setColumnLayout(0, Qt::Vertical ); - TopGroupBox->layout()->setSpacing( 0 ); - TopGroupBox->layout()->setMargin( 0 ); - QGridLayout* TopGroupBoxLayout = new QGridLayout( TopGroupBox->layout() ); - TopGroupBoxLayout->setAlignment( Qt::AlignTop ); - TopGroupBoxLayout->setSpacing( 6 ); - TopGroupBoxLayout->setMargin( 11 ); - - Comment1 = new QLabel( tr( "TextLabel1" ), TopGroupBox, "Comment1" ); - Comment1->setAlignment( QLabel::AlignCenter ); - TopGroupBoxLayout->addWidget( Comment1, 0, 0 ); - - Comment2 = new QLabel( tr( "TextLabel2" ), TopGroupBox, "Comment2" ); - Comment2->setAlignment( QLabel::AlignCenter ); - TopGroupBoxLayout->addWidget( Comment2, 1, 0 ); - - SpinBox1 = new QSpinBox( 1, 100, 1, TopGroupBox, "SpinBox1" ); - SpinBox1->setValue( 100 ); - SpinBox1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - SpinBox1->setMinimumSize( 70, 0 ); - QHBoxLayout* SLayout = new QHBoxLayout; - SLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); - SLayout->addWidget( SpinBox1 ); - SLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); - TopGroupBoxLayout->addLayout( SLayout, 2, 0 ); - - GroupButtons = new QGroupBox (this, "GroupButtons"); - GroupButtons->setGeometry(QRect(10, 10, 281, 48)); - GroupButtons->setColumnLayout(0, Qt::Vertical); - GroupButtons->layout()->setSpacing(0); - GroupButtons->layout()->setMargin(0); - QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons->layout()); - GroupButtonsLayout->setAlignment(Qt::AlignTop); - GroupButtonsLayout->setSpacing(6); - GroupButtonsLayout->setMargin(11); - - buttonOk = new QPushButton (tr("&OK"), GroupButtons, "buttonOk"); - buttonOk->setAutoDefault(TRUE); - buttonOk->setDefault(TRUE); - GroupButtonsLayout->addWidget(buttonOk, 0, 0); - - GroupButtonsLayout->addItem(new QSpacerItem (5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1); - - buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel"); - buttonCancel->setAutoDefault(TRUE); - GroupButtonsLayout->addWidget(buttonCancel, 0, 2); - - TopLayout->addWidget(TopGroupBox, 0, 0); - TopLayout->addWidget(GroupButtons, 1, 0); - - // signals and slots connections - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); -} - -/*! - Destructor -*/ -VisuGUI_CursorDlg::~VisuGUI_CursorDlg() -{ -} diff --git a/src/VISUGUI/VisuGUI_CursorDlg.h b/src/VISUGUI/VisuGUI_CursorDlg.h deleted file mode 100644 index 018709cf..00000000 --- a/src/VISUGUI/VisuGUI_CursorDlg.h +++ /dev/null @@ -1,55 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_CursorDlg.h -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -#ifndef VISUGUI_CURSORDLG_H -#define VISUGUI_CURSORDLG_H - -#include -#include -#include -#include -#include - -class VisuGUI_CursorDlg : public QDialog -{ - Q_OBJECT - -public: - VisuGUI_CursorDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~VisuGUI_CursorDlg(); - - QGroupBox* TopGroupBox; - QLabel* Comment1; - QLabel* Comment2; - QSpinBox* SpinBox1; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; -}; - -#endif // VISUGUI_CURSORDLG_H diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.h b/src/VISUGUI/VisuGUI_CutPlanesDlg.h deleted file mode 100644 index e5ccea9f..00000000 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.h +++ /dev/null @@ -1,136 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_CutPlanesDlg.h -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -#ifndef VISUGUI_CUTPLANESDLG_H -#define VISUGUI_CUTPLANESDLG_H - -#include "VisuGUI_ScalarBarDlg.h" -#include "VISU_CutPlanes_i.hh" - -#include - -#include -#include - -#include "SALOMEconfig.h" -#include CORBA_CLIENT_HEADER(VISU_Gen) - -class QtxDblSpinBox; -class SUIT_ViewWindow; -class SUIT_ViewManager; -class SalomeApp_Module; - - -class VisuGUI_CutPlanesPane : public QFrame -{ - Q_OBJECT - -public: - VisuGUI_CutPlanesPane (QWidget* parent); - ~VisuGUI_CutPlanesPane(); - - void setNbPlanes( const int nbp ) {nbPlan->setValue( nbp );} - int getNbPlanes() {return nbPlan->value();} - void setPlanePos( const VISU::CutPlanes::Orientation orient/*, const double pos1, const double pos2 */); - VISU::CutPlanes::Orientation getOrientaion(); - void setRotation( const double r1, const double r2 ); - double getRotation1() {return Rot1->value();} - double getRotation2() {return Rot2->value();} - - void initFromPrsObject(VISU::CutPlanes_i* thePrs); - int storeToPrsObject(VISU::CutPlanes_i* thePrs); - -private: - void createPlanes(); - void deletePlanes(); - - - QLabel* LabelRot1; - QLabel* LabelRot2; - QSpinBox* nbPlan; - QtxDblSpinBox* Rot1; - QtxDblSpinBox* Rot2; - QRadioButton* RBzx; - QRadioButton* RByz; - QRadioButton* RBxy; - QtxDblSpinBox* myPosSpn; - QTable* myPosTable; - VISU::CutPlanes_i* myCutPlanes; - QCheckBox* myPreviewCheck; - double X1, X2; - double Y1, Y2; - double Z1, Z2; - bool hasInit; - - SALOME_Actor* myPreviewActor; - -private slots: - void editScalarBar(); - void orientationChanged( int ); - void DrawTable(); - void setDefault( int all = -1); - void onValueChanged(int theRow, int theCol); - void onRotation(double theValue); - void onPreviewCheck(bool thePreview); -}; - - -class VisuGUI_CutPlanesDlg : public QDialog -{ - Q_OBJECT - -public: - VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule); - ~VisuGUI_CutPlanesDlg() {}; - - void initFromPrsObject (VISU::CutPlanes_i* thePrs); - int storeToPrsObject (VISU::CutPlanes_i* thePrs); - -protected slots: - void accept(); - void reject(); - void onWindowActivated (SUIT_ViewWindow*); - -private: - VisuGUI_CutPlanesPane* myCutPane; - VisuGUI_ScalarBarPane* myScalarPane; - VISU::CutPlanes_i* myPrs; -}; - - -class VisuGUI_NumEditItem: public QTableItem -{ -public: - VisuGUI_NumEditItem(QTable* table, EditType et, const QString& text ): - QTableItem(table, et, text) {}; - ~VisuGUI_NumEditItem() {}; - - QWidget* createEditor() const; -}; - -#endif // VISUGUI_CUTPLANESDLG_H diff --git a/src/VISUGUI/VisuGUI_EditContainerDlg.cxx b/src/VISUGUI/VisuGUI_EditContainerDlg.cxx deleted file mode 100644 index eed32a53..00000000 --- a/src/VISUGUI/VisuGUI_EditContainerDlg.cxx +++ /dev/null @@ -1,429 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_EditContainerDlg.cxx -// Author : VSV -// Module : VISU - - -#include "VisuGUI_EditContainerDlg.h" - -#include "VisuGUI.h" -#include "VisuGUI_Tools.h" - -#include "VISU_Table_i.hh" - -#include "SalomeApp_Application.h" -#include "SUIT_Desktop.h" - -#include -#include -#include -#include -#include - -using namespace std; - - -/* XPM */ -static const char * left_xpm[] = { -"24 24 61 1", -" c None", -". c #323232", -"+ c #010101", -"@ c #4A4A4A", -"# c #040404", -"$ c #979797", -"% c #7B7B7B", -"& c #939393", -"* c #EEEEEE", -"= c #686868", -"- c #030303", -"; c #9C9C9C", -"> c #FFFFFF", -", c #B1B1B1", -"' c #5E5E5E", -") c #060606", -"! c #C1C1C1", -"~ c #626262", -"{ c #000000", -"] c #989898", -"^ c #A1A1A1", -"/ c #A5A5A5", -"( c #909090", -"_ c #868686", -": c #616161", -"< c #959595", -"[ c #919191", -"} c #848484", -"| c #606060", -"1 c #0B0B0B", -"2 c #545454", -"3 c #727272", -"4 c #A2A2A2", -"5 c #969696", -"6 c #838383", -"7 c #5F5F5F", -"8 c #101010", -"9 c #434343", -"0 c #6B6B6B", -"a c #858585", -"b c #8E8E8E", -"c c #373737", -"d c #696969", -"e c #8D8D8D", -"f c #B5B5B5", -"g c #111111", -"h c #393939", -"i c #898989", -"j c #B0B0B0", -"k c #191919", -"l c #3A3A3A", -"m c #646464", -"n c #535353", -"o c #050505", -"p c #353535", -"q c #585858", -"r c #4C4C4C", -"s c #0D0D0D", -"t c #3E3E3E", -"u c #020202", -"v c #0A0A0A", -" ", -" ", -" .+ .+ ", -" .@# .@# ", -" .$%# .$%# ", -" .&*=- .&*=- ", -" .;>,') .;>,') ", -" .;>!;~{ .;>!;~{ ", -" .]>!^&~{ .]>!^&~{ ", -" ./>!/(_:{ ./>!/(_:{ ", -" .<*!^[}}|{.<*!^[}}|{ ", -" 123}45667{123}45667{ ", -" 890a45b7{ 890a45b7{ ", -" 8cdef5'{ 8cdef5'{ ", -" gh0ij7k gh0ij7k ", -" 8lm0no 8lm0no ", -" 8pqr- 8pqr- ", -" sht- sht- ", -" 1.u 1.u ", -" v{ v{ ", -" ", -" ", -" ", -" "}; - -static QPixmap MYLeftPix(left_xpm); - - -static const char * right_xpm[] = { -"24 24 43 1", -" g None", -". g #323232", -"+ g #5D5D5D", -"@ g #000000", -"# g #C4C4C4", -"$ g #313131", -"% g #C5C5C5", -"& g #E4E4E4", -"* g #2D2D2D", -"= g #B7B7B7", -"- g #EFEFEF", -"; g #DCDCDC", -"> g #282828", -", g #AFAFAF", -"' g #E0E0E0", -") g #242424", -"! g #C7C7C7", -"~ g #9A9A9A", -"{ g #8E8E8E", -"] g #1F1F1F", -"^ g #A5A5A5", -"/ g #989898", -"( g #888888", -"_ g #1B1B1B", -": g #ADADAD", -"< g #858585", -"[ g #838383", -"} g #868686", -"| g #929292", -"1 g #C1C1C1", -"2 g #161616", -"3 g #909090", -"4 g #747474", -"5 g #3A3A3A", -"6 g #121212", -"7 g #0D0D0D", -"8 g #7A7A7A", -"9 g #8A8A8A", -"0 g #090909", -"a g #040404", -"b g #707070", -"c g #6E6E6E", -"d g #3F3F3F", -" ", -" ", -" .. .. ", -" .+@ .+@ ", -" .#+@ .#+@ ", -" $%&+@ $%&+@ ", -" *=-;+@ *=-;+@ ", -" >,'=;+@ >,'=;+@ ", -" ),!~{;+@ ),!~{;+@ ", -" ]^!/({;+@ ]^!/({;+@ ", -" _~:<[}|1+@_~:<[}|1+@ ", -" 23~[[{:45@23~[[{:45@ ", -" 6setFrameStyle(QFrame::Box | QFrame::Sunken); - - QGridLayout* aControlLay = new QGridLayout (aControlFrame); - aControlLay->setSpacing(6); - aControlLay->setMargin(11); - aControlLay->addRowSpacing(1, 30); - aControlLay->addRowSpacing(4, 30); - aControlLay->setRowStretch(1, 1); - aControlLay->setRowStretch(4, 1); - aControlLay->addColSpacing(0, 180); - aControlLay->addColSpacing(2, 180); - - QLabel* aSelectLbl = new QLabel (tr("LBL_STUDY"), aControlFrame); - aControlLay->addWidget(aSelectLbl, 0, 0); - - myStudyLst = new QListView (aControlFrame); - myStudyLst->setSelectionMode(QListView::Extended); - myStudyLst->addColumn(tr("TXT_TABLE"), 80); - myStudyLst->addColumn(tr("TXT_CURVE"), 50); - myStudyLst->addColumn(tr(""), 0); - myStudyLst->setAllColumnsShowFocus(true); - myStudyLst->setMinimumHeight(130); - connect(myStudyLst, SIGNAL(selectionChanged()), this, SLOT(onLeftSelected())); - aControlLay->addMultiCellWidget(myStudyLst, 1, 4, 0, 0); - - myRightBtn = new QToolButton (aControlFrame); - myRightBtn->setIconSet(MYRightPix); - myRightBtn->setEnabled(false); - connect(myRightBtn, SIGNAL(clicked()), this, SLOT(onRightClicked())); - aControlLay->addWidget(myRightBtn, 2, 1); - - myLeftBtn = new QToolButton(aControlFrame); - myLeftBtn->setIconSet(MYLeftPix); - myLeftBtn->setEnabled(false); - connect(myLeftBtn, SIGNAL(clicked()), this, SLOT(onLeftClicked())); - aControlLay->addWidget(myLeftBtn, 3, 1); - - QLabel* aForceLbl = new QLabel (tr("LBL_CONTAINER"), aControlFrame); - aControlLay->addWidget(aForceLbl, 0, 2); - - myContainerLst = new QListView(aControlFrame); - myContainerLst->setSelectionMode(QListView::Extended); - myContainerLst->addColumn(tr("TXT_TABLE"), 80); - myContainerLst->addColumn(tr("TXT_CURVE"), 50); - myContainerLst->addColumn(tr(""), 0); - myContainerLst->setMinimumWidth(130); - connect(myContainerLst, SIGNAL(selectionChanged()), this, SLOT(onRightSelected())); - aControlLay->addMultiCellWidget(myContainerLst, 1, 4, 2, 2); - - TopLayout->addWidget(aControlFrame); - - // Common buttons =========================================================== - QGroupBox* GroupButtons = new QGroupBox(this, "GroupButtons"); - GroupButtons->setColumnLayout(0, Qt::Vertical); - GroupButtons->layout()->setSpacing(0); - GroupButtons->layout()->setMargin(0); - QGridLayout* GroupButtonsLayout = new QGridLayout(GroupButtons->layout()); - GroupButtonsLayout->setAlignment(Qt::AlignTop); - GroupButtonsLayout->setSpacing(6); - GroupButtonsLayout->setMargin(11); - - QPushButton* buttonOk = new QPushButton(tr("&OK"), GroupButtons, "buttonOk"); - buttonOk->setAutoDefault(TRUE); - buttonOk->setDefault(TRUE); - GroupButtonsLayout->addWidget(buttonOk, 0, 0); - GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, - QSizePolicy::Minimum), 0, 1); - - QPushButton* buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel"); - buttonCancel->setAutoDefault(TRUE); - GroupButtonsLayout->addWidget(buttonCancel, 0, 2); - - TopLayout->addWidget(GroupButtons); - - connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); -} - -void VisuGUI_EditContainerDlg::initFromPrsObject (VISU::Container_i* theContainer) -{ - _PTR(Study) aStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI)); - _PTR(SComponent) aVisuSO = aStudy->FindComponent("VISU"); - if (!aVisuSO) { - return; - } - QValueList aStudyCurves; - QValueList aContainerCurves; - // Find curves in container - for (int i = 1; i <= theContainer->GetNbCurves(); i++) { - VISU::Curve_i* aCurve = theContainer->GetCurve(i); - if (aCurve == NULL) continue; - CurveStruct aEntry; - aEntry.CurveName = aCurve->GetTitle(); - aEntry.CurveEntry = aCurve->GetEntry(); - _PTR(SObject) aTableSO = aStudy->FindObjectID(aCurve->GetTableID()); - if (!aTableSO) continue; - aEntry.TableName = getSObjectName(aTableSO); - aContainerCurves.append(aEntry); - new QListViewItem(myContainerLst, aEntry.TableName, aEntry.CurveName, aEntry.CurveEntry); - } - // Find curves in study - _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aVisuSO); - for (aIter->InitEx(true); aIter->More(); aIter->Next()) { - _PTR(SObject) aSObject = aIter->Value(); - CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject); - VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject); - if (!CORBA::is_nil(aVisuObj)) { - if (aVisuObj->GetType() == VISU::TCURVE) { - _PTR(SObject) aTableSO = aSObject->GetFather(); - CurveStruct aEntry; - aEntry.TableName = getSObjectName(aTableSO); - aEntry.CurveName = getSObjectName(aSObject); - aEntry.CurveEntry = aSObject->GetID().c_str(); - aStudyCurves.append(aEntry); - } - } - } - //Show Curves which are not in Curve - QValueList::iterator it; - QValueList::iterator it2; - bool isExist = false; - for (it = aStudyCurves.begin(); it != aStudyCurves.end(); ++it) { - for (it2 = aContainerCurves.begin(); it2 != aContainerCurves.end(); ++it2) { - if (isExist = ((*it).CurveEntry == (*it2).CurveEntry)) - break; - } - if (!isExist) - new QListViewItem(myStudyLst, (*it).TableName, (*it).CurveName, (*it).CurveEntry); - } -} - -void VisuGUI_EditContainerDlg::storeToPrsObject (VISU::Container_i* theContainer) -{ - theContainer->Clear(); - - _PTR(Study) aStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI)); - QListViewItem* anItem = myContainerLst->firstChild(); - while (anItem) { - _PTR(SObject) aCurveSO = aStudy->FindObjectID(anItem->text(2).latin1()); - if (aCurveSO) { - CORBA::Object_var aObject = VISU::ClientSObjectToObject(aCurveSO); - if (!CORBA::is_nil(aObject)) { - VISU::Curve_i* aCurve = dynamic_cast(VISU::GetServant(aObject).in()); - if (aCurve) theContainer->AddCurve(aCurve->_this()); - } - } - anItem = anItem->nextSibling(); - } -} - -QString VisuGUI_EditContainerDlg::getSObjectName (_PTR(SObject) theSObject) -{ - if (!theSObject) return QString(""); - - _PTR(GenericAttribute) anAttr; - if (theSObject->FindAttribute(anAttr, "AttributeName")) { - _PTR(AttributeName) aName (anAttr); - return QString(aName->Value().c_str()); - } - return QString(""); -} - -void VisuGUI_EditContainerDlg::onLeftClicked() -{ - QListViewItem* anItem = myContainerLst->firstChild(); - while (anItem) { - if (anItem->isSelected()) { - QListViewItem* anTmpItem = anItem; - anItem = anTmpItem->nextSibling(); - myContainerLst->takeItem(anTmpItem); - myStudyLst->insertItem(anTmpItem); - } else { - anItem = anItem->nextSibling(); - } - } -} - -void VisuGUI_EditContainerDlg::onRightClicked() -{ - QListViewItem* anItem = myStudyLst->firstChild(); - while (anItem) { - if (anItem->isSelected()) { - QListViewItem* anTmpItem = anItem; - anItem = anTmpItem->nextSibling(); - myStudyLst->takeItem(anTmpItem); - myContainerLst->insertItem(anTmpItem); - } else { - anItem = anItem->nextSibling(); - } - } -} - -void VisuGUI_EditContainerDlg::onLeftSelected() -{ - QListViewItem* anItem = myStudyLst->firstChild(); - bool isSelected = false; - while (anItem) { - if (anItem->isSelected()) { - isSelected = true; - break; - } - anItem = anItem->nextSibling(); - } - myRightBtn->setEnabled(isSelected); -} - -void VisuGUI_EditContainerDlg::onRightSelected() -{ - QListViewItem* anItem = myContainerLst->firstChild(); - bool isSelected = false; - while (anItem) { - if (anItem->isSelected()) { - isSelected = true; - break; - } - anItem = anItem->nextSibling(); - } - myLeftBtn->setEnabled(isSelected); -} diff --git a/src/VISUGUI/VisuGUI_EditContainerDlg.h b/src/VISUGUI/VisuGUI_EditContainerDlg.h deleted file mode 100644 index 8493d0ff..00000000 --- a/src/VISUGUI/VisuGUI_EditContainerDlg.h +++ /dev/null @@ -1,63 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_EditContainerDlg.h -// Author : VSV -// Module : VISU - -#ifndef VISUGUI_EDITCONTAINER_H -#define VISUGUI_EDITCONTAINER_H - -#include -#include -#include -#include - -#include "SALOMEDSClient_SObject.hxx" - -class VisuGUI; - -namespace VISU { - class Container_i; -} - - -struct CurveStruct { - QString TableName; - QString CurveName; - QString CurveEntry; -}; - - -class VisuGUI_EditContainerDlg: public QDialog -{ - Q_OBJECT; - - public: - VisuGUI_EditContainerDlg (VisuGUI* theModule, bool theIsModal = true); - ~VisuGUI_EditContainerDlg() {}; - - void initFromPrsObject (VISU::Container_i* theContainer); - void storeToPrsObject (VISU::Container_i* theContainer); - - private slots: - void onLeftClicked(); - void onRightClicked(); - void onLeftSelected(); - void onRightSelected(); - - private: - QString getSObjectName (_PTR(SObject) theSObject); - - QListView* myStudyLst; - QListView* myContainerLst; - QToolButton* myLeftBtn; - QToolButton* myRightBtn; - - VisuGUI* myVisuGUI; -}; - -#endif // VISUGUI_EDITCONTAINER_H diff --git a/src/VISUGUI/VisuGUI_FileDlg.cxx b/src/VISUGUI/VisuGUI_FileDlg.cxx deleted file mode 100644 index 1e788c46..00000000 --- a/src/VISUGUI/VisuGUI_FileDlg.cxx +++ /dev/null @@ -1,111 +0,0 @@ -// SALOME SALOMEGUI : GUI of VISU module -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_FileDlg.cxx -// Author : -// Module : SALOME -// $Header: /dn05/salome/CVS/SALOME_ROOT/SALOME/src/VISUGUI/Visu_FileDlg.cxx - - -#include -#include -#include -#include -#include - -#include "VISUConfig.hh" -#include "VisuGUI_FileDlg.h" -#include "SUIT_ResourceMgr.h" - -using namespace std; - -bool VisuGUI_FileDlg::IsBuild = false; - -/*! -Constructor -*/ -VisuGUI_FileDlg::VisuGUI_FileDlg (QWidget* parent, - bool open, - bool showQuickDir, - bool modal) : - SUIT_FileDlg(parent, open, showQuickDir, modal) -{ - myCBuildAll = new QCheckBox (tr("FULL_LOAD"), this); - QLabel* label = new QLabel("", this); - label->setMaximumWidth(0); - QPushButton* pb = new QPushButton(this); - pb->setMaximumWidth(0); - addWidgets( label, myCBuildAll, pb ); - bool toBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false); - if (toBuildAll) myCBuildAll->setChecked(true); -} - -/*! - Destructor -*/ -VisuGUI_FileDlg::~VisuGUI_FileDlg() -{ -} - -/*! - Processes selection : tries to set given path or filename as selection -*/ -bool VisuGUI_FileDlg::processPath( const QString& path ) -{ - if ( !path.isNull() ) { - QFileInfo fi( path ); - if ( fi.exists() ) { - if ( fi.isFile() ) - setSelection( path ); - else if ( fi.isDir() ) - setDir( path ); - return true; - } - else { - if ( QFileInfo( fi.dirPath() ).exists() ) { - setDir( fi.dirPath() ); - return true; - } - } - } - return false; -} - -/*! - Returns the file name for Open/Save [ static ] -*/ -QString VisuGUI_FileDlg::getFileName( QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption, - bool open, - bool showQuickDir, - SUIT_FileValidator* validator ) -{ - VisuGUI_FileDlg* fd = new VisuGUI_FileDlg( parent, open, showQuickDir, true ); - if ( !caption.isEmpty() ) - fd->setCaption( caption ); - if ( !initial.isEmpty() ) { - fd->processPath( initial ); // VSR 24/03/03 check for existing of directory has been added to avoid QFileDialog's bug - } - fd->setFilters( filters ); - if ( validator ) - fd->setValidator( validator ); - fd->exec(); - QString filename = fd->selectedFile(); - - VisuGUI_FileDlg::IsBuild = fd->IsChecked(); - - delete fd; - qApp->processEvents(); - - return filename; -} - -bool VisuGUI_FileDlg::IsChecked() -{ - return myCBuildAll->isChecked(); -} diff --git a/src/VISUGUI/VisuGUI_FileDlg.h b/src/VISUGUI/VisuGUI_FileDlg.h deleted file mode 100644 index ec3b219f..00000000 --- a/src/VISUGUI/VisuGUI_FileDlg.h +++ /dev/null @@ -1,45 +0,0 @@ -// SALOME SALOMEGUI : GUI of VISU module -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_FileDlg.h -// Author : -// Module : SALOME -// $Header: /dn05/salome/CVS/SALOME_ROOT/VISU/src/VISUGUI/VisuGUI_FileDlg.h - -#ifndef VISU_FILEDIALOG_H -#define VISU_FILEDIALOG_H - -#include "SUIT_FileDlg.h" - -class QCheckBox; - -class VisuGUI_FileDlg : public SUIT_FileDlg -{ - Q_OBJECT; - public: - VisuGUI_FileDlg( QWidget* parent, - bool open, - bool showQuickDir = true, - bool modal = true ); - ~VisuGUI_FileDlg(); - - public: - static bool IsBuild; - static QString getFileName( QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption, - bool open, - bool showQuickDir = true, - SUIT_FileValidator* validator = 0); - -private: - QCheckBox* myCBuildAll; - bool IsChecked(); - bool processPath( const QString& path ); -}; - -#endif diff --git a/src/VISUGUI/VisuGUI_FontWg.cxx b/src/VISUGUI/VisuGUI_FontWg.cxx deleted file mode 100755 index 78d62a1c..00000000 --- a/src/VISUGUI/VisuGUI_FontWg.cxx +++ /dev/null @@ -1,149 +0,0 @@ -// VISU VISUGUI : GUI for SMESH component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_CubeAxesDlg.cxx -// Author : Sergey LITONIN -// Module : VISU - -#include "VisuGUI_FontWg.h" - -#include -#include -#include -#include - -#include - -/*! - * Class : VisuGUI_FontWg - * Description : Dialog for specifynig font - */ - -//======================================================================= -// name : VisuGUI_FontWg -// Purpose : Constructor -//======================================================================= -VisuGUI_FontWg::VisuGUI_FontWg( QWidget* theParent ) -: QHBox( theParent ) -{ - setSpacing( 5 ); - myColorBtn = new QToolButton( this ); - myColorBtn->setMinimumWidth( 20 ); - - myFamily = new QComboBox( this ); - myFamily->insertItem( tr( "ARIAL" ) ); - myFamily->insertItem( tr( "COURIER" ) ); - myFamily->insertItem( tr( "TIMES" ) ); - - myBold = new QCheckBox( tr( "BOLD" ), this ); - myItalic = new QCheckBox( tr( "ITALIC" ), this ); - myShadow = new QCheckBox( tr( "SHADOW" ), this ); - - connect( myColorBtn, SIGNAL( clicked() ), SLOT( onColor() ) ); -} - -//======================================================================= -// name : ~VisuGUI_FontWg -// Purpose : Destructor -//======================================================================= -VisuGUI_FontWg::~VisuGUI_FontWg() -{ -} - -//======================================================================= -// name : SetColor -// Purpose : -//======================================================================= -void VisuGUI_FontWg::SetColor( const QColor& theColor ) -{ - myColorBtn->setPaletteBackgroundColor( theColor ); -} - -//======================================================================= -// name : GetColor -// Purpose : -//======================================================================= -QColor VisuGUI_FontWg::GetColor() const -{ - return myColorBtn->paletteBackgroundColor(); -} - -//======================================================================= -// name : onColor -// Purpose : -//======================================================================= -void VisuGUI_FontWg::onColor() -{ - QColor aColor = QColorDialog::getColor( GetColor(), this ); - if ( aColor.isValid() ) - SetColor( aColor ); -} - -//======================================================================= -// name : SetData -// Purpose : -//======================================================================= -void VisuGUI_FontWg::SetData( const QColor& theColor, - const int theFamily, - const bool theBold, - const bool theItalic, - const bool theShadow ) -{ - SetColor( theColor ); - - if ( theFamily == VTK_ARIAL ) - myFamily->setCurrentItem( 0 ); - else if ( theFamily == VTK_COURIER ) - myFamily->setCurrentItem( 1 ); - else - myFamily->setCurrentItem( 2 ); - - myBold->setChecked( theBold ); - myItalic->setChecked( theItalic ); - myShadow->setChecked( theShadow ); -} - -//======================================================================= -// name : GetData -// Purpose : -//======================================================================= -void VisuGUI_FontWg::GetData( QColor& theColor, - int& theFamily, - bool& theBold, - bool& theItalic, - bool& theShadow ) const -{ - theColor = GetColor(); - - int anItem =myFamily->currentItem(); - if ( anItem == 0 ) - theFamily = VTK_ARIAL; - else if ( anItem == 1 ) - theFamily = VTK_COURIER; - else - theFamily = VTK_TIMES; - - theBold = myBold->isChecked(); - theItalic = myItalic->isChecked(); - theShadow = myShadow->isChecked(); -} diff --git a/src/VISUGUI/VisuGUI_FontWg.h b/src/VISUGUI/VisuGUI_FontWg.h deleted file mode 100755 index e3a45ee4..00000000 --- a/src/VISUGUI/VisuGUI_FontWg.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_FontWg.h -// Author : Sergey LITONIN -// Module : VISU - - -#ifndef VisuGUI_FontWg_H -#define VisuGUI_FontWg_H - -#include - -class QToolButton; -class QComboBox; -class QCheckBox; -class QColor; - - -/*! - * Class : VisuGUI_FontWg - * Description : Dialog for specifynig font - */ -class VisuGUI_FontWg : public QHBox -{ - Q_OBJECT - -public: - VisuGUI_FontWg( QWidget* ); - virtual ~VisuGUI_FontWg(); - - void SetColor( const QColor& ); - QColor GetColor() const; - - void SetData( const QColor&, const int, const bool, const bool, const bool ); - - void GetData( QColor&, int&, bool&, bool&, bool& ) const; - -private slots: - void onColor(); - -private: - QToolButton* myColorBtn; - QComboBox* myFamily; - QCheckBox* myBold; - QCheckBox* myItalic; - QCheckBox* myShadow; -}; - -#endif diff --git a/src/VISUGUI/VisuGUI_NameDlg.cxx b/src/VISUGUI/VisuGUI_NameDlg.cxx deleted file mode 100644 index c847861f..00000000 --- a/src/VISUGUI/VisuGUI_NameDlg.cxx +++ /dev/null @@ -1,134 +0,0 @@ -// SALOME VisuGUI : implementation of desktop and GUI kernel -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_NameDlg.cxx -// Author : Vadim SANDLER -// Module : SALOME -// $Header$ - -#include "VisuGUI_NameDlg.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -using namespace std; - -/*! - Constructor -*/ -VisuGUI_NameDlg::VisuGUI_NameDlg( QWidget* parent ) - : QDialog( parent ? parent : SUIT_Session::session()->activeApplication()->desktop(), - "VisuGUI_NameDlg", - true, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - setCaption( tr("TLT_RENAME") ); - setSizeGripEnabled( TRUE ); - - QVBoxLayout* topLayout = new QVBoxLayout( this ); - topLayout->setMargin( 11 ); topLayout->setSpacing( 6 ); - - /***************************************************************/ - QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setMargin( 0 ); GroupC1->layout()->setSpacing( 0 ); - QHBoxLayout* GroupC1Layout = new QHBoxLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setMargin( 11 ); GroupC1Layout->setSpacing( 6 ); - - QLabel* TextLabel = new QLabel( GroupC1, "TextLabel1" ); - TextLabel->setText( tr( "NAME_LBL" ) ); - GroupC1Layout->addWidget( TextLabel ); - - myLineEdit = new QLineEdit( GroupC1, "LineEdit1" ); - myLineEdit->setMinimumSize( 250, 0 ); - GroupC1Layout->addWidget( myLineEdit ); - - /***************************************************************/ - QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setMargin( 0 ); GroupButtons->layout()->setSpacing( 0 ); - QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setMargin( 11 ); GroupButtonsLayout->setSpacing( 6 ); - - myButtonOk = new QPushButton( GroupButtons, "buttonOk" ); - myButtonOk->setText( tr( "BUT_OK" ) ); - myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( myButtonOk ); - - GroupButtonsLayout->addStretch(); - - myButtonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - myButtonCancel->setText( tr( "BUT_CANCEL" ) ); - myButtonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( myButtonCancel ); - /***************************************************************/ - - topLayout->addWidget( GroupC1 ); - topLayout->addWidget( GroupButtons ); - - // signals and slots connections - connect( myButtonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( myButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - - /* Move widget on the botton right corner of main widget */ - SUIT_Tools::centerWidget( this, parent ); -} - -/*! - Destructor -*/ -VisuGUI_NameDlg::~VisuGUI_NameDlg() -{ -} - -/*! - Sets name -*/ -void VisuGUI_NameDlg::setName( const QString& name ) -{ - myLineEdit->setText( name ); - myLineEdit->end(false); - myLineEdit->home(true); -} - -/*! - Returns name entered by user -*/ -QString VisuGUI_NameDlg::name() -{ - return myLineEdit->text(); -} - -void VisuGUI_NameDlg::accept() -{ - if ( name().stripWhiteSpace().isEmpty() ) - return; - QDialog::accept(); -} - -/*! - Creates modal dialog and returns name entered [ static ] -*/ -QString VisuGUI_NameDlg::getName( QWidget* parent, const QString& oldName ) -{ - QString n; - VisuGUI_NameDlg* dlg = new VisuGUI_NameDlg( parent ); - if ( !oldName.isNull() ) - dlg->setName( oldName ); - if ( dlg->exec() == QDialog::Accepted ) - n = dlg->name(); - delete dlg; - return n; -} diff --git a/src/VISUGUI/VisuGUI_NameDlg.h b/src/VISUGUI/VisuGUI_NameDlg.h deleted file mode 100644 index 56a9819b..00000000 --- a/src/VISUGUI/VisuGUI_NameDlg.h +++ /dev/null @@ -1,46 +0,0 @@ -// SALOME VisuGUI : implementation of desktop and GUI kernel -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_NameDlg.h -// Author : Vadim SANDLER -// Module : SALOME -// $Header$ - -#ifndef VisuGUI_NAMEDLG_H -#define VisuGUI_NAMEDLG_H - -#include - -class QLineEdit; -class QPushButton; - -//================================================================================= -// class : VisuGUI_NameDlg -// purpose : Common dialog box class -//================================================================================= -class VisuGUI_NameDlg : public QDialog -{ - Q_OBJECT - -public: - VisuGUI_NameDlg( QWidget* parent = 0 ); - ~VisuGUI_NameDlg(); - - void setName( const QString& name ); - QString name(); - - static QString getName( QWidget* parent = 0, const QString& oldName = QString::null ); - -protected slots: - void accept(); - -private: - QPushButton* myButtonOk; - QPushButton* myButtonCancel; - QLineEdit* myLineEdit; -}; - -#endif // VisuGUI_NAMEDLG_H diff --git a/src/VISUGUI/VisuGUI_NonIsometricDlg.h b/src/VISUGUI/VisuGUI_NonIsometricDlg.h deleted file mode 100644 index 739f87ec..00000000 --- a/src/VISUGUI/VisuGUI_NonIsometricDlg.h +++ /dev/null @@ -1,40 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_NonIsometricDlg.h -// Author : Vasily Rusyaev -// Module : VISU -// $Header$ - -#ifndef VisuGUI_NONISOMETRICDLG_H -#define VisuGUI_NONISOMETRICDLG_H - -#include -class QtxDblSpinBox; -class QPushButton; - -class VisuGUI_NonIsometricDlg : public QDialog -{ - Q_OBJECT - -public: - VisuGUI_NonIsometricDlg (QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); - ~VisuGUI_NonIsometricDlg(); - -private: - QtxDblSpinBox* m_sbXcoeff; - QtxDblSpinBox* m_sbYcoeff; - QtxDblSpinBox* m_sbZcoeff; - QPushButton* m_bReset ; - -private slots: - void onClickApply(); - void onClickReset(); - void onClickOk(); - void onFunctionChanged(); -}; - -#endif // VisuGUI_NONISOMETRICDLG_H diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.cxx b/src/VISUGUI/VisuGUI_OffsetDlg.cxx deleted file mode 100644 index bb078813..00000000 --- a/src/VISUGUI/VisuGUI_OffsetDlg.cxx +++ /dev/null @@ -1,210 +0,0 @@ - -#include "VisuGUI_OffsetDlg.h" - -#include "VisuGUI.h" -#include "VisuGUI_Tools.h" - -#include "VISU_ViewManager_i.hh" -#include "VISU_Actor.h" - -#include "SalomeApp_Application.h" -#include "SVTK_ViewWindow.h" -#include "SVTK_ViewModel.h" -#include "SUIT_Desktop.h" - -#include "QtxDblSpinBox.h" - -// VTK Includes -#include "vtkRenderer.h" - -// QT Includes -#include -#include -#include -#include -#include -#include - - -#define MAXVAL 1e10 - - -VisuGUI_OffsetDlg::VisuGUI_OffsetDlg (VisuGUI* theModule) -: QDialog(VISU::GetDesktop(theModule), 0, false, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), -myModule(theModule) -{ - myPrsList.setAutoDelete(false); - - setName("VisuGUI_OffsetDlg"); - setCaption(tr("TIT_OFFSETDLG")); - setSizeGripEnabled(TRUE); - - QVBoxLayout* TopLayout = new QVBoxLayout (this); - TopLayout->setSpacing(6); - TopLayout->setMargin(11); - - QHBox* aOffsetsPane = new QHBox (this); - aOffsetsPane->setSpacing(6); - - new QLabel ("dX:", aOffsetsPane); - myDxEdt = new QtxDblSpinBox (aOffsetsPane, "myDxEdt"); - myDxEdt->setRange(-MAXVAL, MAXVAL); - - new QLabel("dY:", aOffsetsPane); - myDyEdt = new QtxDblSpinBox (aOffsetsPane, "myDyEdt"); - myDyEdt->setRange(-MAXVAL, MAXVAL); - - new QLabel("dZ:", aOffsetsPane); - myDzEdt = new QtxDblSpinBox (aOffsetsPane, "myDzEdt"); - myDzEdt->setRange(-MAXVAL, MAXVAL); - - QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), aOffsetsPane); - connect(aResetBtn, SIGNAL(clicked()), this, SLOT(onReset())); - - TopLayout->addWidget(aOffsetsPane); - - if (!VISU::GetCStudy(VISU::GetAppStudy(theModule))->GetProperties()->IsLocked()) { - mySaveChk = new QCheckBox ("Save to presentation", this); - TopLayout->addWidget(mySaveChk); - mySaveChk->setChecked(true); - } else { - mySaveChk = 0; - } - - // Common buttons =========================================================== - QGroupBox* GroupButtons = new QGroupBox(this, "GroupButtons"); - GroupButtons->setColumnLayout(0, Qt::Vertical); - GroupButtons->layout()->setSpacing(0); - GroupButtons->layout()->setMargin(0); - QGridLayout* GroupButtonsLayout = new QGridLayout(GroupButtons->layout()); - GroupButtonsLayout->setAlignment(Qt::AlignTop); - GroupButtonsLayout->setSpacing(6); - GroupButtonsLayout->setMargin(11); - - QPushButton* buttonOk = new QPushButton(tr("&OK"), GroupButtons, "buttonOk"); - buttonOk->setAutoDefault(TRUE); - buttonOk->setDefault(TRUE); - GroupButtonsLayout->addWidget(buttonOk, 0, 0); - GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1); - - QPushButton* buttonApply = new QPushButton(tr("&Apply"), GroupButtons, "buttonApply"); - buttonOk->setAutoDefault(TRUE); - GroupButtonsLayout->addWidget(buttonApply, 0, 2); - GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 3); - - QPushButton* buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel"); - buttonCancel->setAutoDefault(TRUE); - GroupButtonsLayout->addWidget(buttonCancel, 0, 4); - - TopLayout->addWidget(GroupButtons); - - connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(onApply())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); -} - -void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs) -{ - myPrsList.append(thePrs); - OffsetStruct aOffs; - thePrs->GetOffset(aOffs.myOffset); - myOldOffsets.append(aOffs); - if (myPrsList.count() == 1) { - setOffset(aOffs.myOffset); - } else if (myPrsList.count() == 2) { - float aOffset[3]; - aOffset[0] = aOffset[1] = aOffset[2] = 0; - setOffset(aOffset); - } -} - -void VisuGUI_OffsetDlg::setOffset (const float* theOffset) -{ - myDxEdt->setValue(theOffset[0]); - myDyEdt->setValue(theOffset[1]); - myDzEdt->setValue(theOffset[2]); -} - -void VisuGUI_OffsetDlg::getOffset (float* theOffset) const -{ - theOffset[0] = myDxEdt->value(); - theOffset[1] = myDyEdt->value(); - theOffset[2] = myDzEdt->value(); -} - -void VisuGUI_OffsetDlg::onReset() -{ - myDxEdt->setValue(0); - myDyEdt->setValue(0); - myDzEdt->setValue(0); -} - -bool VisuGUI_OffsetDlg::isToSave() const -{ - if (mySaveChk) - return mySaveChk->isChecked(); - else - return false; -} - -void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, float* theOffset) -{ - if (myPrsList.count() == 0) return; - - if (isToSave()) thePrs->SetOffset(theOffset); - - ViewManagerList aViewManagerList; - SalomeApp_Application* anApp = myModule->getApp(); - anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList); - QPtrListIterator anVMIter (aViewManagerList); - for (; anVMIter.current(); ++anVMIter) { - SUIT_ViewManager* aViewManager = anVMIter.current(); - QPtrVector aViews = aViewManager->getViews(); - for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) { - if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) { - if (SVTK_ViewWindow* vw = dynamic_cast(aViewWindow)) { - vw->onAdjustTrihedron(); - - if (VISU_Actor* anActor = VISU::GetActor(thePrs, vw)) { - anActor->SetPosition(theOffset); - vw->getRenderer()->ResetCameraClippingRange(); - vw->Repaint(); - - Handle(SALOME_InteractiveObject) anIO; - CORBA::Object_var anObject = VISU::GetSelectedObj(myModule, &anIO); - if (!CORBA::is_nil(anObject)) - vw->highlight(anIO, 1); - } - } - } - } - } -} - -void VisuGUI_OffsetDlg::accept() -{ - float aOffset[3]; - getOffset(aOffset); - for (int i = 0; i < myPrsList.count(); i++) { - updateOffset(myPrsList.at(i), aOffset); - } - QDialog::accept(); -} - -void VisuGUI_OffsetDlg::reject() -{ - for (int i = 0; i < myPrsList.count(); i++) { - updateOffset(myPrsList.at(i), myOldOffsets[i].myOffset); - } - QDialog::reject(); -} - -void VisuGUI_OffsetDlg::onApply() -{ - float aOffset[3]; - getOffset(aOffset); - for (int i = 0; i < myPrsList.count(); i++) { - updateOffset(myPrsList.at(i), aOffset); - } -} diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx deleted file mode 100644 index 78cbcec2..00000000 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ /dev/null @@ -1,566 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_Plot3DDlg.cxx -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -#include "VisuGUI_Plot3DDlg.h" - -#include "VisuGUI.h" -#include "VisuGUI_Tools.h" - -#include "VISU_ViewManager_i.hh" -#include "VISU_Plot3DPL.hxx" - -#include "SALOME_Actor.h" -#include "SVTK_ViewWindow.h" -#include "SUIT_Desktop.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace std; - -#define SURFACE_PRS_ID 0 -#define CONTOUR_PRS_ID 1 - -//======================================================================= -//function : renderViewFrame -//purpose : -//======================================================================= -static void renderViewFrame (SVTK_ViewWindow* vw) -{ - if (vw) { - vw->getRenderer()->ResetCameraClippingRange(); - vw->Repaint(); - } -} - -//======================================================================= -//class : TPlane -//purpose : actor of plane preview -//======================================================================= -class TPlane : public SALOME_Actor -{ - float mySize; - vtkDataSetMapper* myMapper; - vtkPlaneSource* myPlaneSource; - - public: - // constructor - TPlane(float planeSize): mySize(planeSize) - { - Init(); - } - // set plane parameters - void Set(float origin[3], float normal[3]) - { - float point2[3], point1[3]; - vtkMath::Perpendiculars(normal, point1, point2, 0.); - for (int i = 0; i < 3; ++i) { - point1[ i ] = point1[ i ] * mySize + origin[ i ]; - point2[ i ] = point2[ i ] * mySize + origin[ i ]; - } - myPlaneSource->SetOrigin(origin); - myPlaneSource->SetPoint1(point1); - myPlaneSource->SetPoint2(point2); - myPlaneSource->SetCenter(origin); - } - vtkTypeMacro(TPlane,SALOME_Actor); - - protected: - void Init() { - myPlaneSource = vtkPlaneSource::New(); - myMapper = vtkDataSetMapper::New(); - myMapper->SetInput(myPlaneSource->GetOutput()); - // actor methods - VisibilityOff(); - PickableOff(); - SetInfinitive(true); - SetOpacity(0.85); - SetMapper(myMapper); - } - ~TPlane() { - myMapper->RemoveAllInputs(); - myMapper->Delete(); - myPlaneSource->UnRegisterAllOutputs(); - myPlaneSource->Delete(); - }; - // Not implemented. - TPlane(const TPlane&); - void operator=(const TPlane&); -}; - -//======================================================================= -//function : VisuGUI_Plot3DPane -//purpose : -//======================================================================= -VisuGUI_Plot3DPane::VisuGUI_Plot3DPane (QWidget* parent) - : QVBox(parent), myInitFromPrs(false), myPreviewActor(NULL), - myViewWindow(VISU::GetViewWindow()), myPrs(NULL), myPipeCopy(NULL) -{ - layout()->setAlignment(Qt::AlignTop); - setSpacing(6); - - // Orientation - - GBOrientation = new QButtonGroup (tr("Orientation"), this, "GBOrientation"); - GBOrientation->setTitle(tr("ORIENTATION")); - GBOrientation->setColumnLayout(0, Qt::Vertical); - GBOrientation->layout()->setSpacing(0); - GBOrientation->layout()->setMargin(0); - QGridLayout* BGOrientationLayout = new QGridLayout (GBOrientation->layout()); - BGOrientationLayout->setAlignment(Qt::AlignTop); - BGOrientationLayout->setSpacing(6); - BGOrientationLayout->setMargin(11); - - QRadioButton *RBxy, *RByz, *RBzx; - RBxy = new QRadioButton (tr("// X-Y"), GBOrientation, "RBxy"); - RByz = new QRadioButton (tr("// Y-Z"), GBOrientation, "RByz"); - RBzx = new QRadioButton (tr("// Z-X"), GBOrientation, "RBzx"); - BGOrientationLayout->addWidget(RBxy, 0, 0); - BGOrientationLayout->addWidget(RByz, 0, 1); - BGOrientationLayout->addWidget(RBzx, 0, 2); - - // Rotation - - QGroupBox* GBrot = new QGroupBox (tr("ROTATIONS"), this, "GBrot"); - GBrot->setColumnLayout(0, Qt::Vertical); - GBrot->layout()->setSpacing(0); - GBrot->layout()->setMargin(0); - QGridLayout* GBrotLayout = new QGridLayout (GBrot->layout()); - GBrotLayout->setAlignment(Qt::AlignTop); - GBrotLayout->setSpacing(6); - GBrotLayout->setMargin(11); - // label 1 - LabelRot1 = new QLabel (tr("ROTATION_X"), GBrot, "LabelRot1"); - GBrotLayout->addWidget(LabelRot1, 0, 0); - // spin 1 - Rot1 = new QtxDblSpinBox (-180, 180, 5, GBrot); - Rot1->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - GBrotLayout->addWidget(Rot1, 0, 1); - // label 2 - LabelRot2 = new QLabel (tr("ROTATION_Y"), GBrot, "LabelRot2"); - GBrotLayout->addWidget(LabelRot2, 1, 0); - // spin 2 - Rot2 = new QtxDblSpinBox (-180, 180, 5, GBrot); - Rot2->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - GBrotLayout->addWidget(Rot2, 1, 1); - - // Position - - QGroupBox* GBpos = new QGroupBox (tr("POSITION"), this, "GBpos"); - GBpos->setColumnLayout(0, Qt::Horizontal); - GBpos->layout()->setSpacing(0); - GBpos->layout()->setMargin(0); - QGridLayout* GBposLayout = new QGridLayout (GBpos->layout()); - GBposLayout->setAlignment(Qt::AlignTop); - GBposLayout->setSpacing(6); - GBposLayout->setMargin(11); - // value label - QLabel * valueLabel = new QLabel (tr("POSITION_VALUE"), GBpos, "LabelRot1"); - GBposLayout->addWidget(valueLabel, 0, 0); - // value spin - PositionSpn = new QtxDblSpinBox (0, 1, 0.1, GBpos); - GBposLayout->addWidget(PositionSpn, 0, 1); - // Relative CheckBox - RelativeChkB = new QCheckBox (tr("RELATIVE"), GBpos, "RelativeChkB"); - RelativeChkB->setChecked(true); - GBposLayout->addWidget(RelativeChkB, 0, 2); - - // Scale, Presentation type, Nb Contours, Preview - - QFrame* bottomFrame = new QFrame (this); - QGridLayout* bottomLayout = new QGridLayout (bottomFrame); - bottomLayout->setAlignment(Qt::AlignTop); - bottomLayout->setSpacing(11); - bottomLayout->setMargin(0); - // scale - QLabel* scaleLabel = new QLabel (tr("SCALE"), bottomFrame); - ScaleSpn = new QtxDblSpinBox (-1.e6, 1.e6, 0.1, bottomFrame); - // Presentation type - GBPrsType = new QHButtonGroup (tr("PRESENTATION_TYPE"), bottomFrame); - new QRadioButton (tr("SURFACE"), GBPrsType); - new QRadioButton (tr("CONTOUR"), GBPrsType); - // nb Contours - QLabel* nbContLabel = new QLabel (tr("NUMBER_CONTOURS"), bottomFrame); - NbContoursSpn = new QSpinBox (1, 999, 1, bottomFrame, "NbContoursSpn"); - // Preview - PreviewChkB = new QCheckBox (tr("PREVIEW"), bottomFrame); - PreviewChkB->setChecked(false); - - bottomLayout->addWidget(scaleLabel, 0, 0); - bottomLayout->addWidget(ScaleSpn, 0, 1); - bottomLayout->addMultiCellWidget(GBPrsType, 1, 1, 0, 1); - bottomLayout->addWidget(nbContLabel, 2, 0); - bottomLayout->addWidget(NbContoursSpn, 2, 1); - bottomLayout->addWidget(PreviewChkB, 3, 0); - - // signals and slots connections - connect(GBOrientation, SIGNAL(clicked(int)), this, SLOT(orientationChanged(int))); - connect(Rot1, SIGNAL(valueChanged(double)), this, SLOT(updatePreview())); - connect(Rot2, SIGNAL(valueChanged(double)), this, SLOT(updatePreview())); - connect(PositionSpn, SIGNAL(valueChanged(double)), this, SLOT(onPositionSpn())); - connect(RelativeChkB, SIGNAL(toggled(bool)), this, SLOT(onRelativePos(bool))); - connect(GBPrsType, SIGNAL(clicked(int)), this, SLOT(onPrsType(int))); - connect(PreviewChkB, SIGNAL(toggled(bool)), this, SLOT(updatePreview())); -} - -//======================================================================= -//function : destructor -//purpose : -//======================================================================= -VisuGUI_Plot3DPane::~VisuGUI_Plot3DPane() -{ -} - -//======================================================================= -//function : storePrsParams -//purpose : create a copy of Prs parameters and then store current -// control values into the Prs -//======================================================================= -void VisuGUI_Plot3DPane::storePrsParams() -{ - if (!myPipeCopy) - myPipeCopy = VISU_Plot3DPL::New(); - if (myPrs) { - myPipeCopy->ShallowCopy(myPrs->GetPL()); - storeToPrsObject(myPrs); - } -} - -//======================================================================= -//function : restorePrsParams -//purpose : restore Prs parameters from the copy -//======================================================================= -void VisuGUI_Plot3DPane::restorePrsParams() -{ - if (!myPipeCopy) - myPipeCopy = VISU_Plot3DPL::New(); - if (myPrs) - myPrs->GetPL()->ShallowCopy(myPipeCopy); -} - -//======================================================================= -//function : onPositionSpn -//purpose : update absolute position range -//======================================================================= -void VisuGUI_Plot3DPane::onPositionSpn() -{ - if (myPrs && !RelativeChkB->isChecked()) { - float minPos, maxPos; - storePrsParams(); - myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos); - restorePrsParams(); - if (minPos > PositionSpn->value()) - minPos = PositionSpn->value(); - if (maxPos < PositionSpn->value()) - maxPos = PositionSpn->value(); - PositionSpn->setRange(minPos, maxPos); - } - updatePreview(); -} - -//======================================================================= -//function : orientationChanged -//purpose : update rotation labels and preview -//======================================================================= -void VisuGUI_Plot3DPane::orientationChanged(int Id) -{ - if (Id == 0) { // RBxy->isChecked() - LabelRot1->setText(tr("ROTATION_X")); - LabelRot2->setText(tr("ROTATION_Y")); - } else if (Id == 1) { // RByz->isChecked() - LabelRot1->setText(tr("ROTATION_Y")); - LabelRot2->setText(tr("ROTATION_Z")); - } else { - LabelRot1->setText(tr("ROTATION_Z")); - LabelRot2->setText(tr("ROTATION_X")); - } - updatePreview(); -} - -//======================================================================= -//function : onRelativePos -//purpose : update position value and range -//======================================================================= -void VisuGUI_Plot3DPane::onRelativePos(bool isRelativePos) -{ - float minPos = 0., maxPos = 1., pos = PositionSpn->value(); - if (myPrs) { - storePrsParams(); - myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos); - restorePrsParams(); - if (-1e-7 < (maxPos - minPos) && (maxPos - minPos) < 1e-7) { - pos = 0; - } else { - if (isRelativePos) // absolute -> relative - pos = (pos - minPos) / (maxPos - minPos); - else // relative -> absolute - pos = minPos * (1. - pos) + maxPos * pos; - } - } - if (isRelativePos) { - minPos = 0.; - maxPos = 1.; - } - PositionSpn->setMinValue(minPos); - PositionSpn->setMaxValue(maxPos); - PositionSpn->setLineStep((maxPos - minPos) / 10.); - PositionSpn->setValue(pos); -} - -//======================================================================= -//function : onPrsType -//purpose : -//======================================================================= -void VisuGUI_Plot3DPane::onPrsType(int id) -{ - NbContoursSpn->setEnabled(id == CONTOUR_PRS_ID); -} - -//======================================================================= -//function : updatePreview -//purpose : -//======================================================================= -void VisuGUI_Plot3DPane::updatePreview() -{ - if (myInitFromPrs || !myPrs || !myViewWindow) - return; - bool fitall = false; - if (PreviewChkB->isChecked()) // place preview plane - { - // get plane preview actor - TPlane* planePreview = (TPlane*) myPreviewActor; - if (!planePreview) { - myPreviewActor = planePreview = new TPlane(myPrs->GetInput()->GetLength()); - myViewWindow->AddActor(planePreview); - fitall = !VISU::GetActor(myPrs, myViewWindow); - } - // set plane parameters corresponding to control values - storePrsParams(); - float normal[3], origin[3]; - myPrs->GetPlot3DPL()->GetBasePlane(origin, normal, true); - planePreview->Set(origin, normal); - restorePrsParams(); - } - if (myPreviewActor) - myPreviewActor->SetVisibility(PreviewChkB->isChecked()); - - renderViewFrame(myViewWindow); - - if (fitall) { - myPreviewActor->SetInfinitive(false); - myViewWindow->onFitAll(); - myPreviewActor->SetInfinitive(true); - } -} - -//======================================================================= -//function : initFromPrsObject -//purpose : -//======================================================================= -void VisuGUI_Plot3DPane::initFromPrsObject(VISU::Plot3D_i* thePrs) -{ - myInitFromPrs = true; - myPrs = thePrs; - - // orientation - int id; - switch (thePrs->GetOrientationType()) { - case VISU::Plot3D::XY: id = 0; break; - case VISU::Plot3D::YZ: id = 1; break; - default: id = 2; - } - GBOrientation->setButton(id); - orientationChanged(id); - - // rotation - Rot1->setValue(thePrs->GetRotateX() * 180./PI); - Rot2->setValue(thePrs->GetRotateY() * 180./PI); - - // position - RelativeChkB->setChecked(thePrs->IsPositionRelative()); - onRelativePos(thePrs->IsPositionRelative()); // update range - PositionSpn->setValue(thePrs->GetPlanePosition()); - - // scale - ScaleSpn->setValue(thePrs->GetScaleFactor()); - - // prs type - id = thePrs->GetIsContourPrs() ? CONTOUR_PRS_ID : SURFACE_PRS_ID; - GBPrsType->setButton(id); - onPrsType(id); - - // nb contours - NbContoursSpn->setValue(thePrs->GetNbOfContours()); - - // disable cutting plane controls if the mesh is planar - - if (thePrs->GetPL()->IsPlanarInput()) - { - GBOrientation->setEnabled(false); - Rot1 ->setEnabled(false); - Rot2 ->setEnabled(false); - PositionSpn ->setEnabled(false); - RelativeChkB ->setEnabled(false); - PreviewChkB ->setEnabled(false); - } - - myInitFromPrs = false; - updatePreview(); -} - -//======================================================================= -//function : storeToPrsObject -//purpose : -//======================================================================= -int VisuGUI_Plot3DPane::storeToPrsObject(VISU::Plot3D_i* thePrs) -{ - if (myInitFromPrs) - return 0; - // orientation - int id = GBOrientation->id (GBOrientation->selected()); - VISU::Plot3D::Orientation ori; - switch (id) { - case 0 : ori = VISU::Plot3D::XY; break; - case 1 : ori = VISU::Plot3D::YZ; break; - default: ori = VISU::Plot3D::ZX; - } - // rotation - thePrs->SetOrientation(ori, Rot1->value()*PI/180., Rot2->value()*PI/180.); - - // position - thePrs->SetPlanePosition(PositionSpn->value(), RelativeChkB->isChecked()); - - // scale - thePrs->SetScaleFactor(ScaleSpn->value()); - - // prs type - id = GBPrsType->id (GBPrsType->selected()); - thePrs->SetContourPrs(id == CONTOUR_PRS_ID); - - // nb contours - thePrs->SetNbOfContours(NbContoursSpn->value()); - - return 1; -} - -//======================================================================= -//function : check -//purpose : -//======================================================================= -bool VisuGUI_Plot3DPane::check() -{ - if (myPreviewActor && myViewWindow) // erase preview - { - myPreviewActor->SetVisibility(false); - myViewWindow->RemoveActor(myPreviewActor); - myPreviewActor->Delete(); - myPreviewActor = 0; - } - - return true; -} - -//======================================================================= -//function : Constructor -//purpose : -//======================================================================= -VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg (SalomeApp_Module* theModule) - : QDialog(VISU::GetDesktop(theModule), "VisuGUI_Plot3DDlg", false, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - setCaption(tr("TITLE")); - setSizeGripEnabled(TRUE); - - QVBoxLayout* TopLayout = new QVBoxLayout(this); - TopLayout->setSpacing(6); - TopLayout->setMargin(11); - - QTabWidget* aTabBox = new QTabWidget (this); - myIsoPane = new VisuGUI_Plot3DPane (this); - myIsoPane->setMargin(5); - aTabBox->addTab(myIsoPane, tr("PLOT3D_TAB_TITLE")); - myScalarPane = new VisuGUI_ScalarBarPane (this, false); - myScalarPane->setMargin(5); - aTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB_TITLE")); - - TopLayout->addWidget(aTabBox); - - QGroupBox* GroupButtons = new QGroupBox (this, "GroupButtons"); - GroupButtons->setGeometry(QRect(10, 10, 281, 48)); - GroupButtons->setColumnLayout(0, Qt::Vertical); - GroupButtons->layout()->setSpacing(0); - GroupButtons->layout()->setMargin(0); - QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons->layout()); - GroupButtonsLayout->setAlignment(Qt::AlignTop); - GroupButtonsLayout->setSpacing(6); - GroupButtonsLayout->setMargin(11); - - QPushButton* buttonOk = new QPushButton (tr("&OK"), GroupButtons, "buttonOk"); - buttonOk->setAutoDefault(TRUE); - buttonOk->setDefault(TRUE); - GroupButtonsLayout->addWidget(buttonOk, 0, 0); - GroupButtonsLayout->addItem(new QSpacerItem (5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1); - QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel"); - buttonCancel->setAutoDefault(TRUE); - GroupButtonsLayout->addWidget(buttonCancel, 0, 2); - - TopLayout->addWidget(GroupButtons); - - // signals and slots connections - connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); -} - -//======================================================================= -//function : accept -//purpose : -//======================================================================= -void VisuGUI_Plot3DDlg::accept() -{ - if (myIsoPane->check() && myScalarPane->check()) - QDialog::accept(); -} - -//======================================================================= -//function : reject -//purpose : -//======================================================================= -void VisuGUI_Plot3DDlg::reject() -{ - myIsoPane->check(); // hide preview - - QDialog::reject(); -} diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.h b/src/VISUGUI/VisuGUI_Plot3DDlg.h deleted file mode 100644 index a1e59f90..00000000 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.h +++ /dev/null @@ -1,119 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_Plot3DDlg.h -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -#ifndef VISUGUI_PLOT3D_H -#define VISUGUI_PLOT3D_H - -#include "VisuGUI_ScalarBarDlg.h" - -#include "VISU_Plot3D_i.hh" - -#include - -class SalomeApp_Module; - -namespace VISU { - class Plot3D_i; -}; - -class VISU_Plot3DPL; -class SVTK_ViewWindow; -class SALOME_Actor; -class QtxDblSpinBox; - -class VisuGUI_Plot3DPane : public QVBox -{ - Q_OBJECT - - public: - VisuGUI_Plot3DPane(QWidget* parent); - ~VisuGUI_Plot3DPane(); - - void initFromPrsObject (VISU::Plot3D_i* thePrs); - int storeToPrsObject (VISU::Plot3D_i* thePrs); - - bool check(); - - VISU::Plot3D_i* GetPrs() { return myPrs; } - - private: - bool myInitFromPrs; - SALOME_Actor* myPreviewActor; - SVTK_ViewWindow* myViewWindow; - VISU::Plot3D_i* myPrs; - VISU_Plot3DPL* myPipeCopy; - - void storePrsParams(); - void restorePrsParams(); - - QButtonGroup * GBOrientation; - QLabel * LabelRot1; - QLabel * LabelRot2; - QtxDblSpinBox * Rot1; - QtxDblSpinBox * Rot2; - QtxDblSpinBox * PositionSpn; - QCheckBox * RelativeChkB; - QtxDblSpinBox * ScaleSpn; - QHButtonGroup * GBPrsType; - QSpinBox * NbContoursSpn; - QCheckBox * PreviewChkB; - - private slots: - - void orientationChanged( int ); - void onRelativePos( bool ); - void onPrsType( int ); - void onPositionSpn(); - void updatePreview(); -}; - - -class VisuGUI_Plot3DDlg : public QDialog -{ - Q_OBJECT - - public: - VisuGUI_Plot3DDlg (SalomeApp_Module* theModule); - ~VisuGUI_Plot3DDlg() {}; - - void initFromPrsObject (VISU::Plot3D_i* thePrs) - { myScalarPane->initFromPrsObject(thePrs); myIsoPane->initFromPrsObject(thePrs); } - - int storeToPrsObject (VISU::Plot3D_i* thePrs) - { return myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs); } - - protected slots: - void accept(); - void reject(); - - private: - VisuGUI_Plot3DPane* myIsoPane; - VisuGUI_ScalarBarPane* myScalarPane; -}; - -#endif // VISUGUI_PLOT3D_H diff --git a/src/VISUGUI/VisuGUI_PopupTools.h b/src/VISUGUI/VisuGUI_PopupTools.h deleted file mode 100644 index f93d8810..00000000 --- a/src/VISUGUI/VisuGUI_PopupTools.h +++ /dev/null @@ -1,65 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2005 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_PopupTools.h -// Author : Sergey Anikin -// Module : VISU - -#ifndef VisuGUI_PopupTools_HeaderFile -#define VisuGUI_PopupTools_HeaderFile - -#include - -////////////////////////////////////////////////// -// Class: VisuGUI_Selection -////////////////////////////////////////////////// - -class SalomeApp_Module; - -class VisuGUI_Selection : public SalomeApp_Selection -{ -public: - VisuGUI_Selection( SalomeApp_Module* theModule ) : myModule( theModule ) {}; - virtual ~VisuGUI_Selection() {}; - - virtual QtxValue param( const int, const QString& ) const; - -private: - QString type( const int ) const; - QString nbComponents( const int ) const; - QString nbTimeStamps( const int ) const; - QString representation( const int ) const; - QString nbChildren( const int ) const; - QString nbNamedChildren( const int ) const; - QString isVisible( const int ) const; - QString isShrunk( const int ) const; - QString hasActor( const int ) const; - -private: - int nbChild( const int, const bool ) const; - -private: - SalomeApp_Module* myModule; -}; - -#endif diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx deleted file mode 100644 index 6a24502f..00000000 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ /dev/null @@ -1,923 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_ScalarBarDlg.cxx -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -#include "VisuGUI_ScalarBarDlg.h" - -#include "VisuGUI.h" -#include "VisuGUI_Tools.h" -#include "VisuGUI_FontWg.h" - -#include "VISUConfig.hh" -#include "VISU_Convertor.hxx" - -#include "VISU_ScalarMapPL.hxx" -#include "VISU_ScalarMap_i.hh" - -#include "SalomeApp_Application.h" - -#include "SUIT_MessageBox.h" -#include "SUIT_ResourceMgr.h" - -#include -#include -#include -#include - -using namespace std; - - -VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent, bool SetPref): - QVBox(parent) -{ - myVerX = 0.01; myVerY = 0.10; myVerW = 0.10; myVerH = 0.80; - myHorX = 0.20; myHorY = 0.01; myHorW = 0.60; myHorH = 0.12; - Imin = 0.0; Imax = 0.0; /*Fmin = 0.0; Fmax = 0.0;*/ Rmin = 0.0; Rmax = 0.0; - myRangeMode = -1; - - setSpacing(6); - //setMargin(11); - - // Range ============================================================ - RangeGroup = new QButtonGroup (tr("SCALAR_RANGE_GRP"), this, "RangeGroup"); - RangeGroup->setColumnLayout(0, Qt::Vertical ); - RangeGroup->layout()->setSpacing( 0 ); - RangeGroup->layout()->setMargin( 0 ); - QGridLayout* RangeGroupLayout = new QGridLayout( RangeGroup->layout() ); - RangeGroupLayout->setAlignment( Qt::AlignTop ); - RangeGroupLayout->setSpacing( 6 ); - RangeGroupLayout->setMargin( 11 ); - - myModeLbl = new QLabel("Scalar Mode", RangeGroup); - - myModeCombo = new QComboBox(RangeGroup); - myModeCombo->insertItem("Modulus"); - myModeCombo->insertItem("Component 1"); - myModeCombo->insertItem("Component 2"); - myModeCombo->insertItem("Component 3"); - - CBLog = new QCheckBox (tr("LOGARITHMIC_SCALING"), RangeGroup); - CBLog->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - RBFrange = new QRadioButton (tr("FIELD_RANGE_BTN"), RangeGroup, "RBFrange"); - RBIrange = new QRadioButton (tr("IMPOSED_RANGE_BTN"), RangeGroup, "RBIrange"); - RBFrange->setChecked( true ); - - MinEdit = new QLineEdit( RangeGroup, "MinEdit" ); - MinEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - MinEdit->setMinimumWidth( 70 ); - MinEdit->setValidator( new QDoubleValidator(this) ); - MinEdit->setText( "0.0" ); - QLabel* MinLabel = new QLabel (tr("LBL_MIN"), RangeGroup, "MinLabel"); - MinLabel->setBuddy(MinEdit); - - MaxEdit = new QLineEdit( RangeGroup, "MaxEdit" ); - MaxEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - MaxEdit->setMinimumWidth( 70 ); - MaxEdit->setValidator( new QDoubleValidator(this) ); - MaxEdit->setText( "0.0" ); - QLabel* MaxLabel = new QLabel (tr("LBL_MAX"), RangeGroup, "MaxLabel"); - MaxLabel->setBuddy(MaxEdit); - - RangeGroupLayout->addWidget( myModeLbl, 0, 0 ); - RangeGroupLayout->addMultiCellWidget( myModeCombo, 0, 0, 1, 3); - RangeGroupLayout->addMultiCellWidget( CBLog, 1, 1, 0, 3); - RangeGroupLayout->addMultiCellWidget( RBFrange, 2, 2, 0, 1); - RangeGroupLayout->addMultiCellWidget( RBIrange, 2, 2, 2, 3); - RangeGroupLayout->addWidget( MinLabel, 3, 0 ); - RangeGroupLayout->addWidget( MinEdit, 3, 1 ); - RangeGroupLayout->addWidget( MaxLabel, 3, 2 ); - RangeGroupLayout->addWidget( MaxEdit, 3, 3 ); - - //TopLayout->addWidget( RangeGroup ); - - // Colors and Labels ======================================================== - QGroupBox* ColLabGroup = new QGroupBox (tr("COLORS_LABELS_GRP"), this, "ColLabGroup"); - ColLabGroup->setColumnLayout(0, Qt::Vertical ); - ColLabGroup->layout()->setSpacing( 0 ); - ColLabGroup->layout()->setMargin( 0 ); - QGridLayout* ColLabGroupLayout = new QGridLayout( ColLabGroup->layout() ); - ColLabGroupLayout->setAlignment( Qt::AlignTop ); - ColLabGroupLayout->setSpacing( 6 ); - ColLabGroupLayout->setMargin( 11 ); - - QLabel* ColorLabel = new QLabel (tr("LBL_NB_COLORS"), ColLabGroup, "ColorLabel"); - ColorSpin = new QSpinBox( 2, 256, 1, ColLabGroup ); - ColorSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - ColorSpin->setMinimumWidth( 70 ); - ColorSpin->setValue( 64 ); - - QLabel* LabelLabel = new QLabel (tr("LBL_NB_LABELS"), ColLabGroup, "LabelLabel"); - LabelSpin = new QSpinBox( 2, 65, 1, ColLabGroup ); - LabelSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - LabelSpin->setMinimumWidth( 70 ); - LabelSpin->setValue( 5 ); - - ColLabGroupLayout->addWidget( ColorLabel, 0, 0); - ColLabGroupLayout->addWidget( ColorSpin, 0, 1); - ColLabGroupLayout->addWidget( LabelLabel, 0, 2); - ColLabGroupLayout->addWidget( LabelSpin, 0, 3); - - //TopLayout->addWidget( ColLabGroup ); - - // Orientation ========================================================== - QButtonGroup* OrientGroup = new QButtonGroup (tr("ORIENTATION_GRP"), this, "OrientGroup"); - OrientGroup->setColumnLayout(0, Qt::Vertical ); - OrientGroup->layout()->setSpacing( 0 ); - OrientGroup->layout()->setMargin( 0 ); - QGridLayout* OrientGroupLayout = new QGridLayout( OrientGroup->layout() ); - OrientGroupLayout->setAlignment( Qt::AlignTop ); - OrientGroupLayout->setSpacing( 6 ); - OrientGroupLayout->setMargin( 11 ); - - RBvert = new QRadioButton (tr("VERTICAL_BTN"), OrientGroup, "RBvert"); - RBvert->setChecked( true ); - RBhori = new QRadioButton (tr("HORIZONTAL_BTN"), OrientGroup, "RBhori"); - OrientGroupLayout->addWidget( RBvert, 0, 0 ); - OrientGroupLayout->addWidget( RBhori, 0, 1 ); - - // TopLayout->addWidget( OrientGroup ); - - // Origin =============================================================== - QGroupBox* OriginGroup = new QGroupBox (tr("ORIGIN_GRP"), this, "OriginGroup"); - OriginGroup->setColumnLayout(0, Qt::Vertical ); - OriginGroup->layout()->setSpacing( 0 ); - OriginGroup->layout()->setMargin( 0 ); - QGridLayout* OriginGroupLayout = new QGridLayout( OriginGroup->layout() ); - OriginGroupLayout->setAlignment( Qt::AlignTop ); - OriginGroupLayout->setSpacing( 6 ); - OriginGroupLayout->setMargin( 11 ); - - QLabel* XLabel = new QLabel (tr("LBL_X"), OriginGroup, "XLabel"); - XSpin = new QtxDblSpinBox( 0.0, 1.0, 0.1, OriginGroup ); - XSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - XSpin->setMinimumWidth( 70 ); - XSpin->setValue( 0.01 ); - - QLabel* YLabel = new QLabel (tr("LBL_Y"), OriginGroup, "YLabel"); - YSpin = new QtxDblSpinBox( 0.0, 1.0, 0.1, OriginGroup ); - YSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - YSpin->setMinimumWidth( 70 ); - YSpin->setValue( 0.01 ); - - OriginGroupLayout->addWidget( XLabel, 0, 0); - OriginGroupLayout->addWidget( XSpin, 0, 1); - OriginGroupLayout->addWidget( YLabel, 0, 2); - OriginGroupLayout->addWidget( YSpin, 0, 3); - - //TopLayout->addWidget( OriginGroup ); - - // Dimensions ========================================================= - QGroupBox* DimGroup = new QGroupBox (tr("DIMENSIONS_GRP"), this, "DimGroup"); - DimGroup->setColumnLayout(0, Qt::Vertical ); - DimGroup->layout()->setSpacing( 0 ); - DimGroup->layout()->setMargin( 0 ); - QGridLayout* DimGroupLayout = new QGridLayout( DimGroup->layout() ); - DimGroupLayout->setAlignment( Qt::AlignTop ); - DimGroupLayout->setSpacing( 6 ); - DimGroupLayout->setMargin( 11 ); - - QLabel* WidthLabel = new QLabel (tr("LBL_WIDTH"), DimGroup, "WidthLabel"); - WidthSpin = new QtxDblSpinBox( 0.0, 1.0, 0.1, DimGroup ); - WidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - WidthSpin->setMinimumWidth( 70 ); - WidthSpin->setValue( 0.1 ); - - QLabel* HeightLabel = new QLabel (tr("LBL_HEIGHT"), DimGroup, "HeightLabel"); - HeightSpin = new QtxDblSpinBox( 0.0, 1.0, 0.1, DimGroup ); - HeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - HeightSpin->setMinimumWidth( 70 ); - HeightSpin->setValue( 0.8 ); - - DimGroupLayout->addWidget( WidthLabel, 0, 0); - DimGroupLayout->addWidget( WidthSpin, 0, 1); - DimGroupLayout->addWidget( HeightLabel, 0, 2); - DimGroupLayout->addWidget( HeightSpin, 0, 3); - - //TopLayout->addWidget( DimGroup ); - - // Save check box =========================================================== - QHBox* aSaveBox = new QHBox(this); - if (!SetPref) { - CBSave = new QCheckBox (tr("SAVE_DEFAULT_CHK"), aSaveBox, "CBSave"); - //TopLayout->addWidget(CBSave); - } - else { - CBSave = 0; - } - myTextBtn = new QPushButton("Text properties...", aSaveBox); - myTextDlg = new VisuGUI_TextPrefDlg(this); - myTextDlg->setTitleVisible(!SetPref); - - // signals and slots connections =========================================== - connect( RangeGroup, SIGNAL( clicked( int ) ), this, SLOT( changeRange( int ) ) ); - connect( OrientGroup, SIGNAL( clicked( int ) ), this, SLOT( changeDefaults( int ) ) ); - connect( XSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) ); - connect( YSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) ); - connect( myTextBtn, SIGNAL( clicked() ), this, SLOT( onTextPref() ) ); - - changeRange( 0 ); - changeDefaults( 0 ); - myIsStoreTextProp = false; -} - - -/** - * Initializes dialog box values from resources - */ -void VisuGUI_ScalarBarPane::initFromResources() { - int sbCol=64,sbLab=5,orient=0; - float sbX1=0.01,sbY1=0.1,sbW=0.1,sbH=0.8; - float sbVmin=0., sbVmax=0.; - bool sbRange=false; - QString aString; - - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - - int aScalarMode = aResourceMgr->integerValue("VISU", "scalar_bar_mode", 0); - myModeCombo->setCurrentItem(aScalarMode); - - orient = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", orient); - if(orient != 0){ - orient=1; - sbX1=0.2; - sbY1=0.01; - sbW=0.6; - sbH=0.12; - } - - QString propertyName = QString( "scalar_bar_%1_" ).arg( orient == 0 ? "vertical" : "horizontal" ); - - sbX1 = aResourceMgr->doubleValue("VISU", propertyName + "x", sbX1); - sbY1 = aResourceMgr->doubleValue("VISU", propertyName + "y", sbY1); - - sbW = aResourceMgr->doubleValue("VISU", propertyName + "width", sbW); - sbH = aResourceMgr->doubleValue("VISU", propertyName + "height",sbH); - - sbCol = aResourceMgr->integerValue("VISU" ,"scalar_bar_num_colors", sbCol); - sbLab = aResourceMgr->integerValue("VISU", "scalar_bar_num_labels", sbLab); - - int rangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0); - if (rangeType == 1) sbRange = true; - sbVmin = aResourceMgr->doubleValue("VISU", "scalar_range_min", sbVmin); - sbVmax = aResourceMgr->doubleValue("VISU", "scalar_range_max", sbVmax); - - bool isLog = aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false); - setLogarithmic(isLog); - - if((sbX1 < 0.) || (sbY1 < 0.) || - ((sbX1+sbW) > 1.) || ((sbY1+sbH) > 1.)) { - if(orient == 0) { - sbX1=0.01; - sbY1=0.1; - sbW=0.1; - sbH=0.8; - } else { - sbX1=0.2; - sbY1=0.01; - sbW=0.6; - sbH=0.12; - } - } - if(sbCol < 2) sbCol=2; - if(sbCol > 64) sbCol=64; - if(sbLab < 2) sbLab=2; - if(sbLab > 65) sbLab=65; - - if(sbVmin > sbVmax) { - sbVmin=0.; - sbVmax=0.; - } - - setRange( sbVmin, sbVmax, /*0.0, 0.0,*/ sbRange ); - setPosAndSize( sbX1, sbY1, sbW, sbH, orient == 0); - setScalarBarData( sbCol, sbLab ); - - // "Title" - bool isBold = false, isItalic = false, isShadow = false; - int aFontFamily = VTK_ARIAL; - - if ( aResourceMgr->hasValue( "VISU", "scalar_bar_title_font" ) ) - { - QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_title_font" ); - - if ( f.family() == "Arial" ) - aFontFamily = VTK_ARIAL; - else if ( f.family() == "Courier" ) - aFontFamily = VTK_COURIER; - else if ( f.family() == "Times" ) - aFontFamily = VTK_TIMES; - - isBold = f.bold(); - isItalic = f.italic(); - isShadow = f.underline(); - } - - QColor aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_title_color", QColor( 255, 255, 255 ) ); - - myTextDlg->myTitleFont->SetData(aTextColor, aFontFamily, isBold, isItalic, isShadow); - - // "Labels" - isBold = isItalic = isShadow = false; - aFontFamily = VTK_ARIAL; - - if ( aResourceMgr->hasValue( "VISU", "scalar_bar_label_font" ) ) - { - QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_label_font" ); - - if ( f.family() == "Arial" ) - aFontFamily = VTK_ARIAL; - else if ( f.family() == "Courier" ) - aFontFamily = VTK_COURIER; - else if ( f.family() == "Times" ) - aFontFamily = VTK_TIMES; - - isBold = f.bold(); - isItalic = f.italic(); - isShadow = f.underline(); - } - - aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_label_color", QColor( 255, 255, 255 ) ); - - myTextDlg->myLabelFont->SetData(aTextColor, aFontFamily, isBold, isItalic, isShadow); -} - -/** - * Stores dialog values to resources - */ -void VisuGUI_ScalarBarPane::storeToResources() { - int orient = (RBvert->isChecked())? 0 : 1; - float sbX1 = XSpin->value(); - float sbY1 = YSpin->value(); - float sbW = WidthSpin->value(); - float sbH = HeightSpin->value(); - int sbCol = ColorSpin->value(); - int sbLab = LabelSpin->value(); - - if((sbX1 < 0.) || (sbY1 < 0.) || ((sbX1+sbW) > 1.) || ((sbY1+sbH) > 1.)) { - if(orient == 0) { - sbX1=0.01; - sbY1=0.1; - sbW=0.17; - sbH=0.8; - } else { - sbX1=0.2; - sbY1=0.01; - sbW=0.6; - sbH=0.12; - } - } - - bool sbRange = RBIrange->isChecked(); - float sbVmin = (float)(MinEdit->text().toDouble()); - float sbVmax = (float)(MaxEdit->text().toDouble()); - - if(sbVmin > sbVmax) { - sbVmin=0.; - sbVmax=0.; - } - - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - - aResourceMgr->setValue("VISU", "scalar_bar_orientation", orient); - - QString propertyName = QString( "scalar_bar_%1_" ).arg( orient == 0 ? "vertical" : "horizontal" ); - - aResourceMgr->setValue("VISU", propertyName + "x", sbX1); - aResourceMgr->setValue("VISU", propertyName + "y", sbY1); - aResourceMgr->setValue("VISU", propertyName + "width", sbW); - aResourceMgr->setValue("VISU", propertyName + "height", sbH); - - aResourceMgr->setValue("VISU", "scalar_bar_num_colors", sbCol); - aResourceMgr->setValue("VISU", "scalar_bar_num_labels", sbLab); - - if(sbRange) - { - aResourceMgr->setValue("VISU", "scalar_range_type", 1); - aResourceMgr->setValue("VISU", "scalar_range_min" ,sbVmin); - aResourceMgr->setValue("VISU", "scalar_range_max" ,sbVmax); - } - else - aResourceMgr->setValue("VISU", "scalar_range_type", 0); - - aResourceMgr->setValue("VISU", "scalar_bar_logarithmic", isLogarithmic()); - - //// - - if (myIsStoreTextProp) { - // "Title" - QColor aTitleColor (255, 255, 255); - int aTitleFontFamily = VTK_ARIAL; - bool isTitleBold = false; - bool isTitleItalic = false; - bool isTitleShadow = false; - - myTextDlg->myTitleFont->GetData(aTitleColor, aTitleFontFamily, - isTitleBold, isTitleItalic, isTitleShadow); - - QFont aTitleFont; - - aTitleFont.setBold(isTitleBold); - aTitleFont.setItalic(isTitleItalic); - aTitleFont.setUnderline(isTitleShadow); - - QString titleFontFamily; - switch (aTitleFontFamily) { - case VTK_ARIAL: - titleFontFamily = "Arial"; - break; - case VTK_COURIER: - titleFontFamily = "Courier"; - break; - case VTK_TIMES: - titleFontFamily = "Times"; - break; - } - aTitleFont.setFamily(titleFontFamily); - - aResourceMgr->setValue("VISU", "scalar_bar_title_font", aTitleFont); - - aResourceMgr->setValue("VISU", "scalar_bar_title_color", aTitleColor); - - // "Label" - QColor aLabelColor (255, 255, 255); - int aLabelFontFamily = VTK_ARIAL; - bool isLabelBold = false; - bool isLabelItalic = false; - bool isLabelShadow = false; - - myTextDlg->myLabelFont->GetData(aLabelColor, aLabelFontFamily, - isLabelBold, isLabelItalic, isLabelShadow); - - - QFont aLabelFont; - - aLabelFont.setBold(isLabelBold); - aLabelFont.setItalic(isLabelItalic); - aLabelFont.setUnderline(isLabelShadow); - - QString labelFontFamily; - switch (aLabelFontFamily) { - case VTK_ARIAL: - labelFontFamily = "Arial"; - break; - case VTK_COURIER: - labelFontFamily = "Courier"; - break; - case VTK_TIMES: - labelFontFamily = "Times"; - break; - } - - aLabelFont.setFamily(labelFontFamily); - - aResourceMgr->setValue("VISU", "scalar_bar_label_font", aLabelFont); - - aResourceMgr->setValue("VISU", "scalar_bar_label_color", aLabelColor); - } -} - -/** - * Initialise dialog box from presentation object - */ -void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { - initFromResources(); - myModeCombo->setCurrentItem(thePrs->GetScalarMode()); - setPosAndSize( thePrs->GetPosX(), - thePrs->GetPosY(), - thePrs->GetWidth(), - thePrs->GetHeight(), - thePrs->GetBarOrientation()); - switch(thePrs->GetScaling()){ - case VISU::LOGARITHMIC : - setLogarithmic(true); - break; - default: - setLogarithmic(false); - } - float aRange[2]; - thePrs->GetScalarMapPL()->GetSourceRange(aRange); - Rmin = aRange[0]; Rmax = aRange[1]; - setRange( thePrs->GetMin(), thePrs->GetMax(), - /*0.0, 0.0,*/ thePrs->IsRangeFixed() ); - setScalarBarData( thePrs->GetNbColors(), thePrs->GetLabels() ); - bool isScalarMode = (thePrs->GetField()->myNbComp > 1); - myModeLbl->setEnabled(isScalarMode); - myModeCombo->setEnabled(isScalarMode); - - // "Title" - myTextDlg->setTitleText(QString(thePrs->GetTitle())); - - float R, G, B; - thePrs->GetTitleColor(&R, &G, &B); - - myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)), - thePrs->GetTitFontType(), - thePrs->IsBoldTitle(), - thePrs->IsItalicTitle(), - thePrs->IsShadowTitle()); - - // "Labels" - thePrs->GetLabelColor(&R, &G, &B); - - myTextDlg->myLabelFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)), - thePrs->GetLblFontType(), - thePrs->IsBoldLabel(), - thePrs->IsItalicLabel(), - thePrs->IsShadowLabel()); -} - -/** - * Store values to presentation object - */ -int VisuGUI_ScalarBarPane::storeToPrsObject(VISU::ScalarMap_i* thePrs) { - thePrs->SetScalarMode(myModeCombo->currentItem()); - thePrs->SetPosition(XSpin->value(), YSpin->value()); - thePrs->SetSize(WidthSpin->value(), HeightSpin->value()); - thePrs->SetBarOrientation((RBvert->isChecked())? VISU::ScalarMap::VERTICAL : VISU::ScalarMap::HORIZONTAL); - if(isLogarithmic()) - thePrs->SetScaling(VISU::LOGARITHMIC); - else - thePrs->SetScaling(VISU::LINEAR); - - if (RBFrange->isChecked()) { - thePrs->SetSourceRange(); - } else { - thePrs->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble()); - } - thePrs->SetNbColors(ColorSpin->value()); - thePrs->SetLabels(LabelSpin->value()); - - if (isToSave()) storeToResources(); - - if (myIsStoreTextProp) { - // "Title" - thePrs->SetTitle(myTextDlg->getTitleText().latin1()); - - QColor aTitColor (255, 255, 255); - int aTitleFontFamily = VTK_ARIAL; - bool isTitleBold = false; - bool isTitleItalic = false; - bool isTitleShadow = false; - - myTextDlg->myTitleFont->GetData(aTitColor, aTitleFontFamily, - isTitleBold, isTitleItalic, isTitleShadow); - - thePrs->SetBoldTitle(isTitleBold); - thePrs->SetItalicTitle(isTitleItalic); - thePrs->SetShadowTitle(isTitleShadow); - thePrs->SetTitFontType(aTitleFontFamily); - thePrs->SetTitleColor(aTitColor.red()/255., - aTitColor.green()/255., - aTitColor.blue()/255.); - - // "Label" - QColor aLblColor (255, 255, 255); - int aLabelFontFamily = VTK_ARIAL; - bool isLabelBold = false; - bool isLabelItalic = false; - bool isLabelShadow = false; - - myTextDlg->myLabelFont->GetData(aLblColor, aLabelFontFamily, - isLabelBold, isLabelItalic, isLabelShadow); - - thePrs->SetBoldLabel(isLabelBold); - thePrs->SetItalicLabel(isLabelItalic); - thePrs->SetShadowLabel(isLabelShadow); - thePrs->SetLblFontType(aLabelFontFamily); - thePrs->SetLabelColor(aLblColor.red()/255., - aLblColor.green()/255., - aLblColor.blue()/255.); - } - - return 1; -} - -/*! - Called when orientation is changed -*/ -void VisuGUI_ScalarBarPane::changeDefaults( int ) -{ - if ( RBvert->isChecked() ) { - XSpin->setValue( myVerX ); - YSpin->setValue( myVerY ); - WidthSpin->setValue( myVerW ); - HeightSpin->setValue( myVerH ); - } - else { - XSpin->setValue( myHorX ); - YSpin->setValue( myHorY ); - WidthSpin->setValue( myHorW ); - HeightSpin->setValue( myHorH ); - } -} - -/*! - Called when Range mode is changed -*/ -void VisuGUI_ScalarBarPane::changeRange( int ) -{ - int mode = -1; - if ( RBFrange->isChecked() ) - mode = 0; - if ( RBIrange->isChecked() ) - mode = 1; - if ( myRangeMode == mode ) - return; - //MinSpin->setMaxValue( Fmin ); - //MaxSpin->setMinValue( Fmax ); - if ( RBFrange->isChecked() ) { - //MinLabel->setEnabled( false ); - MinEdit->setEnabled( false ); - //MaxLabel->setEnabled( false ); - MaxEdit->setEnabled( false ); - if ( mode != -1 ) { - Imin = MinEdit->text().toDouble(); - Imax = MaxEdit->text().toDouble(); - } - MinEdit->setText( QString::number( Rmin ) ); - MaxEdit->setText( QString::number( Rmax ) ); - } - else { - //MinLabel->setEnabled( true ); - MinEdit->setEnabled( true ); - //MaxLabel->setEnabled( true ); - MaxEdit->setEnabled( true ); - MinEdit->setText( QString::number( Imin ) ); - MaxEdit->setText( QString::number( Imax ) ); - } - myRangeMode = mode; -} - -/*! - Called when X,Y position is changed -*/ -void VisuGUI_ScalarBarPane::XYChanged( double ) -{ - QtxDblSpinBox* snd = (QtxDblSpinBox*)sender(); - if ( snd == XSpin ) { - WidthSpin->setMaxValue( 1.0 - XSpin->value() ); - } - if ( snd == YSpin ) { - HeightSpin->setMaxValue( 1.0 - YSpin->value() ); - } -} - -/*! - Sets default values and range mode -*/ -void VisuGUI_ScalarBarPane::setRange( double imin, double imax/*, double fmin, double fmax*/, bool sbRange ) -{ - Imin = imin; Imax = imax;// Fmin = fmin; Fmax = fmax; - if ( RBIrange->isChecked() ) { - MinEdit->setText( QString::number( Imin ) ); - MaxEdit->setText( QString::number( Imax ) ); - } - else { - MinEdit->setText( QString::number( Rmin ) ); - MaxEdit->setText( QString::number( Rmax ) ); - } - myRangeMode = -1; - if( sbRange ) - RBIrange->setChecked( true ); - else - RBFrange->setChecked( true ); - changeRange( 0 ); -} - -/*! - Sets size and position -*/ -void VisuGUI_ScalarBarPane::setPosAndSize( double x, double y, double w, double h, bool vert ) -{ - if ( vert ) { - myVerX = x; - myVerY = y; - myVerW = w; - myVerH = h; - RBvert->setChecked( true ); - } - else { - myHorX = x; - myHorY = y; - myHorW = w; - myHorH = h; - RBhori->setChecked( true ); - } - changeDefaults( 0 ); -} - -/*! - Sets colors and labels number -*/ -void VisuGUI_ScalarBarPane::setScalarBarData( int colors, int labels ) -{ - ColorSpin->setValue( colors ); - LabelSpin->setValue( labels ); -} - -/*! - Gets orientation -*/ -int VisuGUI_ScalarBarPane::getOrientation() -{ - if (RBvert->isChecked() ) - return 1; - else - return 0; -} - -/*! - Called when button is clicked, validates data and closes dialog -*/ -bool VisuGUI_ScalarBarPane::check() -{ - double minVal = MinEdit->text().toDouble(); - double maxVal = MaxEdit->text().toDouble(); - if ( RBIrange->isChecked() ) { - if (minVal >= maxVal) { - SUIT_MessageBox::warn1( this,tr("WRN_VISU"), - tr("MSG_MINMAX_VALUES"), - tr("BUT_OK")); - return false; - } - } - // check if logarithmic mode is on and check imposed range to not contain negative values - if ( CBLog->isChecked() ) { - if ( RBIrange->isChecked() ) { - if ( (minVal > 0) && (maxVal > 0) ) { - // nothing to do - } - else { - SUIT_MessageBox::warn1( this, - tr("WRN_VISU"), - tr("WRN_LOGARITHMIC_RANGE"), - tr("BUT_OK")); - return false; - } - } - else { - if ( Rmin > 0 && Rmax > 0 ) { - // nothing to do - } - else { - SUIT_MessageBox::warn1( this, - tr("WRN_VISU"), - tr("WRN_LOGARITHMIC_FIELD_RANGE"), - tr("BUT_OK")); - RBIrange->setChecked(1); - changeRange(1); - //MinEdit->setText( QString::number( Rmin ) ); - //MaxEdit->setText( QString::number( Rmax ) ); - return false; - } - } - } - return true; -} - -void VisuGUI_ScalarBarPane::onTextPref() -{ - myIsStoreTextProp = myTextDlg->exec(); -} - - -//####################################################################################### - -/*! - Constructor -*/ -VisuGUI_ScalarBarDlg::VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule, bool SetPref) - : QDialog(VISU::GetDesktop(theModule), 0, true, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - setName("VisuGUI_ScalarBarDlg"); - setCaption(SetPref ? tr("DLG_PREF_TITLE") : tr("DLG_PROP_TITLE")); - setSizeGripEnabled(TRUE); - - QVBoxLayout* TopLayout = new QVBoxLayout(this); - TopLayout->setSpacing(6); - TopLayout->setMargin(11); - - myScalarPane = new VisuGUI_ScalarBarPane(this, SetPref); - TopLayout->addWidget(myScalarPane); - - // Common buttons =========================================================== - QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - QPushButton* buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); - - QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); - - TopLayout->addWidget( GroupButtons ); - - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); -} - -/*! - Called when button is clicked, validates data and closes dialog -*/ -void VisuGUI_ScalarBarDlg::accept() -{ - if (myScalarPane->check()) QDialog::accept(); -} - - -//####################################################################################### -VisuGUI_TextPrefDlg::VisuGUI_TextPrefDlg (QWidget* parent) - : QDialog(parent, 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - setName("VisuGUI_TextPrefDlg"); - setCaption(tr("TIT_TEXT_PREF")); - setSizeGripEnabled(TRUE); - - QVBoxLayout* TopLayout = new QVBoxLayout(this); - TopLayout->setSpacing(6); - TopLayout->setMargin(11); - - // "Title" grp - QGroupBox* aTitleGrp = new QGroupBox (2, Qt::Vertical, tr("LBL_TITLE"), this); - - // edit line - myTitleEdt = new QLineEdit (aTitleGrp); - - // font - QHBox* aHBox = new QHBox (aTitleGrp); - aHBox->setSpacing(5); - myTitleFont = new VisuGUI_FontWg (aHBox); - - TopLayout->addWidget(aTitleGrp); - - // "Labels" grp - QGroupBox* aLabelsGrp = new QGroupBox (1, Qt::Vertical, tr("LBL_LABELS"), this); - - // font - aHBox = new QHBox (aLabelsGrp); - aHBox->setSpacing(5); - myLabelFont = new VisuGUI_FontWg (aHBox); - - TopLayout->addWidget(aLabelsGrp); - - // Common buttons =========================================================== - QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - QPushButton* buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); - - QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); - - TopLayout->addWidget( GroupButtons ); - - connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); -} diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.h b/src/VISUGUI/VisuGUI_ScalarBarDlg.h deleted file mode 100644 index c8ddc6ab..00000000 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.h +++ /dev/null @@ -1,184 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_ScalarBarDlg.h -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -#ifndef VISUGUI_SCALARBARDLG_H -#define VISUGUI_SCALARBARDLG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "QtxDblSpinBox.h" - -#include "VISU_ScalarMap_i.hh" - -class QButtonGroup; -class QGroupBox; -class QLabel; -class QRadioButton; -class QCheckBox; -class QPushButton; -class QSpinBox; -class QLineEdit; -class QComboBox; -class QVBox; -class QToolButton; - -class QtxDblSpinBox; -class SalomeApp_Module; -class VisuGUI_FontWg; - -class VisuGUI_TextPrefDlg: public QDialog -{ - Q_OBJECT; - - public: - VisuGUI_TextPrefDlg (QWidget* parent); - ~VisuGUI_TextPrefDlg() {}; - - QString getTitleText() { return myTitleEdt->text(); } - void setTitleText(QString theText) { myTitleEdt->setText(theText); } - - void setTitleVisible (bool isVisible) - { (isVisible)? myTitleEdt->show() : myTitleEdt->hide(); } - - public: - VisuGUI_FontWg* myTitleFont; - VisuGUI_FontWg* myLabelFont; - - private: - QLineEdit* myTitleEdt; -}; - - -class VisuGUI_ScalarBarPane : public QVBox -{ - Q_OBJECT; - - public: - VisuGUI_ScalarBarPane(QWidget* parent, bool SetPref); - ~VisuGUI_ScalarBarPane() {}; - - void setRange( double imin, double imax, /*double fmin, double fmax,*/ bool sbRange ); - bool isIRange() {return RBIrange->isChecked();} - double getMin() {return MinEdit->text().toDouble();} - double getMax() {return MaxEdit->text().toDouble();} - int getOrientation(); - void setPosAndSize( double x, double y, double w, double h, bool vert ); - double getX() {return XSpin->value();} - double getY() {return YSpin->value();} - double getWidth() {return WidthSpin->value();} - double getHeight() {return HeightSpin->value();} - void setScalarBarData( int colors, int labels ); - int getNbColors() {return ColorSpin->value();} - int getNbLabels() {return LabelSpin->value();} - bool isLogarithmic() {return CBLog->isChecked();} - void setLogarithmic( bool on ) {CBLog->setChecked( on );} - bool isToSave() {return CBSave ? CBSave->isChecked() : false;} - - void initFromResources(); - void storeToResources(); - - void initFromPrsObject(VISU::ScalarMap_i* thePrs); - int storeToPrsObject(VISU::ScalarMap_i* thePrs); - - bool check(); - - protected: - QButtonGroup* RangeGroup; - QRadioButton* RBFrange; - QRadioButton* RBIrange; - QLineEdit* MinEdit; - QLineEdit* MaxEdit; - - QRadioButton* RBhori; - QRadioButton* RBvert; - - QtxDblSpinBox* XSpin; - QtxDblSpinBox* YSpin; - - QtxDblSpinBox* WidthSpin; - QtxDblSpinBox* HeightSpin; - - QSpinBox* ColorSpin; - QSpinBox* LabelSpin; - - QCheckBox* CBSave; - QCheckBox* CBLog; - QLabel* myModeLbl; - QComboBox* myModeCombo; - QPushButton* myTextBtn; - VisuGUI_TextPrefDlg* myTextDlg; - - double Imin, Imax, /* Fmin, Fmax,*/ Rmin, Rmax; - double myHorX, myHorY, myHorW, myHorH; - double myVerX, myVerY, myVerW, myVerH; - int myRangeMode; - bool myIsStoreTextProp; - - private slots: - void changeDefaults( int ); - void changeRange( int ); - void XYChanged( double ); - void onTextPref(); -}; - - -class VisuGUI_ScalarBarDlg : public QDialog -{ - Q_OBJECT; - - public: - VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule, bool SetPref = FALSE); - ~VisuGUI_ScalarBarDlg() {}; - - bool isToSave() {return myScalarPane->isToSave();} - - void initFromResources() {myScalarPane->initFromResources();} - void storeToResources() {myScalarPane->storeToResources();} - - void initFromPrsObject(VISU::ScalarMap_i* thePrs) {myScalarPane->initFromPrsObject(thePrs);} - int storeToPrsObject(VISU::ScalarMap_i* thePrs) {return myScalarPane->storeToPrsObject(thePrs);} - - protected slots: - void accept(); - - protected: - VisuGUI_ScalarBarPane* myScalarPane; -}; - -#endif // VISUGUI_SCALARBARDLG_H diff --git a/src/VISUGUI/VisuGUI_SweepPrefDlg.cxx b/src/VISUGUI/VisuGUI_SweepPrefDlg.cxx deleted file mode 100644 index 48ec2dcf..00000000 --- a/src/VISUGUI/VisuGUI_SweepPrefDlg.cxx +++ /dev/null @@ -1,161 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_SweepPrefDlg.cxx -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -using namespace std; -#include "VisuGUI_SweepPrefDlg.h" -#include - -/*! - Constructor -*/ -VisuGUI_SweepPrefDlg::VisuGUI_SweepPrefDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - if (!name) - setName("VisuGUI_SweepPrefDlg"); - setCaption(tr("DLG_TITLE")); - setSizeGripEnabled(TRUE); - - QVBoxLayout* TopLayout = new QVBoxLayout( this ); - TopLayout->setSpacing( 6 ); - TopLayout->setMargin( 11 ); - - TopGroup = new QGroupBox( this, "TopGroup" ); - TopGroup->setColumnLayout(0, Qt::Vertical ); - TopGroup->layout()->setSpacing( 0 ); - TopGroup->layout()->setMargin( 0 ); - QGridLayout* TopGroupLayout = new QGridLayout( TopGroup->layout() ); - TopGroupLayout->setAlignment( Qt::AlignTop ); - TopGroupLayout->setSpacing( 6 ); - TopGroupLayout->setMargin( 11 ); - - TimeLabel = new QLabel (tr("LBL_TIME_STEP"), TopGroup, "TimeLabel"); - TimeSpin = new QtxDblSpinBox( 0.1, 1000.0, 0.1, TopGroup ); - TimeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - TimeSpin->setMinimumSize( 70, 0 ); - TimeSpin->setValue( 0.2 ); - - CyclesLabel = new QLabel (tr("LBL_NB_CYCLES"), TopGroup, "CyclesLabel"); - CyclesSpin = new QSpinBox( 1, 100, 1, TopGroup, "CyclesSpin" ); - CyclesSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - CyclesSpin->setMinimumSize( 70, 0 ); - CyclesSpin->setValue( 1 ); - - StepsLabel = new QLabel (tr("LBL_NB_STEPS"), TopGroup, "StepsLabel"); - StepsSpin = new QSpinBox( 1, 200, 1, TopGroup, "StepsSpin" ); - StepsSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - StepsSpin->setMinimumSize( 70, 0 ); - StepsSpin->setValue( 20 ); - - TopGroupLayout->addWidget( TimeLabel, 0, 0 ); - TopGroupLayout->addWidget( TimeSpin, 0, 1 ); - TopGroupLayout->addWidget( CyclesLabel, 1, 0 ); - TopGroupLayout->addWidget( CyclesSpin, 1, 1 ); - TopGroupLayout->addWidget( StepsLabel, 2, 0 ); - TopGroupLayout->addWidget( StepsSpin, 2, 1 ); - - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); - buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); - - TopLayout->addWidget( TopGroup, 0, 0); - TopLayout->addWidget( GroupButtons, 1, 0 ); - - // signals and slots connections =========================================== - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); -} - -/*! - Destructor -*/ -VisuGUI_SweepPrefDlg::~VisuGUI_SweepPrefDlg() -{ -} - -/*! - Sets Time step -*/ -void VisuGUI_SweepPrefDlg::setTimeStep( double step ) -{ - TimeSpin->setValue( step ); -} - -/*! - Gets Time step -*/ -double VisuGUI_SweepPrefDlg::getTimeStep() -{ - return TimeSpin->value(); -} - -/*! - Sets Nb of cycles -*/ -void VisuGUI_SweepPrefDlg::setNbCycles( int nbc ) -{ - CyclesSpin->setValue( nbc ); -} - -/*! - Gets Nb of cycles -*/ -int VisuGUI_SweepPrefDlg::getNbCycles() -{ - return CyclesSpin->value(); -} - -/*! - Sets Nb of Steps -*/ -void VisuGUI_SweepPrefDlg::setNbSteps( int nbs ) -{ - StepsSpin->setValue( nbs ); -} - -/*! - Gets Nb of Steps -*/ -int VisuGUI_SweepPrefDlg::getNbSteps() -{ - return StepsSpin->value(); -} diff --git a/src/VISUGUI/VisuGUI_SweepPrefDlg.h b/src/VISUGUI/VisuGUI_SweepPrefDlg.h deleted file mode 100644 index 6179c111..00000000 --- a/src/VISUGUI/VisuGUI_SweepPrefDlg.h +++ /dev/null @@ -1,67 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_SweepPrefDlg.h -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -#ifndef VISUGUI_SWEEPPREFDLG_H -#define VISUGUI_SWEEPPREFDLG_H - -#include -#include -#include -#include -#include -#include "QtxDblSpinBox.h" - -class VisuGUI_SweepPrefDlg : public QDialog -{ - Q_OBJECT - -public: - VisuGUI_SweepPrefDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~VisuGUI_SweepPrefDlg(); - - void setTimeStep( double step ); - double getTimeStep(); - void setNbCycles( int nbc ); - int getNbCycles(); - void setNbSteps ( int nbs ); - int getNbSteps (); - -private: - QGroupBox* TopGroup; - QLabel* TimeLabel; - QtxDblSpinBox* TimeSpin; - QLabel* CyclesLabel; - QSpinBox* CyclesSpin; - QLabel* StepsLabel; - QSpinBox* StepsSpin; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; -}; - -#endif // VISUGUI_SWEEPPREFDLG_H diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx deleted file mode 100644 index 0598764e..00000000 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ /dev/null @@ -1,1268 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_TimeAnimation.cxx -// Author : Vitaly SMETANNIKOV -// Module : VISU - -#include "VisuGUI_TimeAnimation.h" - -#include "VisuGUI.h" -#include "VisuGUI_Tools.h" -#include "VisuGUI_DeformedShapeDlg.h" -#include "VisuGUI_CutPlanesDlg.h" -#include "VisuGUI_Plot3DDlg.h" -#include "VisuGUI_VectorsDlg.h" -#include "VisuGUI_IsoSurfacesDlg.h" -#include "VisuGUI_StreamLinesDlg.h" - -#include "VISU_TimeAnimation.h" - -#include "VISU_ScalarMap_i.hh" -#include "VISU_IsoSurfaces_i.hh" -#include "VISU_DeformedShape_i.hh" -#include "VISU_CutPlanes_i.hh" -#include "VISU_Plot3D_i.hh" -#include "VISU_CutLines_i.hh" -#include "VISU_Vectors_i.hh" -#include "VISU_StreamLines_i.hh" - -#include "VISU_ViewManager_i.hh" - -#include "VISU_ScalarBarActor.hxx" -#include "VISU_Actor.h" - -#include "SalomeApp_Study.h" -#include "SalomeApp_Application.h" - -#include "SVTK_ViewWindow.h" - -#include "SUIT_OverrideCursor.h" -#include "SUIT_MessageBox.h" -#include "SUIT_Desktop.h" -#include "SUIT_FileDlg.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAXVAL 1e10 - -ArrangeDlg::ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator) - : QDialog(theParent, "ArrangeDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), - myAnimator(theAnimator), myViewWindow(theAnimator->getViewer()) -{ - myCurrent = 0; - init(); - QStringList aFieldNames; - // Find names of fields - for (int i = 0; i < theAnimator->getNbFields(); i++) { - aFieldNames.append(VISU::getValue(theAnimator->getFieldData(i).myField, "myName")); - Offset aOffs; - aOffs.myOffset[0] = myAnimator->getFieldData(i).myOffset[0]; - aOffs.myOffset[1] = myAnimator->getFieldData(i).myOffset[1]; - aOffs.myOffset[2] = myAnimator->getFieldData(i).myOffset[2]; - myOffsets.append(aOffs); - } - myFieldLst->insertStringList(aFieldNames); - myFieldLst->setSelected(0, true); -} - -ArrangeDlg::ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow) - : QDialog(theParent, "ArrangeDlg", true, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), - myAnimator(0), myViewWindow(theViewWindow) -{ - myCurrent = 0; - init(); - QStringList aPrsNames; - vtkActor* anActor; - vtkActorCollection *anActColl = myViewWindow->getRenderer()->GetActors(); - for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;) { - VISU_Actor* anVISUActor = dynamic_cast(anActor); - if (anVISUActor) - if (anVISUActor->GetVisibility() != 0) { - VISU::Prs3d_i* aPrs = anVISUActor->GetParent()->GetPrs3d(); - if (aPrs) { - if (!myPrsMap.contains(aPrs)) { - SALOMEDS::SObject_var aSObject = aPrs->GetSObject(); - if(!aSObject->_is_nil()){ - SALOMEDS::GenericAttribute_var anAttr; - if (aSObject->FindAttribute(anAttr, "AttributeName")) { - SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); - string aNam = aName->Value(); - QString strIn(aNam.c_str()); - aPrsNames.append(strIn); - myPrsMap[aPrs] = myOffsets.count(); - Offset aOffs; - anVISUActor->GetPosition(aOffs.myOffset); - myOffsets.append(aOffs); - } - } - } - } - } - } - myFieldLst->insertStringList(aPrsNames); - myFieldLst->setSelected(0, true); -} - -void ArrangeDlg::init() -{ - setCaption("Arrange Presentations"); - setSizeGripEnabled( TRUE ); - - QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 6); - aMainLayout->setSpacing(5); - - QButtonGroup* aBtnGrp = new QButtonGroup(2, Qt::Horizontal, this); - aBtnGrp->setExclusive(true); - aMainLayout->addWidget(aBtnGrp); - - QRadioButton* aAutoBtn = new QRadioButton("Auto", aBtnGrp); - aBtnGrp->insert(aAutoBtn, AutoMode); - - QRadioButton* aManualBtn = new QRadioButton("Manual", aBtnGrp); - aBtnGrp->insert(aManualBtn, ManualMode); - aBtnGrp->setButton(AutoMode); - - myStackWgt = new QWidgetStack(this); - aMainLayout->addWidget(myStackWgt); - - // AUTO Pane - QVBox* aAutoPane = new QVBox(myStackWgt); - aAutoPane->setSpacing(5); - // Axis Group - myAxisGrp = new QButtonGroup(3, Qt::Horizontal,"Axis", aAutoPane); - - QRadioButton* aXBtn = new QRadioButton("X",myAxisGrp ); - myAxisGrp->insert(aXBtn, XAxis); - - QRadioButton* aYBtn = new QRadioButton("Y",myAxisGrp ); - myAxisGrp->insert(aYBtn, YAxis); - - QRadioButton* aZBtn = new QRadioButton("Z",myAxisGrp ); - myAxisGrp->insert(aZBtn, ZAxis); - - myAxisGrp->setButton(XAxis); - - //Distance Input - QHBox* aDistPane = new QHBox(aAutoPane); - aDistPane->setSpacing(5); - new QLabel("Relative Distance", aDistPane); - myDistVal = new QtxDblSpinBox (-10,10, 0.5, aDistPane); - myDistVal->setValue(1); - - myStackWgt->addWidget(aAutoPane, AutoMode); - - // Manual Pane - QHBox* aManualPane = new QHBox(myStackWgt); - aManualPane->setSpacing(10); - - myFieldLst = new QListBox(aManualPane); - connect( myFieldLst, SIGNAL( highlighted(int) ), - this, SLOT( onFieldChange(int) ) ); - - QGrid* aCoordPane = new QGrid(2, aManualPane); - aCoordPane->setSpacing(5); - - new QLabel("X", aCoordPane); - myCoord[0] = new QtxDblSpinBox(aCoordPane); - myCoord[0]->setRange(-MAXVAL, MAXVAL); - - new QLabel("Y", aCoordPane); - myCoord[1] = new QtxDblSpinBox(aCoordPane); - myCoord[1]->setRange(-MAXVAL, MAXVAL); - - new QLabel("Z", aCoordPane); - myCoord[2] = new QtxDblSpinBox(aCoordPane); - myCoord[2]->setRange(-MAXVAL, MAXVAL); - - myStackWgt->addWidget(aManualPane, ManualMode); - - myStackWgt->raiseWidget(AutoMode); - - connect(aBtnGrp, SIGNAL(clicked(int)), myStackWgt, SLOT(raiseWidget(int)) ); - - SUIT_Study* aSUITStudy = myViewWindow->getViewManager()->study(); - SalomeApp_Study* anAppStudy = dynamic_cast(aSUITStudy); - _PTR(Study) aCStudy = VISU::GetCStudy(anAppStudy); - if (!myAnimator && !aCStudy->GetProperties()->IsLocked()) { - mySaveChk = new QCheckBox ("Save to presentation", this); - mySaveChk->setChecked(false); - aMainLayout->addWidget(mySaveChk); - } else { - mySaveChk = 0; - } - - // Common buttons =========================================================== - QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - QPushButton* buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); - - QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); - - aMainLayout->addWidget( GroupButtons ); - - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); -} - -void ArrangeDlg::accept() -{ - if (myAnimator) { - acceptAnimation(); - } else { - acceptViewWindow(); - } - QDialog::accept(); -} - -void ArrangeDlg::onFieldChange(int theCurrent) -{ - if (myCurrent != theCurrent) { - Offset& aOffs = myOffsets[myCurrent]; - aOffs.myOffset[0] = myCoord[0]->value(); - aOffs.myOffset[1] = myCoord[1]->value(); - aOffs.myOffset[2] = myCoord[2]->value(); - } - myCurrent = theCurrent; - const Offset& aNewOffs = myOffsets[myCurrent]; - myCoord[0]->setValue(aNewOffs.myOffset[0]); - myCoord[1]->setValue(aNewOffs.myOffset[1]); - myCoord[2]->setValue(aNewOffs.myOffset[2]); -} - -void ArrangeDlg::acceptAnimation() -{ - if (getMode() == ManualMode) { - // Save from GUI - Offset& aOffs = myOffsets[myCurrent]; - aOffs.myOffset[0] = myCoord[0]->value(); - aOffs.myOffset[1] = myCoord[1]->value(); - aOffs.myOffset[2] = myCoord[2]->value(); - - for (int i = 0; i < myAnimator->getNbFields(); i++) { - Offset aOffs = myOffsets[i]; - myAnimator->getFieldData(i).myOffset[0] = aOffs.myOffset[0]; - myAnimator->getFieldData(i).myOffset[1] = aOffs.myOffset[1]; - myAnimator->getFieldData(i).myOffset[2] = aOffs.myOffset[2]; - } - } else { - QApplication::setOverrideCursor( Qt::waitCursor ); - FieldData& aData = myAnimator->getFieldData(0); - if (aData.myPrs.empty()) - myAnimator->generatePresentations(0); - VISU_Actor* aActor = aData.myPrs[0]->CreateActor(); - float aBounds[6]; - aActor->GetBounds(aBounds); - aActor->Delete(); - float aDist = 0; - int aAxis = getAxis(); - switch (aAxis) { - case XAxis: - aDist = fabs(aBounds[1] - aBounds[0]); - break; - case YAxis: - aDist = fabs(aBounds[3] - aBounds[2]); - break; - case ZAxis: - aDist = fabs(aBounds[5] - aBounds[4]); - } - - float dx = fabs(aBounds[1] - aBounds[0]); - float dy = fabs(aBounds[3] - aBounds[2]); - float dz = fabs(aBounds[5] - aBounds[4]); - float max = (dx > dy) ? dx : dy; - max = (dz > max) ? dz : max; - max /= 100.0; - - if (aDist < max) { - // set base distance between centers of bounding boxes - // to minimal (but big enough) size of current bounding box - if (dx < max) dx = FLT_MAX; - if (dy < max) dy = FLT_MAX; - if (dz < max) dz = FLT_MAX; - - aDist = (dx < dy) ? dx : dy; - aDist = (dz < aDist) ? dz : aDist; - } - aDist = aDist * getDistance(); - for (int i = 0; i < myAnimator->getNbFields(); i++) { - myAnimator->getFieldData(i).myOffset[0] = 0; - myAnimator->getFieldData(i).myOffset[1] = 0; - myAnimator->getFieldData(i).myOffset[2] = 0; - myAnimator->getFieldData(i).myOffset[aAxis] = aDist * i; - } - - QApplication::restoreOverrideCursor(); - } -} - -void ArrangeDlg::acceptViewWindow() -{ - if (getMode() == ManualMode) { - // Save from GUI - Offset& aOffs = myOffsets[myCurrent]; - aOffs.myOffset[0] = myCoord[0]->value(); - aOffs.myOffset[1] = myCoord[1]->value(); - aOffs.myOffset[2] = myCoord[2]->value(); - - QMap::Iterator it; - for (it = myPrsMap.begin(); it != myPrsMap.end(); ++it) { - VISU::Prs3d_i* aPrs = it.key(); - Offset& aOffs = myOffsets[it.data()]; - if (VISU_Actor* anActor = VISU::GetActor(aPrs, myViewWindow)) - anActor->SetPosition(aOffs.myOffset); - if (mySaveChk) - if (mySaveChk->isChecked()) - aPrs->SetOffset(aOffs.myOffset); - } - } else { - float aDist = 0; - float aShift = 0; - float aPrevDist = 0; - float aPrevShift = 0; - int i; - QMap::Iterator it; - for (it = myPrsMap.begin(), i = 0; it != myPrsMap.end(); ++it, i++) { - VISU::Prs3d_i* aPrs = it.key(); - if (VISU_Actor* aActor = VISU::GetActor(aPrs, myViewWindow)) { - int aAxis = getAxis(); - - float aZeroOffset[3]; - aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0; - aActor->SetPosition(aZeroOffset); - aActor->GetMapper()->Update(); - - float aBounds[6]; - aActor->GetBounds(aBounds); - switch (aAxis) { - case XAxis: - aDist = fabs(aBounds[1] - aBounds[0]); - break; - case YAxis: - aDist = fabs(aBounds[3] - aBounds[2]); - break; - case ZAxis: - aDist = fabs(aBounds[5] - aBounds[4]); - } - float aOffset[3]; - aOffset[0] = (aBounds[1] < aBounds[0]) ? -aBounds[1] : -aBounds[0]; - aOffset[1] = (aBounds[3] < aBounds[2]) ? -aBounds[3] : -aBounds[2]; - aOffset[2] = (aBounds[5] < aBounds[4]) ? -aBounds[5] : -aBounds[4]; - - if (i > 0) { - float aCCDist = (aDist + aPrevDist) / 2.0; - - float dx = fabs(aBounds[1] - aBounds[0]); - float dy = fabs(aBounds[3] - aBounds[2]); - float dz = fabs(aBounds[5] - aBounds[4]); - float max = (dx > dy) ? dx : dy; - max = (dz > max) ? dz : max; - max /= 100.0; - - if (aCCDist < max) { - // set base distance between centers of bounding boxes - // to minimal (but big enough) size of current bounding box - if (dx < max) dx = FLT_MAX; - if (dy < max) dy = FLT_MAX; - if (dz < max) dz = FLT_MAX; - - aCCDist = (dx < dy) ? dx : dy; - aCCDist = (dz < aCCDist) ? dz : aCCDist; - } - - //--------------------------------> - // aShift - // aDist / 2 - // <--> - // .--------------. .------. - //----------->| | | | - // aPrevShift '--------------' '------' - // <------> - // aPrevDist / 2 - // - // <---------------> - // (aDist + aPrevDist) * getDistance() / 2 - - aShift = aPrevShift + aPrevDist/2.0 + aCCDist*getDistance() - aDist/2.0; - } - - aOffset[aAxis] += aShift; - aActor->SetPosition(aOffset); - if (mySaveChk) - if (mySaveChk->isChecked()) - aPrs->SetOffset(aOffset); - - aPrevDist = aDist; - aPrevShift = aShift; - } - } - } - myViewWindow->getRenderer()->ResetCameraClippingRange(); - myViewWindow->Repaint(); -} - - -//***************************************************************************************************** -//***************************************************************************************************** -//***************************************************************************************************** -SetupDlg::SetupDlg (VisuGUI* theModule, VISU_TimeAnimation* theAnimator) - : QDialog(VISU::GetDesktop(theModule), "SetupDlg", true, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), - myModule(theModule) -{ - setCaption("Setup Animation"); - setSizeGripEnabled( TRUE ); - myAnimator = theAnimator; - - QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 6); - aMainLayout->setSpacing(5); - - - QFrame* aRangeGrp = new QFrame(this); - QGridLayout* aRangeLayout = new QGridLayout( aRangeGrp ); - aRangeLayout->setSpacing( 6 ); - aRangeLayout->setMargin( 11 ); - aRangeGrp->setFrameStyle(QFrame::Box | QFrame::Raised); - - myUseRangeChk = new QCheckBox("Use range of time stamps", aRangeGrp); - aRangeLayout->addMultiCellWidget(myUseRangeChk, 0, 0, 0, 3); - myUseRangeChk->setChecked(myAnimator->isRangeDefined()); - - QLabel* aMinLbl = new QLabel("From", aRangeGrp); - aMinLbl->setEnabled(myUseRangeChk->isChecked()); - aRangeLayout->addWidget(aMinLbl, 1, 0); - double aStep = (myAnimator->getMaxTime() - myAnimator->getMinTime())/(theAnimator->getFieldData(0).myNbTimes - 1); - myMinVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp ); - myMinVal->setEnabled(myUseRangeChk->isChecked()); - if (myUseRangeChk->isChecked()) - myMinVal->setValue( myAnimator->getMinRange() ); - else - myMinVal->setValue( myAnimator->getMinTime() ); - - connect(myMinVal, SIGNAL( valueChanged(double)), - this, SLOT( onMinValue(double) )); - aRangeLayout->addWidget(myMinVal, 1, 1); - - QLabel* aMaxLbl = new QLabel("To", aRangeGrp); - aMaxLbl->setEnabled(myUseRangeChk->isChecked()); - aRangeLayout->addWidget(aMaxLbl, 1, 2); - myMaxVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp ); - myMaxVal->setEnabled(myUseRangeChk->isChecked()); - if (myUseRangeChk->isChecked()) - myMaxVal->setValue( myAnimator->getMaxRange() ); - else - myMaxVal->setValue( myAnimator->getMaxTime() ); - - connect(myMaxVal, SIGNAL( valueChanged(double)), - this, SLOT( onMaxValue(double) )); - aRangeLayout->addWidget(myMaxVal, 1, 3); - - connect(myUseRangeChk, SIGNAL( toggled(bool)), - aMinLbl, SLOT( setEnabled(bool) )); - connect(myUseRangeChk, SIGNAL( toggled(bool)), - aMaxLbl, SLOT( setEnabled(bool) )); - connect(myUseRangeChk, SIGNAL( toggled(bool)), - this, SLOT( onRangeCheck(bool) )); - - aMainLayout->addWidget(aRangeGrp); - - - QHBox* aPropFrame = new QHBox(this); - aPropFrame->setSpacing(5); - - QVGroupBox* aNamesBox = new QVGroupBox("Fields",aPropFrame); - myFieldLst = new QListBox(aNamesBox); - QStringList aFieldNames; - // Find names of fields - for (int i = 0; i < theAnimator->getNbFields(); i++) { - _PTR(SObject) aSO = theAnimator->getFieldData(i).myField; - aFieldNames.append(VISU::getValue(aSO, "myName")); - } - myFieldLst->insertStringList(aFieldNames); - myFieldLst->setSelected(0, true); - connect( myFieldLst, SIGNAL( highlighted(int) ), - this, SLOT( onFieldChange(int) ) ); - - - QVBox* aSetupBox = new QVBox(aPropFrame); - aSetupBox->setSpacing(5); - - QVGroupBox* aPropBox = new QVGroupBox("Properties", aSetupBox); - //QVGroupBox* aPropBox = new QVGroupBox("Properties", aPropFrame); - myTypeCombo = new QComboBox(aPropBox); - connect( myTypeCombo, SIGNAL( activated(int) ), - this, SLOT( onTypeChanged(int) ) ); - - // QPushButton* aBarBtn = new QPushButton("Scalar Bar...", aPropBox); - //connect( aBarBtn, SIGNAL( clicked() ), - // this, SLOT( onScalarBarDlg() ) ); - - myPropBtn = new QPushButton("Properties...", aPropBox); - // myPropBtn->setEnabled(theAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP); - connect( myPropBtn, SIGNAL( clicked() ), - this, SLOT( onPreferencesDlg() ) ); - - if (myAnimator->getNbFields() > 1) { - myArrangeBtn = new QPushButton("Arrange...", aSetupBox); - connect( myArrangeBtn, SIGNAL( clicked() ), this, SLOT( onArrangeDlg() ) ); - } - onFieldChange(0); - aMainLayout->addWidget(aPropFrame); - - QHBox* aBtnBox = new QHBox(this); - QHBoxLayout* aBtnLayout = new QHBoxLayout(aBtnBox->layout()); - aBtnLayout->addStretch(); - - QPushButton* aCloseBtn = new QPushButton(tr("BUT_OK"), aBtnBox); - connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close())); - - aMainLayout->addWidget(aBtnBox); -} - -//************************************************************************ -enum PrsComboItem { - TSCALARMAP_ITEM = 0, // VISU::TSCALARMAP - TISOSURFACE_ITEM = 1, // VISU::TISOSURFACE - TCUTPLANES_ITEM = 2, // VISU::TCUTPLANES - TPLOT3D_ITEM = 3, // VISU::TPLOT3D - TDEFORMEDSHAPE_ITEM = 4, // VISU::TDEFORMEDSHAPE - TVECTORS_ITEM = 5, // VISU::TVECTORS - TSTREAMLINES_ITEM = 6 // VISU::TSTREAMLINES -}; - -//************************************************************************ -void SetupDlg::onFieldChange (int theIndex) -{ - FieldData& aData = myAnimator->getFieldData(theIndex); - myTypeCombo->clear(); - // ATTENTION: append items in the same order like it is done in the PrsComboItem enumeration - myTypeCombo->insertItem("Scalar Map"); // item 0 - myTypeCombo->insertItem("Iso Surfaces"); // item 1 - myTypeCombo->insertItem("Cut Planes"); // item 2 - myTypeCombo->insertItem("Plot 3D"); // item 3 - - _PTR(SObject) aSObject = aData.myField; - long aNumComp = VISU::getValue(aSObject, "myNumComponent").toLong(); - if (aNumComp > 1) { - myTypeCombo->insertItem("Deformed Shape"); // item 4 - myTypeCombo->insertItem("Vectors"); // item 5 - myTypeCombo->insertItem("Stream Lines"); // item 6 - } - switch (aData.myPrsType) { - case VISU::TSCALARMAP: //Scalar Map - myTypeCombo->setCurrentItem(TSCALARMAP_ITEM); - break; - case VISU::TISOSURFACE: //Iso Surfaces - myTypeCombo->setCurrentItem(TISOSURFACE_ITEM); - break; - case VISU::TCUTPLANES: //Cut Planes - myTypeCombo->setCurrentItem(TCUTPLANES_ITEM); - break; - case VISU::TPLOT3D: //Plot 3D - myTypeCombo->setCurrentItem(TPLOT3D_ITEM); - break; - case VISU::TDEFORMEDSHAPE: //Deformed Shape - myTypeCombo->setCurrentItem(TDEFORMEDSHAPE_ITEM); - break; - case VISU::TVECTORS: //Vectors - myTypeCombo->setCurrentItem(TVECTORS_ITEM); - break; - case VISU::TSTREAMLINES: //Stream Lines - myTypeCombo->setCurrentItem(TSTREAMLINES_ITEM); - aData.myPrsType = VISU::TSTREAMLINES; - break; - } - //myPropBtn->setEnabled(aData.myPrsType != VISU::TSCALARMAP); -} - -//************************************************************************ -void SetupDlg::onTypeChanged (int theIndex) -{ - FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem()); - switch (theIndex) { - case TSCALARMAP_ITEM: //Scalar Map - aData.myPrsType = VISU::TSCALARMAP; - break; - case TISOSURFACE_ITEM: //Iso Surfaces - aData.myPrsType = VISU::TISOSURFACE; - break; - case TCUTPLANES_ITEM: //Cut Planes - aData.myPrsType = VISU::TCUTPLANES; - break; - case TPLOT3D_ITEM: //Plot 3D - aData.myPrsType = VISU::TPLOT3D; - break; - case TDEFORMEDSHAPE_ITEM: //Deformed Shape - aData.myPrsType = VISU::TDEFORMEDSHAPE; - break; - case TVECTORS_ITEM: //Vectors - aData.myPrsType = VISU::TVECTORS; - break; - case TSTREAMLINES_ITEM: //Stream Lines - aData.myPrsType = VISU::TSTREAMLINES; - break; - } - myAnimator->clearData(aData); - //myPropBtn->setEnabled(aData.myPrsType != VISU::TSCALARMAP); - //myAnimator->generatePresentations(myFieldLst->currentItem()); -} - -//************************************************************************ -/*void SetupDlg::onScalarBarDlg() { - QApplication::setOverrideCursor( Qt::waitCursor ); - FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem()); - if (aData.myPrs == 0) - myAnimator->generatePresentations(myFieldLst->currentItem()); - QApplication::restoreOverrideCursor(); - - VisuGUI_ScalarBarDlg* aScalarBarDlg = new VisuGUI_ScalarBarDlg(); - aScalarBarDlg->initFromPrsObject(aData.myPrs[0]); - if (aScalarBarDlg->exec()) { - for (int i = 0; i < aData.myNbFrames; i++) - aScalarBarDlg->storeToPrsObject(aData.myPrs[i]); - } -} -*/ - -//************************************************************************ -void SetupDlg::onPreferencesDlg() -{ - SUIT_OverrideCursor c; - FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem()); - if (aData.myPrs.empty()) - myAnimator->generatePresentations(myFieldLst->currentItem()); - -// BUG VISU5725 : Compatibility gcc 2.95 -// #define EDITPRS(TYPE, DLG) \ -// { \ -// DLG* aDlg = new DLG(); \ -// aDlg->initFromPrsObject(dynamic_cast(aData.myPrs.at(0))); \ -// if (aDlg->exec()) { \ -// for (int i = 0; i < aData.myNbFrames; i++) \ -// aDlg->storeToPrsObject(dynamic_cast(aData.myPrs.at(i))); \ -// } \ -// delete aDlg; \ -// } - - -#define EDITPRS(TYPE, DLG) {\ - DLG* aDlg = new DLG (myModule);\ - aDlg->initFromPrsObject(dynamic_cast(aData.myPrs[0]));\ - if (aDlg->exec())\ - { \ - for (int i = 0; i < aData.myNbFrames; i++)\ - aDlg->storeToPrsObject(dynamic_cast(aData.myPrs[i]));\ - } \ - delete aDlg;} - - switch (myTypeCombo->currentItem()) { - case TSCALARMAP_ITEM: //Scalar Map - c.suspend(); - EDITPRS(VISU::ScalarMap_i, VisuGUI_ScalarBarDlg); - break; - case TISOSURFACE_ITEM: //Iso Surfaces - c.suspend(); - EDITPRS(VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg); - break; - case TCUTPLANES_ITEM: //Cut Planes - c.suspend(); - EDITPRS(VISU::CutPlanes_i, VisuGUI_CutPlanesDlg); - /*{ - VisuGUI_CutPlanesDlg* aDlg = new VisuGUI_CutPlanesDlg (myModule); - //_CS_PhB :operator [] .at aDlg->initFromPrsObject(dynamic_cast(aData.myPrs.at(0))); - aDlg->initFromPrsObject(dynamic_cast(aData.myPrs[0])); - - if (aDlg->exec()) { - for (int i = 0; i < aData.myNbFrames; i++) - //_CS_PhB:operator [] .at aDlg->storeToPrsObject(dynamic_cast(aData.myPrs.at(i))); - aDlg->storeToPrsObject(dynamic_cast(aData.myPrs[i])); - } - delete aDlg; - }*/ - break; - case TPLOT3D_ITEM: //Plot 3D - c.suspend(); - EDITPRS(VISU::Plot3D_i, VisuGUI_Plot3DDlg); - break; - case TDEFORMEDSHAPE_ITEM: //Deformed Shape - c.suspend(); - EDITPRS(VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg); - break; - case TVECTORS_ITEM: //Vectors - c.suspend(); - EDITPRS(VISU::Vectors_i, VisuGUI_VectorsDlg); - break; - case TSTREAMLINES_ITEM: //Stream Lines - c.suspend(); - EDITPRS(VISU::StreamLines_i, VisuGUI_StreamLinesDlg); - break; - } -#undef EDITPRS -} - - -//************************************************************************ -void SetupDlg::onArrangeDlg() -{ - ArrangeDlg aDlg(this, myAnimator); - aDlg.exec(); -} - -//************************************************************************ -void SetupDlg::onRangeCheck (bool theCheck) -{ - for (int i = 0; i < myAnimator->getNbFields(); i++) - myAnimator->clearData(myAnimator->getFieldData(i)); - - myMinVal->setEnabled(theCheck); - myMaxVal->setEnabled(theCheck); - - if (!theCheck) - myAnimator->setAnimationRange(0, 0); - else { - // if (myMinVal->value() < myMaxVal->value()) - myAnimator->setAnimationRange(myMinVal->value(), myMaxVal->value()); -// else if (myMinVal->value() > myMaxVal->value()) -// myAnimator->setAnimationRange(myMaxVal->value(), myMinVal->value()); -// else // equal case -// myAnimator->setAnimationRange(0, 0); - } -} - -//************************************************************************ -void SetupDlg::onMinValue (double theVal) -{ - if (theVal > myAnimator->getMaxRange()) { - myMinVal->setValue( myAnimator->getMinTime() ); - myMinVal->setFocus(); - return; - } - for (int i = 0; i < myAnimator->getNbFields(); i++) - myAnimator->clearData(myAnimator->getFieldData(i)); - myAnimator->setAnimationRange(theVal, myAnimator->getMaxRange()); -} - -//************************************************************************ -void SetupDlg::onMaxValue (double theVal) -{ - if (theVal < myAnimator->getMinRange()) { - myMaxVal->setValue( myAnimator->getMaxTime() ); - myMaxVal->setFocus(); - return; - } - for (int i = 0; i < myAnimator->getNbFields(); i++) - myAnimator->clearData(myAnimator->getFieldData(i)); - myAnimator->setAnimationRange(myAnimator->getMinRange(), theVal); -} - -static const char * firstIco[] = { -"18 10 2 1", -" g None", -". g #000000", -" . . ", -" .. .. .. ", -" .. ... ... ", -" .. .... .... ", -" .. ..... ..... ", -" .. ..... ..... ", -" .. .... .... ", -" .. ... ... ", -" .. .. .. ", -" . . "}; - - -static const char * lastIco[] = { -"18 10 2 1", -" g None", -". g #000000", -" . . ", -" .. .. .. ", -" ... ... .. ", -" .... .... .. ", -" ..... ..... .. ", -" ..... ..... .. ", -" .... .... .. ", -" ... ... .. ", -" .. .. .. ", -" . . "}; - - -static const char * leftIco[] = { -"11 10 2 1", -" g None", -". g #000000", -" . .", -" .. ..", -" ... ...", -" .... ....", -"..... .....", -"..... .....", -" .... ....", -" ... ...", -" .. ..", -" . ."}; - -static const char * playIco[] = { -"14 14 2 1", -" g None", -". g #000000", -" ", -" ", -" .. ", -" .... ", -" ...... ", -" ........ ", -" .......... ", -" .......... ", -" ........ ", -" ...... ", -" .... ", -" .. ", -" ", -" "}; - -static QPixmap MYplayPixmap(playIco); - - -static const char * rightIco[] = { -"11 10 2 1", -" g None", -". g #000000", -". . ", -".. .. ", -"... ... ", -".... .... ", -"..... .....", -"..... .....", -".... .... ", -"... ... ", -".. .. ", -". . "}; - - -static const char * pauseIco[] = { -"14 14 2 1", -" g None", -". g #000000", -" ", -" ", -" .. .. ", -" .. .. ", -" .. .. ", -" .. .. ", -" .. .. ", -" .. .. ", -" .. .. ", -" .. .. ", -" .. .. ", -" .. .. ", -" ", -" "}; - -static QPixmap MYpausePixmap(pauseIco); - - -VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Study) theStudy) - : QDialog(VISU::GetDesktop(theModule), "VisuGUI_TimeAnimationDlg", false, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), - myModule(theModule), - myStudy(theStudy) -{ - setCaption("Animation"); - setSizeGripEnabled( TRUE ); - isClosing = false; - - myAnimator = new VISU_TimeAnimation (theStudy); - myAnimator->setSpeed(1); - myAnimator->setViewer(VISU::GetViewWindow()); - connect(myAnimator, SIGNAL(frameChanged(long, double)), this, SLOT(onExecution(long, double))); - connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop())); - - QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 6); - aMainLayout->setSpacing(5); - - mySetupBtn = new QPushButton("Setup Animation...", this); - connect( mySetupBtn, SIGNAL( clicked() ), - this, SLOT( onSetupDlg() ) ); - aMainLayout->addWidget(mySetupBtn); - - myGenBtn = new QPushButton("Generate frames", this); - connect( myGenBtn, SIGNAL( clicked() ), - this, SLOT( createFrames() ) ); - aMainLayout->addWidget(myGenBtn); - - myPlayFrame = new QFrame(this); - myPlayFrame->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); - myPlayFrame->setLineWidth( 1 ); - - - // --- Play controls --- - QGridLayout* TopLayout = new QGridLayout( myPlayFrame ); - TopLayout->setSpacing( 6 ); - TopLayout->setMargin( 11 ); - - myTimeLbl = new QLabel("0", myPlayFrame); - TopLayout->addMultiCellWidget(myTimeLbl, 0, 0, 0, 2, Qt::AlignHCenter); - - mySlider = new QSlider(Qt::Horizontal, myPlayFrame); - mySlider->setMinValue(0); - mySlider->setMaxValue(3); - mySlider->setTickInterval(1); - //mySlider->setTickmarks(QSlider::Below); - mySlider->setTracking(false); - connect( mySlider, SIGNAL( valueChanged(int) ), - this, SLOT( onWindowChanged(int) ) ); - TopLayout->addMultiCellWidget(mySlider, 1, 1, 0, 2); - - myPlayBtn = new QToolButton(myPlayFrame); - myPlayBtn->setIconSet(MYplayPixmap); - myPlayBtn->setToggleButton(true); - connect( myPlayBtn, SIGNAL( clicked() ), - this, SLOT( onPlayPressed() ) ); - TopLayout->addMultiCellWidget(myPlayBtn, 2, 2, 0, 1); - - QToolButton* aBackBtn = new QToolButton(myPlayFrame); - aBackBtn->setIconSet(QPixmap(leftIco)); - connect( aBackBtn, SIGNAL( clicked() ), - this, SLOT( onBackPressed() ) ); - TopLayout->addWidget(aBackBtn, 3, 0); - - QToolButton* aForvardBtn = new QToolButton(myPlayFrame); - aForvardBtn->setIconSet(QPixmap(rightIco)); - connect( aForvardBtn, SIGNAL( clicked() ), - this, SLOT( onForvardPressed() ) ); - TopLayout->addWidget(aForvardBtn, 3, 1); - - QToolButton* aFirstBtn = new QToolButton(myPlayFrame); - aFirstBtn->setIconSet(QPixmap(firstIco)); - connect( aFirstBtn, SIGNAL( clicked() ), - this, SLOT( onFirstPressed() ) ); - TopLayout->addWidget(aFirstBtn, 4, 0); - - QToolButton* aLastBtn = new QToolButton(myPlayFrame); - aLastBtn->setIconSet(QPixmap(lastIco)); - connect( aLastBtn, SIGNAL( clicked() ), - this, SLOT( onLastPressed() ) ); - TopLayout->addWidget(aLastBtn, 4, 1); - - QLabel* aSpeedLbl = new QLabel("Speed", myPlayFrame); - TopLayout->addWidget(aSpeedLbl, 4, 2, Qt::AlignRight); - - QLCDNumber* aSpeedNum = new QLCDNumber( 2, myPlayFrame ); - aSpeedNum->setSegmentStyle(QLCDNumber::Flat); - aSpeedNum->display(1); - TopLayout->addWidget(aSpeedNum, 4, 3); - - QwtWheel* aWheel = new QwtWheel(myPlayFrame); - aWheel->setOrientation(Qt::Vertical); - aWheel->setRange(1, 99, 1); - connect( aWheel, SIGNAL(valueChanged(double)), - aSpeedNum, SLOT(display(double)) ); - connect( aWheel, SIGNAL(valueChanged(double)), - this, SLOT(onSpeedChange(double)) ); - TopLayout->addMultiCellWidget(aWheel, 1, 3, 3, 3, Qt::AlignRight); - - QCheckBox* aCycleCheck = new QCheckBox("Cycled animation",myPlayFrame); - aCycleCheck->setChecked(myAnimator->isCycling()); - connect(aCycleCheck, SIGNAL(toggled(bool)), myAnimator, SLOT(setCyclingSlot(bool))); - TopLayout->addMultiCellWidget(aCycleCheck, 5, 5, 0, 3); - - QCheckBox* aPropCheck = new QCheckBox("Use proportional timing",myPlayFrame); - aPropCheck->setChecked(myAnimator->isProportional()); - connect(aPropCheck, SIGNAL(toggled(bool)), myAnimator, SLOT(setProportionalSlot(bool))); - TopLayout->addMultiCellWidget(aPropCheck, 6, 6, 0, 3); - - QGroupBox* aSaveBox = new QGroupBox( "Saving", myPlayFrame ); - aSaveBox->setColumnLayout(0, Qt::Horizontal ); - QGridLayout* aSaveLay = new QGridLayout(aSaveBox->layout()); - aSaveLay->setSpacing( 5 ); - aSaveLay->setMargin( 5 ); - - mySaveCheck = new QCheckBox("Save pictures to directory", aSaveBox); - aSaveLay->addMultiCellWidget(mySaveCheck, 0, 0, 0, 2); - connect(mySaveCheck, SIGNAL( toggled(bool)), - aWheel, SLOT( setDisabled(bool) )); - - QLabel* aPathLbl = new QLabel("Path:", aSaveBox); - aPathLbl->setEnabled(false); - connect(mySaveCheck, SIGNAL( toggled(bool)), - aPathLbl, SLOT( setEnabled(bool) )); - aSaveLay->addWidget(aPathLbl, 1, 0); - - myPathEdit = new QLineEdit(aSaveBox); - myPathEdit->setEnabled(false); - connect(mySaveCheck, SIGNAL( toggled(bool)), - myPathEdit, SLOT( setEnabled(bool) )); - aSaveLay->addWidget(myPathEdit, 1, 1); - - QPushButton* aBrowseBtn = new QPushButton("Browse...", aSaveBox); - aBrowseBtn->setEnabled(false); - connect(mySaveCheck, SIGNAL( toggled(bool)), - aBrowseBtn, SLOT( setEnabled(bool) )); - connect(aBrowseBtn, SIGNAL( clicked()), - this, SLOT( onBrowse() )); - mySaveCheck->setChecked(false); - aSaveLay->addWidget(aBrowseBtn, 1, 2); - - TopLayout->addMultiCellWidget(aSaveBox, 7, 7, 0, 3); - - aMainLayout->addWidget(myPlayFrame); - - QHBox* aPublishBox = new QHBox(this); - aPublishBox->setSpacing(5); - - myPublishBtn = new QPushButton("Publish to study", aPublishBox); - connect(myPublishBtn, SIGNAL(clicked()), this, SLOT(publishToStudy())); - - mySaveBtn = new QPushButton("Save Animation", aPublishBox); - mySaveBtn->setEnabled(myAnimator->isSavedInStudy()); - connect(mySaveBtn, SIGNAL(clicked()), this, SLOT(saveToStudy())); - - aMainLayout->addWidget(aPublishBox); - - - QHBox* aBtnBox = new QHBox(this); - QHBoxLayout* aBtnLayout = new QHBoxLayout(aBtnBox->layout()); - aBtnLayout->addStretch(); - - QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox); - connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close())); - - SUIT_Study* aStudy = VISU::GetAppStudy(myModule); - connect(aStudy, SIGNAL(destroyed()), this, SLOT(close())); - - aMainLayout->addWidget(aBtnBox); - - myPlayFrame->setEnabled(false); -} - -//************************************************************************ -VisuGUI_TimeAnimationDlg::~VisuGUI_TimeAnimationDlg() -{ - delete myAnimator; -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onTypeChange (int index) -{ - stopAnimation(); - myPropBtn->setEnabled(index != 0); - - clearView(); - myPlayFrame->setEnabled(false); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::addField (_PTR(SObject) theSObject) -{ - myPlayFrame->setEnabled(false); - myAnimator->addField(theSObject); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::createFrames() -{ - stopAnimation(); - SUIT_OverrideCursor c; - - for (int i = 0; i < myAnimator->getNbFields(); i++) { - if (myAnimator->getFieldData(i).myPrs.empty()) - myAnimator->generatePresentations(i); - } - if (myAnimator->getNbFrames() == 0) { - myPlayFrame->setEnabled(false); - c.suspend(); - SUIT_MessageBox::warn1(this, - tr("ERROR"), - tr("MSG_NO_ANIMATIONDATA"), - tr("&OK")); - return; - } - mySlider->setMaxValue(myAnimator->getNbFrames()-1); - myPlayFrame->setEnabled(true); - if (!myAnimator->generateFrames()) { - c.suspend(); - //myPlayFrame->setEnabled(false); - SUIT_MessageBox::warn1(this, - tr("ERROR"), - myAnimator->getLastErrorMsg(), - tr("&OK")); - return; - } - //myPlayFrame->setEnabled(true); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onPlayPressed() -{ - if (myPlayBtn->isOn() && (!myAnimator->running())) { - myPlayBtn->setIconSet(MYpausePixmap); - if (mySaveCheck->isChecked()) - myAnimator->dumpTo(myPathEdit->text()); - else - myAnimator->dumpTo(""); - mySetupBtn->setEnabled(false); - myGenBtn->setEnabled(false); - myAnimator->startAnimation(); - } else { - myPlayBtn->setIconSet(MYplayPixmap); - myAnimator->stopAnimation(); - mySetupBtn->setEnabled(true); - myGenBtn->setEnabled(true); - } -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onBackPressed() -{ - //stopAnimation(); - myAnimator->prevFrame(); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onForvardPressed() -{ - myAnimator->nextFrame(); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onLastPressed() -{ - myAnimator->lastFrame(); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onFirstPressed() -{ - myAnimator->firstFrame(); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::clearView() -{ - myAnimator->clearView(); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::closeEvent (QCloseEvent* theEvent) -{ - myAnimator->stopAnimation(); - myAnimator->wait(500); - if (myAnimator->running() && (! myAnimator->finished())) { - isClosing = true; - myEvent = theEvent; - } else { - QDialog::closeEvent(theEvent); - } -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onWindowChanged (int index) -{ - if (myAnimator->isRunning()) return; - myAnimator->gotoFrame(index); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onSpeedChange (double theSpeed) -{ - myAnimator->setSpeed((int)theSpeed); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::stopAnimation() -{ - myAnimator->stopAnimation(); - myPlayBtn->setOn(false); - myPlayBtn->setIconSet(MYplayPixmap); - mySetupBtn->setEnabled(true); - myGenBtn->setEnabled(true); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onExecution (long theNewFrame, double theTime) -{ - myTimeLbl->setText(QString("%1").arg(theTime)); - mySlider->setValue(theNewFrame); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onSetupDlg() -{ - if (myAnimator->getNbFrames() > 0) myAnimator->firstFrame(); - SetupDlg* aDlg = new SetupDlg (myModule, myAnimator); - aDlg->exec(); - myPlayFrame->setEnabled(false); - delete aDlg; -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onBrowse() -{ - QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/","Select path"); - if (!aPath.isEmpty()) - myPathEdit->setText(aPath); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::onStop() -{ - if (isClosing) { - QDialog::closeEvent(myEvent); - } else { - myPlayBtn->setOn(false); - myPlayBtn->setIconSet(MYplayPixmap); - mySetupBtn->setEnabled(true); - myGenBtn->setEnabled(true); - } -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::saveToStudy() -{ - myAnimator->saveAnimation(); - VISU::UpdateObjBrowser(myModule, true); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::publishToStudy() -{ - myAnimator->publishInStudy(); - VISU::UpdateObjBrowser(myModule, true); - mySaveBtn->setEnabled(myAnimator->isSavedInStudy()); -} - -//************************************************************************ -void VisuGUI_TimeAnimationDlg::restoreFromStudy(_PTR(SObject) theAnimation) -{ - myAnimator->restoreFromStudy(theAnimation); - mySaveBtn->setEnabled(myAnimator->isSavedInStudy()); -} diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.h b/src/VISUGUI/VisuGUI_TimeAnimation.h deleted file mode 100644 index f9fd9743..00000000 --- a/src/VISUGUI/VisuGUI_TimeAnimation.h +++ /dev/null @@ -1,175 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VisuGUI_TimeAnimation.h -// Author : Vitaly SMETANNIKOV -// Module : VISU - -#ifndef VISUGUI_TIMEANIMATION_H -#define VISUGUI_TIMEANIMATION_H - -#include "QtxDblSpinBox.h" - -#include "SALOMEDSClient_Study.hxx" - -#include -#include -#include - -class VisuGUI; -class VISU_TimeAnimation; - -namespace VISU { - class Prs3d_i; -} - -class SVTK_ViewWindow; - -class QtxDblSpinBox; - -class QLabel; -class QSlider; -class QListBox; -class QCheckBox; -class QComboBox; -class QToolButton; - -/*! - * Auxilliary class for presentations definition - */ -class ArrangeDlg: public QDialog -{ - Q_OBJECT - public: - enum { AutoMode, ManualMode }; - enum { XAxis, YAxis, ZAxis }; - - ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator); - ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow); - ~ArrangeDlg() {}; - - int getMode() const { return myStackWgt->id(myStackWgt->visibleWidget()); } - double getDistance() const { return myDistVal->value(); } - int getAxis() const { return myAxisGrp->id(myAxisGrp->selected()); } - - protected slots: - virtual void accept(); - void onFieldChange(int); - - private: - struct Offset { - float myOffset[3]; - }; - - - void init(); - void acceptAnimation(); - void acceptViewWindow(); - - VISU_TimeAnimation* myAnimator; - SVTK_ViewWindow * myViewWindow; - - QWidgetStack* myStackWgt; - QButtonGroup* myAxisGrp; - QtxDblSpinBox* myDistVal; - QListBox* myFieldLst; - QtxDblSpinBox* myCoord[3]; - QValueList myOffsets; - - QCheckBox* mySaveChk; - - int myCurrent; - QMap myPrsMap; -}; - - -class SetupDlg: public QDialog { - Q_OBJECT - - public: - SetupDlg(VisuGUI* theModule, VISU_TimeAnimation* theAnimator); - ~SetupDlg() {}; - - private slots: - void onFieldChange(int theIndex); - void onTypeChanged(int theIndex); - // void onScalarBarDlg(); - void onPreferencesDlg(); - void onRangeCheck(bool theCheck); - void onMinValue(double theVal); - void onMaxValue(double theVal); - void onArrangeDlg(); - - private: - VisuGUI* myModule; - VISU_TimeAnimation* myAnimator; - QListBox* myFieldLst; - QComboBox* myTypeCombo; - QPushButton* myPropBtn; - QPushButton* myArrangeBtn; - QCheckBox* myUseRangeChk; - QtxDblSpinBox* myMinVal; - QtxDblSpinBox* myMaxVal; -}; - - -class VisuGUI_TimeAnimationDlg: public QDialog -{ - Q_OBJECT - public: - VisuGUI_TimeAnimationDlg(VisuGUI* theModule, _PTR(Study) theStudy); - ~VisuGUI_TimeAnimationDlg(); - - void addField(_PTR(SObject) theField); - void clearView(); - - void restoreFromStudy(_PTR(SObject) theAnimation); - - protected: - virtual void closeEvent(QCloseEvent* theEvent); - void stopAnimation(); - - private slots: - void onTypeChange(int index); - void onPlayPressed(); - void onBackPressed(); - void onForvardPressed(); - void onLastPressed(); - void onFirstPressed(); - void onSetupDlg(); - void onWindowChanged(int index); - void createFrames(); - void onSpeedChange(double theSpeed); - void onExecution(long theNewFrame, double theTime); - void onBrowse(); - void onStop(); - void saveToStudy(); - void publishToStudy(); - - private: - QSlider* mySlider; - QComboBox* myTypeCombo; - QPushButton* myPropBtn; - QToolButton* myPlayBtn; - QLabel* myTimeLbl; - QPushButton* mySetupBtn; - QPushButton* myGenBtn; - - QFrame* myPlayFrame; - _PTR(Study) myStudy; - VisuGUI* myModule; - - VISU_TimeAnimation* myAnimator; - QCheckBox* mySaveCheck; - QLineEdit* myPathEdit; - bool isClosing; - QCloseEvent* myEvent; - - QPushButton* myPublishBtn; - QPushButton* mySaveBtn; -}; - -#endif //VISUGUI_TIMEANIMATION_H diff --git a/src/VISU_I/VISUConfig.hh b/src/VISU_I/VISUConfig.hh deleted file mode 100644 index 3224f05a..00000000 --- a/src/VISU_I/VISUConfig.hh +++ /dev/null @@ -1,181 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISUConfig.hh -// Author : Alexey PETROV -// Module : VISU - -#ifndef __VISU_CONFIG_H__ -#define __VISU_CONFIG_H__ - -// IDL headers -#include "SALOMEconfig.h" -#include CORBA_SERVER_HEADER(VISU_Gen) -#include CORBA_SERVER_HEADER(MED) -#include CORBA_SERVER_HEADER(SALOMEDS) -#include CORBA_SERVER_HEADER(SALOMEDS_Attributes) - -#include "SALOME_NamingService.hxx" -#include "SALOME_LifeCycleCORBA.hxx" -#include "Utils_CorbaException.hxx" -#include "utilities.h" - -#include -#include - -// QT headers -#include -#include -#include -#include - -// standard C++ headers -#include - -// STL headers -#include -#include -#include -#include -#include - -class SUIT_Session; -class SUIT_ResourceMgr; - - -namespace VISU{ - - SUIT_Session *GetSession(); - SUIT_ResourceMgr *GetResourceMgr(); - - //=========================================================================== - - class VISU_Gen_i; - - class Base_i : public virtual POA_VISU::Base, - public virtual PortableServer::RefCountServantBase - { - public: - Base_i(); - virtual ~Base_i(); - virtual char* GetID(); - virtual VISU::VISUType GetType() = 0; - - protected: - std::string myID; - - protected: - static QMutex* myMutex; - static CORBA::ORB_var myOrb; - static PortableServer::POA_var myPoa; - static SALOME_NamingService* myNamingService; - static VISU_Gen_i* myVisuGenImpl; - static SALOME_LifeCycleCORBA* myEnginesLifeCycle; - - public: - static CORBA::ORB_var GetORB() { return myOrb;} - static PortableServer::POA_var GetPOA() { return myPoa;} - static SALOME_NamingService* GetNS() { return myNamingService;} - static SALOME_LifeCycleCORBA* GetLCC() { return myEnginesLifeCycle;} - static VISU_Gen_i* GetVisuGenImpl() { return myVisuGenImpl;} - }; - - - //=========================================================================== - class Mutex{ - QMutex* myMutex; - int isQAppLocked; - public: - Mutex(QMutex* theMutex); - ~Mutex(); - }; - - - //=========================================================================== - class Storable : public virtual Base_i { - protected: - virtual void ToStream(std::ostringstream& theStr) = 0; - public: - std::string ToString(); - virtual const char* GetComment() const = 0; - typedef std::map TRestoringMap; - typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, const TRestoringMap& theMap); - typedef std::map TCallbackMap; - static void Registry(const char* theComment, TStorableEngine theEngine); - static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString); - static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL); - static void StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap); - static SALOMEDS::SObject_ptr GetResultSO(SALOMEDS::SObject_ptr theSObject); - static void DataToStream(std::ostringstream& theStr, const QString& theName, const QString& theVal); - static void DataToStream(std::ostringstream& theStr, const QString& theName, const int theVal); - static void DataToStream(std::ostringstream& theStr, const QString& theName, const double theVal); - }; - - //=========================================================================== - class RemovableObject_i : public virtual POA_VISU::RemovableObject, - public virtual Storable - { - public: - virtual void RemoveFromStudy() = 0; - }; - - //=========================================================================== - const CORBA::Boolean IsMultifile(); - QString GenerateName(const std::string& theFmt, int theId); - - PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject); - CORBA::Object_var ClientSObjectToObject(_PTR(SObject) theSObject); - CORBA::Object_var SObjectToObject(SALOMEDS::SObject_ptr); - - _PTR(SComponent) ClientFindOrCreateVisuComponent(_PTR(Study) theStudyDocument); - SALOMEDS::SComponent_var FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument); - - std::string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument, - const char* theFatherEntry, const char* theRefFatherEntry, - const char* theIOR, const char* theName, - const char* thePersistentRef, const char* theComment, - CORBA::Boolean theCreateNew = true); - - std::string CreateAttributes(_PTR(Study) theStudyDocument, - const char* theFatherEntry, const char* theRefFatherEntry, - const char* theIOR, const char* theName, - const char* thePersistentRef, const char* theComment, - CORBA::Boolean theCreateNew = true); - - std::string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry, - const char* theComment, int IsAllLevels = true); - - SALOMEDS::SObject_var GetSObject(_PTR(SObject)); - _PTR(SObject) GetClientSObject(SALOMEDS::SObject_var, _PTR(Study)); - - SALOMEDS::Study_var GetDSStudy(_PTR(Study)); - - void RemoveFromStudy(SALOMEDS::SObject_ptr theSObject, - bool theIsAttrOnly = true, - bool theDestroySubObjects = false); - void RemoveFromStudy(_PTR(SObject) theSObject, - bool theIsAttrOnly = true, - bool theDestroySubObjects = false); -} - -#endif diff --git a/src/VISU_I/VISU_Mesh_i.hh b/src/VISU_I/VISU_Mesh_i.hh deleted file mode 100644 index 6f7ffd5f..00000000 --- a/src/VISU_I/VISU_Mesh_i.hh +++ /dev/null @@ -1,107 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_PrsObject_i.hxx -// Author : Alexey PETROV -// Module : VISU - -#ifndef VISU_Mesh_i_HeaderFile -#define VISU_Mesh_i_HeaderFile - -#include "VISU_Prs3d_i.hh" - -class VISU_MeshPL; - -namespace VISU{ - class Mesh_i : public virtual POA_VISU::Mesh, - public virtual Prs3d_i - { - static int myNbPresent; - Mesh_i(); - Mesh_i(const Mesh_i&); - public: - explicit - Mesh_i(Result_i* theResult); - explicit - Mesh_i(Result_i* theResult, - SALOMEDS::SObject_ptr theSObject); - virtual void SameAs(const Mesh_i* theOrigin); - virtual ~Mesh_i(); - virtual void RemoveFromStudy(); - - virtual VISU::VISUType GetType() { return VISU::TMESH;}; - - virtual void SetCellColor(const SALOMEDS::Color& theColor) { myCellColor = theColor;} - virtual SALOMEDS::Color GetCellColor() { return myCellColor;} - - virtual void SetNodeColor(const SALOMEDS::Color& theColor) { myNodeColor = theColor;} - virtual SALOMEDS::Color GetNodeColor() { return myNodeColor;} - - virtual void SetLinkColor(const SALOMEDS::Color& theColor) { myLinkColor = theColor;} - virtual SALOMEDS::Color GetLinkColor() { return myLinkColor;} - - virtual void SetPresentationType(VISU::PresentationType theType) { myPresentType = theType;} - virtual PresentationType GetPresentationType() { return myPresentType;} - - typedef VISU::Mesh TInterface; - VISU_MeshPL* GetMeshPL(){ return myMeshPL;} - - protected: - Storable* Build(int theRestoring); - - VISU_MeshPL* myMeshPL; - - // std::string myMeshName; move it to Prs3d_i - int myEntity;//jfa IPAL9284: TEntity myEntity; - std::string mySubMeshName; - VISU::VISUType myType; - - VISU::PresentationType myPresentType; - struct SALOMEDS::Color myCellColor, myNodeColor, myLinkColor; - - public: - static int IsPossible(Result_i* theResult, const char* theMeshName, - Entity theEntity, const char* theFamilyName = ""); - virtual Storable* Create(const char* theMeshName, Entity theEntity, const char* theFamilyName = ""); - - static int IsPossible(Result_i* theResult, const char* theMeshName, const char* theGroupName); - virtual Storable* Create(const char* theMeshName, const char* theGroupName); - - const std::string& GetMeshName() const { return myMeshName;} - VISU::Entity GetEntity() const { return VISU::Entity(myEntity);} - const string& GetSubMeshName() const { return mySubMeshName;} - - virtual void ToStream(std::ostringstream& theStr); - - virtual const char* GetComment() const; - static const std::string myComment; - virtual QString GenerateName(); - - virtual Storable* Restore(const Storable::TRestoringMap& theMap); - - virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL); - - virtual void UpdateActor(VISU_Actor* theActor); - }; -} - -#endif diff --git a/src/VISU_I/VISU_PrsObject_i.cc b/src/VISU_I/VISU_PrsObject_i.cc deleted file mode 100644 index 321696a1..00000000 --- a/src/VISU_I/VISU_PrsObject_i.cc +++ /dev/null @@ -1,59 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_PrsObject_i.cxx -// Author : Alexey PETROV -// Module : VISU - -#include "VISU_PrsObject_i.hh" -using namespace VISU; -using namespace std; - -#ifdef _DEBUG_ -static int MYDEBUG = 1; -static int MYDEBUGWITHFILES = 0; -#else -static int MYDEBUG = 0; -static int MYDEBUGWITHFILES = 0; -#endif - -void VISU::PrsObject_i::SetName( const char* theName ) -{ - myName = theName; - SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() ); - if(!mySO->_is_nil()){ - SALOMEDS::StudyBuilder_var aBuilder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( mySO, "AttributeName" ); - SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow( anAttr ); - aNameAttr->SetValue( theName ); - } -} -QString VISU::PrsObject_i::GetEntry() { - CORBA::String_var anIOR = GetID(); - SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(anIOR.in()); - CORBA::String_var anEntry; - if(!CORBA::is_nil(aSObject.in())) - anEntry = aSObject->GetID(); - else - MESSAGE("PrsObject_i::GetEntry - Cannot find SObject in the Study with StudyId = "<StudyId()<<" !!!"); - return anEntry.in(); -} diff --git a/src/VISU_I/VISU_PrsObject_i.hh b/src/VISU_I/VISU_PrsObject_i.hh deleted file mode 100644 index b9aca61e..00000000 --- a/src/VISU_I/VISU_PrsObject_i.hh +++ /dev/null @@ -1,54 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_PrsObject_i.hxx -// Author : Alexey PETROV -// Module : VISU - -#ifndef VISU_PrsObject_i_HeaderFile -#define VISU_PrsObject_i_HeaderFile - -#include "VISUConfig.hh" - -namespace VISU{ - class PrsObject_i : public virtual POA_VISU::PrsObject, - public virtual RemovableObject_i - { - PrsObject_i(const PrsObject_i&); - - public: - PrsObject_i(SALOMEDS::Study_ptr theStudy) : myStudy(SALOMEDS::Study::_duplicate(theStudy)) {}; - virtual ~PrsObject_i() {} - - protected: - std::string myName; - SALOMEDS::Study_var myStudy; - - public: - virtual const char* GetName() const { return myName.c_str();} - virtual void SetName( const char* theName ); - const SALOMEDS::Study_var& GetStudyDocument() const { return myStudy;} - QString GetEntry(); - }; -} - -#endif diff --git a/src/VISU_I/VISU_Result_i.hh b/src/VISU_I/VISU_Result_i.hh deleted file mode 100644 index beb1e558..00000000 --- a/src/VISU_I/VISU_Result_i.hh +++ /dev/null @@ -1,132 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_Result_i.hh -// Author : Alexey PETROV -// Module : VISU - -#ifndef __VISU_RESULT_I_H__ -#define __VISU_RESULT_I_H__ - -#include "VISUConfig.hh" -#include "SALOME_GenericObj_i.hh" - -#include - -#include - -class VISU_Convertor; - -namespace VISU{ - class Result_i : public virtual POA_VISU::Result, - public virtual RemovableObject_i, - public virtual SALOME::GenericObj_i - { - Result_i(); - Result_i(const Result_i &); - - public: - enum ESourceId {eRestoredComponent = -2, eRestoredFile = -1, eFile = 1, eComponent = 2}; - enum ECreationId {eImportFile, eCopyAndImportFile, eImportMed, eImportMedField}; - - Result_i(SALOMEDS::Study_ptr theStudy, - const ESourceId& theSourceId, - const ECreationId& theCreationId); - - virtual ~Result_i(); - virtual void RemoveFromStudy(); - - virtual VISU::VISUType GetType() { return VISU::TRESULT;} - virtual CORBA::Boolean BuildAll(); - - typedef VISU_Convertor TInput; - - private: - ESourceId mySourceId; - ECreationId myCreationId; - - TInput *myInput; - CORBA::Boolean myIsDone; - std::string myName, myInitFileName; - QFileInfo myFileInfo; - - protected: - virtual Storable* Build(SALOMEDS::SObject_ptr theSObject = SALOMEDS::SObject::_nil()) ; - - public: - virtual int IsPossible(); - - virtual Storable* Create(const char* theFileName); - virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject); - virtual Storable* Create(SALOME_MED::FIELD_ptr theField); - - virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject, - const Storable::TRestoringMap& theMap, - const std::string& thePrefix); - - static Storable* Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); - - virtual void ToStream(std::ostringstream& theStr); - virtual const char* GetComment() const; - static const std::string myComment; - TInput* GetInput(); - - const std::string& GetName() const { return myName;} - const QFileInfo& GetFileInfo() const { return myFileInfo;} - const std::string& GetFileName() const { return myInitFileName;} - const ECreationId& GetCreationId() const { return myCreationId;} - - private: - SALOMEDS::SObject_var mySObject; - SALOMEDS::Study_var myStudyDocument; - SALOMEDS::SComponent_var mySComponent; - - public: - std::string GetRefFatherEntry(); - std::string GetEntry(); - const SALOMEDS::SObject_var& GetSObject() const; - const SALOMEDS::Study_var& GetStudyDocument() const; - const SALOMEDS::SComponent_var& GetSComponent() const; - std::string GetEntry(const std::string& theComment); - - // Info on structured mesh contained in TInput - public: - typedef enum { AXIS_X = 0, AXIS_Y, AXIS_Z } TAxis; - const std::vector< float >* GetAxisInfo(const std::string& theMeshName, - TAxis theAxis, - gp_Dir& thePlaneNormal); - // Return i,j or k values and cutting plane normal for theAxis. - // In the case of any problems, return NULL pointer - private: - struct TGridInfo { - std::vector< float > myComponets[ 3 ]; - gp_Dir myAxis [ 3 ]; - }; - map< string, TGridInfo > myMeshName2GridInfoMap; - }; - - Result_var FindResult(SALOMEDS::SObject_ptr theSObject); -} - -#endif diff --git a/src/VISU_I/VISU_Table_i.cc b/src/VISU_I/VISU_Table_i.cc deleted file mode 100644 index dfe598c1..00000000 --- a/src/VISU_I/VISU_Table_i.cc +++ /dev/null @@ -1,1292 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_Table_i.cc -// Author : Vadim SANDLER -// Module : VISU - -#include "VISU_Table_i.hh" - -#include "VISU_CutLines_i.hh" -#include "VISU_Result_i.hh" -#include "VISU_ViewManager_i.hh" - -#include "SPlot2d_Curve.h" - -#include -#include -#include - -#include -#include -#include - -using namespace std; - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif -//---------------------------------------------------------------- -// Table Object -//---------------------------------------------------------------- -int VISU::Table_i::myNbPresent = 0; -const string VISU::Table_i::myComment = "TABLE"; -/*! - Generate unique name -*/ -const char* VISU::Table_i::GenerateName() -{ - return VISU::GenerateName( "Table", ++myNbPresent ); -} -/*! - Gets comment string -*/ -const char* VISU::Table_i::GetComment() const -{ - return myComment.c_str(); -} -/*! - Constructor -*/ -VISU::Table_i::Table_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry ) - : PrsObject_i(theStudy) -{ - mySObj = SALOMEDS::SObject::_duplicate((theStudy->FindObjectID(theObjectEntry))); - myOrientation = VISU::Table::HORIZONTAL; -} -/*! - Destructor -*/ -VISU::Table_i::~Table_i() -{ - MESSAGE("Table_i::~Table_i"); -} -/*! - Gets number of rows in table -*/ -CORBA::Long VISU::Table_i::GetNbRows() -{ - SALOMEDS::SObject_var SO = mySObj; - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - if ( !SO->_is_nil() ) { - SALOMEDS::GenericAttribute_var anAttr; - if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) { - SALOMEDS::AttributeTableOfInteger_var anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr ); - return anInt->GetNbRows(); - } - else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) { - SALOMEDS::AttributeTableOfReal_var aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr ); - return aReal->GetNbRows(); - } - } - return 0; -} -/*! - Gets number of columns in table -*/ -CORBA::Long VISU::Table_i::GetNbColumns() -{ - SALOMEDS::SObject_var SO = mySObj; - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - if ( !SO->_is_nil() ) { - SALOMEDS::GenericAttribute_var anAttr; - if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) { - SALOMEDS::AttributeTableOfInteger_var anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr ); - return anInt->GetNbColumns(); - } - else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) { - SALOMEDS::AttributeTableOfReal_var aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr ); - return aReal->GetNbColumns(); - } - } - return 0; -} -/*! - Creates table object -*/ -VISU::Storable* VISU::Table_i::Create() -{ - // generate name ... - myName = GetTableTitle(); - - // mpv (PAL 5357): if name attribute already exist at this label, use it as name of table - if ( myName == "" ) - if ( !mySObj->_is_nil() ) { - CutLines_i* pCutLines = NULL; - CORBA::Object_var anObj = SObjectToObject(mySObj); - if(!CORBA::is_nil(anObj)){ - VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj); - if(!aCutLines->_is_nil()) - pCutLines = dynamic_cast(GetServant(aCutLines).in()); - } - if (!pCutLines) - if (mySObj->GetName()) myName = mySObj->GetName(); - } - - if ( myName == "" ) - myName = GenerateName(); - // ... and build the object - return Build( false ); -} -/*! - Builds presentation of table -*/ -VISU::Storable* VISU::Table_i::Build( int theRestoring ) -{ - - // look for reference SObject with table attribute - SALOMEDS::SObject_var SO = mySObj; - - if ( !SO->_is_nil() ) { - CutLines_i* pCutLines = NULL; - CORBA::Object_var anObj = SObjectToObject(SO); - if(!CORBA::is_nil(anObj)){ - VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj); - if(!aCutLines->_is_nil()) - pCutLines = dynamic_cast(GetServant(aCutLines).in()); - } - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - // look for component - if ( !theRestoring ) { - SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( myStudy ); - // create SObject and set attributes - QString aComment; - if(pCutLines) - aComment.sprintf("myComment=%s;myType=%d;mySourceId=CutLines",GetComment(),VISU::TTABLE); - else{ - aComment.sprintf("myComment=%s;myType=%d;mySourceId=TableAttr",GetComment(),VISU::TTABLE); - SALOMEDS::SObject_var aFatherSObject = SO->GetFather(); - if(aFatherSObject->FindAttribute(anAttr,"AttributeComment")){ - SALOMEDS::AttributeComment_var aCommentAttr = - SALOMEDS::AttributeComment::_narrow(anAttr); - CORBA::String_var aValue = aCommentAttr->Value(); - Storable::TRestoringMap aMap; - Storable::StrToMap(aValue.in(),aMap); - bool anIsExist; - QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist); - if(anIsExist){ - if(strcmp(aMethodName.latin1(),"ImportTables") == 0){ - aComment.sprintf("myComment=%s;myType=%d;mySourceId=TableFile",GetComment(),VISU::TTABLE); - } - } - } - } - - string anEntry = CreateAttributes( myStudy, - SO->GetID(),//SComponent->GetID(), - "", - GetID(), - GetName(), - "", - aComment.latin1(), - pCutLines ); - // create SObject referenced to real table object - mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID( anEntry.c_str() )); - if(pCutLines) { - pCutLines->BuildTableOfReal(mySObj); - } - // mpv (PAL5357): reference attributes are unnecessary now - //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj ); - //Builder->Addreference( refSO, SO ); - } - return this; - } - return NULL; -} -/*! - Restores table object from stream -*/ -VISU::Storable* VISU::Table_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO) -{ - if(MYDEBUG) MESSAGE(GetComment()); - myName = (const char*)(VISU::Storable::FindValue(theMap,"myName")); - myTitle = (const char*)(VISU::Storable::FindValue(theMap,"myTitle")); - myOrientation = ( VISU::Table::Orientation )( VISU::Storable::FindValue(theMap,"myOrientation").toInt() ); - mySObj = SALOMEDS::SObject::_duplicate(SO); - return Build( true ); -} -/*! - Flushes table data into stream -*/ -void VISU::Table_i::ToStream( std::ostringstream& theStr ) -{ - Storable::DataToStream( theStr, "myName", myName.c_str() ); - Storable::DataToStream( theStr, "myTitle", myTitle.c_str() ); - Storable::DataToStream( theStr, "myOrientation", myOrientation ); -} -/*! - Called from engine to restore table from the file -*/ -VISU::Storable* VISU::Table_i::Restore(SALOMEDS::SObject_ptr theSObject, - const string& thePrefix, const Storable::TRestoringMap& theMap) -{ - SALOMEDS::Study_var aStudy = theSObject->GetStudy(); - VISU::Table_i* pResent = new VISU::Table_i( aStudy, "" ); - return pResent->Restore( theMap, theSObject); -} -/*! - Gets title for the original table object -*/ -const char* VISU::Table_i::GetTableTitle() -{ - SALOMEDS::SObject_var SO = mySObj; - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeTableOfInteger_var anInt; - SALOMEDS::AttributeTableOfReal_var aReal; - if ( !SO->_is_nil() ) { - if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) { - anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr ); - return anInt->GetTitle(); - } - else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) { - aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr ); - return aReal->GetTitle(); - } - } - return ""; -} - -void VISU::Table_i::RemoveFromStudy() -{ - // Remove the table with all curves - VISU::RemoveFromStudy(mySObj,false); -} - -//---------------------------------------------------------------- -// Curve Object -//---------------------------------------------------------------- -/*! - Restores table object from the stream [ static ] -*/ -static VISU::Table_i* GetTable( SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSO ) { - CORBA::Object_var anObject = VISU::SObjectToObject( theSO ); - if( !CORBA::is_nil( anObject ) ) { - CORBA::Object_ptr aTable = VISU::Table::_narrow( anObject ); - if( !CORBA::is_nil( aTable ) ) - return dynamic_cast(VISU::GetServant(aTable).in()); - } - return NULL; -} - -int VISU::Curve_i::myNbPresent = 0; -const string VISU::Curve_i::myComment = "CURVE"; -/*! - Generate unique name -*/ -const char* VISU::Curve_i::GenerateName() -{ - return VISU::GenerateName( "Curve", ++myNbPresent ); -} -/*! - Gets comment string -*/ -const char* VISU::Curve_i::GetComment() const -{ - return myComment.c_str(); -} -/*! - Constructor - NB : theHRow, theVRow are the indexes of rows in the Table object and numbered from the 1 to GetNbRows() -*/ -VISU::Curve_i::Curve_i(SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::Long theHRow, CORBA::Long theVRow ) - : PrsObject_i(theStudy), myTable( theTable ), myHRow( theHRow ), myVRow( theVRow ) -{ - myAuto = true; - myLine = VISU::Curve::SOLIDLINE; - myLineWidth = 0; - myMarker = VISU::Curve::CIRCLE; - myColor.R = 0.0; myColor.G = 0.0; myColor.B = 0.0; -} -/*! - Destructor -*/ -VISU::Curve_i::~Curve_i() -{ - MESSAGE("Curve_i::~Curve_i"); -} -/*! - Creates curve object -*/ -VISU::Storable* VISU::Curve_i::Create() -{ - // generate name ... - myName = GetVerTitle(); - if ( myName == "" ) - myName = GenerateName(); - // ... and build the object - return Build( false ); -} -/*! - Builds presentation of curve -*/ -VISU::Storable* VISU::Curve_i::Build(int theRestoring ) -{ - if ( myTable != NULL ) { - // getting table SObject by it's entry - int nbRows = myTable->GetNbRows(); - if ( myHRow > 0 && myHRow <= nbRows && myVRow > 0 && myVRow <= nbRows ) { - if ( !theRestoring ) { - // look for component - SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( myStudy ); - // create SObject and set attributes - QString aComment; - aComment.sprintf("myComment=%s;myType=%d",GetComment(),VISU::TCURVE); - string anEntry = CreateAttributes( myStudy, - myTable->GetObjectEntry(), - "", - GetID(), - GetName(), - "", - aComment.latin1(), - true ); - // create SObject referenced to real table object - mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID(anEntry.c_str())); - } - return this; - } - } - return NULL; -} - -/*! - Returns CORBA::True if curve refers to valid table data -*/ -CORBA::Boolean VISU::Curve_i::IsValid() -{ - // getting table SObject by it's entry - SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry()); - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeTableOfInteger_var anInt; - SALOMEDS::AttributeTableOfReal_var aReal; - if ( !SO->_is_nil() ) { - if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) { - anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr ); - if ( myHRow > 0 && myHRow <= anInt->GetNbRows() && myVRow > 0 && myVRow <= anInt->GetNbRows() ) { - return true; - } - } - else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) { - aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr ); - if ( myHRow > 0 && myHRow <= aReal->GetNbRows() && myVRow > 0 && myVRow <= aReal->GetNbRows() ) { - return true; - } - } - } - return false; -} -/*! - Returns hor.axis title -*/ -string VISU::Curve_i::GetHorTitle() -{ - string title; - // getting table SObject by it's entry - SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry()); - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeTableOfInteger_var anInt; - SALOMEDS::AttributeTableOfReal_var aReal; - if ( !SO->_is_nil() ) { - if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) { - anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr ); - SALOMEDS::StringSeq_var rowTitles = anInt->GetRowTitles(); - if ( rowTitles->length() > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() ) { - title = rowTitles[ myHRow-1 ]; - } - } - else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) { - aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr ); - SALOMEDS::StringSeq_var rowTitles = aReal->GetRowTitles(); - if ( rowTitles->length() > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() ) { - title = rowTitles[ myHRow-1 ]; - } - } - } - return title; -} -/*! - Returns ver.axis title -*/ -string VISU::Curve_i::GetVerTitle() -{ - string title; - // getting table SObject by it's entry - SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry()); - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeTableOfInteger_var anInt; - SALOMEDS::AttributeTableOfReal_var aReal; - if ( !SO->_is_nil() ) { - if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) { - anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr ); - SALOMEDS::StringSeq_var rowTitles = anInt->GetRowTitles(); - if ( rowTitles->length() > 0 && myVRow > 0 && myVRow <= anInt->GetNbRows() ) - title = rowTitles[ myVRow-1 ]; - } - else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) { - aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr ); - SALOMEDS::StringSeq_var rowTitles = aReal->GetRowTitles(); - if ( rowTitles->length() > 0 && myVRow > 0 && myVRow <= aReal->GetNbRows() ) - title = rowTitles[ myVRow-1 ]; - } - } - return title; -} -/*! - Returns hor.axis units -*/ -string VISU::Curve_i::GetHorUnits() -{ - string units; - // getting table SObject by it's entry - SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry()); - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeTableOfInteger_var anInt; - SALOMEDS::AttributeTableOfReal_var aReal; - if ( !SO->_is_nil() ) { - if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) { - anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr ); - SALOMEDS::StringSeq_var rowUnits = anInt->GetRowUnits(); - if ( rowUnits->length() > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() ) - units = rowUnits[ myHRow-1 ]; - } - else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) { - aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr ); - SALOMEDS::StringSeq_var rowUnits = aReal->GetRowUnits(); - if ( rowUnits->length() > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() ) - units = rowUnits[ myHRow-1 ]; - } - } - return units; -} -/*! - Returns ver.axis units -*/ -string VISU::Curve_i::GetVerUnits() -{ - string units; - // getting table SObject by it's entry - SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry()); - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeTableOfInteger_var anInt; - SALOMEDS::AttributeTableOfReal_var aReal; - if ( !SO->_is_nil() ) { - if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) { - anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr ); - SALOMEDS::StringSeq_var rowUnits = anInt->GetRowUnits(); - if ( rowUnits->length() > 0 && myVRow > 0 && myVRow <= anInt->GetNbRows() ) - units = rowUnits[ myVRow-1]; - } - else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) { - aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr ); - SALOMEDS::StringSeq_var rowUnits = aReal->GetRowUnits(); - if ( rowUnits->length() > 0 && myVRow > 0 && myVRow <= aReal->GetNbRows() ) - units = rowUnits[ myVRow-1 ]; - } - } - return units; -} -/*! - Gets curve data -*/ -int VISU::Curve_i::GetData( double*& theHorList, double*& theVerList ) -{ - theHorList = 0; theVerList = 0; - // getting table SObject by it's entry - SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry()); - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeTableOfInteger_var anInt; - SALOMEDS::AttributeTableOfReal_var aReal; - if ( !SO->_is_nil() ) { - if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) { - anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr ); - int nbCols = anInt->GetNbColumns() ; - if ( nbCols > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() && myVRow > 0 && myVRow <= anInt->GetNbRows() ) { - int nbPoints = 0; - for ( int j = 1; j <= nbCols; j++ ) { - if ( anInt->HasValue( myHRow, j ) && anInt->HasValue( myVRow, j ) ) - nbPoints++; - } - if ( nbPoints > 0 ) { - theHorList = new double[ nbPoints ]; - theVerList = new double[ nbPoints ]; - int k = 0; - for ( int j = 1; j <= nbCols; j++ ) { - if ( anInt->HasValue( myHRow, j ) && anInt->HasValue( myVRow, j ) ) { - theHorList[k] = anInt->GetValue( myHRow, j ); - theVerList[k] = anInt->GetValue( myVRow, j ); - k++; - } - } - } - return nbPoints; - } - } - else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) { - aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr ); - int nbCols = aReal->GetNbColumns() ; - if ( nbCols > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() && myVRow > 0 && myVRow <= aReal->GetNbRows() ) { - int nbPoints = 0; - for ( int j = 1; j <= nbCols; j++ ) { - if ( aReal->HasValue( myHRow, j ) && aReal->HasValue( myVRow, j ) ) - nbPoints++; - } - if ( nbPoints > 0 ) { - theHorList = new double[ nbPoints ]; - theVerList = new double[ nbPoints ]; - int k = 0; - for ( int j = 1; j <= nbCols; j++ ) { - if ( aReal->HasValue( myHRow, j ) && aReal->HasValue( myVRow, j ) ) { - theHorList[k] = aReal->GetValue( myHRow, j ); - theVerList[k] = aReal->GetValue( myVRow, j ); - k++; - } - } - } - return nbPoints; - } - } - } - return 0; -} -/*! - Creates curve Plot2d presentation object -*/ -SPlot2d_Curve* VISU::Curve_i::CreatePresentation() -{ - SPlot2d_Curve* crv = new SPlot2d_Curve(); - crv->setHorTitle( GetHorTitle().c_str() ); - string tlt = GetTitle(); - if ( tlt.length() <= 0 ) - tlt = GetVerTitle(); - //crv->setVerTitle( strdup( GetVerTitle().c_str() ) ); - //crv->setVerTitle( strdup( GetName() ) ); - crv->setVerTitle( tlt.c_str() ); - crv->setHorUnits( GetHorUnits().c_str() ); - crv->setVerUnits( GetVerUnits().c_str() ); - double* xList = 0; - double* yList = 0; - int nbPoints = GetData( xList, yList ); - if ( nbPoints > 0 && xList && yList ) { - crv->setData( xList, yList, nbPoints ); - } - //cout << "********** Number of points: " << nbPoints <setLine( (Plot2d_Curve::LineType)GetLine(), GetLineWidth() ); - crv->setMarker( (Plot2d_Curve::MarkerType)GetMarker() ); - SALOMEDS::Color color = GetColor(); - crv->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) ); - crv->setAutoAssign( IsAuto() ); - crv->setIO(new SALOME_InteractiveObject(mySObj->GetID(),"VISU",GetName())); - if ( myTable ) - crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry(),"VISU",myTable->GetName())); - return crv; -} -/*! - Restores curve object from stream -*/ -VISU::Storable* VISU::Curve_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO) -{ - if(MYDEBUG) MESSAGE(GetComment()); - mySObj = SALOMEDS::SObject::_duplicate(theSO); - myName = VISU::Storable::FindValue(theMap,"myName").latin1(); - myHRow = VISU::Storable::FindValue(theMap,"myHRow").toInt(); - myVRow = VISU::Storable::FindValue(theMap,"myVRow").toInt(); - myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble(); - myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble(); - myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble(); - myMarker = ( VISU::Curve::MarkerType )( VISU::Storable::FindValue(theMap,"myMarker").toInt() ); - myLine = ( VISU::Curve::LineType )( VISU::Storable::FindValue(theMap,"myLine").toInt() ); - myLineWidth = VISU::Storable::FindValue(theMap,"myLineWidth").toInt(); - myAuto = VISU::Storable::FindValue(theMap,"myAuto").toInt(); - return Build( true ); -} -/*! - Flushes curve data into stream -*/ -void VISU::Curve_i::ToStream( std::ostringstream& theStr ) -{ - Storable::DataToStream( theStr, "myName", myName.c_str() ); - Storable::DataToStream( theStr, "myHRow", myHRow ); - Storable::DataToStream( theStr, "myVRow", myVRow ); - Storable::DataToStream( theStr, "myColor.R", myColor.R ); - Storable::DataToStream( theStr, "myColor.G", myColor.G ); - Storable::DataToStream( theStr, "myColor.B", myColor.B ); - Storable::DataToStream( theStr, "myMarker", myMarker ); - Storable::DataToStream( theStr, "myLine", myLine ); - Storable::DataToStream( theStr, "myLineWidth", myLineWidth ); - Storable::DataToStream( theStr, "myAuto", myAuto ); -} -/*! - Gets reference table's entry -*/ -const char* VISU::Curve_i::GetTableID() { - return myTable->GetObjectEntry(); -} -/*! - Called from engine to restore curve from the file -*/ -VISU::Storable* VISU::Curve_i::Restore(SALOMEDS::SObject_ptr theSObject, - const string& thePrefix, const Storable::TRestoringMap& theMap) -{ - SALOMEDS::Study_var aStudy = theSObject->GetStudy(); - VISU::Table_i* pTable = GetTable(aStudy, theSObject->GetFather()); - if( pTable != NULL ) { - VISU::Curve_i* pResent = new VISU::Curve_i( aStudy, pTable, 0, 0 ); - return pResent->Restore( theMap, theSObject); - } - return NULL; -} - -void VISU::Curve_i::RemoveFromStudy() -{ - VISU::DeleteActors(this); - VISU::RemoveFromStudy(mySObj,false); -} - -SALOMEDS::SObject_var VISU::Curve_i::GetSObject() -{ - return mySObj; -} - -//---------------------------------------------------------------- -// Container Object -//---------------------------------------------------------------- -int VISU::Container_i::myNbPresent = 0; -const string VISU::Container_i::myComment = "CONTAINER"; -/*! - Generate unique name -*/ -const char* VISU::Container_i::GenerateName() -{ - return VISU::GenerateName( "Plot2DView", ++myNbPresent ); -} -/*! - Gets comment string -*/ -const char* VISU::Container_i::GetComment() const -{ - return myComment.c_str(); -} -/*! - Constructor -*/ -VISU::Container_i::Container_i( SALOMEDS::Study_ptr theStudy ) - : PrsObject_i( theStudy ) -{ -} -/*! - Destructor -*/ -VISU::Container_i::~Container_i() -{ - MESSAGE("Container_i::~Container_i"); - myCurves.clear(); -} -/*! - Inserts curve into the container -*/ -void VISU::Container_i::AddCurve( Curve_ptr theCurve ) -{ - if ( myStudy->_is_nil() ) - return; - SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() ); - if ( mySO->_is_nil() ) - return; - PortableServer::POA_ptr aPOA = GetPOA(); - Curve_i* pCurve = dynamic_cast( aPOA->reference_to_servant( theCurve ) ); - if( pCurve ) { - QString entry = pCurve->GetEntry(); - SALOMEDS::SObject_var SO = myStudy->FindObjectID( entry.latin1() ); - if ( !SO->_is_nil() && myCurves.find( entry ) == myCurves.end() ) { - myCurves.append( entry ); - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::SObject_var newSO = Builder->NewObject( mySO ); - Builder->Addreference( newSO, SO ); - } - } -} -/*! - Removes curve from the container -*/ -void VISU::Container_i::RemoveCurve( Curve_ptr theCurve ) -{ - if ( myStudy->_is_nil() ) - return; - SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() ); - if ( mySO->_is_nil() ) - return; - PortableServer::POA_ptr aPOA = GetPOA(); - Curve_i* pCurve = dynamic_cast( aPOA->reference_to_servant( theCurve ) ); - if( pCurve ) { - QString entry = pCurve->GetEntry(); - if ( myCurves.find( entry ) != myCurves.end() ) { - // found !!! - myCurves.remove( entry ); - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO ); - for ( ; CI->More(); CI->Next() ) { - SALOMEDS::SObject_var childSO = CI->Value(); - SALOMEDS::SObject_var refSO; - if ( childSO->ReferencedObject( refSO ) && !refSO->_is_nil() && entry == QString( refSO->GetID() ) ) { - Builder->RemoveObject( childSO ); - } - } - } - } -} -/*! - Gets number of curves in the container -*/ -CORBA::Long VISU::Container_i::GetNbCurves() -{ - Update(); - return myCurves.count(); -} -/*! - Clears container -*/ -void VISU::Container_i::Clear() -{ - if ( myStudy->_is_nil() ) - return; - SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() ); - if ( mySO->_is_nil() ) - return; - QStringList toDelete; - SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO ); - for ( ; CI->More(); CI->Next() ) { - toDelete.append( CI->Value()->GetID() ); - } - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - for ( int i = 0; i < toDelete.count(); i++ ) { - SALOMEDS::SObject_var SO = myStudy->FindObjectID( toDelete[i].latin1() ); - Builder->RemoveObject( SO ); - } - myCurves.clear(); -} -/*! - Creates container object -*/ -VISU::Storable* VISU::Container_i::Create() -{ - // generate name ... - myName = GenerateName(); - // ... and build the object - return Build( false ); -} -/*! - Builds presentation of container -*/ -VISU::Storable* VISU::Container_i::Build( int theRestoring ) -{ - if ( !theRestoring ) { - // looking for component - SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( myStudy ); - // create SObject and set attributes - QString aComment; - aComment.sprintf("myComment=%s;myType=%d",GetComment(),VISU::TCONTAINER); - string anEntry = CreateAttributes( myStudy, - SComponent->GetID(), - "", - GetID(), - GetName(), - "", - aComment.latin1(), - true ); - mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID(anEntry.c_str())); - } - return this; -} -/*! - Updates presentation of container -*/ -void VISU::Container_i::Update() -{ - if ( myStudy->_is_nil() ) - return; - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() ); - SALOMEDS::GenericAttribute_var anAttr; - if ( !mySO->_is_nil() ) { - QStringList toDelete; - int i; - for ( i = 0; i < myCurves.count(); i++ ) { - SALOMEDS::SObject_var SO = myStudy->FindObjectID( myCurves[i].latin1() ); - if ( !SO->_is_nil() && Builder->FindAttribute( SO, anAttr, "AttributeIOR" ) ) { - // if real Curve Object still exists - SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO ); - bool bFound = false; - for ( ; CI->More(); CI->Next() ) { - SALOMEDS::SObject_var childSO = CI->Value(); - SALOMEDS::SObject_var refSO; - if ( childSO->ReferencedObject( refSO ) && !refSO->_is_nil() && myCurves[i] == QString( refSO->GetID() ) ) { - bFound = true; break; - } - } - if (! bFound ) { - // create SObject referenced to real curve object if is not yet added - SALOMEDS::SObject_var newSO = Builder->NewObject( mySO ); - Builder->Addreference( newSO, SO ); - } - } - else { - // real Curve Object doesn't exist (might be removed) - toDelete.append( myCurves[i] ); - } - } - for ( i = 0; i < toDelete.count(); i++ ) { - myCurves.remove( toDelete[i] ); - } - toDelete.clear(); - SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO ); - for ( ; CI->More(); CI->Next() ) { - SALOMEDS::SObject_var childSO = CI->Value(); - SALOMEDS::SObject_var refSO; - if ( childSO->ReferencedObject( refSO ) && ( refSO->_is_nil() || !Builder->FindAttribute( refSO, anAttr, "AttributeIOR" ) || - myCurves.find( refSO->GetID() ) == myCurves.end() ) ) { - toDelete.append( childSO->GetID() ); - } - } - for ( i = 0; i < toDelete.count(); i++ ) { - SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO ); - for ( ; CI->More(); CI->Next() ) { - SALOMEDS::SObject_var childSO = CI->Value(); - if ( toDelete[i] == CI->Value()->GetID() ) { - Builder->RemoveObject( childSO ); - } - } - } - } -} -/*! - Gets curve from container by index - NB : curves are numbered from 1 -*/ -VISU::Curve_i* VISU::Container_i::GetCurve( CORBA::Long theIndex ) -{ - if ( theIndex > 0 && theIndex <= myCurves.count() ) { - SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::SObject_var SO = myStudy->FindObjectID( myCurves[ theIndex-1 ].latin1() ); - CORBA::Object_var anObject = VISU::SObjectToObject( SO ); - if( !CORBA::is_nil( anObject ) ) { - // if real Curve Object exists - CORBA::Object_ptr aCurve = VISU::Curve::_narrow( anObject ); - if( !CORBA::is_nil( aCurve ) ) - return dynamic_cast(VISU::GetServant(aCurve).in()); - } - } - return NULL; -} -/*! - Restores container data from the stream -*/ -VISU::Storable* VISU::Container_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO ) -{ - if(MYDEBUG) MESSAGE(GetComment()); - mySObj = SALOMEDS::SObject::_duplicate(SO); - myName = VISU::Storable::FindValue( theMap, "myName" ).latin1(); - QString val = VISU::Storable::FindValue( theMap, "myCurves" ); - myCurves = QStringList::split( QString( "*" ), val, false ); - return Build( true ); -} -/*! - Flushes container data into the stream -*/ -void VISU::Container_i::ToStream( std::ostringstream& theStr ) -{ - Storable::DataToStream( theStr, "myName", myName.c_str() ); - Storable::DataToStream( theStr, "myCurves", myCurves.join( QString( "*" ) ) ); -// theStr<<" myName "<GetStudy(); - VISU::Container_i* pResent = new VISU::Container_i( aStudy ); - return pResent->Restore( theMap, theSObject ); -} - -void VISU::Container_i::RemoveFromStudy() -{ - VISU::RemoveFromStudy(mySObj,false); -} - -//------------------------------------------------------------- -// Implementation of reading from file -//------------------------------------------------------------- -typedef string TValue; -typedef vector TValues; - -struct TRow{ - string myTitle; - string myUnit; - TValues myValues; -}; - -typedef vector TRows; - -struct TTable2D { - string myTitle; - vector myColumnUnits; - vector myColumnTitles; - TRows myRows; - int Check(){ - if(myRows.empty()) return 0; - int iEnd = myRows[0].myValues.size(); - if(iEnd == 0) return 0; - if(myColumnTitles.size() != iEnd) myColumnTitles.resize(iEnd); - if(myColumnUnits.size() != iEnd) myColumnUnits.resize(iEnd); - int jEnd = myRows.size(); - for(int j = 0; j < jEnd; j++) - if(myRows[j].myValues.size() != iEnd) - return 0; - return 1; - } - void getColumns(TTable2D& theTable2D) const { - TRows& aRows = theTable2D.myRows; - aRows.clear(); - if(myRows.empty()) return; - int jEnd = myRows.size(); - //Define Titles & Units - theTable2D.myColumnTitles.resize(jEnd); - theTable2D.myColumnUnits.resize(jEnd); - for(int j = 0; j < jEnd; j++){ - theTable2D.myColumnTitles[j] = myRows[j].myTitle; - theTable2D.myColumnUnits[j] = myRows[j].myUnit; - } - //Define Rows - int iEnd = myRows[0].myValues.size(); - for(int i = 0; i < iEnd; i++){ - TRow aNewRow; - aNewRow.myTitle = myColumnTitles[i]; - aNewRow.myUnit = myColumnUnits[i]; - aNewRow.myValues.resize(jEnd); - for(int j = 0; j < jEnd; j++){ - aNewRow.myValues[j] = myRows[j].myValues[i]; - } - aRows.push_back(aNewRow); - } - } -}; - -typedef vector TTableCont; - -int getLine(ifstream& theStmIn, QString& theString){ - char tmp; - ostrstream aStrOut; - while(theStmIn.get(tmp)){ - aStrOut<= 0 ) { - data = aTmp.left( index ).stripWhiteSpace(); - cmt = aTmp.mid( index+1 ).stripWhiteSpace(); - } - // if comment is not empty, try to get keyword from it (separated by ':' symbol) - if ( !cmt.isEmpty() ) { - int index1 = cmt.find( ":" ); - if ( index1 >= 0 ) { - QString tmpstr = cmt.left( index1 ).stripWhiteSpace(); - if ( tmpstr == QString( "TITLE" ) || - tmpstr == QString( "COLUMN_TITLES" ) || - tmpstr == QString( "COLUMN_UNITS" ) || - tmpstr == QString( "COMMENT" ) ) { - keyword = tmpstr; - cmt = cmt.mid( index1+1 ).stripWhiteSpace(); - } - } - } - // if data is empty, process only comment - if ( data.isEmpty() ) { - // if keyword is found, try to process it - // elsewise it is a simple comment, just ignore it - if ( !keyword.isEmpty() ) { - if ( keyword == QString( "TITLE" ) ) { - QString title = cmt; - if ( aTable2D.myTitle != "" ) - title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title; - if(MYDEBUG) cout << "...Table TITLE is: " << title.latin1() << endl; - aTable2D.myTitle = title.latin1(); - } - else if ( keyword == QString( "COLUMN_TITLES" ) ) { - // comment may contain column headers - QStringList aStrList = QStringList::split( "|", cmt ); - if(MYDEBUG) cout << "...Column TITLES are: "; - for ( int i = 0; i < aStrList.count(); i++ ) { - QString tmpstr = aStrList[ i ].stripWhiteSpace(); - if(MYDEBUG) cout << tmpstr.latin1() << " "; - aTable2D.myColumnTitles.push_back( tmpstr.latin1() ); - } - if(MYDEBUG) cout << endl; - } - else if ( keyword == QString( "COLUMN_UNITS" ) ) { - // comment may contain column units - QStringList aStrList = QStringList::split( " ", cmt ); - if(MYDEBUG) cout << "...Column UNITS are: "; - for ( int i = 0; i < aStrList.count(); i++ ) { - QString tmpstr = aStrList[ i ].stripWhiteSpace(); - if(MYDEBUG) cout << tmpstr.latin1() << " "; - aTable2D.myColumnUnits.push_back( tmpstr.latin1() ); - } - if(MYDEBUG) cout << endl; - } - else if ( keyword == QString( "COMMENT" ) ) { - // keyword 'COMMENT' processing can be here - // currently it is ignored - if(MYDEBUG) cout << "...COMMENT: " << cmt.latin1() << endl; - } - } - else { - if(MYDEBUG) cout << "...comment: " << cmt.latin1() << endl; - // simple comment processing can be here - // currently it is ignored - } - } - // if data is not empty, try to process it - else { - TRow aRow; - if(MYDEBUG) cout << "...New row is found: " << endl; - if ( !cmt.isEmpty() ) { - aRow.myTitle = cmt.latin1(); - if(MYDEBUG) cout << "......ROW TITLE is: " << cmt.latin1() << endl; - } - QStringList aValList = QStringList::split( " ", data ); - for ( int i = 0; i < aValList.count(); i++ ) { - if ( aValList[i].stripWhiteSpace() != "" ) { - TValue aVal = aValList[i].stripWhiteSpace().latin1(); - aRow.myValues.push_back( aVal ); - } - } - if( aRow.myValues.size() > 0 ) - aTable2D.myRows.push_back( aRow ); - // ************** OLD CODE ****************** - /* - TValue aVal; - istrstream aStream( data ); - aStream.precision( STRPRECISION ); - while( aStream >> aVal ) { - aRow.myValues.push_back( aVal ); - } - if( aRow.myValues.size() > 0 ) - aTable2D.myRows.push_back( aRow ); - */ - // ************** OLD CODE ****************** - } - getLine( aStmIn, aTmp ); - } - if( aTable2D.Check() ) { - if(MYDEBUG) cout << "aTable2D is checked OK " << aTable2D.myTitle << endl; - theTableCont.push_back( aTable2D ); - } - } - while( !aStmIn.eof() ); - aStmIn.close(); - if(MYDEBUG) cout << "After close" << endl; -} - -SALOMEDS::SObject_var VISU::ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy){ - TTableCont aTableCont; - ImportTables(theFileName,aTableCont); - if(aTableCont.empty()) return SALOMEDS::SObject::_nil(); - SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); - SALOMEDS::SComponent_var theSComponent = VISU::FindOrCreateVisuComponent(theStudy); - SALOMEDS::SObject_var aFileObject = aStudyBuilder->NewObject(theSComponent); - SALOMEDS::GenericAttribute_var anAttr = - aStudyBuilder->FindOrCreateAttribute(aFileObject, "AttributeName"); - SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); - QFileInfo aFileInfo(theFileName); - aName->SetValue(aFileInfo.fileName().latin1()); - anAttr = aStudyBuilder->FindOrCreateAttribute(aFileObject, "AttributeComment"); - SALOMEDS::AttributeComment_var aComment = SALOMEDS::AttributeComment::_narrow(anAttr); - QString aString; - aString.sprintf("myComment=ImportTables;myFileName=%s", - aFileInfo.absFilePath().latin1()); - aComment->SetValue(aString.latin1()); - for(int i = 0, iEnd = aTableCont.size(); i < iEnd; i++){ - const TTable2D& aTable2D = aTableCont[i]; - SALOMEDS::SObject_var aRealObject = aStudyBuilder->NewObject(aFileObject); - anAttr = aStudyBuilder->FindOrCreateAttribute(aRealObject, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - if(MYDEBUG) cout<<"aTable2D.myTitle = "<SetValue(aTable2D.myTitle.c_str()); - else{ - QString aNewName; - aNewName.sprintf("Table:%d",i); - aName->SetValue(aNewName.latin1()); - } - anAttr = aStudyBuilder->FindOrCreateAttribute(aRealObject, "AttributeTableOfReal"); - SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr); - aTableOfReal->SetTitle(aTable2D.myTitle.c_str()); - TTable2D aNewTable2D; - aTable2D.getColumns(aNewTable2D); - int kEnd = aNewTable2D.myRows[0].myValues.size(); - aTableOfReal->SetNbColumns(kEnd); - for(int j = 0, jEnd = aNewTable2D.myRows.size(); j < jEnd; j++){ - if(MYDEBUG) cout<<"j = "<PutValue(aValue,j+1,k+1); - } - - aTableOfReal->SetRowTitle(j+1,aNewTable2D.myRows[j].myTitle.c_str()); - aTableOfReal->SetRowUnit(j+1,aNewTable2D.myRows[j].myUnit.c_str()); - } - for(int k = 0; k < kEnd; k++) - aTableOfReal->SetColumnTitle(k+1,aNewTable2D.myColumnTitles[k].c_str()); - } - return aFileObject; -} - -template bool ExportTableToFile(const TTableAttr& aTabAttr, - const char* theFileName) -{ - if (!CORBA::is_nil(aTabAttr)) { - QFile aFile(theFileName); - aFile.open(IO_WriteOnly); - - /* extract the tabe info and write it into file */ - - QString aTitle(aTabAttr->GetTitle()); /*Table title*/ - int aRowsNb = aTabAttr->GetNbRows(); - int aColNb = aTabAttr->GetNbColumns(); - - SALOMEDS::StringSeq_var aRowTitles = aTabAttr->GetRowTitles(); - QString anAbscissTitle(aRowTitles[0]); /*Absciss row title (X coord)*/ - anAbscissTitle.stripWhiteSpace(); - - SALOMEDS::StringSeq_var aRowUnits = aTabAttr->GetRowUnits(); - QString anAbscissUnit(aRowUnits[0]); - anAbscissUnit.stripWhiteSpace(); - - SALOMEDS::StringSeq_var aColumnTitles = aTabAttr->GetColumnTitles(); - if (aRowsNb > 2 && aTitle.length() ) aTitle = aTitle + " - "; - - QString aLine; - for (int i = 2; i <= aRowsNb; i++ ) - { - /* TITLE */ - QString anOrdinate(aRowTitles[i-1]), aTail; - anOrdinate.stripWhiteSpace(); - - aLine = "#TITLE: " + aTitle + - ((anOrdinate.length())? anOrdinate : - (aRowsNb>2)? aTail.sprintf("%d",i-1) : aTail.sprintf("") ) + "\n"; - aFile.writeBlock(aLine, aLine.length() ); - - /* COLUMN_TITLES */ - if ( anAbscissTitle.length() || anOrdinate.length() ) { - aLine = "#COLUMN_TITLES: " + anAbscissTitle + " | " + anOrdinate + "\n"; - aFile.writeBlock(aLine, aLine.length() ); - } - - /* COLUMN_UNITS */ - aLine = anAbscissUnit + " " +aRowUnits[i-1]; - if (!aLine.stripWhiteSpace().isEmpty()) { - aLine = "#COLUMN_UNITS: " + aLine + "\n"; - aFile.writeBlock(aLine, aLine.length() ); - } - - /* CURVE COORDINATES */ - for (int j = 1; j <= aColNb; j++) - { - if ( aTabAttr -> HasValue(i,j) && aTabAttr -> HasValue(1, j)) { - aLine = aLine.sprintf("%.16g %.16g", - (double)(aTabAttr->GetValue(1,j)), - (double)(aTabAttr->GetValue(i,j))); /* aTabAttr->GetValue(1,j) - X coord */ - if ( !aLine.stripWhiteSpace().isEmpty() ) { - QString aColTitle(aColumnTitles[j-1]); - if ( !aColTitle.stripWhiteSpace().isEmpty() ) - aLine = aLine + " #TITLE: " + aColTitle ; - aFile.writeBlock(aLine + "\n", aLine.length() + 1); - } - } - } - aFile.writeBlock("\n", 1); - } - aFile.close(); - return true; - } - return false; -} - -bool VISU::ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName) -{ - //Find table - SALOMEDS::GenericAttribute_var anAttr ; - if (theTable->FindAttribute(anAttr, "AttributeTableOfReal")) - { - SALOMEDS::AttributeTableOfReal_var aTabAttr = SALOMEDS::AttributeTableOfReal ::_narrow(anAttr); - return ExportTableToFile ( aTabAttr , theFileName); - - } - else if (theTable->FindAttribute(anAttr, "AttributeTableOfInteger")) { - - SALOMEDS::AttributeTableOfInteger_var aTabAttr = SALOMEDS::AttributeTableOfInteger ::_narrow(anAttr); - return ExportTableToFile ( aTabAttr , theFileName); - - } - return false; -} diff --git a/src/VISU_I/VISU_Table_i.hh b/src/VISU_I/VISU_Table_i.hh deleted file mode 100644 index ed911dcf..00000000 --- a/src/VISU_I/VISU_Table_i.hh +++ /dev/null @@ -1,206 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_Table_i.hh -// Author : Vadim SANDLER -// Module : VISU - -#ifndef VISU_Table_i_HeaderFile -#define VISU_Table_i_HeaderFile - -#include "VISU_PrsObject_i.hh" - -#include - -class SPlot2d_Curve; - -namespace VISU{ - //============================================================================== - class Table_i : public virtual POA_VISU::Table, - public virtual PrsObject_i - { - static int myNbPresent; - Table_i(); - Table_i( const Table_i& ); - public: - Table_i( SALOMEDS::Study_ptr theStudy, const char* theObject ); - virtual ~Table_i(); - virtual VISU::VISUType GetType() { return VISU::TTABLE;}; - - virtual void SetTitle( const char* theName ) { SetName( theName ); } - virtual char* GetTitle() { return CORBA::string_dup( GetName() ); } - - virtual void SetOrientation( VISU::Table::Orientation theOrientation ) { myOrientation = theOrientation; } - virtual VISU::Table::Orientation GetOrientation() { return myOrientation; } - - virtual CORBA::Long GetNbRows(); - virtual CORBA::Long GetNbColumns(); - - virtual void RemoveFromStudy(); - - protected: - Storable* Build(int theRestoring); - - protected: - VISU::Table::Orientation myOrientation; - std::string myTitle; - SALOMEDS::SObject_var mySObj; - - public: - virtual Storable* Create(); - SALOMEDS::SObject_var GetSObject() const { return mySObj;} - - virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO); - static Storable* Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); - virtual void ToStream( std::ostringstream& theStr ); - static const std::string myComment; - virtual const char* GetComment() const; - virtual const char* GenerateName(); - virtual const char* GetTableTitle(); - - virtual char* GetObjectEntry() { return CORBA::string_dup( mySObj->GetID() ); } - }; - SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy); - bool ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName); - //============================================================================== - class Curve_i : public virtual POA_VISU::Curve, - public virtual PrsObject_i - { - static int myNbPresent; - Curve_i(); - Curve_i( const Curve_i& ); - public: - Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::Long theHRow, CORBA::Long theVRow ); - virtual ~Curve_i(); - virtual VISU::VISUType GetType() { return VISU::TCURVE;}; - - virtual void SetTitle( const char* theName ) { SetName( theName ); } - virtual char* GetTitle() { return CORBA::string_dup( GetName() ); } - - virtual void SetColor( const SALOMEDS::Color& theColor ) { myColor = theColor; myAuto = false; } - virtual SALOMEDS::Color GetColor() { return myColor; } - - virtual void SetMarker( VISU::Curve::MarkerType theType ) { myMarker = theType; myAuto = false; } - virtual VISU::Curve::MarkerType GetMarker() { return myMarker; } - - virtual void SetLine( VISU::Curve::LineType theType, CORBA::Long theWidth ) - { myLine = theType; myLineWidth = theWidth; myAuto = false; } - virtual VISU::Curve::LineType GetLine() { return myLine; } - virtual CORBA::Long GetLineWidth() { return myLineWidth; } - - virtual void RemoveFromStudy(); - - virtual SALOMEDS::SObject_var GetSObject(); - - protected: - Storable* Build(int theRestoring); - - protected: - Table_i* myTable; - int myHRow; - int myVRow; - struct SALOMEDS::Color myColor; - VISU::Curve::MarkerType myMarker; - VISU::Curve::LineType myLine; - int myLineWidth; - std::string myTitle; - bool myAuto; - SALOMEDS::SObject_var mySObj; - - public: - virtual Storable* Create(); - - int GetHRow() const { return myHRow;} - int GetVRow() const { return myVRow;} - - virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO); - - static Storable* Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); - - virtual void ToStream( std::ostringstream& theStr ); - static const std::string myComment; - virtual const char* GetComment() const; - virtual const char* GenerateName(); - virtual const char* GetTableID(); - - virtual CORBA::Boolean IsAuto() { return myAuto; } - virtual CORBA::Boolean IsValid(); - virtual std::string GetHorTitle(); - virtual std::string GetVerTitle(); - virtual std::string GetHorUnits(); - virtual std::string GetVerUnits(); - virtual int GetData( double*& theHorList, double*& theVerList ); - - virtual SPlot2d_Curve* CreatePresentation(); - }; - - //============================================================================== - class Container_i : public virtual POA_VISU::Container, - public virtual PrsObject_i - { - static int myNbPresent; - Container_i(); - Container_i( const Container_i& ); - public: - Container_i(SALOMEDS::Study_ptr theStudy); - virtual ~Container_i(); - virtual VISU::VISUType GetType() { return VISU::TCONTAINER;}; - - virtual void AddCurve( Curve_ptr theCurve ); - virtual void RemoveCurve( Curve_ptr theCurve ); - - virtual CORBA::Long GetNbCurves(); - virtual void Clear(); - - virtual void RemoveFromStudy(); - - protected: - Storable* Build(int theRestoring); - - protected: - QStringList myCurves; - SALOMEDS::SObject_var mySObj; - - public: - virtual Storable* Create(); - virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO ); - - static Storable* Restore(SALOMEDS::SObject_ptr theSObject, - const std::string& thePrefix, - const Storable::TRestoringMap& theMap); - - virtual void ToStream( std::ostringstream& theStr ); - static const std::string myComment; - virtual const char* GetComment() const; - virtual const char* GenerateName(); - - void Update(); - VISU::Curve_i* GetCurve( CORBA::Long theIndex ); - - }; -} - -#endif diff --git a/src/VISU_I/VISU_TimeAnimation.h b/src/VISU_I/VISU_TimeAnimation.h deleted file mode 100644 index 26cc764c..00000000 --- a/src/VISU_I/VISU_TimeAnimation.h +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : VISU_TimeAnimation.h -// Author : Vitaly SMETANNIKOV -// Module : VISU - -#ifndef VISU_TIMEANIMATION_H -#define VISU_TIMEANIMATION_H - -#include "VISUConfig.hh" - -#include - -#include -#include -#include - -class SVTK_ViewWindow; -class VISU_Actor; - -namespace VISU{ - class Result_i; - class ScalarMap_i; -} - -struct FieldData -{ - VISU::VISUType myPrsType; - _PTR(SObject) myField; // field label - long myNbTimes; // number of Timestamps - long myNbFrames; // number of created Frames - std::vector myPrs; // Presentations - std::vector myActors; // Actors - std::vector myTiming; // time values - float myOffset[3]; -}; - - -class VISU_TimeAnimation: public QObject, public QThread -{ - Q_OBJECT; - public: - //static VISU::Result_i* createPresent (SALOMEDS::SObject_var theField); - //static VISU::Storable::TRestoringMap getMapOfValue (SALOMEDS::SObject_var theSObject); - //static double getTimeValue (SALOMEDS::SObject_var theTimestamp); - - static VISU::Result_i* createPresent (_PTR(SObject) theField); - static VISU::Storable::TRestoringMap getMapOfValue (_PTR(SObject) theSObject); - static double getTimeValue (_PTR(SObject) theTimestamp); - - VISU_TimeAnimation(_PTR(Study) theStudy, - VISU::View3D_ptr theView3D = VISU::View3D::_nil()); - ~VISU_TimeAnimation(); - - virtual VISU::VISUType GetType() { return VISU::TNONE;}; - - void addField (_PTR(SObject) theField); - void addField (SALOMEDS::SObject_ptr theField); - FieldData& getFieldData (int theNum) { return myFieldsLst[theNum]; } - - CORBA::Boolean generateFrames(); - void generatePresentations(CORBA::Long theFieldNum); - void setViewer(SVTK_ViewWindow* theView) { myView = theView; } - SVTK_ViewWindow* getViewer() { return myView; } - void clearView(); - void clearData(FieldData& theData); - - void stopAnimation(); - void startAnimation(); - void nextFrame(); - void prevFrame(); - void firstFrame(); - void lastFrame(); - void gotoFrame(CORBA::Long theFrame); - - CORBA::Long getNbFields() { return myFieldsLst.size(); } - CORBA::Long getNbFrames(); - CORBA::Boolean isRunning() { return myIsActive; } - CORBA::Long getCurrentFrame() { return myFrame; } - - VISU::ScalarMap_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame); - - void setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType) - { myFieldsLst[theFieldNum].myPrsType = theType; } - VISU::VISUType getPresentationType(CORBA::Long theFieldNum) - { return myFieldsLst[theFieldNum].myPrsType; } - - void setSpeed(CORBA::Long theSpeed); - CORBA::Long getSpeed() { return mySpeed; } - - CORBA::Boolean isProportional() { return myProportional; } - - void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax) - { myMaxVal = theMax; myMinVal = theMin; } - - CORBA::Double getMinRange() { return myMinVal; } - CORBA::Double getMaxRange() { return myMaxVal; } - CORBA::Boolean isRangeDefined() { return !((myMaxVal==0) && (myMinVal == myMaxVal)); } - - void dumpTo(const char* thePath) { myDumpPath = thePath; } - - QString getLastErrorMsg() { return myLastError; } - - CORBA::Boolean isCycling() { return myCycling; } - - CORBA::Double getMinTime() { return myTimeMin;} - CORBA::Double getMaxTime() { return myTimeMax;} - - void setProportional(CORBA::Boolean theProp) { myProportional = theProp; } - void setCycling(CORBA::Boolean theCycle) { myCycling = theCycle; } - - SALOMEDS::SObject_ptr publishInStudy(); - void restoreFromStudy(SALOMEDS::SObject_ptr theField); - void restoreFromStudy(_PTR(SObject) theField); - void saveAnimation(); - bool isSavedInStudy() const { return !myAnimEntry.isEmpty(); } - - public slots: - void setProportionalSlot(bool theProp) { myProportional = theProp; } - void setCyclingSlot(bool theCycle) { myCycling = theCycle; } - - signals: - void frameChanged(long theNewFrame, double theTime); - void stopped(); - - protected: - void run(); - QString GenerateName(); - - private: - QString myLastError; - - QValueList myFieldsLst; - bool myIsActive; - long myFrame; - int mySpeed; - bool myProportional; - bool myCycling; - _PTR(Study) myStudy; - - double myMaxVal, myMinVal; - double myTimeMin, myTimeMax; - QString myDumpPath; - SVTK_ViewWindow* myView; - - QString myAnimEntry; - - static int myNBAnimations; -}; - - -class VISU_TimeAnimation_i: public virtual POA_VISU::Animation, - public virtual VISU::Base_i -{ - VISU_TimeAnimation* myAnim; -public: - VISU_TimeAnimation_i(SALOMEDS::Study_ptr theStudy, - VISU::View3D_ptr theView3D = VISU::View3D::_nil()); - ~VISU_TimeAnimation_i(); - - virtual VISU::VISUType GetType() { return VISU::TANIMATION; } - //virtual VISU::VISUType GetType() { return VISU::TNONE; } - - virtual void addField(SALOMEDS::SObject_ptr theField); - - virtual CORBA::Boolean generateFrames(); - virtual void generatePresentations(CORBA::Long theFieldNum); - - virtual void clearView(); - - virtual void stopAnimation(); - virtual void startAnimation(); - virtual void nextFrame(); - virtual void prevFrame(); - virtual void firstFrame(); - virtual void lastFrame(); - virtual void gotoFrame(CORBA::Long theFrame); - - virtual CORBA::Long getNbFields(); - virtual CORBA::Long getNbFrames(); - virtual CORBA::Boolean isRunning(); - virtual CORBA::Long getCurrentFrame(); - - virtual VISU::ScalarMap_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame); - - virtual void setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType); - virtual VISU::VISUType getPresentationType(CORBA::Long theFieldNum); - - virtual void setSpeed(CORBA::Long theSpeed); - virtual CORBA::Long getSpeed(); - - virtual CORBA::Boolean isProportional(); - - virtual void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax); - - virtual CORBA::Double getMinRange(); - virtual CORBA::Double getMaxRange(); - virtual CORBA::Boolean isRangeDefined(); - - virtual void dumpTo(const char* thePath); - - virtual CORBA::Boolean isCycling(); - - virtual CORBA::Double getMinTime(); - virtual CORBA::Double getMaxTime(); - - virtual void setProportional(CORBA::Boolean theProp); - virtual void setCycling(CORBA::Boolean theCycle); - - virtual SALOMEDS::SObject_ptr publishInStudy(); - virtual void restoreFromStudy(SALOMEDS::SObject_ptr theField); - virtual CORBA::Boolean isSavedInStudy(); - virtual void saveAnimation(); -}; - -#endif //VISU_TIMEANIMATION_H diff --git a/src/VISU_I/VISU_ViewManager_i.hh b/src/VISU_I/VISU_ViewManager_i.hh deleted file mode 100644 index 5fa7284a..00000000 --- a/src/VISU_I/VISU_ViewManager_i.hh +++ /dev/null @@ -1,83 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_ViewManager_i.hh -// Author : Alexey PETROV -// Module : VISU - -#ifndef VISU_ViewManager_i_HeaderFile -#define VISU_ViewManager_i_HeaderFile - -#include "VISUConfig.hh" - -class SalomeApp_Application; - -class VISU_Actor; - -class SUIT_ViewWindow; - -class SVTK_ViewWindow; -class Plot2d_ViewFrame; - -class vtkRenderer; -class vtkCamera; - - -namespace VISU { - class Prs3d_i; - class Curve_i; - - class ViewManager_i : public virtual POA_VISU::ViewManager, - public virtual Base_i - { - public: - ViewManager_i(SALOMEDS::Study_ptr theStudy); - virtual ~ViewManager_i(); - virtual VISU::VISUType GetType() { return VISU::TVIEWMANAGER;}; - - virtual View3D_ptr Create3DView(); - virtual View_ptr GetCurrentView(); - virtual TableView_ptr CreateTableView(VISU::Table_ptr theTable); - virtual XYPlot_ptr CreateXYPlot(); - virtual void Destroy(View_ptr theView); - - protected: - SalomeApp_Application *myApplication; - }; - - SVTK_ViewWindow* GetViewWindow (SUIT_ViewWindow* theStudyFrame); - vtkRenderer* GetRenderer (SUIT_ViewWindow* theStudyFrame); - vtkCamera* GetCamera (SUIT_ViewWindow* theStudyFrame); - - void RepaintView (SUIT_ViewWindow* theStudyFrame); - - enum Displaing {eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll}; - VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs = NULL); - void UpdatePlot2d (Plot2d_ViewFrame *theView, int theDisplaying, Curve_i* theCurve); - - VISU_Actor* GetActor (VISU::Prs3d_i* thePrs, SVTK_ViewWindow* theViewWindow); - - void DeleteActors (VISU::Prs3d_i* thePrs); - void DeleteActors (VISU::Curve_i* thePrs); -} - -#endif diff --git a/src/VISU_SWIG/VISU_Gen_s.hh b/src/VISU_SWIG/VISU_Gen_s.hh deleted file mode 100644 index ecb0c3d0..00000000 --- a/src/VISU_SWIG/VISU_Gen_s.hh +++ /dev/null @@ -1,67 +0,0 @@ -// VISU OBJECT : interactive object for VISU entities implementation -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : VISU_Gen_s.hh -// Author : Alexey PETROV -// Module : VISU - -#ifndef __VISU_VISU_Gen_s_H__ -#define __VISU_VISU_Gen_s_H__ - -class VISU_Convertor; -class Convertor{ - VISU_Convertor* myConvertor; -public: - Convertor() : myConvertor(0) {}; - Convertor(const char* theFileName); - - VISU_Convertor* GetImpl(){ return myConvertor;} -}; - -class VISU_ScalarMapPL; -class ScalarMap{ - VISU_ScalarMapPL* myScalarMap; -public: - ScalarMap() : myScalarMap(0) {}; - ScalarMap(Convertor* theConvertor, const char* theMeshName, int theEntity, - const char* theFieldName, int theIteration); - - VISU_ScalarMapPL* GetImpl(){ return myScalarMap;} -}; - -class vtkRenderer; -class vtkRenderWindow; -class vtkRenderWindowInteractor; -class View3D{ - vtkRenderer *myRen; - vtkRenderWindow *myRenWin; - vtkRenderWindowInteractor *myIRen; -public: - View3D(); - ~View3D(); - - void SetPosition(int theX, int theY); - void Display(ScalarMap* theScalarMap); -}; - - -#endif diff --git a/src/VISU_SWIG/VISU_shared_modules.py b/src/VISU_SWIG/VISU_shared_modules.py deleted file mode 100644 index afd4231f..00000000 --- a/src/VISU_SWIG/VISU_shared_modules.py +++ /dev/null @@ -1,19 +0,0 @@ -""" - -""" - -# force VISU importation at interpretor initialization -# see salome_shared_modules.py -# (avoids incomplete import at run time) - -print "============== import VISU =======================" - -import VISU - -# this function is required - -def init_shared_modules(): - """ - This function initializes shared modules that need to be - """ - pass diff --git a/src/VISU_SWIG/batch_test_events.py b/src/VISU_SWIG/batch_test_events.py deleted file mode 100644 index df7f3c3c..00000000 --- a/src/VISU_SWIG/batch_test_events.py +++ /dev/null @@ -1,14 +0,0 @@ -############################################################### -# -# File : batch_test_events.py -# Description : Test postEvent() functionality for VISU module -# -############################################################### - -import batchmode_visu - -for i in range ( 10 ): - batchmode_visu.myVisu.CreateTestView() - for j in range ( 10 ): - batchmode_visu.myVisu.ShowTestObject(); - diff --git a/src/VISU_SWIG/batchmode_visu.py b/src/VISU_SWIG/batchmode_visu.py deleted file mode 100644 index 559a3eb4..00000000 --- a/src/VISU_SWIG/batchmode_visu.py +++ /dev/null @@ -1,76 +0,0 @@ -# VISU VISU_SWIG : binding of C++ implementation and Python -# -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : batchmode_visu.py -# Module : VISU - -from batchmode_salome import * -import visu - -myVisu = visu.Initialize(orb,naming_service,lcc,myStudyManager,myStudy,10) -if myVisu is None: - raise RuntimeError, "myVisu is none, VISU component is not loaded or found" - -def try_mesh_parameters(theMeshPattern): - aResult = [] - if theMeshPattern is None : return aResult ; - theMeshPattern = theMeshPattern._narrow(VISU.Mesh) - if theMeshPattern is None : return aResult ; - - aTYPES = [VISU.POINT, VISU.WIREFRAME, VISU.SHADED, VISU.INSIDEFRAME, VISU.SHRINK] - import copy; import os; - for ind in aTYPES: - aNewMesh = copy.deepcopy(theMeshPattern); - aNewMesh.SetPresentationType(ind) - aResult.append(aNewMesh) - - return aResult - -def try_scalarmap_parameters(thePattern, theNum): - aList = [] - if thePattern is None : return aList - thePattern = thePattern._narrow(VISU.ScalarMap) - if thePattern is None : return aList - SCALING = [VISU.LINEAR, VISU.LOGARITHMIC] - import copy - import random - for ind in range(0,theNum): - anObj = copy.deepcopy(thePattern); - if ind%2 : - #try incorrect value deliberately (but allowed by idl description) - #try SetScalarMode(long) - mode = random.randint(-100000,100000); #incorrect value deliberately - else: - #correct value of ScalarMode - mode = random.randint(0, 3) - - print "\tSetScalarMode(" + str(mode) +")" - anObj.SetScalarMode(mode) - - # --- SCALING --- - scal = random.randint(0,1) - print "\tSetScaling(" + str(SCALING[scal]) +")" - anObj.SetScaling(SCALING[scal]) - - # --- BOUNDARIES --- - if ind%2 : - alfa = random.random()*random.randint(-100000,100000) - betta = random.random()*random.randint(-100000,100000) - aMin = alfa; aMax = betta - else: - #more correct set - aPMin = thePattern.GetMin() - aPMax = thePattern.GetMax() - aLen = aPMax - aPMin - alfa = random.random()%0.5 - betta = random.random()%0.5 - aMin = alfa*aLen*random.randint(-1,1) + aPMin - aMax = betta*aLen*random.randint(-1,1) + aPMax - print "\tSetRange(" + str(aMin) + ", " + str(aMax) + ")" - anObj.SetRange(aMin, aMax) - aList.append(anObj) - - return aList diff --git a/src/VISU_SWIG/batchmode_visu_table.py b/src/VISU_SWIG/batchmode_visu_table.py deleted file mode 100644 index aca745d1..00000000 --- a/src/VISU_SWIG/batchmode_visu_table.py +++ /dev/null @@ -1,77 +0,0 @@ -# VISU VISU_SWIG : binding of C++ implementation and Python -# -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : visu_big_table.py -# Author : Vadim SANDLER -# Module : VISU -# $Header$ - -from batchmode_salome import * -import batchmode_visu -import SALOMEDS -import VISU -import math - -#-------------------------------------------------------------------------- -modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog") - -# >>> Getting study builder ================================================== -myBuilder = myStudy.NewBuilder() - -# >>> Getting (loading) VISU component ======================================= -myVisu = lcc.FindOrLoadComponent("FactoryServer", "VISU") -myComponent = myStudy.FindComponent("VISU") -myVisu.SetCurrentStudy(myStudy) -if not myComponent: - myComponent = myBuilder.NewComponent("VISU") - aName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName") - #aName.SetValue("Visu") - Comp = modulecatalog.GetComponent( "VISU" ) - aName.SetValue( Comp._get_componentusername() ) - - A2 = myBuilder.FindOrCreateAttribute(myComponent, "AttributePixMap"); - aPixmap = A2._narrow(SALOMEDS.AttributePixMap); - aPixmap.SetPixMap( "ICON_OBJBROWSER_Visu" ); - - myBuilder.DefineComponentInstance(myComponent,myVisu) - -# >>> Creating object with Table of real[ 200 * 20 ] ======================== -myTRealObject = myBuilder.NewObject(myComponent) -AName = myBuilder.FindOrCreateAttribute(myTRealObject, "AttributeName") -AName.SetValue("Table Of Real") -ARealTable = myBuilder.FindOrCreateAttribute(myTRealObject, "AttributeTableOfReal") -myHorNb = 10 -myVerNb = 200 - -k={} -for j in range(0,myHorNb): - k[j] = j*10+1 -ARealTable.AddRow(k.values()) -ARealTable.SetRowTitle(1, "Frequency") -ARealTable.SetRowUnit(1, "Hz") - -for i in range(1,myVerNb+1): - for j in range(0,myHorNb): - if j % 2 == 1: - k[j] = math.log10(j*30*math.pi/180) * 20 + i * 15 + j*5 - else: - k[j] = math.sin(j*30*math.pi/180) * 20 + i * 15 + j*5 - ARealTable.AddRow(k.values()) - ARealTable.SetRowTitle(i+1, "Power " + str(i)) - ARealTable.SetRowUnit(i+1, "Wt") -ARealTable.SetTitle("Very useful data") - -# >>> Create Visu table -myVisuTableReal = myVisu.CreateTable( myTRealObject.GetID() ) - -# >>> Create container and insert curves -myContainer = myVisu.CreateContainer() - -# >>> Create curves -for i in range(1,myVerNb+1): - myCurve = myVisu.CreateCurve( myVisuTableReal, 1, i+1 ) - myContainer.AddCurve(myCurve) -# ============================================================================ diff --git a/src/VISU_SWIG/batchmode_visu_view.py b/src/VISU_SWIG/batchmode_visu_view.py deleted file mode 100644 index 4bc74a8b..00000000 --- a/src/VISU_SWIG/batchmode_visu_view.py +++ /dev/null @@ -1,57 +0,0 @@ -# VISU VISU_SWIG : binding of C++ implementation and Python -# -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : test_table.py -# Author : Alexey Petrov -# Module : VISU -# $Header: - -from VISU import * -from batchmode_visu_table import * - -myViewMan = myVisu.GetViewManager() - -myTable = myViewMan.CreateTableView(myVisuTableReal) -myTitle = myTable.GetTitle() -myTable.SetTitle('Changed Title') - -myPlot = myViewMan.CreateXYPlot() -myTitle = myPlot.GetTitle() -myPlot.SetTitle('Change the title from python') - -mySubTitle = myPlot.GetSubTitle() -myPlot.SetSubTitle(myTitle) - -myXTitle = myPlot.GetXTitle() -myYTitle = myPlot.GetYTitle() -myPlot.SetXTitle(myYTitle) -myPlot.SetYTitle(myXTitle) - -myPlot.GetMarkerSize() -myPlot.SetMarkerSize(20) -myPlot.GetMarkerSize() -myPlot.ShowLegend(0) - -myPlot.SetCurveType(VISU.XYPlot.POINTS) -myPlot.SetCurveType(VISU.XYPlot.MULTYLINE) -myPlot.GetCurveType() -myPlot.SetCurveType(VISU.XYPlot.SPLINE) - -myPlot.SetHorScaling(VISU.LOGARITHMIC) -myPlot.EnableXGrid(1,3,1,4) -myPlot.SetHorScaling(VISU.LINEAR) -myPlot.EnableXGrid(1,10,1,10) -myPlot.GetHorScaling() - -myPlot.SetVerScaling(VISU.LOGARITHMIC) -myPlot.GetVerScaling() -myPlot.EnableYGrid(1,2,1,10) - -myPlot.ShowLegend(1) -myPlot.SetMarkerSize(5) -myPlot.GetMarkerSize() - -myPlot.Display(myContainer) diff --git a/src/VISU_SWIG/libVISU_Swig.i b/src/VISU_SWIG/libVISU_Swig.i deleted file mode 100644 index 1f9a4de7..00000000 --- a/src/VISU_SWIG/libVISU_Swig.i +++ /dev/null @@ -1,54 +0,0 @@ -// VISU VISU_SWIG : binding of C++ implementation and Python -// -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : libVISU_Swig.i -// Author : Paul RASCLE, EDF -// Module : VISU -// $Header$ - -%module libVISU_Swig -%{ -#include "VISU_Gen_s.hh" -%} - - -class Convertor{ -public: - Convertor(){}; - Convertor(const char* theFileName); -}; - - -class ScalarMap{ -public: - ScalarMap(){}; - ScalarMap(Convertor* theConvertor, const char* theMeshName, int theEntity, - const char* theFieldName, int theIteration); -}; - -class View3D{ -public: - View3D(); - void Display(ScalarMap* theScalarMap); - void SetPosition(int theX, int theY); -}; \ No newline at end of file diff --git a/src/VISU_SWIG/test_events.py b/src/VISU_SWIG/test_events.py deleted file mode 100755 index df53a3e8..00000000 --- a/src/VISU_SWIG/test_events.py +++ /dev/null @@ -1,14 +0,0 @@ -############################################################### -# -# File : test_events.py -# Description : Test postEvent() functionality for VISU module -# This script can be run from GUI Python console only! -############################################################### - -from visu_gui import * - -for i in range ( 10 ): - myVisu.CreateTestView() - for j in range ( 10 ): - myVisu.ShowTestObject(); - diff --git a/src/VISU_SWIG/visu_big_table.py b/src/VISU_SWIG/visu_big_table.py deleted file mode 100644 index fb90b2d6..00000000 --- a/src/VISU_SWIG/visu_big_table.py +++ /dev/null @@ -1,77 +0,0 @@ -# VISU VISU_SWIG : binding of C++ implementation and Python -# -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : visu_big_table.py -# Author : Vadim SANDLER -# Module : VISU -# $Header$ - -import salome -import math -import SALOMEDS -import VISU - -# >>> Getting study builder ================================================== -myStudy = salome.myStudy -myBuilder = myStudy.NewBuilder() - -# >>> Getting (loading) VISU component ======================================= -myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU") -myComponent = myStudy.FindComponent("VISU") -myVisu.SetCurrentStudy(myStudy) -if not myComponent: - myComponent = myBuilder.NewComponent("VISU") - aName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName") - #aName.SetValue("Visu") - aName.SetValue( salome.sg.getComponentUserName("VISU") ) - - A2 = myBuilder.FindOrCreateAttribute(myComponent, "AttributePixMap"); - aPixmap = A2._narrow(SALOMEDS.AttributePixMap); - aPixmap.SetPixMap( "ICON_OBJBROWSER_Visu" ); - - myBuilder.DefineComponentInstance(myComponent,myVisu) - -# >>> Creating object with Table of real[ 200 * 20 ] ======================== -myTRealObject = myBuilder.NewObject(myComponent) -AName = myBuilder.FindOrCreateAttribute(myTRealObject, "AttributeName") -AName.SetValue("Table Of Real") -ARealTable = myBuilder.FindOrCreateAttribute(myTRealObject, "AttributeTableOfReal") -myHorNb = 10 -myVerNb = 200 - -k={} -for j in range(0,myHorNb): - k[j] = j*10+1 -ARealTable.AddRow(k.values()) -ARealTable.SetRowTitle(1, "Frequency") -ARealTable.SetRowUnit(1, "Hz") - -for i in range(1,myVerNb+1): - for j in range(0,myHorNb): - if j % 2 == 1: - k[j] = math.log10(j*30*math.pi/180) * 20 + i * 15 + j*5 - else: - k[j] = math.sin(j*30*math.pi/180) * 20 + i * 15 + j*5 - ARealTable.AddRow(k.values()) - ARealTable.SetRowTitle(i+1, "Power " + str(i)) - ARealTable.SetRowUnit(i+1, "Wt") -ARealTable.SetTitle("Very useful data") - -# >>> Create Visu table -myVisuTableReal = myVisu.CreateTable( myTRealObject.GetID() ) - -# >>> Create container and insert curves -myContainer = myVisu.CreateContainer() - -# >>> Create curves -for i in range(1,myVerNb+1): - myCurve = myVisu.CreateCurve( myVisuTableReal, 1, i+1 ) - myContainer.AddCurve(myCurve) - -# >>> Updating Object Browser ================================================ -salome.sg.updateObjBrowser(1) - -# ============================================================================ diff --git a/src/VISU_SWIG/visu_gui.py b/src/VISU_SWIG/visu_gui.py deleted file mode 100644 index d21a239f..00000000 --- a/src/VISU_SWIG/visu_gui.py +++ /dev/null @@ -1,23 +0,0 @@ -# VISU VISU_SWIG : binding of C++ implementation and Python -# -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : visu_gui.py -# Module : VISU - -import sys -import os - -import SALOMEDS -import SALOME -import SALOME_MED -import VISU - -from salome import * -import visu - -myVisu = visu.Initialize(orb, naming_service,lcc,myStudyManager,myStudy, 2) -if myVisu is None: - raise RuntimeError, "myVisu is none, VISU component is not loaded or found" diff --git a/src/VISU_SWIG/visu_split_views.py b/src/VISU_SWIG/visu_split_views.py deleted file mode 100644 index 545ed7a3..00000000 --- a/src/VISU_SWIG/visu_split_views.py +++ /dev/null @@ -1,129 +0,0 @@ - -import VISU -import SALOMEDS -from visu_gui import * - -myViewManager = myVisu.GetViewManager() - -################################################ - -myView1 = myViewManager.Create3DView() -myView1.SetTitle("The window will be soon destroyed!") -print "myView1 = myViewManager.Create3DView()" - -myView1.Maximize() -print "myView1.Maximize()" - -myView1.Restore() -print "myView1.Restore()" - -myView1.Minimize() -print "myView1.Minimize()" - -myViewManager.Destroy(myView1) -print "myViewManager.Destroy(myView1)" - -################################################ - -myView2 = myViewManager.Create3DView() -print "myView2 = myViewManager.Create3DView()" -myView2.SetTitle("myView2") - -aColor = SALOMEDS.Color(0.0,0.3,1.0) -myView2.SetBackground(aColor) -print "aColor = SALOMEDS.Color(0.0,0.3,1.0)" -print "myView2.SetBackground(aColor)" - -myView2.SetFocalPoint([0,0,0]) -print "myView2.SetFocalPoint([0,0,0])" -myView2.SetParallelScale(2) -print "myView2.SetParallelScale(2)" - -################################################ - -myView3 = myViewManager.Create3DView() -print "myView3 = myViewManager.Create3DView()" -myView3.SetTitle("myView3") - -myView3.SplitRight() -print "myView3.SplitRight()" - -aColor = SALOMEDS.Color(0.0,0.7,0.0) -print "aColor = SALOMEDS.Color(0.0,0.7,0.0)" -myView3.SetBackground(aColor) -print "myView3.SetBackground(aColor)" - -aPoint = myView3.GetPointOfView() -aPoint[0] = aPoint[0] + 10 -myView3.SetPointOfView(aPoint) -print "myView3.SetPointOfView(...)" -myView3.ScaleView(VISU.View3D.YAxis,10.0) -myView3.ScaleView(VISU.View3D.XAxis,3.0) -print "myView3.ScaleView(...)" - -myView3.FitAll() - -myView3.SaveViewParams('AAA') -print "myView3.SaveViewParams('AAA')" - -myView3.RemoveScale() -print "myView3.RemoveScale()" - -myView3.Update() -print "myView3.Update()" -myView3.FitAll() -print "myView3.FitAll()" - -################################################ - -myView4 = myViewManager.Create3DView() -print "myView4 = myViewManager.Create3DView()" -myView4.SetTitle("myView4") - -aColor = SALOMEDS.Color(1.0,0.7,0.0) -print "aColor = SALOMEDS.Color(1.0,0.7,0.0)" -myView4.SetBackground(aColor) -print "myView4.SetBackground(aColor)" - -################################################ - -myView5 = myViewManager.Create3DView() -print "myView5 = myViewManager.Create3DView()" -myView5.SetTitle("myView5") - -myView5.SplitTop() -print "myView5.SplitTop()" - -aColor = SALOMEDS.Color(0.7,0.7,0.7) -print "aColor = SALOMEDS.Color(0.7,0.7,0.7)" -myView5.SetBackground(aColor) -print "myView5.SetBackground(aColor)" - -################################################ - -myView6 = myViewManager.CreateXYPlot() -print "myView6 = myViewManager.CreateXYPlot()" -myView6.SetTitle("myView6") - -################################################ - -myView7 = myViewManager.Create3DView() -print "myView7 = myViewManager.Create3DView()" -myView7.SetTitle("myView7") - -################################################ - -myView6.OnTop() -print "myView6.OnTop()" - -myView4.Attract(myView2) -print "myView4.Attract(myView2)" - -myView4.SetRelativePositionInSplitter(0.7) -print "myView4.SetRelativePositionInSplitter(0.7)" - -myView4.SetRelativePositionX(0.2) -print "myView4.SetRelativePositionX(0.7)" - -#myView4.SetRelativePositionY(0.2) -#print "myView4.SetRelativePositionY(0.2)" diff --git a/src/VISU_SWIG/visu_table.py b/src/VISU_SWIG/visu_table.py deleted file mode 100644 index 780e698c..00000000 --- a/src/VISU_SWIG/visu_table.py +++ /dev/null @@ -1,163 +0,0 @@ -# VISU VISU_SWIG : binding of C++ implementation and Python -# -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : visu_table.py -# Author : Vadim SANDLER -# Module : VISU -# $Header$ - -import salome -import math -import SALOMEDS -import VISU - -# >>> Getting study builder ================================================== -myStudy = salome.myStudy -myBuilder = myStudy.NewBuilder() - -# >>> Getting (loading) VISU component ======================================= -myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU") -myComponent = myStudy.FindComponent("VISU") -myVisu.SetCurrentStudy(myStudy) -if not myComponent: - myComponent = myBuilder.NewComponent("VISU") - aName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName") - #aName.SetValue("Visu") - aName.SetValue( salome.sg.getComponentUserName("VISU") ) - - A2 = myBuilder.FindOrCreateAttribute(myComponent, "AttributePixMap"); - aPixmap = A2._narrow(SALOMEDS.AttributePixMap); - aPixmap.SetPixMap( "ICON_OBJBROWSER_Visu" ); - - myBuilder.DefineComponentInstance(myComponent,myVisu) - -# >>> Creating object with Table of integer ================================== -myTIntObject = myBuilder.NewObject(myComponent) -AName = myBuilder.FindOrCreateAttribute(myTIntObject, "AttributeName") -AName.SetValue("Table Of Integer") -AIntTable = myBuilder.FindOrCreateAttribute(myTIntObject, "AttributeTableOfInteger") - -a=[1,2,3,4,5,6,7,8,9,10] -AIntTable.AddRow(a) -a=[110,120,130,140,150,160,170,180,190,200] -AIntTable.AddRow(a) -a=[-1,272,0,0,-642,10000,13,578,-578,99] -AIntTable.AddRow(a) -AIntTable.SetTitle("TEST table of integer") -AIntTable.SetRowTitle(1,"FR") -AIntTable.SetRowUnit(1,"m/h") -AIntTable.SetRowTitle(2,"SR") -AIntTable.SetRowUnit(2,"s") -AIntTable.SetRowTitle(3,"TR") -AIntTable.SetRowUnit(3,"$") -c=["C1","C2","C3","C4","C5","C6","C7","C8","C9","C10"] -AIntTable.SetColumnTitles(c) - -# >>> Creating object with Table of real ===================================== -myTRealObject = myBuilder.NewObject(myComponent) -AName = myBuilder.FindOrCreateAttribute(myTRealObject, "AttributeName") -AName.SetValue("Table Of Real") -ARealTable = myBuilder.FindOrCreateAttribute(myTRealObject, "AttributeTableOfReal") - -k={} -l={} -for j in range(0,20): - k[j] = j*10+1 - l[j] = "C"+str(j+1) -ARealTable.AddRow(k.values()) -ARealTable.SetRowTitle(1, "Row 0") -ARealTable.SetRowUnit(1, "Hz") -ARealTable.SetColumnTitles(l.values()) -for i in range(1,11): - for j in range(1,21): - if j % 2 == 1: - k[j] = math.log10(j*30*math.pi/180) * 20 + i * 15 + j*5 - else: - k[j] = math.sin(j*30*math.pi/180) * 20 + i * 15 + j*5 - ARealTable.AddRow(k.values()) - ARealTable.SetRowTitle(i+1, "Row " + str(i)) - ARealTable.SetRowUnit(i+1, "Wt") -ARealTable.SetTitle("TEST table of real") - -# >>> Creating object with integer attribute ================================= -myIntObject = myBuilder.NewObject(myComponent) -AName = myBuilder.FindOrCreateAttribute(myIntObject, "AttributeName") -AName.SetValue("Integer") -AInt = myBuilder.FindOrCreateAttribute(myIntObject, "AttributeInteger") -AInt.SetValue(123) - -# >>> Creating object with real attribute ==================================== -myRealObject = myBuilder.NewObject(myComponent) -AName = myBuilder.FindOrCreateAttribute(myRealObject, "AttributeName") -AName.SetValue("Real") -AReal = myBuilder.FindOrCreateAttribute(myRealObject, "AttributeReal") -AReal.SetValue(-56.9634) - -# >>> Creating object with comment attribute ================================= -myCmtObject = myBuilder.NewObject(myComponent) -AName = myBuilder.FindOrCreateAttribute(myCmtObject, "AttributeName") -AName.SetValue("Comment") -ACmt = myBuilder.FindOrCreateAttribute(myCmtObject, "AttributeComment") -ACmt.SetValue("Just a comment") - -# >>> Create VISU presentable objects ======================================== -# >>> Create table of real -myVisuTableReal = myVisu.CreateTable( myTRealObject.GetID() ) - -# >>> Create curves -myCurve1 = myVisu.CreateCurve( myVisuTableReal, 1, 2 ) -myCurve2 = myVisu.CreateCurve( myVisuTableReal, 1, 3 ) -myCurve3 = myVisu.CreateCurve( myVisuTableReal, 1, 4 ) -myCurve4 = myVisu.CreateCurve( myVisuTableReal, 1, 6 ) -myCurve5 = myVisu.CreateCurve( myVisuTableReal, 1, 8 ) -myCurve6 = myVisu.CreateCurve( myVisuTableReal, 1, 11 ) - -# >>> Set curve parameters -myCurve4.SetMarker( VISU.Curve.RECTANGLE ) -myCurve4.SetLine( VISU.Curve.DASHLINE, 3 ) -myCurve4.SetColor( SALOMEDS.Color(0, 0.7, 0.3) ) -myCurve6.SetMarker( VISU.Curve.LTRIANGLE ) -myCurve6.SetLine( VISU.Curve.DOTLINE, 2 ) -myCurve6.SetColor( SALOMEDS.Color(0.2, 0.2, 0.9) ) - -# >>> Create container and insert curves -myContainer1 = myVisu.CreateContainer() -myContainer1.AddCurve(myCurve1) -myContainer1.AddCurve(myCurve2) -myContainer1.AddCurve(myCurve3) -myContainer1.AddCurve(myCurve4) -myContainer1.AddCurve(myCurve5) -myContainer1.AddCurve(myCurve6) - -# >>> Create container and insert curves -myContainer2 = myVisu.CreateContainer() -myContainer2.AddCurve(myCurve4) - -# >>> Create table of integer -myVisuTableInt = myVisu.CreateTable( myTIntObject.GetID() ) - -# >>> Create curves -myCurve101 = myVisu.CreateCurve( myVisuTableInt, 1, 1 ) -myCurve102 = myVisu.CreateCurve( myVisuTableInt, 1, 3 ) - -# >>> Set curve parameters -myCurve101.SetMarker( VISU.Curve.RECTANGLE ) -myCurve101.SetLine( VISU.Curve.DASHLINE, 3 ) -myCurve101.SetColor( SALOMEDS.Color(0, 0.7, 0.3) ) -myCurve101.SetTitle( "Very useful data" ) - -# >>> Create container and insert curves -myContainer3 = myVisu.CreateContainer() -myContainer3.AddCurve(myCurve101) -myContainer3.AddCurve(myCurve102) - -# >>> Updating Object Browser ================================================ -salome.sg.updateObjBrowser(1) - -# ============================================================================ - - - diff --git a/src/VISU_SWIG/visu_view.py b/src/VISU_SWIG/visu_view.py deleted file mode 100644 index d301e592..00000000 --- a/src/VISU_SWIG/visu_view.py +++ /dev/null @@ -1,62 +0,0 @@ -# VISU VISU_SWIG : binding of C++ implementation and Python -# -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : test_table.py -# Author : Alexey Petrov -# Module : VISU -# $Header: - -import SALOMEDS -import VISU - -import salome -import SALOMEDS -from VISU import * - -from visu_table import * - -myViewMan = myVisu.GetViewManager() - -myTable = myViewMan.CreateTableView(myVisuTableReal) -myTitle = myTable.GetTitle() -myTable.SetTitle('Changed Title') - -myPlot = myViewMan.CreateXYPlot() -myTitle = myPlot.GetTitle() -myPlot.SetTitle('Change the title from python') - -mySubTitle = myPlot.GetSubTitle() -myPlot.SetSubTitle(myTitle) - -myXTitle = myPlot.GetXTitle() -myYTitle = myPlot.GetYTitle() -myPlot.SetXTitle(myYTitle) -myPlot.SetYTitle(myXTitle) - -myPlot.GetMarkerSize() -myPlot.SetMarkerSize(20) -myPlot.GetMarkerSize() -myPlot.ShowLegend(0) - -myPlot.SetCurveType(VISU.XYPlot.POINTS) -myPlot.SetCurveType(VISU.XYPlot.MULTYLINE) -myPlot.GetCurveType() -myPlot.SetCurveType(VISU.XYPlot.SPLINE) - -myPlot.SetHorScaling(VISU.LOGARITHMIC) -myPlot.EnableXGrid(1,3,1,4) -myPlot.SetHorScaling(VISU.LINEAR) -myPlot.EnableXGrid(1,10,1,10) -myPlot.GetHorScaling() - -myPlot.SetVerScaling(VISU.LOGARITHMIC) -myPlot.GetVerScaling() -myPlot.EnableYGrid(1,2,1,10) - -myPlot.ShowLegend(1) -myPlot.SetMarkerSize(5) -myPlot.GetMarkerSize() -