ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccGuiPythonInstance.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 <FileIOFilter.h>
11 
13 class QMainWindow;
14 
15 namespace pybind11
16 {
17 class args;
18 class kwargs;
19 class object;
20 } // namespace pybind11
21 
26 class Q_DECL_EXPORT ccGuiPythonInstance final
27 {
28  public:
29  explicit ccGuiPythonInstance(ecvMainAppInterface *app) noexcept(false);
30 
31  QMainWindow *getMainWindow();
32 
33  bool haveSelection() const;
34 
35  bool haveOneSelection() const;
36 
37  const ccHObject::Container &getSelectedEntities() const;
38 
39  void setSelectedInDB(ccHObject *obj, bool selected);
40 
41  ccHObject *dbRootObject();
42 
43  void addToDB(pybind11::object &obj,
44  bool updateZoom = false,
45  bool autoExpandDBTree = true,
46  bool checkDimensions = false,
47  bool autoRedraw = true);
48 
49  void removeFromDB(pybind11::object &obj);
50 
51  void redrawAll(bool only2D = false);
52 
53  void refreshAll(bool only2D = false);
54 
55  void enableAll();
56 
57  void disableAll();
58 
59  void updateUI();
60 
61  void freezeUI(bool state);
62 
63  ccHObject *loadFile(const char *filename, FileIOFilter::LoadParameters &parameters);
64 
65  ecvMainAppInterface *app();
66 
67  private:
68  ecvMainAppInterface *m_app;
69 };
ccGuiPythonInstance::haveOneSelection
bool haveOneSelection() const
Definition: ccGuiPythonInstance.cpp:94
ccCommandLineInterface::saveClouds
virtual bool saveClouds(QString suffix=QString(), bool allAtOnce=false, const QString *allAtOnceFileName=nullptr)=0
Saves all clouds.
filename
std::string filename
Definition: PointCloudIO.cpp:47
CC_FERR_CANCELED_BY_USER
@ CC_FERR_CANCELED_BY_USER
Definition: FileIOFilter.h:30
CC_FERR_BAD_ARGUMENT
@ CC_FERR_BAD_ARGUMENT
Definition: FileIOFilter.h:22
ccCommandLineInterface::getExportFilename
virtual QString getExportFilename(const CLEntityDesc &entityDesc, QString extension=QString(), QString suffix=QString(), QString *baseOutputFilename=nullptr, bool forceNoTimestamp=false) const =0
Returns the name of a to-be-exported entity.
ccCommandLineInterface::GlobalShiftOptions::customGlobalShift
CCVector3d customGlobalShift
Definition: ecvCommandLineInterface.h:230
CC_FERR_WRITING
@ CC_FERR_WRITING
Definition: FileIOFilter.h:25
ccCommandLineInterface::clouds
virtual std::vector< CLCloudDesc > & clouds()
Currently opened point clouds and their filename.
Definition: ecvCommandLineInterface.cpp:133
CLCloudDesc::pc
ccPointCloud * pc
Definition: ecvCommandLineInterface.h:69
CL_ENTITY_TYPE::GROUP
@ GROUP
ecvDisplayTools.h
define_ccCommandLine
void define_ccCommandLine(py::module &m)
Definition: ccCommandLine.cpp:23
CLEntityDesc::basename
QString basename
Definition: ecvCommandLineInterface.h:35
ccGuiPythonInstance::refreshAll
void refreshAll(bool only2D=false)
Definition: ccGuiPythonInstance.cpp:172
CC_FERR_WRONG_FILE_TYPE
@ CC_FERR_WRONG_FILE_TYPE
Definition: FileIOFilter.h:24
ccCommandLineInterface::saveMeshes
virtual bool saveMeshes(QString suffix=QString(), bool allAtOnce=false, const QString *allAtOnceFileName=nullptr)=0
Saves all meshes.
ecvMainAppInterface.h
FileIOFilter::LoadParameters
Generic loading parameters.
Definition: FileIOFilter.h:51
ccHObject::Container
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
ccCommandLineInterface::GlobalShiftOptions
Global Shift options.
Definition: ecvCommandLineInterface.h:221
ecvGenericMesh.h
ccCommandLineInterface::meshes
virtual std::vector< CLMeshDesc > & meshes()
Currently opened meshes and their filename.
Definition: ecvCommandLineInterface.cpp:139
CC_FERR_BROKEN_DEPENDENCY_ERROR
@ CC_FERR_BROKEN_DEPENDENCY_ERROR
Definition: FileIOFilter.h:34
result
core::Tensor result
Definition: VtkUtils.cpp:76
CC_FERR_UNKNOWN_FILE
@ CC_FERR_UNKNOWN_FILE
Definition: FileIOFilter.h:23
ecvCommandLineInterface.h
ccGuiPythonInstance::disableAll
void disableAll()
Definition: ccGuiPythonInstance.cpp:182
ecvMainAppInterface
Main application interface (for plugins)
Definition: ecvMainAppInterface.h:24
CC_FERR_BAD_ENTITY_TYPE
@ CC_FERR_BAD_ENTITY_TYPE
Definition: FileIOFilter.h:29
ccGuiPythonInstance::getSelectedEntities
const ccHObject::Container & getSelectedEntities() const
Definition: ccGuiPythonInstance.cpp:99
ccGuiPythonInstance
Definition: ccGuiPythonInstance.h:26
CC_FERR_NOT_ENOUGH_MEMORY
@ CC_FERR_NOT_ENOUGH_MEMORY
Definition: FileIOFilter.h:31
FileIOFilter::LoadFromFile
static ccHObject * LoadFromFile(const QString &filename, LoadParameters &parameters, Shared filter, CC_FILE_ERROR &result)
Loads one or more entities from a file with a known filter.
Definition: FileIOFilter.cpp:253
CLEntityDesc::path
QString path
Definition: ecvCommandLineInterface.h:36
CC_FILE_ERROR
CC_FILE_ERROR
Typical I/O filter errors.
Definition: FileIOFilter.h:20
CLEntityDesc
Loaded entity description.
Definition: ecvCommandLineInterface.h:34
ccGuiPythonInstance::redrawAll
void redrawAll(bool only2D=false)
Definition: ccGuiPythonInstance.cpp:167
CL_ENTITY_TYPE::CLOUD
@ CLOUD
ccGuiPythonInstance::updateUI
void updateUI()
Definition: ccGuiPythonInstance.cpp:187
ccCommandLineInterface::ExportOption::NoOptions
@ NoOptions
FileIOFilter.h
define_ccGUIPythonInstance
void define_ccGUIPythonInstance(py::module &m)
Definition: ccGuiPythonInstance.cpp:201
CLEntityDesc::indexInFile
int indexInFile
Definition: ecvCommandLineInterface.h:37
CC_FERR_THIRD_PARTY_LIB_EXCEPTION
@ CC_FERR_THIRD_PARTY_LIB_EXCEPTION
Definition: FileIOFilter.h:37
CC_FERR_NO_LOAD
@ CC_FERR_NO_LOAD
Definition: FileIOFilter.h:28
CL_ENTITY_TYPE::MESH
@ MESH
ThrowForFileError
static void ThrowForFileError(CC_FILE_ERROR error)
Definition: ccGuiPythonInstance.cpp:31
ccGuiPythonInstance::dbRootObject
ccHObject * dbRootObject()
Definition: ccGuiPythonInstance.cpp:162
CC_FERR_INTERNAL
@ CC_FERR_INTERNAL
Definition: FileIOFilter.h:39
ccCommandLineInterface
Command line interface.
Definition: ecvCommandLineInterface.h:112
CC_FERR_THIRD_PARTY_LIB_FAILURE
@ CC_FERR_THIRD_PARTY_LIB_FAILURE
Definition: FileIOFilter.h:36
ccGuiPythonInstance::ccGuiPythonInstance
ccGuiPythonInstance(ecvMainAppInterface *app) noexcept(false)
Definition: ccGuiPythonInstance.cpp:76
ccCommandLineInterface::GlobalShiftOptions::mode
Mode mode
Definition: ecvCommandLineInterface.h:229
CC_FERR_MALFORMED_FILE
@ CC_FERR_MALFORMED_FILE
Definition: FileIOFilter.h:32
CC_FERR_READING
@ CC_FERR_READING
Definition: FileIOFilter.h:26
ccGuiPythonInstance::enableAll
void enableAll()
Definition: ccGuiPythonInstance.cpp:177
ccGuiPythonInstance.h
CLMeshDesc::mesh
ccGenericMesh * mesh
Definition: ecvCommandLineInterface.h:91
CC_FERR_FILE_WAS_WRITTEN_BY_UNKNOWN_PLUGIN
@ CC_FERR_FILE_WAS_WRITTEN_BY_UNKNOWN_PLUGIN
Definition: FileIOFilter.h:35
ccGuiPythonInstance::getMainWindow
QMainWindow * getMainWindow()
Definition: ccGuiPythonInstance.cpp:84
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
ccGuiPythonInstance::app
ecvMainAppInterface * app()
Definition: ccGuiPythonInstance.cpp:196
pybind11
Definition: ccGuiPythonInstance.h:15
ccGuiPythonInstance::freezeUI
void freezeUI(bool state)
Definition: ccGuiPythonInstance.cpp:192
Utils::module
static double module(T *vector)
Definition: utils.h:105
CLEntityDesc::getEntity
virtual ccHObject * getEntity()=0
CC_FERR_CONSOLE_ERROR
@ CC_FERR_CONSOLE_ERROR
Definition: FileIOFilter.h:33
ccGuiPythonInstance::haveSelection
bool haveSelection() const
Definition: ccGuiPythonInstance.cpp:89
ccGuiPythonInstance::setSelectedInDB
void setSelectedInDB(ccHObject *obj, bool selected)
Definition: ccGuiPythonInstance.cpp:104
CC_FERR_NO_ERROR
@ CC_FERR_NO_ERROR
Definition: FileIOFilter.h:21
PYBIND11_MAKE_OPAQUE
PYBIND11_MAKE_OPAQUE(std::vector< CLCloudDesc >)
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.
ccGuiPythonInstance::loadFile
ccHObject * loadFile(const char *filename, FileIOFilter::LoadParameters &parameters)
Definition: ccGuiPythonInstance.cpp:109
ecvPointCloud.h
ccGuiPythonInstance::addToDB
void addToDB(pybind11::object &obj, bool updateZoom=false, bool autoExpandDBTree=true, bool checkDimensions=false, bool autoRedraw=true)
Definition: ccGuiPythonInstance.cpp:125
CC_FERR_NO_SAVE
@ CC_FERR_NO_SAVE
Definition: FileIOFilter.h:27
ccGuiPythonInstance::removeFromDB
void removeFromDB(pybind11::object &obj)
Definition: ccGuiPythonInstance.cpp:143
CC_FERR_NOT_IMPLEMENTED
@ CC_FERR_NOT_IMPLEMENTED
Definition: FileIOFilter.h:38
CLGroupDesc::groupEntity
ccHObject * groupEntity
Definition: ecvCommandLineInterface.h:54