~ubuntu-branches/debian/sid/cloudcompare/sid

« back to all changes in this revision

Viewing changes to plugins/qCompass/ccCompassDlg.h

  • Committer: Package Import Robot
  • Author(s): Gürkan Myczko
  • Date: 2018-02-23 08:38:00 UTC
  • Revision ID: package-import@ubuntu.com-20180223083800-m96gby901656yjd1
Tags: upstream-2.9.1+git20180223
Import upstream version 2.9.1+git20180223

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//##########################################################################
 
2
//#                                                                        #
 
3
//#                    CLOUDCOMPARE PLUGIN: ccCompass                      #
 
4
//#                                                                        #
 
5
//#  This program is free software; you can redistribute it and/or modify  #
 
6
//#  it under the terms of the GNU General Public License as published by  #
 
7
//#  the Free Software Foundation; version 2 of the License.               #
 
8
//#                                                                        #
 
9
//#  This program is distributed in the hope that it will be useful,       #
 
10
//#  but WITHOUT ANY WARRANTY; without even the implied warranty of        #
 
11
//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         #
 
12
//#  GNU General Public License for more details.                          #
 
13
//#                                                                        #
 
14
//#                     COPYRIGHT: Sam Thiele  2017                        #
 
15
//#                                                                        #
 
16
//##########################################################################
 
17
 
 
18
#ifndef CC_COMPASS_DIALOG_HEADER
 
19
#define CC_COMPASS_DIALOG_HEADER
 
20
 
 
21
//Qt
 
22
#include <QDialog>
 
23
#include <QList>
 
24
#include <QAction>
 
25
 
 
26
//CC
 
27
#include <ccGLWindow.h>
 
28
#include <ccOverlayDialog.h>
 
29
 
 
30
//Local
 
31
#include <ui_compassDlg.h>
 
32
#include "ccTrace.h"
 
33
 
 
34
class ccCompassDlg : public ccOverlayDialog, public Ui::compassDlg
 
35
{
 
36
        Q_OBJECT
 
37
 
 
38
public:
 
39
        //! Default constructor
 
40
        explicit ccCompassDlg(QWidget* parent = 0);
 
41
 
 
42
        /*
 
43
        Returns a flag describing the currently selected ccTrace::COST_MODE (used to build the cost function for optimisation)
 
44
        */
 
45
        int getCostMode();
 
46
 
 
47
        /*
 
48
        Returns true if the m_plane_fit action is checked -> used to check if the user expects us to fit a plane to finished traces.
 
49
        */
 
50
        bool planeFitMode();
 
51
 
 
52
        //menus
 
53
        QMenu *m_cost_algorithm_menu;
 
54
        QMenu *m_settings_menu;
 
55
        QMenu *m_pairpicking_menu;
 
56
 
 
57
        //settings menu actions
 
58
        QAction *m_plane_fit;
 
59
        QAction *m_showStippled;
 
60
        QAction *m_showNormals;
 
61
        QAction *m_showNames;
 
62
        QAction *m_recalculate;
 
63
 
 
64
        //pair picking menu actions
 
65
        QAction *m_pinchTool;
 
66
        QAction *m_measure_thickness; //activates thickness tool
 
67
        QAction *m_measure_thickness_twoPoint; //activates thickness tool
 
68
        //--
 
69
        QAction *m_youngerThan; //activates topology tool - crosscutting relations
 
70
        QAction *m_follows; //activates topology tool - stratigraphic younging relations
 
71
        QAction *m_equivalent; //activates topology tool - coeval/equivalent relations
 
72
        //--
 
73
        QAction *m_fitPlaneToGeoObject; //fits a plane to the upper/lower surfaces of all points in a GeoObject
 
74
        QAction *m_mergeSelected; //merges the selected geoObjects
 
75
        //--
 
76
        QAction *m_noteTool; //activates note tool
 
77
        QAction *m_toSVG; //export to svg
 
78
 
 
79
protected slots:
 
80
        //! To capture overridden shortcuts (pause button, etc.)
 
81
        void onShortcutTriggered(int);
 
82
 
 
83
        //callbacks to update cost
 
84
        void setDarkCost() { clearCost(); m_dark->setChecked(true); }
 
85
        void setLightCost() { clearCost(); m_light->setChecked(true); }
 
86
        void setRGBCost() { clearCost(); m_rgb->setChecked(true); }
 
87
        void setGradCost() { clearCost(); m_grad->setChecked(true); }
 
88
        void setCurveCost() { clearCost(); m_curve->setChecked(true); }
 
89
        void setDistCost() { clearCost(); m_dist->setChecked(true); }
 
90
        void setScalarCost() { clearCost(); m_scalar->setChecked(true); }
 
91
        void setInvScalarCost() { clearCost(); m_scalar_inv->setChecked(true); }
 
92
private:
 
93
        //algorithm menu
 
94
        QAction *m_dark;
 
95
        QAction *m_light;
 
96
        QAction *m_rgb;
 
97
        QAction *m_grad;
 
98
        QAction *m_curve;
 
99
        QAction *m_dist;
 
100
        QAction *m_scalar;
 
101
        QAction *m_scalar_inv;
 
102
        
 
103
        //disactivates all cost function checkboxes
 
104
        void clearCost()
 
105
        {
 
106
                m_dark->setChecked(false);
 
107
                m_light->setChecked(false);
 
108
                m_rgb->setChecked(false);
 
109
                m_grad->setChecked(false);
 
110
                m_curve->setChecked(false);
 
111
                m_dist->setChecked(false);
 
112
                m_scalar->setChecked(false);
 
113
                m_scalar_inv->setChecked(false);
 
114
        }
 
115
};
 
116
 
 
117
#endif