19 #include <QCoreApplication>
20 #include <QMainWindow>
21 #include <QProgressDialog>
26 qHoughNormals::qHoughNormals(QObject* parent)
31 void qHoughNormals::onNewSelection(
34 for (
ccHObject* entity : selectedEntities) {
47 QList<QAction*> qHoughNormals::getActions() {
88 size_t pointCount = cloud->
size();
90 pc.resize(pointCount, 3);
91 for (
size_t i = 0; i < pointCount; ++i) {
93 pc.row(i) = Eigen::Vector3d(P->
x, P->
y, P->
z);
108 int stepProgress =
std::max(1, maxProgress / 100);
109 QProgressDialog pDlg(
"Computing normals...", QString(), 0,
112 QCoreApplication::processEvents();
114 std::function<void(
int)> progressLambda = [&](
int value) {
115 if ((value % stepProgress) == 0) {
116 QMetaObject::invokeMethod(&pDlg,
"setValue",
117 Qt::QueuedConnection,
119 QCoreApplication::processEvents();
132 for (
size_t i = 0; i < pointCount; ++i) {
133 const Eigen::Vector3d& n =
normals.row(i);
143 }
catch (
const std::bad_alloc&) {
float PointCoordinateType
Type of the coordinates of a (N-D) point.
static bool Error(const char *format,...)
Display an error dialog with formatted message.
bool & density_sensitive()
void setProgressCallback(std::function< void(int)> callback)
double & get_tol_angle_rad()
int maxProgressCounter() const
virtual QString getName() const override
Returns (short) name (for menu entry, etc.)
virtual QString getDescription() const override
Returns long name/description (for tooltip, etc.)
virtual QIcon getIcon() const override
Returns icon.
virtual void showNormals(bool state)
Sets normals visibility.
Hierarchical CLOUDVIEWER Object.
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
bool resizeTheNormsTable()
Resizes the compressed normals array.
void setPointNormal(size_t pointIndex, const CCVector3 &N)
Sets a particular point normal (shortcut)
Standard ECV plugin interface.
ecvMainAppInterface * m_app
Main application interface.
unsigned size() const override
const CCVector3 * getPoint(unsigned index) const override
virtual void updateUI()=0
virtual QMainWindow * getMainWindow()=0
Returns main window.
bool haveSelection() const
Checks if we have any selections.
virtual void refreshSelected(bool only2D=false, bool forceRedraw=true)=0
virtual const ccHObject::Container & getSelectedEntities() const =0
Returns currently selected entities ("read only")
QAction * m_action
Associated action.
void doAction()
Slot called when associated action is triggered.
qHoughNormalsDialog::Parameters s_params