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 ()
0 commit comments