Flatland
load_model_dialog.h
1 /*
2  * ______ __ __ __
3  * /\ _ \ __ /\ \/\ \ /\ \__
4  * \ \ \L\ \ __ __ /\_\ \_\ \ \ \____ ___\ \ ,_\ ____
5  * \ \ __ \/\ \/\ \\/\ \ /'_` \ \ '__`\ / __`\ \ \/ /',__\
6  * \ \ \/\ \ \ \_/ |\ \ \/\ \L\ \ \ \L\ \/\ \L\ \ \ \_/\__, `\
7  * \ \_\ \_\ \___/ \ \_\ \___,_\ \_,__/\ \____/\ \__\/\____/
8  * \/_/\/_/\/__/ \/_/\/__,_ /\/___/ \/___/ \/__/\/___/
9  * @copyright Copyright 2017 Avidbots Corp.
10  * @name load_model_dialog.h
11  * @brief Spawn dialog
12  * @author Joseph Duchesne
13  * @author Mike Brousseau
14  *
15  * Software License Agreement (BSD License)
16  *
17  * Copyright (c) 2017, Avidbots Corp.
18  * All rights reserved.
19  *
20  * Redistribution and use in source and binary forms, with or without
21  * modification, are permitted provided that the following conditions
22  * are met:
23  *
24  * * Redistributions of source code must retain the above copyright
25  * notice, this list of conditions and the following disclaimer.
26  * * Redistributions in binary form must reproduce the above
27  * copyright notice, this list of conditions and the following
28  * disclaimer in the documentation and/or other materials provided
29  * with the distribution.
30  * * Neither the name of the Avidbots Corp. nor the names of its
31  * contributors may be used to endorse or promote products derived
32  * from this software without specific prior written permission.
33  *
34  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
37  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
38  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
39  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
40  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
41  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
42  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
43  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
44  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
45  * POSSIBILITY OF SUCH DAMAGE.
46  */
47 
48 #ifndef LOAD_MODEL_DIALOG_H
49 #define LOAD_MODEL_DIALOG_H
50 
51 #include <OGRE/OgreEntity.h>
52 #include <OGRE/OgreSceneManager.h>
53 #include <OGRE/OgreSceneNode.h>
54 #include <OgreVector3.h>
55 
56 #include <ros/console.h>
57 
58 #include <rviz/geometry.h>
59 #include <rviz/mesh_loader.h>
60 #include <rviz/properties/float_property.h>
61 #include <rviz/properties/vector_property.h>
62 #include <rviz/viewport_mouse_event.h>
63 #include <rviz/visualization_manager.h>
64 
65 // #include <QColorDialog>
66 #include <QCursor>
67 #include <QFileDialog>
68 #include <QHBoxLayout>
69 #include <QLabel>
70 #include <QLineEdit>
71 #include <QMessageBox>
72 #include <QPushButton>
73 #include <QVBoxLayout>
74 #include <QWidget>
75 
76 #include <boost/filesystem.hpp>
77 
78 namespace flatland_viz {
79 class SpawnModelTool;
80 }
81 
82 class LoadModelDialog : public QDialog {
83  public:
90  LoadModelDialog(QWidget *parent, flatland_viz::SpawnModelTool *tool);
91 
92  private:
97  QString ChooseFile();
102  void AddNumberAndUpdateName();
103 
104  static QString path_to_model_file; // full path to model file
105  static int count; // counter for adding unique number to filename
106  static bool numbering; // flag to use unique numbering
107 
109  QLineEdit *n_edit; // name lineEdit widget
110  QLabel *p_label; // path label widget
111  QCheckBox *n_checkbox; // checkbox widget
112 
113  public Q_SLOTS:
118  void NumberCheckBoxChanged(bool value);
123  void CancelButtonClicked();
128  void OkButtonClicked();
133  void on_PathButtonClicked();
134 };
135 
136 #endif // LOAD_MODEL_DIALOG_H
Definition: load_model_dialog.h:78
Definition: load_model_dialog.h:82
Definition: spawn_model_tool.h:67