![]() |
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.
| 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) |
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 TemplateAlignment, ExtractSIFT, CorrespondenceMatching, DONSegmentation, EuclideanClusterSegmentation, MinimumCutSegmentation, RegionGrowingSegmentation, SACSegmentation, ConvexConcaveHullReconstruction, GreedyTriangulation, MarchingCubeReconstruction, NurbsCurveFitting, NurbsSurfaceReconstruction, PoissonReconstruction, GeneralFilters, and ProjectionFilter.
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, TemplateAlignment, ExtractSIFT, CorrespondenceMatching, DONSegmentation, EuclideanClusterSegmentation, MinimumCutSegmentation, RegionGrowingSegmentation, SACSegmentation, ConvexConcaveHullReconstruction, GreedyTriangulation, MarchingCubeReconstruction, NurbsCurveFitting, NurbsSurfaceReconstruction, and PoissonReconstruction.
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, TemplateAlignment, MLSSmoothingUpsampling, GeneralFilters, ExtractSIFT, CorrespondenceMatching, DONSegmentation, EuclideanClusterSegmentation, MinimumCutSegmentation, RegionGrowingSegmentation, SACSegmentation, ConvexConcaveHullReconstruction, GreedyTriangulation, MarchingCubeReconstruction, NurbsCurveFitting, NurbsSurfaceReconstruction, PoissonReconstruction, ProjectionFilter, NormalEstimation, and StatisticalOutliersRemover.
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.
References m_action.
| void BasePclModule::getAllEntitiesOfType | ( | CV_CLASS_ENUM | type, |
| ccHObject::Container & | entities | ||
| ) |
Returns all the objects in db tree of type "type".
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.
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
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, TemplateAlignment, ExtractSIFT, GeneralFilters, CorrespondenceMatching, DONSegmentation, EuclideanClusterSegmentation, MinimumCutSegmentation, RegionGrowingSegmentation, SACSegmentation, ConvexConcaveHullReconstruction, GreedyTriangulation, MarchingCubeReconstruction, NurbsCurveFitting, NurbsSurfaceReconstruction, PoissonReconstruction, and ProjectionFilter.
References getModuleName().
Referenced by ProjectionFilter::getErrorMessage(), PoissonReconstruction::getErrorMessage(), NurbsSurfaceReconstruction::getErrorMessage(), ExtractSIFT::getErrorMessage(), MarchingCubeReconstruction::getErrorMessage(), DONSegmentation::getErrorMessage(), ConvexConcaveHullReconstruction::getErrorMessage(), NurbsCurveFitting::getErrorMessage(), RegionGrowingSegmentation::getErrorMessage(), MinimumCutSegmentation::getErrorMessage(), EuclideanClusterSegmentation::getErrorMessage(), GeneralFilters::getErrorMessage(), GreedyTriangulation::getErrorMessage(), SACSegmentation::getErrorMessage(), CorrespondenceMatching::getErrorMessage(), TemplateAlignment::getErrorMessage(), FastGlobalRegistrationFilter::getErrorMessage(), and throwError().
| QIcon BasePclModule::getIcon | ( | ) | const |
Returns the icon associated with the button.
References m_desc, and PclModuleDescription::m_icon.
Referenced by initAction().
|
inline |
Returns associated CC application interface for accessing to some of mainWindow methods
References m_app.
| QString BasePclModule::getModuleName | ( | ) | const |
Returns the name of the filter.
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, TemplateAlignment, GeneralFilters, ExtractSIFT, CorrespondenceMatching, DONSegmentation, EuclideanClusterSegmentation, MinimumCutSegmentation, RegionGrowingSegmentation, SACSegmentation, ConvexConcaveHullReconstruction, GreedyTriangulation, MarchingCubeReconstruction, NurbsCurveFitting, NurbsSurfaceReconstruction, PoissonReconstruction, MLSSmoothingUpsampling, ProjectionFilter, NormalEstimation, and StatisticalOutliersRemover.
Referenced by performAction().
|
inline |
Returns the associated parent plugin interface.
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.
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
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
References ccObject::isA(), m_selected, and CV_TYPES::POINT_CLOUD.
| ccHObject * BasePclModule::getSelectedEntityAsCCHObject | ( | ) | const |
Returns the first selected entity as a ccHObject.
References m_selected.
| ccPointCloud * BasePclModule::getSelectedEntityAsCCPointCloud | ( | ) | const |
Returns the first selected entity as a ccPointCloud.
References ccObject::isA(), m_selected, CV_TYPES::POINT_CLOUD, and ccHObjectCaster::ToPointCloud().
Referenced by NormalEstimation::compute(), StatisticalOutliersRemover::compute(), ProjectionFilter::compute(), RegionGrowingSegmentation::compute(), NurbsCurveFitting::compute(), MarchingCubeReconstruction::compute(), SACSegmentation::compute(), ConvexConcaveHullReconstruction::compute(), GreedyTriangulation::compute(), DONSegmentation::compute(), ExtractSIFT::compute(), EuclideanClusterSegmentation::compute(), NurbsSurfaceReconstruction::compute(), PoissonReconstruction::compute(), MinimumCutSegmentation::compute(), GeneralFilters::compute(), MLSSmoothingUpsampling::compute(), getSelectedAvailableScalarFields(), hasSelectedRGB(), hasSelectedScalarField(), NormalEstimation::openInputDialog(), RegionGrowingSegmentation::openInputDialog(), GreedyTriangulation::openInputDialog(), MinimumCutSegmentation::openInputDialog(), PoissonReconstruction::openInputDialog(), and MarchingCubeReconstruction::openInputDialog().
| ccHObject::Container BasePclModule::getSelectedThatHaveMetaData | ( | const QString | key | ) | const |
Get selected object that also have the provided metadata key.
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
References m_desc, and PclModuleDescription::m_status_tip.
Referenced by initAction().
| int BasePclModule::hasSelectedRGB | ( | ) |
Returns 1 if the first selected entity has RGB info.
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.
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
References cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), getSelectedEntityAsCCPointCloud(), and result.
|
protectedvirtual |
Initializes the corresponding action.
Action can be retrieved with getAction.
References getEntryName(), getIcon(), getStatusTip(), m_action, and performAction().
Referenced by BasePclModule().
| int BasePclModule::isFirstSelectedCcPointCloud | ( | ) |
Returns 1 if the first selected object is a ccPointCloud.
References m_selected, and CV_TYPES::POINT_CLOUD.
Referenced by ExtractSIFT::checkSelected(), CorrespondenceMatching::checkSelected(), NurbsSurfaceReconstruction::checkSelected(), NurbsCurveFitting::checkSelected(), MarchingCubeReconstruction::checkSelected(), MinimumCutSegmentation::checkSelected(), ConvexConcaveHullReconstruction::checkSelected(), PoissonReconstruction::checkSelected(), RegionGrowingSegmentation::checkSelected(), SACSegmentation::checkSelected(), EuclideanClusterSegmentation::checkSelected(), GreedyTriangulation::checkSelected(), DONSegmentation::checkSelected(), TemplateAlignment::checkSelected(), hasSelectedRGB(), and hasSelectedScalarField().
|
signal |
Signal emitted when a new entity is created by the filter.
Referenced by qPCL::addPclModule(), StatisticalOutliersRemover::compute(), ProjectionFilter::compute(), NurbsSurfaceReconstruction::compute(), PoissonReconstruction::compute(), MarchingCubeReconstruction::compute(), EuclideanClusterSegmentation::compute(), ConvexConcaveHullReconstruction::compute(), NurbsCurveFitting::compute(), RegionGrowingSegmentation::compute(), MinimumCutSegmentation::compute(), DONSegmentation::compute(), ExtractSIFT::compute(), GreedyTriangulation::compute(), SACSegmentation::compute(), CorrespondenceMatching::compute(), GeneralFilters::compute(), MLSSmoothingUpsampling::compute(), and TemplateAlignment::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 TemplateAlignment, ExtractSIFT, GeneralFilters, CorrespondenceMatching, DONSegmentation, EuclideanClusterSegmentation, MinimumCutSegmentation, RegionGrowingSegmentation, SACSegmentation, ConvexConcaveHullReconstruction, GreedyTriangulation, MarchingCubeReconstruction, NurbsCurveFitting, NurbsSurfaceReconstruction, PoissonReconstruction, MLSSmoothingUpsampling, ProjectionFilter, NormalEstimation, and StatisticalOutliersRemover.
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.
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
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)
References m_app.
|
inline |
Sets whether to show a progressbar while computing or not.
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())
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) |
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.
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)
Referenced by getAction(), initAction(), and updateSelectedEntities().
|
protected |
Associated application interface.
Referenced by DONSegmentation::compute(), EuclideanClusterSegmentation::compute(), SACSegmentation::compute(), getAllEntitiesOfType(), getMainAppInterface(), CorrespondenceMatching::getParametersFromDialog(), TemplateAlignment::getParametersFromDialog(), FastGlobalRegistrationFilter::getParametersFromDialog(), StatisticalOutliersRemover::openInputDialog(), NormalEstimation::openInputDialog(), MLSSmoothingUpsampling::openInputDialog(), ProjectionFilter::openInputDialog(), GeneralFilters::openInputDialog(), SACSegmentation::openInputDialog(), NurbsCurveFitting::openInputDialog(), GreedyTriangulation::openInputDialog(), NurbsSurfaceReconstruction::openInputDialog(), CorrespondenceMatching::openInputDialog(), DONSegmentation::openInputDialog(), MarchingCubeReconstruction::openInputDialog(), ExtractSIFT::openInputDialog(), EuclideanClusterSegmentation::openInputDialog(), MinimumCutSegmentation::openInputDialog(), PoissonReconstruction::openInputDialog(), ConvexConcaveHullReconstruction::openInputDialog(), RegionGrowingSegmentation::openInputDialog(), TemplateAlignment::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.
Referenced by getEntryName(), getIcon(), getModuleName(), and getStatusTip().
|
protected |
associated parent plugin of the filter
Referenced by BasePclModule(), and getParentPlugin().
|
protected |
Pointer to the main window.
Used for accessing qCC functionalities from filters Currently selected entities Updated using updateSelectedEntities()
Referenced by FastGlobalRegistrationFilter::checkSelected(), 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?
Referenced by setShowProgressBar(), and start().