![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Base abstract class for each implemented PCL filter. More...
#include <BasePclModule.h>


Signals | |
| void | entityHasChanged (ccHObject *) |
| Signal emitted when an entity is (visually) modified. More... | |
| void | newEntity (ccHObject *) |
| Signal emitted when a new entity is created by the filter. More... | |
| void | newErrorMessage (QString) |
| Signal emitted when a new error message is produced. More... | |
Public Member Functions | |
| BasePclModule (PclModuleDescription desc=PclModuleDescription(), ccPluginInterface *parent_plugin=0) | |
| Default constructor. More... | |
| QAction * | getAction () |
| Get the action associated with the button used in menu and toolbar creation. More... | |
| virtual QString | getErrorMessage (int errorCode) |
| Returns the error message corresponding to a given error code. More... | |
| QString | getStatusTip () const |
| Returns the status tip. More... | |
| QString | getModuleName () const |
| Returns the name of the filter. More... | |
| QString | getEntryName () const |
| Returns the entry name. More... | |
| QIcon | getIcon () const |
| Returns the icon associated with the button. More... | |
| void | setShowProgressBar (bool status) |
| Sets whether to show a progressbar while computing or not. More... | |
| std::vector< std::string > | getSelectedAvailableScalarFields () |
| ccPointCloud * | getSelectedEntityAsCCPointCloud () const |
| Returns the first selected entity as a ccPointCloud. More... | |
| ccHObject * | getSelectedEntityAsCCHObject () const |
| Returns the first selected entity as a ccHObject. More... | |
| ccHObject::Container | getSelectedThatHaveMetaData (const QString key) const |
| Get selected object that also have the provided metadata key. More... | |
| void | getAllEntitiesOfType (CV_CLASS_ENUM type, ccHObject::Container &entities) |
| Returns all the objects in db tree of type "type". More... | |
| void | getAllEntitiesThatHaveMetaData (QString key, ccHObject::Container &entities) |
| void | getSelectedEntitiesThatAreCCPointCloud (ccHObject::Container &entities) |
| get all entities that are selected and that also are cc_point_cloud More... | |
| void | getSelectedEntitiesThatAre (CV_CLASS_ENUM kind, ccHObject::Container &entities) |
| int | hasSelectedRGB () |
| Returns 1 if the first selected entity has RGB info. More... | |
| int | hasSelectedScalarField () |
| Returns 1 if the first selected entity has at least one scalar field. More... | |
| int | hasSelectedScalarField (std::string field_name) |
| int | isFirstSelectedCcPointCloud () |
| Returns 1 if the first selected object is a ccPointCloud. More... | |
| virtual void | updateSelectedEntities (const ccHObject::Container &selectedEntities) |
| Updates the internal copy of selected entities. More... | |
| virtual int | compute ()=0 |
| Performs the actual filter job. More... | |
| void | setMainAppInterface (ecvMainAppInterface *app) |
| Sets associated CC application interface (to access DB) More... | |
| ecvMainAppInterface * | getMainAppInterface () |
| ccPluginInterface * | getParentPlugin () const |
| Returns the associated parent plugin interface. More... | |
Protected Slots | |
| int | performAction () |
| Returns is called when the dialog window is accepted. More... | |
Protected Member Functions | |
| virtual int | checkSelected () |
| Checks if current selection is compliant with the filter. More... | |
| virtual int | openInputDialog () |
| virtual int | openOutputDialog () |
| virtual void | getParametersFromDialog () |
| Collects parameters from the filter dialog (if openDialog is successful) More... | |
| virtual int | checkParameters () |
| virtual int | start () |
| Starts computation. More... | |
| virtual void | initAction () |
| Initializes the corresponding action. More... | |
| void | throwError (int errCode) |
Protected Attributes | |
| QAction * | m_action |
| Forces the Ui to be updated. More... | |
| ccHObject::Container | m_selected |
| Pointer to the main window. More... | |
| PclModuleDescription | m_desc |
| Associated dialog. More... | |
| ecvMainAppInterface * | m_app |
| Associated application interface. More... | |
| ccPluginInterface * | m_parent_plugin |
| associated parent plugin of the filter More... | |
| bool | m_show_progress |
| Do we want to show a progress bar when the filter works? More... | |
Base abstract class for each implemented PCL filter.
Definition at line 53 of file BasePclModule.h.
| BasePclModule::BasePclModule | ( | PclModuleDescription | desc = PclModuleDescription(), |
| ccPluginInterface * | parent_plugin = 0 |
||
| ) |
Default constructor.
| [in] | desc | a PclModuleDescription structure containing filter infos |
| [in] | parent_plugin | parent plugin (optional) |
Definition at line 37 of file BasePclModule.cpp.
References initAction(), and m_parent_plugin.
|
inlineprotectedvirtual |
Checks that the parameters retrieved by getParametersFromDialog are valid Automatically called by performAction. Does nothing by default. Must be overridden if necessary.
Reimplemented in PoissonReconstruction, NurbsSurfaceReconstruction, NurbsCurveFitting, MarchingCubeReconstruction, GreedyTriangulation, ConvexConcaveHullReconstruction, SACSegmentation, RegionGrowingSegmentation, MinimumCutSegmentation, EuclideanClusterSegmentation, DONSegmentation, TemplateAlignment, CorrespondenceMatching, ProjectionFilter, GeneralFilters, and ExtractSIFT.
Definition at line 239 of file BasePclModule.h.
Referenced by performAction().
|
protectedvirtual |
Checks if current selection is compliant with the filter.
If not, an error is returned and computation stops. By default, baseclass method simply checks that selection is composed of one and only one ccPointCloud. This method should be overridden if necessary.
Reimplemented in FastGlobalRegistrationFilter, PoissonReconstruction, NurbsSurfaceReconstruction, NurbsCurveFitting, MarchingCubeReconstruction, GreedyTriangulation, ConvexConcaveHullReconstruction, SACSegmentation, RegionGrowingSegmentation, MinimumCutSegmentation, EuclideanClusterSegmentation, DONSegmentation, TemplateAlignment, CorrespondenceMatching, and ExtractSIFT.
Definition at line 139 of file BasePclModule.cpp.
References m_selected, and CV_TYPES::POINT_CLOUD.
Referenced by performAction(), and updateSelectedEntities().
|
pure virtual |
Performs the actual filter job.
This method MUST be re-implemented by derived filter
Implemented in FastGlobalRegistrationFilter, PoissonReconstruction, NurbsSurfaceReconstruction, NurbsCurveFitting, MarchingCubeReconstruction, GreedyTriangulation, ConvexConcaveHullReconstruction, SACSegmentation, RegionGrowingSegmentation, MinimumCutSegmentation, EuclideanClusterSegmentation, DONSegmentation, TemplateAlignment, CorrespondenceMatching, StatisticalOutliersRemover, ProjectionFilter, MLSSmoothingUpsampling, GeneralFilters, NormalEstimation, and ExtractSIFT.
Referenced by doCompute().
|
signal |
Signal emitted when an entity is (visually) modified.
Referenced by qPCL::addPclModule(), and NormalEstimation::compute().
| QAction * BasePclModule::getAction | ( | ) |
Get the action associated with the button used in menu and toolbar creation.
Definition at line 216 of file BasePclModule.cpp.
References m_action.
Referenced by qPCL::addPclModule().
| void BasePclModule::getAllEntitiesOfType | ( | CV_CLASS_ENUM | type, |
| ccHObject::Container & | entities | ||
| ) |
Returns all the objects in db tree of type "type".
Definition at line 285 of file BasePclModule.cpp.
References ecvMainAppInterface::dbRootObject(), ccHObject::filterChildren(), m_app, and type.
Referenced by getAllEntitiesThatHaveMetaData().
| void BasePclModule::getAllEntitiesThatHaveMetaData | ( | QString | key, |
| ccHObject::Container & | entities | ||
| ) |
Returns all the existent hierarchical objects which have a specific metadata May return an empty container if none found.
Definition at line 292 of file BasePclModule.cpp.
References getAllEntitiesOfType(), and CV_TYPES::HIERARCHY_OBJECT.
| QString BasePclModule::getEntryName | ( | ) | const |
Returns the entry name.
Entry name is used when creating the corresponding QAction by initAction
Definition at line 210 of file BasePclModule.cpp.
References m_desc, and PclModuleDescription::m_entry_name.
Referenced by initAction().
|
virtual |
Returns the error message corresponding to a given error code.
Each filter have a set of possible error message to be used given bt getFilterErrorMessage() Baseclass implementation provides some generic messages.
Reimplemented in FastGlobalRegistrationFilter, PoissonReconstruction, NurbsSurfaceReconstruction, NurbsCurveFitting, MarchingCubeReconstruction, GreedyTriangulation, ConvexConcaveHullReconstruction, SACSegmentation, RegionGrowingSegmentation, MinimumCutSegmentation, EuclideanClusterSegmentation, DONSegmentation, TemplateAlignment, CorrespondenceMatching, ProjectionFilter, GeneralFilters, and ExtractSIFT.
Definition at line 218 of file BasePclModule.cpp.
References getModuleName().
Referenced by ExtractSIFT::getErrorMessage(), GeneralFilters::getErrorMessage(), ProjectionFilter::getErrorMessage(), CorrespondenceMatching::getErrorMessage(), TemplateAlignment::getErrorMessage(), DONSegmentation::getErrorMessage(), EuclideanClusterSegmentation::getErrorMessage(), MinimumCutSegmentation::getErrorMessage(), RegionGrowingSegmentation::getErrorMessage(), SACSegmentation::getErrorMessage(), ConvexConcaveHullReconstruction::getErrorMessage(), GreedyTriangulation::getErrorMessage(), MarchingCubeReconstruction::getErrorMessage(), NurbsCurveFitting::getErrorMessage(), NurbsSurfaceReconstruction::getErrorMessage(), PoissonReconstruction::getErrorMessage(), FastGlobalRegistrationFilter::getErrorMessage(), and throwError().
| QIcon BasePclModule::getIcon | ( | ) | const |
Returns the icon associated with the button.
Definition at line 214 of file BasePclModule.cpp.
References m_desc, and PclModuleDescription::m_icon.
Referenced by initAction().
|
inline |
Returns associated CC application interface for accessing to some of mainWindow methods
Definition at line 165 of file BasePclModule.h.
References m_app.
| QString BasePclModule::getModuleName | ( | ) | const |
Returns the name of the filter.
Definition at line 208 of file BasePclModule.cpp.
References m_desc, and PclModuleDescription::m_module_name.
Referenced by getErrorMessage(), and start().
|
inlineprotectedvirtual |
Collects parameters from the filter dialog (if openDialog is successful)
Automatically called by performAction. Does nothing by default. Must be overridden if necessary.
Reimplemented in FastGlobalRegistrationFilter, PoissonReconstruction, NurbsSurfaceReconstruction, NurbsCurveFitting, MarchingCubeReconstruction, GreedyTriangulation, ConvexConcaveHullReconstruction, SACSegmentation, RegionGrowingSegmentation, MinimumCutSegmentation, EuclideanClusterSegmentation, DONSegmentation, TemplateAlignment, CorrespondenceMatching, StatisticalOutliersRemover, ProjectionFilter, MLSSmoothingUpsampling, GeneralFilters, NormalEstimation, and ExtractSIFT.
Definition at line 231 of file BasePclModule.h.
Referenced by performAction().
|
inline |
Returns the associated parent plugin interface.
Definition at line 168 of file BasePclModule.h.
References m_parent_plugin.
| std::vector< std::string > BasePclModule::getSelectedAvailableScalarFields | ( | ) |
Returns a vector of strings representing the names of the available scalar fields For the first selected entity.
Definition at line 344 of file BasePclModule.cpp.
References cloudViewer::PointCloudTpl< T >::getNumberOfScalarFields(), cloudViewer::PointCloudTpl< T >::getScalarFieldName(), and getSelectedEntityAsCCPointCloud().
Referenced by ExtractSIFT::openInputDialog().
| void BasePclModule::getSelectedEntitiesThatAre | ( | CV_CLASS_ENUM | kind, |
| ccHObject::Container & | entities | ||
| ) |
get all entities that are selected and that also are of the specified type
Definition at line 315 of file BasePclModule.cpp.
References ccObject::isA(), and m_selected.
| void BasePclModule::getSelectedEntitiesThatAreCCPointCloud | ( | ccHObject::Container & | entities | ) |
get all entities that are selected and that also are cc_point_cloud
Definition at line 304 of file BasePclModule.cpp.
References ccObject::isA(), m_selected, and CV_TYPES::POINT_CLOUD.
| ccHObject * BasePclModule::getSelectedEntityAsCCHObject | ( | ) | const |
Returns the first selected entity as a ccHObject.
Definition at line 266 of file BasePclModule.cpp.
References m_selected.
| ccPointCloud * BasePclModule::getSelectedEntityAsCCPointCloud | ( | ) | const |
Returns the first selected entity as a ccPointCloud.
Definition at line 256 of file BasePclModule.cpp.
References ccObject::isA(), m_selected, CV_TYPES::POINT_CLOUD, and ccHObjectCaster::ToPointCloud().
Referenced by ExtractSIFT::compute(), NormalEstimation::compute(), GeneralFilters::compute(), MLSSmoothingUpsampling::compute(), ProjectionFilter::compute(), StatisticalOutliersRemover::compute(), DONSegmentation::compute(), EuclideanClusterSegmentation::compute(), MinimumCutSegmentation::compute(), RegionGrowingSegmentation::compute(), SACSegmentation::compute(), ConvexConcaveHullReconstruction::compute(), GreedyTriangulation::compute(), MarchingCubeReconstruction::compute(), NurbsCurveFitting::compute(), NurbsSurfaceReconstruction::compute(), PoissonReconstruction::compute(), getSelectedAvailableScalarFields(), hasSelectedRGB(), hasSelectedScalarField(), NormalEstimation::openInputDialog(), MinimumCutSegmentation::openInputDialog(), RegionGrowingSegmentation::openInputDialog(), GreedyTriangulation::openInputDialog(), MarchingCubeReconstruction::openInputDialog(), and PoissonReconstruction::openInputDialog().
| ccHObject::Container BasePclModule::getSelectedThatHaveMetaData | ( | const QString | key | ) | const |
Get selected object that also have the provided metadata key.
Definition at line 273 of file BasePclModule.cpp.
References ccObject::hasMetaData(), and m_selected.
| QString BasePclModule::getStatusTip | ( | ) | const |
Returns the status tip.
Status tip is visualized in status bar when button is hovered. used in QAction creation
Definition at line 212 of file BasePclModule.cpp.
References m_desc, and PclModuleDescription::m_status_tip.
Referenced by initAction().
| int BasePclModule::hasSelectedRGB | ( | ) |
Returns 1 if the first selected entity has RGB info.
Definition at line 365 of file BasePclModule.cpp.
References getSelectedEntityAsCCPointCloud(), ccPointCloud::hasColors(), and isFirstSelectedCcPointCloud().
Referenced by ExtractSIFT::checkSelected(), and ExtractSIFT::openInputDialog().
| int BasePclModule::hasSelectedScalarField | ( | ) |
Returns 1 if the first selected entity has at least one scalar field.
Definition at line 335 of file BasePclModule.cpp.
References getSelectedEntityAsCCPointCloud(), ccPointCloud::hasScalarFields(), and isFirstSelectedCcPointCloud().
Referenced by ExtractSIFT::checkSelected().
| int BasePclModule::hasSelectedScalarField | ( | std::string | field_name | ) |
Returns 1 if the first selected entity has a scalar field with name field_name
Definition at line 326 of file BasePclModule.cpp.
References cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), getSelectedEntityAsCCPointCloud(), and result.
|
protectedvirtual |
Initializes the corresponding action.
Action can be retrieved with getAction.
Definition at line 44 of file BasePclModule.cpp.
References getEntryName(), getIcon(), getStatusTip(), m_action, and performAction().
Referenced by BasePclModule().
| int BasePclModule::isFirstSelectedCcPointCloud | ( | ) |
Returns 1 if the first selected object is a ccPointCloud.
Definition at line 358 of file BasePclModule.cpp.
References m_selected, and CV_TYPES::POINT_CLOUD.
Referenced by ExtractSIFT::checkSelected(), CorrespondenceMatching::checkSelected(), TemplateAlignment::checkSelected(), DONSegmentation::checkSelected(), EuclideanClusterSegmentation::checkSelected(), MinimumCutSegmentation::checkSelected(), RegionGrowingSegmentation::checkSelected(), SACSegmentation::checkSelected(), ConvexConcaveHullReconstruction::checkSelected(), GreedyTriangulation::checkSelected(), MarchingCubeReconstruction::checkSelected(), NurbsCurveFitting::checkSelected(), NurbsSurfaceReconstruction::checkSelected(), PoissonReconstruction::checkSelected(), hasSelectedRGB(), and hasSelectedScalarField().
|
signal |
Signal emitted when a new entity is created by the filter.
Referenced by qPCL::addPclModule(), ExtractSIFT::compute(), GeneralFilters::compute(), MLSSmoothingUpsampling::compute(), ProjectionFilter::compute(), StatisticalOutliersRemover::compute(), CorrespondenceMatching::compute(), TemplateAlignment::compute(), DONSegmentation::compute(), EuclideanClusterSegmentation::compute(), MinimumCutSegmentation::compute(), RegionGrowingSegmentation::compute(), SACSegmentation::compute(), ConvexConcaveHullReconstruction::compute(), GreedyTriangulation::compute(), MarchingCubeReconstruction::compute(), NurbsCurveFitting::compute(), NurbsSurfaceReconstruction::compute(), and PoissonReconstruction::compute().
|
signal |
Signal emitted when a new error message is produced.
Referenced by qPCL::addPclModule(), and throwError().
|
inlineprotectedvirtual |
Opens the input dialog window. Where the user can supply parameters for the computation Automatically called by performAction. Does nothing by default. Must be overridden if a dialog must be displayed.
Reimplemented in PoissonReconstruction, NurbsSurfaceReconstruction, NurbsCurveFitting, MarchingCubeReconstruction, GreedyTriangulation, ConvexConcaveHullReconstruction, SACSegmentation, RegionGrowingSegmentation, MinimumCutSegmentation, EuclideanClusterSegmentation, DONSegmentation, TemplateAlignment, CorrespondenceMatching, StatisticalOutliersRemover, ProjectionFilter, MLSSmoothingUpsampling, GeneralFilters, NormalEstimation, and ExtractSIFT.
Definition at line 215 of file BasePclModule.h.
Referenced by performAction().
|
inlineprotectedvirtual |
Opens the output dialog window. To be used when the computations have output to be shown in a dedicated dialog (as plots, histograms, etc) Automatically called by performAction. Does nothing by default. Must be overridden if a output dialog must be displayed.
Definition at line 225 of file BasePclModule.h.
Referenced by performAction().
|
protectedslot |
Returns is called when the dialog window is accepted.
it can be overridden but normally should not be necessary the parameters will be retrieved from the dialog via the getParametersFromDialog() method this always need to be overridden. Called when action is triggered
Definition at line 68 of file BasePclModule.cpp.
References ccHObject::applyGLTransformation_recursive(), checkParameters(), checkSelected(), getParametersFromDialog(), ccHObject::getViewId(), m_app, m_selected, openInputDialog(), openOutputDialog(), CV_TYPES::POINT_CLOUD, ecvMainAppInterface::putObjectBackIntoDBTree(), ecvDisplayTools::RedrawDisplay(), ecvDisplayTools::RemoveBB(), ecvMainAppInterface::removeObjectTemporarilyFromDBTree(), ccHObject::setRedrawFlagRecursive(), ecvDisplayTools::SetRedrawRecursive(), start(), throwError(), and ccHObjectCaster::ToPointCloud().
Referenced by initAction().
|
inline |
Sets associated CC application interface (to access DB)
Definition at line 161 of file BasePclModule.h.
References m_app.
Referenced by qPCL::addPclModule().
|
inline |
Sets whether to show a progressbar while computing or not.
Definition at line 95 of file BasePclModule.h.
References m_show_progress.
|
protectedvirtual |
Starts computation.
Automatically called by performAction. By default, baseclass method simply calls compute Can be overridden if needed (e.g. a pre-processing step before compute())
Definition at line 162 of file BasePclModule.cpp.
References doCompute(), getModuleName(), m_show_progress, s_computeStatus, s_computing, s_module, cloudViewer::utility::Sleep(), and throwError().
Referenced by performAction().
|
protected |
Emits the error corresponding to a given error code (see newErrorMessage) Error messages are retrieved from getErrorMessage() and getFilterErrorMessage()
| errCode | Error code (identifies a given error message) |
Definition at line 53 of file BasePclModule.cpp.
References getErrorMessage(), and newErrorMessage().
Referenced by performAction(), and start().
|
virtual |
Updates the internal copy of selected entities.
'selectedEntities' is a vector of pointers to selected entities.
Definition at line 61 of file BasePclModule.cpp.
References checkSelected(), m_action, and m_selected.
|
protected |
Forces the Ui to be updated.
Simply calls m_q_parent->UpdateUI(); The filter action (created by initAction)
Definition at line 269 of file BasePclModule.h.
Referenced by getAction(), initAction(), and updateSelectedEntities().
|
protected |
Associated application interface.
Definition at line 296 of file BasePclModule.h.
Referenced by DONSegmentation::compute(), EuclideanClusterSegmentation::compute(), SACSegmentation::compute(), getAllEntitiesOfType(), getMainAppInterface(), CorrespondenceMatching::getParametersFromDialog(), TemplateAlignment::getParametersFromDialog(), FastGlobalRegistrationFilter::getParametersFromDialog(), ExtractSIFT::openInputDialog(), NormalEstimation::openInputDialog(), GeneralFilters::openInputDialog(), MLSSmoothingUpsampling::openInputDialog(), ProjectionFilter::openInputDialog(), StatisticalOutliersRemover::openInputDialog(), CorrespondenceMatching::openInputDialog(), TemplateAlignment::openInputDialog(), DONSegmentation::openInputDialog(), EuclideanClusterSegmentation::openInputDialog(), MinimumCutSegmentation::openInputDialog(), RegionGrowingSegmentation::openInputDialog(), SACSegmentation::openInputDialog(), ConvexConcaveHullReconstruction::openInputDialog(), GreedyTriangulation::openInputDialog(), MarchingCubeReconstruction::openInputDialog(), NurbsCurveFitting::openInputDialog(), NurbsSurfaceReconstruction::openInputDialog(), PoissonReconstruction::openInputDialog(), performAction(), and setMainAppInterface().
|
protected |
Associated dialog.
Created inside the derived class constructor Filter information Contains all informations about the given filter, as name etc.. Passed to the BasePclModule class constructor.
Definition at line 293 of file BasePclModule.h.
Referenced by getEntryName(), getIcon(), getModuleName(), and getStatusTip().
|
protected |
associated parent plugin of the filter
Definition at line 299 of file BasePclModule.h.
Referenced by BasePclModule(), and getParentPlugin().
|
protected |
Pointer to the main window.
Used for accessing qCC functionalities from filters Currently selected entities Updated using updateSelectedEntities()
Definition at line 281 of file BasePclModule.h.
Referenced by checkSelected(), FastGlobalRegistrationFilter::checkSelected(), FastGlobalRegistrationFilter::getParametersFromDialog(), getSelectedEntitiesThatAre(), getSelectedEntitiesThatAreCCPointCloud(), getSelectedEntityAsCCHObject(), getSelectedEntityAsCCPointCloud(), getSelectedThatHaveMetaData(), isFirstSelectedCcPointCloud(), performAction(), and updateSelectedEntities().
|
protected |
Do we want to show a progress bar when the filter works?
Definition at line 302 of file BasePclModule.h.
Referenced by setShowProgressBar(), and start().