ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
qManualSeg.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 #pragma once
9 
10 // ##########################################################################
11 // # #
12 // # CLOUDVIEWER PLUGIN: qManualSeg #
13 // # #
14 // # This program is free software; you can redistribute it and/or modify #
15 // # it under the terms of the GNU General Public License as published by #
16 // # the Free Software Foundation; version 2 of the License. #
17 // # #
18 // # This program is distributed in the hope that it will be useful, #
19 // # but WITHOUT ANY WARRANTY; without even the implied warranty of #
20 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
21 // # GNU General Public License for more details. #
22 // # #
23 // # Cyberbuild,2020 #
24 // # v1.2 # # #
25 // ##########################################################################
26 
27 #include "ecvStdPluginInterface.h"
28 
29 class ccManualSeg : public QObject, public ccStdPluginInterface {
30  Q_OBJECT
32 
33  Q_PLUGIN_METADATA(IID "ecvcorp.cloudviewer.plugin.qManualSeg" FILE
34  "info.json")
35 
36 public:
37  explicit ccManualSeg(QObject* parent = nullptr);
38  virtual ~ccManualSeg() override = default;
39 
40  // inherited from ccStdPluginInterface
41  void onNewSelection(const ccHObject::Container& selectedEntities) override;
42  QList<QAction*> getActions() override;
43 
44 private:
45  void doAction();
46  void doAction2();
47 
48  std::vector<int> pointIdx(ccPointCloud* cloud, ccPolyline* poly);
49  std::vector<int> stIdFromPtId(std::vector<int> pts,
50  std::vector<std::pair<int, int>> pairs);
51  std::vector<int> ptIdFromStId(std::vector<int> pts,
52  std::vector<std::pair<int, int>> pairs);
53 
54  QAction* m_action;
55 
56 protected:
61 };
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
ccPointCloud * m_polyVertices
Segmentation polyline vertices.
Definition: qManualSeg.h:60
ccPolyline * m_segmentationPoly
Segmentation polyline.
Definition: qManualSeg.h:58
Standard ECV plugin interface.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Colored polyline.
Definition: ecvPolyline.h:24
Standard ECV plugin interface.