Changeset 2455 for trunk/packages/vizservers/vtkvis/RpVtkDataSet.cpp
- Timestamp:
- Sep 1, 2011, 11:40:10 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/RpVtkDataSet.cpp
r2454 r2455 32 32 _name(name), 33 33 _visible(true), 34 _opacity(1), 34 35 _cellSizeAverage(0) 35 36 { … … 43 44 44 45 /** 46 * \brief Create and initialize a VTK Prop to render the outline 47 */ 48 void DataSet::initProp() 49 { 50 if (_prop == NULL) { 51 _prop = vtkSmartPointer<vtkActor>::New(); 52 vtkProperty *property = _prop->GetProperty(); 53 property->EdgeVisibilityOff(); 54 property->SetOpacity(_opacity); 55 property->SetAmbient(.2); 56 property->LightingOff(); 57 _prop->SetVisibility((_visible ? 1 : 0)); 58 } 59 } 60 61 /** 62 * \brief Create and initialize a wireframe outline 63 */ 64 void DataSet::showOutline(bool state) 65 { 66 if (state) { 67 if (_outlineFilter == NULL) { 68 _outlineFilter = vtkSmartPointer<vtkOutlineFilter>::New(); 69 _outlineFilter->SetInput(_dataSet); 70 } 71 if (_outlineMapper == NULL) { 72 _outlineMapper = vtkSmartPointer<vtkPolyDataMapper>::New(); 73 _outlineMapper->SetInputConnection(_outlineFilter->GetOutputPort()); 74 } 75 initProp(); 76 _prop->SetMapper(_outlineMapper); 77 } else { 78 if (_prop != NULL) { 79 _prop->SetMapper(NULL); 80 } 81 if (_outlineMapper != NULL) { 82 _outlineMapper = NULL; 83 } 84 if (_outlineFilter != NULL) { 85 _outlineFilter = NULL; 86 } 87 } 88 } 89 90 /** 91 * \brief Set opacity of DataSet outline 92 * 93 * This method is used for record-keeping and opacity of the 94 * DataSet bounds outline. The renderer controls opacity 95 * of other related graphics objects. 96 */ 97 void DataSet::setOpacity(double opacity) 98 { 99 _opacity = opacity; 100 if (_prop != NULL) { 101 _prop->GetProperty()->SetOpacity(opacity); 102 } 103 } 104 105 /** 45 106 * \brief Set visibility flag in DataSet 46 107 * 47 * This method is used for record-keeping. The renderer controls 48 * the visibility of related graphics objects. 108 * This method is used for record-keeping and visibility of the 109 * DataSet bounds outline. The renderer controls visibility 110 * of other related graphics objects. 49 111 */ 50 112 void DataSet::setVisibility(bool state) 51 113 { 52 114 _visible = state; 115 if (_prop != NULL) { 116 _prop->SetVisibility((state ? 1 : 0)); 117 } 53 118 } 54 119
Note: See TracChangeset
for help on using the changeset viewer.