Skip to content

Commit 3bb3076

Browse files
Tom O'ReillyTom O'Reilly
authored andcommitted
emit TopoDataItem::lineDefined(), including elev profile payload, when profile line specified by user
1 parent da1a03c commit 3bb3076

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

src/qt-guilib/DrawInteractorStyle.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ void DrawInteractorStyle::computeElevationProfile(double *startPoint,
229229

230230
/* ***
231231
editor_->setSurfaceOpacity(0.3);
232-
232+
** */
233+
233234
std::cerr << "Now extract and graph profile data\n";
234235

235236
// Extract elev profile data for display in 2D graph
@@ -281,6 +282,7 @@ void DrawInteractorStyle::computeElevationProfile(double *startPoint,
281282
// x: distance along profile
282283
// y: elevation
283284

285+
/* ***
284286
// Create table for chart
285287
vtkNew<vtkTable> table;
286288
@@ -330,7 +332,21 @@ void DrawInteractorStyle::computeElevationProfile(double *startPoint,
330332
*** */
331333

332334
qDebug() << "render() again";
333-
334335
topoDataItem_->render();
336+
337+
// Transfer profile X-Y data to QList<QVector2D, and include as signal
338+
// payload
339+
QList<QVector2D> qProfile;
340+
QVector2D qPoint;
341+
for (int i = 0; i < profileData.size(); i++) {
342+
std::pair<double, double> point = profileData.at(i);
343+
qPoint.setX((float )point.first);
344+
qPoint.setY((float )point.second);
345+
qProfile.append(qPoint);
346+
}
347+
348+
qDebug() << "emit TopoDataItem::lineDefined()";
349+
// Emit signal with profile X-Y payload
350+
emit topoDataItem_->lineDefined(qProfile);
335351

336352
}

0 commit comments

Comments
 (0)