ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvPointListPickingDlg.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 // GUI
11 #include <ui_pointListPickingDlg.h>
12 
13 // Local
15 
16 // CV_DB_LIB
17 #include <ecvHObject.h>
18 
19 class cc2DLabel;
20 
22 
26  public Ui::PointListPickingDlg {
27  Q_OBJECT
28 
29 public:
31  explicit ccPointListPickingDlg(ccPickingHub* pickingHub, QWidget* parent);
32 
34  void linkWithCloud(ccPointCloud* cloud);
35 
36 protected slots:
37 
39  void applyAndExit();
41  void cancelAndExit();
43  void exportToNewCloud();
45  void exportToNewPolyline();
47  void removeLastEntry();
48 
50  inline void exportToASCII_xyz() {
52  }
54  inline void exportToASCII_ixyz() {
56  }
58  inline void exportToASCII_gxyz() {
60  }
62  inline void exportToASCII_lxyz() {
64  }
65 
67  void markerSizeChanged(int);
69  void startIndexChanged(int);
71  void updateList();
72 
73 protected:
74  // inherited from ccPointPickingGenericInterface
75  virtual void processPickedPoint(ccPointCloud* cloud,
76  unsigned pointIndex,
77  int x,
78  int y) override;
79 
81  unsigned getPickedPoints(std::vector<cc2DLabel*>& pickedPoints);
82 
83  void clearLastLabel(ccHObject* lastVisibleLabel);
84  void removeEntity(ccHObject* lastVisibleLabel);
85 
87 
89  enum ExportFormat {
94  };
95 
98 
101 
112 };
cc2DLabel::addPickedPoint
bool addPickedPoint(ccGenericPointCloud *cloud, unsigned pointIndex, bool entityCenter=false)
Adds a point to this label.
Definition: ecv2DLabel.cpp:400
ecvDisplayTools::SetDisplayParameters
static void SetDisplayParameters(const ecvGui::ParamStruct &params)
Sets current parameters for this display.
Definition: ecvDisplayTools.cpp:2547
ccHObject::filterChildren
unsigned filterChildren(Container &filteredChildren, bool recursive=false, CV_CLASS_ENUM filter=CV_TYPES::OBJECT, bool strict=false) const
Collects the children corresponding to a certain pattern.
Definition: ecvHObject.cpp:611
ccHObject::detachChild
void detachChild(ccHObject *child)
Detaches a specific child.
Definition: ecvHObject.cpp:988
filename
std::string filename
Definition: PointCloudIO.cpp:47
cloudViewer::ReferenceCloud::reserve
virtual bool reserve(unsigned n)
Reserves some memory for hosting the point references.
Definition: ReferenceCloud.cpp:51
ccPointListPickingDlg::exportToASCII
void exportToASCII(ExportFormat format)
Exports list to an ASCII file.
Definition: ecvPointListPickingDlg.cpp:370
cc2DLabel::setDisplayedIn2D
void setDisplayedIn2D(bool state)
Whether to display the label in 2D.
Definition: ecv2DLabel.h:114
x
normal_z x
Definition: my_point_types.h:165
Tuple3Tpl::x
Type x
Definition: CVGeom.h:137
ecvPointListPickingDlg.h
cc2DLabel::displayPointLegend
void displayPointLegend(bool state)
Whether to display the point(s) legend (title only)
Definition: ecv2DLabel.h:108
ecvDisplayTools::GetDisplayParameters
static const ecvGui::ParamStruct & GetDisplayParameters()
Returns current parameters for this display (const version)
Definition: ecvDisplayTools.cpp:2502
ccHObject::getParent
ccHObject * getParent() const
Returns parent object.
Definition: ecvHObject.h:245
cc2DLabel::updateLabel
void updateLabel()
Definition: ecv2DLabel.cpp:312
ccPointListPickingDlg::exportToASCII_gxyz
void exportToASCII_gxyz()
Exports list to an 'gxyz' ASCII file.
Definition: ecvPointListPickingDlg.h:58
format
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:181
CVConst.h
ccPointListPickingDlg::PLP_ASCII_EXPORT_GXYZ
@ PLP_ASCII_EXPORT_GXYZ
Definition: ecvPointListPickingDlg.h:92
ccObject::setName
virtual void setName(const QString &name)
Sets object name.
Definition: ecvObject.h:75
ccPointListPickingDlg::exportToNewPolyline
void exportToNewPolyline()
Exports list to a polyline.
Definition: ecvPointListPickingDlg.cpp:240
ccPointListPickingDlg::linkWithCloud
void linkWithCloud(ccPointCloud *cloud)
Associates dialog with cloud.
Definition: ecvPointListPickingDlg.cpp:134
ccPointListPickingDlg::PLP_ASCII_EXPORT_LXYZ
@ PLP_ASCII_EXPORT_LXYZ
Definition: ecvPointListPickingDlg.h:93
ccShiftedObject::isShifted
bool isShifted() const
Returns whether the cloud is shifted or not.
Definition: ecvShiftedObject.h:56
ccShiftedObject::setGlobalScale
virtual void setGlobalScale(double scale)
Definition: ecvShiftedObject.cpp:33
CVLog::Print
static bool Print(const char *format,...)
Prints out a formatted message in console.
Definition: CVLog.cpp:113
ccPointListPickingDlg::m_orderedLabelsContainer
ccHObject * m_orderedLabelsContainer
Ordered labels container.
Definition: ecvPointListPickingDlg.h:105
cloudViewer::PointCloudTpl::getPoint
const CCVector3 * getPoint(unsigned index) const override
Definition: PointCloudTpl.h:143
ecvDisplayTools.h
ccPointListPickingDlg::removeLastEntry
void removeLastEntry()
Removes last inserted point from list.
Definition: ecvPointListPickingDlg.cpp:291
ecvGui::ParamStruct::labelMarkerSize
unsigned labelMarkerSize
Label marker size.
Definition: ecvGuiParameters.h:84
CVLog.h
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
cc2DLabel
2D label (typically attached to points)
Definition: ecv2DLabel.h:22
ccHObjectCaster::To2DLabel
static cc2DLabel * To2DLabel(ccHObject *obj)
Converts current object to cc2DLabel (if possible)
Definition: ecvHObjectCaster.cpp:262
ccDBRoot::removeElement
void removeElement(ccHObject *object)
Removes an element from the DB tree.
Definition: ecvDBRoot.cpp:554
cc2DLabel::setPosition
void setPosition(float x, float y)
Sets relative position.
Definition: ecv2DLabel.cpp:225
ccHObject::Container
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
MainWindow::TheInstance
static MainWindow * TheInstance()
Returns the unique instance of this object.
Definition: MainWindow.cpp:2037
MainWindow::addToDB
void addToDB(const QStringList &filenames, QString fileFilter=QString(), bool displayDialog=true)
Definition: MainWindow.cpp:2152
CCVector3d
Vector3Tpl< double > CCVector3d
Double 3D Vector.
Definition: CVGeom.h:804
ccPointListPickingDlg::m_associatedCloud
ccPointCloud * m_associatedCloud
Associated cloud.
Definition: ecvPointListPickingDlg.h:100
ccPointListPickingDlg::exportToASCII_ixyz
void exportToASCII_ixyz()
Exports list to an 'ixyz' ASCII file.
Definition: ecvPointListPickingDlg.h:54
CVLog::Error
static bool Error(const char *format,...)
Display an error dialog with formatted message.
Definition: CVLog.cpp:143
ecvDisplayTools::GetCurrentScreen
static QWidget * GetCurrentScreen()
Definition: ecvDisplayTools.h:666
cloudViewer::ReferenceCloud::addPointIndex
virtual bool addPointIndex(unsigned globalIndex)
Point global index insertion mechanism.
Definition: ReferenceCloud.cpp:84
slots
#define slots
Definition: PythonPlugin.cpp:25
size
int size
Definition: FileIOFactory.cpp:130
ccShiftedObject::getGlobalShift
virtual const CCVector3d & getGlobalShift() const
Returns the shift applied to original coordinates.
Definition: ecvShiftedObject.h:46
y
normal_z y
Definition: my_point_types.h:168
ccPointListPickingDlg::exportToASCII_xyz
void exportToASCII_xyz()
Exports list to an 'xyz' ASCII file.
Definition: ecvPointListPickingDlg.h:50
s_defaultLabelBaseName
static const char s_defaultLabelBaseName[]
Definition: ecvPointListPickingDlg.cpp:42
Vector3Tpl< PointCoordinateType >
cc2DLabel::setCollapsed
void setCollapsed(bool state)
Whether to collapse label or not.
Definition: ecv2DLabel.h:102
ecv2DLabel.h
Ui
Definition: sfEditDlg.h:16
ccPointListPickingDlg::ExportFormat
ExportFormat
Export format.
Definition: ecvPointListPickingDlg.h:89
ccPointListPickingDlg::updateList
void updateList()
Updates point list widget.
Definition: ecvPointListPickingDlg.cpp:451
ccPointCloud::reserve
bool reserve(unsigned numberOfPoints) override
Reserves memory for all the active features.
Definition: ecvPointCloud.cpp:1452
ccPointListPickingDlg::exportToASCII_lxyz
void exportToASCII_lxyz()
Exports list to an 'lxyz' ASCII file.
Definition: ecvPointListPickingDlg.h:62
cc2DLabel::size
unsigned size() const
Returns current size.
Definition: ecv2DLabel.h:74
CV_TYPES::LABEL_2D
@ LABEL_2D
Definition: CVTypes.h:140
cc2DLabel::PickedPoint::index
unsigned index
Point/triangle index.
Definition: ecv2DLabel.h:128
s_pickedPointContainerName
static const char s_pickedPointContainerName[]
Definition: ecvPointListPickingDlg.cpp:41
s_pickedPointsStartIndex
static unsigned s_pickedPointsStartIndex
Definition: ecvPointListPickingDlg.cpp:39
ccDrawableObject::setVisible
virtual void setVisible(bool state)
Sets entity visibility.
Definition: ecvDrawableObject.h:40
ecvGui::ParamStruct::displayedNumPrecision
unsigned displayedNumPrecision
Displayed numbers precision.
Definition: ecvGuiParameters.h:100
Tuple3Tpl::z
Type z
Definition: CVGeom.h:137
ccPolyline::setGlobalShift
virtual void setGlobalShift(const CCVector3d &shift) override
Sets shift applied to original coordinates (information storage only)
Definition: ecvPolyline.cpp:568
ccShiftedObject::toGlobal3d
CCVector3d toGlobal3d(const Vector3Tpl< T > &Plocal) const
Returns the point back-projected into the original coordinates system.
Definition: ecvShiftedObject.h:64
ccPointListPickingDlg::clearLastLabel
void clearLastLabel(ccHObject *lastVisibleLabel)
Definition: ecvPointListPickingDlg.cpp:327
ccPointListPickingDlg::ccPointListPickingDlg
ccPointListPickingDlg(ccPickingHub *pickingHub, QWidget *parent)
Default constructor.
Definition: ecvPointListPickingDlg.cpp:44
ccPointListPickingDlg::startIndexChanged
void startIndexChanged(int)
Redraw window when starting index changes.
Definition: ecvPointListPickingDlg.cpp:347
cc2DLabel::PickedPoint
Picked point descriptor.
Definition: ecv2DLabel.h:122
ccPointListPickingDlg
Dialog/interactor to graphically pick a list of points.
Definition: ecvPointListPickingDlg.h:25
ecvDBRoot.h
ccHObject::getChildrenNumber
unsigned getChildrenNumber() const
Returns the number of children.
Definition: ecvHObject.h:312
AsciiFilter::GetFileFilter
static QString GetFileFilter()
Definition: AsciiFilter.h:26
MainWindow.h
cloudViewer::GenericIndexedCloud::getPoint
virtual const CCVector3 * getPoint(unsigned index) const =0
Returns the ith point.
ccPointPickingGenericInterface::stop
void stop(bool state) override
Stops process/dialog.
Definition: ecvPointPickingGenericInterface.cpp:64
ccObject::getUniqueID
virtual unsigned getUniqueID() const
Returns object unique ID.
Definition: ecvObject.h:86
ccPointListPickingDlg::applyAndExit
void applyAndExit()
Applies changes and exit.
Definition: ecvPointListPickingDlg.cpp:274
count
int count
Definition: FileIOFactory.cpp:132
CV_TYPES::HIERARCHY_OBJECT
@ HIERARCHY_OBJECT
Definition: CVTypes.h:103
ccPointListPickingDlg::PLP_ASCII_EXPORT_IXYZ
@ PLP_ASCII_EXPORT_IXYZ
Definition: ecvPointListPickingDlg.h:91
ccPointListPickingDlg::processPickedPoint
virtual void processPickedPoint(ccPointCloud *cloud, unsigned pointIndex, int x, int y) override
Generic method to process picked points.
Definition: ecvPointListPickingDlg.cpp:504
ccDBRoot::removeElements
void removeElements(ccHObject::Container &objects)
Removes several elements at once from the DB tree.
Definition: ecvDBRoot.cpp:513
ccPickingHub
Point/triangle picking hub.
Definition: ecvPickingHub.h:29
ccPointListPickingDlg::getPickedPoints
unsigned getPickedPoints(std::vector< cc2DLabel * > &pickedPoints)
Gets current (visible) picked points from the associated cloud.
Definition: ecvPointListPickingDlg.cpp:103
ccShiftedObject::getGlobalScale
virtual double getGlobalScale() const
Returns the scale applied to original coordinates.
Definition: ecvShiftedObject.h:53
ccDrawableObject::isVisible
virtual bool isVisible() const
Returns whether entity is visible or not.
Definition: ecvDrawableObject.h:38
ccShiftedObject::setGlobalShift
virtual void setGlobalShift(double x, double y, double z)
Sets shift applied to original coordinates (information storage only)
Definition: ecvShiftedObject.h:33
ecvPointPickingGenericInterface.h
s_showGlobalCoordsCheckBoxChecked
static bool s_showGlobalCoordsCheckBoxChecked
Definition: ecvPointListPickingDlg.cpp:40
ccPointListPickingDlg::m_lastPreviousID
unsigned m_lastPreviousID
Last existing label unique ID on load.
Definition: ecvPointListPickingDlg.h:103
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
Tuple3Tpl::y
Type y
Definition: CVGeom.h:137
ecvDisplayTools::RedrawDisplay
static void RedrawDisplay(bool only2D=false, bool forceRedraw=true)
Definition: ecvDisplayTools.cpp:2883
ecvPolyline.h
ccPolyline::setGlobalScale
virtual void setGlobalScale(double scale) override
Definition: ecvPolyline.cpp:578
ccDBRoot
GUI database tree root.
Definition: ecvDBRoot.h:65
Vector3Tpl::norm2
Type norm2() const
Returns vector square norm.
Definition: CVGeom.h:417
MainWindow::db
ccDBRoot * db()
Returns real 'dbRoot' object.
Definition: MainWindow.h:193
cloudViewer::PointCloudTpl::addPoint
void addPoint(const CCVector3 &P)
Adds a 3D point to the database.
Definition: PointCloudTpl.h:246
ccPointListPickingDlg::cancelAndExit
void cancelAndExit()
Cancels process and exit.
Definition: ecvPointListPickingDlg.cpp:166
ccPointListPickingDlg::exportToNewCloud
void exportToNewCloud()
Exports list to a new cloud.
Definition: ecvPointListPickingDlg.cpp:208
ccHObject::removeDependencyWith
void removeDependencyWith(ccHObject *otherObject)
Removes any dependency flags with a given object.
Definition: ecvHObject.cpp:497
Tuple3Tpl::u
Type u[3]
Definition: CVGeom.h:139
cc2DLabel::PickedPoint::cloud
ccGenericPointCloud * cloud
Cloud.
Definition: ecv2DLabel.h:124
ccPointListPickingDlg::m_toBeDeleted
ccHObject::Container m_toBeDeleted
Definition: ecvPointListPickingDlg.h:108
ccHObject::addChild
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
Definition: ecvHObject.cpp:534
ccPointListPickingDlg::m_toBeAdded
ccHObject::Container m_toBeAdded
Definition: ecvPointListPickingDlg.h:111
ccPointListPickingDlg::markerSizeChanged
void markerSizeChanged(int)
Redraw window when marker size changes.
Definition: ecvPointListPickingDlg.cpp:357
ccObject::setEnabled
virtual void setEnabled(bool state)
Sets the "enabled" property.
Definition: ecvObject.h:102
ecvHObject.h
Vector3Tpl< double >::fromArray
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
Definition: CVGeom.h:268
ecvGui::ParamStruct
GUI parameters.
Definition: ecvGuiParameters.h:30
ecvDisplayTools::GetScreenSize
static QSize GetScreenSize()
Definition: ecvDisplayTools.h:886
ecvPointCloud.h
ccPointListPickingDlg::removeEntity
void removeEntity(ccHObject *lastVisibleLabel)
Definition: ecvPointListPickingDlg.cpp:339
ccPointListPickingDlg::PLP_ASCII_EXPORT_XYZ
@ PLP_ASCII_EXPORT_XYZ
Definition: ecvPointListPickingDlg.h:90
AsciiFilter.h
ccPolyline
Colored polyline.
Definition: ecvPolyline.h:23
ccPointPickingGenericInterface
Definition: ecvPointPickingGenericInterface.h:28