ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PlyOpenDlg.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 #ifndef CC_PLY_OPEN_DIALOG
9 #define CC_PLY_OPEN_DIALOG
10 
11 // GUIs generated by Qt Designer
12 #include <ui_openPlyFileDlg.h>
13 
14 // Qt
15 #include <QStringList>
16 
17 // system
18 #include <vector>
19 
20 class QComboBox;
21 struct PlyLoadingContext;
22 
24 class PlyOpenDlg : public QDialog, public Ui::PlyOpenDlg {
25  Q_OBJECT
26 
27 public:
28  explicit PlyOpenDlg(QWidget* parent = nullptr);
29 
30  void setDefaultComboItems(const QStringList& stdPropsText);
31  void setListComboItems(const QStringList& listPropsText);
32  void setSingleComboItems(const QStringList& singlePropsText);
33 
35  std::vector<QComboBox*> m_standardCombos;
37  std::vector<QComboBox*> m_listCombos;
39  std::vector<QComboBox*> m_singleCombos;
41  std::vector<QComboBox*> m_sfCombos;
42 
44  bool isValid(bool displayErrors = true) const;
45 
47 
50  bool restorePreviousContext(bool& hasAPreviousContext);
51 
53  static void ResetApplyAll();
54 
56 
59  bool canBeSkipped() const;
60 
61 public:
62  void addSFComboBox(int selectedIndex = 0);
63 
64 protected:
65  void apply();
66  void applyAll();
68 
69 Q_SIGNALS:
70  void fullyAccepted();
71 
72 protected:
74  void saveContext(PlyLoadingContext* context);
76  bool restoreContext(PlyLoadingContext* context,
77  int& unassignedProps,
78  int& mismatchProps);
79 
81  QStringList m_stdPropsText;
83  QStringList m_listPropsText;
85  QStringList m_singlePropsText;
86 };
87 
88 #endif
Dialog for configuration of PLY files opening sequence.
Definition: PlyOpenDlg.h:24
void addAllStdPropsAsSF()
bool isValid(bool displayErrors=true) const
Returns whether the current configuration is valid or not.
void addSFComboBox(int selectedIndex=0)
static void ResetApplyAll()
Resets the "apply all" flag (if set)
QStringList m_stdPropsText
Standard comboboxes elements.
Definition: PlyOpenDlg.h:81
std::vector< QComboBox * > m_listCombos
List-related comboboxes (faces, etc.)
Definition: PlyOpenDlg.h:37
void setListComboItems(const QStringList &listPropsText)
PlyOpenDlg(QWidget *parent=nullptr)
void saveContext(PlyLoadingContext *context)
Saves current configuration (for internal use)
void setSingleComboItems(const QStringList &singlePropsText)
bool canBeSkipped() const
Returns whether the dialog can be 'skipped'.
void apply()
bool restorePreviousContext(bool &hasAPreviousContext)
Restores the previously saved configuration (if any)
void setDefaultComboItems(const QStringList &stdPropsText)
bool restoreContext(PlyLoadingContext *context, int &unassignedProps, int &mismatchProps)
Restore a previously saved configuration (for internal use)
QStringList m_singlePropsText
Single-related comboboxes elements.
Definition: PlyOpenDlg.h:85
void fullyAccepted()
void applyAll()
std::vector< QComboBox * > m_standardCombos
Standard comboboxes.
Definition: PlyOpenDlg.h:35
std::vector< QComboBox * > m_singleCombos
Single-related comboboxes (texture index, etc.)
Definition: PlyOpenDlg.h:39
std::vector< QComboBox * > m_sfCombos
SF comboboxes.
Definition: PlyOpenDlg.h:41
QStringList m_listPropsText
List-related comboboxes elements.
Definition: PlyOpenDlg.h:83
ImGuiContext * context
Definition: Window.cpp:76