| 126 | } |
| 127 | |
| 128 | void test_PolyLine(ostream& strm) |
| 129 | { |
| 130 | double dist2; |
| 131 | int subId; |
| 132 | |
| 133 | vtkNew<vtkPolyLine> polyLine; |
| 134 | double polyLineCoords[3], polyLineWeights[3]; |
| 135 | double polyLinePoint[4][3] = { { 10.0, 20.0, 30.0 }, { 10.0, 30.0, 30.0 }, { 10.0, 30.0, 40.0 }, |
| 136 | { 0, 0, 0 } }; |
| 137 | double polyLineClosest[3]; |
| 138 | |
| 139 | polyLine->GetPointIds()->SetNumberOfIds(3); |
| 140 | polyLine->GetPointIds()->SetId(0, 0); |
| 141 | polyLine->GetPointIds()->SetId(1, 1); |
| 142 | polyLine->GetPointIds()->SetId(2, 2); |
| 143 | |
| 144 | polyLine->GetPoints()->SetNumberOfPoints(3); |
| 145 | polyLine->GetPoints()->SetPoint(0, 10.0, 20.0, 30.0); |
| 146 | polyLine->GetPoints()->SetPoint(1, 10.0, 30.0, 30.0); |
| 147 | polyLine->GetPoints()->SetPoint(2, 10.0, 30.0, 40.0); |
| 148 | |
| 149 | int n = sizeof(polyLinePoint) / (3 * sizeof(double)); |
| 150 | for (int j = 0; j < n; j++) |
| 151 | { |
| 152 | polyLine->EvaluatePosition(&polyLinePoint[j][0], &polyLineClosest[0], subId, &polyLineCoords[0], |
| 153 | dist2, &polyLineWeights[0]); |
| 154 | strm << "vtkPolyLine (" << polyLinePoint[j][0] << ", " << polyLinePoint[j][1] << ", " |
| 155 | << polyLinePoint[j][2] << ")" << std::endl; |
| 156 | strm << "\tclosest: " << polyLineClosest[0] << ", " << polyLineClosest[1] << ", " |
| 157 | << polyLineClosest[2] << std::endl; |
| 158 | strm << "\tcoords: " << polyLineCoords[0] << std::endl; |
| 159 | strm << "\tweights: " << polyLineWeights[0] << std::endl; |
| 160 | strm << "\tsubid: " << subId << std::endl; |
| 161 | strm << "\tdist2: " << dist2 << std::endl; |
| 162 | strm << std::endl; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | void test_Triangle(ostream& strm) |
| 167 | { |
no test coverage detected