Skip to content

Commit 6aca8e6

Browse files
Tom O'ReillyTom O'Reilly
authored andcommitted
modified comments
1 parent 2bf4849 commit 6aca8e6

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

src/qt-guilib/PointsSelectInteractorStyle.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define QT_NO_DEBUG_OUTPUT
1+
/// #define QT_NO_DEBUG_OUTPUT
22

33
#include <vtkNamedColors.h>
44
#include <vtkAreaPicker.h>
@@ -81,10 +81,20 @@ void PointsSelectInteractorStyle::OnLeftButtonUp() {
8181
if (drawingMode_ == DrawingMode::Rectangle) {
8282
vtkNew<vtkNamedColors> colors;
8383

84+
/*
85+
Retrieve frustum representinf the space starting from the camera's
86+
lens and extending through the rectangular area drawn by the user
87+
into the 3D scene. The frustum is stored as a vtkPlanes object,
88+
consisting of six planes defining the boundaries of that 3D box.
89+
*/
8490
vtkPlanes* frustum =
8591
static_cast<vtkAreaPicker*>(GetInteractor()->GetPicker())
8692
->GetFrustum();
8793

94+
/*
95+
Initialize vtkExtractPolyDataGeometry, a filter used to "clip"
96+
or "crop" polygonal data, set input to topoDataItem_.
97+
*/
8898
vtkNew<vtkExtractPolyDataGeometry> extractor;
8999
extractor->SetInputData(topoDataItem_->getPolyData());
90100

@@ -93,26 +103,28 @@ void PointsSelectInteractorStyle::OnLeftButtonUp() {
93103
extractor->ExtractInsideOn(); // T.O'R.
94104
// Extract the cells
95105
extractor->Update();
96-
97106
vtkPolyData *extractedData = extractor->GetOutput();
98107

99108
qDebug() << "Extracted "
100109
<< extractedData->GetNumberOfCells()
101110
<< " cells.";
102111

103112
// Set mapper input to extracted cells
104-
// (Color is not controlled by scalar)
105113
selectedMapper_->SetInputData(extractedData);
114+
// Color is not controlled by scalar
106115
selectedMapper_->ScalarVisibilityOff();
107116

117+
selectedActor_->SetMapper(selectedMapper_);
118+
108119
selectedActor_->
109-
GetProperty()->SetColor(colors->GetColor3d("Black").GetData());
120+
GetProperty()->SetColor(colors->GetColor3d("Red").GetData());
110121

111122
selectedActor_->GetProperty()->SetPointSize(1);
112123
// selectedActor_->GetProperty()->SetRepresentationToWireframe();
113124
// selectedActor_->GetProperty()->SetRepresentationToSurface();
114125
selectedActor_->GetProperty()->SetRepresentationToPoints();
115126

127+
//
116128
GetInteractor()
117129
->GetRenderWindow()
118130
->GetRenderers()

src/qt-guilib/PointsSelectInteractorStyle.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ typedef enum {
1616

1717
class TopoDataItem;
1818

19-
// Define interaction style
19+
/// User can select data points in rectangular 'rubber band' area, by
20+
/// left-dragging mouse.
21+
/// Subclass of MyRubberBandStyle for proper QtQuick integration of
22+
/// rubber band rectangle-draw during mouse drag.
2023
class PointsSelectInteractorStyle : public MyRubberBandStyle {
2124
public:
2225
static PointsSelectInteractorStyle* New();

0 commit comments

Comments
 (0)