12 #include <QtCore/QObject>
13 #include <QtCore/QHash>
14 #include <QtCore/QMap>
15 #include <QtCore/QString>
23 #include <vtkSmartPointer.h>
73 FIELD_ASSOCIATION_CELLS = 0,
74 FIELD_ASSOCIATION_POINTS = 1
95 static bool promptUser(
const QString& settingsKey,
97 const QString& message,
98 QWidget* parent =
nullptr);
130 vtkSelection* selection, FieldAssociation fieldAssociation);
141 static QMap<vtkProp*, vtkDataSet*> extractDataFromSelection(
142 vtkSelection* selection);
152 static vtkDataSet* getPrimaryDataFromSelection(vtkSelection* selection);
166 vtkSelection* selection, FieldAssociation fieldAssociation);
176 static bool pointInPolygon(
const int point[2],
178 vtkIdType numPoints);
188 vtkSelection* selection, vtkIntArray*
polygon, vtkIdType numPoints);
196 return m_lastSelection;
203 void setEnableCaching(
bool enable);
213 int getCacheSize()
const;
214 int getCacheHits()
const;
215 int getCacheMisses()
const;
225 void enterSelectionMode();
230 void exitSelectionMode();
244 void invalidateCachedSelection();
265 void setPointPickingRadius(
unsigned int radius);
296 : valid(false), attributeID(-1), prop(nullptr), polyData(nullptr) {}
310 PixelSelectionInfo getPixelSelectionInfo(
int x,
int y,
bool selectCells);
326 vtkIdType fastPreSelectAt(
int x,
int y,
bool selectCells);
332 bool hasCachedBuffers()
const;
341 bool captureBuffersForFastPreSelection();
390 OPERATION_DEFAULT = 0,
391 OPERATION_ADDITION = 1,
392 OPERATION_SUBTRACTION = 2,
405 CombineOperation operation);
436 void cacheSelection(
const QString& key, vtkSelection* selection);
458 const QString& errorContext);
462 vtkRenderer* m_renderer;
472 bool m_cachingEnabled;
473 QHash<QString, vtkSmartPointer<vtkSelection>> m_selectionCache;
480 static const int MAX_CACHE_SIZE = 50;
483 bool m_inSelectionMode =
false;
487 bool m_invalidating =
false;
494 unsigned int m_pointPickingRadius =
boost::geometry::model::polygon< point_xy > polygon
Hardware selector with ParaView-style buffer caching.
Encapsulates selection data without exposing VTK types.
Selection pipeline abstraction layer.
void errorOccurred(const QString &message)
Emitted when an error occurs.
void selectionCompleted(vtkSelection *selection)
Emitted when selection is completed.
bool isInSelectionMode() const
Check if currently in selection mode.
FieldAssociation
Field association type.
vtkSmartPointer< vtkSelection > getLastSelection() const
Get the last selection result.
SelectionType
Selection type.
@ FRUSTUM_POINTS
Frustum points.
@ FRUSTUM_CELLS
Frustum cells.
@ SURFACE_CELLS
Surface cells (rectangle)
@ SURFACE_POINTS
Surface points (rectangle)
@ POLYGON_CELLS
Polygon cells.
unsigned int getPointPickingRadius() const
Get the current point picking radius.
CombineOperation
Selection combination methods (ParaView-style)
#define QPCL_ENGINE_LIB_API
Fast Pre-Selection API (ParaView-aligned)