ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvPlaneEditDlg.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 <ui_planeEditDlg.h>
12 
13 #include "ecvPickingListener.h"
14 
15 // cloudViewer
16 #include <CVGeom.h>
17 
18 // Qt
19 #include <QDialog>
20 
21 class ccPlane;
22 class ccHObject;
23 class ccPickingHub;
24 
26 class ccPlaneEditDlg : public QDialog,
27  public ccPickingListener,
28  public Ui::PlaneEditDlg {
29  Q_OBJECT
30 
31 public:
33  explicit ccPlaneEditDlg(ccPickingHub* pickingHub, QWidget* parent);
34 
36  virtual ~ccPlaneEditDlg();
37 
39  void initWithPlane(ccPlane* plane);
40 
42  void updatePlane(ccPlane* plane);
43 
45  virtual void onItemPicked(const PickedItem& pi);
46 
47 public slots:
48 
49  void pickPointAsCenter(bool);
50  void onDipDirChanged(double);
51  void onDipDirModified(bool);
52  void onNormalChanged(double);
53 
54 protected slots:
55 
56  void saveParamsAndAccept();
57 
58 protected: // members
61 
64 };
ecvPlaneEditDlg.h
s_width
static double s_width
Definition: ecvPlaneEditDlg.cpp:26
Vector3Tpl::normalize
void normalize()
Sets vector norm to unity.
Definition: CVGeom.h:428
Tuple3Tpl::x
Type x
Definition: CVGeom.h:137
ccPlaneEditDlg::pickPointAsCenter
void pickPointAsCenter(bool)
Definition: ecvPlaneEditDlg.cpp:178
ccPickingHub::addListener
bool addListener(ccPickingListener *listener, bool exclusive=false, bool autoStartPicking=true, ecvDisplayTools::PICKING_MODE mode=ecvDisplayTools::POINT_OR_TRIANGLE_PICKING)
Adds a listener.
Definition: ecvPickingHub.cpp:104
ccPlaneEditDlg::m_pickingHub
ccPickingHub * m_pickingHub
Picking hub.
Definition: ecvPlaneEditDlg.h:63
CVLog::Print
static bool Print(const char *format,...)
Prints out a formatted message in console.
Definition: CVLog.cpp:113
ccGLMatrixTpl::setTranslation
void setTranslation(const Vector3Tpl< float > &Tr)
Sets translation (float version)
Definition: ecvGLMatrixTpl.h:836
ccPlaneEditDlg::onItemPicked
virtual void onItemPicked(const PickedItem &pi)
Inherited from ccPickingListener.
Definition: ecvPlaneEditDlg.cpp:198
ccPlane::getCenter
CCVector3 getCenter() const
Returns the center.
Definition: ecvPlane.h:56
ccNormalVectors::ConvertNormalToDipAndDipDir
static void ConvertNormalToDipAndDipDir(const CCVector3 &N, PointCoordinateType &dip_deg, PointCoordinateType &dipDir_deg)
Converts a normal vector to geological 'dip direction & dip' parameters.
Definition: ecvNormalVectors.cpp:848
ccPickingListener
Point/triangle picking listener interface.
Definition: ecvPickingListener.h:21
ccPlane::getNormal
CCVector3 getNormal() const override
Returns the entity normal.
Definition: ecvPlane.h:73
ecvNormalVectors.h
ccPlaneEditDlg::saveParamsAndAccept
void saveParamsAndAccept()
Definition: ecvPlaneEditDlg.cpp:93
ccPlane::getXWidth
PointCoordinateType getXWidth() const
Returns 'X' width.
Definition: ecvPlane.h:50
ecvPlane.h
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
ccNormalVectors::ConvertDipAndDipDirToNormal
static CCVector3 ConvertDipAndDipDirToNormal(PointCoordinateType dip_deg, PointCoordinateType dipDir_deg, bool upward=true)
Definition: ecvNormalVectors.cpp:892
MainWindow::addToDB
void addToDB(const QStringList &filenames, QString fileFilter=QString(), bool displayDialog=true)
Definition: MainWindow.cpp:2152
ccPlane::setXWidth
void setXWidth(PointCoordinateType w, bool autoUpdate=true)
Sets 'X' width.
Definition: ecvPlane.h:61
s_center
static CCVector3d s_center(0, 0, 0)
ccPlaneEditDlg::ccPlaneEditDlg
ccPlaneEditDlg(ccPickingHub *pickingHub, QWidget *parent)
Default constructor.
Definition: ecvPlaneEditDlg.cpp:31
width
int width
Definition: FileIOFactory.cpp:142
CVLog::Error
static bool Error(const char *format,...)
Display an error dialog with formatted message.
Definition: CVLog.cpp:143
ccPlaneEditDlg
Dialog to create (or edit the parameters) of a plane.
Definition: ecvPlaneEditDlg.h:26
slots
#define slots
Definition: PythonPlugin.cpp:25
ccGLMatrixTpl::getTranslationAsVec3D
Vector3Tpl< T > getTranslationAsVec3D() const
Returns a copy of the translation as a CCVector3.
Definition: ecvGLMatrixTpl.h:830
height
int height
Definition: FileIOFactory.cpp:143
ccPickingListener::PickedItem::entity
ccHObject * entity
Definition: ecvPickingListener.h:30
Vector3Tpl
3D Vector (templated version)
Definition: CVGeom.h:223
ccHObject::redrawDisplay
virtual void redrawDisplay(bool forceRedraw=true, bool only2D=false)
Redraws associated display.
Definition: ecvHObject.cpp:1734
Ui
Definition: sfEditDlg.h:16
ccPlane::setYWidth
void setYWidth(PointCoordinateType h, bool autoUpdate=true)
Sets 'Y' width.
Definition: ecvPlane.h:67
ccHObject::applyGLTransformation_recursive
void applyGLTransformation_recursive(const ccGLMatrix *trans=nullptr)
Applies the active OpenGL transformation to the entity (recursive)
Definition: ecvHObject.cpp:948
ccGLMatrixTpl::initFromParameters
void initFromParameters(T alpha_rad, const Vector3Tpl< T > &axis3D, const Vector3Tpl< T > &t3D)
Inits transformation from a rotation axis, an angle and a translation.
Definition: ecvGLMatrixTpl.h:648
CVGeom.h
ccPlaneEditDlg::m_associatedPlane
ccPlane * m_associatedPlane
Associated plane (if any)
Definition: ecvPlaneEditDlg.h:60
ccPlaneEditDlg::~ccPlaneEditDlg
virtual ~ccPlaneEditDlg()
Destructor.
Definition: ecvPlaneEditDlg.cpp:89
ccPlaneEditDlg::initWithPlane
void initWithPlane(ccPlane *plane)
Links this dialog with an existing plane.
Definition: ecvPlaneEditDlg.cpp:210
Tuple3Tpl::z
Type z
Definition: CVGeom.h:137
ecvPickingHub.h
s_dipDir
static double s_dipDir
Definition: ecvPlaneEditDlg.cpp:25
ccPlane::getYWidth
PointCoordinateType getYWidth() const
Returns 'Y' width.
Definition: ecvPlane.h:53
ecvPickingListener.h
cloudViewer::DegreesToRadians
float DegreesToRadians(int degrees)
Convert degrees to radians.
Definition: CVMath.h:98
ccPlaneEditDlg::updatePlane
void updatePlane(ccPlane *plane)
Updates a plane with the current parameters.
Definition: ecvPlaneEditDlg.cpp:249
s_dip
static double s_dip
Definition: ecvPlaneEditDlg.cpp:24
ccPickingListener::PickedItem::P3D
CCVector3 P3D
Definition: ecvPickingListener.h:32
PC_ONE
constexpr PointCoordinateType PC_ONE
'1' as a PointCoordinateType value
Definition: CVConst.h:67
Vector3Tpl::dot
Type dot(const Vector3Tpl &v) const
Dot product.
Definition: CVGeom.h:408
ccGLMatrix
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
MainWindow.h
ccPlaneEditDlg::onNormalChanged
void onNormalChanged(double)
Definition: ecvPlaneEditDlg.cpp:155
MainWindow::updatePropertiesView
void updatePropertiesView()
Updates the 'Properties' view.
Definition: MainWindow.cpp:4988
ccPickingHub
Point/triangle picking hub.
Definition: ecvPickingHub.h:29
ccPlaneEditDlg::onDipDirModified
void onDipDirModified(bool)
Definition: ecvPlaneEditDlg.cpp:130
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
Tuple3Tpl::y
Type y
Definition: CVGeom.h:137
s_upward
static bool s_upward
Definition: ecvPlaneEditDlg.cpp:28
ccGLMatrixTpl< float >::FromToRotation
static ccGLMatrixTpl< float > FromToRotation(const Vector3Tpl< float > &from, const Vector3Tpl< float > &to)
Creates a transformation matrix that rotates a vector to another.
Definition: ecvGLMatrixTpl.h:230
rotation
Eigen::Matrix3d rotation
Definition: VoxelGridIO.cpp:27
ccPickingListener::PickedItem
Picked item.
Definition: ecvPickingListener.h:26
PointCoordinateType
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
ccPickingHub::removeListener
void removeListener(ccPickingListener *listener, bool autoStopPickingIfLast=true)
Removes a listener.
Definition: ecvPickingHub.cpp:165
ccPlane
Plane (primitive)
Definition: ecvPlane.h:17
s_height
static double s_height
Definition: ecvPlaneEditDlg.cpp:27
ccPlaneEditDlg::onDipDirChanged
void onDipDirChanged(double)
Definition: ecvPlaneEditDlg.cpp:134
ccGLMatrixTpl::toString
QString toString(int precision=12, QChar separator=' ') const
Returns matrix as a string.
Definition: ecvGLMatrixTpl.h:502