------------------------------------------------------------------------------
| 171 | |
| 172 | //------------------------------------------------------------------------------ |
| 173 | void vtkCompassRepresentation::BuildRing() |
| 174 | { |
| 175 | // create the polydata |
| 176 | this->Ring = vtkPolyData::New(); |
| 177 | this->Ring->SetPoints(this->Points); |
| 178 | |
| 179 | // build the cells |
| 180 | vtkCellArray* ringCells = vtkCellArray::New(); |
| 181 | for (int i = 0; i < 4; ++i) |
| 182 | { |
| 183 | ringCells->InsertNextCell(17); |
| 184 | for (int j = 0; j < 8; ++j) |
| 185 | { |
| 186 | ringCells->InsertCellPoint(i * 9 + j); |
| 187 | } |
| 188 | for (int j = 0; j < 8; ++j) |
| 189 | { |
| 190 | ringCells->InsertCellPoint(i * 9 + 35 + 7 - j); |
| 191 | } |
| 192 | ringCells->InsertCellPoint(i * 9); |
| 193 | } |
| 194 | this->Ring->SetLines(ringCells); |
| 195 | ringCells->Delete(); |
| 196 | |
| 197 | // add some polys |
| 198 | vtkCellArray* markCells = vtkCellArray::New(); |
| 199 | for (int i = 1; i < 4; ++i) |
| 200 | { |
| 201 | markCells->InsertNextCell(3); |
| 202 | markCells->InsertCellPoint(i + 69); |
| 203 | markCells->InsertCellPoint(i * 9 + 35); |
| 204 | markCells->InsertCellPoint(i * 9 + 33); |
| 205 | } |
| 206 | this->Ring->SetPolys(markCells); |
| 207 | markCells->Delete(); |
| 208 | |
| 209 | // build the points |
| 210 | for (int i = 0; i < 35; ++i) |
| 211 | { |
| 212 | this->Points->SetPoint(i, this->OuterRadius * cos(vtkMath::RadiansFromDegrees(10. * (i + 10))), |
| 213 | this->OuterRadius * sin(vtkMath::RadiansFromDegrees(10. * (i + 10))), 0.0); |
| 214 | this->Points->SetPoint(i + 35, |
| 215 | this->InnerRadius * cos(vtkMath::RadiansFromDegrees(10. * (i + 10))), |
| 216 | this->InnerRadius * sin(vtkMath::RadiansFromDegrees(10. * (i + 10))), 0.0); |
| 217 | } |
| 218 | // add the WSE points |
| 219 | this->Points->SetPoint(70, -this->OuterRadius - 0.1, 0.0, 0.0); |
| 220 | this->Points->SetPoint(71, 0.0, -this->OuterRadius - 0.1, 0.0); |
| 221 | this->Points->SetPoint(72, this->OuterRadius + 0.1, 0.0, 0.0); |
| 222 | } |
| 223 | |
| 224 | //------------------------------------------------------------------------------ |
| 225 | vtkCompassRepresentation::~vtkCompassRepresentation() |
no test coverage detected