MEPP2 Project
ChooseDatastructureMsgBox.hpp
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published
6 // by the Free Software Foundation; either version 3 of the License,
7 // or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 #pragma once
12 
13 
14 #include <string>
15 
16 #include <QMessageBox>
17 #include <QPushButton>
18 
19 
20 namespace FEVV {
21 
27 inline
28 std::string chooseDatastructureMsgBox(void)
29 {
30  QMessageBox msgbox;
31  msgbox.setWindowTitle("Datastructure");
32  msgbox.setText("Choose a datastructure to store the mesh(es):");
33  msgbox.setIcon(QMessageBox::Question);
34 
35  // here the Role is used to order the buttons
36 #ifdef FEVV_USE_CGAL
37  QPushButton *polyhedron_button =
38  msgbox.addButton("Polyhedron_3", QMessageBox::ResetRole);
39  QPushButton *surfacemesh_button =
40  msgbox.addButton("Surface_mesh", QMessageBox::ResetRole);
41  QPushButton *lcc_button =
42  msgbox.addButton("LCC", QMessageBox::ResetRole);
43  QPushButton *cgalpointset_button =
44  msgbox.addButton("CGALPointSet", QMessageBox::ResetRole);
45 #endif
46 
47 #ifdef FEVV_USE_OPENMESH
48  QPushButton *openmesh_button =
49  msgbox.addButton("OpenMesh", QMessageBox::ResetRole);
50 #endif
51 
52 #ifdef FEVV_USE_AIF
53  QPushButton *aif_button = msgbox.addButton("AIF", QMessageBox::ResetRole);
54 #endif
55 
56 #ifdef FEVV_USE_PCL
57  QPushButton *pcl_button =
58  msgbox.addButton("PCLPointCloud", QMessageBox::ResetRole);
59 #endif
60 
61  msgbox.addButton(QMessageBox::Cancel);
62 
63  msgbox.exec();
64  std::string choice("NONE");
65 
66 #ifdef FEVV_USE_CGAL
67  if(msgbox.clickedButton() == polyhedron_button)
68  {
69  choice = "POLYHEDRON";
70  }
71  else if(msgbox.clickedButton() == surfacemesh_button)
72  {
73  choice = "SURFACEMESH";
74  }
75  else if(msgbox.clickedButton() == lcc_button)
76  {
77  choice = "LCC";
78  }
79  else if(msgbox.clickedButton() == cgalpointset_button)
80  {
81  choice = "CGALPOINTSET";
82  }
83 #endif
84 
85 #ifdef FEVV_USE_OPENMESH
86  if(msgbox.clickedButton() == openmesh_button)
87  {
88  choice = "OPENMESH";
89  }
90 #endif
91 
92 #ifdef FEVV_USE_AIF
93  if(msgbox.clickedButton() == aif_button)
94  {
95  choice = "AIF";
96  }
97 #endif
98 
99 #ifdef FEVV_USE_PCL
100  if(msgbox.clickedButton() == pcl_button)
101  {
102  choice = "PCLPOINTCLOUD";
103  }
104 #endif
105 
106  return choice;
107 }
108 
109 } // namespace FEVV
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::chooseDatastructureMsgBox
std::string chooseDatastructureMsgBox(void)
Definition: ChooseDatastructureMsgBox.hpp:28