Debian Codegraph @

plugins/core/Standard/qMasonry/qManualSeg/qManualSeg.h

raw
1 #pragma once
2
3 //##########################################################################
4 //# #
5 //# CLOUDCOMPARE PLUGIN: qManualSeg #
6 //# #
7 //# This program is free software; you can redistribute it and/or modify #
8 //# it under the terms of the GNU General Public License as published by #
9 //# the Free Software Foundation; version 2 of the License. #
10 //# #
11 //# This program is distributed in the hope that it will be useful, #
12 //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 //# GNU General Public License for more details. #
15 //# #
16 //# Cyberbuild,2020 #
17 //# v1.2 #
18 //# #
19 //##########################################################################
20
21 #include "ccStdPluginInterface.h"
22
23 class ccManualSeg : public QObject, public ccStdPluginInterface
24 {
25 Q_OBJECT
26 Q_INTERFACES( ccPluginInterface ccStdPluginInterface )
27
28 Q_PLUGIN_METADATA(IID "cccorp.cloudcompare.plugin.qManualSeg" FILE "info.json")
29
30 public:
31 explicit ccManualSeg( QObject *parent = nullptr );
32 virtual ~ccManualSeg() = default;
33
34 // inherited from ccStdPluginInterface
35 QList<QAction *> getActions() override;
36
37 private:
38
39 void doAction();
40
41 //! Returns indexes of points inside a polyline from a point cloud
42 std::vector<unsigned> pointIdx(ccPointCloud* cloud, ccPolyline* poly) const;
43 //! Returns stone indexes given points idexes
44 static std::vector<int> StIdFromPtId(const std::vector<unsigned>& pts, const std::vector<std::pair<unsigned, int>>& pairs);
45 //! Returns returns points indexes given stone indexes
46 static std::vector<unsigned> PtIdFromStId(const std::vector<int>& pts, const std::vector<std::pair<unsigned, int>>& pairs);
47
48 QAction* m_action;
49 };