+// Get Actor for Threshold criteria compute
+SMESH_DeviceActor* SMESH_ActorDef::GetActorForThreshold()
+{
+ switch (myControlMode) {
+ case eLength2D:
+ return my1DExtActor;
+ case eWarping3D:
+ return my2DExtActor;
+ default:;
+ return myControlActor;
+ }
+}
+
+// Hides the cells beyond threshold if isThresholdOn == true.
+void SMESH_ActorDef::ClipThreshold(bool isThresholdOn,double min /*= 0.0*/, double max /*= 0.0*/)
+{
+ SMESH_DeviceActor* anActor = GetActorForThreshold();
+ if (anActor != myControlActor)
+ myControlActor->VisibilityOff();
+
+ myIsClipThresholdOn = isThresholdOn;
+ if (isThresholdOn)
+ {
+ // Initialize the filter
+ vtkSmartPointer<vtkThreshold> threshold = vtkSmartPointer<vtkThreshold>::New();
+
+ // We have set scalar data with SMESH_DeviceActor::SetControlMode() call as vtkDataSetAttributes::SCALARS.
+ // So, we don't need to pass an array name in SetInputArrayToProcess().
+ threshold->SetInputConnection(anActor->myMergeFilter->GetOutputPort());
+ threshold->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, vtkDataSetAttributes::SCALARS);
+
+ // Set range
+ threshold->SetThresholdFunction(vtkThreshold::THRESHOLD_BETWEEN);
+ threshold->SetLowerThreshold(min);
+ threshold->SetUpperThreshold(max);
+
+ // Debug output
+ threshold->Update();
+ SCRUTE(threshold->GetOutput()->GetNumberOfCells());
+
+ // Add to the filters' chain
+ vtkAlgorithmOutput* port = threshold->GetOutputPort();
+ anActor->myPassFilter[0]->SetInputConnection(port);
+ }
+ else
+ {
+ // Restore the filters' chain
+ anActor->SetImplicitFunctionUsed(anActor->myIsImplicitFunctionUsed);
+ // Restore Actor filters when after Controls, which not use ExtACtor was called Controls, which use ExtActor
+ // For avoid artifact's
+ if (anActor != myControlActor)
+ myControlActor->SetImplicitFunctionUsed(myControlActor->myIsImplicitFunctionUsed);
+
+ myControlActor->VisibilityOn();
+ }
+}
+
+// Hides the wireframe if isWireframeOff == true.
+void SMESH_ActorDef::SetWireframeOff(bool isWireframeOff)
+{
+ myIsWireframeOff = isWireframeOff;
+
+ UpdateHighlight();
+}
+