From a1884d435d319c921f54b7a174199003ae7eb1e1 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 15 Jul 2008 07:41:39 +0000 Subject: [PATCH] This commit was generated by cvs2git to create tag 'V4_1_0rc1'. Sprout from BR_Dev_For_4_0 2007-11-07 11:52:10 UTC maintenance team 'Common update' Cherrypick from V4_1_0_maintainance 2008-07-15 07:41:38 UTC rnv 'Fix for issue 0019937: EDF 790 VISU : ScalarMapondeformed of ELNO field.': doc/salome/gui/VISU/images/table.png doc/salome/gui/VISU/images/table3d.png doc/salome/gui/VISU/images/tablesn1.png doc/salome/gui/VISU/images/tablesn2.png doc/salome/gui/VISU/input/table_3d.doc src/CONVERTOR/VISU_ElnoMeshValue.hxx src/CONVERTOR/VISU_TableReader.cxx src/CONVERTOR/VISU_TableReader.hxx src/CONVERTOR/VISU_VTKTypeList.hxx src/OBJECT/VISU_ActorBase.cxx src/OBJECT/VISU_ActorBase.h src/OBJECT/VISU_IsoSurfActor.cxx src/OBJECT/VISU_IsoSurfActor.h src/OBJECT/VISU_PointMap3dActor.cxx src/OBJECT/VISU_PointMap3dActor.h src/PIPELINE/VISU_DeformationPL.cxx src/PIPELINE/VISU_DeformationPL.hxx src/PIPELINE/VISU_DeformedGridPL.cxx src/PIPELINE/VISU_DeformedGridPL.hxx src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx src/PIPELINE/VISU_ElnoAssembleFilter.cxx src/PIPELINE/VISU_ElnoAssembleFilter.hxx src/PIPELINE/VISU_ElnoDisassembleFilter.cxx src/PIPELINE/VISU_ElnoDisassembleFilter.hxx src/PIPELINE/VISU_LabelPointsFilter.cxx src/PIPELINE/VISU_LabelPointsFilter.hxx src/PIPELINE/VISU_MergedPL.cxx src/PIPELINE/VISU_MergedPL.hxx src/PIPELINE/VISU_OptionalDeformationPL.cxx src/PIPELINE/VISU_OptionalDeformationPL.hxx src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h src/VISUGUI/VisuGUI_FileInfoDlg.cxx src/VISUGUI/VisuGUI_FileInfoDlg.h src/VISUGUI/VisuGUI_Table3dDlg.cxx src/VISUGUI/VisuGUI_Table3dDlg.h src/VISU_I/VISU_Deformation_i.cc src/VISU_I/VISU_Deformation_i.hh src/VISU_I/VISU_DeformedShapeAndScalarMap_i.cc src/VISU_I/VISU_DeformedShapeAndScalarMap_i.hh src/VISU_I/VISU_MonoColorPrs_i.cc src/VISU_I/VISU_MonoColorPrs_i.hh src/VISU_I/VISU_OptionalDeformation_i.cc src/VISU_I/VISU_OptionalDeformation_i.hh src/VISU_I/VISU_PointMap3d_i.cc src/VISU_I/VISU_PointMap3d_i.hh src/VISU_SWIG/visu_pointmap3d.py Cherrypick from master 2008-03-07 07:46:09 UTC jfa 'Join modifications from BR_Dev_For_4_0 tag V4_1_1.': doc/salome/gui/VISU/images/barproperty.png src/CONVERTOR/VISU_GaussMergeFilter.cxx src/CONVERTOR/VISU_GaussMergeFilter.hxx --- doc/salome/gui/VISU/images/barproperty.png | Bin 0 -> 14083 bytes doc/salome/gui/VISU/images/table.png | Bin 0 -> 9959 bytes doc/salome/gui/VISU/images/table3d.png | Bin 0 -> 21142 bytes doc/salome/gui/VISU/images/tablesn1.png | Bin 0 -> 6494 bytes doc/salome/gui/VISU/images/tablesn2.png | Bin 0 -> 12113 bytes doc/salome/gui/VISU/input/table_3d.doc | 49 + src/CONVERTOR/VISU_ElnoMeshValue.hxx | 162 +++ src/CONVERTOR/VISU_GaussMergeFilter.cxx | 386 +++++ src/CONVERTOR/VISU_GaussMergeFilter.hxx | 138 ++ src/CONVERTOR/VISU_TableReader.cxx | 400 ++++++ src/CONVERTOR/VISU_TableReader.hxx | 110 ++ src/CONVERTOR/VISU_VTKTypeList.hxx | 120 ++ src/OBJECT/VISU_ActorBase.cxx | 166 +++ src/OBJECT/VISU_ActorBase.h | 93 ++ src/OBJECT/VISU_IsoSurfActor.cxx | 165 +++ src/OBJECT/VISU_IsoSurfActor.h | 88 ++ src/OBJECT/VISU_PointMap3dActor.cxx | 147 ++ src/OBJECT/VISU_PointMap3dActor.h | 95 ++ src/PIPELINE/VISU_DeformationPL.cxx | 163 +++ src/PIPELINE/VISU_DeformationPL.hxx | 87 ++ src/PIPELINE/VISU_DeformedGridPL.cxx | 238 +++ src/PIPELINE/VISU_DeformedGridPL.hxx | 117 ++ .../VISU_DeformedShapeAndScalarMapPL.cxx | 372 +++++ .../VISU_DeformedShapeAndScalarMapPL.hxx | 149 ++ src/PIPELINE/VISU_ElnoAssembleFilter.cxx | 171 +++ src/PIPELINE/VISU_ElnoAssembleFilter.hxx | 47 + src/PIPELINE/VISU_ElnoDisassembleFilter.cxx | 400 ++++++ src/PIPELINE/VISU_ElnoDisassembleFilter.hxx | 48 + src/PIPELINE/VISU_LabelPointsFilter.cxx | 296 ++++ src/PIPELINE/VISU_LabelPointsFilter.hxx | 76 + src/PIPELINE/VISU_MergedPL.cxx | 51 + src/PIPELINE/VISU_MergedPL.hxx | 75 + src/PIPELINE/VISU_OptionalDeformationPL.cxx | 101 ++ src/PIPELINE/VISU_OptionalDeformationPL.hxx | 59 + .../VisuGUI_DeformedShapeAndScalarMapDlg.cxx | 478 ++++++ .../VisuGUI_DeformedShapeAndScalarMapDlg.h | 122 ++ src/VISUGUI/VisuGUI_FileInfoDlg.cxx | 79 + src/VISUGUI/VisuGUI_FileInfoDlg.h | 44 + src/VISUGUI/VisuGUI_Table3dDlg.cxx | 840 +++++++++++ src/VISUGUI/VisuGUI_Table3dDlg.h | 187 +++ src/VISU_I/VISU_Deformation_i.cc | 166 +++ src/VISU_I/VISU_Deformation_i.hh | 103 ++ .../VISU_DeformedShapeAndScalarMap_i.cc | 404 ++++++ .../VISU_DeformedShapeAndScalarMap_i.hh | 179 +++ src/VISU_I/VISU_MonoColorPrs_i.cc | 186 +++ src/VISU_I/VISU_MonoColorPrs_i.hh | 83 ++ src/VISU_I/VISU_OptionalDeformation_i.cc | 110 ++ src/VISU_I/VISU_OptionalDeformation_i.hh | 76 + src/VISU_I/VISU_PointMap3d_i.cc | 1277 +++++++++++++++++ src/VISU_I/VISU_PointMap3d_i.hh | 274 ++++ src/VISU_SWIG/visu_pointmap3d.py | 57 + 51 files changed, 9234 insertions(+) create mode 100644 doc/salome/gui/VISU/images/barproperty.png create mode 100644 doc/salome/gui/VISU/images/table.png create mode 100644 doc/salome/gui/VISU/images/table3d.png create mode 100644 doc/salome/gui/VISU/images/tablesn1.png create mode 100644 doc/salome/gui/VISU/images/tablesn2.png create mode 100644 doc/salome/gui/VISU/input/table_3d.doc create mode 100644 src/CONVERTOR/VISU_ElnoMeshValue.hxx create mode 100644 src/CONVERTOR/VISU_GaussMergeFilter.cxx create mode 100644 src/CONVERTOR/VISU_GaussMergeFilter.hxx create mode 100644 src/CONVERTOR/VISU_TableReader.cxx create mode 100644 src/CONVERTOR/VISU_TableReader.hxx create mode 100644 src/CONVERTOR/VISU_VTKTypeList.hxx create mode 100644 src/OBJECT/VISU_ActorBase.cxx create mode 100644 src/OBJECT/VISU_ActorBase.h create mode 100644 src/OBJECT/VISU_IsoSurfActor.cxx create mode 100644 src/OBJECT/VISU_IsoSurfActor.h create mode 100644 src/OBJECT/VISU_PointMap3dActor.cxx create mode 100644 src/OBJECT/VISU_PointMap3dActor.h create mode 100755 src/PIPELINE/VISU_DeformationPL.cxx create mode 100755 src/PIPELINE/VISU_DeformationPL.hxx create mode 100644 src/PIPELINE/VISU_DeformedGridPL.cxx create mode 100644 src/PIPELINE/VISU_DeformedGridPL.hxx create mode 100644 src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx create mode 100644 src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx create mode 100644 src/PIPELINE/VISU_ElnoAssembleFilter.cxx create mode 100644 src/PIPELINE/VISU_ElnoAssembleFilter.hxx create mode 100644 src/PIPELINE/VISU_ElnoDisassembleFilter.cxx create mode 100644 src/PIPELINE/VISU_ElnoDisassembleFilter.hxx create mode 100644 src/PIPELINE/VISU_LabelPointsFilter.cxx create mode 100644 src/PIPELINE/VISU_LabelPointsFilter.hxx create mode 100644 src/PIPELINE/VISU_MergedPL.cxx create mode 100644 src/PIPELINE/VISU_MergedPL.hxx create mode 100755 src/PIPELINE/VISU_OptionalDeformationPL.cxx create mode 100755 src/PIPELINE/VISU_OptionalDeformationPL.hxx create mode 100644 src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx create mode 100644 src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h create mode 100644 src/VISUGUI/VisuGUI_FileInfoDlg.cxx create mode 100644 src/VISUGUI/VisuGUI_FileInfoDlg.h create mode 100644 src/VISUGUI/VisuGUI_Table3dDlg.cxx create mode 100644 src/VISUGUI/VisuGUI_Table3dDlg.h create mode 100755 src/VISU_I/VISU_Deformation_i.cc create mode 100755 src/VISU_I/VISU_Deformation_i.hh create mode 100644 src/VISU_I/VISU_DeformedShapeAndScalarMap_i.cc create mode 100644 src/VISU_I/VISU_DeformedShapeAndScalarMap_i.hh create mode 100644 src/VISU_I/VISU_MonoColorPrs_i.cc create mode 100644 src/VISU_I/VISU_MonoColorPrs_i.hh create mode 100755 src/VISU_I/VISU_OptionalDeformation_i.cc create mode 100755 src/VISU_I/VISU_OptionalDeformation_i.hh create mode 100644 src/VISU_I/VISU_PointMap3d_i.cc create mode 100644 src/VISU_I/VISU_PointMap3d_i.hh create mode 100755 src/VISU_SWIG/visu_pointmap3d.py diff --git a/doc/salome/gui/VISU/images/barproperty.png b/doc/salome/gui/VISU/images/barproperty.png new file mode 100644 index 0000000000000000000000000000000000000000..6bc74cec101b76e103f39ca67dec2d8ec54ead45 GIT binary patch literal 14083 zcmcJ0by!qg+wZ6-64E8@fOJZWfDew8BGL`g4blxNf*>U#EueHGT@I*#NH<6eIHYv< zxq03=-#O>~zW>g;F2`Zd?7i1s>t6RS?lmEgAIV8W9nwh}!kA?YK)m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^jWn3#B{KBG=^05;75Ebo84bUX{v1KJYL9+(7MTeA!{?rICCuMb*aLjzEXLErR* zgpqSW#Bf0;5Q1UosGQyKDNG)u6?^@uDo7PFMK7&gd$07&O=E|Cx0+zbHo|?zz(t)M zL!a|q0`_U?q-wad{k!P&_nR*Q*0KHA6ubsuv6n3c&ePqUVfJit{WvT{$)#zLoq-HJ)eI|D9elXaymm|2r*yiS|x>@R#E-?56U7T1B^)O4lAXA+ft$ ze>n$|iK#aNcBuXIY3x=q?@DAcby4YJOTB9>8hCeoC3c`?$m!2de!-ith3n=NQSZ|! zC1&b~;I}grP!|*^oe3tDYqEsY&ZkyC?eLQ0&(Gw14T(g|c(tlLEly{6uL|r=%kgPs zXs^-DdmO__pZPvbT)pWr_O;OO@Pnp%7@AW@`P{TT)FawGM$9-@kug;%(acNO0>@`s zeZ+%!fU@K(Cefx@N+MLD1ii z4}zp(Rh89sb&8nNx_sJ{2XaDkG&28cynuN2ar4?)wMOQ289o>Uuw%{VK!)(V>L>W1 zemWAfKA(5vyz(b7msGo_Wimc7;UIsJ3aR_5>o0oTawY_Vs%=j*?6f+Khc}8;*&V|| zOf27Y5t&t~Q_=8c={Ny7({0v2la0bB=EsNMu5{@~a_f@>W?>;Lt0;J0x797T@--3P zYg#nLO&Q#;Tj$=A*5t|S~Z!r*|CZ5cI%S= zoFuN8+t&+-avKtp>GbQ@q-1lYeD8RLE&$Jl+MW#B{1%}Td85P+9@>p98kr;d2v04m zYvzF5D|awdI3elS?DvvHs8+TEXZvyBi3ary>FDUVOZ_b*)fpM6e*|GL4q^_qHF~OXFQc hJo~zF5EOhW#iZ=XBca^m2+@m>zyAnTB>m*Y{{o>tr%C_- literal 0 HcmV?d00001 diff --git a/doc/salome/gui/VISU/images/table.png b/doc/salome/gui/VISU/images/table.png new file mode 100644 index 0000000000000000000000000000000000000000..473aeff11c05c46f5a92f9cf6f25bde9351a67d7 GIT binary patch literal 9959 zcmb`N1yq#n_Vx!+x{(kOq&wxMq#Q~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I-!Rj)iO#$|m*(^U_&fQ8^-CEy0 zbZr;qhg5%gneWHxj*_lS`Ba4$#OVt_RF-CGwxb0o3>k2QN!rTQlxK90WAb9^onSX7 z>piXDq6?pE%zG$u+jVd3gd3|ad2k=vdyUJX`I5-J8+qB&h&mkIKP4&Ol{cAi?W<=< zx?dnGghWFp5>4`h5Z2@`0$B|MT~Aadr^Zt<>;{xcfdMJ!e&esuHv; zaCqT78uq~VNEf#eCI!NP-xwVU19%x2k2WBmFKBFB076dk@2wsL8M^gQ%9pN&tPPX9 zkNF|wA;;co9bZWhW{1ahE(P0t4n6$X^Z2?py~ALZ!6 zEk&Aa+S3zqbbWpuDp~8QdVM?g)n{09Gp6jak^0Fxt9)LiW*TBm;F2&d5LLfE4k!s literal 0 HcmV?d00001 diff --git a/doc/salome/gui/VISU/images/tablesn2.png b/doc/salome/gui/VISU/images/tablesn2.png new file mode 100644 index 0000000000000000000000000000000000000000..4b3b85d1d84a8ed85bee146c1ff313235d41ae6e GIT binary patch literal 12113 zcmb7qRa9I}(Cy$Fbb`AMFu~m+xI@q&0cLO?+=7Hakb%L2li<$a?rsV01cC)mAVBcT zckj!6`q%nj&gzHmt~$M|>g?*Xqjj{DU*J;V0sw#)swxV4000W_^Y|w=>hn{H0$&gS zU;wBp$m#oKpX3BK&?pD*cN@$zA6S^wu|jH*Rl|*)PG1IC?9!#6%g181%gpjLyiV@C zWJ^O7;ZOm7?N!wAMM7st54LkJN*rlCEmmA_sDDKLk!BicnqA$FGeMLx9h;v&`aQzS zyGX*^;7-}w$jIC1+UuLwx4#o}*K5q)i~5U_G8YdI?+w;pPqlck2sG$SB(c`h4ovdi~|7~El?)hLO8%mTb_uze19!)QK4vN(#M6ed`fyrCOO zboBFF{S(g(VnCV(RAkHhGbopANx2Mrn9JAL!=r6!lA>%ZG*{=fS$1ahuOjN^Jp81UD~?vLy;kw z(TvqlWG5=vK#P2QoIR~7$#+E0u}{M%=&Sn-y)2IsGN8@a;=N;`!8yUQ@{2)li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.doc b/doc/salome/gui/VISU/input/table_3d.doc new file mode 100644 index 00000000..15a36d2e --- /dev/null +++ b/doc/salome/gui/VISU/input/table_3d.doc @@ -0,0 +1,49 @@ +/*! + +\page table_3d_page Table 3D presentation + +\n Table 3D is a 3D graphic presentation of data contained in the table. +The relief and coloring of the resulting +presentation both correspond to the values contained in the table. The values from the first column of the +table define X-axis. The values from the second to the last columns define Z-axis. Y increases with a fixed step starting from Y=0. +To successfully produce a Table 3D presentation, the table should not contain empty fields. + +To create a Table 3D presentation: +\par +– Right-click on an XLS table in the +Object browser and from the context menu choose Show, or Show only + +\image html table.png + +The table will be immediately displayed in the Viewer. + +Choose Edit in the context menu if you wish to change the layout of the presentation. + +\image html table3d.png + +\par +
    +
  • Scale Factor - visualization scaling of all values of the table.
  • +
  • Presentation type:
  • +
      +
    • \b Surface - Plot 3D will be represented with a smooth surface.
    • + +\image html tablesn2.png + +
    • \b Contour - Plot 3D will be represented with a set of contours.
    • + +\image html tablesn1.png + +
    +
  • Number of contours - allows to define the number of +contours (active when Contour presentation type is selected).
  • +
  • Scalar Bar tab allows to define the parameters of the scalar +bar displayed with this presentation (\ref scalar_map_page "see also").
  • +
+ +It is also possible to choose \b Wireframe or \b Shading \b Representation type, change +such properties as \b Opacity and Line Width and Translate presentation from the context menu. + + + +*/ \ No newline at end of file diff --git a/src/CONVERTOR/VISU_ElnoMeshValue.hxx b/src/CONVERTOR/VISU_ElnoMeshValue.hxx new file mode 100644 index 00000000..42e4699b --- /dev/null +++ b/src/CONVERTOR/VISU_ElnoMeshValue.hxx @@ -0,0 +1,162 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_ElnoMeshValue.hxx +// Author : Alexey PETROV +// Module : VISU + +#ifndef VISU_ElnoMeshValue_HeaderFile +#define VISU_ElnoMeshValue_HeaderFile + +#include "VISU_VTKTypeList.hxx" +#include + + +/*! + \file VISU_ElnoMeshValue.hxx + \brief The file contains declarations for the acess to the specific ELNO MED data +*/ + +namespace VISU +{ + //--------------------------------------------------------------- + template< int elno_type > + struct TGetElnoNodeData + { + typedef typename TL::TEnum2VTKArrayType< elno_type >::TResult TVTKDataArray; + typedef typename TL::TEnum2VTKBasicType< elno_type >::TResult TDataType; + TVTKDataArray *myElnoDataArray; + vtkIntArray *myElnoDataMapper; + int myElemInfo[3]; + + + //---------------------------------------------------------------------------- + TGetElnoNodeData( vtkDataArray *theElnoDataArray, + vtkDataArray *theElnoDataMapper ) + : myElnoDataArray( TVTKDataArray::SafeDownCast( theElnoDataArray ) ) + , myElnoDataMapper( vtkIntArray::SafeDownCast( theElnoDataMapper ) ) + {} + + + //---------------------------------------------------------------------------- + TDataType* + operator () ( vtkIdType theCellId, vtkIdType theLocalPntId ) + { + myElnoDataMapper->GetTupleValue( theCellId, myElemInfo ); + + vtkIdType aPos = myElemInfo[ 0 ] + theLocalPntId * myElemInfo[ 1 ]; + + return myElnoDataArray->GetPointer( aPos ); + } + + + //---------------------------------------------------------------------------- + int + getNbComp() + { + myElnoDataMapper->GetTupleValue( 0, myElemInfo ); + + return myElemInfo[ 1 ]; + } + }; + + + //---------------------------------------------------------------------------------------------- + template< int elno_type > + struct TSetElnoNodeData + { + typedef typename TL::TEnum2VTKArrayType< elno_type >::TResult TVTKDataArray; + typedef typename TL::TEnum2VTKBasicType< elno_type >::TResult TDataType; + + //---------------------------------------------------------------------------------------------- + TSetElnoNodeData( vtkIdType theEffectNbComp, + vtkIdType theRealNbComp, + vtkIdType theNbTuples, + const char* theDataArrayName, + const char* theMapperArrayName ) + : myElnoDataArray( TVTKDataArray::New() ) + , myElnoDataMapper( vtkIntArray::New() ) + { + myElnoDataArray->SetNumberOfComponents( theEffectNbComp ); + myElnoDataArray->SetNumberOfTuples( theNbTuples ); + myElnoDataArray->SetName( theDataArrayName ); + + myElnoDataMapper->SetNumberOfComponents( 3 ); + myElnoDataMapper->Allocate( theNbTuples * 3 ); + myElnoDataMapper->SetName( theMapperArrayName ); + + myElemInfo[ 0 ] = 0; + myElemInfo[ 1 ] = theRealNbComp; + myElemInfo[ 2 ] = 0; + } + + + //---------------------------------------------------------------------------------------------- + ~TSetElnoNodeData() + { + myElnoDataArray->Delete(); + myElnoDataMapper->Delete(); + } + + + //---------------------------------------------------------------------------------------------- + int + AddNextPointData( TDataType* theDataPtr ) + { + vtkIdType aPos = myElemInfo[ 0 ] + myElemInfo[ 2 ] * myElemInfo[ 1 ]; + + TDataType* aDataPtr = myElnoDataArray->GetPointer( aPos ); + + for ( vtkIdType aCompId = 0; aCompId < myElemInfo[ 1 ]; aCompId++ ) + *aDataPtr++ = *theDataPtr++; + + return myElemInfo[ 2 ]++; + } + + + //---------------------------------------------------------------------------------------------- + void + InsertNextCellData() + { + myElnoDataMapper->InsertNextTupleValue( myElemInfo ); + myElemInfo[ 0 ] += myElemInfo[ 2 ] * myElemInfo[ 1 ]; + myElemInfo[ 2 ] = 0; + } + + + //---------------------------------------------------------------------------------------------- + void + AddData( vtkDataSetAttributes* theDataSetAttributes ) + { + theDataSetAttributes->AddArray( myElnoDataArray ); + theDataSetAttributes->AddArray( myElnoDataMapper ); + } + + protected: + TVTKDataArray *myElnoDataArray; + vtkIntArray *myElnoDataMapper; + int myElemInfo[ 3 ]; + }; + + + //--------------------------------------------------------------- +} + +#endif diff --git a/src/CONVERTOR/VISU_GaussMergeFilter.cxx b/src/CONVERTOR/VISU_GaussMergeFilter.cxx new file mode 100644 index 00000000..a27a1f4c --- /dev/null +++ b/src/CONVERTOR/VISU_GaussMergeFilter.cxx @@ -0,0 +1,386 @@ +// SALOME VTKViewer : build VTK viewer into Salome desktop +// +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : +// Author : +// Module : SALOME +// $Header$ + +#include "VISU_GaussMergeFilter.hxx" +#include "VISU_MergeFilterUtilities.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + +//------------------------------------------------------------------------------ +vtkStandardNewMacro(VISU_GaussMergeFilter); + +//------------------------------------------------------------------------------ +VISU_GaussMergeFilter +::VISU_GaussMergeFilter(): + myIsMergingInputs(false) +{ + this->FieldList = new VISU::TFieldList; + this->SetNumberOfInputPorts(6); +} + +//------------------------------------------------------------------------------ +VISU_GaussMergeFilter::~VISU_GaussMergeFilter() +{ + delete this->FieldList; +} + +//------------------------------------------------------------------------------ +void VISU_GaussMergeFilter::SetGeometry(vtkDataSet *input) +{ + this->Superclass::SetInput(input); +} + +//------------------------------------------------------------------------------ +vtkDataSet *VISU_GaussMergeFilter::GetGeometry() +{ + if (this->GetNumberOfInputConnections(0) < 1) + { + return NULL; + } + return vtkDataSet::SafeDownCast( + this->GetExecutive()->GetInputData(0, 0)); +} + +//------------------------------------------------------------------------------ +void VISU_GaussMergeFilter::SetScalars(vtkDataSet *input) +{ + this->SetInput(1, input); +} + +//------------------------------------------------------------------------------ +vtkDataSet *VISU_GaussMergeFilter::GetScalars() +{ + if (this->GetNumberOfInputConnections(1) < 1) + { + return NULL; + } + return vtkDataSet::SafeDownCast( + this->GetExecutive()->GetInputData(1, 0)); +} + +//------------------------------------------------------------------------------ +void VISU_GaussMergeFilter::SetVectors(vtkDataSet *input) +{ + this->SetInput(2, input); +} + +//------------------------------------------------------------------------------ +vtkDataSet *VISU_GaussMergeFilter::GetVectors() +{ + if (this->GetNumberOfInputConnections(2) < 1) + { + return NULL; + } + return vtkDataSet::SafeDownCast( + this->GetExecutive()->GetInputData(2, 0)); +} + +//------------------------------------------------------------------------------ +void VISU_GaussMergeFilter::SetNormals(vtkDataSet *input) +{ + this->SetInput(3, input); +} + +//------------------------------------------------------------------------------ +vtkDataSet *VISU_GaussMergeFilter::GetNormals() +{ + if (this->GetNumberOfInputConnections(3) < 1) + { + return NULL; + } + return vtkDataSet::SafeDownCast( + this->GetExecutive()->GetInputData(3, 0)); +} + +//------------------------------------------------------------------------------ +void VISU_GaussMergeFilter::SetTCoords(vtkDataSet *input) +{ + this->SetInput(4, input); +} + +//------------------------------------------------------------------------------ +vtkDataSet *VISU_GaussMergeFilter::GetTCoords() +{ + if (this->GetNumberOfInputConnections(4) < 1) + { + return NULL; + } + return vtkDataSet::SafeDownCast( + this->GetExecutive()->GetInputData(4, 0)); +} + +//------------------------------------------------------------------------------ +void VISU_GaussMergeFilter::SetTensors(vtkDataSet *input) +{ + this->SetInput(5, input); +} + +//------------------------------------------------------------------------------ +vtkDataSet *VISU_GaussMergeFilter::GetTensors() +{ + if (this->GetNumberOfInputConnections(5) < 1) + { + return NULL; + } + return vtkDataSet::SafeDownCast( + this->GetExecutive()->GetInputData(5, 0)); +} + +//------------------------------------------------------------------------------ +void VISU_GaussMergeFilter::AddField(const char* name, vtkDataSet* input) +{ + this->FieldList->Add(name, input); +} + +//------------------------------------------------------------------------------ +void VISU_GaussMergeFilter::RemoveFields() +{ + delete this->FieldList; + this->FieldList = new VISU::TFieldList; +} + + +//--------------------------------------------------------------- +void +VISU_GaussMergeFilter +::SetMergingInputs(bool theIsMergingInputs) +{ + if(myIsMergingInputs == theIsMergingInputs) + return; + + myIsMergingInputs = theIsMergingInputs; + Modified(); +} + + +//--------------------------------------------------------------- +bool +VISU_GaussMergeFilter +::IsMergingInputs() +{ + return myIsMergingInputs; +} + + +//--------------------------------------------------------------- +int +VISU_GaussMergeFilter +::RequestData(vtkInformation *theRequest, + vtkInformationVector **theInputVector, + vtkInformationVector *theOutputVector) +{ + if(vtkUnstructuredGrid *anInput = dynamic_cast(this->GetInput())){ + vtkPolyData *anOutput = dynamic_cast(this->GetOutput()); + return ExecuteGauss(anInput, + anOutput); + } + + return Superclass::RequestData(theRequest, + theInputVector, + theOutputVector); +} + +//---------------------------------------------------------------------------- +// Trick: Abstract data types that may or may not be the same type +// (structured/unstructured), but the points/cells match up. +// Output/Geometry may be structured while ScalarInput may be +// unstructured (but really have same triagulation/topology as geometry). +// Just request all the input. Always generate all of the output (todo). +int +VISU_GaussMergeFilter +::RequestUpdateExtent(vtkInformation *vtkNotUsed(request), + vtkInformationVector **inputVector, + vtkInformationVector *vtkNotUsed(outputVector)) +{ + vtkInformation *inputInfo; + int idx; + + for (idx = 0; idx < 6; ++idx) + { + inputInfo = inputVector[idx]->GetInformationObject(0); + if (inputInfo) + { + inputInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(), + 0); + inputInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(), + 1); + inputInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(), + 0); + inputInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 1); + } + } + return 1; +} + + +//---------------------------------------------------------------------------- +int +VISU_GaussMergeFilter +::FillInputPortInformation(int port, vtkInformation *info) +{ + int retval = this->Superclass::FillInputPortInformation(port, info); + if (port > 0) + { + info->Set(vtkAlgorithm::INPUT_IS_OPTIONAL(), 1); + } + return retval; +} + +//---------------------------------------------------------------------------- +int +VISU_GaussMergeFilter +::FillOutputPortInformation(int port, vtkInformation *info) +{ + info->Set(vtkDataObject::DATA_TYPE_NAME(),"vtkPolyData"); + return 1; +} + +void +VISU_GaussMergeFilter +::SetGaussPtsIDMapper(const VISU::PGaussPtsIDMapper& theIDMapper) +{ + myGaussPtsIDMapper = theIDMapper; +} + + +const VISU::PGaussPtsIDMapper& +VISU_GaussMergeFilter +::GetGaussPtsIDMapper() +{ + return myGaussPtsIDMapper; +} + +bool +VISU_GaussMergeFilter +::ExecuteGauss(vtkUnstructuredGrid* theInput, + vtkPolyData* theOutput) +{ + if(IsMergingInputs()){ + vtkCellData *aCellData = theInput->GetCellData(); + if(vtkDataArray *aCellMapper = aCellData->GetArray("VISU_CELLS_MAPPER")){ + vtkIntArray *aGeometryCellMapper = dynamic_cast(aCellMapper); + + vtkIntArray* aDataPointMapper = GetIDMapper(FieldList, + VISU::TGetPointData(), + "VISU_POINTS_MAPPER"); + + vtkIntArray* aDataCellIds = vtkIntArray::New(); + + int nbPoints = aDataPointMapper->GetNumberOfTuples(); + aDataCellIds->SetNumberOfComponents(2); + aDataCellIds->SetNumberOfTuples(nbPoints); + int* aDataCellPointer = aDataCellIds->GetPointer(0); + { + int nbPoints = aDataPointMapper->GetNumberOfTuples(); + for(int i=0;iGetObjID(i); + vtkIdType aCellId = aGPID.first; + *aDataCellPointer = aCellId; + aDataCellPointer++; + *aDataCellPointer = 3; // it's a entity CELL + } + } + /* + vtkIntArray* anCellArr = GetIDMapper(FieldList, + VISU::TGetCellData(), + "VISU_CELLS_MAPPER"); + vtkIntArray* anPMArr = GetIDMapper(FieldList, + VISU::TGetPointData(), + "VISU_POINTS_MAPPER"); + + vtkDataArray* anFArr = GetIDMapper(FieldList, + VISU::TGetPointData(), + "VISU_FIELD"); + */ + if(VISU::IsDifferent(aDataCellIds, aGeometryCellMapper)){ + VISU::TObjectIdArray anIntersection; + VISU::GetIntersection(aDataCellIds, + aGeometryCellMapper, + anIntersection); + + vtkIdType aNbTuples = anIntersection.size(); + + VISU::TObjectId2TupleIdMap aDataCellId2TupleIdMap; + VISU::GetObjectId2TupleIdMap(aDataCellIds, aDataCellId2TupleIdMap); + + vtkPointSet* aScalarsDataSet = dynamic_cast(GetScalars()); + vtkPoints* aDataPoints = aScalarsDataSet->GetPoints(); + vtkPoints* anOutputPoints = vtkPoints::New(aDataPoints->GetDataType()); + + anOutputPoints->SetNumberOfPoints(aNbTuples); + theOutput->SetPoints(anOutputPoints); + anOutputPoints->Delete(); + + vtkCellData* anInputCellData = aScalarsDataSet->GetCellData(); + vtkPointData* anInputPointData = aScalarsDataSet->GetPointData(); + + theOutput->Allocate(aNbTuples); + vtkCellData* anOutputCellData = theOutput->GetCellData(); + vtkPointData* anOutputPointData = theOutput->GetPointData(); + + anOutputCellData->CopyAllocate(anInputCellData,aNbTuples); + anOutputPointData->CopyAllocate(anInputPointData,aNbTuples); + + vtkIdList *aCellIds = vtkIdList::New(); + vtkFloatingPointType aCoords[3]; + for(int aTupleId=0;aTupleIdGetCell(aCellId); + + aCellIds->Reset(); + aCellIds->InsertNextId(aTupleId); + + vtkIdType aCellType = GetScalars()->GetCellType(aCellId); + vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds); + + anOutputCellData->CopyData(anInputCellData, aCellId, aNewCellId); + anOutputPointData->CopyData(anInputPointData, aCellId, aNewCellId); + + aDataPoints->GetPoint(aCellId, aCoords); + anOutputPoints->SetPoint(aNewCellId, aCoords); + } + } + } + } + return true; +} diff --git a/src/CONVERTOR/VISU_GaussMergeFilter.hxx b/src/CONVERTOR/VISU_GaussMergeFilter.hxx new file mode 100644 index 00000000..52cace44 --- /dev/null +++ b/src/CONVERTOR/VISU_GaussMergeFilter.hxx @@ -0,0 +1,138 @@ +// SALOME VTKViewer : build VTK viewer into Salome desktop +// +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : +// Author : +// Module : SALOME +// $Header$ + +#ifndef VISU_GaussMergeFilter_H +#define VISU_GaussMergeFilter_H + +#include "VISU_Convertor.hxx" + +//#include +#include + +namespace VISU +{ + class TFieldList; +} + + +//------------------------------------------------------------------------------ +class VISU_CONVERTOR_EXPORT VISU_GaussMergeFilter : public vtkPointSetAlgorithm +{ +public: + static VISU_GaussMergeFilter *New(); + vtkTypeMacro(VISU_GaussMergeFilter, vtkPointSetAlgorithm); + + // Description: + // Specify object from which to extract geometry information. + void SetGeometry(vtkDataSet *input); + vtkDataSet *GetGeometry(); + + // Description: + // Specify object from which to extract scalar information. + void SetScalars(vtkDataSet *); + vtkDataSet *GetScalars(); + + // Description: + // Set / get the object from which to extract vector information. + void SetVectors(vtkDataSet *); + vtkDataSet *GetVectors(); + + // Description: + // Set / get the object from which to extract normal information. + void SetNormals(vtkDataSet *); + vtkDataSet *GetNormals(); + + // Description: + // Set / get the object from which to extract texture coordinates + // information. + void SetTCoords(vtkDataSet *); + vtkDataSet *GetTCoords(); + + // Description: + // Set / get the object from which to extract tensor data. + void SetTensors(vtkDataSet *); + vtkDataSet *GetTensors(); + + // Description: + // Set the object from which to extract a field and the name + // of the field + void AddField(const char* name, vtkDataSet* input); + + // Description: + // Removes all previously added fields + void RemoveFields(); + + // Description: + // Defines whether to perform merging of data with the geometry according to + // the ids of the cell or not + void + SetMergingInputs(bool theIsMergingInputs); + + bool + IsMergingInputs(); + + void + SetGaussPtsIDMapper(const VISU::PGaussPtsIDMapper& theGaussPtsIDMapper); + + const VISU::PGaussPtsIDMapper& + GetGaussPtsIDMapper(); + +protected: + VISU_GaussMergeFilter(); + ~VISU_GaussMergeFilter(); + + virtual + int + RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); + + int + RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *); + + int + FillInputPortInformation(int port, vtkInformation *info); + + int + FillOutputPortInformation(int port, vtkInformation *info); + + VISU::TFieldList* FieldList; + bool myIsMergingInputs; + + VISU::PGaussPtsIDMapper myGaussPtsIDMapper; + + bool + ExecuteGauss(vtkUnstructuredGrid* theInput, + vtkPolyData* theOutput); + +private: + VISU_GaussMergeFilter(const VISU_GaussMergeFilter&); // Not implemented. + void operator=(const VISU_GaussMergeFilter&); // Not implemented. +}; + +#endif + + diff --git a/src/CONVERTOR/VISU_TableReader.cxx b/src/CONVERTOR/VISU_TableReader.cxx new file mode 100644 index 00000000..c130a575 --- /dev/null +++ b/src/CONVERTOR/VISU_TableReader.cxx @@ -0,0 +1,400 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File: +// Author: +// Module : VISU + +#include "VISU_TableReader.hxx" + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + + +//--------------------------------------------------------------- +int +VISU::TTable2D +::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 +VISU::TTable2D +::getColumns(VISU::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); + } +} + + +//--------------------------------------------------------------- +namespace +{ + int getLine( std::ifstream& theStmIn, QString& theString ) + { + char tmp; + std::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) std::cout << "...Table TITLE is: " << title.latin1() << std::endl; + aTable2D.myTitle = title.latin1(); + } + else if ( keyword == QString( "COLUMN_TITLES" ) ) { + // comment may contain column headers + QStringList aStrList = QStringList::split( "|", cmt ); + if(MYDEBUG) std::cout << "...Column TITLES are: "; + for ( int i = 0; i < aStrList.count(); i++ ) { + QString tmpstr = aStrList[ i ].stripWhiteSpace(); + if(MYDEBUG) std::cout << tmpstr.latin1() << " "; + aTable2D.myColumnTitles.push_back( tmpstr.latin1() ); + } + if(MYDEBUG) std::cout << std::endl; + } + else if ( keyword == QString( "COLUMN_UNITS" ) ) { + // comment may contain column units + QStringList aStrList = QStringList::split( " ", cmt ); + if(MYDEBUG) std::cout << "...Column UNITS are: "; + for ( int i = 0; i < aStrList.count(); i++ ) { + QString tmpstr = aStrList[ i ].stripWhiteSpace(); + if(MYDEBUG) std::cout << tmpstr.latin1() << " "; + aTable2D.myColumnUnits.push_back( tmpstr.latin1() ); + } + if(MYDEBUG) std::cout << std::endl; + } + else if ( keyword == QString( "COMMENT" ) ) { + // keyword 'COMMENT' processing can be here + // currently it is ignored + if(MYDEBUG) std::cout << "...COMMENT: " << cmt.latin1() << std::endl; + } + } + else { + if(MYDEBUG) std::cout << "...comment: " << cmt.latin1() << std::endl; + // simple comment processing can be here + // currently it is ignored + } + } + // if data is not empty, try to process it + else { + TTable2D::TRow aRow; + if(MYDEBUG) std::cout << "...New row is found: " << std::endl; + if ( !cmt.isEmpty() ) { + aRow.myTitle = cmt.latin1(); + if(MYDEBUG) std::cout << "......ROW TITLE is: " << cmt.latin1() << std::endl; + } + QString datar1 = data.replace(QRegExp("\t"), " "); + QStringList aValList = QStringList::split( " ", datar1 ); + for ( int i = 0; i < aValList.count(); i++ ) { + if ( aValList[i].stripWhiteSpace() != "" ) { + TTable2D::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) std::cout << "aTable2D is checked OK " << aTable2D.myTitle << std::endl; + theContainer.push_back( aTableIDMapper ); + } + } while ( !aStmIn.eof() ); + aStmIn.close(); + + if(MYDEBUG) std::cout << "After close" << std::endl; +} + + +//--------------------------------------------------------------- +VISU::TTableIDMapper +::TTableIDMapper(): + myOutput( vtkPolyData::New() ), + myXAxisPosition( -1 ) +{} + +VISU::TTableIDMapper +::~TTableIDMapper() +{ + myOutput->Delete(); +} + +vtkPolyData* +VISU::TTableIDMapper +::GetPolyDataOutput() +{ + if ( myXAxisPosition == -1 ) + SetXAxisPosition( 0 ); + + return myOutput; +} + +long unsigned int +VISU::TTableIDMapper +::GetMemorySize() +{ + return myOutput->GetActualMemorySize() * 1024; +} + +void +VISU::TTableIDMapper +::SetXAxisPosition( vtkIdType theAxisPosition ) +{ + if ( myXAxisPosition == theAxisPosition || !Check() ) + return; + + myOutput->Initialize(); + + if ( !Check() ) + return; + + TTable2D aTable2D; + getColumns( aTable2D ); + + vtkIdType aXSize = aTable2D.myRows[0].myValues.size(); + + // It is necessary to decrease the size at 1 take intoa account X axis + vtkIdType anYSize = aTable2D.myRows.size() - 1; + + vtkIdType aNbPoints = aXSize * anYSize; + + std::vector anXAxis(aXSize); + const TTable2D::TValues& aValues = aTable2D.myRows[theAxisPosition].myValues; + for ( vtkIdType aX = 0; aX < aXSize; aX++ ) + anXAxis[aX] = atof( aValues[aX].c_str() ); + + double aXRange = anXAxis[aXSize - 1] - anXAxis[0]; + double anYDelta = aXRange / anYSize; + std::vector anYAxis(anYSize); + for ( vtkIdType anY = 0; anY < anYSize; anY++ ) + anYAxis[anY] = anY * anYDelta; + + vtkPoints* aPoints = vtkPoints::New(); + aPoints->SetNumberOfPoints( aNbPoints ); + + vtkIntArray *aPointsIDMapper = vtkIntArray::New(); + aPointsIDMapper->SetName("VISU_POINTS_MAPPER"); + aPointsIDMapper->SetNumberOfComponents(2); + aPointsIDMapper->SetNumberOfTuples(aNbPoints); + int *aPointsIDMapperPtr = aPointsIDMapper->GetPointer(0); + + //vtkIntArray *aCellIDMapper = vtkIntArray::New(); + //aCellIDMapper->SetName("VISU_POINTS_MAPPER"); + //aCellIDMapper->SetNumberOfComponents(2); + //aCellIDMapper->SetNumberOfTuples(aNbPoints); + //int *aCellIDMapperPtr = aCellIDMapper->GetPointer(0); + + for ( vtkIdType aY = 0, aPntId = 0; aY < anYSize; aY++ ) { + for ( vtkIdType aX = 0; aX < aXSize; aX++, aPntId++ ) { + aPoints->SetPoint( aPntId, anXAxis[aX], anYAxis[aY], 0.0 ); + + *aPointsIDMapperPtr++ = aPntId; + *aPointsIDMapperPtr++ = 0; + + //*aCellIDMapperPtr++ = aPntId; + //*aCellIDMapperPtr++ = 0; + } + } + + std::vector anYData; + for ( vtkIdType anY = 0; anY < anYSize + 1; anY++ ) { + if ( anY == theAxisPosition ) + continue; + anYData.push_back( aTable2D.myRows[anY].myValues ); + } + + vtkDoubleArray* aScalars = vtkDoubleArray::New(); + aScalars->SetNumberOfComponents( 1 ); + aScalars->SetNumberOfTuples( aNbPoints ); + double *aScalarsPtr = aScalars->GetPointer(0); + for ( vtkIdType anY = 0; anY < anYSize; anY++ ) { + const TTable2D::TValues& aValues = anYData[anY]; + for ( vtkIdType aX = 0; aX < aXSize; aX++ ) { + double aValue = atof( aValues[aX].c_str() ); + *aScalarsPtr++ = aValue; + } + } + + vtkStructuredGrid* aStructuredGrid = vtkStructuredGrid::New(); + aStructuredGrid->SetPoints( aPoints ); + aPoints->Delete(); + + aStructuredGrid->SetDimensions( aXSize, anYSize, 1 ); + + aStructuredGrid->GetPointData()->AddArray( aPointsIDMapper ); + aPointsIDMapper->Delete(); + + //aStructuredGrid->GetCellData()->AddArray( aCellIDMapper ); + //aCellIDMapper->Delete(); + + aStructuredGrid->GetPointData()->SetScalars( aScalars ); + aScalars->Delete(); + + vtkStructuredGridGeometryFilter* aFilter = vtkStructuredGridGeometryFilter::New(); + aFilter->SetInput( aStructuredGrid ); + aFilter->Update(); + myOutput->ShallowCopy( aFilter->GetOutput() ); + aFilter->Delete(); +} diff --git a/src/CONVERTOR/VISU_TableReader.hxx b/src/CONVERTOR/VISU_TableReader.hxx new file mode 100644 index 00000000..1b724c34 --- /dev/null +++ b/src/CONVERTOR/VISU_TableReader.hxx @@ -0,0 +1,110 @@ +// VISU CONVERTOR : +// +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_TableReader.hxx +// Author : Alexey PETROV +// Module : VISU + +#ifndef VISU_TableReader_HeaderFile +#define VISU_TableReader_HeaderFile + +/*! + \file VISU_TableReader.hxx + \brief The file contains definition of the Table reading functionlity +*/ + +#include "VISUConvertor.hxx" + +#include "VISU_IDMapper.hxx" + +#include +#include + +namespace VISU +{ + //--------------------------------------------------------------- + struct VISU_CONVERTOR_EXPORT TTable2D + { + typedef std::string TValue; + typedef std::vector TValues; + + struct TRow + { + std::string myTitle; + std::string myUnit; + TValues myValues; + }; + + std::string myTitle; + std::vector myColumnUnits; + std::vector myColumnTitles; + + typedef std::vector TRows; + TRows myRows; + + int + Check(); + + void + getColumns( TTable2D& theTable2D ) const; + }; + + + //--------------------------------------------------------------- + class VISU_CONVERTOR_EXPORT TTableIDMapper: + public virtual TPolyDataIDMapper, + public virtual TTable2D + { + public: + TTableIDMapper(); + ~TTableIDMapper(); + + virtual + vtkPolyData* + GetPolyDataOutput(); + + virtual + long unsigned int + GetMemorySize(); + + void + SetXAxisPosition( vtkIdType theAxisPosition ); + + vtkIdType + GetXAxisPosition(); + + protected: + vtkIdType myXAxisPosition; + vtkPolyData* myOutput; + }; + typedef MED::SharedPtr PTableIDMapper; + + + //--------------------------------------------------------------- + typedef std::vector TTableContainer; + void ImportTables( const char* theFileName, TTableContainer& theContainer ); + + + //--------------------------------------------------------------- +} + +#endif diff --git a/src/CONVERTOR/VISU_VTKTypeList.hxx b/src/CONVERTOR/VISU_VTKTypeList.hxx new file mode 100644 index 00000000..f210f652 --- /dev/null +++ b/src/CONVERTOR/VISU_VTKTypeList.hxx @@ -0,0 +1,120 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_VTKTypeList.hxx +// Author : Oleg UVAROV +// Module : VISU + +#ifndef VISU_VTKTypeList_HeaderFile +#define VISU_VTKTypeList_HeaderFile + +#include "VISU_TypeList.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +//---------------------------------------------------------------------------- +namespace VISU +{ + //---------------------------------------------------------------------------- + namespace TL + { + //---------------------------------------------------------------------------- + typedef TSequence< char, + unsigned char, + short, + unsigned short, + int, + unsigned int, + long, + unsigned long, + float, + double >::TResult TVTKBasicTypeList; + + + //---------------------------------------------------------------------------- + typedef TSequence< vtkCharArray, + vtkUnsignedCharArray, + vtkShortArray, + vtkUnsignedShortArray, + vtkIntArray, + vtkUnsignedIntArray, + vtkLongArray, + vtkUnsignedLongArray, + vtkFloatArray, + vtkDoubleArray >::TResult TVTKArrayTypeList; + + + //---------------------------------------------------------------------------- + typedef TSequence< TInt2Type< VTK_CHAR >, + TInt2Type< VTK_UNSIGNED_CHAR >, + TInt2Type< VTK_SHORT >, + TInt2Type< VTK_UNSIGNED_SHORT >, + TInt2Type< VTK_INT >, + TInt2Type< VTK_UNSIGNED_INT >, + TInt2Type< VTK_LONG >, + TInt2Type< VTK_UNSIGNED_LONG >, + TInt2Type< VTK_FLOAT >, + TInt2Type< VTK_DOUBLE > >::TResult TVTKBasicEnumList; + + + //---------------------------------------------------------------------------- + template< unsigned int type_enum > + struct TEnum2VTKBasicType + { + typedef typename TTypeAt< TVTKBasicTypeList, TIndexOf< TVTKBasicEnumList, TInt2Type< type_enum > >::value >::TResult TResult; + }; + + + //---------------------------------------------------------------------------- + template< unsigned int type_enum > + struct TEnum2VTKArrayType + { + typedef typename TTypeAt< TVTKArrayTypeList, TIndexOf< TVTKBasicEnumList, TInt2Type< type_enum > >::value >::TResult TResult; + }; + + + //---------------------------------------------------------------------------- + template< class T > + struct TVTKBasicType2Enum + { + typedef typename TTypeAt< TVTKBasicEnumList, TIndexOf< TVTKBasicTypeList, T >::value >::TResult TResult; + }; + + + //---------------------------------------------------------------------------- + } + + + //---------------------------------------------------------------------------- +} + +#endif diff --git a/src/OBJECT/VISU_ActorBase.cxx b/src/OBJECT/VISU_ActorBase.cxx new file mode 100644 index 00000000..846f8060 --- /dev/null +++ b/src/OBJECT/VISU_ActorBase.cxx @@ -0,0 +1,166 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : +// Author : +// Module : VISU +// $Header$ + +#include "VISU_ActorBase.h" +#include "VISU_ActorFactory.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "utilities.h" + +#include "VTKViewer_ShrinkFilter.h" + + +#include + +VISU_ActorBase +::VISU_ActorBase() : + myIsShrinkable(true), + myIsShrunk(false), + myShrinkFilter(VTKViewer_ShrinkFilter::New()) +{ + myShrinkFilter->Delete(); + + myStoreMapping = true; + + myShrinkFilter->SetStoreMapping(true); + +} + +VISU_ActorBase +::~VISU_ActorBase() +{ + +} + +//---------------------------------------------------------------------------- +VISU::TActorFactory* +VISU_ActorBase +::GetFactory() +{ + return myActorFactory; +} + +void +VISU_ActorBase +::SetFactory(VISU::TActorFactory* theActorFactory) +{ + using namespace VISU; + + if(myActorFactory == theActorFactory) + return; + + if(theActorFactory) + myDestroySignal.connect(boost::bind(&TActorFactory::RemoveActor, + theActorFactory, + _1)); + + myActorFactory = theActorFactory; +} + +void +VISU_ActorBase +::UpdateFromFactory() +{ + if(myUpdateFromFactoryTime.GetMTime() < myActorFactory->GetMTime()){ + myUpdateFromFactoryTime.Modified(); + myActorFactory->UpdateActor(this); + Update(); + } +} + +//-------------------------------------------------------------------------- + +void +VISU_ActorBase +::SetLineWidth(vtkFloatingPointType theLineWidth) +{ + GetProperty()->SetLineWidth(theLineWidth); +} + +vtkFloatingPointType +VISU_ActorBase +::GetLineWidth() +{ + return GetProperty()->GetLineWidth(); +} + +//-------------------------------------------------------------------------- +void +VISU_ActorBase +::SetRepresentation(int theMode) +{ + Superclass::SetRepresentation(theMode); + if(myRepresentation == VTK_POINTS) + UnShrink(); +} + +//---------------------------------------------------------------------------- +void VISU_ActorBase::SetShrink() +{ + if(!myIsShrinkable) + return; + if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){ + myShrinkFilter->SetInput(aDataSet); + myPassFilter[1]->SetInput(myShrinkFilter->GetOutput()); + myIsShrunk = true; + } +} + +void VISU_ActorBase::UnShrink() +{ + if(!myIsShrunk) + return; + if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){ + myPassFilter[1]->SetInput(aDataSet); + myPassFilter[1]->Modified(); + myIsShrunk = false; + Modified(); + } +} + +bool VISU_ActorBase::IsShrunk() +{ + return myIsShrunk; +} + +void VISU_ActorBase::SetShrinkable(bool theIsShrinkable) +{ + myIsShrinkable = theIsShrinkable; +} + +bool VISU_ActorBase::IsShrunkable() +{ + return myIsShrinkable; +} diff --git a/src/OBJECT/VISU_ActorBase.h b/src/OBJECT/VISU_ActorBase.h new file mode 100644 index 00000000..6904b15f --- /dev/null +++ b/src/OBJECT/VISU_ActorBase.h @@ -0,0 +1,93 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : +// Author : +// Module : VISU +// $Header$ + +#ifndef VISU_ACTOR_BASE_H +#define VISU_ACTOR_BASE_H + +#include "SALOME_Actor.h" +#include "VISU_BoostSignals.h" + +class VTKViewer_ShrinkFilter; + +#ifdef _WIN32 +#define VTKOCC_EXPORT __declspec (dllexport) +#else +#define VTKOCC_EXPORT VTK_EXPORT +#endif + + +//---------------------------------------------------------------------------- +namespace VISU +{ + struct TActorFactory; +} + + +//! This class defines an abstaract interface to manage actors +class VTKOCC_EXPORT VISU_ActorBase: public SALOME_Actor, + public boost::signalslib::trackable +{ + public: + vtkTypeMacro(VISU_ActorBase, SALOME_Actor); + + //---------------------------------------------------------------------------- + VISU::TActorFactory* GetFactory(); + virtual void SetFactory(VISU::TActorFactory* theActorFactory); + + //---------------------------------------------------------------------------- + virtual void UpdateFromFactory(); + + //---------------------------------------------------------------------------- + + virtual void SetLineWidth(vtkFloatingPointType theLineWidth); + virtual vtkFloatingPointType GetLineWidth(); + + virtual void SetShrink(); + virtual void UnShrink(); + virtual bool IsShrunkable(); + virtual bool IsShrunk(); + virtual void SetShrinkable(bool theIsShrinkable); + + + virtual void SetRepresentation(int theMode); + + protected: + VISU_ActorBase(); + virtual ~VISU_ActorBase(); + + VISU::TActorFactory* myActorFactory; + vtkTimeStamp myUpdateFromFactoryTime; + boost::signal1 myDestroySignal; + + vtkSmartPointer myShrinkFilter; + + bool myIsShrinkable; + bool myIsShrunk; +}; + +#endif //VISU_ACTOR_BASE_H diff --git a/src/OBJECT/VISU_IsoSurfActor.cxx b/src/OBJECT/VISU_IsoSurfActor.cxx new file mode 100644 index 00000000..3c58fc47 --- /dev/null +++ b/src/OBJECT/VISU_IsoSurfActor.cxx @@ -0,0 +1,165 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : VISU_IsoSurfActor.cxx +// Author : Vitaly Smetannikov +// Module : VISU + + +#include "VISU_IsoSurfActor.h" +#include "VISU_PipeLine.hxx" +#include "VISU_LabelPointsFilter.hxx" + + +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include + + + +//---------------------------------------------------------------------------- +vtkStandardNewMacro(VISU_IsoSurfActor); + + +//---------------------------------------------------------------------------- +VISU_IsoSurfActor::VISU_IsoSurfActor(): + VISU_ScalarMapAct(), + myIsLinesLabeled(true) +{ + myLabelsDataSet = vtkPolyData::New(); + +// myMaskPoints = vtkMaskPoints::New(); +// myMaskPoints->SetInput(myLabelsDataSet); +// myMaskPoints->SetOnRatio(100); + + myMaskPoints = VISU_LabelPointsFilter::New(); + myMaskPoints->SetInput(myLabelsDataSet); + + myLabeledDataMapper = vtkLabeledDataMapper::New(); + myLabeledDataMapper->SetInput(myMaskPoints->GetOutput()); + //myLabeledDataMapper->SetLabelFormat("%e"); + myLabeledDataMapper->SetLabelModeToLabelScalars(); + + myLabels = vtkActor2D::New(); + myLabels->SetMapper(myLabeledDataMapper); + myLabels->GetProperty()->SetColor(1,1,1); + myLabels->SetVisibility(myIsLinesLabeled); +} + + +//---------------------------------------------------------------------------- +VISU_IsoSurfActor::~VISU_IsoSurfActor() +{ + myLabelsDataSet->Delete(); + myMaskPoints->Delete(); + myLabeledDataMapper->Delete(); + myLabels->Delete(); +} + +//---------------------------------------------------------------------------- +void VISU_IsoSurfActor::SetLinesLabeled(bool theIsLinesLabeled, int theNbLbl) +{ + myIsLinesLabeled = theIsLinesLabeled; + myMaskPoints->SetPointsNb(theNbLbl); + Modified(); +} + +//---------------------------------------------------------------------------- +int VISU_IsoSurfActor::GetNbLabels() const +{ + return myMaskPoints->GetPointsNb(); +} + + +//---------------------------------------------------------------------------- +void VISU_IsoSurfActor::UpdateLabels() +{ + if (myIsLinesLabeled) { + vtkDataSet* aDataSet = GetPipeLine()->GetOutput(); + if (aDataSet != NULL) { + unsigned long aTime = myLabelsDataSet->GetMTime(); + unsigned long anObjTime = GetMTime(); + if (aTime < anObjTime) { + myLabelsDataSet->ShallowCopy(aDataSet); + myLabelsDataSet->Modified(); + } + } + } + myLabels->SetVisibility(myIsLinesLabeled); +} + + +//---------------------------------------------------------------------------- +void VISU_IsoSurfActor::AddToRender(vtkRenderer* theRenderer) +{ + VISU_ScalarMapAct::AddToRender(theRenderer); + theRenderer->AddActor2D(myLabels); +} + +//---------------------------------------------------------------------------- +void VISU_IsoSurfActor::RemoveFromRender(vtkRenderer* theRenderer) +{ + VISU_ScalarMapAct::RemoveFromRender(theRenderer); + theRenderer->RemoveActor(myLabels); +} + +//From vtkFollower +int VISU_IsoSurfActor::RenderOpaqueGeometry(vtkViewport *vp) +{ + UpdateLabels(); + return VISU_ScalarMapAct::RenderOpaqueGeometry(vp); +} + + +int VISU_IsoSurfActor::RenderTranslucentGeometry(vtkViewport *vp) +{ + UpdateLabels(); + return VISU_ScalarMapAct::RenderTranslucentGeometry(vp); +} + +void VISU_IsoSurfActor::SetVisibility(int theMode){ + VISU_ScalarMapAct::SetVisibility(theMode); + if(GetVisibility()) + myLabels->VisibilityOn(); + else + myLabels->VisibilityOff(); + Modified(); +} + + +///!!!! For test purposes only +// void VISU_IsoSurfActor::SetMapperInput(vtkDataSet* theDataSet) +// { +// VISU_ScalarMapAct::SetMapperInput(theDataSet); + +// vtkFeatureEdges* aFilter = vtkFeatureEdges::New(); +// aFilter->SetInput(VISU_ScalarMapAct::GetInput()); +// SetInput(aFilter->GetOutput()); +// } diff --git a/src/OBJECT/VISU_IsoSurfActor.h b/src/OBJECT/VISU_IsoSurfActor.h new file mode 100644 index 00000000..0377ae6a --- /dev/null +++ b/src/OBJECT/VISU_IsoSurfActor.h @@ -0,0 +1,88 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : VISU_IsoSurfActor.h +// Author : Vitaly Smetannikov +// Module : VISU + + +#ifndef VISU_VectorsAct_HeaderFile +#define VISU_VectorsAct_HeaderFile + +#include "VISU_ScalarMapAct.h" + +class vtkActor2D; +//class vtkMaskPoints; +class vtkLabeledDataMapper; +class vtkPolyData; +class VISU_LabelPointsFilter; + + +class VTKOCC_EXPORT VISU_IsoSurfActor : public VISU_ScalarMapAct +{ + public: + vtkTypeMacro(VISU_IsoSurfActor, VISU_ScalarMapAct); + + static VISU_IsoSurfActor* New(); + + + //---------------------------------------------------------------------------- + virtual void AddToRender( vtkRenderer* ); + + virtual void RemoveFromRender( vtkRenderer* ); + + virtual int RenderOpaqueGeometry(vtkViewport *viewport); + virtual int RenderTranslucentGeometry(vtkViewport *viewport); + + //virtual void SetPipeLine(VISU_PipeLine* thePipeLine); + + void SetLinesLabeled(bool theIsLinesLabeled, int theNbLbl); + bool GetLinesLabeled() const { return myIsLinesLabeled;} + + int GetNbLabels() const; + + + //---------------------------------------------------------------------------- + //! Visibility management + virtual void SetVisibility( int ); + + + protected: + + VISU_IsoSurfActor(); + ~VISU_IsoSurfActor(); + + void UpdateLabels(); + + vtkActor2D *myLabels; + vtkLabeledDataMapper* myLabeledDataMapper; + //vtkMaskPoints* myMaskPoints; + VISU_LabelPointsFilter* myMaskPoints; + vtkPolyData* myLabelsDataSet; + + bool myIsLinesLabeled; + //int myNbLabels; +}; + + +#endif diff --git a/src/OBJECT/VISU_PointMap3dActor.cxx b/src/OBJECT/VISU_PointMap3dActor.cxx new file mode 100644 index 00000000..ec57b21d --- /dev/null +++ b/src/OBJECT/VISU_PointMap3dActor.cxx @@ -0,0 +1,147 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : +// Author : +// Module : VISU +// $Header$ + +#include "VISU_PointMap3dActor.h" +#include "VISU_PipeLine.hxx" +#include "VISU_ScalarBarActor.hxx" +#include "VISU_DeformedGridPL.hxx" + +#include "utilities.h" +#include +#include + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +vtkStandardNewMacro(VISU_PointMap3dActor); + +//================================================================== +// function: Constructor +// purpose : +//================================================================== + +VISU_PointMap3dActor +::VISU_PointMap3dActor() +{ + if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::VISU_PointMap3dActor - this = "< myPipeLine; + + VISU_ScalarBarActor* myScalarBar; +}; + +#endif diff --git a/src/PIPELINE/VISU_DeformationPL.cxx b/src/PIPELINE/VISU_DeformationPL.cxx new file mode 100755 index 00000000..2189b228 --- /dev/null +++ b/src/PIPELINE/VISU_DeformationPL.cxx @@ -0,0 +1,163 @@ +// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File: VISU_ScalarMapPL.cxx +// Author: Roman NIKOLAEV +// Module : VISU + +//Salome includes +#include "VISU_DeformationPL.hxx" +#include "VISU_MergeFilter.hxx" +#include "VISU_DeformedShapePL.hxx" +#include "VISU_PipeLineUtils.hxx" + +//VTK includes +#include +#include +#include +#include +#include +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + + +//---------------------------------------------------------------------------- +VISU_DeformationPL::VISU_DeformationPL(): + myScaleFactor(1.0), + myMapScaleFactor(1.0) +{ + if(MYDEBUG) MESSAGE("VISU_DeformationPL()::VISU_DeformationPL() - "<SetScaleFactor(myScaleFactor); + + myVectorMergeFilter = VISU_MergeFilter::New(); + myVectorMergeFilter->SetMergingInputs(true); + myInputPassFilter = vtkPassThroughFilter::New(); + myOutputPassFiler = vtkPassThroughFilter::New(); + myCellDataToPointData = vtkCellDataToPointData::New(); + myCellDataToPointData->PassCellDataOn(); + + myInputPassFilter->SetInput(vtkUnstructuredGrid::New()); + + myCellDataToPointData->SetInput(myInputPassFilter->GetOutput()); + + myWarpVector->SetInput(myCellDataToPointData->GetOutput()); + + myOutputPassFiler->SetInput(myWarpVector->GetOutput()); +} + +//---------------------------------------------------------------------------- +VISU_DeformationPL::~VISU_DeformationPL() +{ + if(MYDEBUG) MESSAGE("VISU_DeformationPL()::~VISU_DeformationPL() - "<Delete(); + myVectorMergeFilter->Delete(); + myInputPassFilter->Delete(); + myOutputPassFiler->Delete(); + myCellDataToPointData->Delete(); +} + + +//---------------------------------------------------------------------------- +unsigned long int +VISU_DeformationPL::GetMTime(){ + unsigned long int aTime = std::max(myWarpVector->GetMTime(), + myVectorMergeFilter->GetMTime()); + + aTime = std::max(aTime,myInputPassFilter->GetMTime()); + aTime = std::max(aTime,myOutputPassFiler->GetMTime()); + aTime = std::max(aTime,myCellDataToPointData->GetMTime()); +} + +//---------------------------------------------------------------------------- +void VISU_DeformationPL::SetScale(vtkFloatingPointType theScaleFactor) +{ + if(myScaleFactor == theScaleFactor) + return; + myScaleFactor = theScaleFactor; + myWarpVector->SetScaleFactor(myScaleFactor*myMapScaleFactor); +} + +void VISU_DeformationPL::SetMapScale(vtkFloatingPointType theMapScaleFactor) +{ + if(myMapScaleFactor == theMapScaleFactor) + return; + myMapScaleFactor = theMapScaleFactor; + + myWarpVector->SetScaleFactor(myScaleFactor*myMapScaleFactor); +} + + +vtkFloatingPointType VISU_DeformationPL::GetScale() +{ + return myScaleFactor; +} + +//---------------------------------------------------------------------------- +void VISU_DeformationPL::SetWarpVectorInput(vtkDataSet *theInput) +{ + myInputPassFilter->SetInput(theInput); +} + +//---------------------------------------------------------------------------- +vtkDataSet* VISU_DeformationPL::GetWarpVectorOutput() +{ + return myOutputPassFiler->GetOutput(); +} + +//---------------------------------------------------------------------------- +void VISU_DeformationPL::SetMergeFilterInput(vtkDataSet* ScalarInput, + vtkDataSet* VectorialInput) +{ + myVectorMergeFilter->SetScalars(ScalarInput); + myVectorMergeFilter->AddField("VISU_CELLS_MAPPER",ScalarInput); + myVectorMergeFilter->AddField("VISU_POINTS_MAPPER",ScalarInput); + + myVectorMergeFilter->SetGeometry(VectorialInput); + myVectorMergeFilter->SetVectors(VectorialInput); +} + +//---------------------------------------------------------------------------- +vtkDataSet* VISU_DeformationPL::GetMergeFilterOutput(){ + return myVectorMergeFilter->GetOutput(); +} + +//---------------------------------------------------------------------------- +vtkFloatingPointType VISU_DeformationPL::GetDefaultScaleFactor(VISU_DeformationPL *thePipeLine) +{ + if(!thePipeLine || !thePipeLine->GetMergeFilterOutput()) + return 0.0; + + vtkFloatingPointType aSourceRange[2]; + thePipeLine->GetMergeFilterOutput()->GetScalarRange(aSourceRange); + + static vtkFloatingPointType EPS = 1.0 / VTK_LARGE_FLOAT; + if(fabs(aSourceRange[1]) > EPS){ + vtkDataSet* aDataSet = thePipeLine->GetMergeFilterOutput(); + vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor(aDataSet); + return aScaleFactor / aSourceRange[1]; + } + return 0.0; +} + diff --git a/src/PIPELINE/VISU_DeformationPL.hxx b/src/PIPELINE/VISU_DeformationPL.hxx new file mode 100755 index 00000000..e18f43e3 --- /dev/null +++ b/src/PIPELINE/VISU_DeformationPL.hxx @@ -0,0 +1,87 @@ +// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : VISU_DeformationPL.hxx +// Author : +// Module : SALOME + +#ifndef VISU_DeformationPL_HeaderFile +#define VISU_DeformationPL_HeaderFile + +#include "VISUPipeline.hxx" +#include "VISU_MapperHolder.hxx" +#include + +class vtkDataSet; +class VISU_MergeFilter; +class vtkPassThroughFilter; +class vtkWarpVector; +class vtkCellDataToPointData; + +class VISU_PIPELINE_EXPORT VISU_DeformationPL { + +public: + VISU_DeformationPL(); + virtual ~VISU_DeformationPL(); + + //----------------------------------------------------------- + virtual void SetScale(vtkFloatingPointType theScaleFactor); + virtual void SetMapScale(vtkFloatingPointType theMapScaleFactor); + virtual vtkFloatingPointType GetScale(); + + //----------------------------------------------------------- + virtual void SetVectorialField(VISU::PUnstructuredGridIDMapper theIdMapper) = 0; + virtual VISU::PUnstructuredGridIDMapper getVectorialField() = 0; + + + //----------------------------------------------------------- + virtual + unsigned + long int + GetMTime(); + + static vtkFloatingPointType GetDefaultScaleFactor(VISU_DeformationPL *thePipeLine); + + void SetWarpVectorInput(vtkDataSet *theInput); + vtkDataSet* GetWarpVectorOutput(); + + //----------------------------------------------------------- + void SetMergeFilterInput(vtkDataSet* ScalarInput, + vtkDataSet* VectorialInput); + + vtkDataSet* GetMergeFilterOutput(); + +protected: + + VISU::PUnstructuredGridIDMapper myVectorialField; + vtkWarpVector *myWarpVector; + vtkSmartPointer myVectorMergeFilter; + vtkPassThroughFilter *myInputPassFilter; + vtkPassThroughFilter *myOutputPassFiler; + vtkCellDataToPointData *myCellDataToPointData; + +private: + vtkFloatingPointType myScaleFactor; + vtkFloatingPointType myMapScaleFactor; + +}; + +#endif diff --git a/src/PIPELINE/VISU_DeformedGridPL.cxx b/src/PIPELINE/VISU_DeformedGridPL.cxx new file mode 100644 index 00000000..72f40c58 --- /dev/null +++ b/src/PIPELINE/VISU_DeformedGridPL.cxx @@ -0,0 +1,238 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File: VISU_DeformedGridPL.cxx +// Author: Alexey PETROV +// Module : VISU + + +#include "VISU_DeformedGridPL.hxx" +#include "VISU_FieldTransform.hxx" +#include "VISU_Plot3DPL.hxx" + +#include "VISU_PipeLineUtils.hxx" + +#include +#include +#include + + +//---------------------------------------------------------------------------- +vtkStandardNewMacro(VISU_DeformedGridPL); + + +//---------------------------------------------------------------------------- +VISU_DeformedGridPL +::VISU_DeformedGridPL(): + myContourFilter(vtkContourFilter::New()), + myWarpScalar(vtkWarpScalar::New()), + myIsContour(false), + myScaleFactor(1.0), + myMapScaleFactor(1.0) +{ + SetIsShrinkable(false); + SetNumberOfContours(32); +} + + +//---------------------------------------------------------------------------- +VISU_DeformedGridPL +::~VISU_DeformedGridPL() +{} + + +//---------------------------------------------------------------------------- +unsigned long int +VISU_DeformedGridPL +::GetMTime() +{ + unsigned long int aTime = Superclass::GetMTime(); + + aTime = std::max(aTime, myContourFilter->GetMTime()); + aTime = std::max(aTime, myWarpScalar->GetMTime()); + + return aTime; +} + + +//---------------------------------------------------------------------------- +unsigned long int +VISU_DeformedGridPL +::GetMemorySize() +{ + unsigned long int aSize = Superclass::GetMemorySize(); + + if(vtkDataObject* aDataObject = myContourFilter->GetInput()) + aSize += aDataObject->GetActualMemorySize() * 1024; + + if(vtkDataObject* aDataObject = myWarpScalar->GetInput()) + aSize += aDataObject->GetActualMemorySize() * 1024; + + return aSize; +} + + +//---------------------------------------------------------------------------- +void +VISU_DeformedGridPL +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) +{ + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); + + if(VISU_DeformedGridPL *aPipeLine = dynamic_cast(thePipeLine)){ + SetScaleFactor( aPipeLine->GetScaleFactor() ); + SetContourPrs( aPipeLine->GetIsContourPrs() ); + SetNumberOfContours( aPipeLine->GetNumberOfContours() ); + } +} + + +//---------------------------------------------------------------------------- +void +VISU_DeformedGridPL +::Init() +{ + Superclass::Init(); + + vtkPointSet* aPointSet = GetFieldTransformFilter()->GetPolyDataOutput(); + SetScaleFactor( VISU_Plot3DPL::GetScaleFactor( this, aPointSet ) ); +} + + +//---------------------------------------------------------------------------- +void +VISU_DeformedGridPL +::Build() +{ + Superclass::Build(); + + myWarpScalar->SetInput( GetFieldTransformFilter()->GetPolyDataOutput() ); + GetPolyDataMapper()->SetInput( myWarpScalar->GetPolyDataOutput() ); +} + + +//---------------------------------------------------------------------------- +void +VISU_DeformedGridPL +::Update() +{ + vtkPointSet* aPointSet = GetFieldTransformFilter()->GetPolyDataOutput(); + if ( !myIsContour ) // surface prs + { + myWarpScalar->SetInput( aPointSet ); + } + else // contour prs + { + myContourFilter->SetInput( aPointSet ); + + vtkFloatingPointType aScalarRange[2]; + GetSourceRange( aScalarRange ); + + myContourFilter->GenerateValues( GetNumberOfContours(), aScalarRange ); + myWarpScalar->SetInput( myContourFilter->GetOutput() ); + } + + Superclass::Update(); +} + + +//---------------------------------------------------------------------------- +void +VISU_DeformedGridPL +::SetNumberOfContours(int theNumber) +{ + myContourFilter->SetNumberOfContours(theNumber); +} + + +//---------------------------------------------------------------------------- +int +VISU_DeformedGridPL +::GetNumberOfContours() +{ + return myContourFilter->GetNumberOfContours(); +} + + +//---------------------------------------------------------------------------- +void +VISU_DeformedGridPL +::SetScaleFactor(vtkFloatingPointType theScaleFactor) +{ + if ( VISU::CheckIsSameValue( myWarpScalar->GetScaleFactor(), theScaleFactor ) ) + return; + + myScaleFactor = theScaleFactor; + myWarpScalar->SetScaleFactor(theScaleFactor*myMapScaleFactor); +} + + +//---------------------------------------------------------------------------- +vtkFloatingPointType +VISU_DeformedGridPL +::GetScaleFactor() +{ + return myScaleFactor; +} + + +//---------------------------------------------------------------------------- +void +VISU_DeformedGridPL +::SetContourPrs(bool theIsContourPrs ) +{ + if(myIsContour == theIsContourPrs) + return; + + myIsContour = theIsContourPrs; + Modified(); +} + + +//---------------------------------------------------------------------------- +bool +VISU_DeformedGridPL +::GetIsContourPrs() +{ + return myIsContour; +} + + +//---------------------------------------------------------------------------- +void +VISU_DeformedGridPL +::SetMapScale(vtkFloatingPointType theMapScale) +{ + Superclass::SetMapScale(theMapScale); + myMapScaleFactor = theMapScale; + + if ( myIsContour ) { + vtkFloatingPointType aSourceRange[2]; + GetSourceRange( aSourceRange ); + vtkFloatingPointType aDeltaRange = aSourceRange[1] - aSourceRange[0]; + vtkFloatingPointType aNewRange[2] = { aSourceRange[1] - theMapScale*aDeltaRange, aSourceRange[1] }; + myContourFilter->GenerateValues( GetNumberOfContours(), aNewRange ); + } + + myWarpScalar->SetScaleFactor( myScaleFactor * theMapScale ); +} diff --git a/src/PIPELINE/VISU_DeformedGridPL.hxx b/src/PIPELINE/VISU_DeformedGridPL.hxx new file mode 100644 index 00000000..4f325949 --- /dev/null +++ b/src/PIPELINE/VISU_DeformedGridPL.hxx @@ -0,0 +1,117 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File: VISU_ScalarMapPL.hxx +// Author: Alexey PETROV +// Module : VISU + +#ifndef VISU_DeformedGridPL_HeaderFile +#define VISU_DeformedGridPL_HeaderFile + +#include "VISUPipeline.hxx" +#include "VISU_PolyDataPL.hxx" + +class vtkWarpScalar; +class vtkContourFilter; + + +//---------------------------------------------------------------------------- +class VISU_PIPELINE_EXPORT VISU_DeformedGridPL : public VISU_PolyDataPL +{ +public: + vtkTypeMacro(VISU_DeformedGridPL, VISU_PolyDataPL); + + static + VISU_DeformedGridPL* + New(); + + //---------------------------------------------------------------------------- + virtual + unsigned long int + GetMTime(); + + //! Gets memory size used by the instance (bytes). + virtual + unsigned long int + GetMemorySize(); + + //---------------------------------------------------------------------------- + void + SetScaleFactor( vtkFloatingPointType theScaleFactor ); + + vtkFloatingPointType + GetScaleFactor(); + + void + SetContourPrs( bool theIsContourPrs ); + + bool + GetIsContourPrs(); + + void + SetNumberOfContours( int theNumber ); + + int + GetNumberOfContours(); + + virtual + void + SetMapScale(vtkFloatingPointType theMapScale = 1.0); + + //---------------------------------------------------------------------------- + virtual + void + Init(); + + virtual + void + Update(); + +protected: + //---------------------------------------------------------------------------- + VISU_DeformedGridPL(); + + virtual + ~VISU_DeformedGridPL(); + + virtual + void + Build(); + + virtual + void + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); + +private: + VISU_DeformedGridPL(const VISU_DeformedGridPL&); // Not implemented. + void operator=(const VISU_DeformedGridPL&); // Not implemented. + + vtkFloatingPointType myScaleFactor; + vtkFloatingPointType myMapScaleFactor; + vtkContourFilter* myContourFilter; + vtkWarpScalar *myWarpScalar; + bool myIsContour; +}; + +#endif diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx new file mode 100644 index 00000000..b807671e --- /dev/null +++ b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx @@ -0,0 +1,372 @@ +// VISU DeformedShapeAndScalarMapPL +// +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File: VISU_DeformedShapeAndScalarMapPL.cxx +// Author: Eugeny Nikolaev +// Module : VISU + +#include "VISU_DeformedShapeAndScalarMapPL.hxx" +#include "VISU_FieldTransform.hxx" +#include "VISU_Extractor.hxx" +#include "VISU_LookupTable.hxx" +#include "VISU_DeformedShapePL.hxx" +#include "VTKViewer_TransformFilter.h" +#include "VTKViewer_Transform.h" +#include "VISU_MergeFilter.hxx" +#include "VISU_ElnoDisassembleFilter.hxx" +#include "VISU_PipeLineUtils.hxx" + +#include +#include +#include +#include + + +//---------------------------------------------------------------------------- +vtkStandardNewMacro(VISU_DeformedShapeAndScalarMapPL) + +//---------------------------------------------------------------------------- +/*! + * Constructor. Creating new instances of vtkWarpVector,vtkMergeFilter,vtkUnstructuredGrid + * Where: + * \li myDeformVectors is vtkWarpVector - deformation vectors data + * \li myScalarsMergeFilter is vtkMergeFilter - merge filter. + * Merge filter which unify the deformation and scalars + * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data +*/ +VISU_DeformedShapeAndScalarMapPL +::VISU_DeformedShapeAndScalarMapPL(): + myScaleFactor(1.0), + myMapScaleFactor(1.0) +{ + myWarpVector = vtkWarpVector::New(); + + myScalarsMergeFilter = VISU_MergeFilter::New(); + myScalarsMergeFilter->SetMergingInputs(true); + + myScalarsExtractor = VISU_Extractor::New(); + + myScalarsFieldTransform = VISU_FieldTransform::New(); + + myCellDataToPointData = vtkCellDataToPointData::New(); + myScalarsElnoDisassembleFilter = VISU_ElnoDisassembleFilter::New(); +} + +//---------------------------------------------------------------------------- +/*! + * Destructor. + * Delete all fields. +*/ +VISU_DeformedShapeAndScalarMapPL +::~VISU_DeformedShapeAndScalarMapPL() +{ + myWarpVector->Delete(); + + myScalarsMergeFilter->Delete(); + + myScalarsExtractor->Delete(); + + myScalarsFieldTransform->Delete(); + + myCellDataToPointData->Delete(); +} + +//---------------------------------------------------------------------------- +/*! + * Initial method + */ +void +VISU_DeformedShapeAndScalarMapPL +::Init() +{ + Superclass::Init(); + + SetScale(VISU_DeformedShapePL::GetDefaultScale(this)); +} + +//---------------------------------------------------------------------------- +/*! + * Build method + * Building of deformation and puts result to merge filter. + */ +void +VISU_DeformedShapeAndScalarMapPL +::Build() +{ + Superclass::Build(); +} + + +//---------------------------------------------------------------------------- +vtkDataSet* +VISU_DeformedShapeAndScalarMapPL +::InsertCustomPL() +{ + GetMapper()->SetColorModeToMapScalars(); + GetMapper()->ScalarVisibilityOn(); + + VISU::CellDataToPoint(myWarpVector, + myCellDataToPointData, + GetMergedInput()); + + myScalars = GetMergedInput(); + + UpdateScalars(); + + myScalarsFieldTransform->SetInput(myScalarsExtractor->GetOutput()); + + // Sets geometry for merge filter + myScalarsMergeFilter->SetGeometry(myWarpVector->GetUnstructuredGridOutput()); + + vtkDataSet* aScalarsDataSet = myScalarsFieldTransform->GetOutput(); + myScalarsMergeFilter->SetScalars(aScalarsDataSet); + myScalarsMergeFilter->AddField("VISU_CELLS_MAPPER", aScalarsDataSet); + myScalarsMergeFilter->AddField("VISU_POINTS_MAPPER", aScalarsDataSet); + + return myScalarsMergeFilter->GetOutput(); +} + + +//---------------------------------------------------------------------------- +/*! + * Update method + */ +void +VISU_DeformedShapeAndScalarMapPL +::Update() +{ + Superclass::Update(); + //{ + // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsExtractor.vtk"; + // VISU::WriteToFile(myScalarsExtractor->GetUnstructuredGridOutput(), aFileName); + //} + //{ + // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myWarpVector.vtk"; + // VISU::WriteToFile(myWarpVector->GetUnstructuredGridOutput(), aFileName); + //} + //{ + // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsMergeFilter.vtk"; + // VISU::WriteToFile(myScalarsMergeFilter->GetUnstructuredGridOutput(), aFileName); + //} +} + +//---------------------------------------------------------------------------- +unsigned long int +VISU_DeformedShapeAndScalarMapPL +::GetMemorySize() +{ + unsigned long int aSize = Superclass::GetMemorySize(); + + if(vtkDataSet* aDataSet = myWarpVector->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; + + if(vtkDataSet* aDataSet = myScalarsExtractor->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; + + if(vtkDataSet* aDataSet = myScalarsMergeFilter->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; + + if(myCellDataToPointData->GetInput()) + if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; + + return aSize; +} + +//---------------------------------------------------------------------------- +/*! + * Update scalars method. + * Put scalars to merge filter. + */ +void +VISU_DeformedShapeAndScalarMapPL +::UpdateScalars() +{ + vtkDataSet* aScalars = GetScalars(); + myScalarsElnoDisassembleFilter->SetInput(aScalars); + myScalarsExtractor->SetInput(myScalarsElnoDisassembleFilter->GetOutput()); + + if(VISU::IsDataOnCells(myScalarsElnoDisassembleFilter->GetOutput())) + GetMapper()->SetScalarModeToUseCellData(); + else + GetMapper()->SetScalarModeToUsePointData(); +} + +//---------------------------------------------------------------------------- +/*! + * Copy information about pipline. + * Copy scale and scalars. + */ +void +VISU_DeformedShapeAndScalarMapPL +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) +{ + Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); + + if(VISU_DeformedShapeAndScalarMapPL *aPipeLine = dynamic_cast(thePipeLine)){ + SetScale(aPipeLine->GetScale()); + SetScalars(aPipeLine->GetScalars()); + } +} + +//---------------------------------------------------------------------------- +/*! + * Set scalars. + * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction. + */ +void +VISU_DeformedShapeAndScalarMapPL +::SetScalars(vtkDataSet *theScalars) +{ + if(GetScalars() == theScalars) + return; + + myScalars = theScalars; + UpdateScalars(); +} + +//---------------------------------------------------------------------------- +/*! + * Get pointer to input scalars. + */ +vtkDataSet* +VISU_DeformedShapeAndScalarMapPL +::GetScalars() +{ + return myScalars.GetPointer(); +} + +//---------------------------------------------------------------------------- +/*! + * Sets scale for deformed shape + */ +void +VISU_DeformedShapeAndScalarMapPL +::SetScale(vtkFloatingPointType theScale) +{ + if(VISU::CheckIsSameValue(myScaleFactor, theScale)) + return; + + myScaleFactor = theScale; + myWarpVector->SetScaleFactor(theScale*myMapScaleFactor); +} + +//---------------------------------------------------------------------------- +/*! + * Gets scale of deformed shape. + */ +vtkFloatingPointType +VISU_DeformedShapeAndScalarMapPL +::GetScale() +{ + return myScaleFactor; +} + +//---------------------------------------------------------------------------- +/*! + * Set scale factor of deformation. + */ +void +VISU_DeformedShapeAndScalarMapPL +::SetMapScale(vtkFloatingPointType theMapScale) +{ + myMapScaleFactor = theMapScale; + Superclass::SetMapScale(theMapScale); + myWarpVector->SetScaleFactor(myScaleFactor*theMapScale); +} + +//---------------------------------------------------------------------------- +/*! + * Gets scalar mode. + */ +int +VISU_DeformedShapeAndScalarMapPL +::GetScalarMode() +{ + return myScalarsExtractor->GetScalarMode(); +} + +//---------------------------------------------------------------------------- +/*! + * Sets scalar mode. + */ +void +VISU_DeformedShapeAndScalarMapPL +::SetScalarMode(int theScalarMode) +{ + VISU_ScalarMapPL::SetScalarMode(theScalarMode, GetScalars(), myScalarsExtractor); +} + +//---------------------------------------------------------------------------- +void +VISU_DeformedShapeAndScalarMapPL +::SetScaling(int theScaling) +{ + if(GetScaling() == theScaling) + return; + + GetBarTable()->SetScale(theScaling); + + if(theScaling == VTK_SCALE_LOG10) + myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Log10)); + else + myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Ident)); +} + + +//---------------------------------------------------------------------------- +void +VISU_DeformedShapeAndScalarMapPL +::SetScalarRange(vtkFloatingPointType theRange[2]) +{ + if(VISU::CheckIsSameRange(theRange, GetScalarRange())) + return; + + myScalarsFieldTransform->SetScalarRange(theRange); + GetBarTable()->SetRange(theRange); +} + + +//---------------------------------------------------------------------------- +vtkFloatingPointType* +VISU_DeformedShapeAndScalarMapPL +::GetScalarRange() +{ + return myScalarsFieldTransform->GetScalarRange(); +} + + +//---------------------------------------------------------------------------- +/*! + * Gets ranges of extracted scalars + * \param theRange[2] - output values + * \li theRange[0] - minimum value + * \li theRange[1] - maximum value + */ +void +VISU_DeformedShapeAndScalarMapPL +::GetSourceRange(vtkFloatingPointType theRange[2]) +{ + myScalarsExtractor->Update(); + myScalarsExtractor->GetUnstructuredGridOutput()->GetScalarRange(theRange); +} diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx new file mode 100644 index 00000000..b3d454a2 --- /dev/null +++ b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx @@ -0,0 +1,149 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File: VISU_DeformedShapeAndScalarMapPL.hxx +// Author: Eugeny Nikolaev +// Module : VISU + +#ifndef VISU_DeformedShapeAndScalarMapPL_HeaderFile +#define VISU_DeformedShapeAndScalarMapPL_HeaderFile + +#include "VISUPipeline.hxx" +#include "VISU_ScalarMapPL.hxx" + +class VISU_MergeFilter; +class vtkWarpVector; +class vtkUnstructuredGrid; +class vtkCellDataToPointData; +class vtkPointDataToCellData; +class VISU_ElnoDisassembleFilter; + + +//---------------------------------------------------------------------------- +class VISU_PIPELINE_EXPORT VISU_DeformedShapeAndScalarMapPL : public VISU_ScalarMapPL +{ +public: + vtkTypeMacro(VISU_DeformedShapeAndScalarMapPL, VISU_ScalarMapPL); + + static + VISU_DeformedShapeAndScalarMapPL* + New(); + + virtual + void + SetScale(vtkFloatingPointType theScale); + + virtual + vtkFloatingPointType + GetScale(); + + virtual + int + GetScalarMode(); + + virtual + void + SetScalarMode(int theScalarMode = 0); + + virtual + void + SetScaling(int theScaling); + + virtual + void + SetScalarRange(vtkFloatingPointType theRange[2]); + + virtual + vtkFloatingPointType* + GetScalarRange(); + + virtual + void + GetSourceRange(vtkFloatingPointType theRange[2]); + + virtual + void + SetScalars(vtkDataSet *theScalars); + + virtual + vtkDataSet* + GetScalars(); + +public: + //! Redefined method for initialization of the pipeline. + virtual + void + Init(); + + //! Redefined method for building the pipeline. + virtual + void + Build(); + + //! Redefined method for updating the pipeline. + virtual + void + Update(); + + //! Gets memory size used by the instance (bytes). + virtual + unsigned long int + GetMemorySize(); + + //! Update scalars. + void + UpdateScalars(); + + virtual + void + SetMapScale(vtkFloatingPointType theMapScale = 1.0); + +protected: + VISU_DeformedShapeAndScalarMapPL(); + + virtual + ~VISU_DeformedShapeAndScalarMapPL(); + + virtual + vtkDataSet* + InsertCustomPL(); + + virtual + void + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); + +private: + VISU_DeformedShapeAndScalarMapPL(const VISU_DeformedShapeAndScalarMapPL&); + + vtkFloatingPointType myScaleFactor; + vtkFloatingPointType myMapScaleFactor; + vtkWarpVector *myWarpVector; + VISU_MergeFilter *myScalarsMergeFilter; + vtkSmartPointer myScalars; + vtkCellDataToPointData* myCellDataToPointData; + VISU_FieldTransform* myScalarsFieldTransform; + VISU_Extractor* myScalarsExtractor; + VISU_ElnoDisassembleFilter* myScalarsElnoDisassembleFilter; +}; + +#endif diff --git a/src/PIPELINE/VISU_ElnoAssembleFilter.cxx b/src/PIPELINE/VISU_ElnoAssembleFilter.cxx new file mode 100644 index 00000000..be843ed3 --- /dev/null +++ b/src/PIPELINE/VISU_ElnoAssembleFilter.cxx @@ -0,0 +1,171 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com + +#include "VISU_ElnoAssembleFilter.hxx" +#include "VISU_PipeLineUtils.hxx" +#include "VISU_ElnoMeshValue.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include + + +//---------------------------------------------------------------------------- +vtkStandardNewMacro( VISU_ElnoAssembleFilter ); + + +//---------------------------------------------------------------------------- +VISU_ElnoAssembleFilter::VISU_ElnoAssembleFilter() +{ + this->SetInputArrayToProcess( 0, // idx + 0, // port + 0, // connection + vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association + "ELNO_POINT_COORDS" ); // name + + this->myIsRestorePoints = false; +} + + +//---------------------------------------------------------------------------- +VISU_ElnoAssembleFilter::~VISU_ElnoAssembleFilter() +{} + + +//---------------------------------------------------------------------------- +void VISU_ElnoAssembleFilter::SetElnoAssembleState( bool theIsRestorePoints ) +{ + if ( myIsRestorePoints == theIsRestorePoints ) + return; + + myIsRestorePoints = theIsRestorePoints; + this->Modified(); +} + +//---------------------------------------------------------------------------- +namespace +{ + //---------------------------------------------------------------------------- + template < int points_type, int elno_type > + int Execute2( vtkPointSet *theInput, + vtkPointSet *theOutput, + vtkDataArray *theElnoPointCoords ) + { + theOutput->CopyStructure( theInput ); + + vtkCellData *aCellData = theOutput->GetCellData(); + aCellData->PassData( theInput->GetCellData() ); + + vtkPointData *aPointData = theOutput->GetPointData(); + aPointData->PassData( theInput->GetPointData() ); + + vtkPoints *anInputPoints = theInput->GetPoints(); + vtkPoints *aPoints = anInputPoints->New( elno_type ); + vtkIdType aNbPoints = theInput->GetNumberOfPoints(); + aPoints->SetNumberOfPoints( aNbPoints ); + + typedef typename VISU::TL::TEnum2VTKArrayType< elno_type >::TResult TPointsDataArray; + typedef typename VISU::TL::TEnum2VTKBasicType< elno_type >::TResult TPointsDataType; + TPointsDataArray* anOutputPointsArray = TPointsDataArray::SafeDownCast( aPoints->GetData() ); + + TPointsDataArray* anElnoPointCoords = TPointsDataArray::SafeDownCast( theElnoPointCoords ); + + for ( vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++ ) { + TPointsDataType aCoords[ 3 ]; + anElnoPointCoords->GetTupleValue( aPointId, aCoords ); + anOutputPointsArray->SetTupleValue( aPointId, aCoords ); + } + + theOutput->SetPoints( aPoints ); + + return 1; + } + + + //---------------------------------------------------------------------------- + template < int points_type > + int Execute( vtkPointSet *theInput, + vtkPointSet *theOutput, + vtkDataArray *theElnoPointCoords ) + { + switch( theElnoPointCoords->GetDataType() ){ + case VTK_DOUBLE: + return Execute2< points_type, VTK_DOUBLE >( theInput, theOutput, theElnoPointCoords ); + case VTK_FLOAT: + return Execute2< points_type, VTK_FLOAT >( theInput, theOutput, theElnoPointCoords ); + case VTK_INT: + return Execute2< points_type, VTK_INT >( theInput, theOutput, theElnoPointCoords ); + case VTK_LONG: + return Execute2< points_type, VTK_LONG >( theInput, theOutput, theElnoPointCoords ); + default: + break; + } + + return 0; + } + + + //---------------------------------------------------------------------------- +} + + +//---------------------------------------------------------------------------- +int VISU_ElnoAssembleFilter::RequestData( vtkInformation *vtkNotUsed(request), + vtkInformationVector **inputVector, + vtkInformationVector *outputVector ) +{ + // get the info objects + vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); + vtkInformation *outInfo = outputVector->GetInformationObject(0); + + // get the input and ouptut + vtkPointSet *anInput = vtkPointSet::SafeDownCast( inInfo->Get( vtkDataObject::DATA_OBJECT() ) ); + vtkPointSet *anOutput = vtkPointSet::SafeDownCast( outInfo->Get( vtkDataObject::DATA_OBJECT() ) ); + + vtkDataArray *anElnoPointCoords = this->GetInputArrayToProcess( 0, inputVector ); + + if ( !myIsRestorePoints || !anElnoPointCoords ) { + anOutput->ShallowCopy( anInput ); + return 1; + } + + vtkPoints *aPoints = anInput->GetPoints(); + switch( aPoints->GetDataType() ){ + case VTK_DOUBLE: + return ::Execute< VTK_DOUBLE >( anInput, anOutput, anElnoPointCoords ); + case VTK_FLOAT: + return ::Execute< VTK_FLOAT >( anInput, anOutput, anElnoPointCoords ); + case VTK_INT: + return ::Execute< VTK_INT >( anInput, anOutput, anElnoPointCoords ); + case VTK_LONG: + return ::Execute< VTK_LONG >( anInput, anOutput, anElnoPointCoords ); + default: + break; + } + + return 0; +} + + +//---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_ElnoAssembleFilter.hxx b/src/PIPELINE/VISU_ElnoAssembleFilter.hxx new file mode 100644 index 00000000..8f586c66 --- /dev/null +++ b/src/PIPELINE/VISU_ElnoAssembleFilter.hxx @@ -0,0 +1,47 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com + +#ifndef VISU_ElnoAssembleFilter_H +#define VISU_ElnoAssembleFilter_H + +#include + +class VISU_ElnoAssembleFilter : public vtkPointSetAlgorithm +{ +public: + typedef vtkPointSetAlgorithm Superclass; + + static VISU_ElnoAssembleFilter *New(); + + void SetElnoAssembleState( bool theIsRestorePoints ); + +protected: + VISU_ElnoAssembleFilter(); + ~VISU_ElnoAssembleFilter(); + + int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); + + bool myIsRestorePoints; + +private: + VISU_ElnoAssembleFilter(const VISU_ElnoAssembleFilter&); // Not implemented. + void operator=(const VISU_ElnoAssembleFilter&); // Not implemented. +}; + +#endif diff --git a/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx b/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx new file mode 100644 index 00000000..eb84ca41 --- /dev/null +++ b/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx @@ -0,0 +1,400 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com + +#include "VISU_ElnoDisassembleFilter.hxx" +#include "VISU_PipeLineUtils.hxx" +#include "VISU_ElnoMeshValue.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include + + +//---------------------------------------------------------------------------- +vtkStandardNewMacro( VISU_ElnoDisassembleFilter ); + + +//---------------------------------------------------------------------------- +VISU_ElnoDisassembleFilter::VISU_ElnoDisassembleFilter() +{ + this->SetInputArrayToProcess( 0, // idx + 0, // port + 0, // connection + vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association + "ELNO_FIELD" ); // name + + this->SetInputArrayToProcess( 1, // idx + 0, // port + 0, // connection + vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association + "ELNO_COMPONENT_MAPPER" ); // name + + this->myShrinkFactor = -0.999; +} + + +//---------------------------------------------------------------------------- +VISU_ElnoDisassembleFilter::~VISU_ElnoDisassembleFilter() +{} + + +//---------------------------------------------------------------------------- +void VISU_ElnoDisassembleFilter::SetShrinkFactor( vtkFloatingPointType theValue ) +{ + if ( VISU::CheckIsSameValue( theValue, myShrinkFactor ) ) + return; + + myShrinkFactor = theValue; + this->Modified(); +} + + +//---------------------------------------------------------------------------- +vtkFloatingPointType VISU_ElnoDisassembleFilter::GetShrinkFactor() +{ + return myShrinkFactor; +} + + +//---------------------------------------------------------------------------- +namespace +{ + //---------------------------------------------------------------------------- + template < int points_type, int elno_type > + struct TExecute2 + { + vtkUnstructuredGrid *myInput; + vtkUnstructuredGrid *myOutput; + vtkDataArray *myElnoDataArray; + vtkDataArray *myElnoDataMapper; + vtkFloatingPointType myShrinkFactor; + + typedef typename VISU::TL::TEnum2VTKArrayType< points_type >::TResult TPointsDataArray; + typedef typename VISU::TL::TEnum2VTKBasicType< points_type >::TResult TPointsDataType; + + typedef typename VISU::TL::TEnum2VTKArrayType< elno_type >::TResult TElnoDataArray; + typedef typename VISU::TL::TEnum2VTKBasicType< elno_type >::TResult TElnoDataType; + + VISU::TGetElnoNodeData< elno_type > myGetElnoNodeData; + vtkCellArray *myConnectivity; + vtkPointData *myInputPointData; + vtkPointData *myOutputPointData; + TPointsDataArray *myInputPointsArray; + TPointsDataArray *myOutputPointsArray; + TElnoDataArray* myElnoFullDataArray; + TElnoDataArray* myElnoPartialDataArray; + TPointsDataArray *myElnoPointCoords; + vtkIntArray* myInputPointsMapper; + vtkIntArray* myOutputPointsMapper; + + //---------------------------------------------------------------------------- + TExecute2( vtkUnstructuredGrid *theInput, + vtkUnstructuredGrid *theOutput, + vtkDataArray *theElnoDataArray, + vtkDataArray *theElnoDataMapper, + vtkFloatingPointType theShrinkFactor ) + : myGetElnoNodeData( theElnoDataArray, theElnoDataMapper ) + , myInput( theInput ) + , myOutput( theOutput ) + , myElnoDataArray( theElnoDataArray ) + , myElnoDataMapper( theElnoDataMapper ) + , myShrinkFactor( theShrinkFactor ) + { + myConnectivity = vtkCellArray::New(); + myConnectivity->DeepCopy( theInput->GetCells() ); + + vtkPoints *anInputPoints = theInput->GetPoints(); + vtkPoints *aPoints = anInputPoints->New( anInputPoints->GetDataType() ); + vtkIdType aNbCells = myConnectivity->GetNumberOfCells(); + vtkIdType aNbPoints = myConnectivity->GetNumberOfConnectivityEntries() - aNbCells; + aPoints->Allocate( aNbPoints ); + + myInputPointsArray = TPointsDataArray::SafeDownCast( anInputPoints->GetData() ); + myOutputPointsArray = TPointsDataArray::SafeDownCast( aPoints->GetData() ); + + myInputPointData = theInput->GetPointData(); + myOutputPointData = theOutput->GetPointData(); + myOutputPointData->Allocate( aNbPoints ); + + vtkCellData *anInputCellData = theInput->GetCellData(); + + // To create a new copy of initial data for output + myElnoFullDataArray = TElnoDataArray::New(); + myElnoFullDataArray->SetName( "VISU_FIELD" ); + myElnoFullDataArray->SetNumberOfComponents( myGetElnoNodeData.getNbComp() ); + myElnoFullDataArray->SetNumberOfTuples( aNbPoints ); + + // To create a new copy of partial initial data for output + myElnoPartialDataArray = TElnoDataArray::New(); + // This partial data can be represented as in terms of vectors as scalars + if ( anInputCellData->GetVectors() != NULL ) + myElnoPartialDataArray->SetNumberOfComponents( 3 ); + else + myElnoPartialDataArray->SetNumberOfComponents( 1 ); + myElnoPartialDataArray->SetNumberOfTuples( aNbPoints ); + + myElnoPointCoords = TPointsDataArray::New(); + myElnoPointCoords->SetName( "ELNO_POINT_COORDS" ); + myElnoPointCoords->SetNumberOfComponents( 3 ); + myElnoPointCoords->SetNumberOfTuples( aNbPoints ); + + vtkDataArray* anArray = myInputPointData->GetArray( "VISU_POINTS_MAPPER" ); + myInputPointsMapper = vtkIntArray::SafeDownCast( anArray ); + + myOutputPointsMapper = vtkIntArray::New(); + myOutputPointsMapper->SetName( myInputPointsMapper->GetName() ); + myOutputPointsMapper->SetNumberOfComponents( myInputPointsMapper->GetNumberOfComponents() ); + myOutputPointsMapper->SetNumberOfTuples( aNbPoints ); + + if ( theShrinkFactor > 0.0 ) + this->ShrinkExecute(); + else + this->SimpleExecute(); + + theOutput->SetPoints( aPoints ); + + theOutput->SetCells( theInput->GetCellTypesArray(), + theInput->GetCellLocationsArray(), + myConnectivity ); + + myConnectivity->Delete(); + + vtkCellData *anOutputCellData = theOutput->GetCellData(); + anOutputCellData->PassData( anInputCellData ); + + anOutputCellData->RemoveArray( "ELNO_COMPONENT_MAPPER" ); + anOutputCellData->RemoveArray( "ELNO_FIELD" ); + anOutputCellData->RemoveArray( "VISU_FIELD" ); + anOutputCellData->SetVectors( NULL ); + + //anOutputPointData->PassData( anInputPointData ); + + myOutputPointData->AddArray( myElnoFullDataArray ); + myElnoFullDataArray->Delete(); + + if ( anInputCellData->GetVectors() != NULL ) + myOutputPointData->SetVectors( myElnoPartialDataArray ); + else + myOutputPointData->SetScalars( myElnoPartialDataArray ); + myElnoPartialDataArray->Delete(); + + myOutputPointData->AddArray( myElnoPointCoords ); + myElnoPointCoords->Delete(); + + myOutputPointData->AddArray( myOutputPointsMapper ); + myOutputPointsMapper->Delete(); + } + + //---------------------------------------------------------------------------- + void SimpleExecute() + { + // To reserve a temproary value holder + vtkIdType aNbComp = std::max( 3, myGetElnoNodeData.getNbComp() ); + std::vector< TElnoDataType > anElnoDataValues( aNbComp ); + + std::vector< int > anPointsMapperValues( myInputPointsMapper->GetNumberOfComponents() ); + + myConnectivity->InitTraversal(); + vtkIdType aNbPts = 0, *aPts = 0; + for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) { + for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) { + TPointsDataType aCoords[ 3 ]; + vtkIdType aCurrentPntId = aPts[ aPntId ]; + myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords ); + + aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aCoords ); + vtkIdType aNewPntId = aPts[ aPntId ]; + + myElnoPointCoords->SetTupleValue( aNewPntId, aCoords ); + + myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId ); + + TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId ); + myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData ); + + myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); + myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); + + myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] ); + myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] ); + } + } + } + + //---------------------------------------------------------------------------- + void ShrinkExecute() + { + // To reserve a temproary value holder + vtkIdType aNbComp = std::max( 3, myGetElnoNodeData.getNbComp() ); + std::vector< TElnoDataType > anElnoDataValues( aNbComp ); + + std::vector< int > anPointsMapperValues( myInputPointsMapper->GetNumberOfComponents() ); + + myConnectivity->InitTraversal(); + vtkIdType aNbPts = 0, *aPts = 0; + for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) { + + TPointsDataType aCenter[ 3 ] = { TPointsDataType(), TPointsDataType(), TPointsDataType() }; + + for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) { + TPointsDataType aCoords[ 3 ]; + myInputPointsArray->GetTupleValue( aPts[ aPntId ], aCoords ); + + aCenter[ 0 ] += aCoords[ 0 ]; + aCenter[ 1 ] += aCoords[ 1 ]; + aCenter[ 2 ] += aCoords[ 2 ]; + } + + aCenter[ 0 ] /= aNbPts; + aCenter[ 1 ] /= aNbPts; + aCenter[ 2 ] /= aNbPts; + + for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) { + TPointsDataType aCoords[ 3 ]; + vtkIdType aCurrentPntId = aPts[ aPntId ]; + myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords ); + + TPointsDataType aNewCoords[ 3 ]; + + aNewCoords[ 0 ] = aCenter[ 0 ] + + TPointsDataType( myShrinkFactor * ( aCoords[ 0 ] - aCenter[ 0 ] ) ); + aNewCoords[ 1 ] = aCenter[ 1 ] + + TPointsDataType( myShrinkFactor * ( aCoords[ 1 ] - aCenter[ 1 ] ) ); + aNewCoords[ 2 ] = aCenter[ 2 ] + + TPointsDataType( myShrinkFactor * ( aCoords[ 2 ] - aCenter[ 2 ] ) ); + + aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aNewCoords ); + vtkIdType aNewPntId = aPts[ aPntId ]; + + myElnoPointCoords->SetTupleValue( aNewPntId, aCoords ); + + myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId ); + + TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId ); + myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData ); + + myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); + myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); + + myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] ); + myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] ); + } + } + } + }; + + + //---------------------------------------------------------------------------- + template < int points_type, int elno_type > + int Execute2( vtkUnstructuredGrid *theInput, + vtkUnstructuredGrid *theOutput, + vtkDataArray *theElnoDataArray, + vtkDataArray *theElnoDataMapper, + vtkFloatingPointType theShrinkFactor ) + { + TExecute2< points_type, elno_type >( theInput, + theOutput, + theElnoDataArray, + theElnoDataMapper, + theShrinkFactor ); + + return 1; + } + + + //---------------------------------------------------------------------------- + template < int points_type > + int Execute( vtkUnstructuredGrid *theInput, + vtkUnstructuredGrid *theOutput, + vtkDataArray *theElnoDataArray, + vtkDataArray *theElnoDataMapper, + vtkFloatingPointType theShrinkFactor ) + { + switch( theElnoDataArray->GetDataType() ){ + case VTK_DOUBLE: + return Execute2< points_type, VTK_DOUBLE > + ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); + case VTK_FLOAT: + return Execute2< points_type, VTK_FLOAT > + ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); + case VTK_INT: + return Execute2< points_type, VTK_INT > + ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); + case VTK_LONG: + return Execute2< points_type, VTK_LONG > + ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); + default: + break; + } + + return 0; + } + + + //---------------------------------------------------------------------------- +} + + +//---------------------------------------------------------------------------- +int VISU_ElnoDisassembleFilter::RequestData( vtkInformation *vtkNotUsed(request), + vtkInformationVector **inputVector, + vtkInformationVector *outputVector ) +{ + // get the info objects + vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); + vtkInformation *outInfo = outputVector->GetInformationObject(0); + + // get the input and ouptut + vtkUnstructuredGrid *anInput = + vtkUnstructuredGrid::SafeDownCast( inInfo->Get( vtkDataObject::DATA_OBJECT() ) ); + vtkUnstructuredGrid *anOutput = + vtkUnstructuredGrid::SafeDownCast( outInfo->Get( vtkDataObject::DATA_OBJECT() ) ); + + vtkDataArray *anElnoDataArray = this->GetInputArrayToProcess( 0, inputVector ); + vtkDataArray *anElnoDataMapper = this->GetInputArrayToProcess( 1, inputVector ); + + if ( !anElnoDataArray ) { + anOutput->ShallowCopy( anInput ); + return 1; + } + + vtkPoints *aPoints = anInput->GetPoints(); + switch( aPoints->GetDataType() ){ + case VTK_DOUBLE: + return ::Execute< VTK_DOUBLE >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor ); + case VTK_FLOAT: + return ::Execute< VTK_FLOAT >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor ); + case VTK_INT: + return ::Execute< VTK_INT >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor ); + case VTK_LONG: + return ::Execute< VTK_LONG >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor ); + default: + break; + } + + return 0; +} + + +//---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_ElnoDisassembleFilter.hxx b/src/PIPELINE/VISU_ElnoDisassembleFilter.hxx new file mode 100644 index 00000000..0053c13e --- /dev/null +++ b/src/PIPELINE/VISU_ElnoDisassembleFilter.hxx @@ -0,0 +1,48 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com + +#ifndef VISU_ElnoDisassembleFilter_H +#define VISU_ElnoDisassembleFilter_H + +#include + +class VISU_ElnoDisassembleFilter : public vtkUnstructuredGridAlgorithm +{ +public: + typedef vtkUnstructuredGridAlgorithm Superclass; + + static VISU_ElnoDisassembleFilter *New(); + + void SetShrinkFactor( vtkFloatingPointType theValue ); + vtkFloatingPointType GetShrinkFactor(); + +protected: + VISU_ElnoDisassembleFilter(); + ~VISU_ElnoDisassembleFilter(); + + int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); + + vtkFloatingPointType myShrinkFactor; + +private: + VISU_ElnoDisassembleFilter(const VISU_ElnoDisassembleFilter&); // Not implemented. + void operator=(const VISU_ElnoDisassembleFilter&); // Not implemented. +}; + +#endif diff --git a/src/PIPELINE/VISU_LabelPointsFilter.cxx b/src/PIPELINE/VISU_LabelPointsFilter.cxx new file mode 100644 index 00000000..040d6a23 --- /dev/null +++ b/src/PIPELINE/VISU_LabelPointsFilter.cxx @@ -0,0 +1,296 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File: VISU_LabelPointsFilter.cxx +// Author: Vitaly Smetannikov +// Module : VISU + + + +#include "VISU_LabelPointsFilter.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +#define CONTAINS(SET, PT) (SET.find(PT) != SET.end()) + +struct ltIdType +{ + bool operator()(const vtkIdType a1, const vtkIdType a2) const + { + return a1 < a2; + } +}; + + + +//---------------------------------------------------------------------------- +vtkStandardNewMacro(VISU_LabelPointsFilter); + + +//---------------------------------------------------------------------------- +void VISU_LabelPointsFilter::SetPointsNb(int theNb) +{ + if (myPointsNb == theNb) return; + myPointsNb = (theNb < 1)? 1:theNb; + Modified(); +} + +//---------------------------------------------------------------------------- +VISU_LabelPointsFilter::VISU_LabelPointsFilter(): + vtkPolyDataAlgorithm(), + myPointsNb(3) +{ +} + +//---------------------------------------------------------------------------- +VISU_LabelPointsFilter::~VISU_LabelPointsFilter() +{} + + + +//---------------------------------------------------------------------------- +int VISU_LabelPointsFilter::RequestData(vtkInformation* vtkNotUsed(request), + vtkInformationVector** inputVector, + vtkInformationVector* outputVector) +{ + // get the info objects + vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); + vtkInformation* outInfo = outputVector->GetInformationObject(0); + + // get the input and ouptut + vtkPolyData* input = vtkPolyData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); + vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); + + GetRegions(input, output); + + return 1; +} + +int VISU_LabelPointsFilter::RequestUpdateExtent(vtkInformation* vtkNotUsed(request), + vtkInformationVector** inputVector, + vtkInformationVector* outputVector) +{ + // get the info objects + vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); + vtkInformation *outInfo = outputVector->GetInformationObject(0); + + vtkPolyData* input = vtkPolyData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); + vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); + + GetRegions(input, output); + return 1; +} + + + +int VISU_LabelPointsFilter::GetRegions(vtkPolyData* theInput, + vtkPolyData* theOutput) +{ + vtkIdType cellId, i; + vtkIdType numPts, numCells; + vtkPoints *inPts; + + vtkPointData *aInpPD=theInput->GetPointData(), *aOutPD=theOutput->GetPointData(); + vtkCellData *aInpCD=theInput->GetCellData(), *aOutCD=theOutput->GetCellData(); + + // Check input/allocate storage + // + inPts = theInput->GetPoints(); + + if (inPts == NULL) + return 1; + + numPts = inPts->GetNumberOfPoints(); + numCells = theInput->GetNumberOfCells(); + + if ( numPts < 1 || numCells < 1 ) + return 1; + + // Build cell structure + // + vtkPolyData* aMesh = vtkPolyData::New(); + aMesh->CopyStructure(theInput); + aMesh->BuildLinks(); + + // Initialize. Keep track of points and cells visited. + // + vtkIdTypeArray* aRegionSizes = vtkIdTypeArray::New(); + int* aVisited = new int[numCells]; + for ( i=0; i < numCells; i++ ) + aVisited[i] = -1; + + vtkIdType* aPointMap = new vtkIdType[numPts]; + for ( i=0; i < numPts; i++ ) + aPointMap[i] = -1; + + vtkPoints* newPts = vtkPoints::New(); + newPts->Allocate(numPts); + + // Traverse all cells marking those visited. Each new search + // starts a new connected region. Connected region grows + // using a connected wave propagation. + // + vtkIdList* aWave = vtkIdList::New(); + aWave->Allocate(numPts/4+1,numPts); + vtkIdList* aWave2 = vtkIdList::New(); + aWave2->Allocate(numPts/4+1,numPts); + + vtkIdType aPointNumber = 0; + int aRegionNumber = 0; + + vtkIdList* aCellIds = vtkIdList::New(); + aCellIds->Allocate(8, VTK_CELL_SIZE); + vtkIdList* aPointIds = vtkIdList::New(); + aPointIds->Allocate(8, VTK_CELL_SIZE); + + // vtkIdType aNumCellsInRegion; + + aOutPD->CopyAllocate(aInpPD); + aOutCD->CopyAllocate(aInpCD); + + //visit all cells marking with region number + for (cellId=0; cellId < numCells; cellId++) { + if ( aVisited[cellId] < 0 ) { + aWave->InsertNextId(cellId); + aPointNumber = 0; + TraverseAndMark(aWave, aWave2, aVisited, aPointMap, + aRegionNumber, aPointNumber, aMesh); + + if (aPointNumber >= myPointsNb) { + std::set aIdxSet; + for (i=0; i < numPts; i++) { + if ( aPointMap[i] > -1 ) { + aIdxSet.insert(i); + aPointMap[i] = -1; + } + } + std::vector aIdx(aIdxSet.begin(), aIdxSet.end()); + int aActualPts = aIdx.size(); + int aNewId; + if (myPointsNb > 2) { + int k = aActualPts/(myPointsNb - 1); + int count; + for (i=0, count = 0; i < aActualPts; i+=k, count++) { + aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[i])); + aOutPD->CopyData(aInpPD, aIdx[i], aNewId); + } + if (count < myPointsNb) { + aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1])); + aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId); + } + } else { + aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[0])); + aOutPD->CopyData(aInpPD, aIdx[0], aNewId); + if (myPointsNb == 2) { + aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1])); + aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId); + } + } + } + aWave->Reset(); + aWave2->Reset(); + } + } + + aWave->Delete(); + aWave2->Delete(); + + theOutput->SetPoints(newPts); + newPts->Delete(); + + + delete [] aVisited; + delete [] aPointMap; + aMesh->Delete(); + theOutput->Squeeze(); + aCellIds->Delete(); + aPointIds->Delete(); + + return aRegionSizes->GetMaxId() + 1; +} + + +// Mark current cell as visited and assign region number. Note: +// traversal occurs across shared vertices. +// +void VISU_LabelPointsFilter::TraverseAndMark (vtkIdList* theWave, + vtkIdList* theWave2, + int* theVisited, + vtkIdType* thePointMap, + int& theRegionNumber, + vtkIdType& thePointNumber, + vtkPolyData* theMesh) +{ + vtkIdType cellId, ptId, numIds, i; + int j, k; + vtkIdType *pts, *cells, npts; + vtkIdList *tmpWave; + unsigned short ncells; + vtkIdList* aNeighborCellPointIds = vtkIdList::New(); + + + while ( (numIds=theWave->GetNumberOfIds()) > 0 ) { + for ( i=0; i < numIds; i++ ) { + cellId = theWave->GetId(i); + if ( theVisited[cellId] < 0 ) { + theVisited[cellId] = theRegionNumber; + theMesh->GetCellPoints(cellId, npts, pts); + + for (j=0; j < npts; j++) { + if ( thePointMap[ptId=pts[j]] < 0 ) { + thePointMap[ptId] = thePointNumber++; + } + theMesh->GetPointCells(ptId,ncells,cells); + + // check connectivity criterion (geometric + scalar) + for (k=0; k < ncells; k++) { + cellId = cells[k]; + theWave2->InsertNextId(cellId); + // } + }//for all cells using this point + }//for all points of this cell + }//if cell not yet visited + }//for all cells in this wave + + tmpWave = theWave; + theWave = theWave2; + theWave2 = tmpWave; + tmpWave->Reset(); + } //while wave is not empty +} diff --git a/src/PIPELINE/VISU_LabelPointsFilter.hxx b/src/PIPELINE/VISU_LabelPointsFilter.hxx new file mode 100644 index 00000000..46fa1c44 --- /dev/null +++ b/src/PIPELINE/VISU_LabelPointsFilter.hxx @@ -0,0 +1,76 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File: VISU_LabelPointsFilter.hxx +// Author: Vitaly Smetannikov +// Module : VISU + +#ifndef VISU_LabelPointsFilter_HeaderFile +#define VISU_LabelPointsFilter_HeaderFile + +#include "VISUPipeline.hxx" +#include + +class vtkPolyData; + +class VISU_PIPELINE_EXPORT VISU_LabelPointsFilter : public vtkPolyDataAlgorithm +{ +public: + vtkTypeMacro(VISU_LabelPointsFilter, vtkPolyDataAlgorithm); + + static VISU_LabelPointsFilter* New(); + + void SetPointsNb(int theNb); + + int GetPointsNb() const { return myPointsNb; } + +protected: + VISU_LabelPointsFilter(); + + virtual ~VISU_LabelPointsFilter(); + + virtual int RequestData(vtkInformation* request, + vtkInformationVector** inputVector, + vtkInformationVector* outputVector); + + virtual int RequestUpdateExtent(vtkInformation*, + vtkInformationVector**, + vtkInformationVector*); + + + void TraverseAndMark (vtkIdList* theWave, + vtkIdList* theWave2, + int* theVisited, + vtkIdType* thePointMap, + int& theRegionNumber, + vtkIdType& thePointNumber, + vtkPolyData* theMesh); + + int GetRegions(vtkPolyData* theInput, + vtkPolyData* theOutput); + + int myPointsNb; + +}; + + +#endif diff --git a/src/PIPELINE/VISU_MergedPL.cxx b/src/PIPELINE/VISU_MergedPL.cxx new file mode 100644 index 00000000..4aa24b88 --- /dev/null +++ b/src/PIPELINE/VISU_MergedPL.cxx @@ -0,0 +1,51 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File: VISU_MergedPL.cxx +// Author: Alexey PETROV +// Module : VISU + + +#include "VISU_MergedPL.hxx" +#include "VISU_PipeLine.hxx" + + +//---------------------------------------------------------------------------- +void +VISU_MergedPL +::DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput) +{ + if(VISU_MergedPL *aPipeLine = dynamic_cast(thePipeLine)){ + if ( this == aPipeLine ) + return; + + if ( aPipeLine->IsExternalGeometryUsed() ) { + ClearGeometry(); + int aNbOfGeometry = aPipeLine->GetNumberOfGeometry(); + for ( int aGeomNumber = 0; aGeomNumber < aNbOfGeometry; aGeomNumber++ ) + AddGeometry( aPipeLine->GetGeometry( aGeomNumber ) ); + }else + SetSourceGeometry(); + } +} diff --git a/src/PIPELINE/VISU_MergedPL.hxx b/src/PIPELINE/VISU_MergedPL.hxx new file mode 100644 index 00000000..9c8e9b97 --- /dev/null +++ b/src/PIPELINE/VISU_MergedPL.hxx @@ -0,0 +1,75 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File: VISU_MergedPL.hxx +// Author: Alexey PETROV +// Module : VISU + +#ifndef VISU_MergedPL_HeaderFile +#define VISU_MergedPL_HeaderFile + +#include "VISUPipeline.hxx" + +class vtkDataSet; +class vtkPointSet; +class VISU_PipeLine; + + +//---------------------------------------------------------------------------- +struct VISU_PIPELINE_EXPORT VISU_MergedPL +{ + virtual + void + SetSourceGeometry() = 0; + + virtual + int + AddGeometry( vtkDataSet* theGeometry ) = 0; + + virtual + vtkDataSet* + GetGeometry( int theGeomNumber ) = 0; + + virtual + int + GetNumberOfGeometry() = 0; + + virtual + bool + IsExternalGeometryUsed() = 0; + + virtual + void + ClearGeometry() = 0; + + virtual + vtkPointSet* + GetMergedInput() = 0; + + virtual + void + DoShallowCopy(VISU_PipeLine *thePipeLine, + bool theIsCopyInput); +}; + +#endif diff --git a/src/PIPELINE/VISU_OptionalDeformationPL.cxx b/src/PIPELINE/VISU_OptionalDeformationPL.cxx new file mode 100755 index 00000000..a4bc4555 --- /dev/null +++ b/src/PIPELINE/VISU_OptionalDeformationPL.cxx @@ -0,0 +1,101 @@ +// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File: VISU_ScalarMapPL.cxx +// Author: Roman NIKOLAEV +// Module : VISU + +//Salome includes +#include "VISU_OptionalDeformationPL.hxx" +#include "VISU_PipeLineUtils.hxx" + +//VTK includes +#include +#include +#include +#include +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +//---------------------------------------------------------------------------- +VISU_OptionalDeformationPL::VISU_OptionalDeformationPL(): + VISU_DeformationPL(), + myIsDeformed(true) +{ + if(MYDEBUG) MESSAGE("VISU_OptionalDeformationPL()::VISU_OptionalDeformationPL() - "<SetInput(myInputPassFilter->GetOutput()); + myWarpVector->SetInput(myCellDataToPointData->GetOutput()); + myOutputPassFiler->SetInput(myWarpVector->GetOutput()); +} + +//---------------------------------------------------------------------------- +void VISU_OptionalDeformationPL::OffDeformation(){ + myOutputPassFiler->SetInput(myInputPassFilter->GetOutput()); +} + + + +bool VISU_OptionalDeformationPL::CheckCanDeformate(vtkDataSet* theInput){ + if(theInput) { + if(VISU::IsDataOnCells(theInput)) + return theInput->GetCellData()->GetVectors() != NULL; + else if(VISU::IsDataOnPoints(theInput)) + return theInput->GetPointData()->GetVectors() != NULL; + } + return false; +} diff --git a/src/PIPELINE/VISU_OptionalDeformationPL.hxx b/src/PIPELINE/VISU_OptionalDeformationPL.hxx new file mode 100755 index 00000000..333da0cc --- /dev/null +++ b/src/PIPELINE/VISU_OptionalDeformationPL.hxx @@ -0,0 +1,59 @@ +// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : VISU_OptionalDeformationPL.hxx +// Author : +// Module : SALOME + +#ifndef VISU_OptionalDeformationPL_HeaderFile +#define VISU_OptionalDeformationPL_HeaderFile + +#include "VISUPipeline.hxx" +#include "VISU_DeformationPL.hxx" + +class VISU_PIPELINE_EXPORT VISU_OptionalDeformationPL: public VISU_DeformationPL +{ +public: + VISU_OptionalDeformationPL(); + virtual ~VISU_OptionalDeformationPL(); + + typedef VISU_DeformationPL Superclass; + + void UseDeformation(bool flag); + bool IsDeformed(); + + virtual + unsigned + long int + GetMTime(); + +protected: + bool CheckCanDeformate(vtkDataSet* theInput); + +private: + void OnDeformation(); + void OffDeformation(); + +private: + bool myIsDeformed; +}; + +#endif diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx new file mode 100644 index 00000000..f66ae75e --- /dev/null +++ b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx @@ -0,0 +1,478 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : VisuGUI_DeformedShapeAndScalarMapDlg.cxx +// Author : Eugeny Nikolaev +// Module : VISU + +#include "VisuGUI_DeformedShapeAndScalarMapDlg.h" + +#include "VisuGUI_Tools.h" +#include "VisuGUI_InputPane.h" + +#include "VISU_Result_i.hh" +#include "VISU_DeformedShapeAndScalarMap_i.hh" +#include "VISU_ColoredPrs3dFactory.hh" + +#include "VISU_ScalarMapPL.hxx" +#include "VISU_DeformedShapeAndScalarMapPL.hxx" + +#include "VISU_Convertor.hxx" + +#include "SalomeApp_Module.h" +#include "LightApp_Application.h" +#include "LightApp_SelectionMgr.h" +#include "SUIT_Desktop.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "SALOME_ListIO.hxx" + +#include "SALOMEDSClient_AttributeString.hxx" +#include "SALOMEDSClient_AttributeName.hxx" + +#include +#include + +using namespace std; + +#define MYDEBUG 0 + +/*! + * Constructor + */ +VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule) + : VisuGUI_ScalarBarBaseDlg(theModule), + myIsAnimation(false), + myUpdateScalars(true), + myVisuGUI(theModule) +{ + setCaption(tr("DLG_TITLE")); + setSizeGripEnabled(TRUE); + + QVBoxLayout* TopLayout = new QVBoxLayout (this); + TopLayout->setSpacing(6); + TopLayout->setMargin(11); + + myTabBox = new QTabWidget (this); + + // Scalar Map on Deformed shape pane + QVBox* aBox = new QVBox (this); + aBox->setMargin(11); + QFrame* TopGroup = new QFrame (aBox, "TopGroup"); + TopGroup->setFrameStyle(QFrame::Box | QFrame::Sunken); + TopGroup->setLineWidth(1); + QGridLayout* TopGroupLayout = new QGridLayout (TopGroup); + TopGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); + TopGroupLayout->setSpacing(6); + TopGroupLayout->setMargin(11); + + // Scale factor + QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup, "ScaleLabel"); + TopGroupLayout->addWidget(ScaleLabel, 0, 0); + + ScalFact = new QtxDblSpinBox (0.0, 1.0E+38, 0.1, TopGroup); + ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); + + ScalFact->setPrecision( aPrecision*(-1) ); + ScalFact->setValue(0.1); + TopGroupLayout->addWidget(ScalFact, 0, 1); + + // Fields combo box + QLabel* FieldLabel = new QLabel (tr("FIELD_ITEM"), TopGroup, "FieldLabel"); + myFieldsCombo = new QComboBox (TopGroup,"Fields"); + + TopGroupLayout->addWidget(FieldLabel, 1, 0); + TopGroupLayout->addWidget(myFieldsCombo,1,1); + + // TimeStamps combo box + QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup, "TimeStampLabel"); + myTimeStampsCombo = new QComboBox (TopGroup,"TimeStamp"); + + TopGroupLayout->addWidget(TimeStampLabel, 2, 0); + TopGroupLayout->addWidget(myTimeStampsCombo,2,1); + + // + myTabBox->addTab(aBox, tr("DEFORMED_SHAPE_AND_SCALAR_MAP_TAB")); + + // Scalar bar pane + myInputPane = new VisuGUI_InputPane(VISU::TDEFORMEDSHAPEANDSCALARMAP, theModule, this); + + myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB")); + myTabBox->addTab(myInputPane, tr("INPUT_TAB")); + + // Buttons + 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); + + QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + + // Add Tab box and Buttons to the top layout + TopLayout->addWidget(myTabBox); + TopLayout->addWidget(GroupButtons); + + // signals and slots connections + connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); + connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int))); + connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int))); +} + +VisuGUI_DeformedShapeAndScalarMapDlg::~VisuGUI_DeformedShapeAndScalarMapDlg() +{} + +void VisuGUI_DeformedShapeAndScalarMapDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, + bool theInit ) +{ + if( theInit ) + myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); + setFactor(myPrsCopy->GetScale()); + myTimeStampsCombo->setDisabled(myIsAnimation); + + CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName()); + QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(), + aFieldName.in(), + myPrsCopy->GetScalarTimeStampNumber()); + if (myEntity2Fields.size() == 0) + { + // find all fields and time stamps on it + _PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI)); + LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI); + SALOME_ListIO selected; + aSel->selectedObjects(selected); + if (selected.Extent() > 0) { + Handle(SALOME_InteractiveObject) aIO = selected.First(); + if (aIO->hasEntry()) { + _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry()); + VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject ); + switch(aType){ + case VISU::TTIMESTAMP: { + aSObject = aSObject->GetFather(); + aSObject = aSObject->GetFather(); + break; + } + case VISU::TFIELD: { + _PTR(SObject) newSObject; + if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject; + aSObject = aSObject->GetFather(); + break; + } + case VISU::TANIMATION: { + _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject); + for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) { + _PTR(SObject) aTmpChildSObj = aTmpIter->Value(); + _PTR(SObject) newSObject; + if(aTmpChildSObj->ReferencedObject(newSObject)){ + aSObject = newSObject; + aSObject->GetFather(); + break; + } + } + break; + }} + + aSObject = aSObject->GetFather(); + aSObject = aSObject->GetFather(); + + mySelectionObj = aSObject; + CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj); + if (CORBA::is_nil(anObject)) { + mySelectionObj = mySelectionObj->GetFather(); + } + } + } + + if (mySelectionObj) { + _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj); + + for (aIter->InitEx(true); aIter->More(); aIter->Next()) { + _PTR(SObject) aChildSObj = aIter->Value(); + VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj); + if (!aRestoringMap.empty()) { + VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap); + if (aType == VISU::TTIMESTAMP) { + QString aMeshName = aRestoringMap["myMeshName"]; + CORBA::String_var aName = myPrsCopy->GetMeshName(); + if (aMeshName != aName.in()) + continue; + QString aFieldName = aRestoringMap["myFieldName"]; + QString aTimeIter = aRestoringMap["myTimeStampId"]; + QString aEntity = aRestoringMap["myEntityId"]; + VISU::Entity anEntity; + switch (aEntity.toInt()) { + case 0: anEntity = VISU::NODE; break; + case 1: anEntity = VISU::EDGE; break; + case 2: anEntity = VISU::FACE; break; + case 3: anEntity = VISU::CELL; break; + } + TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity]; + TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName]; + aTimeStampNumber2Time[aTimeIter.toInt()] = + GetFloatValueOfTimeStamp(anEntity, + aFieldName.latin1(), + aTimeIter.toInt()); + } + } + } + } + AddAllFieldNames(); + } + myFieldsCombo->setCurrentText(aFieldName.in()); + AddAllTimes(myFieldsCombo->currentText()); + myTimeStampsCombo->setCurrentText(aIteration); + SetScalarField( false ); + + VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit); + + if( !theInit ) + return; + + myInputPane->initFromPrsObject( myPrsCopy ); + myTabBox->setCurrentPage( 0 ); +} + +void VisuGUI_DeformedShapeAndScalarMapDlg::setFactor(double theFactor) +{ + double i=0.1; + while (1) { // Calculate Step & Precission + if ( int (theFactor/i) > 0) + break; + else { + i = i*0.1; + } + } + + ScalFact->setLineStep(i); + + ScalFact->setValue(theFactor); +} + +int +VisuGUI_DeformedShapeAndScalarMapDlg +::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs) +{ + if(!myInputPane->check() || !GetScalarPane()->check()) + return 0; + + int anIsOk = myInputPane->storeToPrsObject( myPrsCopy ); + anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy ); + + myPrsCopy->SetScale(getFactor()); + + myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(), + getCurrentScalarFieldName().latin1(), + myTimeStampID[ myTimeStampsCombo->currentItem() ]); + + if(myUpdateScalars) + SetScalarField( false ); + + VISU::TSameAsFactory().Copy(myPrsCopy, thePrs); + + return anIsOk; +} + +int VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarFieldNamePos(){ + return myFieldsCombo->currentItem(); +} + +QString VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarFieldName(){ + return myFieldsCombo->currentText(); +} + +int VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarNbIterations(){ + return myTimeStampsCombo->count(); +} + +VISU::Entity +VisuGUI_DeformedShapeAndScalarMapDlg +::getCurrentScalarEntity() +{ + VISU::Entity anEntity = VISU::Entity(-1); + TEntity2Fields::const_iterator anIter = myEntity2Fields.begin(); + for(; anIter != myEntity2Fields.end(); anIter++){ + const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second; + TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin(); + for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){ + const QString& aFieldName = aFieldIter->first; + if (aFieldName == myFieldsCombo->currentText()) { + anEntity = anIter->first; + break; + } + } + } + return anEntity; +} + +void VisuGUI_DeformedShapeAndScalarMapDlg::SetScalarField( const bool save_scalar_pane ){ + SetScalarField( myTimeStampID[ myTimeStampsCombo->currentItem() ], "", save_scalar_pane ); +} + +void +VisuGUI_DeformedShapeAndScalarMapDlg +::SetScalarField(int theIter, + QString theFieldName, + const bool save_scalar_pane ) +{ + QApplication::setOverrideCursor(Qt::waitCursor); + + if( save_scalar_pane ) + GetScalarPane()->storeToPrsObject(myPrsCopy); + + QString aFieldName; + + if(theFieldName.isEmpty()) + aFieldName = myFieldsCombo->currentText(); + else + aFieldName = theFieldName; + + VISU::Entity anEntity = getCurrentScalarEntity(); + + myPrsCopy->SetScalarField(anEntity, + aFieldName.latin1(), + theIter); + + if( save_scalar_pane ) + UpdateScalarField(); + + QApplication::restoreOverrideCursor(); +} + +void VisuGUI_DeformedShapeAndScalarMapDlg::accept() +{ + VisuGUI_ScalarBarBaseDlg::accept(); +} + +void VisuGUI_DeformedShapeAndScalarMapDlg::reject() +{ + VisuGUI_ScalarBarBaseDlg::reject(); +} + +QString VisuGUI_DeformedShapeAndScalarMapDlg::GetContextHelpFilePath() +{ + return "scalar_map_on_deformed_shape_page.html"; +} + +void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllFieldNames(){ + TEntity2Fields::const_iterator anIter = myEntity2Fields.begin(); + for(; anIter != myEntity2Fields.end(); anIter++){ + const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second; + TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin(); + for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){ + const QString& aFieldName = aFieldIter->first; + myFieldsCombo->insertItem(aFieldName); + } + } +} + +void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllTimes(const QString& theFieldName){ + TEntity2Fields::const_iterator anIter = myEntity2Fields.begin(); + for(; anIter != myEntity2Fields.end(); anIter++){ + const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second; + TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin(); + for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){ + const QString& aFieldName = aFieldIter->first; + if(theFieldName != aFieldName) + continue; + + myTimeStampID.clear(); + myTimeStampsCombo->clear(); + + const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second; + TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin(); + for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){ + int aTimeStampNumber = aTimeStampIter->first; + myTimeStampID.push_back(aTimeStampNumber); + + QString aTimeStampTime = aTimeStampIter->second; + myTimeStampsCombo->insertItem(aTimeStampTime); + } + return; + } + } +} + +void VisuGUI_DeformedShapeAndScalarMapDlg::onFieldChanged(int){ + AddAllTimes(myFieldsCombo->currentText()); + SetScalarField(); + UpdateScalarField(); +} + +void VisuGUI_DeformedShapeAndScalarMapDlg::onTimeStampChanged(int){ + SetScalarField(); + UpdateScalarField(); +} + +void VisuGUI_DeformedShapeAndScalarMapDlg::UpdateScalarField(){ + GetScalarPane()->initFromPrsObject(myPrsCopy); +} + +QString +VisuGUI_DeformedShapeAndScalarMapDlg +::GetFloatValueOfTimeStamp(VISU::Entity theEntity, + const std::string& theFieldName, + int theTimeStampNumber) +{ + QString aTime(""); + VISU::TEntity anEntity = VISU::TEntity(theEntity); + VISU::Result_i* theResult = myPrsCopy->GetCResult(); + VISU::Result_i::PInput anInput = theResult->GetInput(); + VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(), + anEntity, + theFieldName); + if(!aField) + return aTime; + + VISU::TValField& aValField = aField->myValField; + VISU::TValField::const_iterator aIter = aValField.find(theTimeStampNumber); + if(aIter != aValField.end()){ + VISU::PValForTime aValForTime = aIter->second; + aTime = VISU_Convertor::GenerateName(aValForTime->myTime).c_str(); + } + return aTime; +} diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h new file mode 100644 index 00000000..81033adf --- /dev/null +++ b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h @@ -0,0 +1,122 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : VisuGUI_DeformedShapeAndScalarMapDlg.h +// Author : Eugeny Nikolaev +// Module : VISU + +#ifndef VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H +#define VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H + +#include "VisuGUI_Prs3dDlg.h" + +#include "VISUConfig.hh" + +#include "QtxDblSpinBox.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +class SalomeApp_Module; +class VisuGUI_InputPane; + +namespace VISU +{ + class DeformedShapeAndScalarMap_i; +} + +class VisuGUI_DeformedShapeAndScalarMapDlg : public VisuGUI_ScalarBarBaseDlg +{ + Q_OBJECT + +public: + VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule); + ~VisuGUI_DeformedShapeAndScalarMapDlg(); + + double getFactor() + { return ScalFact->value(); } + void setFactor(double theFactor); + + virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, + bool theInit ); + + virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); + + int getCurrentScalarFieldNamePos(); + QString getCurrentScalarFieldName(); + int getCurrentScalarNbIterations(); + VISU::Entity getCurrentScalarEntity(); + void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true ); + +protected: + virtual QString GetContextHelpFilePath(); + +protected slots: + void accept(); + void reject(); + +private slots: + void onFieldChanged(int i=0); + void onTimeStampChanged(int i=0); + +private: + QtxDblSpinBox* ScalFact; + QTabWidget* myTabBox; + VisuGUI_ScalarBarPane* myScalarPane; + VisuGUI_InputPane* myInputPane; + QComboBox *myFieldsCombo; + QComboBox *myTimeStampsCombo; + + typedef std::map TTimeStampNumber2Time; // Times map definition (iteration time, real value of time) + typedef std::map TFieldName2TimeStamps; // Field name and enity to Times + typedef std::map TEntity2Fields; // Mesh to fields map + + TEntity2Fields myEntity2Fields; + int myCurrScalarIter; + bool myIsAnimation; + bool myUpdateScalars; + std::vector myTimeStampID; + + _PTR(SObject) mySelectionObj; + SALOME::GenericObjPtr myPrsCopy; + SalomeApp_Module* myVisuGUI; + +protected: + void UpdateScalarField(); + void SetScalarField( const bool = true ); + void AddAllFieldNames(); + void AddAllTimes(const QString& theFieldName); + QString GetFloatValueOfTimeStamp(VISU::Entity theEntity, + const std::string& theFieldName, + int theTimeStampNumber); +}; + +#endif // VISUGUI_DEFORMEDSHAPEDLS_H diff --git a/src/VISUGUI/VisuGUI_FileInfoDlg.cxx b/src/VISUGUI/VisuGUI_FileInfoDlg.cxx new file mode 100644 index 00000000..5e4e6a7f --- /dev/null +++ b/src/VISUGUI/VisuGUI_FileInfoDlg.cxx @@ -0,0 +1,79 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : VisuGUI_FileInfoDlg.cxx +// Author : Alexandre SOLOVYOV +// Module : VISU +// $Header$ + +#include + +#include + +#include +#include +#include + +VisuGUI_FileInfoDlg::VisuGUI_FileInfoDlg( QWidget* parent, SALOME_MED::MedFileInfo* inf ) + : QtxDialog( parent, 0, true, true, QtxDialog::OK ) +{ + setCaption( tr( "CAPTION" ) ); + setSizeGripEnabled( true ); + + QLineEdit* fname = new QLineEdit( mainFrame() ); + fname->setReadOnly( true ); + QLineEdit* fsize = new QLineEdit( mainFrame() ); + fsize->setReadOnly( true ); + QLineEdit* medversion = new QLineEdit( mainFrame() ); + medversion->setReadOnly( true ); + fname->setMinimumWidth( 300 ); + + QGridLayout* lay = new QGridLayout( mainFrame(), 4, 2, 5, 5 ); + lay->addWidget( new QLabel( tr( "FILE_NAME" ), mainFrame() ), 0, 0 ); + lay->addWidget( fname, 0, 1 ); + lay->addWidget( new QLabel( tr( "FILE_SIZE" ), mainFrame() ), 1, 0 ); + lay->addWidget( fsize, 1, 1 ); + lay->addWidget( new QLabel( tr( "MED_VERSION" ), mainFrame() ), 2, 0 ); + lay->addWidget( medversion, 2, 1 ); + + fname->setText( (char*)inf->fileName ); + fname->home( false ); + fsize->setText( QString::number( inf->fileSize ) ); + + QString version; + if( inf->major>=0 ) + { + version = QString::number( inf->major ); + if( inf->minor>=0 ) + { + version += "." + QString::number( inf->minor ); + if( inf->release>=0 ) + version += "." + QString::number( inf->release ); + } + } + medversion->setText( version ); +} + +VisuGUI_FileInfoDlg::~VisuGUI_FileInfoDlg() +{ +} diff --git a/src/VISUGUI/VisuGUI_FileInfoDlg.h b/src/VISUGUI/VisuGUI_FileInfoDlg.h new file mode 100644 index 00000000..e7d8a674 --- /dev/null +++ b/src/VISUGUI/VisuGUI_FileInfoDlg.h @@ -0,0 +1,44 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : VisuGUI_FileInfoDlg.h +// Author : Alexandre SOLOVYOV +// Module : VISU +// $Header$ + +#ifndef VISUGUI_FILE_INFO_DIALOG +#define VISUGUI_FILE_INFO_DIALOG + +#include +#include + +class VisuGUI_FileInfoDlg : public QtxDialog +{ + Q_OBJECT + +public: + VisuGUI_FileInfoDlg( QWidget*, SALOME_MED::MedFileInfo* ); + virtual ~VisuGUI_FileInfoDlg(); +}; + +#endif diff --git a/src/VISUGUI/VisuGUI_Table3dDlg.cxx b/src/VISUGUI/VisuGUI_Table3dDlg.cxx new file mode 100644 index 00000000..8c951285 --- /dev/null +++ b/src/VISUGUI/VisuGUI_Table3dDlg.cxx @@ -0,0 +1,840 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : VisuGUI_Plot3DDlg.cxx +// Author : Laurent CORNABE & Hubert ROLLAND +// Module : VISU +// $Header$ + +#include "VisuGUI_Table3dDlg.h" + +#include "VisuGUI.h" +#include "VisuGUI_Tools.h" +#include "VisuGUI_ViewTools.h" +#include "VisuGUI_InputPane.h" + +#include "VISU_ColoredPrs3dFactory.hh" +#include "VISU_ViewManager_i.hh" + +#include "SVTK_ViewWindow.h" + +#include "SALOME_Actor.h" +#include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "LightApp_Application.h" + +#include "SVTK_FontWidget.h" + +#include "QtxDblSpinBox.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +#define SURFACE_PRS_ID 0 +#define CONTOUR_PRS_ID 1 + +//======================================================================= +//function : VisuGUI_Table3DPane +//purpose : +//======================================================================= +VisuGUI_Table3DPane::VisuGUI_Table3DPane (QWidget* parent) + : QVBox(parent), myViewWindow(VISU::GetActiveViewWindow()), myPrs(NULL), + myInitFromPrs(false) +{ + layout()->setAlignment(Qt::AlignTop); + setSpacing(6); + + // Scale, Presentation type, Nb Contours, Preview + + QFrame* bottomFrame = new QFrame (this); + QGridLayout* bottomLayout = new QGridLayout (bottomFrame); + bottomLayout->setAlignment(Qt::AlignTop); + bottomLayout->setSpacing(6); + bottomLayout->setMargin(11); + // 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"); + + 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); + + // signals and slots connections + + connect(GBPrsType, SIGNAL(clicked(int)), this, SLOT(onPrsType(int))); +} + +//======================================================================= +//function : destructor +//purpose : +//======================================================================= +VisuGUI_Table3DPane::~VisuGUI_Table3DPane() +{} + +//======================================================================= +//function : onPrsType +//purpose : +//======================================================================= +void VisuGUI_Table3DPane::onPrsType(int id) +{ + NbContoursSpn->setEnabled(id == CONTOUR_PRS_ID); +} + +//======================================================================= +//function : storeToPrsObject +//purpose : +//======================================================================= +int VisuGUI_Table3DPane::storeToPrsObject(VISU::PointMap3d_i* thePrs) +{ + + // scale + thePrs->SetScaleFactor(ScaleSpn->value()); + + // prs type + int id = GBPrsType->id (GBPrsType->selected()); + thePrs->SetContourPrs(id == CONTOUR_PRS_ID); + + // nb contours + thePrs->SetNbOfContours(NbContoursSpn->value()); + + return 1; +} + +//======================================================================= +//function : initFromPrsObject +//purpose : +//======================================================================= +void VisuGUI_Table3DPane::initFromPrsObject(VISU::PointMap3d_i* thePrs) +{ + myInitFromPrs = true; + myPrs = thePrs; + + // scale + double aScale = thePrs->GetScaleFactor(); + if (aScale<0) + aScale = 0; + ScaleSpn->setValue( aScale ); + + // prs type + int id = thePrs->GetIsContourPrs() ? CONTOUR_PRS_ID : SURFACE_PRS_ID; + GBPrsType->setButton(id); + onPrsType(id); + + // nb contours + NbContoursSpn->setValue(thePrs->GetNbOfContours()); +} + +//======================================================================= +//function : Table Scalar Bar +//purpose : +//======================================================================= + +VisuGUI_TableScalarBarPane::VisuGUI_TableScalarBarPane (QWidget * parent): + QVBox(parent), myBarPrs(NULL) +{ + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + QString propertyName; + propertyName = QString("scalar_bar_vertical_"); + myVerX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.); + myVerY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.); + myVerW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.); + myVerH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.); + myVerTW = aResourceMgr->integerValue("VISU", propertyName + "title_width", 0); + myVerTH = aResourceMgr->integerValue("VISU", propertyName + "title_height",0); + myVerLW = aResourceMgr->integerValue("VISU", propertyName + "label_width", 0); + myVerLH = aResourceMgr->integerValue("VISU", propertyName + "label_height",0); + myVerBW = aResourceMgr->integerValue("VISU", propertyName + "bar_width", 0); + myVerBH = aResourceMgr->integerValue("VISU", propertyName + "bar_height",0); + + propertyName = QString("scalar_bar_horizontal_"); + myHorX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.); + myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.); + myHorW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.); + myHorH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.); + myHorTW = aResourceMgr->integerValue("VISU", propertyName + "title_width", 0); + myHorTH = aResourceMgr->integerValue("VISU", propertyName + "title_height",0); + myHorLW = aResourceMgr->integerValue("VISU", propertyName + "label_width", 0); + myHorLH = aResourceMgr->integerValue("VISU", propertyName + "label_height",0); + myHorBW = aResourceMgr->integerValue("VISU", propertyName + "bar_width", 0); + myHorBH = aResourceMgr->integerValue("VISU", propertyName + "bar_height",0); + + 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 ); + + 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->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 ); + + QHBox* aSaveBox = new QHBox(this); + + myTextBtn = new QPushButton("Text properties...", aSaveBox); + myBarBtn = new QPushButton("Bar properties...", aSaveBox); + myTextDlg = new VisuGUI_TextPrefDlg(this); + myTextDlg->setTitleVisible(true); + myBarDlg = new VisuGUI_BarPrefDlg(this); + + + if(RBvert->isChecked()) { + myBarDlg->setRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH); + } else { + myBarDlg->setRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH); + } + + myBarDlg->setLabelsFormat(aResourceMgr->stringValue("VISU", propertyName + "label_format", "%-#6.3g")); + myBarDlg->setUnitsVisible(aResourceMgr->booleanValue("VISU", propertyName + "display_units", true)); + + // 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() ) ); + connect( myBarBtn, SIGNAL( clicked() ), this, SLOT( onBarPref() ) ); + changeDefaults( 0 ); + myIsStoreTextProp = true; + myBusy = false; +} + +//---------------------------------------------------------------------------- + +void VisuGUI_TableScalarBarPane::onBarPref() +{ + if(RBvert->isChecked()) + myBarDlg->setRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH); + else + myBarDlg->setRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH); + if(myBarDlg->exec()) { + if(RBvert->isChecked()) + myBarDlg->getRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH); + else + myBarDlg->getRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH); + } +} + +//---------------------------------------------------------------------------- +/** + * Initialise dialog box from presentation object + */ +void VisuGUI_TableScalarBarPane::initFromPrsObject(VISU::PointMap3d_i* thePrs) +{ + myBarPrs = dynamic_cast(thePrs); + + if( !myBarPrs ) + return; + + switch(myBarPrs->GetScaling()){ + case VISU::LOGARITHMIC : + CBLog->setChecked( true ); + break; + default: + CBLog->setChecked( false ); + } + + setRange( myBarPrs->GetMin(), myBarPrs->GetMax(), myBarPrs->IsRangeFixed() ); + + setScalarBarData( myBarPrs->GetNbColors(), myBarPrs->GetLabels() ); + + // "Title" + CORBA::String_var aTitle = myBarPrs->GetTitle(); + myTextDlg->setTitleText(aTitle.in()); + myTitle = aTitle.in(); + + vtkFloatingPointType R, G, B; + myBarPrs->GetTitleColor(R, G, B); + + setPosAndSize( myBarPrs->GetPosX(), + myBarPrs->GetPosY(), + myBarPrs->GetWidth(), + myBarPrs->GetHeight(), + myBarPrs->GetBarOrientation()); + + myVerTW = myBarPrs->GetTitleWidth(); + myVerTH = myBarPrs->GetTitleHeight(); + myVerLW = myBarPrs->GetLabelWidth(); + myVerLH = myBarPrs->GetLabelHeight(); + myVerBW = myBarPrs->GetBarWidth(); + myVerBH = myBarPrs->GetBarHeight(); + myBarDlg->setRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH); + + myBarDlg->setLabelsFormat(myBarPrs->GetLabelsFormat()); + myBarDlg->setUnitsVisible(myBarPrs->IsUnitsVisible()); + + myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)), + myBarPrs->GetTitFontType(), + myBarPrs->IsBoldTitle(), + myBarPrs->IsItalicTitle(), + myBarPrs->IsShadowTitle()); + + // "Labels" + myBarPrs->GetLabelColor(R, G, B); + + myTextDlg->myLabelFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)), + myBarPrs->GetLblFontType(), + myBarPrs->IsBoldLabel(), + myBarPrs->IsItalicLabel(), + myBarPrs->IsShadowLabel()); +} + +//---------------------------------------------------------------------------- +/** + * Store values to presentation object + */ +int VisuGUI_TableScalarBarPane::storeToPrsObject(VISU::PointMap3d_i* thePrs) { + if( !myBarPrs ) + return 0; + + myBarPrs->SetPosition(XSpin->value(), YSpin->value()); + myBarPrs->SetSize(WidthSpin->value(), HeightSpin->value()); + + myBarPrs->SetRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH); + + myBarPrs->SetLabelsFormat(myBarDlg->getLabelsFormat()); + myBarPrs->SetUnitsVisible(myBarDlg->isUnitsVisible()); + + myBarPrs->SetBarOrientation((RBvert->isChecked())? VISU::ColoredPrs3dBase::VERTICAL : VISU::ColoredPrs3dBase::HORIZONTAL); + if(CBLog->isChecked()) + myBarPrs->SetScaling(VISU::LOGARITHMIC); + else + myBarPrs->SetScaling(VISU::LINEAR); + + if (RBFrange->isChecked()) { + myBarPrs->SetSourceRange(); + } else { + myBarPrs->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble()); + } + myBarPrs->SetNbColors(ColorSpin->value()); + myBarPrs->SetLabels(LabelSpin->value()); + + if (myIsStoreTextProp) { + // "Title" + myBarPrs->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); + + myBarPrs->SetBoldTitle(isTitleBold); + myBarPrs->SetItalicTitle(isTitleItalic); + myBarPrs->SetShadowTitle(isTitleShadow); + myBarPrs->SetTitFontType(aTitleFontFamily); + myBarPrs->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); + + myBarPrs->SetBoldLabel(isLabelBold); + myBarPrs->SetItalicLabel(isLabelItalic); + myBarPrs->SetShadowLabel(isLabelShadow); + myBarPrs->SetLblFontType(aLabelFontFamily); + myBarPrs->SetLabelColor(aLblColor.red()/255., + aLblColor.green()/255., + aLblColor.blue()/255.); + // myIsStoreTextProp = false; + } + return 1; +} + +//---------------------------------------------------------------------------- +/*! + Sets default values and range mode +*/ +void VisuGUI_TableScalarBarPane::setRange( double imin, double imax, bool sbRange ) +{ + MinEdit->setText( QString::number( imin ) ); + MaxEdit->setText( QString::number( imax ) ); + + if( sbRange ) + RBIrange->setChecked( true ); + else + RBFrange->setChecked( true ); + + changeRange( sbRange ); +} + +//---------------------------------------------------------------------------- +/*! + Called when Range mode is changed +*/ +void VisuGUI_TableScalarBarPane::changeRange( int ) +{ + if ( RBFrange->isChecked() ) { + myBarPrs->SetSourceRange(); + MinEdit->setEnabled( false ); + MaxEdit->setEnabled( false ); + } else { + myBarPrs->SetRange( myBarPrs->GetMin(), myBarPrs->GetMax() ); + myBarPrs->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble()); + MinEdit->setEnabled( true ); + MaxEdit->setEnabled( true ); + } + + MinEdit->setText( QString::number( myBarPrs->GetMin() ) ); + MaxEdit->setText( QString::number( myBarPrs->GetMax() ) ); +} + +//---------------------------------------------------------------------------- +/*! + Called when X,Y position is changed +*/ +void VisuGUI_TableScalarBarPane::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 size and position +*/ +void VisuGUI_TableScalarBarPane::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_TableScalarBarPane::setScalarBarData( int colors, int labels ) +{ + ColorSpin->setValue( colors ); + LabelSpin->setValue( labels ); +} + +//---------------------------------------------------------------------------- +void VisuGUI_TableScalarBarPane::onTextPref() +{ + myTextDlg->storeBeginValues(); + myIsStoreTextProp = myTextDlg->exec() || myIsStoreTextProp; +} + +//---------------------------------------------------------------------------- +VisuGUI_TableScalarBarPane::~VisuGUI_TableScalarBarPane() +{ +} + +//---------------------------------------------------------------------------- +/*! + Called when orientation is changed +*/ +void VisuGUI_TableScalarBarPane::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 ); + } +} + + +//======================================================================= +//function : Constructor +//purpose : +//======================================================================= +VisuGUI_Table3DDlg::VisuGUI_Table3DDlg ( SalomeApp_Module* theModule ) + : QDialog ( VISU::GetDesktop(theModule), 0, false ) +{ + setCaption(tr("Point Map 3D Definition")); + setSizeGripEnabled(TRUE); + + QVBoxLayout* TopLayout = new QVBoxLayout(this); + TopLayout->setSpacing(6); + TopLayout->setMargin(11); + + myTabBox = new QTabWidget (this); + myIsoPane = new VisuGUI_Table3DPane (this); + myScalarBarPane = new VisuGUI_TableScalarBarPane (this); + + myIsoPane->setMargin(11); + myScalarBarPane->setMargin(11); + myTabBox->addTab(myIsoPane, tr("DLG_PREF_TITLE")); + myTabBox->addTab(myScalarBarPane, tr("DLG_PROP_TITLE")); + + TopLayout->addWidget(myTabBox); + + 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); + + QPushButton* buttonApply = new QPushButton (tr("&Apply"), GroupButtons, "buttonApply"); + buttonApply->setAutoDefault(TRUE); + buttonApply->setDefault(TRUE); + GroupButtonsLayout->addWidget(buttonApply, 0, 1); + GroupButtonsLayout->addItem(new QSpacerItem (5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2); + QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel"); + buttonCancel->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonCancel, 0, 3); + QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); + + TopLayout->addWidget(GroupButtons); + + // signals and slots connections + connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); + connect(buttonApply, SIGNAL(clicked()), this, SLOT(onApply())); +} + +VisuGUI_Table3DDlg::~VisuGUI_Table3DDlg() +{} + +//======================================================================= +//function : Check +//purpose : Called when button is clicked, validates data and closes dialog +//======================================================================= +bool VisuGUI_TableScalarBarPane::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 ( minVal <= 0.0 ) { + if ( RBIrange->isChecked() ) { + SUIT_MessageBox::warn1( this, + tr("WRN_VISU"), + tr("WRN_LOGARITHMIC_RANGE"), + tr("BUT_OK")); + } else { + if ( minVal == 0) + SUIT_MessageBox::warn1( this, + tr("WRN_VISU"), + tr("WRN_LOGARITHMIC_RANGE"), + tr("BUT_OK")); + else + SUIT_MessageBox::warn1( this, + tr("WRN_VISU"), + tr("WRN_LOGARITHMIC_FIELD_RANGE"), + tr("BUT_OK")); + RBIrange->setChecked(true); + changeRange(1); + } + return false; + } + } + return true; +} + +//======================================================================= +//function : accept +//purpose : +//======================================================================= +void VisuGUI_Table3DDlg::accept() +{ + if (myScalarBarPane->check()) + QDialog::accept(); +} + +//======================================================================= +//function : reject +//purpose : +//======================================================================= +void VisuGUI_Table3DDlg::reject() +{ + QDialog::reject(); +} + +//======================================================================= +//function : onApply +//purpose : +//======================================================================= +void VisuGUI_Table3DDlg::onApply() +{ + if (myScalarBarPane->check()) { + storeToPrsObject( myPrsCopy ); + myPrsCopy->UpdateActors(); + } +} + +//======================================================================= +//function : onHelp +//purpose : +//======================================================================= +void VisuGUI_Table3DDlg::onHelp() +{ + QString aHelpFileName = "table_3d_page.html"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } + +} + +//======================================================================= +//function : storeToPrsObject +//purpose : +//======================================================================= +int VisuGUI_Table3DDlg::storeToPrsObject (VISU::PointMap3d_i* thePrs) +{ + int anIsOk = myIsoPane->storeToPrsObject( thePrs ); + anIsOk &= myScalarBarPane->storeToPrsObject( thePrs ); + + return anIsOk; +} + +//======================================================================= +//function : initFromPrsObject +//purpose : +//======================================================================= +void VisuGUI_Table3DDlg::initFromPrsObject (VISU::PointMap3d_i* thePrs) +{ + myPrsCopy = thePrs; + myIsoPane->initFromPrsObject( thePrs ); + myScalarBarPane->initFromPrsObject( thePrs ); +} + diff --git a/src/VISUGUI/VisuGUI_Table3dDlg.h b/src/VISUGUI/VisuGUI_Table3dDlg.h new file mode 100644 index 00000000..cc10bb3e --- /dev/null +++ b/src/VISUGUI/VisuGUI_Table3dDlg.h @@ -0,0 +1,187 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : VisuGUI_Plot3DDlg.h +// Author : Laurent CORNABE & Hubert ROLLAND +// Module : VISU +// $Header$ + +#ifndef VISUGUI_TABLE3D_H +#define VISUGUI_TABLE3D_H + +#include "VisuGUI_Prs3dDlg.h" + +#include +#include +#include +#include + +class SalomeApp_Module; + +namespace VISU +{ + class PointMap3d_i; +}; + +class VISU_Plot3DPL; +class SVTK_ViewWindow; +class SALOME_Actor; +class QtxDblSpinBox; + +class VisuGUI_Table3DPane : public QVBox +{ + Q_OBJECT + + public: + VisuGUI_Table3DPane(QWidget* parent); + ~VisuGUI_Table3DPane(); + + void initFromPrsObject (VISU::PointMap3d_i* thePrs); + int storeToPrsObject (VISU::PointMap3d_i* thePrs); + + VISU::PointMap3d_i* GetPrs() { return myPrs; } + + private: + bool myInitFromPrs; + + SVTK_ViewWindow* myViewWindow; + VISU::PointMap3d_i* myPrs; + + QtxDblSpinBox * ScaleSpn; + QHButtonGroup * GBPrsType; + QSpinBox * NbContoursSpn; + + private slots: + + void onPrsType( int ); +}; + +class VisuGUI_TableScalarBarPane : public QVBox +{ + Q_OBJECT; + + public: + VisuGUI_TableScalarBarPane(QWidget* parent); + ~VisuGUI_TableScalarBarPane(); + + void setRange( double imin, double imax, bool sbRange ); + void setDefaultRange(double imin, double imax); + int getOrientation(); + void setPosAndSize( double x, double y, double w, double h, bool vert ); + void setScalarBarData( int colors, int labels ); + bool isIRange(); + double getMin(); + double getMax(); + double getX(); + double getY(); + double getWidth(); + double getHeight(); + int getNbColors(); + int getNbLabels(); + bool isLogarithmic(); + void setLogarithmic( bool on ); + // bool isToSave() {return CBSave ? CBSave->isChecked() : false;} + + void storeToResources(); + + void initFromPrsObject(VISU::PointMap3d_i* thePrs); + int storeToPrsObject(VISU::PointMap3d_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; + QComboBox* myModeCombo; + QPushButton* myTextBtn; + QPushButton* myBarBtn; + VisuGUI_TextPrefDlg* myTextDlg; + VisuGUI_BarPrefDlg* myBarDlg; + + double myHorX, myHorY, myHorW, myHorH; + double myVerX, myVerY, myVerW, myVerH; + int myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH; + int myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH; + bool myIsStoreTextProp; + + private slots: + void changeDefaults( int ); + void changeRange( int ); + void XYChanged( double ); + void changeScalarMode( int ); + void onTextPref(); + void onBarPref(); + + private: + std::string myTitle; + VISU::PointMap3d_i* myBarPrs; + + bool myBusy; +}; + +/////////////////////////////////////////////////////// + +class VisuGUI_Table3DDlg : public QDialog +{ + Q_OBJECT + + public: + VisuGUI_Table3DDlg (SalomeApp_Module* theModule); + ~VisuGUI_Table3DDlg(); + + virtual void initFromPrsObject( VISU::PointMap3d_i* thePrs ); + virtual int storeToPrsObject(VISU::PointMap3d_i* thePrs); + + protected slots: + void accept(); + void reject(); + void onHelp(); + void onApply(); + + private: + QTabWidget* myTabBox; + VisuGUI_Table3DPane* myIsoPane; + VisuGUI_TableScalarBarPane* myScalarBarPane; + + SALOME::GenericObjPtr myPrsCopy; +}; + +#endif // VISUGUI_TABLE3D_H diff --git a/src/VISU_I/VISU_Deformation_i.cc b/src/VISU_I/VISU_Deformation_i.cc new file mode 100755 index 00000000..8f4c05bc --- /dev/null +++ b/src/VISU_I/VISU_Deformation_i.cc @@ -0,0 +1,166 @@ +// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_Deformation_i.cc +// Author : +// Module : VISU + +#include "VISU_Deformation_i.hh" +#include "VISU_Result_i.hh" +#include "VISU_Prs3dUtils.hh" + +#include "VISU_DeformationPL.hxx" +#include "VISU_Convertor.hxx" +#include "VISU_DeformationPL.hxx" +#include "VISUConfig.hh" + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +//--------------------------------------------------------------- +VISU::Deformation_i::Deformation_i(VISU::ColoredPrs3d_i *thePrs3d): + myColoredPrs3d(thePrs3d) +{ + if(MYDEBUG) MESSAGE("Deformation_i::Deformation_i()"); +} + +//--------------------------------------------------------------- +VISU::Deformation_i::~Deformation_i() +{ + if(MYDEBUG) MESSAGE("Deformation_i::~Deformation_i()"); +} + +//--------------------------------------------------------------- +void VISU::Deformation_i::SetScale(CORBA::Double theScale) +{ + if(MYDEBUG) MESSAGE("Deformation_i::SetScale()"); + + VISU::TSetModified aModified(GetColoredPrs3d()); + + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificDeformedPL(), &VISU_DeformationPL::SetScale, theScale)); +} + +//--------------------------------------------------------------- +void VISU::Deformation_i::InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine){ + + if(MYDEBUG) MESSAGE("Deformation_i::InitDeformedPipeLine()"); + myDeformationPL = theDeformedPipeLine; +} + +//--------------------------------------------------------------- +CORBA::Double +VISU::Deformation_i +::GetScale() +{ + if(MYDEBUG) MESSAGE("Deformation_i::GetScale()"); + return GetSpecificDeformedPL()->GetScale(); +} + +//--------------------------------------------------------------- +VISU::Entity VISU::Deformation_i::GetVectorialFieldEntity(){ + return myVectorialEntity; +} + +//--------------------------------------------------------------- +char* VISU::Deformation_i::GetVectorialFieldName(){ + return CORBA::string_dup(myVectorialFieldName.c_str()); +} + +//--------------------------------------------------------------- +void VISU::Deformation_i:: +DeformationToStream(std::ostringstream& theStr) +{ + Storable::DataToStream(theStr,"myScaleFactor", GetScale()); + Storable::DataToStream(theStr,"myVectorialField", GetVectorialFieldName()); + Storable::DataToStream(theStr,"myVectorialEntiry", GetVectorialFieldEntity()); + +} + +//--------------------------------------------------------------- +void +VISU::Deformation_i::RestoreDeformation(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap) +{ + SetScale(VISU::Storable::FindValue(theMap,"myScaleFactor").toDouble()); + VISU::Entity anEntity = VISU::Entity(VISU::Storable::FindValue(theMap, "myVectorialEntiry").toInt()); + + SetVectorialField(anEntity, + VISU::Storable::FindValue(theMap, "myVectorialField")); +} + +//--------------------------------------------------------------- +void +VISU::Deformation_i::SameAsDeformation(const Deformation_i *aDeformedPrs){ + if(const Deformation_i* aPrs = dynamic_cast(aDeformedPrs)) { + Deformation_i* anOrigin = const_cast(aPrs); + + CORBA::String_var aVectorialFieldName = anOrigin->GetVectorialFieldName(); + VISU::Entity anEntity = anOrigin->GetVectorialFieldEntity(); + this->SetVectorialField(anEntity, + aVectorialFieldName); + this->SetScale(anOrigin->GetScale()); + } +} + +void VISU::Deformation_i::SetVectorialField(Entity theEntity, const char* theFieldName){ + if(MYDEBUG) MESSAGE("CutPlanes_i::SetVectorialField()"); + + bool anIsModified = false; + if(!anIsModified) + anIsModified |= GetVectorialFieldEntity() != theEntity; + + if(!anIsModified) + anIsModified |= GetVectorialFieldName() != theFieldName; + + if(!anIsModified) + return; + + ColoredPrs3d_i *aColoredPrs = GetColoredPrs3d(); + int aTimeStampNumber = aColoredPrs->GetTimeStampNumber(); + + VISU::TEntity aEntity = VISU::TEntity(theEntity); + + VISU::Result_i::PInput anInput = aColoredPrs->GetCResult()->GetInput(aColoredPrs->GetCMeshName(), + theEntity, + theFieldName, + aTimeStampNumber); + + PField aVectorialField = anInput->GetField(aColoredPrs->GetCMeshName(), aEntity, theFieldName); + + VISU::PUnstructuredGridIDMapper anIDMapper = + anInput->GetTimeStampOnMesh(aColoredPrs->GetCMeshName(), + aEntity, + theFieldName, + aTimeStampNumber); + if(GetSpecificDeformedPL() && anIDMapper) { + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificDeformedPL(), &VISU_DeformationPL::SetVectorialField, anIDMapper)); + + VISU::TSetModified aModified(GetColoredPrs3d()); + + myVectorialEntity = theEntity; + myVectorialFieldName = theFieldName; + myVectorialField = anIDMapper; + } +}; diff --git a/src/VISU_I/VISU_Deformation_i.hh b/src/VISU_I/VISU_Deformation_i.hh new file mode 100755 index 00000000..821b2735 --- /dev/null +++ b/src/VISU_I/VISU_Deformation_i.hh @@ -0,0 +1,103 @@ +// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_Deformation_i.hxx +// Author : +// Module : VISU + +#ifndef VISU_Deformation_i_HeaderFile +#define VISU_Deformation_i_HeaderFile + +#include "VISU_I.hxx" +#include "VISU_ColoredPrs3d_i.hh" +#include "VISU_DeformationPL.hxx" + + + +namespace VISU{ + + class VISU_I_EXPORT Deformation_i : public virtual POA_VISU::Deformation + { + Deformation_i(const Deformation_i&); + public: + typedef VISU::Deformation TInterface; + + Deformation_i(VISU::ColoredPrs3d_i* theColoredPrs3d); + virtual ~Deformation_i(); + + virtual + void + SetScale(CORBA::Double theScale); + + virtual + CORBA::Double + GetScale(); + + virtual + void + DeformationToStream(std::ostringstream& theStr); + + virtual + void + RestoreDeformation(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap); + + virtual + void + SameAsDeformation(const Deformation_i *aDeformedPrs); + + virtual + VISU::Entity + GetVectorialFieldEntity(); + + virtual + char* + GetVectorialFieldName(); + + virtual void SetVectorialField(Entity theEntity, const char* theFieldName); + + protected: + virtual + void + InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine); + + VISU_DeformationPL* + GetSpecificDeformedPL() const + { + return myDeformationPL; + } + + ColoredPrs3d_i* GetColoredPrs3d(){ + return myColoredPrs3d; + } + + + private: + VISU_DeformationPL *myDeformationPL; + + PField myVectorialField; + VISU::Entity myVectorialEntity; + std::string myVectorialFieldName; + ColoredPrs3d_i *myColoredPrs3d; + + }; +} + +#endif diff --git a/src/VISU_I/VISU_DeformedShapeAndScalarMap_i.cc b/src/VISU_I/VISU_DeformedShapeAndScalarMap_i.cc new file mode 100644 index 00000000..f5b4316f --- /dev/null +++ b/src/VISU_I/VISU_DeformedShapeAndScalarMap_i.cc @@ -0,0 +1,404 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_DeformedShapeAndScalarMap_i.cc +// Author : Eugeny Nikolaev +// Module : VISU + +#include "VISU_DeformedShapeAndScalarMap_i.hh" +#include "VISU_Prs3dUtils.hh" +#include "VISU_Result_i.hh" + +#include "VISU_ScalarMapAct.h" +#include "VISU_DeformedShapeAndScalarMapPL.hxx" +#include "VISU_Convertor.hxx" + +#include "SUIT_ResourceMgr.h" +#include "SALOME_Event.hxx" + +#include +#include +#include + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +static int INCMEMORY = 4+12; + + +//--------------------------------------------------------------- +size_t +VISU::DeformedShapeAndScalarMap_i +::IsPossible(Result_i* theResult, + const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber, + bool theIsMemoryCheck) +{ + size_t aResult = 0; + try{ + aResult = TSuperClass::IsPossible(theResult, + theMeshName, + theEntity, + theFieldName, + theTimeStampNumber, + false); + if(theIsMemoryCheck && aResult){ + VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName, + theEntity, + theFieldName, + theTimeStampNumber); + VISU::PField aField = anInput->GetField(theMeshName, + (VISU::TEntity)theEntity, + theFieldName); + if(aField->myNbComp <= 1) + return 0; + + bool anIsEstimated = true; + size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName, + (VISU::TEntity)theEntity, + theFieldName, + theTimeStampNumber, + anIsEstimated); + if(anIsEstimated) + aSize *= INCMEMORY; + aResult = VISU_PipeLine::CheckAvailableMemory(aSize); + if(MYDEBUG) + MESSAGE("DeformedShapeAndScalarMap_i::IsPossible - CheckAvailableMemory = "<(theOrigin)){ + DeformedShapeAndScalarMap_i* anOrigin = const_cast(aPrs3d); + CORBA::String_var aFieldName = anOrigin->GetScalarFieldName(); + + SetScalarField(anOrigin->GetScalarEntity(), + aFieldName, + anOrigin->GetScalarTimeStampNumber()); + Update(); + } +} + + +//--------------------------------------------------------------- +void +VISU::DeformedShapeAndScalarMap_i +::SetScale(CORBA::Double theScale) +{ + VISU::TSetModified aModified(this); + + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificPL(), &VISU_DeformedShapeAndScalarMapPL::SetScale, theScale)); +} + + +//--------------------------------------------------------------- +CORBA::Double +VISU::DeformedShapeAndScalarMap_i +::GetScale() +{ + return myDeformedShapeAndScalarMapPL->GetScale(); +} + + +//--------------------------------------------------------------- +void +VISU::DeformedShapeAndScalarMap_i +::CreatePipeLine(VISU_PipeLine* thePipeLine) +{ + if(!thePipeLine){ + myDeformedShapeAndScalarMapPL = VISU_DeformedShapeAndScalarMapPL::New(); + }else + myDeformedShapeAndScalarMapPL = dynamic_cast(thePipeLine); + + myDeformedShapeAndScalarMapPL->GetMapper()->SetScalarVisibility(1); + + TSuperClass::CreatePipeLine(myDeformedShapeAndScalarMapPL); +} + + +//--------------------------------------------------------------- +bool +VISU::DeformedShapeAndScalarMap_i +::CheckIsPossible() +{ + return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true); +} + + +//--------------------------------------------------------------- +VISU_Actor* +VISU::DeformedShapeAndScalarMap_i +::CreateActor() +{ + VISU_Actor* anActor = TSuperClass::CreateActor(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2); + bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false); + anActor->SetRepresentation(aDispMode); + if (toShrink) + anActor->SetShrink(); + anActor->SetVTKMapping(false); + return anActor; +} + + +//--------------------------------------------------------------- +void +VISU::DeformedShapeAndScalarMap_i +::UpdateActor(VISU_Actor* theActor) +{ + if(VISU_ScalarMapAct* anActor = dynamic_cast(theActor)){ + anActor->SetBarVisibility(true); + GetPipeLine()->GetMapper()->SetScalarVisibility(1); + } + TSuperClass::UpdateActor(theActor); +} + + +//--------------------------------------------------------------- +void +VISU::DeformedShapeAndScalarMap_i +::SetField(VISU::PField theField) +{ + TSuperClass::SetField(theField); + + if(!myScalarField) + myScalarField = theField; +} + + +//--------------------------------------------------------------- +void +VISU::DeformedShapeAndScalarMap_i +::SetScalarField(VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theTimeStampNumber) +{ + bool anIsModified = false; + + if(!anIsModified) + anIsModified |= myScalarEntity != theEntity; + + if(!anIsModified) + anIsModified |= myScalarFieldName != theFieldName; + + if(!anIsModified) + anIsModified |= myScalarTimeStampNumber != theTimeStampNumber; + + if(!anIsModified) + return; + + VISU::TSetModified aModified(this); + + VISU::TEntity aEntity = VISU::TEntity(theEntity); + VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(), + theEntity, + theFieldName, + theTimeStampNumber); + myScalarField = anInput->GetField(GetCMeshName(), aEntity, theFieldName); + + VISU::PUnstructuredGridIDMapper anIDMapper = + anInput->GetTimeStampOnMesh(GetCMeshName(), + aEntity, + theFieldName, + theTimeStampNumber); + + vtkUnstructuredGrid* anOutput = anIDMapper->GetUnstructuredGridOutput(); + if(myDeformedShapeAndScalarMapPL && anOutput) + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificPL(), &VISU_DeformedShapeAndScalarMapPL::SetScalars, anOutput)); + + myScalarEntity = theEntity; + myScalarFieldName = theFieldName; + myScalarTimeStampNumber = theTimeStampNumber; + + SetTitle(theFieldName); + SetScalarMode(GetScalarMode()); + if(!IsRangeFixed() && IsPipeLineExists()) + SetSourceRange(); + + myParamsTime.Modified(); +} + + +//--------------------------------------------------------------- +VISU::Entity +VISU::DeformedShapeAndScalarMap_i +::GetScalarEntity() +{ + return myScalarEntity; +} + + +//--------------------------------------------------------------- +char* +VISU::DeformedShapeAndScalarMap_i +::GetScalarFieldName() +{ + return CORBA::string_dup(myScalarFieldName.c_str()); +} + + +//--------------------------------------------------------------- +CORBA::Long +VISU::DeformedShapeAndScalarMap_i +::GetScalarTimeStampNumber() +{ + return myScalarTimeStampNumber; +} + + +//--------------------------------------------------------------- +VISU::PField +VISU::DeformedShapeAndScalarMap_i +::GetScalarField() +{ + return myScalarField; +} diff --git a/src/VISU_I/VISU_DeformedShapeAndScalarMap_i.hh b/src/VISU_I/VISU_DeformedShapeAndScalarMap_i.hh new file mode 100644 index 00000000..35827d1d --- /dev/null +++ b/src/VISU_I/VISU_DeformedShapeAndScalarMap_i.hh @@ -0,0 +1,179 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File: VISU_DeformedShapeAndScalarMap_i.hh +// Author: Eugeny Nikolaev +// Module : VISU + +#ifndef VISU_DeformedShapeAndScalarMap_i_HeaderFile +#define VISU_DeformedShapeAndScalarMap_i_HeaderFile + +#include "VISU_ScalarMap_i.hh" + +class VISU_DeformedShapeAndScalarMapPL; + +namespace VISU +{ + //---------------------------------------------------------------------------- + //! Class of Scalar Map on Deformed Shape presentation. + class VISU_I_EXPORT DeformedShapeAndScalarMap_i : public virtual POA_VISU::DeformedShapeAndScalarMap, + public virtual ScalarMap_i + { + static int myNbPresent; + DeformedShapeAndScalarMap_i(const DeformedShapeAndScalarMap_i&); + + public: + //---------------------------------------------------------------------------- + typedef ScalarMap_i TSuperClass; + typedef VISU::DeformedShapeAndScalarMap TInterface; + + explicit + DeformedShapeAndScalarMap_i(EPublishInStudyMode thePublishInStudyModep); + + virtual + ~DeformedShapeAndScalarMap_i(); + + virtual + VISU::VISUType + GetType() + { + return VISU::TDEFORMEDSHAPEANDSCALARMAP; + } + + virtual + void + SetScale(CORBA::Double theScale); + + virtual + CORBA::Double + GetScale(); + + virtual + void + SameAs(const Prs3d_i* theOrigin); + + VISU_DeformedShapeAndScalarMapPL* + GetSpecificPL() + { + return myDeformedShapeAndScalarMapPL; + } + + protected: + //! Redefines VISU_ColoredPrs3d_i::SetField + virtual + void + SetField(VISU::PField theField); + + //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine + virtual + void + CreatePipeLine(VISU_PipeLine* thePipeLine); + + //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible + virtual + bool + CheckIsPossible(); + + public: + //! Redefines VISU_ColoredPrs3d_i::IsPossible + static + size_t + IsPossible(Result_i* theResult, + const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber, + bool theIsMemoryCheck); + + //! Redefines VISU_ColoredPrs3d_i::IsPossible + virtual + Storable* + Create(const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber); + + //! Redefines VISU_ColoredPrs3d_i::ToStream + virtual + void + ToStream(std::ostringstream& theStr); + + //! Redefines VISU_ColoredPrs3d_i::Restore + virtual + Storable* + Restore(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap); + + static const std::string myComment; + + virtual + const char* + GetComment() const; + + virtual + QString + GenerateName(); + + virtual + const char* + GetIconName(); + + virtual + VISU_Actor* + CreateActor(); + + virtual + void + UpdateActor(VISU_Actor* theActor) ; + + virtual + void + SetScalarField(VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theTimeStampNumber); + + virtual + VISU::Entity + GetScalarEntity(); + + virtual + char* + GetScalarFieldName(); + + virtual + CORBA::Long + GetScalarTimeStampNumber(); + + virtual + VISU::PField + GetScalarField(); + + private: + VISU_DeformedShapeAndScalarMapPL *myDeformedShapeAndScalarMapPL; + + PField myScalarField; + VISU::Entity myScalarEntity; + std::string myScalarFieldName; + CORBA::Long myScalarTimeStampNumber; + }; +} +#endif diff --git a/src/VISU_I/VISU_MonoColorPrs_i.cc b/src/VISU_I/VISU_MonoColorPrs_i.cc new file mode 100644 index 00000000..28afbc8d --- /dev/null +++ b/src/VISU_I/VISU_MonoColorPrs_i.cc @@ -0,0 +1,186 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_MonoColorPrs_i.cxx +// Author : Vitaly Smetannikov +// Module : VISU + + +#include "VISU_MonoColorPrs_i.hh" +#include "VISU_Prs3dUtils.hh" +#include "VISU_PipeLineUtils.hxx" +#include "VISU_ScalarMapAct.h" + +#include "VISU_PipeLine.hxx" + +#include +#include + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +//--------------------------------------------------------------- +VISU::MonoColorPrs_i +::MonoColorPrs_i(EPublishInStudyMode thePublishInStudyMode): + ColoredPrs3d_i(thePublishInStudyMode), + ScalarMap_i(thePublishInStudyMode) +{ + if(MYDEBUG) MESSAGE("MonoColorPrs_i::MonoColorPrs_i"); +} + +//--------------------------------------------------------------- +void +VISU::MonoColorPrs_i +::SameAs(const Prs3d_i* theOrigin) +{ + TSuperClass::SameAs(theOrigin); + + if(const MonoColorPrs_i* aPrs3d = dynamic_cast(theOrigin)){ + MonoColorPrs_i* anOrigin = const_cast(aPrs3d); + SetColor(anOrigin->GetColor()); + ShowColored(anOrigin->IsColored()); + } +} + + +//--------------------------------------------------------------- +VISU::Storable* +VISU::MonoColorPrs_i +::Create(const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber) +{ + myIsColored = false; + myColor.R = myColor.G = myColor.B = 0.5; + return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber); +} + +//--------------------------------------------------------------- +VISU::Storable* +VISU::MonoColorPrs_i +::Restore(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap) +{ + if(!TSuperClass::Restore(theSObject, theMap)) + return NULL; + + myIsColored = VISU::Storable::FindValue(theMap,"myIsColored").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(); + + return this; +} + +//--------------------------------------------------------------- +void +VISU::MonoColorPrs_i +::ToStream(std::ostringstream& theStr) +{ + TSuperClass::ToStream(theStr); + + Storable::DataToStream( theStr, "myIsColored", myIsColored ); + Storable::DataToStream( theStr, "myColor.R", myColor.R ); + Storable::DataToStream( theStr, "myColor.G", myColor.G ); + Storable::DataToStream( theStr, "myColor.B", myColor.B ); +} + + +//--------------------------------------------------------------- +VISU::MonoColorPrs_i::~MonoColorPrs_i() +{ + if(MYDEBUG) MESSAGE("MonoColorPrs_i::~MonoColorPrs_i()"); +} + +//--------------------------------------------------------------- +CORBA::Boolean VISU::MonoColorPrs_i::IsColored() +{ + return myIsColored; +} + + + +//--------------------------------------------------------------- +void +VISU::MonoColorPrs_i::ShowColored(CORBA::Boolean theColored) +{ + if(myIsColored == theColored) + return; + myIsColored = theColored; + myParamsTime.Modified(); +} + +//--------------------------------------------------------------- +SALOMEDS::Color VISU::MonoColorPrs_i::GetColor() +{ + return myColor; +} + +//--------------------------------------------------------------- +void VISU::MonoColorPrs_i::SetColor(const SALOMEDS::Color& theColor) +{ + bool anIsSameValue = VISU::CheckIsSameValue(myColor.R, theColor.R); + anIsSameValue &= VISU::CheckIsSameValue(myColor.G, theColor.G); + anIsSameValue &= VISU::CheckIsSameValue(myColor.B, theColor.B); + if(anIsSameValue) + return; + + VISU::TSetModified aModified(this); + + myColor = theColor; + myParamsTime.Modified(); +} + +//--------------------------------------------------------------- +VISU_Actor* VISU::MonoColorPrs_i::CreateActor(bool toSupressShrinking) +{ + VISU_Actor* anActor = TSuperClass::CreateActor(toSupressShrinking); + anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); + return anActor; +} + +//--------------------------------------------------------------- +VISU_Actor* VISU::MonoColorPrs_i::CreateActor() +{ + return CreateActor(false); +} + +//--------------------------------------------------------------- +void VISU::MonoColorPrs_i::UpdateActor(VISU_ActorBase* theActor) +{ + if(VISU_ScalarMapAct* anActor = dynamic_cast(theActor)){ + if(IsColored()){ + anActor->SetBarVisibility(true); + GetPipeLine()->GetMapper()->SetScalarVisibility(1); + }else{ + anActor->SetBarVisibility(false); + GetPipeLine()->GetMapper()->SetScalarVisibility(0); + anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); + } + TSuperClass::UpdateActor(theActor); + } +} + diff --git a/src/VISU_I/VISU_MonoColorPrs_i.hh b/src/VISU_I/VISU_MonoColorPrs_i.hh new file mode 100644 index 00000000..50fff308 --- /dev/null +++ b/src/VISU_I/VISU_MonoColorPrs_i.hh @@ -0,0 +1,83 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_MonoColorPrs_i.hxx +// Author : Vitaly Smetannikov +// Module : VISU + + +#ifndef VISU_MonoColorPrs_i_HeaderFile +#define VISU_MonoColorPrs_i_HeaderFile + +#include +#include "VISU_ScalarMap_i.hh" + +namespace VISU +{ + //---------------------------------------------------------------------------- + class VISU_I_EXPORT MonoColorPrs_i : public virtual POA_VISU::MonoColorPrs, + public virtual ScalarMap_i + { + MonoColorPrs_i(const MonoColorPrs_i&); + + public: + //---------------------------------------------------------------------------- + typedef ScalarMap_i TSuperClass; + typedef VISU::MonoColorPrs TInterface; + + explicit MonoColorPrs_i(EPublishInStudyMode thePublishInStudyModep); + + virtual void SameAs(const Prs3d_i* theOrigin); + + virtual ~MonoColorPrs_i(); + + virtual CORBA::Boolean IsColored(); + + virtual void ShowColored(CORBA::Boolean theColored); + + virtual SALOMEDS::Color GetColor(); + + virtual void SetColor(const SALOMEDS::Color& theColor); + + protected: + SALOMEDS::Color myColor; + bool myIsColored; + + public: + virtual Storable* Create(const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber); + + virtual void ToStream(std::ostringstream& theStr); + + virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap); + + virtual VISU_Actor* CreateActor(); + + virtual VISU_Actor* CreateActor(bool toSupressShrinking); + + virtual void UpdateActor(VISU_ActorBase* theActor); + }; +}; +#endif diff --git a/src/VISU_I/VISU_OptionalDeformation_i.cc b/src/VISU_I/VISU_OptionalDeformation_i.cc new file mode 100755 index 00000000..77a12298 --- /dev/null +++ b/src/VISU_I/VISU_OptionalDeformation_i.cc @@ -0,0 +1,110 @@ +// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_OptionalDeformation_i.cc +// Author : +// Module : VISU + +#include "VISU_OptionalDeformation_i.hh" +#include "VISU_Result_i.hh" +#include "VISU_Prs3dUtils.hh" +#include "VISUConfig.hh" + +#include "VISU_OptionalDeformationPL.hxx" + + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +//--------------------------------------------------------------- +VISU::OptionalDeformation_i::OptionalDeformation_i(VISU::ColoredPrs3d_i *theColoredPrs3d): + Deformation_i(theColoredPrs3d) +{ + if(MYDEBUG) MESSAGE("OptionalDeformation_i::OptionalDeformation_i()"); +} + +//--------------------------------------------------------------- +VISU::OptionalDeformation_i::~OptionalDeformation_i() +{ + if(MYDEBUG) MESSAGE("OptionalDeformation_i::~OptionalDeformation_i()"); +} + +//--------------------------------------------------------------- +void VISU::OptionalDeformation_i::UseDeformation(CORBA::Boolean theFlag){ + if(MYDEBUG) MESSAGE("OptionalDeformation_i::UseDeformation()"); + + VISU::TSetModified aModified(GetColoredPrs3d()); + + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificDeformedPL(), &VISU_OptionalDeformationPL::UseDeformation, theFlag)); +} + +//--------------------------------------------------------------- +CORBA::Boolean VISU::OptionalDeformation_i::IsDeformed(){ + + if(MYDEBUG) MESSAGE("OptionalDeformation_i::IsDeformed()"); + return GetSpecificDeformedPL()->IsDeformed(); +} + + +void VISU::OptionalDeformation_i::InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine){ + + if(MYDEBUG) MESSAGE("OptionalDeformation_i::InitDeformedPipeLine()"); + myOptionalDeformationPL = dynamic_cast(theDeformedPipeLine); + + TSuperClass::InitDeformedPipeLine(myOptionalDeformationPL); +} + +//--------------------------------------------------------------- +void VISU::OptionalDeformation_i:: +DeformationToStream(std::ostringstream& theStr) +{ + Storable::DataToStream(theStr,"IsDeformed", IsDeformed()); + if(IsDeformed()) + TSuperClass::DeformationToStream(theStr); +} + +//--------------------------------------------------------------- +void +VISU::OptionalDeformation_i::RestoreDeformation(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap) +{ + UseDeformation(Storable::FindValue(theMap,"IsDeformed").toInt()); + if(IsDeformed()) + TSuperClass::RestoreDeformation(theSObject,theMap); +} + + + +void +VISU::OptionalDeformation_i::SameAsDeformation(const Deformation_i *aDeformedPrs){ + + if(const OptionalDeformation_i* aPrs3d = dynamic_cast(aDeformedPrs)){ + OptionalDeformation_i* anOrigin = const_cast(aPrs3d); + UseDeformation(anOrigin->IsDeformed()); + + if(anOrigin->IsDeformed()){ + TSuperClass::SameAsDeformation(aDeformedPrs); + } + } +} diff --git a/src/VISU_I/VISU_OptionalDeformation_i.hh b/src/VISU_I/VISU_OptionalDeformation_i.hh new file mode 100755 index 00000000..ac6a08ff --- /dev/null +++ b/src/VISU_I/VISU_OptionalDeformation_i.hh @@ -0,0 +1,76 @@ +// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_Deformation_i.hxx +// Author : +// Module : VISU + +#ifndef VISU_OptionalDeformation_i_HeaderFile +#define VISU_OptionalDeformation_i_HeaderFile + +#include "VISU_I.hxx" +#include "VISU_Deformation_i.hh" +#include "VISU_OptionalDeformationPL.hxx" + +namespace VISU { + class VISU_I_EXPORT OptionalDeformation_i : public virtual POA_VISU::OptionalDeformation, + public virtual Deformation_i + { + OptionalDeformation_i(const OptionalDeformation_i&); + public: + typedef VISU::OptionalDeformation TInterface; + typedef Deformation_i TSuperClass; + + OptionalDeformation_i(VISU::ColoredPrs3d_i* theModifiedEngine); + virtual ~OptionalDeformation_i(); + + virtual void UseDeformation(CORBA::Boolean theFlag); + virtual CORBA::Boolean IsDeformed(); + + + virtual + void + DeformationToStream(std::ostringstream& theStr); + + virtual + void + RestoreDeformation(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap); + + virtual + void + SameAsDeformation(const Deformation_i *aDeformedPrs); + + protected: + virtual + void InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine); + + VISU_OptionalDeformationPL* + GetSpecificDeformedPL() const + { + return myOptionalDeformationPL; + } + + private: + VISU_OptionalDeformationPL* myOptionalDeformationPL; + + }; +} +#endif diff --git a/src/VISU_I/VISU_PointMap3d_i.cc b/src/VISU_I/VISU_PointMap3d_i.cc new file mode 100644 index 00000000..40b346a2 --- /dev/null +++ b/src/VISU_I/VISU_PointMap3d_i.cc @@ -0,0 +1,1277 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_PointMap3d_i.cc +// Author : Dmitry Matveitchev +// Module : VISU + +#include "VISU_PointMap3d_i.hh" + +#include "VISU_CutLines_i.hh" +#include "VISU_Result_i.hh" +#include "VISU_ViewManager_i.hh" +#include "VISU_ScalarBarActor.hxx" +#include "SUIT_ResourceMgr.h" + +#include "SALOME_Event.hxx" +#include "VISU_Prs3dUtils.hh" +#include "SPlot2d_Curve.h" +#include "VISU_PipeLineUtils.hxx" + +#include "VISU_TableReader.hxx" +#include "VISU_ConvertorUtils.hxx" +#include "VISU_DeformedGridPL.hxx" + +#include "SALOME_InteractiveObject.hxx" +#include "VISU_Gen_i.hh" + +#include +#include + +#include + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +//---------------------------------------------------------------- +// PointMap3d Object +//---------------------------------------------------------------- +int VISU::PointMap3d_i::myNbPresent = 0; +const string VISU::PointMap3d_i::myComment = "POINTMAP3D"; +/*! + Generate unique name +*/ +QString VISU::PointMap3d_i::GenerateName() +{ + return VISU::GenerateName( "Table3D - ", ++myNbPresent ); +} +/*! + Gets comment string +*/ +const char* VISU::PointMap3d_i::GetComment() const +{ + return myComment.c_str(); +} +/*! + Constructor +*/ +VISU::PointMap3d_i::PointMap3d_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry ) + : Table_i(theStudy, theObjectEntry), + myActorCollection(vtkActorCollection::New()), + myIsActiveState(true) +{ + if(MYDEBUG) MESSAGE("PointMap3d_i::PointMap3d_i - this = "<FindObjectID(theObjectEntry); + myOffset[0] = myOffset[1] = myOffset[2] = 0; + myActorCollection->Delete(); +} +/*! + Destructor +*/ +VISU::PointMap3d_i::~PointMap3d_i() +{ + if(MYDEBUG) MESSAGE("PointMap3d_i::~PointMap3d_i - this = "< TSignal; + const TSignal& mySignal; + + TInvokeSignalEvent(const TSignal& theSignal): + mySignal(theSignal) + {} + + virtual + void + Execute() + { + mySignal(); + } + }; +} + +//---------------------------------------------------------------------------- +void +VISU::PointMap3d_i +::SetTitle( const char* theTitle ) +{ + SetName( theTitle, true ); +} + +//---------------------------------------------------------------------------- +char* +VISU::PointMap3d_i +::GetTitle() +{ + return CORBA::string_dup( GetName().c_str() ); +} + +//---------------------------------------------------------------------------- +SALOMEDS::SObject_var +VISU::PointMap3d_i +::GetSObject() const +{ + return mySObj; +} + +//---------------------------------------------------------------------------- +std::string +VISU::PointMap3d_i +::GetObjectEntry() +{ + CORBA::String_var anEntry = mySObj->GetID(); + return anEntry.in(); +} + +//---------------------------------------------------------------------------- +Handle(SALOME_InteractiveObject) +VISU::PointMap3d_i +::GetIO() +{ + if( myIO.IsNull() ) + myIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str()); + + return myIO; +} + +//---------------------------------------------------------------------------- +/*! + Creates table3d object +*/ +VISU::Storable* VISU::PointMap3d_i::Create() +{ + // generate name ... + SetName(GetTableTitle().latin1(), false); + + if ( GetName() == "" ) { + 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()) SetName(mySObj->GetName(), false); + } + } + + if ( GetName() == "" ) + SetName(GenerateName().latin1(), false); + + // Create Pipeline + myTablePL = VISU_DeformedGridPL::New(); + myTablePL->SetPolyDataIDMapper(GetTableIDMapper()); + myTablePL->Update(); + + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + + bool isUnits = aResourceMgr->booleanValue( "VISU", "scalar_bar_display_units", true ); + SetUnitsVisible(isUnits); + + SetSourceRange(); + + if( aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false) ) + SetScaling(VISU::LOGARITHMIC); + else + SetScaling(VISU::LINEAR); + + int aNumberOfColors = aResourceMgr->integerValue( "VISU", "scalar_bar_num_colors", 64 ); + SetNbColors(aNumberOfColors); + + int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0); + UseFixedRange(aRangeType == 1); + if(aRangeType == 1){ + float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0); + float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0); + SetRange(aMin, aMax); + } + + QString aLabelsFormat = aResourceMgr->stringValue( "VISU", "scalar_bar_label_format", "%-#6.3g" ); + const char *lf=aLabelsFormat.latin1(); + SetLabelsFormat(lf); + + // Orientation + int anOrientation = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", 0); + if(anOrientation == 1) + SetBarOrientation(VISU::ColoredPrs3dBase::HORIZONTAL); + else + SetBarOrientation(VISU::ColoredPrs3dBase::VERTICAL); + + // Scalar Bar origin + QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" ); + + vtkFloatingPointType aXorigin = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL) ? 0.01 : 0.2; + aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin); + myPosition[0] = aXorigin; + + vtkFloatingPointType aYorigin = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL) ? 0.1 : 0.012; + aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin); + myPosition[1] = aYorigin; + + // Scalar Bar size + myWidth = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL)? 0.1 : 0.6; + myWidth = aResourceMgr->doubleValue("VISU", propertyName + "width", myWidth); + + myHeight = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL)? 0.8:0.12; + myHeight = aResourceMgr->doubleValue("VISU", propertyName + "height", myHeight); + + myTitleWidth = aResourceMgr->doubleValue("VISU", propertyName + "title_width", 0); + myTitleHeight = aResourceMgr->doubleValue("VISU", propertyName + "title_height", 0); + myLabelWidth = aResourceMgr->doubleValue("VISU", propertyName + "label_width", 0); + myLabelHeight = aResourceMgr->doubleValue("VISU", propertyName + "label_height", 0); + myBarWidth = aResourceMgr->doubleValue("VISU", propertyName + "bar_width", 0); + myBarHeight = aResourceMgr->doubleValue("VISU", propertyName + "bar_height", 0); + + // Nb of Labels + myNumberOfLabels = aResourceMgr->integerValue( "VISU", "scalar_bar_num_labels", 5 ); + + // Fonts properties definition + myIsBoldTitle = myIsItalicTitle = myIsShadowTitle = true; + myTitFontType = VTK_ARIAL; + + if(aResourceMgr->hasValue( "VISU", "scalar_bar_title_font" )){ + QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_title_font" ); + if ( f.family() == "Arial" ) + myTitFontType = VTK_ARIAL; + else if ( f.family() == "Courier" ) + myTitFontType = VTK_COURIER; + else if ( f.family() == "Times" ) + myTitFontType = VTK_TIMES; + + myIsBoldTitle = f.bold(); + myIsItalicTitle = f.italic(); + myIsShadowTitle = f.underline(); + } + + QColor aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_title_color", QColor( 255, 255, 255 ) ); + + myTitleColor[0] = aTextColor.red() / 255; + myTitleColor[1] = aTextColor.green() / 255; + myTitleColor[2] = aTextColor.blue() / 255; + + myIsBoldLabel = myIsItalicLabel = myIsShadowLabel = true; + myLblFontType = VTK_ARIAL; + + if( aResourceMgr->hasValue( "VISU", "scalar_bar_label_font" )){ + QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_label_font" ); + if ( f.family() == "Arial" ) + myLblFontType = VTK_ARIAL; + else if ( f.family() == "Courier" ) + myLblFontType = VTK_COURIER; + else if ( f.family() == "Times" ) + myLblFontType = VTK_TIMES; + + myIsBoldLabel = f.bold(); + myIsItalicLabel = f.italic(); + myIsShadowLabel = f.underline(); + } + + QColor aLabelColor = aResourceMgr->colorValue( "VISU", "scalar_bar_label_color", QColor( 255, 255, 255 ) ); + + myLabelColor[0] = aLabelColor.red() / 255; + myLabelColor[1] = aLabelColor.green() / 255; + myLabelColor[2] = aLabelColor.blue() / 255; + + // scalar bar default position + bool anIsArrangeBar = aResourceMgr->booleanValue("VISU", "scalar_bars_default_position", 0); + int aPlace = 1; + if (anIsArrangeBar){ + aPlace = aResourceMgr->integerValue("VISU", "scalar_bar_position_num",0); + } + if(myBarOrientation == VISU::ColoredPrs3dBase::HORIZONTAL){ + myPosition[1] += myHeight*(aPlace-1); + } else { + myPosition[0] += myWidth*(aPlace-1); + } + + return Build( false ); +} + +/* + GetIDMapper +*/ + +VISU::PTableIDMapper +VISU::PointMap3d_i +::GetTableIDMapper() +{ + //Initialisate table mapper + SALOMEDS::GenericAttribute_var anAttr; + mySObj->FindAttribute(anAttr, "AttributeTableOfReal"); + SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr); + + PTableIDMapper aTableIDMapper( new TTableIDMapper() ); + TTable2D& aTable2D = *aTableIDMapper; + + aTable2D.myTitle = aTableOfReal->GetTitle(); + + SALOMEDS::StringSeq_var aColStrList = aTableOfReal->GetColumnTitles(); + SALOMEDS::StringSeq_var aRowStrList = aTableOfReal->GetRowTitles(); + + for ( int i = 0; i < aRowStrList->length(); i++ ) { + aTable2D.myColumnTitles.push_back( aRowStrList[ i ].in() ); + } + + int aCols = aTableOfReal->GetNbColumns(); + int aRows = aTableOfReal->GetNbRows(); + + for (int i=1; i<=aCols; i++) { + TTable2D::TRow aRow; + aRow.myTitle = aColStrList[ i-1 ].in(); + for (int j=1; j<=aRows; j++) { + double aVal = aTableOfReal->GetValue(j, i); + QString aValStr = QString::number(aVal); + aRow.myValues.push_back( aValStr ); + } + if( aRow.myValues.size() > 0 ) + aTable2D.myRows.push_back( aRow ); + } + + return aTableIDMapper; +} + +/* + Create Actor +*/ +VISU_PointMap3dActor* VISU::PointMap3d_i::CreateActor() +{ + VISU_PointMap3dActor* anActor = VISU_PointMap3dActor::New(); + anActor->SetPipeLine(myTablePL); + anActor->SetFactory(this); + + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "point_map_represent", 2); + bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_map_shrink", false); + anActor->SetRepresentation(aDispMode); + if (toShrink) anActor->SetShrink(); + + Handle (SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str()); + anActor->setIO(anIO); + + myUpdateActorsSignal.connect(boost::bind(&VISU_Actor::UpdateFromFactory,anActor)); + // myRemoveActorsFromRendererSignal.connect(boost::bind(&VISU_Actor::RemoveFromRender,anActor)); + + myActorCollection->AddItem(anActor); + + UpdateActor( anActor ); + + return anActor; +} + +/* + Update Actor +*/ +void VISU::PointMap3d_i::UpdateActor(VISU_ActorBase* theActor) +{ + if(VISU_PointMap3dActor* anActor = dynamic_cast(theActor)){ + Update(); + VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar(); + aScalarBar->SetLookupTable(GetSpecificPL()->GetBarTable()); + aScalarBar->SetTitle(GetTitle()); + aScalarBar->SetOrientation(GetBarOrientation()); + aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport(); + aScalarBar->GetPositionCoordinate()->SetValue(GetPosX(),GetPosY()); + aScalarBar->SetWidth(GetWidth()); + aScalarBar->SetHeight(GetHeight()); + aScalarBar->SetNumberOfLabels(GetLabels()); + aScalarBar->SetRatios(myTitleWidth, myTitleHeight, + myLabelWidth, myLabelHeight, + myBarWidth, myBarHeight); + aScalarBar->SetNumberOfLabels(GetLabels()); + aScalarBar->SetLabelFormat(GetLabelsFormat()); + + vtkFloatingPointType anRGB[3]; + + vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty(); + aTitleProp->SetFontFamily(GetTitFontType()); + + GetTitleColor(anRGB[0],anRGB[1],anRGB[2]); + aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]); + + IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff(); + IsItalicTitle()? aTitleProp->ItalicOn() : aTitleProp->ItalicOff(); + IsShadowTitle()? aTitleProp->ShadowOn() : aTitleProp->ShadowOff(); + + vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty(); + aLabelProp->SetFontFamily(GetLblFontType()); + + GetLabelColor(anRGB[0],anRGB[1],anRGB[2]); + aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]); + + IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff(); + IsItalicLabel()? aLabelProp->ItalicOn() : aLabelProp->ItalicOff(); + IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff(); + + aScalarBar->Modified(); + } + theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]); +} + +void +VISU::PointMap3d_i +::UpdateActors() +{ + if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors - this = "< + (GetSpecificPL(), &VISU_PipeLine::Update)); + + ProcessVoidEvent(new VISU::TInvokeSignalEvent(myUpdateActorsSignal)); +} + +//---------------------------------------------------------------------------- +void +VISU::PointMap3d_i +::Update() +{ + if(GetMTime() < myUpdateTime.GetMTime()) + return; + + if(MYDEBUG) MESSAGE("PointMap3d_i::Update - this = "< + (GetSpecificPL(), &VISU_PipeLine::Update)); + myUpdateTime.Modified(); + }catch(std::exception&){ + throw; + }catch(...){ + throw std::runtime_error("PointMap3d_i::Update >> unexpected exception was caught!!!"); + } +} + +//---------------------------------------------------------------------------- +unsigned long int +VISU::PointMap3d_i +::GetMTime() +{ + unsigned long int aTime = myParamsTime.GetMTime(); + if( GetSpecificPL() ) + aTime = std::max(aTime, GetSpecificPL()->GetMTime()); + return aTime; +} + +/*! + Builds presentation of table +*/ +VISU::Storable* VISU::PointMap3d_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::Study_var aStudy = GetStudyDocument(); + SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder(); + SALOMEDS::GenericAttribute_var anAttr; + // look for component + if ( !theRestoring ) { + SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() ); + // create SObject and set attributes + QString aComment; + if(pCutLines) + aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment()); + else{ + aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment()); + SALOMEDS::SObject_var aFatherSObject = SO->GetFather(); + if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){ + SALOMEDS::AttributeString_var aCommentAttr = + SALOMEDS::AttributeString::_narrow(anAttr); + CORBA::String_var aValue = aCommentAttr->Value(); + Storable::TRestoringMap aMap; + Storable::StringToMap(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;mySourceId=TableFile",GetComment()); + } + } + } + } + + string anEntry = CreateAttributes( GetStudyDocument(), + SO->GetID(),//SComponent->GetID(), + "ICON_TREE_TABLE", + GetID(), + GetName(), + "", + aComment.latin1(), + pCutLines ); + // create SObject referenced to real table object + mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->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::PointMap3d_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO) +{ + if(MYDEBUG) MESSAGE(GetComment()); + SetName(VISU::Storable::FindValue(theMap,"myName").latin1(), false); + myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1(); + myOrientation = ( VISU::Table::Orientation )( VISU::Storable::FindValue(theMap,"myOrientation").toInt() ); + mySObj = SALOMEDS::SObject::_duplicate(SO); + + //Create PipeLine + myTablePL = VISU_DeformedGridPL::New(); + myTablePL->SetPolyDataIDMapper(GetTableIDMapper()); + myTablePL->Update(); + + //Restore Other Values + + float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble(); + float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble(); + SetRange(aMin, aMax); + + UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange", "0").toInt()); + + SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt()); + SetUnitsVisible(VISU::Storable::FindValue(theMap,"myUnitsVisible", "1").toInt()); + SetLabelsFormat(VISU::Storable::FindValue(theMap,"myLabelsFormat", "%-#6.3g")); + SetBarOrientation((VISU::ColoredPrs3dBase::Orientation)VISU::Storable::FindValue(theMap,"myBarOrientation").toInt()); + + SetTitle(VISU::Storable::FindValue(theMap,"myTitle").latin1()); + myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt(); + myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble(); + myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble(); + myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble(); + myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble(); + myTitleWidth = VISU::Storable::FindValue(theMap,"myTitleWidth").toInt(); + myTitleHeight = VISU::Storable::FindValue(theMap,"myTitleHeight").toInt(); + myLabelWidth = VISU::Storable::FindValue(theMap,"myLabelWidth").toInt(); + myLabelHeight = VISU::Storable::FindValue(theMap,"myLabelHeight").toInt(); + myBarWidth = VISU::Storable::FindValue(theMap,"myBarWidth").toInt(); + myBarHeight = VISU::Storable::FindValue(theMap,"myBarHeight").toInt(); + + myTitFontType = VISU::Storable::FindValue(theMap,"myTitFontType").toInt(); + myIsBoldTitle = VISU::Storable::FindValue(theMap,"myIsBoldTitle").toInt(); + myIsItalicTitle = VISU::Storable::FindValue(theMap,"myIsItalicTitle").toInt(); + myIsShadowTitle = VISU::Storable::FindValue(theMap,"myIsShadowTitle").toInt(); + myTitleColor[0] = VISU::Storable::FindValue(theMap,"myTitleColor[0]").toFloat(); + myTitleColor[1] = VISU::Storable::FindValue(theMap,"myTitleColor[1]").toFloat(); + myTitleColor[2] = VISU::Storable::FindValue(theMap,"myTitleColor[2]").toFloat(); + + myLblFontType = VISU::Storable::FindValue(theMap,"myLblFontType").toInt(); + myIsBoldLabel = VISU::Storable::FindValue(theMap,"myIsBoldLabel").toInt(); + myIsItalicLabel = VISU::Storable::FindValue(theMap,"myIsItalicLabel").toInt(); + myIsShadowLabel = VISU::Storable::FindValue(theMap,"myIsShadowLabel").toInt(); + myLabelColor[0] = VISU::Storable::FindValue(theMap,"myLabelColor[0]").toFloat(); + myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat(); + myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat(); + + myParamsTime.Modified(); + return Build( true ); +} +/*! + Flushes table data into stream +*/ +void VISU::PointMap3d_i::ToStream( std::ostringstream& theStr ) +{ + Storable::DataToStream( theStr, "myName", GetName().c_str() ); + Storable::DataToStream( theStr, "myTitle", myTitle.c_str() ); + Storable::DataToStream( theStr, "myOrientation", myOrientation ); + + Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() ); + Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() ); + Storable::DataToStream( theStr, "myIsFixedRange", IsRangeFixed() ); + + Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) ); + Storable::DataToStream( theStr, "myBarOrientation", myBarOrientation ); + + Storable::DataToStream( theStr, "myTitle", myTitle.c_str() ); + Storable::DataToStream( theStr, "myUnitsVisible", myIsUnits ); + Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels ); + Storable::DataToStream( theStr, "myLabelsFormat", myLabelsFormat.c_str() ); + Storable::DataToStream( theStr, "myPosition[0]", myPosition[0] ); + Storable::DataToStream( theStr, "myPosition[1]", myPosition[1] ); + Storable::DataToStream( theStr, "myWidth", myWidth ); + Storable::DataToStream( theStr, "myHeight", myHeight ); + Storable::DataToStream( theStr, "myTitleWidth", myTitleWidth ); + Storable::DataToStream( theStr, "myTitleHeight", myTitleHeight ); + Storable::DataToStream( theStr, "myLabelWidth", myLabelWidth ); + Storable::DataToStream( theStr, "myLabelHeight", myLabelHeight ); + Storable::DataToStream( theStr, "myBarWidth", myBarWidth ); + Storable::DataToStream( theStr, "myBarHeight", myBarHeight ); + + Storable::DataToStream( theStr, "myTitFontType", myTitFontType ); + Storable::DataToStream( theStr, "myIsBoldTitle", myIsBoldTitle ); + Storable::DataToStream( theStr, "myIsItalicTitle", myIsItalicTitle ); + Storable::DataToStream( theStr, "myIsShadowTitle", myIsShadowTitle ); + Storable::DataToStream( theStr, "myTitleColor[0]", myTitleColor[0] ); + Storable::DataToStream( theStr, "myTitleColor[1]", myTitleColor[1] ); + Storable::DataToStream( theStr, "myTitleColor[2]", myTitleColor[2] ); + + Storable::DataToStream( theStr, "myLblFontType", myLblFontType ); + Storable::DataToStream( theStr, "myIsBoldLabel", myIsBoldLabel ); + Storable::DataToStream( theStr, "myIsItalicLabel", myIsItalicLabel ); + Storable::DataToStream( theStr, "myIsShadowLabel", myIsShadowLabel ); + Storable::DataToStream( theStr, "myLabelColor[0]", myLabelColor[0] ); + Storable::DataToStream( theStr, "myLabelColor[1]", myLabelColor[1] ); + Storable::DataToStream( theStr, "myLabelColor[2]", myLabelColor[2] ); +} +/*! + Called from engine to restore table from the file +*/ +VISU::Storable* VISU::PointMap3d_i::StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) +{ + SALOMEDS::Study_var aStudy = theSObject->GetStudy(); + VISU::PointMap3d_i* pResent = new VISU::PointMap3d_i( aStudy, "" ); + return pResent->Restore( theMap, theSObject); +} +/*! + Gets title for the original table object +*/ +QString VISU::PointMap3d_i::GetTableTitle() +{ + SALOMEDS::SObject_var SO = mySObj; + SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->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 ); + CORBA::String_var aString = anInt->GetTitle(); + return aString.in(); + } + else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) { + aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr ); + CORBA::String_var aString = aReal->GetTitle(); + return aString.in(); + } + } + return ""; +} + +//--------------------------------------------------------------- +void VISU::PointMap3d_i::RemoveFromStudy() +{ + struct TRemoveFromStudy: public SALOME_Event + { + VISU::PointMap3d_i* myRemovable; + TRemoveFromStudy(VISU::PointMap3d_i* theRemovable): + myRemovable(theRemovable) + {} + + virtual + void + Execute() + { + VISU::RemoveFromStudy(myRemovable->GetSObject(),false); + } + }; + + // Remove the table with all curves + ProcessVoidEvent(new TRemoveFromStudy(this)); +} + +//---------------------------------------------------------------- +void VISU::PointMap3d_i::SetOffset(CORBA::Float theDx, CORBA::Float theDy, CORBA::Float theDz) +{ + myOffset[0] = theDx; + myOffset[1] = theDy; + myOffset[2] = theDz; + myParamsTime.Modified(); +} + +void VISU::PointMap3d_i::GetOffset(CORBA::Float& theDx, CORBA::Float& theDy, CORBA::Float& theDz) +{ + theDx = myOffset[0]; + theDy = myOffset[1]; + theDz = myOffset[2]; +} + +CORBA::Float VISU::PointMap3d_i::GetMemorySize() +{ + CORBA::Float aSize = GetSpecificPL()->GetMemorySize(); + + int anEnd = myActorCollection->GetNumberOfItems(); + for(int anId = 0; anId < anEnd; anId++) + if(vtkObject* anObject = myActorCollection->GetItemAsObject(anId)) + if(VISU_Actor* anActor = dynamic_cast(anObject)){ + aSize += anActor->GetMemorySize(); + //cout<<"Prs3d_i::GetMemorySize - "<GetValue(1, 1); + + for (int i=1; i<=aTableOfReal->GetNbColumns(); i++) + for (int j=1; j<=aTableOfReal->GetNbRows(); j++) { + double aVal = aTableOfReal->GetValue(j, i); + if (aVal < aMin) + aMin = aVal; + } + + return aMin; +} + +CORBA::Double VISU::PointMap3d_i::GetMaxTableValue() +{ + SALOMEDS::GenericAttribute_var anAttr; + mySObj->FindAttribute(anAttr, "AttributeTableOfReal"); + SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr); + double aMax = aTableOfReal->GetValue(1, 1); + + for (int i=1; i<=aTableOfReal->GetNbColumns(); i++) + for (int j=1; j<=aTableOfReal->GetNbRows(); j++) { + double aVal = aTableOfReal->GetValue(j, i); + if (aVal > aMax) + aMax = aVal; + } + + return aMax; +} + +CORBA::Double VISU::PointMap3d_i::GetMax() +{ + return myTablePL->GetScalarRange()[1]; +} + +void VISU::PointMap3d_i::SetRange(CORBA::Double theMin, CORBA::Double theMax) +{ + vtkFloatingPointType aScalarRange[2] = {theMin, theMax}; + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificPL(), &VISU_DeformedGridPL::SetScalarRange, aScalarRange)); + + UseFixedRange(true); +} + +CORBA::Double VISU::PointMap3d_i::GetSourceMin() +{ + vtkFloatingPointType aRange[2]; + GetSpecificPL()->GetSourceRange(aRange); + return aRange[0]; +} + +CORBA::Double VISU::PointMap3d_i::GetSourceMax() +{ + vtkFloatingPointType aRange[2]; + GetSpecificPL()->GetSourceRange(aRange); + return aRange[1]; +} + +void VISU::PointMap3d_i::SetSourceRange() +{ + GetSpecificPL()->SetSourceRange(); + ProcessVoidEvent(new TVoidMemFunEvent + (GetSpecificPL(), &VISU_DeformedGridPL::SetSourceRange)); + + UseFixedRange(false); +} + +CORBA::Boolean VISU::PointMap3d_i::IsRangeFixed() +{ + return myIsFixedRange; +} + +void VISU::PointMap3d_i::UseFixedRange(bool theRange) +{ + if(myIsFixedRange == theRange) + return; + + myIsFixedRange = theRange; +} + +void VISU::PointMap3d_i::SetPosition(CORBA::Double theX, CORBA::Double theY) +{ + bool anIsSameValue = VISU::CheckIsSameValue(myPosition[0], theX); + anIsSameValue &= VISU::CheckIsSameValue(myPosition[1], theY); + if(anIsSameValue) + return; + + myPosition[0] = theX; + myPosition[1] = theY; +} + +CORBA::Double VISU::PointMap3d_i::GetPosX() +{ + return myPosition[0]; +} + +CORBA::Double VISU::PointMap3d_i::GetPosY() +{ + return myPosition[1]; +} + +void VISU::PointMap3d_i::SetSize(CORBA::Double theWidth, CORBA::Double theHeight) +{ + bool anIsSameValue = VISU::CheckIsSameValue(myWidth, theWidth); + anIsSameValue &= VISU::CheckIsSameValue(myHeight, theHeight); + if(anIsSameValue) + return; + + myWidth = theWidth; + myHeight = theHeight; +} + +CORBA::Double VISU::PointMap3d_i::GetHeight() +{ + return myHeight; +} + +CORBA::Double VISU::PointMap3d_i::GetWidth() +{ + return myWidth; +} + +void VISU::PointMap3d_i::SetNbColors(CORBA::Long theNbColors) +{ + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificPL(), &VISU_DeformedGridPL::SetNbColors, theNbColors)); +} + +CORBA::Long VISU::PointMap3d_i::GetNbColors() +{ + return GetSpecificPL()->GetNbColors(); +} + +void VISU::PointMap3d_i::SetLabels(CORBA::Long theNbLabels) +{ + if(myNumberOfLabels == theNbLabels) + return; + + myNumberOfLabels = theNbLabels; +} + +CORBA::Long VISU::PointMap3d_i::GetLabels() +{ + return myNumberOfLabels; +} + +void VISU::PointMap3d_i::SetBarOrientation(VISU::ColoredPrs3dBase::Orientation theBarOrientation) +{ + if(myBarOrientation == theBarOrientation) + return; + + myBarOrientation = theBarOrientation; +} + +VISU::ColoredPrs3dBase::Orientation VISU::PointMap3d_i::GetBarOrientation() +{ + return myBarOrientation; +} + +//------------------- ScaledPrs3d Methods ----------------------- + +void VISU::PointMap3d_i::SetScaling(VISU::Scaling theScaling) +{ + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificPL(), &VISU_DeformedGridPL::SetScaling, theScaling)); +} + +VISU::Scaling VISU::PointMap3d_i::GetScaling() +{ + return VISU::Scaling(GetSpecificPL()->GetScaling()); +} + +//------------------- Check Table on Positive Values ------------ +bool VISU::PointMap3d_i::IsPositiveTable() +{ + SALOMEDS::GenericAttribute_var anAttr; + mySObj->FindAttribute(anAttr, "AttributeTableOfReal"); + SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr); + + for (int i=1; i<=aTableOfReal->GetNbColumns(); i++) + for (int j=1; j<=aTableOfReal->GetNbRows(); j++) { + double aVal = aTableOfReal->GetValue(j, i); + if (aVal < 0) + return false; + } + + return true; +} + +//------------------- Plot3dBase Methods ------------------------ + +void VISU::PointMap3d_i::SetScaleFactor (CORBA::Double theScaleFactor) +{ + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificPL(), &VISU_DeformedGridPL::SetScaleFactor, theScaleFactor)); +} + +CORBA::Double VISU::PointMap3d_i::GetScaleFactor () +{ + return myTablePL->GetScaleFactor(); +} + +void VISU::PointMap3d_i::SetContourPrs (CORBA::Boolean theIsContourPrs ) +{ + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificPL(), &VISU_DeformedGridPL::SetContourPrs, theIsContourPrs)); +} + +CORBA::Boolean VISU::PointMap3d_i::GetIsContourPrs() +{ + return myTablePL->GetIsContourPrs(); +} + +void VISU::PointMap3d_i::SetNbOfContours (CORBA::Long theNb) +{ + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificPL(), &VISU_DeformedGridPL::SetNumberOfContours, theNb)); +} + +CORBA::Long VISU::PointMap3d_i::GetNbOfContours () +{ + return myTablePL->GetNumberOfContours(); +} + +//-------------------- Actor Factory Methods -------------------- + +bool VISU::PointMap3d_i::GetActiveState () +{ + return myIsActiveState; +} + +void VISU::PointMap3d_i::SetActiveState ( bool theState ) +{ + myIsActiveState = theState; +} + +void VISU::PointMap3d_i::RemoveActor (VISU_ActorBase* theActor) +{ + myActorCollection->RemoveItem(theActor); +} + +void VISU::PointMap3d_i::RemoveActors () +{ + ProcessVoidEvent(new TInvokeSignalEvent(myRemoveActorsFromRendererSignal)); + myActorCollection->RemoveAllItems(); +} + + +//-----------------------Text Properties & Label Properties------------------ +bool VISU::PointMap3d_i::IsBoldTitle() +{ + return myIsBoldTitle; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetBoldTitle(bool theIsBoldTitle) +{ + if(myIsBoldTitle == theIsBoldTitle) + return; + + myIsBoldTitle = theIsBoldTitle; + myParamsTime.Modified(); +} + +//---------------------------------------------------------------------------- +bool VISU::PointMap3d_i::IsItalicTitle() +{ + return myIsItalicTitle; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetItalicTitle(bool theIsItalicTitle) +{ + if(myIsItalicTitle == theIsItalicTitle) + return; + + myIsItalicTitle = theIsItalicTitle; + myParamsTime.Modified(); +} + +//---------------------------------------------------------------------------- +bool VISU::PointMap3d_i::IsShadowTitle() +{ + return myIsShadowTitle; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetShadowTitle(bool theIsShadowTitle) +{ + if(myIsShadowTitle == theIsShadowTitle) + return; + + myIsShadowTitle = theIsShadowTitle; + myParamsTime.Modified(); +} + +//---------------------------------------------------------------------------- +int VISU::PointMap3d_i::GetTitFontType() +{ + return myTitFontType; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetTitFontType(int theTitFontType) +{ + if(myTitFontType == theTitFontType) + return; + + myTitFontType = theTitFontType; + myParamsTime.Modified(); +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::GetTitleColor(vtkFloatingPointType& theR, + vtkFloatingPointType& theG, + vtkFloatingPointType& theB) +{ + theR = myTitleColor[0]; + theG = myTitleColor[1]; + theB = myTitleColor[2]; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetTitleColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB) +{ + bool anIsSameValue = VISU::CheckIsSameValue(myTitleColor[0], theR); + anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[1], theG); + anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[2], theB); + if(anIsSameValue) + return; + + myTitleColor[0] = theR; + myTitleColor[1] = theG; + myTitleColor[2] = theB; + myParamsTime.Modified(); +} + +//---------------------------------------------------------------------------- +bool VISU::PointMap3d_i::IsBoldLabel() +{ + return myIsBoldLabel; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetBoldLabel(bool theIsBoldLabel) +{ + if(myIsBoldLabel == theIsBoldLabel) + return; + + myIsBoldLabel = theIsBoldLabel; + myParamsTime.Modified(); +} + +//---------------------------------------------------------------------------- +bool VISU::PointMap3d_i::IsItalicLabel() +{ + return myIsItalicLabel; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetItalicLabel(bool theIsItalicLabel) +{ + if(myIsItalicLabel == theIsItalicLabel) + return; + + myIsItalicLabel = theIsItalicLabel; + myParamsTime.Modified(); +} + +//---------------------------------------------------------------------------- +bool VISU::PointMap3d_i::IsShadowLabel() +{ + return myIsShadowLabel; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetShadowLabel(bool theIsShadowLabel) +{ + if(myIsShadowLabel == theIsShadowLabel) + return; + + myIsShadowLabel = theIsShadowLabel; + myParamsTime.Modified(); +} + +//---------------------------------------------------------------------------- +int VISU::PointMap3d_i::GetLblFontType() +{ + return myLblFontType; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetLblFontType(int theLblFontType) +{ + if(myLblFontType == theLblFontType) + return; + + myLblFontType = theLblFontType; + myParamsTime.Modified(); +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::GetLabelColor(vtkFloatingPointType& theR, + vtkFloatingPointType& theG, + vtkFloatingPointType& theB) +{ + theR = myLabelColor[0]; + theG = myLabelColor[1]; + theB = myLabelColor[2]; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetLabelColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB) +{ + bool anIsSameValue = VISU::CheckIsSameValue(myLabelColor[0], theR); + anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[1], theG); + anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[2], theB); + if(anIsSameValue) + return; + + myLabelColor[0] = theR; + myLabelColor[1] = theG; + myLabelColor[2] = theB; + myParamsTime.Modified(); +} + +//---------------------------------------------------------------------------- +CORBA::Long VISU::PointMap3d_i::GetTitleWidth() +{ + return myTitleWidth; +} + +//---------------------------------------------------------------------------- +CORBA::Long VISU::PointMap3d_i::GetTitleHeight() +{ + return myTitleHeight; +} + +//---------------------------------------------------------------------------- +CORBA::Long VISU::PointMap3d_i::GetLabelWidth() +{ + return myLabelWidth; +} + +//---------------------------------------------------------------------------- +CORBA::Long VISU::PointMap3d_i::GetLabelHeight() +{ + return myLabelHeight; +} + +//---------------------------------------------------------------------------- +CORBA::Long VISU::PointMap3d_i::GetBarWidth() +{ + return myBarWidth; +} + +//---------------------------------------------------------------------------- +CORBA::Long VISU::PointMap3d_i::GetBarHeight() +{ + return myBarHeight; +} + +//---------------------------------------------------------------------------- +void +VISU::PointMap3d_i::SetLabelsFormat(const char* theFormat) +{ + if( myLabelsFormat != theFormat ){ + myLabelsFormat = theFormat; + myParamsTime.Modified(); + } +} + +//---------------------------------------------------------------------------- +char* VISU::PointMap3d_i::GetLabelsFormat() +{ + return CORBA::string_dup(myLabelsFormat.c_str()); +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetUnitsVisible(CORBA::Boolean isVisible) +{ + if( myIsUnits != isVisible ){ + myIsUnits = isVisible; + myParamsTime.Modified(); + } +} + +//---------------------------------------------------------------------------- +CORBA::Boolean VISU::PointMap3d_i::IsUnitsVisible() +{ + return myIsUnits; +} + +//---------------------------------------------------------------------------- +void VISU::PointMap3d_i::SetRatios(CORBA::Long theTitleWidth, CORBA::Long theTitleHeight, + CORBA::Long theLabelWidth, CORBA::Long theLabelHeight, + CORBA::Long theBarWidth, CORBA::Long theBarHeight) +{ + bool anIsSameValue = VISU::CheckIsSameValue(myTitleWidth, theTitleWidth); + anIsSameValue &= VISU::CheckIsSameValue(myTitleHeight, theTitleHeight); + anIsSameValue &= VISU::CheckIsSameValue(myLabelWidth, theLabelWidth); + anIsSameValue &= VISU::CheckIsSameValue(myLabelHeight, theLabelHeight); + anIsSameValue &= VISU::CheckIsSameValue(myBarWidth, theBarWidth); + anIsSameValue &= VISU::CheckIsSameValue(myBarHeight, theBarHeight); + if(anIsSameValue) + return; + + myTitleWidth = theTitleWidth; + myTitleHeight = theTitleHeight; + myLabelWidth = theLabelWidth; + myLabelHeight = theLabelHeight; + myBarWidth = theBarWidth; + myBarHeight = theBarHeight; + myParamsTime.Modified(); +} diff --git a/src/VISU_I/VISU_PointMap3d_i.hh b/src/VISU_I/VISU_PointMap3d_i.hh new file mode 100644 index 00000000..340e60b6 --- /dev/null +++ b/src/VISU_I/VISU_PointMap3d_i.hh @@ -0,0 +1,274 @@ +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_PointMap3d_i.hh +// Author : +// Module : VISU + +#ifndef VISU_PointMap3d_i_HeaderFile +#define VISU_PointMap3d_i_HeaderFile + +#include "VISU_PrsObject_i.hh" +#include "SALOME_GenericObj_i.hh" + +#include "VISU_TableReader.hxx" +#include "VISU_PointMap3dActor.h" +#include "VISU_Table_i.hh" +#include "VISU_ActorFactory.h" +#include "VISU_DeformedGridPL.hxx" + +#include +#include + +#include + +namespace VISU +{ + + struct TActorFactory; + + //============================================================================== + class VISU_I_EXPORT PointMap3d_i : public virtual POA_VISU::PointMap3d, + public virtual SALOME::GenericObj_i, + public virtual TActorFactory, + public virtual Table_i + { + static int myNbPresent; + PointMap3d_i( const PointMap3d_i& ); + public: + PointMap3d_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry); + + virtual ~PointMap3d_i(); + virtual VISU::VISUType GetType() { return VISU::TPOINTMAP3D;}; + + virtual void SetTitle( const char* theTitle ); + virtual char* GetTitle(); + + virtual void RemoveFromStudy(); + virtual void UpdateActor(VISU_ActorBase* thePointMap3dActor); + virtual void UpdateActors(); + + virtual void Update(); + + virtual Handle(SALOME_InteractiveObject) GetIO(); + + //----------- override Prs3d methods ----------------------------- + + //! Move the 3D presentation according to the given offset parameters + virtual void SetOffset(CORBA::Float theDx, CORBA::Float theDy, CORBA::Float theDz); + + //! Gets offset parameters for the 3D presentation + virtual void GetOffset(CORBA::Float& theDx, CORBA::Float& theDy, CORBA::Float& theDz); + + //! Gets memory size actually used by the presentation (Mb). + virtual CORBA::Float GetMemorySize(); + + //----------- override ColoredPrs3dBase methods ------------------ + + virtual CORBA::Double GetMin(); + virtual CORBA::Double GetMax(); + virtual CORBA::Double GetMinTableValue(); + virtual CORBA::Double GetMaxTableValue(); + virtual void SetRange(CORBA::Double theMin, CORBA::Double theMax); + + virtual CORBA::Double GetSourceMin(); + virtual CORBA::Double GetSourceMax(); + virtual void SetSourceRange(); + + virtual CORBA::Boolean IsRangeFixed(); + + virtual void SetPosition(CORBA::Double X, CORBA::Double Y); + virtual CORBA::Double GetPosX(); + virtual CORBA::Double GetPosY(); + + virtual void SetSize(CORBA::Double theWidth, CORBA::Double theHeight); + + virtual void SetRatios(CORBA::Long theTitleWidth, CORBA::Long theTitleHeight, + CORBA::Long theLabelWidth, CORBA::Long theLabelHeight, + CORBA::Long theBarWidth, CORBA::Long theBarHeight); + + virtual CORBA::Double GetWidth(); + virtual CORBA::Double GetHeight(); + + virtual void SetNbColors(CORBA::Long theNbColors); + virtual CORBA::Long GetNbColors(); + + virtual void SetLabels(CORBA::Long theNbLabels); + virtual CORBA::Long GetLabels(); + + virtual void SetLabelsFormat(const char* theFormat); + virtual char* GetLabelsFormat(); + + virtual void SetBarOrientation(VISU::ColoredPrs3dBase::Orientation theOrientation); + virtual VISU::ColoredPrs3dBase::Orientation GetBarOrientation(); + + void UseFixedRange(bool theUseFixedRange); + + // ScaledMap Methods + + virtual VISU::Scaling GetScaling(); + virtual void SetScaling(VISU::Scaling theScaling); + + bool IsPositiveTable(); + + // Plot3dBase methods + + void SetScaleFactor (CORBA::Double theScaleFactor); + CORBA::Double GetScaleFactor(); + + void SetContourPrs (CORBA::Boolean theIsContourPrs ); + CORBA::Boolean GetIsContourPrs(); + + void SetNbOfContours (CORBA::Long); + CORBA::Long GetNbOfContours(); + + VISU_DeformedGridPL* GetSpecificPL() const { return myTablePL; } + + // TActorFactory Methods + + //! Gets know whether the factory instance can be used for actor management or not + virtual bool GetActiveState(); + + virtual void SetActiveState(bool theState); + + //! Return modified time of the factory + virtual unsigned long int GetMTime(); + + //! To unregister the actor + virtual void RemoveActor(VISU_ActorBase* theActor); + virtual void RemoveActors(); + + //------ Text Properties & Label Properties ------------------------ + + virtual bool IsBoldTitle(); + virtual void SetBoldTitle(bool isBold); + virtual bool IsItalicTitle(); + virtual void SetItalicTitle(bool isItalic); + virtual bool IsShadowTitle(); + virtual void SetShadowTitle(bool isShadow); + virtual int GetTitFontType(); + virtual void SetTitFontType(int theType); + virtual void GetTitleColor(vtkFloatingPointType& theR, + vtkFloatingPointType& theG, + vtkFloatingPointType& theB); + virtual void SetTitleColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB); + + virtual bool IsBoldLabel(); + virtual void SetBoldLabel(bool isBold); + virtual bool IsItalicLabel(); + virtual void SetItalicLabel(bool isItalic); + virtual bool IsShadowLabel(); + virtual void SetShadowLabel(bool isShadow); + virtual int GetLblFontType(); + virtual void SetLblFontType(int theType); + virtual void GetLabelColor(vtkFloatingPointType& theR, + vtkFloatingPointType& theG, + vtkFloatingPointType& theB); + virtual void SetLabelColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB); + + //------------------------------------------------------------------- + virtual CORBA::Long GetTitleWidth(); + virtual CORBA::Long GetTitleHeight(); + virtual CORBA::Long GetLabelWidth(); + virtual CORBA::Long GetLabelHeight(); + virtual CORBA::Long GetBarWidth(); + virtual CORBA::Long GetBarHeight(); + + virtual void SetUnitsVisible(CORBA::Boolean isVisible); + virtual CORBA::Boolean IsUnitsVisible(); + + //------------------------------------------------------------------- + + protected: + Storable* Build(int theRestoring); + + VISU::Table::Orientation myOrientation; + VISU::ColoredPrs3dBase::Orientation myBarOrientation; + std::string myTitle; + std::string myScalarBarTitle; + bool myIsUnits; + SALOMEDS::SObject_var mySObj; + int myNumberOfLabels; + std::string myLabelsFormat; + vtkFloatingPointType myPosition[2], + myWidth, myHeight, + myTitleWidth, myTitleHeight, + myLabelWidth, myLabelHeight, + myBarWidth, myBarHeight; + bool myIsFixedRange; + CORBA::Float myOffset[3]; + bool myIsActiveState; + vtkTimeStamp myParamsTime; + vtkTimeStamp myUpdateTime; + + Handle(SALOME_InteractiveObject) myIO; + + + //Font management + bool myIsBoldTitle; + bool myIsItalicTitle; + bool myIsShadowTitle; + int myTitFontType; + vtkFloatingPointType myTitleColor[3]; + + bool myIsBoldLabel; + bool myIsItalicLabel; + bool myIsShadowLabel; + int myLblFontType; + vtkFloatingPointType myLabelColor[3]; + + boost::signal0 myUpdateActorsSignal; + boost::signal0 myRemoveActorsFromRendererSignal; + vtkSmartPointer myActorCollection; + + public: + // virtual Storable* Create( const VISU::PTableIDMapper& theTableIDMapper ); + virtual Storable* Create(); + VISU_PointMap3dActor* CreateActor(); + VISU::PTableIDMapper GetTableIDMapper(); + + SALOMEDS::SObject_var GetSObject() const; + VISU_DeformedGridPL* myTablePL; + + virtual Storable* Restore( const Storable::TRestoringMap& theMap, + SALOMEDS::SObject_ptr SO); + + static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject, + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile); + + virtual void ToStream( std::ostringstream& theStr ); + static const std::string myComment; + virtual const char* GetComment() const; + virtual QString GenerateName(); + virtual QString GetTableTitle(); + + virtual std::string GetObjectEntry(); + }; +} + +#endif diff --git a/src/VISU_SWIG/visu_pointmap3d.py b/src/VISU_SWIG/visu_pointmap3d.py new file mode 100755 index 00000000..f16d6ee0 --- /dev/null +++ b/src/VISU_SWIG/visu_pointmap3d.py @@ -0,0 +1,57 @@ +import os +import VISU +from visu_gui import * + +aTableFile = os.getenv('DATA_DIR') + '/Tables/table_test.xls' + +aTableSObject = myVisu.ImportTables(aTableFile) + +aTable = None +if aTableSObject: + anIsFound, aSObject = aTableSObject.FindSubObject(1) + if anIsFound: + aTable = aSObject.GetObject() + +aViewManager = myVisu.GetViewManager(); +aView = aViewManager.Create3DView() +if aView is None : print "Creating View Error" +print aTable + +##########Get Values################ +aScaleFactor = aTable.GetScaleFactor(); +anIsContourPrs = aTable.GetIsContourPrs(); +aNbOfContours = aTable.GetNbOfContours(); +aScaling = aTable.GetScaling(); +aMin = aTable.GetMin(); +aMax = aTable.GetMax(); +aSourceMin = aTable.GetSourceMin(); +aSourceMax = aTable.GetSourceMax(); +aPosX = aTable.GetPosX(); +aPosY = aTable.GetPosY(); +aHeight = aTable.GetHeight(); +aWidth = aTable.GetWidth(); +aNbColors = aTable.GetNbColors(); +aLabels = aTable.GetLabels(); +aBarOrientation = aTable.GetBarOrientation(); + + +print "Get Values:" +print "aScaleFactor = ", aScaleFactor +print "anIsContourPrs = ", anIsContourPrs +print "aNbOfContours = ", aNbOfContours +print "aScaling = ", aScaling +print "===== SCALAR BAR =======" +print "aMin = ", aMin +print "aMax = ", aMax +print "aSourceMin = ", aSourceMin +print "aSourceMax = ", aSourceMax +print "aPosX = ", aPosX +print "aPosY = ", aPosY +print "aHeight = ", aHeight +print "aWidth = ", aWidth +print "aNbColors = ", aNbColors +print "aLabels = ", aLabels +print "aBarOrientation = ", aBarOrientation + +aView.DisplayOnly( aTable ) +aView.FitAll() \ No newline at end of file -- 2.39.2