MCPcopy Create free account
hub / github.com/Kitware/VTK / test_Line

Function test_Line

Common/DataModel/Testing/Cxx/otherCellPosition.cxx:96–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void test_Line(ostream& strm)
97{
98 double dist2;
99 int subId;
100
101 vtkNew<vtkLine> line;
102 double lineCoords[3], lineWeights[2];
103 double linePoint[3][3] = { { 10.0, 20.0, 30.0 }, { 30.0, 20.0, 10.0 }, { 0, 0, 0 } };
104 double lineClosest[3];
105
106 line->GetPointIds()->SetId(0, 0);
107 line->GetPointIds()->SetId(1, 1);
108 line->GetPoints()->SetPoint(0, 10.0, 20.0, 30.0);
109 line->GetPoints()->SetPoint(1, 30.0, 20.0, 10.0);
110
111 int n = sizeof(linePoint) / (3 * sizeof(double));
112 for (int j = 0; j < n; j++)
113 {
114 line->EvaluatePosition(
115 &linePoint[j][0], &lineClosest[0], subId, &lineCoords[0], dist2, &lineWeights[0]);
116 strm << "vtkLine (" << linePoint[j][0] << ", " << linePoint[j][1] << ", " << linePoint[j][2]
117 << ")" << std::endl;
118 strm << "\tclosest: " << lineClosest[0] << ", " << lineClosest[1] << ", " << lineClosest[2]
119 << std::endl;
120 strm << "\tcoords: " << lineCoords[0] << std::endl;
121 strm << "\tweights: " << lineWeights[0] << std::endl;
122 strm << "\tsubid: " << subId << std::endl;
123 strm << "\tdist2: " << dist2 << std::endl;
124 strm << std::endl;
125 }
126}
127
128void test_PolyLine(ostream& strm)
129{

Callers 1

TestOCPFunction · 0.85

Calls 5

SetIdMethod · 0.45
GetPointIdsMethod · 0.45
SetPointMethod · 0.45
GetPointsMethod · 0.45
EvaluatePositionMethod · 0.45

Tested by

no test coverage detected