// Salome includes
#include "VISU_Convertor.hxx"
#include "VISU_ConvertorUtils.hxx"
+
#include "VISU_MeshPL.hxx"
#include "VISU_ScalarMapPL.hxx"
#include "VISU_IsoSurfacesPL.hxx"
TPresent* aPresent = TPresent::New();
aPresent->SetUnstructuredGridIDMapper( anUnstructuredGridIDMapper );
+ //aPresent->SetOrientation( VISU_CutPlanesPL::ZX, 0.0, 0.0, 0 );
aPresent->Update();
+ aPresent->GetMapper()->InterpolateScalarsBeforeMappingOn();
anActor->SetMapper( aPresent->GetMapper() );
vtkScalarBarActor* aScalarBar = vtkScalarBarActor::New();
myFieldTransform->SetInput(myExtractor->GetOutput());
GetMapperHolder()->SetLookupTable(GetMapperTable());
+ GetMapper()->InterpolateScalarsBeforeMappingOn();
GetMapper()->SetUseLookupTableScalarRange(true);
GetMapper()->SetColorModeToMapScalars();
GetMapper()->ScalarVisibilityOn();
{
SetIsShrinkable(false);
+ SetElnoDisassembleState( true );
+
myAppendPolyData = vtkAppendPolyData::New();
myNbParts = 10;
}
+//----------------------------------------------------------------------------
+void
+VISU_DataSetMapperHolder
+::SetElnoDisassembleState( bool theIsShrunk )
+{
+ vtkFloatingPointType aShrinkFactor = std::abs( myElnoDisassembleFilter->GetShrinkFactor() );
+ if ( theIsShrunk )
+ myElnoDisassembleFilter->SetShrinkFactor( aShrinkFactor );
+ else
+ myElnoDisassembleFilter->SetShrinkFactor( -aShrinkFactor );
+}
+
+
//----------------------------------------------------------------------------
unsigned long int
VISU_DataSetMapperHolder
ShallowCopy(VISU_MapperHolder *theMapperHolder,
bool theIsCopyInput);
+ void
+ SetElnoDisassembleState( bool theIsShrunk );
+
//! Gets memory size used by the instance (bytes).
virtual
unsigned long int
::Update()
{
Superclass::Update();
- //{
- // 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")+"-myWarpVector.vtk";
+ VISU::WriteToFile(myWarpVector->GetUnstructuredGridOutput(), aFileName);
+ }
}
0, // connection
vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association
"ELNO_POINT_COORDS" ); // name
+
+ this->myIsRestorePoints = false;
}
{}
+//----------------------------------------------------------------------------
+void VISU_ElnoAssembleFilter::SetElnoAssembleState( bool theIsRestorePoints )
+{
+ if ( myIsRestorePoints == theIsRestorePoints )
+ return;
+
+ myIsRestorePoints = theIsRestorePoints;
+ this->Modified();
+}
+
//----------------------------------------------------------------------------
namespace
{
vtkDataArray *anElnoPointCoords = this->GetInputArrayToProcess( 0, inputVector );
- if ( !anElnoPointCoords ) {
+ if ( !myIsRestorePoints || !anElnoPointCoords ) {
anOutput->ShallowCopy( anInput );
return 1;
}
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.
vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
"ELNO_COMPONENT_MAPPER" ); // name
- this->myShrinkFactor = -1.0;
+ this->myShrinkFactor = -0.999;
}
{
SetIsShrinkable(false);
+ SetElnoDisassembleState( true );
+
myContourFilter = vtkContourFilter::New();
myCellDataToPointData = vtkCellDataToPointData::New();
{
SetIsShrinkable(true);
+ SetElnoDisassembleState( false );
+
myElnoAssembleFilter->Delete();
myAppendFilter->SetMergingInputs(true);
}
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapPL
+::SetElnoDisassembleState( bool theIsShrunk )
+{
+ GetDataSetMapperHolder()->SetElnoDisassembleState( theIsShrunk );
+ myElnoAssembleFilter->SetElnoAssembleState( theIsShrunk );
+}
+
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
DoShallowCopy(VISU_PipeLine *thePipeLine,
bool theIsCopyInput);
+ void
+ SetElnoDisassembleState( bool theIsShrunk );
+
private:
VISU_ScalarMapPL(const VISU_ScalarMapPL&); // Not implemented.
void operator=(const VISU_ScalarMapPL&); // Not implemented.