ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
ccTool.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
#include <
ecvDisplayTools.h
>
11
#include <
ecvHObject.h
>
12
#include <
ecvMainAppInterface.h
>
13
#include <
ecvPointCloud.h
>
14
15
/*
16
Template class that defining the basic functionality of qCompass "tools".
17
*/
18
class
ccTool
{
19
public
:
20
virtual
~ccTool
() {}
21
22
void
initializeTool
(
ecvMainAppInterface
* app) {
23
m_app
= app;
// store copy of app
24
m_window
=
ecvDisplayTools::GetCurrentScreen
();
25
}
26
27
// called when the tool is set to active (for initialization)
28
virtual
void
toolActivated
() {}
29
30
// called when the tool is set to disactive (for cleanup)
31
virtual
void
toolDisactivated
() {}
32
33
// called when a point in a point cloud gets picked while this tool is
34
// active
35
virtual
void
pointPicked
(
ccHObject
* insertPoint,
36
unsigned
itemIdx,
37
ccHObject
* pickedObject,
38
const
CCVector3
& P) {}
39
40
// called when a point in a point cloud gets picked while this tool is
41
// active
42
virtual
void
pointPicked
(
ccHObject
* insertPoint,
43
unsigned
itemIdx,
44
ccPointCloud
* cloud,
45
const
CCVector3
& P) {}
46
47
// called when the selection is changed while this tool is active
48
virtual
void
onNewSelection
(
const
ccHObject::Container
& selectedEntities) {}
49
50
// called when "Return" or "Space" is pressed, or the "Accept Button" is
51
// clicked
52
virtual
void
accept
() {}
53
54
// called when the "Escape" is pressed, or the "Cancel" button is clicked
55
virtual
void
cancel
() {}
56
57
// if this returns true, the undo button is enabled in the gui
58
virtual
bool
canUndo
() {
return
false
; }
59
60
// called when the undo button is clicked
61
virtual
void
undo
() {}
62
63
protected
:
64
ccTool
() :
m_app
(nullptr),
m_window
(nullptr) {}
65
66
// link to the main plugin interface
67
ecvMainAppInterface
*
m_app
;
68
69
// link to the active openGLWindow
70
QWidget*
m_window
;
71
};
Vector3Tpl< PointCoordinateType >
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition:
ecvHObject.h:25
ccHObject::Container
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition:
ecvHObject.h:337
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition:
ecvPointCloud.h:147
ccTool
Definition:
ccTool.h:18
ccTool::canUndo
virtual bool canUndo()
Definition:
ccTool.h:58
ccTool::onNewSelection
virtual void onNewSelection(const ccHObject::Container &selectedEntities)
Definition:
ccTool.h:48
ccTool::m_app
ecvMainAppInterface * m_app
Definition:
ccTool.h:67
ccTool::toolActivated
virtual void toolActivated()
Definition:
ccTool.h:28
ccTool::undo
virtual void undo()
Definition:
ccTool.h:61
ccTool::m_window
QWidget * m_window
Definition:
ccTool.h:70
ccTool::accept
virtual void accept()
Definition:
ccTool.h:52
ccTool::pointPicked
virtual void pointPicked(ccHObject *insertPoint, unsigned itemIdx, ccHObject *pickedObject, const CCVector3 &P)
Definition:
ccTool.h:35
ccTool::toolDisactivated
virtual void toolDisactivated()
Definition:
ccTool.h:31
ccTool::cancel
virtual void cancel()
Definition:
ccTool.h:55
ccTool::initializeTool
void initializeTool(ecvMainAppInterface *app)
Definition:
ccTool.h:22
ccTool::pointPicked
virtual void pointPicked(ccHObject *insertPoint, unsigned itemIdx, ccPointCloud *cloud, const CCVector3 &P)
Definition:
ccTool.h:42
ccTool::~ccTool
virtual ~ccTool()
Definition:
ccTool.h:20
ccTool::ccTool
ccTool()
Definition:
ccTool.h:64
ecvDisplayTools::GetCurrentScreen
static QWidget * GetCurrentScreen()
Definition:
ecvDisplayTools.h:666
ecvMainAppInterface
Main application interface (for plugins)
Definition:
ecvMainAppInterface.h:24
ecvDisplayTools.h
ecvHObject.h
ecvMainAppInterface.h
ecvPointCloud.h
plugins
core
Standard
qCompass
include
ccTool.h
Generated on Wed Jan 28 2026 09:01:07 for ACloudViewer by
1.9.1