vtkStandardNewMacro(SMESH_DeviceActor);
-SMESH_DeviceActor::SMESH_DeviceActor(){
+SMESH_DeviceActor::SMESH_DeviceActor()
+{
+ if(MYDEBUG) MESSAGE("SMESH_DeviceActor - "<<this);
+
myIsShrunk = false;
myIsShrinkable = false;
myRepresentation = eSurface;
myShrinkFilter = vtkShrinkFilter::New();
+ myStoreClippingMapping = false;
+
myExtractGeometry = SMESH_ExtractGeometry::New();
myExtractGeometry->SetReleaseDataFlag(true);
- myExtractGeometry->SetStoreMapping(true);
myIsImplicitFunctionUsed = false;
myExtractUnstructuredGrid = SALOME_ExtractUnstructuredGrid::New();
- myExtractUnstructuredGrid->SetStoreMapping(true);
-
+
myMergeFilter = vtkMergeFilter::New();
- myStoreMapping = false;
myGeomFilter = SALOME_GeometryFilter::New();
myTransformFilter = SALOME_TransformFilter::New();
SMESH_DeviceActor::~SMESH_DeviceActor(){
- if(MYDEBUG) MESSAGE("~SMESH_DeviceActor");
+ if(MYDEBUG) MESSAGE("~SMESH_DeviceActor - "<<this);
+
myProperty->Delete();
- myMapper->RemoveAllInputs();
myMapper->Delete();
- myShrinkFilter->UnRegisterAllOutputs();
myShrinkFilter->Delete();
- myExtractUnstructuredGrid->UnRegisterAllOutputs();
myExtractUnstructuredGrid->Delete();
- myMergeFilter->UnRegisterAllOutputs();
myMergeFilter->Delete();
- myGeomFilter->UnRegisterAllOutputs();
myGeomFilter->Delete();
- myExtractGeometry->UnRegisterAllOutputs();
myExtractGeometry->Delete();
- myTransformFilter->UnRegisterAllOutputs();
myTransformFilter->Delete();
for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++){
- myPassFilter[i]->UnRegisterAllOutputs();
myPassFilter[i]->Delete();
}
}
-void SMESH_DeviceActor::SetStoreMapping(int theStoreMapping){
- if (myStoreMapping == theStoreMapping)
- return;
- myStoreMapping = theStoreMapping;
- myGeomFilter->SetStoreMapping( myStoreMapping );
- Modified();
+void
+SMESH_DeviceActor::
+SetStoreGemetryMapping(bool theStoreMapping)
+{
+ myGeomFilter->SetStoreMapping(theStoreMapping);
+ SetStoreClippingMapping(theStoreMapping);
+}
+
+
+void
+SMESH_DeviceActor::
+SetStoreClippingMapping(bool theStoreMapping)
+{
+ myStoreClippingMapping = theStoreMapping;
+ myExtractGeometry->SetStoreMapping(theStoreMapping && myIsImplicitFunctionUsed);
+ SetStoreIDMapping(theStoreMapping);
+}
+
+
+void
+SMESH_DeviceActor::
+SetStoreIDMapping(bool theStoreMapping)
+{
+ myExtractUnstructuredGrid->SetStoreMapping(theStoreMapping);
}
SMESH_DeviceActor::
SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
{
- if(myIsImplicitFunctionUsed == theIsImplicitFunctionUsed)
- return;
-
int anId = 0;
if(theIsImplicitFunctionUsed)
myPassFilter[ anId ]->SetInput( myExtractGeometry->GetOutput() );
myPassFilter[ anId ]->SetInput( myMergeFilter->GetOutput() );
myIsImplicitFunctionUsed = theIsImplicitFunctionUsed;
+ SetStoreClippingMapping(myStoreClippingMapping);
}
myExtractGeometry->SetInput(myMergeFilter->GetOutput());
int anId = 0;
- myPassFilter[ anId ]->SetInput( myMergeFilter->GetOutput() );
+ SetImplicitFunctionUsed(myIsImplicitFunctionUsed);
myPassFilter[ anId + 1]->SetInput( myPassFilter[ anId ]->GetOutput() );
anId++; // 1
- myGeomFilter->SetStoreMapping( myStoreMapping );
myGeomFilter->SetInput( myPassFilter[ anId ]->GetOutput() );
anId++; // 2
bool anIsInitialized = theFunctor;
if(anIsInitialized){
vtkUnstructuredGrid* aDataSet = vtkUnstructuredGrid::New();
+
+ SetStoreIDMapping(true);
+ myExtractUnstructuredGrid->Update();
vtkUnstructuredGrid* aGrid = myExtractUnstructuredGrid->GetOutput();
+
aDataSet->ShallowCopy(aGrid);
vtkDoubleArray *aScalars = vtkDoubleArray::New();
}
void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
- SMESH_DeviceActor* theDeviceActor,
vtkScalarBarActor* theScalarBarActor,
vtkLookupTable* theLookupTable)
{
theScalarBarActor->SetVisibility(anIsInitialized);
}
-void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
- SMESH_DeviceActor* theDeviceActor)
+void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor)
{
myExtractUnstructuredGrid->ClearRegisteredCells();
myExtractUnstructuredGrid->ClearRegisteredCellsWithType();
void SMESH_DeviceActor::SetVisibility(int theMode){
- if(!myExtractUnstructuredGrid->GetInput() || GetUnstructuredGrid()->GetNumberOfCells()){
+ if(!myExtractUnstructuredGrid->GetInput() ||
+ GetUnstructuredGrid()->GetNumberOfCells())
+ {
vtkLODActor::SetVisibility(theMode);
}else{
vtkLODActor::SetVisibility(false);
anID = myExtractGeometry->GetNodeObjId(theVtkID);
vtkIdType aRetID = myVisualObj->GetNodeObjId(anID);
- if(MYDEBUG) MESSAGE("GetNodeObjId - theVtkID = "<<theVtkID<<"; aRetID = "<<aRetID);
+ if(MYDEBUG) MESSAGE("GetNodeObjId - theVtkID = "<<theVtkID<<"; anID = "<<anID<<"; aRetID = "<<aRetID);
return aRetID;
}