Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef ABSTRACT_TOOL_H_
00039 #define ABSTRACT_TOOL_H_
00040
00041 #include <pcl/apps/cloud_composer/qt.h>
00042 #include <pcl/apps/cloud_composer/commands.h>
00043 #include <pcl/apps/cloud_composer/items/cloud_item.h>
00044 #include <pcl/apps/cloud_composer/properties_model.h>
00045
00046 namespace pcl
00047 {
00048 namespace cloud_composer
00049 {
00050
00051
00052 class AbstractTool : public QObject
00053 {
00054 Q_OBJECT
00055 public:
00056
00057 AbstractTool (PropertiesModel* parameter_model, QObject* parent);
00058
00059 virtual ~AbstractTool () { qDebug() << "Tool Destructed"; }
00060
00066 virtual QList <CloudComposerItem*>
00067 performAction (QList <const CloudComposerItem*> input_data, PointTypeFlags::PointType type = PointTypeFlags::NONE) = 0;
00068
00069 virtual CloudCommand*
00070 createCommand (QList <const CloudComposerItem*> input_data) = 0;
00071
00072 QString
00073 getActionText () const {return action_text_;}
00074
00075 void
00076 setActionText (const QString text) { action_text_ = text; }
00077
00078 virtual QString
00079 getToolName () const = 0;
00080
00081 protected:
00082
00083 PropertiesModel* parameter_model_;
00084
00085 private:
00086 QString action_text_;
00087
00088 };
00089
00090 class ModifyItemTool : public AbstractTool
00091 {
00092 Q_OBJECT
00093 public:
00094 ModifyItemTool (PropertiesModel* parameter_model, QObject* parent)
00095 : AbstractTool (parameter_model, parent)
00096 {}
00097
00098 virtual ~ModifyItemTool () { }
00099
00100 virtual QList <CloudComposerItem*>
00101 performAction (QList <const CloudComposerItem*> input_data, PointTypeFlags::PointType type = PointTypeFlags::NONE) = 0;
00102
00103 inline virtual CloudCommand*
00104 createCommand (QList <const CloudComposerItem*> input_data)
00105 {
00106 return new ModifyItemCommand (input_data);
00107 }
00108
00109 inline virtual QString
00110 getToolName () const { return "ModifyItemTool";}
00111
00112 };
00113
00114 class NewItemTool : public AbstractTool
00115 {
00116 Q_OBJECT
00117 public:
00118 NewItemTool (PropertiesModel* parameter_model, QObject* parent)
00119 : AbstractTool (parameter_model, parent)
00120 {}
00121
00122 virtual ~NewItemTool () { }
00123
00124 virtual QList <CloudComposerItem*>
00125 performAction (QList <const CloudComposerItem*> input_data, PointTypeFlags::PointType type = PointTypeFlags::NONE) = 0;
00126
00127 inline virtual CloudCommand*
00128 createCommand (QList <const CloudComposerItem*> input_data)
00129 {
00130 return new NewItemCloudCommand (input_data);
00131 }
00132
00133 inline virtual QString
00134 getToolName () const { return "NewItemTool";}
00135
00136 };
00137
00138 class SplitItemTool : public AbstractTool
00139 {
00140 Q_OBJECT
00141 public:
00142 SplitItemTool (PropertiesModel* parameter_model, QObject* parent)
00143 : AbstractTool (parameter_model, parent)
00144 {}
00145
00146 virtual ~SplitItemTool () { }
00147
00148 virtual QList <CloudComposerItem*>
00149 performAction (QList <const CloudComposerItem*> input_data, PointTypeFlags::PointType type = PointTypeFlags::NONE) = 0;
00150
00151 inline virtual CloudCommand*
00152 createCommand (QList <const CloudComposerItem*> input_data)
00153 {
00154 return new SplitCloudCommand (input_data);
00155 }
00156
00157 inline virtual QString
00158 getToolName () const { return "SplitItemTool";}
00159
00160 };
00161
00162 class MergeCloudTool : public AbstractTool
00163 {
00164 Q_OBJECT
00165 public:
00166 MergeCloudTool (PropertiesModel* parameter_model, QObject* parent)
00167 : AbstractTool (parameter_model, parent)
00168 {}
00169
00170 virtual ~MergeCloudTool () { }
00171
00172 virtual QList <CloudComposerItem*>
00173 performAction (QList <const CloudComposerItem*> input_data, PointTypeFlags::PointType type = PointTypeFlags::NONE) = 0;
00174
00175 inline virtual CloudCommand*
00176 createCommand (QList <const CloudComposerItem*> input_data)
00177 {
00178 return new MergeCloudCommand (input_data);
00179 }
00180
00181 inline virtual QString
00182 getToolName () const { return "MergeCloudTool";}
00183
00184 };
00185 }
00186 }
00187
00188
00189 #endif //ABSTRACT_TOOL_H_