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.
</li>
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
- 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).
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".
\image html viewtable.png
-When the <b>Enable editing</b> 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 <b>Enable editing</b> 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.
<b>Sort policy</b> option allows to specify how the empty cells will be processed
during the sort procedure. The following options are available:
<li><b>Empty cells are considered as highest values</b></li>
<li><b>Empty cells are always first</b></li>
<li><b>Empty cells are always last</b></li>
-<li><b>Empty cells are ignored</b> (means that positions of the empty cells
-will not change after sorting)</li>
+<li><b>Empty cells are ignored</b> (this means that the positions of empty cells
+will not change after the sorting)</li>
</ul>
-<b>Adjust Cells</b> button allows to adjust size of the table cells according
+<b>Adjust Cells</b> button allows to adjust the size of table cells according
to their contents.
It is also possible to create
<parameter name="scalar_bar_active_local" value="0"/>
<parameter name="scalar_bar_bicolor" value="1"/>
<parameter name="scalar_bar_spacing" value="0.01"/>
+ <parameter name="stream_lines_used_points" value="0.01"/>
<parameter name="sweeping_number_cycles" value="1" />
<parameter name="sweeping_number_steps" value="20" />
<parameter name="sweeping_time_step" value="0.2" />
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;
}
#include "VTKViewer_GeometryFilter.h"
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
#include <algorithm>
#include <vtkCell.h>
myCenters = vtkCellCenters::New();
myGeomFilter = VTKViewer_GeometryFilter::New();
myPointsFilter = VISU_MaskPointsFilter::New();
- myPercents = 0.3;
mySource = NULL;
+
+ myPercents = GetUsedPointsDefault();
}
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;
thePercents);
thePropogationTime = CorrectPropagationTime(thePropogationTime,
- aPointSet);
+ aPointSet,
+ thePercents);
theStepLength = CorrectStepLength(theStepLength,
- aPointSet);
+ aPointSet,
+ thePercents);
size_t anIsAccepted = FindPossibleParams(aPointSet,
theStepLength,
//----------------------------------------------------------------------------
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);
size_t aRes = FindPossibleParams(aDataSet,
aStepLength,
aBasePropTime,
- thePercents);
+ aPercents);
aPointsFilter->Delete();
return aRes;
}
//----------------------------------------------------------------------------
vtkFloatingPointType
VISU_StreamLinesPL
-::GetMinPropagationTime(vtkDataSet* theDataSet)
+::GetMinPropagationTime(vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents)
{
if(!theDataSet)
return -1.0;
- return GetMinStepLength(theDataSet);
+ return GetMinStepLength(theDataSet, thePercents);
}
VISU_StreamLinesPL
::GetMinPropagationTime()
{
- return GetMinPropagationTime(GetExtractorFilter()->GetOutput());
+ return GetMinPropagationTime(GetExtractorFilter()->GetOutput(), GetUsedPoints());
}
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;
//----------------------------------------------------------------------------
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;
}
VISU_StreamLinesPL
::GetMinStepLength()
{
- return GetMinStepLength(GetExtractorFilter()->GetOutput());
+ return GetMinStepLength(GetExtractorFilter()->GetOutput(), GetUsedPoints());
}
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;
//----------------------------------------------------------------------------
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
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());
}
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
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
static
vtkFloatingPointType
- GetMinStepLength(vtkDataSet* theDataSet);
+ GetMinStepLength(vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents);
static
vtkFloatingPointType
static
vtkFloatingPointType
- GetBaseStepLength(vtkDataSet* theDataSet);
+ GetBaseStepLength(vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents);
static
vtkFloatingPointType
static
size_t
- IsPossible(vtkPointSet* theDataSet,
- vtkFloatingPointType thePercents = 0.3);
+ IsPossible(vtkPointSet* theDataSet);
protected:
VISU_StreamLinesPL();
GetNecasseryMemorySize(vtkIdType theNbOfPoints,
vtkFloatingPointType theStepLength,
vtkFloatingPointType thePropogationTime,
- vtkFloatingPointType thePercents = 0.3);
+ vtkFloatingPointType thePercents);
static
size_t
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;
<source>VISU_STREAM_LINES</source>
<translation>Stream Lines</translation>
</message>
+ <message>
+ <source>VISU_STREAM_LINES_PREF</source>
+ <translation>Stream Lines Preferences</translation>
+ </message>
+ <message>
+ <source>VISU_STREAM_LINES_PREF</source>
+ <translation>Stream Lines Preferences</translation>
+ </message>
+ <message>
+ <source>VISU_STREAM_LINES_USED_POINTS</source>
+ <translation>Used points</translation>
+ </message>
<message>
<source>VISU_SWEEPING_MODES</source>
<translation>Mode of the sweeping </translation>
<message><source>MODE</source><translation>Mode:</translation></message>
<message><source>LINEAR</source><translation>Linear</translation></message>
- <message><source>COSINUSOIDAL</source><translation>1 - cos( t ) / 2</translation></message>
+ <message><source>COSINUSOIDAL</source><translation>( 1 - cos( t ) ) / 2</translation></message>
<message><source>SINUSOIDAL</source><translation>sin( t - Pi / 2 )</translation></message>
<message><source>NUMBER_OF_STEPS</source><translation>Number Steps:</translation></message>
<translation>Shrink Factor:</translation>
</message>
</context>
+ <context>
+ <name>VisuGUI_PrimitiveBox</name>
+ <message>
+ <source>ALPHA_TEXTURE</source>
+ <translation>Alpha Channel Texture (16x16) : </translation>
+ </message>
+ <message>
+ <source>ALPHA_THRESHOLD</source>
+ <translation>Alpha Channel Threshold : </translation>
+ </message>
+ <message>
+ <source>CLAMP</source>
+ <translation>Maximum Size (Clamp) : </translation>
+ </message>
+ <message>
+ <source>FACE_LIMIT</source>
+ <translation>Notify when number of faces exceeds : </translation>
+ </message>
+ <message>
+ <source>FACE_NUMBER</source>
+ <translation>Number of faces : </translation>
+ </message>
+ <message>
+ <source>GEOMETRICAL_SPHERE</source>
+ <translation>Geometrical Sphere</translation>
+ </message>
+ <message>
+ <source>MAIN_TEXTURE</source>
+ <translation>Main Texture (16x16) : </translation>
+ </message>
+ <message>
+ <source>OPENGL_POINT</source>
+ <translation>OpenGL Point</translation>
+ </message>
+ <message>
+ <source>POINT_SPRITE</source>
+ <translation>Point Sprite</translation>
+ </message>
+ <message>
+ <source>PRIMITIVE_TITLE</source>
+ <translation>Primitive</translation>
+ </message>
+ <message>
+ <source>RESOLUTION</source>
+ <translation>Resolution : </translation>
+ </message>
+ </context>
+ <context>
+ <name>VisuGUI_SizeBox</name>
+ <message>
+ <source>COLOR</source>
+ <translation>Color : </translation>
+ </message>
+ <message>
+ <source>COLOR_TITLE</source>
+ <translation>Color</translation>
+ </message>
+ <message>
+ <source>GEOM_SIZE</source>
+ <translation>Size of points (%) : </translation>
+ </message>
+ <message>
+ <source>INCREMENT</source>
+ <translation>+/- Ratio : </translation>
+ </message>
+ <message>
+ <source>MAGNIFICATION</source>
+ <translation>Magnification (%) : </translation>
+ </message>
+ <message>
+ <source>MAX_SIZE</source>
+ <translation>max size (%) : </translation>
+ </message>
+ <message>
+ <source>MIN_SIZE</source>
+ <translation>Range values for min size (%) : </translation>
+ </message>
+ <message>
+ <source>OUTSIDE_SIZE</source>
+ <translation>Percentage of normal size(%) : </translation>
+ </message>
+ <message>
+ <source>SIZE_TITLE</source>
+ <translation>Size</translation>
+ </message>
+ <message>
+ <source>UNIFORM_COLOR</source>
+ <translation>Uniform Color</translation>
+ </message>
+ </context>
<context>
<name>VISU_TableDlg</name>
<message>
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 ] );
// 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 );
}
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" ) );
{
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<<thePrefix<<aName<<" = aVisu.ImportTables('"
<<aFileName.toLatin1().data()<<"',"
<<aFirstStrAsTitle.toLatin1().data()<<")"<<endl;
return false;
theMarkerTexture = aMarkerIter->second.second;
+ return true;
}
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 ) {
}
setRowData( i-1, strlist );
}
- adjustTable();
+ if ( adjust ) adjustTable();
}
catch( ... ) {
MESSAGE("VISU_TableDlg::TableWidget::initialize : Exception has been caught !!!");
}
setRowData( i-1, strlist );
}
- adjustTable();
+ if ( adjust ) adjustTable();
}
catch( ... ) {
MESSAGE("VISU_TableDlg::TableWidget::initialize : Exception has been caught !!!");
if( !enable ) {
myTable->horizontalHeader()->setSortIndicatorShown( false );
myTable->verticalHeader()->setSortIndicatorShown( false );
- adjustTable();
+ //adjustTable();
}
mySortPolicyLabel->setEnabled( enable );
( VISU::SortPolicy )mySortPolicyCombo->currentIndex() );
myTable->horizontalHeader()->setSortIndicatorShown( true );
myTable->verticalHeader()->setSortIndicatorShown( false );
- updateTableFromServant();
+ updateTableFromServant( false );
}
}
/*!
( VISU::SortPolicy )mySortPolicyCombo->currentIndex() );
myTable->horizontalHeader()->setSortIndicatorShown( false );
myTable->verticalHeader()->setSortIndicatorShown( true );
- updateTableFromServant();
+ updateTableFromServant( false );
}
*/
}
void rowClicked( int );
protected:
- void updateTableFromServant();
+ void updateTableFromServant( bool adjust );
private:
_PTR(Study) myStudy;