From: vsr Date: Thu, 10 Jun 2010 10:04:05 +0000 (+0000) Subject: Merge from V5_1_main 10/06/2010 X-Git-Tag: TRIPOLI_302 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FV6_1_BR;p=modules%2Fvisu.git Merge from V5_1_main 10/06/2010 --- diff --git a/doc/salome/gui/VISU/input/importing_exporting_tables_page.doc b/doc/salome/gui/VISU/input/importing_exporting_tables_page.doc index 9b9a4fd1..b66a1176 100644 --- a/doc/salome/gui/VISU/input/importing_exporting_tables_page.doc +++ b/doc/salome/gui/VISU/input/importing_exporting_tables_page.doc @@ -15,8 +15,9 @@ select Table from File item. choose the necessary *.txt, *.tab or *.csv file containing tables and click \b Open button. -Checkbox "Use first string as title" is checked if it is needed to use -information from first string of file as titles of columns of table. +If the checkbox "Use first string as title" is on, the +information from the first string of the file is used as titles of +table columns. @@ -34,11 +35,11 @@ tables. contain your exported table, and click \b OK button. Your table will be exported. -You can perform export table to *.txt or *.tab file +You can export table to *.txt or *.tab file \image html exporttables1.png -Or you can perform export table to *.csv file +Or you can export table to *.csv file \image html exporttables2.png diff --git a/doc/salome/gui/VISU/input/point_marker.doc b/doc/salome/gui/VISU/input/point_marker.doc index efd0bcd9..c7654438 100644 --- a/doc/salome/gui/VISU/input/point_marker.doc +++ b/doc/salome/gui/VISU/input/point_marker.doc @@ -9,7 +9,7 @@ shapes or by loading a custom texture from an external file. - Standard point markers The Post-Pro module provides a set of predefined point marker shapes -which can be used to display points in 3D viewer. +which can be used to display points in the 3D viewer. Each standard point marker has two attributes: type (defines shape form) and scale factor (defines shape size). @@ -23,9 +23,9 @@ form) and scale factor (defines shape size). It is also possible to load a point marker shape from an external file. This file should provide a description of the point texture as a set -of lines; each line is represented as sequence of "0" and "1" symbols, +of lines; each line is represented as a sequence of "0" and "1" symbols, where "1" symbol means an opaque pixel and "0" symbol means a -transparent pixel. The width of the texture correspond to the length +transparent pixel. The width of the texture corresponds to the length of the longest line in the file, expanded to the nearest byte-aligned value. The height of the texture is equal to the number of non-empty lines in the file. Note that missing symbols are replaced by "0". diff --git a/doc/salome/gui/VISU/input/table_presentations.doc b/doc/salome/gui/VISU/input/table_presentations.doc index 44a153bf..2e5f9b5c 100644 --- a/doc/salome/gui/VISU/input/table_presentations.doc +++ b/doc/salome/gui/VISU/input/table_presentations.doc @@ -27,11 +27,10 @@ in the context menu. \image html viewtable.png -When the Enable editing option is checked, contents of the table -are editable. -\note At the current moment this mode allows to sort table data only. -Sorting is performed by clicking on header of the column, by which the data -has to be sorted. +When the Enable editing option is checked, the table contents are editable. +\note At the current moment this mode only allows to sort table data. +The sorting is performed by clicking on the header of the column, by which the data +is sorted. Sort policy option allows to specify how the empty cells will be processed during the sort procedure. The following options are available: @@ -40,11 +39,11 @@ during the sort procedure. The following options are available:
  • Empty cells are considered as highest values
  • Empty cells are always first
  • Empty cells are always last
  • -
  • Empty cells are ignored (means that positions of the empty cells -will not change after sorting)
  • +
  • Empty cells are ignored (this means that the positions of empty cells +will not change after the sorting)
  • -Adjust Cells button allows to adjust size of the table cells according +Adjust Cells button allows to adjust the size of table cells according to their contents. It is also possible to create diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 74dc330c..cf894dfc 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -115,6 +115,7 @@ + diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 43887c4f..06c33ffc 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -678,6 +678,10 @@ VISU_GaussPointsPL vtkFloatingPointType* aScalarRange = GetScalarRange(); vtkFloatingPointType aDeltaScalarRange = aScalarRange[1] - aScalarRange[0]; + // to avoid FPE if the minimum is equal to maximum + if( aDeltaScalarRange < 1.0 / VTK_LARGE_FLOAT ) + return aMinSize; + return aMinSize + aDelta*(aVal - aScalarRange[0]) / aDeltaScalarRange; } diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index 6eb70ecc..a23956c2 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -36,6 +36,9 @@ #include "VTKViewer_GeometryFilter.h" +#include +#include + #include #include @@ -68,8 +71,9 @@ VISU_StreamLinesPL myCenters = vtkCellCenters::New(); myGeomFilter = VTKViewer_GeometryFilter::New(); myPointsFilter = VISU_MaskPointsFilter::New(); - myPercents = 0.3; mySource = NULL; + + myPercents = GetUsedPointsDefault(); } @@ -173,7 +177,7 @@ VISU_StreamLinesPL size_t anIsPossible = CheckAvailableMemory(aSize); if(!anIsPossible){ vtkFloatingPointType aMaxStepLength = std::max(GetMaxStepLength(theDataSet),thePropogationTime); - vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet); + vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet,thePercents); vtkFloatingPointType aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease; for(int i = 2, aStepChanged = 1, aPerecentsChanged = 1; aStepChanged || aPerecentsChanged; i++){ vtkFloatingPointType aStepLength = theStepLength + aDeltaStepLength; @@ -223,10 +227,12 @@ VISU_StreamLinesPL thePercents); thePropogationTime = CorrectPropagationTime(thePropogationTime, - aPointSet); + aPointSet, + thePercents); theStepLength = CorrectStepLength(theStepLength, - aPointSet); + aPointSet, + thePercents); size_t anIsAccepted = FindPossibleParams(aPointSet, theStepLength, @@ -310,10 +316,11 @@ VISU_StreamLinesPL //---------------------------------------------------------------------------- size_t VISU_StreamLinesPL -::IsPossible(vtkPointSet* theDataSet, - vtkFloatingPointType thePercents) +::IsPossible(vtkPointSet* theDataSet) { - vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet); + vtkFloatingPointType aPercents = GetUsedPointsDefault(); + vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet, + aPercents); vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet); VISU_MaskPointsFilter *aPointsFilter = VISU_MaskPointsFilter::New(); aPointsFilter->SetInput(theDataSet); @@ -322,7 +329,7 @@ VISU_StreamLinesPL size_t aRes = FindPossibleParams(aDataSet, aStepLength, aBasePropTime, - thePercents); + aPercents); aPointsFilter->Delete(); return aRes; } @@ -489,12 +496,13 @@ VISU_StreamLinesPL //---------------------------------------------------------------------------- vtkFloatingPointType VISU_StreamLinesPL -::GetMinPropagationTime(vtkDataSet* theDataSet) +::GetMinPropagationTime(vtkDataSet* theDataSet, + vtkFloatingPointType thePercents) { if(!theDataSet) return -1.0; - return GetMinStepLength(theDataSet); + return GetMinStepLength(theDataSet, thePercents); } @@ -503,7 +511,7 @@ vtkFloatingPointType VISU_StreamLinesPL ::GetMinPropagationTime() { - return GetMinPropagationTime(GetExtractorFilter()->GetOutput()); + return GetMinPropagationTime(GetExtractorFilter()->GetOutput(), GetUsedPoints()); } @@ -532,9 +540,10 @@ VISU_StreamLinesPL vtkFloatingPointType VISU_StreamLinesPL ::CorrectPropagationTime(vtkFloatingPointType thePropagationTime, - vtkDataSet* theDataSet) + vtkDataSet* theDataSet, + vtkFloatingPointType thePercents) { - vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet); + vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet, thePercents); if(aMinPropagationTime > thePropagationTime) thePropagationTime = aMinPropagationTime; @@ -573,10 +582,11 @@ VISU_StreamLinesPL //---------------------------------------------------------------------------- vtkFloatingPointType VISU_StreamLinesPL -::GetMinStepLength(vtkDataSet* theDataSet) +::GetMinStepLength(vtkDataSet* theDataSet, + vtkFloatingPointType thePercents) { static vtkFloatingPointType aNbOfStepsOfIntStep = 1.0E+1; - vtkFloatingPointType anIntStep = GetMinIntegrationStep(theDataSet); + vtkFloatingPointType anIntStep = GetMinIntegrationStep(theDataSet, thePercents); vtkFloatingPointType aStepLength = anIntStep * aNbOfStepsOfIntStep / GetVelocityCoeff(theDataSet); return aStepLength; } @@ -587,7 +597,7 @@ vtkFloatingPointType VISU_StreamLinesPL ::GetMinStepLength() { - return GetMinStepLength(GetExtractorFilter()->GetOutput()); + return GetMinStepLength(GetExtractorFilter()->GetOutput(), GetUsedPoints()); } @@ -614,9 +624,10 @@ VISU_StreamLinesPL vtkFloatingPointType VISU_StreamLinesPL ::CorrectStepLength(vtkFloatingPointType theStep, - vtkDataSet* theDataSet) + vtkDataSet* theDataSet, + vtkFloatingPointType thePercents) { - vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet); + vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet, thePercents); if(theStep < aMinStep) theStep = aMinStep; @@ -631,17 +642,28 @@ VISU_StreamLinesPL //---------------------------------------------------------------------------- vtkFloatingPointType VISU_StreamLinesPL -::GetBaseStepLength(vtkDataSet* theDataSet) +::GetBaseStepLength(vtkDataSet* theDataSet, + vtkFloatingPointType thePercents) { static vtkFloatingPointType anAvgNbOfSteps = 1.0E+2; vtkFloatingPointType aPropagationTime = GetBasePropagationTime(theDataSet); vtkFloatingPointType aStepLength = aPropagationTime/anAvgNbOfSteps; - aStepLength = CorrectStepLength(aStepLength,theDataSet); + aStepLength = CorrectStepLength(aStepLength,theDataSet,thePercents); return aStepLength; } +//---------------------------------------------------------------------------- +vtkFloatingPointType +VISU_StreamLinesPL +::GetUsedPointsDefault() +{ + SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); + return aResourceMgr->doubleValue("VISU", "stream_lines_used_points", 0.01); +} + + //---------------------------------------------------------------------------- void VISU_StreamLinesPL @@ -650,12 +672,14 @@ VISU_StreamLinesPL Superclass::Init(); vtkDataSet* aDataSet = GetExtractorFilter()->GetOutput(); - vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet); + vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet, GetUsedPoints()); vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet); - vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet); + vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet, GetUsedPoints()); SetParams(anIntStep, aPropagationTime, - aStepLength); + aStepLength, + NULL, + GetUsedPoints()); } diff --git a/src/PIPELINE/VISU_StreamLinesPL.hxx b/src/PIPELINE/VISU_StreamLinesPL.hxx index 009424b0..b1f71ff6 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.hxx +++ b/src/PIPELINE/VISU_StreamLinesPL.hxx @@ -61,8 +61,8 @@ public: SetParams(vtkFloatingPointType theIntStep, vtkFloatingPointType thePropogationTime, vtkFloatingPointType theStepLength, - vtkPointSet* theSource = NULL, - vtkFloatingPointType thePercents = 0.3, + vtkPointSet* theSource, + vtkFloatingPointType thePercents, int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS); virtual @@ -159,15 +159,16 @@ public: static vtkFloatingPointType GetMinIntegrationStep(vtkDataSet* theDataSet, - vtkFloatingPointType thePercents = 0.3); + vtkFloatingPointType thePercents); static vtkFloatingPointType GetBaseIntegrationStep(vtkDataSet* theDataSet, - vtkFloatingPointType thePercents = 0.3); + vtkFloatingPointType thePercents); static vtkFloatingPointType - GetMinPropagationTime(vtkDataSet* theDataSet); + GetMinPropagationTime(vtkDataSet* theDataSet, + vtkFloatingPointType thePercents); static vtkFloatingPointType @@ -179,7 +180,8 @@ public: static vtkFloatingPointType - GetMinStepLength(vtkDataSet* theDataSet); + GetMinStepLength(vtkDataSet* theDataSet, + vtkFloatingPointType thePercents); static vtkFloatingPointType @@ -187,7 +189,8 @@ public: static vtkFloatingPointType - GetBaseStepLength(vtkDataSet* theDataSet); + GetBaseStepLength(vtkDataSet* theDataSet, + vtkFloatingPointType thePercents); static vtkFloatingPointType @@ -195,8 +198,7 @@ public: static size_t - IsPossible(vtkPointSet* theDataSet, - vtkFloatingPointType thePercents = 0.3); + IsPossible(vtkPointSet* theDataSet); protected: VISU_StreamLinesPL(); @@ -214,7 +216,7 @@ protected: GetNecasseryMemorySize(vtkIdType theNbOfPoints, vtkFloatingPointType theStepLength, vtkFloatingPointType thePropogationTime, - vtkFloatingPointType thePercents = 0.3); + vtkFloatingPointType thePercents); static size_t @@ -227,17 +229,23 @@ protected: vtkFloatingPointType CorrectIntegrationStep(vtkFloatingPointType theStep, vtkDataSet* theDataSet, - vtkFloatingPointType thePercents = 0.3); + vtkFloatingPointType thePercents); static vtkFloatingPointType CorrectPropagationTime(vtkFloatingPointType thePropagationTime, - vtkDataSet* theDataSet); + vtkDataSet* theDataSet, + vtkFloatingPointType thePercents); static vtkFloatingPointType CorrectStepLength(vtkFloatingPointType theStep, - vtkDataSet* theDataSet); + vtkDataSet* theDataSet, + vtkFloatingPointType thePercents); + + static + vtkFloatingPointType + GetUsedPointsDefault(); VISU_StreamLine* myStream; vtkPointSet* mySource; diff --git a/src/VISUGUI/VISU_msg_en.ts b/src/VISUGUI/VISU_msg_en.ts index 7c4cfd7a..f31cf5bc 100644 --- a/src/VISUGUI/VISU_msg_en.ts +++ b/src/VISUGUI/VISU_msg_en.ts @@ -413,6 +413,18 @@ number of time stamps or number of components is not the same! VISU_STREAM_LINES Stream Lines + + VISU_STREAM_LINES_PREF + Stream Lines Preferences + + + VISU_STREAM_LINES_PREF + Stream Lines Preferences + + + VISU_STREAM_LINES_USED_POINTS + Used points + VISU_SWEEPING_MODES Mode of the sweeping @@ -2947,7 +2959,7 @@ Please select another field. MODEMode: LINEARLinear - COSINUSOIDAL1 - cos( t ) / 2 + COSINUSOIDAL( 1 - cos( t ) ) / 2 SINUSOIDALsin( t - Pi / 2 ) NUMBER_OF_STEPSNumber Steps: @@ -3835,6 +3847,96 @@ Please, refer to the QT documentation. Shrink Factor: + + VisuGUI_PrimitiveBox + + ALPHA_TEXTURE + Alpha Channel Texture (16x16) : + + + ALPHA_THRESHOLD + Alpha Channel Threshold : + + + CLAMP + Maximum Size (Clamp) : + + + FACE_LIMIT + Notify when number of faces exceeds : + + + FACE_NUMBER + Number of faces : + + + GEOMETRICAL_SPHERE + Geometrical Sphere + + + MAIN_TEXTURE + Main Texture (16x16) : + + + OPENGL_POINT + OpenGL Point + + + POINT_SPRITE + Point Sprite + + + PRIMITIVE_TITLE + Primitive + + + RESOLUTION + Resolution : + + + + VisuGUI_SizeBox + + COLOR + Color : + + + COLOR_TITLE + Color + + + GEOM_SIZE + Size of points (%) : + + + INCREMENT + +/- Ratio : + + + MAGNIFICATION + Magnification (%) : + + + MAX_SIZE + max size (%) : + + + MIN_SIZE + Range values for min size (%) : + + + OUTSIDE_SIZE + Percentage of normal size(%) : + + + SIZE_TITLE + Size + + + UNIFORM_COLOR + Uniform Color + + VISU_TableDlg diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 8cc895f5..213f1edd 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1454,6 +1454,7 @@ VisuGUI if( VISU::Prs3d_i* aPrs = aPrsList[i] ) { VTKViewer_MarkerDlg* aDlg = new VTKViewer_MarkerDlg( GetDesktop( this ) ); + aDlg->setHelpData( "VISU", "point_marker_page.html" ); aDlg->setCustomMarkerMap( aMarkerMap[ aStudyId ] ); @@ -3747,8 +3748,8 @@ void VisuGUI::createPreferences() // Set property for precision value for spinboxes for ( ii = 0; ii < nbQuantities; ii++ ){ - setPreferenceProperty( precs[ii], "min", ii == 2 ? 0 : -10 ); - setPreferenceProperty( precs[ii], "max", ii == 2 ? 3 : 10 ); + setPreferenceProperty( precs[ii], "min", ii == 2 ? 0 : -14 ); + setPreferenceProperty( precs[ii], "max", ii == 2 ? 3 : 14 ); setPreferenceProperty( precs[ii], "precision", 2 ); } @@ -3998,6 +3999,18 @@ void VisuGUI::createPreferences() addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" ); addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" ); + // TAB: "StreamLines" + int streamLinesTab = addPreference( tr( "VISU_STREAM_LINES" ) ); + + // group: "StreamLines preferences" + int streamLinesGr = addPreference( tr( "VISU_STREAM_LINES_PREF" ), streamLinesTab ); + setPreferenceProperty( cutLineGr, "columns", 1 ); + int usedPoints = addPreference( tr( "VISU_STREAM_LINES_USED_POINTS" ), streamLinesGr, + LightApp_Preferences::DblSpin, "VISU", "stream_lines_used_points" ); + setPreferenceProperty( usedPoints, "min", 0 ); + setPreferenceProperty( usedPoints, "max", 1 ); + setPreferenceProperty( usedPoints, "step", 0.1 ); + // TAB: "Sweep, Animation, 3D Cache" int animationTab = addPreference( tr( "Sweep, Animation" ) ); { diff --git a/src/VISU_I/VISU_DumpPython.cc b/src/VISU_I/VISU_DumpPython.cc index 80bcd374..5ba81d94 100644 --- a/src/VISU_I/VISU_DumpPython.cc +++ b/src/VISU_I/VISU_DumpPython.cc @@ -1713,7 +1713,11 @@ namespace VISU std::string aName = GenerateName(theSObject,theName2EntryMap,theEntry2NameMap); QString aFirstStrAsTitle = - VISU::Storable::FindValue(aMap,"myFirstStrAsTitle",&anIsExist); + VISU::Storable::FindValue(aMap,"myFirstStrAsTitle",&anIsExist).trimmed().toLower(); + if ( aFirstStrAsTitle == "1" || aFirstStrAsTitle == "true" ) + aFirstStrAsTitle = "True"; + else + aFirstStrAsTitle = "False"; theStr<second.second; + return true; } diff --git a/src/VISU_I/VISU_TableDlg.cxx b/src/VISU_I/VISU_TableDlg.cxx index 46a6b993..df08dc62 100644 --- a/src/VISU_I/VISU_TableDlg.cxx +++ b/src/VISU_I/VISU_TableDlg.cxx @@ -591,11 +591,11 @@ void VISU_TableDlg::TableWidget::initialize( _PTR(Study) study, VISU::Table_i* t setEditEnabled( false ); showColumnTitles( false ); - updateTableFromServant(); + updateTableFromServant( true ); updateButtonsState(); } -void VISU_TableDlg::TableWidget::updateTableFromServant() +void VISU_TableDlg::TableWidget::updateTableFromServant( bool adjust ) { _PTR(SObject) aSObject = myStudy->FindObjectID( myTableObj->GetObjectEntry() ); if ( aSObject ) { @@ -652,7 +652,7 @@ void VISU_TableDlg::TableWidget::updateTableFromServant() } setRowData( i-1, strlist ); } - adjustTable(); + if ( adjust ) adjustTable(); } catch( ... ) { MESSAGE("VISU_TableDlg::TableWidget::initialize : Exception has been caught !!!"); @@ -710,7 +710,7 @@ void VISU_TableDlg::TableWidget::updateTableFromServant() } setRowData( i-1, strlist ); } - adjustTable(); + if ( adjust ) adjustTable(); } catch( ... ) { MESSAGE("VISU_TableDlg::TableWidget::initialize : Exception has been caught !!!"); @@ -731,7 +731,7 @@ void VISU_TableDlg::TableWidget::setEditEnabled( bool enable ) if( !enable ) { myTable->horizontalHeader()->setSortIndicatorShown( false ); myTable->verticalHeader()->setSortIndicatorShown( false ); - adjustTable(); + //adjustTable(); } mySortPolicyLabel->setEnabled( enable ); @@ -1146,7 +1146,7 @@ void VISU_TableDlg::TableWidget::columnClicked( int column ) ( VISU::SortPolicy )mySortPolicyCombo->currentIndex() ); myTable->horizontalHeader()->setSortIndicatorShown( true ); myTable->verticalHeader()->setSortIndicatorShown( false ); - updateTableFromServant(); + updateTableFromServant( false ); } } /*! @@ -1161,7 +1161,7 @@ void VISU_TableDlg::TableWidget::rowClicked( int row ) ( VISU::SortPolicy )mySortPolicyCombo->currentIndex() ); myTable->horizontalHeader()->setSortIndicatorShown( false ); myTable->verticalHeader()->setSortIndicatorShown( true ); - updateTableFromServant(); + updateTableFromServant( false ); } */ } diff --git a/src/VISU_I/VISU_TableDlg.h b/src/VISU_I/VISU_TableDlg.h index a911a6ce..c2161c88 100644 --- a/src/VISU_I/VISU_TableDlg.h +++ b/src/VISU_I/VISU_TableDlg.h @@ -141,7 +141,7 @@ public slots: void rowClicked( int ); protected: - void updateTableFromServant(); + void updateTableFromServant( bool adjust ); private: _PTR(Study) myStudy;