#include "VISU_MergeFilter.hxx"
#include "VISU_ElnoDisassembleFilter.hxx"
#include "VISU_PipeLineUtils.hxx"
+#include "SALOME_ExtractGeometry.h"
+#include <vtkPlane.h>
#include <vtkWarpVector.h>
+#include <vtkImplicitBoolean.h>
+#include <vtkImplicitFunction.h>
#include <vtkUnstructuredGrid.h>
#include <vtkCellDataToPointData.h>
#include <vtkPointDataToCellData.h>
+#include <vtkImplicitFunctionCollection.h>
//----------------------------------------------------------------------------
myCellDataToPointData = vtkCellDataToPointData::New();
myScalarsElnoDisassembleFilter = VISU_ElnoDisassembleFilter::New();
+
+ vtkImplicitBoolean* anImplicitBoolean = vtkImplicitBoolean::New();
+ anImplicitBoolean->SetOperationTypeToIntersection();
+
+ myExtractGeometry = SALOME_ExtractGeometry::New();
+ myExtractGeometry->SetImplicitFunction(anImplicitBoolean);
}
//----------------------------------------------------------------------------
{
vtkDataSet* aScalars = GetScalars();
myScalarsElnoDisassembleFilter->SetInput(aScalars);
- myScalarsExtractor->SetInput(myScalarsElnoDisassembleFilter->GetOutput());
+ myExtractGeometry->SetInput(myScalarsElnoDisassembleFilter->GetOutput());
+ myScalarsExtractor->SetInput(myExtractGeometry->GetOutput());
if(VISU::IsDataOnCells(myScalarsElnoDisassembleFilter->GetOutput()))
GetMapper()->SetScalarModeToUseCellData();
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(VISU_DeformedShapeAndScalarMapPL *aPipeLine = dynamic_cast<VISU_DeformedShapeAndScalarMapPL*>(thePipeLine)){
+ SetImplicitFunction(aPipeLine->GetImplicitFunction());
SetScale(aPipeLine->GetScale());
SetScalars(aPipeLine->GetScalars());
}
return myScalars.GetPointer();
}
+//----------------------------------------------------------------------------
+/*!
+ * Removes all clipping planes (for myScalars)
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::RemoveAllClippingPlanes()
+{
+ if(vtkImplicitBoolean* aBoolean = myExtractGeometry->GetImplicitBoolean()){
+ vtkImplicitFunctionCollection* aFunction = aBoolean->GetFunction();
+ aFunction->RemoveAllItems();
+ aBoolean->Modified();
+ }
+ Superclass::RemoveAllClippingPlanes();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Adds a clipping plane (for myScalars)
+ */
+bool
+VISU_DeformedShapeAndScalarMapPL
+::AddClippingPlane(vtkPlane* thePlane)
+{
+ if (thePlane) {
+ if (vtkImplicitBoolean* aBoolean = myExtractGeometry->GetImplicitBoolean()) {
+ vtkImplicitFunctionCollection* aFunction = aBoolean->GetFunction();
+ aFunction->AddItem(thePlane);
+
+ // Check, that at least one cell present after clipping.
+ // This check was introduced because of bug IPAL8849.
+ vtkDataSet* aClippedDataSet = GetClippedInput();
+ if(aClippedDataSet->GetNumberOfCells() < 1)
+ return false;
+ }
+ }
+ return Superclass::AddClippingPlane(thePlane);
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Sets implicit function of clipping
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetImplicitFunction(vtkImplicitFunction *theFunction)
+{
+ myExtractGeometry->SetImplicitFunction(theFunction);
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets implicit function of clipping
+ */
+vtkImplicitFunction *
+VISU_DeformedShapeAndScalarMapPL
+::GetImplicitFunction()
+{
+ return myExtractGeometry->GetImplicitFunction();
+}
+
//----------------------------------------------------------------------------
/*!
* Sets scale for deformed shape
class vtkCellDataToPointData;
class vtkPointDataToCellData;
class VISU_ElnoDisassembleFilter;
+class SALOME_ExtractGeometry;
+class vtkImplicitFunction;
//----------------------------------------------------------------------------
vtkDataSet*
GetScalars();
+ virtual
+ void
+ RemoveAllClippingPlanes();
+
+ virtual
+ bool
+ AddClippingPlane(vtkPlane* thePlane);
+
+ virtual
+ void
+ SetImplicitFunction(vtkImplicitFunction *theFunction);
+
+ virtual
+ vtkImplicitFunction*
+ GetImplicitFunction();
+
public:
//! Redefined method for initialization of the pipeline.
virtual
VISU_FieldTransform* myScalarsFieldTransform;
VISU_Extractor* myScalarsExtractor;
VISU_ElnoDisassembleFilter* myScalarsElnoDisassembleFilter;
+ SALOME_ExtractGeometry* myExtractGeometry;
};
#endif
theRequiredMemory = int( aMemoryUsed + aMemoryNeeded ) + 1;
size_t aMb = 1024 * 1024;
- double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(2048*aMb)) / double(aMb);
+ double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*aMb)) / double(aMb);
anEnlargeType = aMemoryNeeded < aFreeMemory ?
VISU::ColoredPrs3dCache::ENLARGE : VISU::ColoredPrs3dCache::IMPOSSIBLE;
}
return;
size_t aMb = 1024 * 1024;
- double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(2048*aMb)) / double(aMb);
+ double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*aMb)) / double(aMb);
CORBA::Float aMemoryUsed = GetDeviceMemorySize();
CORBA::Float aMemoryNeeded = theMemorySize - aMemoryUsed;
if( aMemoryNeeded > aFreeMemory )