ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvGraphicalSegmentationTool.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 // LOCAL
11 #include <ecvOverlayDialog.h>
12 
13 // CV_DB_LIB
14 #include <ecvHObject.h>
15 
16 // QT
17 #include <QSet>
18 
19 // GUI
20 #include <ui_graphicalSegmentationDlg.h>
21 
22 class ccPolyline;
23 class ccPointCloud;
25 
28  public Ui::GraphicalSegmentationDlg {
29  Q_OBJECT
30 
31 public:
33  explicit ccGraphicalSegmentationTool(QWidget* parent);
36 
38 
42  bool addEntity(ccHObject* anObject, bool silent = false);
43 
46  unsigned getNumberOfValidEntities() const;
47 
50 
52  QSet<ccHObject*>& entities() { return m_toSegment; }
54  const QSet<ccHObject*>& entities() const { return m_toSegment; }
55 
56  // inherited from ccOverlayDialog
57  virtual bool linkWith(QWidget* win) override;
58  virtual bool start() override;
59  virtual void stop(bool accepted) override;
60 
62  bool deleteHiddenParts() const { return m_deleteHiddenParts; }
63 
65 
68  void removeAllEntities();
69 
72  ccHObject::Container& newEntities);
73 
74 protected slots:
75 
76  void segmentIn();
77  void segmentOut();
78  void segment(bool);
79  void reset();
80  void apply();
81  void applyAndDelete();
82  void cancel();
83  void addPointToPolyline(int x, int y);
84  void closePolyLine(int x = 0,
85  int y = 0); // arguments for compatibility with
86  // ccGlWindow::rightButtonClicked signal
87  void updateSegmentation();
88  void closeRectangle();
89  void updatePolyLine(int x, int y, Qt::MouseButtons buttons);
90  void pauseSegmentationMode(bool state, bool only2D = true);
91  inline void pauseSegmentation(bool state) { pauseSegmentationMode(state); }
92  void resetSegmentation();
97 
99  void onShortcutTriggered(int);
100 
102  void prepareEntityForRemoval(ccHObject* entity,
103  bool unallocateVisibilityArrays);
104 
106  void allowPolylineExport(bool state);
107 
108 protected:
109  void setDrawFlag(bool state = true);
110 
112  QSet<ccHObject*> m_toSegment;
113 
116 
119  POLYLINE = 1,
121  //... = 4,
122  //... = 8,
123  //... = 16,
124  PAUSED = 32,
125  STARTED = 64,
126  RUNNING = 128,
127  };
128 
130  unsigned m_state;
131 
136 
139 
142 };
cloudViewer::Polyline::isClosed
bool isClosed() const
Returns whether the polyline is closed or not.
Definition: Polyline.h:26
ccOverlayDialog::addOverridenShortcut
void addOverridenShortcut(Qt::Key key)
Definition: ecvOverlayDialog.cpp:114
ccGraphicalSegmentationTool::updatePolyLine
void updatePolyLine(int x, int y, Qt::MouseButtons buttons)
Definition: ecvGraphicalSegmentationTool.cpp:458
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
ecvDisplayTools::DEFAULT_PICKING
@ DEFAULT_PICKING
Definition: ecvDisplayTools.h:127
ccGraphicalSegmentationTool::reset
void reset()
Definition: ecvGraphicalSegmentationTool.cpp:302
ecvItemSelectionDlg.h
cloudViewer::ReferenceCloud::reserve
virtual bool reserve(unsigned n)
Reserves some memory for hosting the point references.
Definition: ReferenceCloud.cpp:51
ccObject::isKindOf
bool isKindOf(CV_CLASS_ENUM type) const
Definition: ecvObject.h:128
ecvDisplayTools::UPPER_CENTER_MESSAGE
@ UPPER_CENTER_MESSAGE
Definition: ecvDisplayTools.h:177
ccPointCloud::invalidateBoundingBox
void invalidateBoundingBox() override
Invalidates bounding box.
Definition: ecvPointCloud.cpp:1706
MainWindow::dbRootObject
ccHObject * dbRootObject() override
Returns DB root (as a ccHObject)
Definition: MainWindow.cpp:2027
ecvGraphicalSegmentationTool.h
ecvMainAppInterface::removeObjectTemporarilyFromDBTree
virtual ccHObjectContext removeObjectTemporarilyFromDBTree(ccHObject *obj)=0
Removes object temporarily from DB tree.
ccGraphicalSegmentationOptionsDlg
Definition: ecvGraphicalSegmentationOptionsDlg.h:16
x
normal_z x
Definition: my_point_types.h:165
ecvDisplayTools::DisplayNewMessage
static void DisplayNewMessage(const QString &message, MessagePosition pos, bool append=false, int displayMaxDelay_sec=2, MessageType type=CUSTOM_MESSAGE)
Displays a status message in the bottom-left corner.
Definition: ecvDisplayTools.cpp:2276
ccGraphicalSegmentationTool::doSetPolylineSelection
void doSetPolylineSelection()
Definition: ecvGraphicalSegmentationTool.cpp:784
Tuple3Tpl::x
Type x
Definition: CVGeom.h:137
ecvDisplayTools::RemoveWidgets
static void RemoveWidgets(const WIDGETS_PARAMETER &param, bool update=false)
Definition: ecvDisplayTools.cpp:3978
cloudViewer::ReferenceCloud::size
unsigned size() const override
Returns the number of points.
Definition: ReferenceCloud.h:41
cloudViewer::GenericMesh::size
virtual unsigned size() const =0
Returns the number of triangles.
ccGraphicalSegmentationTool::doExportSegmentationPolyline
void doExportSegmentationPolyline()
Definition: ecvGraphicalSegmentationTool.cpp:946
cloudViewer::GenericCloud::size
virtual unsigned size() const =0
Returns the number of points.
ecvDisplayTools::INTERACT_SEND_ALL_SIGNALS
@ INTERACT_SEND_ALL_SIGNALS
Definition: ecvDisplayTools.h:154
ccHObject::getParent
ccHObject * getParent() const
Returns parent object.
Definition: ecvHObject.h:245
ccGraphicalSegmentationTool::closeRectangle
void closeRectangle()
Definition: ecvGraphicalSegmentationTool.cpp:591
ccMesh::size
virtual unsigned size() const override
Returns the number of triangles.
Definition: ecvMesh.cpp:2143
ccHObjectCaster::ToPolyline
static ccPolyline * ToPolyline(ccHObject *obj)
Converts current object to ccPolyline (if possible)
Definition: ecvHObjectCaster.cpp:141
CV_TYPES::GBL_SENSOR
@ GBL_SENSOR
Definition: CVTypes.h:117
ccGraphicalSegmentationTool::applyAndDelete
void applyAndDelete()
Definition: ecvGraphicalSegmentationTool.cpp:1070
ccGraphicalSegmentationTool::segmentIn
void segmentIn()
Definition: ecvGraphicalSegmentationTool.cpp:656
ecvDisplayTools::DrawWidgets
static void DrawWidgets(const WIDGETS_PARAMETER &param, bool update=false)
Definition: ecvDisplayTools.cpp:3910
CV_TYPES::MESH
@ MESH
Definition: CVTypes.h:105
ccHObject::removeChild
void removeChild(ccHObject *child)
Definition: ecvHObject.cpp:1056
ccObject::setName
virtual void setName(const QString &name)
Sets object name.
Definition: ecvObject.h:75
ccObject::isA
bool isA(CV_CLASS_ENUM type) const
Definition: ecvObject.h:131
ccShiftedObject::isShifted
bool isShifted() const
Returns whether the cloud is shifted or not.
Definition: ecvShiftedObject.h:56
CVLog::Print
static bool Print(const char *format,...)
Prints out a formatted message in console.
Definition: CVLog.cpp:113
CV_TYPES::POINT_CLOUD
@ POINT_CLOUD
Definition: CVTypes.h:104
ccPolyline::setForeground
void setForeground(bool state)
Defines if the polyline is drawn in background or foreground.
Definition: ecvPolyline.cpp:146
ccGenericMesh::getAssociatedCloud
virtual ccGenericPointCloud * getAssociatedCloud() const =0
Returns the vertices cloud.
cloudViewer::PointCloudTpl::getPoint
const CCVector3 * getPoint(unsigned index) const override
Definition: PointCloudTpl.h:143
ecvDisplayTools.h
ecvDisplayTools::MANUAL_SEGMENTATION_MESSAGE
@ MANUAL_SEGMENTATION_MESSAGE
Definition: ecvDisplayTools.h:189
ecvMainAppInterface::dbRootObject
virtual ccHObject * dbRootObject()=0
Returns DB root (as a ccHObject)
cc2DViewportObject::getParameters
const ecvViewportParameters & getParameters() const
Gets parameters.
Definition: ecv2DViewportObject.h:32
ccGraphicalSegmentationTool::RECTANGLE
@ RECTANGLE
Definition: ecvGraphicalSegmentationTool.h:120
CVLog.h
cloudViewer::PointCloudTpl::size
unsigned size() const override
Definition: PointCloudTpl.h:38
ccPolyline::IsCloudVerticesOfPolyline
static bool IsCloudVerticesOfPolyline(ccGenericPointCloud *cloud, ccPolyline **polyline=nullptr)
Helper to determine if the input cloud acts as vertices of a polyline.
Definition: ecvPolyline.cpp:900
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
ccGraphicalSegmentationTool::~ccGraphicalSegmentationTool
virtual ~ccGraphicalSegmentationTool()
Destructor.
Definition: ecvGraphicalSegmentationTool.cpp:138
cc2DLabel
2D label (typically attached to points)
Definition: ecv2DLabel.h:22
ecvDisplayTools::SetPickingMode
static void SetPickingMode(PICKING_MODE mode=DEFAULT_PICKING)
Definition: ecvDisplayTools.cpp:2724
ccGraphicalSegmentationTool::onShortcutTriggered
void onShortcutTriggered(int)
To capture overridden shortcuts (pause button, etc.)
Definition: ecvGraphicalSegmentationTool.cpp:146
ecvMainAppInterface.h
ecvDisplayTools::NO_PICKING
@ NO_PICKING
Definition: ecvDisplayTools.h:118
ccGraphicalSegmentationTool::setDrawFlag
void setDrawFlag(bool state=true)
Definition: ecvGraphicalSegmentationTool.cpp:295
cc2DLabel::getPickedPoint
const PickedPoint & getPickedPoint(unsigned index) const
Returns a given point.
Definition: ecv2DLabel.h:194
cloudViewer::ReferenceCloud::getPointGlobalIndex
virtual unsigned getPointGlobalIndex(unsigned localIndex) const
Definition: ReferenceCloud.h:103
cloudViewer::PointCloudTpl::getPointPersistentPtr
const CCVector3 * getPointPersistentPtr(unsigned index) override
Definition: PointCloudTpl.h:160
ccGraphicalSegmentationTool::doActionUseExistingPolyline
void doActionUseExistingPolyline()
Definition: ecvGraphicalSegmentationTool.cpp:836
ccGraphicalSegmentationTool::pauseSegmentationMode
void pauseSegmentationMode(bool state, bool only2D=true)
Definition: ecvGraphicalSegmentationTool.cpp:726
s_polylineExportCount
static unsigned s_polylineExportCount
Definition: ecvGraphicalSegmentationTool.cpp:945
ccHObject::Container
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
ccGraphicalSegmentationTool::applySegmentation
bool applySegmentation(ecvMainAppInterface *app, ccHObject::Container &newEntities)
Apply segmentation and update the database (helper)
Definition: ecvGraphicalSegmentationTool.cpp:1130
MainWindow::TheInstance
static MainWindow * TheInstance()
Returns the unique instance of this object.
Definition: MainWindow.cpp:2037
CCVector3
Vector3Tpl< PointCoordinateType > CCVector3
Default 3D Vector.
Definition: CVGeom.h:798
ccHObjectCaster::ToMesh
static ccMesh * ToMesh(ccHObject *obj)
Converts current object to ccMesh (if possible)
Definition: ecvHObjectCaster.cpp:129
MainWindow::addToDB
void addToDB(const QStringList &filenames, QString fileFilter=QString(), bool displayDialog=true)
Definition: MainWindow.cpp:2152
ccGLCameraParameters
OpenGL camera parameters.
Definition: ecvGenericDisplayTools.h:554
ecvDisplayTools::TRANSFORM_CAMERA
static INTERACTION_FLAGS TRANSFORM_CAMERA()
Definition: ecvDisplayTools.cpp:67
ecvMainAppInterface::ccHObjectContext
Backup "context" for an object.
Definition: ecvMainAppInterface.h:80
result
core::Tensor result
Definition: VtkUtils.cpp:76
ccOverlayDialog::linkWith
virtual bool linkWith(QWidget *win)
Links the overlay dialog with a MDI window.
Definition: ecvOverlayDialog.cpp:32
ManualSegmentationTools.h
CVLog::Error
static bool Error(const char *format,...)
Display an error dialog with formatted message.
Definition: CVLog.cpp:143
Vector2Tpl< PointCoordinateType >
ecvSubMesh.h
ecvGraphicalSegmentationOptionsDlg.h
ecvDisplayTools::GetCurrentScreen
static QWidget * GetCurrentScreen()
Definition: ecvDisplayTools.h:666
ccGraphicalSegmentationTool::prepareEntityForRemoval
void prepareEntityForRemoval(ccHObject *entity, bool unallocateVisibilityArrays)
Prepare entity before removal.
Definition: ecvGraphicalSegmentationTool.cpp:225
ccDrawableObject::showColors
virtual void showColors(bool state)
Sets colors visibility.
Definition: ecvDrawableObject.h:84
cloudViewer::ReferenceCloud::addPointIndex
virtual bool addPointIndex(unsigned globalIndex)
Point global index insertion mechanism.
Definition: ReferenceCloud.cpp:84
cloudViewer::ManualSegmentationTools::isPointInsidePoly
static bool isPointInsidePoly(const CCVector2 &P, const GenericIndexedCloud *polyVertices)
Tests if a point is inside a polygon (2D)
Definition: ManualSegmentationTools.cpp:61
slots
#define slots
Definition: PythonPlugin.cpp:25
ccGraphicalSegmentationTool::getPolyLine
ccPolyline * getPolyLine()
Get a pointer to the polyline that has been segmented.
Definition: ecvGraphicalSegmentationTool.h:49
ecvDisplayTools::GetMainWindow
static QMainWindow * GetMainWindow()
Definition: ecvDisplayTools.h:679
ccMesh::createNewMeshFromSelection
ccMesh * createNewMeshFromSelection(bool removeSelectedTriangles, std::vector< int > *newIndexesOfRemainingTriangles=nullptr, bool withChildEntities=false)
Creates a new mesh with the selected vertices only.
Definition: ecvMesh.cpp:2747
height
int height
Definition: FileIOFactory.cpp:143
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
ecvMainAppInterface
Main application interface (for plugins)
Definition: ecvMainAppInterface.h:24
ccGraphicalSegmentationTool::m_state
unsigned m_state
Current process state.
Definition: ecvGraphicalSegmentationTool.h:130
ccGraphicalSegmentationTool::allowPolylineExport
void allowPolylineExport(bool state)
Whether to allow or not to exort the current segmentation polyline.
Definition: ecvGraphicalSegmentationTool.cpp:129
ccGenericPointCloud::getTheVisibilityArray
virtual VisibilityTableType & getTheVisibilityArray()
Returns associated visibility array.
Definition: ecvGenericPointCloud.h:168
ccGraphicalSegmentationTool::segment
void segment(bool)
Definition: ecvGraphicalSegmentationTool.cpp:660
ccGenericPointCloud
A 3D cloud interface with associated features (color, normals, octree, etc.)
Definition: ecvGenericPointCloud.h:45
ccGraphicalSegmentationTool::removeAllEntities
void removeAllEntities()
Remove entities from the 'to be segmented' pool.
Definition: ecvGraphicalSegmentationTool.cpp:264
ecvDisplayTools::SetViewportParameters
static void SetViewportParameters(const ecvViewportParameters &params)
Definition: ecvDisplayTools.cpp:2598
ccGraphicalSegmentationTool::STARTED
@ STARTED
Definition: ecvGraphicalSegmentationTool.h:125
Vector3Tpl< double >
ccGraphicalSegmentationTool::linkWith
virtual bool linkWith(QWidget *win) override
Links the overlay dialog with a MDI window.
Definition: ecvGraphicalSegmentationTool.cpp:183
ecvDisplayTools::SetRedrawRecursive
static void SetRedrawRecursive(bool redraw=false)
Definition: ecvDisplayTools.cpp:1992
ccGraphicalSegmentationTool::ccGraphicalSegmentationTool
ccGraphicalSegmentationTool(QWidget *parent)
Default constructor.
Definition: ecvGraphicalSegmentationTool.cpp:54
ecv2DLabel.h
ecvGenericPointCloud.h
ecvColor::yellow
constexpr Rgb yellow(MAX, MAX, 0)
ccGraphicalSegmentationTool::entities
QSet< ccHObject * > & entities()
Returns the active 'to be segmented' set.
Definition: ecvGraphicalSegmentationTool.h:52
ccGraphicalSegmentationTool::deleteHiddenParts
bool deleteHiddenParts() const
Returns whether hidden parts should be delete after segmentation.
Definition: ecvGraphicalSegmentationTool.h:62
Ui
Definition: sfEditDlg.h:16
MainWindow
Definition: MainWindow.h:117
ccOverlayDialog::start
virtual bool start()
Starts process.
Definition: ecvOverlayDialog.cpp:80
CV_TYPES::POLY_LINE
@ POLY_LINE
Definition: CVTypes.h:112
ccHObjectCaster::ToShifted
static ccShiftedObject * ToShifted(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccShiftedObject.
Definition: ecvHObjectCaster.cpp:108
ccGraphicalSegmentationTool::PAUSED
@ PAUSED
Definition: ecvGraphicalSegmentationTool.h:124
ecvColor::green
constexpr Rgb green(0, MAX, 0)
ccPointCloud::reserve
bool reserve(unsigned numberOfPoints) override
Reserves memory for all the active features.
Definition: ecvPointCloud.cpp:1452
ccItemSelectionDlg::SelectEntity
static int SelectEntity(const ccHObject::Container &entities, int defaultSelectedIndex=0, QWidget *parent=0, QString label=QString())
Static shortcut: unique selection mode.
Definition: ecvItemSelectionDlg.cpp:74
WIDGET_POLYLINE_2D
@ WIDGET_POLYLINE_2D
Definition: ecvDrawContext.h:89
ccGraphicalSegmentationTool::resetSegmentation
void resetSegmentation()
Definition: ecvGraphicalSegmentationTool.cpp:648
ccGraphicalSegmentationTool::pauseSegmentation
void pauseSegmentation(bool state)
Definition: ecvGraphicalSegmentationTool.h:91
cc2DLabel::size
unsigned size() const
Returns current size.
Definition: ecv2DLabel.h:74
ccGraphicalSegmentationTool::segmentOut
void segmentOut()
Definition: ecvGraphicalSegmentationTool.cpp:658
ccGBLSensor::clearDepthBuffer
void clearDepthBuffer()
Removes the associated depth buffer.
Definition: ecvGBLSensor.cpp:80
ecvDisplayTools::GetViewportParameters
static const ecvViewportParameters & GetViewportParameters()
Definition: ecvDisplayTools.cpp:2636
CV_TYPES::LABEL_2D
@ LABEL_2D
Definition: CVTypes.h:140
ecvMesh.h
ecvMainAppInterface::putObjectBackIntoDBTree
virtual void putObjectBackIntoDBTree(ccHObject *obj, const ccHObjectContext &context)=0
Adds back object to DB tree.
ccGBLSensor
Ground-based Laser sensor.
Definition: ecvGBLSensor.h:26
cc2DViewportObject
2D viewport object
Definition: ecv2DViewportObject.h:15
cc2DLabel::PickedPoint::index
unsigned index
Point/triangle index.
Definition: ecv2DLabel.h:128
ccGenericMesh
Generic mesh interface.
Definition: ecvGenericMesh.h:28
cc2DViewportObject::setParameters
void setParameters(const ecvViewportParameters &params)
Sets perspective view state.
Definition: ecv2DViewportObject.h:27
ecvCameraSensor.h
ccGenericPointCloud::unallocateVisibilityArray
virtual void unallocateVisibilityArray()
Erases the points visibility information.
Definition: ecvGenericPointCloud.cpp:72
ccShiftedObject
Shifted entity interface.
Definition: ecvShiftedObject.h:18
ccGraphicalSegmentationTool::stop
virtual void stop(bool accepted) override
Stops process/dialog.
Definition: ecvGraphicalSegmentationTool.cpp:276
ccGenericPointCloud::createNewCloudFromVisibilitySelection
virtual ccGenericPointCloud * createNewCloudFromVisibilitySelection(bool removeSelectedPoints=false, VisibilityTableType *visTable=nullptr, std::vector< int > *newIndexesOfRemainingPoints=nullptr, bool silent=false, cloudViewer::ReferenceCloud *selection=nullptr)=0
ccDrawableObject::setVisible
virtual void setVisible(bool state)
Sets entity visibility.
Definition: ecvDrawableObject.h:40
POINT_VISIBLE
constexpr unsigned char POINT_VISIBLE
Definition: CVConst.h:92
Tuple3Tpl::z
Type z
Definition: CVGeom.h:137
cloudViewer::Polyline::setClosed
void setClosed(bool state)
Sets whether the polyline is closed or not.
Definition: Polyline.h:29
ecvMainAppInterface::ccHObjectContext::parent
ccHObject * parent
Definition: ecvMainAppInterface.h:81
ccGraphicalSegmentationTool::m_toSegment
QSet< ccHObject * > m_toSegment
Set of entities to be segmented.
Definition: ecvGraphicalSegmentationTool.h:112
ccPolyline::setGlobalShift
virtual void setGlobalShift(const CCVector3d &shift) override
Sets shift applied to original coordinates (information storage only)
Definition: ecvPolyline.cpp:568
cloudViewer::ReferenceCloud::resize
virtual bool resize(unsigned n)
Presets the size of the vector used to store point references.
Definition: ReferenceCloud.cpp:64
ccPointCloud::clear
void clear() override
Clears the entity from all its points and features.
Definition: ecvPointCloud.cpp:530
ccOverlayDialog::shortcutTriggered
void shortcutTriggered(int key)
Signal emitted when an overridden key shortcut is pressed.
ccPointCloud::resize
bool resize(unsigned numberOfPoints) override
Resizes all the active features arrays.
Definition: ecvPointCloud.cpp:1476
cc2DLabel::PickedPoint::entity
ccHObject * entity() const
Returns the associated entity (cloud or mesh)
Definition: ecv2DLabel.cpp:112
cloudViewer::GenericIndexedCloudPersist
A generic 3D point cloud with index-based and presistent access to points.
Definition: GenericIndexedCloudPersist.h:18
ccGraphicalSegmentationTool::m_segmentationPoly
ccPolyline * m_segmentationPoly
Segmentation polyline.
Definition: ecvGraphicalSegmentationTool.h:133
ccGenericMesh::IsCloudVerticesOfMesh
static bool IsCloudVerticesOfMesh(ccGenericPointCloud *cloud, ccGenericMesh **mesh=nullptr)
Helper to determine if the input cloud acts as vertices of a mesh.
Definition: ecvGenericMesh.cpp:800
RemoveUnusedLabelsAndUpdateTheOthers
static void RemoveUnusedLabelsAndUpdateTheOthers(std::set< cc2DLabel * > &watchedLabels, ccHObject *entity, const std::vector< int > &newIndexesOfRemainingPointsOrTriangles, ecvMainAppInterface *app)
Definition: ecvGraphicalSegmentationTool.cpp:1081
ccGraphicalSegmentationTool
Graphical segmentation mechanism (with polyline)
Definition: ecvGraphicalSegmentationTool.h:27
ccGraphicalSegmentationTool::apply
void apply()
Definition: ecvGraphicalSegmentationTool.cpp:1065
cc2DLabel::PickedPoint
Picked point descriptor.
Definition: ecv2DLabel.h:122
ecvMainAppInterface::addToDB
virtual void addToDB(ccHObject *obj, bool updateZoom=false, bool autoExpandDBTree=true, bool checkDimensions=false, bool autoRedraw=true)=0
ecvHObjectCaster.h
ccHObject::getChildrenNumber
unsigned getChildrenNumber() const
Returns the number of children.
Definition: ecvHObject.h:312
ccGraphicalSegmentationTool::start
virtual bool start() override
Starts process.
Definition: ecvGraphicalSegmentationTool.cpp:207
MainWindow.h
ccOverlayDialog::stop
virtual void stop(bool accepted)
Stops process/dialog.
Definition: ecvOverlayDialog.cpp:91
cloudViewer::GenericIndexedCloud::getPoint
virtual const CCVector3 * getPoint(unsigned index) const =0
Returns the ith point.
ccGraphicalSegmentationTool::m_rectangularSelection
bool m_rectangularSelection
Selection mode.
Definition: ecvGraphicalSegmentationTool.h:138
ccGLCameraParameters::project
bool project(const CCVector3d &input3D, CCVector3d &output2D, bool *inFrustum=nullptr) const
Projects a 3D point in 2D (+ normalized 'z' coordinate)
Definition: ecvGenericDisplayTools.h:561
CV_TYPES::SUB_MESH
@ SUB_MESH
Definition: CVTypes.h:106
CV_TYPES::HIERARCHY_OBJECT
@ HIERARCHY_OBJECT
Definition: CVTypes.h:103
CVLog::Warning
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
ecvGBLSensor.h
ccOverlayDialog
Generic overlay dialog interface.
Definition: ecvOverlayDialog.h:17
WIDGETS_PARAMETER::opacity
double opacity
Definition: ecvDrawContext.h:548
ccGraphicalSegmentationTool::entities
const QSet< ccHObject * > & entities() const
Returns the active 'to be segmented' set (const version)
Definition: ecvGraphicalSegmentationTool.h:54
ccHObject::pushDisplayState
bool pushDisplayState() override
Pushes the current display state (overridden)
Definition: ecvHObject.cpp:1748
ecvDisplayTools::TheInstance
static ecvDisplayTools * TheInstance()
Definition: ecvDisplayTools.cpp:237
ccMesh
Triangular mesh.
Definition: ecvMesh.h:35
CV_TYPES::PRIMITIVE
@ PRIMITIVE
Definition: CVTypes.h:119
ccHObject::getChild
ccHObject * getChild(unsigned childPos) const
Returns the ith child.
Definition: ecvHObject.h:325
ccShiftedObject::getGlobalScale
virtual double getGlobalScale() const
Returns the scale applied to original coordinates.
Definition: ecvShiftedObject.h:53
ecvOverlayDialog.h
ccHObject::isAncestorOf
bool isAncestorOf(const ccHObject *anObject) const
Returns true if the current object is an ancestor of the specified one.
Definition: ecvHObject.cpp:699
WIDGETS_PARAMETER
Definition: ecvDrawContext.h:533
ecvDisplayTools::GetClick3DPos
static bool GetClick3DPos(int x, int y, CCVector3d &P3D)
Returns the approximate 3D position of the clicked pixel.
Definition: ecvDisplayTools.cpp:4101
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
ccObject::getName
virtual QString getName() const
Returns object name.
Definition: ecvObject.h:72
ccGraphicalSegmentationTool::POLYLINE
@ POLYLINE
Definition: ecvGraphicalSegmentationTool.h:119
ecvPolyline.h
ccPolyline::setGlobalScale
virtual void setGlobalScale(double scale) override
Definition: ecvPolyline.cpp:578
ccGraphicalSegmentationTool::cancel
void cancel()
Definition: ecvGraphicalSegmentationTool.cpp:1075
ccHObjectCaster::ToGBLSensor
static ccGBLSensor * ToGBLSensor(ccHObject *obj)
Definition: ecvHObjectCaster.cpp:245
ccGraphicalSegmentationTool::updateSegmentation
void updateSegmentation()
Definition: ecvGraphicalSegmentationTool.cpp:638
ccPolyline::set2DMode
void set2DMode(bool state)
Defines if the polyline is considered as 2D or 3D.
Definition: ecvPolyline.cpp:144
cloudViewer::PointCloudTpl::addPoint
void addPoint(const CCVector3 &P)
Adds a 3D point to the database.
Definition: PointCloudTpl.h:246
ecvDisplayTools::SetInteractionMode
static void SetInteractionMode(INTERACTION_FLAGS flags)
Definition: ecvDisplayTools.cpp:2130
PointCoordinateType
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
ccGraphicalSegmentationTool::closePolyLine
void closePolyLine(int x=0, int y=0)
Definition: ecvGraphicalSegmentationTool.cpp:613
Tuple3Tpl::u
Type u[3]
Definition: CVGeom.h:139
ccObject::isLocked
virtual bool isLocked() const
Returns whether the object is locked or not.
Definition: ecvObject.h:112
ccPolyline::createNewPolylinesFromSelection
bool createNewPolylinesFromSelection(std::vector< ccPolyline * > &output)
Creates a polyline mesh with the selected vertices only.
Definition: ecvPolyline.cpp:934
ccGLCameraParameters::viewport
int viewport[4]
Viewport (GL_VIEWPORT)
Definition: ecvGenericDisplayTools.h:597
ccGraphicalSegmentationTool::ProcessStates
ProcessStates
Process states.
Definition: ecvGraphicalSegmentationTool.h:118
ccHObject::popDisplayState
void popDisplayState(bool apply=true) override
Pops the last pushed display state (overridden)
Definition: ecvHObject.cpp:1759
ccHObject::addChild
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
Definition: ecvHObject.cpp:534
ccGraphicalSegmentationTool::m_deleteHiddenParts
bool m_deleteHiddenParts
Whether to delete hidden parts after segmentation.
Definition: ecvGraphicalSegmentationTool.h:141
ccPolyline::is2DMode
bool is2DMode() const
Returns whether the polyline is considered as 2D or 3D.
Definition: ecvPolyline.h:63
cloudViewer::ReferenceCloud::getAssociatedCloud
virtual GenericIndexedCloudPersist * getAssociatedCloud()
Returns the associated (source) cloud.
Definition: ReferenceCloud.h:206
ccObject::setEnabled
virtual void setEnabled(bool state)
Sets the "enabled" property.
Definition: ecvObject.h:102
ecvHObject.h
ccGraphicalSegmentationTool::getNumberOfValidEntities
unsigned getNumberOfValidEntities() const
Definition: ecvGraphicalSegmentationTool.cpp:454
ccHObjectCaster::ToGenericPointCloud
static ccGenericPointCloud * ToGenericPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccGenericPointCloud.
Definition: ecvHObjectCaster.cpp:81
Vector3Tpl< PointCoordinateType >::fromArray
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
Definition: CVGeom.h:268
POINT_HIDDEN
constexpr unsigned char POINT_HIDDEN
Definition: CVConst.h:94
ccGraphicalSegmentationTool::RUNNING
@ RUNNING
Definition: ecvGraphicalSegmentationTool.h:126
ecvPointCloud.h
ccGraphicalSegmentationTool::m_somethingHasChanged
bool m_somethingHasChanged
Whether something has changed or not (for proper 'cancel')
Definition: ecvGraphicalSegmentationTool.h:115
ccGraphicalSegmentationTool::m_polyVertices
ccPointCloud * m_polyVertices
Segmentation polyline vertices.
Definition: ecvGraphicalSegmentationTool.h:135
ecvDisplayTools::GetGLCameraParameters
static void GetGLCameraParameters(ccGLCameraParameters &params)
Returns the current OpenGL camera parameters.
Definition: ecvDisplayTools.cpp:2513
ccGraphicalSegmentationTool::doSetRectangularSelection
void doSetRectangularSelection()
Definition: ecvGraphicalSegmentationTool.cpp:810
ccGenericPointCloud::resetVisibilityArray
virtual bool resetVisibilityArray()
Resets the associated visibility array.
Definition: ecvGenericPointCloud.cpp:47
ccGraphicalSegmentationTool::addEntity
bool addEntity(ccHObject *anObject, bool silent=false)
Adds an entity (and/or its children) to the 'to be segmented' pool.
Definition: ecvGraphicalSegmentationTool.cpp:325
ecvDisplayTools::ToVtkCoordinates
static CCVector3d ToVtkCoordinates(int x, int y, int z=0)
Definition: ecvDisplayTools.cpp:1150
ccGraphicalSegmentationTool::addPointToPolyline
void addPointToPolyline(int x, int y)
Definition: ecvGraphicalSegmentationTool.cpp:511
ccPolyline::setColor
void setColor(const ecvColor::Rgb &col)
Sets the polyline color.
Definition: ecvPolyline.h:81
ccHObjectCaster::ToGenericMesh
static ccGenericMesh * ToGenericMesh(ccHObject *obj)
Converts current object to ccGenericMesh (if possible)
Definition: ecvHObjectCaster.cpp:123
ccPolyline
Colored polyline.
Definition: ecvPolyline.h:23
SquareMatrix.h
ccHObject::getViewId
QString getViewId() const
Definition: ecvHObject.h:225
cloudViewer::Polyline::clear
void clear(bool unusedParam=true) override
Clears the cloud.
Definition: Polyline.cpp:15
ecv2DViewportObject.h
ccGenericPointCloud::VisibilityTableType
std::vector< unsigned char > VisibilityTableType
Array of "visibility" information for each point.
Definition: ecvGenericPointCloud.h:165
CV_TYPES::VIEWPORT_2D_OBJECT
@ VIEWPORT_2D_OBJECT
Definition: CVTypes.h:141