if(MYDEBUG) MESSAGE("~SMESH_DeviceActor - "<<this);
myMapper->Delete();
-
+ myPlaneCollection->Delete();
myProperty->Delete();
myExtractGeometry->Delete();
SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid());
}
-
void
SMESH_DeviceActor
::SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
SMESH_DeviceActor
::SetUnstructuredGrid(vtkUnstructuredGrid* theGrid)
{
- if(theGrid){
- //myIsShrinkable = theGrid->GetNumberOfCells() > 10;
- myIsShrinkable = true;
+ myExtractUnstructuredGrid->SetInputData(theGrid);
- myExtractUnstructuredGrid->SetInputData(theGrid);
+ if ( theGrid )
+ {
+ myIsShrinkable = true;
myMergeFilter->SetGeometryConnection(myExtractUnstructuredGrid->GetOutputPort());
-
+
//Pass diameters of the balls
if(myMapper->GetBallEnabled()) {
myMergeFilter->SetScalarsConnection(myExtractUnstructuredGrid->GetOutputPort());
int anId = 0;
SetImplicitFunctionUsed(myIsImplicitFunctionUsed);
myPassFilter[ anId + 1]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
-
+
anId++; // 1
myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
myGeomFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 4
- myPassFilter[ anId ]->SetInputConnection( myGeomFilter->GetOutputPort() );
+ myPassFilter[ anId ]->SetInputConnection( myGeomFilter->GetOutputPort() );
myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 5
myMapper->SetClippingPlanes( myPlaneCollection );
vtkLODActor::SetMapper( myMapper );
- Modified();
}
+ Modified();
}
void
return myExtractUnstructuredGrid;
}
+#include "SMDS_Mesh.hxx"
vtkUnstructuredGrid*
SMESH_DeviceActor
vtkIdType aNbCells = aGrid->GetNumberOfCells();
aScalars->SetNumberOfComponents(1);
aScalars->SetNumberOfTuples(aNbCells);
- double* range;// = aScalars->GetRange();
+ double* range = 0;// = aScalars->GetRange();
myVisualObj->UpdateFunctor(theFunctor);
-unsigned long int
+unsigned long int
SMESH_DeviceActor
::GetMTime()
{
+ // cout << this->myExtractUnstructuredGrid
+ // << " " << this->Superclass::GetMTime()
+ // << " " << myExtractGeometry->GetMTime()
+ // << " " << myExtractUnstructuredGrid->GetMTime()
+ // << " " << myMergeFilter->GetMTime()
+ // << " " << myGeomFilter->GetMTime()
+ // << " " << myTransformFilter->GetMTime()
+ // << " " << myFaceOrientationFilter->GetMTime() << endl;
+
unsigned long mTime = this->Superclass::GetMTime();
mTime = max(mTime,myExtractGeometry->GetMTime());
mTime = max(mTime,myExtractUnstructuredGrid->GetMTime());
::UpdateFaceOrientation()
{
bool aShowFaceOrientation = myIsFacesOriented;
- aShowFaceOrientation &= GetVisibility();
+ aShowFaceOrientation &= vtkLODActor::GetVisibility(); //GetVisibility(); -- avoid calling GetUnstructuredGrid()
aShowFaceOrientation &= myRepresentation == eSurface;
myFaceOrientation->SetVisibility(aShowFaceOrientation);
}
SMESH_DeviceActor
::SetVisibility(int theMode)
{
- if(!myExtractUnstructuredGrid->GetInput() ||
- GetUnstructuredGrid()->GetNumberOfCells())
+ if(( theMode ) &&
+ ( !myExtractUnstructuredGrid->GetInput() ||
+ GetUnstructuredGrid()->GetNumberOfCells()))
{
vtkLODActor::SetVisibility(theMode);
}else{
SMESH_DeviceActor
::GetVisibility()
{
- if(!GetUnstructuredGrid()->GetNumberOfCells()){
+ int visibi = vtkLODActor::GetVisibility();
+ if(visibi && !GetUnstructuredGrid()->GetNumberOfCells()){
vtkLODActor::SetVisibility(false);
+ visibi = 0;
}
- return vtkLODActor::GetVisibility();
+ return visibi;
}
{
vtkDataSet* aDataSet = myMergeFilter->GetOutput();
vtkIdType anID = myVisualObj->GetNodeVTKId(theObjID);
- double* aCoord = (anID >=0) ? aDataSet->GetPoint(anID) : NULL;
+ double* aCoord = (anID >=0 && anID < aDataSet->GetNumberOfPoints()) ? aDataSet->GetPoint(anID) : NULL;
if(MYDEBUG) MESSAGE("GetNodeCoord - theObjID = "<<theObjID<<"; anID = "<<anID);
return aCoord;
}