ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvEntitySelectionDlg.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // ##########################################################################
11 // # #
12 // # ACloudViewer #
13 // # #
14 // # This program is free software; you can redistribute it and/or modify #
15 // # it under the terms of the GNU General Public License as published by #
16 // # the Free Software Foundation; version 2 or later of the License. #
17 // # #
18 // # This program is distributed in the hope that it will be useful, #
19 // # but WITHOUT ANY WARRANTY; without even the implied warranty of #
20 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
21 // # GNU General Public License for more details. #
22 // # #
23 // # COPYRIGHT: ACloudViewer project #
24 // # #
25 // ##########################################################################
26 
27 // qCC_db
28 #include <ecvHObject.h>
29 
30 // Qt
31 #include <QDialog>
32 
33 class Ui_EntitySelectionDialog;
34 
36 class ecvEntitySelectionDialog : public QDialog {
37  Q_OBJECT
38 
39 public:
42  bool multiSelectionEnabled,
43  int defaultSelectedIndex = 0,
44  QWidget* parent = 0,
45  QString label = QString());
46 
48  virtual ~ecvEntitySelectionDialog();
49 
51  int getSelectedIndex() const;
52 
54  void getSelectedIndexes(std::vector<int>& indexes) const;
55 
57  static int SelectEntity(const ccHObject::Container& entities,
58  int defaultSelectedIndex = 0,
59  QWidget* parent = 0,
60  QString label = QString());
61 
63  static bool SelectEntities(const ccHObject::Container& entities,
64  std::vector<int>& indexes,
65  QWidget* parent = 0,
66  QString label = QString());
67 
68 public slots:
69 
71  void selectAll();
73  void selectNone();
74 
75 protected:
77  Ui_EntitySelectionDialog* m_ui;
78 };
#define slots
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
Dialog to select one or multiple entities.
void selectNone()
Selects all entities.
Ui_EntitySelectionDialog * m_ui
Associated ui.
static int SelectEntity(const ccHObject::Container &entities, int defaultSelectedIndex=0, QWidget *parent=0, QString label=QString())
Static shortcut: unique selection mode.
int getSelectedIndex() const
Returns the selected index (unique selection mode)
ecvEntitySelectionDialog(const ccHObject::Container &entities, bool multiSelectionEnabled, int defaultSelectedIndex=0, QWidget *parent=0, QString label=QString())
Default constructor.
virtual ~ecvEntitySelectionDialog()
Destructor.
static bool SelectEntities(const ccHObject::Container &entities, std::vector< int > &indexes, QWidget *parent=0, QString label=QString())
Static shortcut: multi-selection mode.
void selectAll()
Selects all entities.
void getSelectedIndexes(std::vector< int > &indexes) const
Returns the selected indexes (multi-selection mode)