ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
qPoissonRecon.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 "ecvStdPluginInterface.h"
11 
13 
17 class qPoissonRecon : public QObject, public ccStdPluginInterface {
18  Q_OBJECT
20 
21  Q_PLUGIN_METADATA(IID "ecvcorp.cloudviewer.plugin.qPoissonRecon" FILE
22  "../info.json")
23 
24 public:
26  explicit qPoissonRecon(QObject* parent = nullptr);
27 
28  virtual ~qPoissonRecon() = default;
29 
30  // inherited from ccStdPluginInterface
31  virtual void onNewSelection(
32  const ccHObject::Container& selectedEntities) override;
33  virtual QList<QAction*> getActions() override;
34 
35 protected:
37  void doAction();
38 
39 protected:
41  QAction* m_action;
42 };
COMMAND_PCV_180
constexpr char COMMAND_PCV_180[]
Definition: PCVCommand.cpp:26
ccPointCloud::addScalarField
int addScalarField(const char *uniqueName) override
Creates a new scalar field and registers it.
Definition: ecvPointCloud.cpp:4210
ccPointCloud::deleteScalarField
void deleteScalarField(int index) override
Deletes a specific scalar field.
Definition: ecvPointCloud.cpp:3237
M_PI
constexpr double M_PI
Pi.
Definition: CVConst.h:19
cloudViewer::GenericCloud::getNextPoint
virtual const CCVector3 * getNextPoint()=0
Returns the next point (relatively to the global iterator position)
COMMAND_PCV_N_RAYS
constexpr char COMMAND_PCV_N_RAYS[]
Definition: PCVCommand.cpp:24
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
ccDefaultPluginInterface::getDescription
virtual QString getDescription() const override
Returns long name/description (for tooltip, etc.)
Definition: ecvDefaultPluginInterface.cpp:104
ccColorScalesManager::GREY
@ GREY
Definition: ecvColorScalesManager.h:32
ccObject::isKindOf
bool isKindOf(CV_CLASS_ENUM type) const
Definition: ecvObject.h:128
cloudViewer::NormalizedProgress::oneStep
bool oneStep()
Increments total progress value of a single unit.
Definition: NormalizedProgress.cpp:99
ccDefaultPluginInterface::getName
virtual QString getName() const override
Returns (short) name (for menu entry, etc.)
Definition: ecvDefaultPluginInterface.cpp:100
x
normal_z x
Definition: my_point_types.h:165
ccScalarField::computeMinAndMax
void computeMinAndMax() override
Determines the min and max values.
Definition: ecvScalarField.cpp:145
ecvMainAppInterface::dispToConsole
virtual void dispToConsole(QString message, ConsoleMessageLevel level=STD_CONSOLE_MESSAGE)=0
qPoissonRecon::m_action
QAction * m_action
Associated action.
Definition: qPoissonRecon.h:41
Tuple3Tpl::x
Type x
Definition: CVGeom.h:137
cloudViewer::GenericCloud::size
virtual unsigned size() const =0
Returns the number of points.
PCVContext::m_snapZ
float * m_snapZ
Depth buffer.
Definition: PCVContext.h:88
PCVCommand::PCVCommand
PCVCommand()
Definition: PCVCommand.cpp:29
PCVContext::m_mesh
cloudViewer::GenericMesh * m_mesh
Displayed entity (mesh - optional)
Definition: PCVContext.h:64
offset
int offset
Definition: FileIOFactory.cpp:135
ccHObject::getParent
ccHObject * getParent() const
Returns parent object.
Definition: ecvHObject.h:245
format
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:181
qPoissonRecon
Wrapper to the "Poisson Surface Reconstruction (Version 9)" algorithm.
Definition: qPoissonRecon.h:17
qPCV::getActions
virtual QList< QAction * > getActions() override
Get a list of actions for this plugin.
Definition: qPCV.cpp:56
ccCommandLineInterface::clouds
virtual std::vector< CLCloudDesc > & clouds()
Currently opened point clouds and their filename.
Definition: ecvCommandLineInterface.cpp:133
ccHObjectCaster::ToPointCloud
static ccPointCloud * ToPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccPointCloud.
Definition: ecvHObjectCaster.cpp:54
CV_TYPES::MESH
@ MESH
Definition: CVTypes.h:105
string.h
nProgress
cloudViewer::NormalizedProgress * nProgress
Definition: qCanupoTools.cpp:42
ecvMainAppInterface::getMainWindow
virtual QMainWindow * getMainWindow()=0
Returns main window.
ccCommandLineInterface::error
virtual bool error(const QString &message) const =0
ccColorScalesManager::GetDefaultScale
static ccColorScale::Shared GetDefaultScale(DEFAULT_SCALES scale=BGYR)
Returns a pre-defined color scale (static shortcut)
Definition: ecvColorScalesManager.h:61
ccObject::isA
bool isA(CV_CLASS_ENUM type) const
Definition: ecvObject.h:131
CV_TYPES::POINT_CLOUD
@ POINT_CLOUD
Definition: CVTypes.h:104
ecvMainAppInterface::WRN_CONSOLE_MESSAGE
@ WRN_CONSOLE_MESSAGE
Definition: ecvMainAppInterface.h:118
ccGenericMesh::getAssociatedCloud
virtual ccGenericPointCloud * getAssociatedCloud() const =0
Returns the vertices cloud.
ScalarField.h
ecvMainAppInterface::dbRootObject
virtual ccHObject * dbRootObject()=0
Returns DB root (as a ccHObject)
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
s_mode180CheckBoxState
static bool s_mode180CheckBoxState
Definition: qPCV.cpp:34
PCVContext::drawEntity
void drawEntity()
Definition: PCVContext.cpp:187
qPCV::onNewSelection
virtual void onNewSelection(const ccHObject::Container &selectedEntities) override
Definition: qPCV.cpp:42
cloudViewer::PointCloudTpl::getScalarFieldIndexByName
int getScalarFieldIndexByName(const char *name) const
Returns the index of a scalar field represented by its name.
Definition: PointCloudTpl.h:375
PCVContext.h
ccHObject::Container
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
CCVector3
Vector3Tpl< PointCoordinateType > CCVector3
Default 3D Vector.
Definition: CVGeom.h:798
ecvGenericMesh.h
qPCV.h
ccDrawableObject::hasNormals
virtual bool hasNormals() const
Returns whether normals are enabled or not.
Definition: ecvDrawableObject.h:89
ccPointCloud::setCurrentDisplayedScalarField
void setCurrentDisplayedScalarField(int index)
Sets the currently displayed scalar field.
Definition: ecvPointCloud.cpp:3227
cloudViewer::PointCloudTpl::getScalarField
ScalarField * getScalarField(int index) const
Returns a pointer to a specific scalar field.
Definition: PointCloudTpl.h:354
ccCommandLineInterface::meshes
virtual std::vector< CLMeshDesc > & meshes()
Currently opened meshes and their filename.
Definition: ecvCommandLineInterface.cpp:139
CVMiscTools.h
width
int width
Definition: FileIOFactory.cpp:142
PCVContext::m_viewMat
float m_viewMat[OPENGL_MATRIX_SIZE]
Current model view matrix.
Definition: PCVContext.h:85
qPCV::qPCV
qPCV(QObject *parent=nullptr)
Default constructor.
Definition: qPCV.cpp:37
PCVCommand::process
bool process(ccCommandLineInterface &cmd) override
Main process.
Definition: PCVCommand.cpp:148
cloudViewer::GenericCloud::getBoundingBox
virtual void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax)=0
Returns the cloud bounding box.
size
int size
Definition: FileIOFactory.cpp:130
height
int height
Definition: FileIOFactory.cpp:143
CC_PCV_FIELD_LABEL_NAME
constexpr char CC_PCV_FIELD_LABEL_NAME[]
Definition: PCVCommand.cpp:21
GenericTriangle.h
y
normal_z y
Definition: my_point_types.h:168
ecvMainAppInterface
Main application interface (for plugins)
Definition: ecvMainAppInterface.h:24
PCV.h
COMMAND_PCV_RESOLUTION
constexpr char COMMAND_PCV_RESOLUTION[]
Definition: PCVCommand.cpp:27
ccGenericPointCloud
A 3D cloud interface with associated features (color, normals, octree, etc.)
Definition: ecvGenericPointCloud.h:45
s_firstLaunch
static bool s_firstLaunch
Definition: qPCV.cpp:31
Vector3Tpl< PointCoordinateType >
PCVContext::m_snapC
unsigned char * m_snapC
Color buffer.
Definition: PCVContext.h:90
COMMAND_PCV_IS_CLOSED
constexpr char COMMAND_PCV_IS_CLOSED[]
Definition: PCVCommand.cpp:25
glTranslate
static void glTranslate(float x, float y, float z)
Definition: PCVContext.cpp:32
ccCommandLineInterface::Command::Shared
QSharedPointer< Command > Shared
Shared type.
Definition: ecvCommandLineInterface.h:132
ecvGenericPointCloud.h
ecvMainAppInterface::ERR_CONSOLE_MESSAGE
@ ERR_CONSOLE_MESSAGE
Definition: ecvMainAppInterface.h:119
Ui
Definition: sfEditDlg.h:16
qPCV::m_action
QAction * m_action
Associated action.
Definition: qPCV.h:44
ccStdPluginInterface::m_app
ecvMainAppInterface * m_app
Main application interface.
Definition: ecvStdPluginInterface.h:85
ecvStdPluginInterface.h
ccPcvDlg
Dialog for the PCV plugin.
Definition: ccPcvDlg.h:13
s_resSpinBoxValue
static int s_resSpinBoxValue
Definition: qPCV.cpp:33
SampleSphere
static bool SampleSphere(unsigned N, std::vector< CCVector3 > &dirs)
Sample points on the unit sphere.
Definition: PCV.cpp:47
ecvProgressDialog
Graphical progress indicator (thread-safe)
Definition: ecvProgressDialog.h:27
ecvScalarField.h
ecvProgressDialog.h
ZERO_TOLERANCE
constexpr double ZERO_TOLERANCE
Numerical threshold for considering a value as "zero".
Definition: CVConst.h:37
ccGenericMesh
Generic mesh interface.
Definition: ecvGenericMesh.h:28
cloudViewer::GenericCloud::placeIteratorAtBeginning
virtual void placeIteratorAtBeginning()=0
Sets the cloud iterator at the beginning.
PCVContext::init
bool init(unsigned W, unsigned H, cloudViewer::GenericCloud *cloud, cloudViewer::GenericMesh *mesh=0, bool closedMesh=true)
Initialization.
Definition: PCVContext.cpp:69
PCVContext::OPENGL_MATRIX_SIZE
static const unsigned OPENGL_MATRIX_SIZE
Model view matrix size (OpenGL)
Definition: PCVContext.h:82
cloudViewer::utility::floor
MiniVec< float, N > floor(const MiniVec< float, N > &a)
Definition: MiniVec.h:75
ccDrawableObject::showSF
virtual void showSF(bool state)
Sets active scalarfield visibility.
Definition: ecvDrawableObject.h:108
ecvMainAppInterface::refreshSelected
virtual void refreshSelected(bool only2D=false, bool forceRedraw=true)=0
ccCommandLineInterface::arguments
virtual QStringList & arguments()=0
Returns the list of arguments.
s_closedMeshCheckBoxState
static bool s_closedMeshCheckBoxState
Definition: qPCV.cpp:35
ccCommandLineInterface::print
virtual void print(const QString &message) const =0
Tuple3Tpl::z
Type z
Definition: CVGeom.h:137
ZTWIST
#define ZTWIST
Definition: PCVContext.cpp:46
ccScalarField::setColorScale
void setColorScale(ccColorScale::Shared scale)
Sets associated color scale.
Definition: ecvScalarField.cpp:108
PCVContext::setViewDirection
void setViewDirection(const CCVector3 &V)
Set the viewing directions.
Definition: PCVContext.cpp:166
glScale
static void glScale(float x, float y, float z)
Definition: PCVContext.cpp:40
PCVCommand.h
PCVContext::m_pixBuffer
QGLPixelBuffer * m_pixBuffer
Definition: PCVContext.h:72
PCV::Launch
static int Launch(unsigned numberOfRays, cloudViewer::GenericCloud *vertices, cloudViewer::GenericMesh *mesh=nullptr, bool meshIsClosed=false, bool mode360=true, unsigned width=1024, unsigned height=1024, cloudViewer::GenericProgressCallback *progressCb=nullptr, QString entityName=QString())
PCVContext::PCVContext
PCVContext()
Default constructor.
Definition: PCVContext.cpp:49
PCVCommand
Definition: PCVCommand.h:35
PCVContext::m_meshIsClosed
bool m_meshIsClosed
Whether displayed mesh is closed or not.
Definition: PCVContext.h:93
ccCommandLineInterface
Command line interface.
Definition: ecvCommandLineInterface.h:112
ecvHObjectCaster.h
openGLSnapshot
void openGLSnapshot(GLenum format, GLenum type, void *buffer)
Definition: PCVContext.cpp:224
PC_ONE
constexpr PointCoordinateType PC_ONE
'1' as a PointCoordinateType value
Definition: CVConst.h:67
ccCommandLineInterface::autoSaveMode
bool autoSaveMode() const
Definition: ecvCommandLineInterface.cpp:155
ccDefaultPluginInterface::getIcon
virtual QIcon getIcon() const override
Returns icon.
Definition: ecvDefaultPluginInterface.cpp:108
PCVContext::m_width
unsigned m_width
Pixel buffer width (pixels)
Definition: PCVContext.h:75
ccPluginInterface
Standard ECV plugin interface.
Definition: ecvPluginInterface.h:33
CLCloudDesc
Loaded cloud description.
Definition: ecvCommandLineInterface.h:68
PCVCommand::Process
static bool Process(const ccHObject::Container &candidates, const std::vector< CCVector3 > &rays, bool meshIsClosed, unsigned resolution, ecvProgressDialog *progressDlg=nullptr, ecvMainAppInterface *app=nullptr)
Definition: PCVCommand.cpp:31
PCVContext::~PCVContext
virtual ~PCVContext()
Destructor.
Definition: PCVContext.cpp:62
gcd
static int gcd(int num1, int num2)
Definition: PCV.cpp:29
ccGenericPointCloud::getPointNormal
virtual const CCVector3 & getPointNormal(unsigned pointIndex) const =0
Returns normal corresponding to a given point.
count
int count
Definition: FileIOFactory.cpp:132
COMMAND_PCV
constexpr char COMMAND_PCV[]
Definition: PCVCommand.cpp:23
PCVContext::m_zoom
PointCoordinateType m_zoom
Definition: PCVContext.h:67
ecvMainAppInterface::getSelectedEntities
virtual const ccHObject::Container & getSelectedEntities() const =0
Returns currently selected entities ("read only")
PCVContext::m_vertices
cloudViewer::GenericCloud * m_vertices
Displayed entity (cloud or mesh vertices)
Definition: PCVContext.h:61
ecvColorScalesManager.h
PCVContext::m_viewCenter
CCVector3 m_viewCenter
Definition: PCVContext.h:69
qPCV::registerCommands
virtual void registerCommands(ccCommandLineInterface *cmd) override
Optional: registers commands (for the command line mode)
Definition: qPCV.cpp:291
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
Tuple3Tpl::y
Type y
Definition: CVGeom.h:137
ccObject::getName
virtual QString getName() const
Returns object name.
Definition: ecvObject.h:72
CLMeshDesc
Loaded mesh description.
Definition: ecvCommandLineInterface.h:90
s_raysSpinBoxValue
static int s_raysSpinBoxValue
Definition: qPCV.cpp:32
ecvMainAppInterface::updateUI
virtual void updateUI()=0
PCVContext::m_height
unsigned m_height
Pixel buffer height (pixels)
Definition: PCVContext.h:77
PCVContext::GLAccumPixel
int GLAccumPixel(std::vector< int > &visibilityCount)
Definition: PCVContext.cpp:242
qPCV::doAction
void doAction()
Slot called when associated ation is triggered.
Definition: qPCV.cpp:69
PointCoordinateType
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
z
normal_z z
Definition: my_point_types.h:165
ccPcvDlg.h
ccCommandLineInterface::registerCommand
virtual bool registerCommand(Command::Shared command)=0
Registers a new command.
PCVContext::glInit
void glInit()
Definition: PCVContext.cpp:136
ccCommandLineInterface::IsCommand
static bool IsCommand(const QString &token, const char *command)
Test whether a command line token is a valid command keyword or not.
Definition: ecvCommandLineInterface.cpp:119
ccStdPluginInterface
Standard ECV plugin interface.
Definition: ecvStdPluginInterface.h:31
PCVContext::associateToEntity
void associateToEntity(cloudViewer::GenericCloud *cloud, cloudViewer::GenericMesh *mesh=0)
Definition: PCVContext.cpp:112
ccCommandLineInterface::exportEntity
virtual QString exportEntity(CLEntityDesc &entityDesc, const QString &suffix=QString(), QString *outputFilename=nullptr, ccCommandLineInterface::ExportOptions options=ExportOption::NoOptions)=0
Exports a cloud or a mesh.
ccHObjectCaster::ToGenericPointCloud
static ccGenericPointCloud * ToGenericPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccGenericPointCloud.
Definition: ecvHObjectCaster.cpp:81
cloudViewer::PointCloudTpl::setCurrentScalarField
void setCurrentScalarField(int index)
Sets both the INPUT & OUTPUT scalar field.
Definition: PointCloudTpl.h:435
type
char type
Definition: FileIOFactory.cpp:131
ecvPointCloud.h
cloudViewer::utility::ceil
MiniVec< float, N > ceil(const MiniVec< float, N > &a)
Definition: MiniVec.h:89
ccScalarField
A scalar field associated to display-related parameters.
Definition: ecvScalarField.h:19
qPoissonRecon::doAction
void doAction()
Slot called when associated ation is triggered.
Definition: qPoissonRecon.cpp:251
PCVContext
PCV (Portion de Ciel Visible / Ambiant Illumination) OpenGL context.
Definition: PCVContext.h:22
ccPcvDlg::ccPcvDlg
ccPcvDlg(QWidget *parent=0)
Definition: ccPcvDlg.cpp:10
glVertex3v
static void glVertex3v(const float *v)
Definition: PCVContext.cpp:28
ccHObjectCaster::ToGenericMesh
static ccGenericMesh * ToGenericMesh(ccHObject *obj)
Converts current object to ccGenericMesh (if possible)
Definition: ecvHObjectCaster.cpp:123
PCV::GenerateRays
static bool GenerateRays(unsigned numberOfRays, std::vector< CCVector3 > &rays, bool mode360=true)
Generates a given number of rays.
Definition: PCV.cpp:159