Changeset 3683 for trunk/packages/vizservers/vtkvis/Disk.cpp
- Timestamp:
- Jun 12, 2013, 2:51:11 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/Disk.cpp
r3680 r3683 10 10 #include <vtkDiskSource.h> 11 11 #include <vtkPolyDataNormals.h> 12 #include <vtkReverseSense.h> 12 13 13 14 #include "Disk.h" … … 17 18 18 19 Disk::Disk() : 19 Shape(), 20 _flipNormals(false) 20 Shape() 21 21 { 22 22 } … … 42 42 normalFilter->SetInputConnection(_disk->GetOutputPort()); 43 43 normalFilter->AutoOrientNormalsOff(); 44 normalFilter->SetFlipNormals(_flipNormals ? 1 : 0);45 44 46 45 _pdMapper->SetInputConnection(normalFilter->GetOutputPort()); … … 54 53 void Disk::flipNormals(bool state) 55 54 { 56 if (_flipNormals != state) { 57 _flipNormals = state; 58 update(); 55 if (_disk == NULL || _pdMapper == NULL) 56 return; 57 58 if (state) { 59 vtkSmartPointer<vtkReverseSense> filter = vtkSmartPointer<vtkReverseSense>::New(); 60 filter->ReverseCellsOn(); 61 filter->ReverseNormalsOn(); 62 filter->SetInputConnection(_disk->GetOutputPort()); 63 64 _pdMapper->SetInputConnection(filter->GetOutputPort()); 65 } else { 66 _pdMapper->SetInputConnection(_disk->GetOutputPort()); 59 67 } 68 _pdMapper->Update(); 60 69 }
Note: See TracChangeset
for help on using the changeset viewer.