@@ -32,8 +32,8 @@ static char THIS_FILE[] = __FILE__;
32
32
mvModelFeatures::mvModelFeatures ()
33
33
{
34
34
m_DisplayMode = MV_DISPLAY_MODEL_FEATURES_AS_CELLS;
35
- m_StructuredGrid = 0 ;
36
- m_UnstructuredGrid = 0 ;
35
+ m_StructuredGrid = nullptr ;
36
+ m_UnstructuredGrid = nullptr ;
37
37
m_ThresholdCells = vtkSmartPointer<vtkThreshold>::New ();
38
38
m_ThresholdCells->SetInputData (m_StructuredGrid);
39
39
#if ((VTK_MAJOR_VERSION == 9) && (VTK_MINOR_VERSION < 1) || (VTK_MAJOR_VERSION < 9))
@@ -269,7 +269,7 @@ void mvModelFeatures::Build()
269
269
m_UnstructuredGrid->SetPoints (m_GridPoints);
270
270
m_NumberOfCells = m_Cells->GetNumberOfCells ();
271
271
}
272
- else
272
+ else if (m_StructuredGrid)
273
273
{
274
274
m_StructuredGrid->SetDimensions (m_Dim[0 ], m_Dim[1 ], m_Dim[2 ]);
275
275
m_StructuredGrid->SetPoints (m_GridPoints);
@@ -291,7 +291,7 @@ void mvModelFeatures::Build()
291
291
{
292
292
m_UnstructuredGrid->GetCellData ()->SetScalars (scalars);
293
293
}
294
- else
294
+ else if (m_StructuredGrid)
295
295
{
296
296
m_StructuredGrid->GetCellData ()->SetScalars (scalars);
297
297
}
@@ -595,15 +595,15 @@ void mvModelFeatures::SetCellArrayForUnstructuredGrid(vtkUnsignedCharArray *cell
595
595
596
596
void mvModelFeatures::SetGridTypeToStructuredGrid ()
597
597
{
598
- m_UnstructuredGrid = 0 ;
598
+ m_UnstructuredGrid = nullptr ;
599
599
m_StructuredGrid = vtkSmartPointer<vtkStructuredGrid>::New ();
600
600
m_ThresholdCells->SetInputData (m_StructuredGrid);
601
601
m_ThresholdCells->Modified ();
602
602
}
603
603
604
604
void mvModelFeatures::SetGridTypeToUnstructuredGrid ()
605
605
{
606
- m_StructuredGrid = 0 ;
606
+ m_StructuredGrid = nullptr ;
607
607
m_UnstructuredGrid = vtkSmartPointer<vtkUnstructuredGrid>::New ();
608
608
m_ThresholdCells->SetInputData (m_UnstructuredGrid);
609
609
m_ThresholdCells->Modified ();
@@ -616,6 +616,7 @@ void mvModelFeatures::Update()
616
616
}
617
617
else
618
618
{
619
+ assert (m_DisplayMode == MV_DISPLAY_MODEL_FEATURES_AS_CELLS);
619
620
if (m_UnstructuredGrid)
620
621
{
621
622
m_UnstructuredGrid->SetCells (m_CellTypes, m_CellLocations, m_Cells);
0 commit comments