MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLCSO/CSOBase/CSOModuleBase/CSOModificator.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00009 //----------------------------------------------------------------------------------
00010 
00011 #ifndef __CSOModificator_H
00012 #define __CSOModificator_H
00013 
00014 #include "CSOGenerator.h"
00015 
00016 
00017 ML_START_NAMESPACE
00018 
00020 
00022 class MLCSO_EXPORT CSOModificator : public CSOGenerator
00023 { 
00024 
00025 public:
00026 
00028   CSOModificator(const std::string& type="CSOModificator", int numInImages=0,int numOutImages=0);
00029 
00030 protected:
00031 
00033   virtual ~CSOModificator();
00034 
00036   virtual void activateAttachments();
00037 
00039   virtual void handleNotification(Field* field);
00040 
00042   virtual void reset();
00043 
00047   virtual void process();
00048 
00050   virtual void _setupCSOList();
00051 
00059   virtual bool _applyModificator();
00060 
00062   virtual void _notifyObservers();
00063 
00064 protected:
00065 
00066   /* FIELDS */
00067 
00069   BaseField* _inputCSOListFld;
00071   BaseField* _outputCSOListFld;
00072 
00075   StringField* _csoIdListFld;
00076 
00079   BoolField* _workDirectlyOnInputListFld;
00080 
00082   BoolField* _listenToFinishingNotificationsFld;
00084   BoolField* _listenToSelectionNotificationsFld;
00085 
00087   BoolField* _changeSettingsForModifiedCSOsFld;
00088 
00089   /* MEMBER VARIABLES */
00090 
00092   CSOList* _inCSOList;
00094   CSOListPtr _outCSOList;
00096   bool _isInNotificationCB;
00098   bool _isNotifyingMyself;
00099 
00101   std::set<unsigned int> _parsedIDs;
00103   bool _parsedIDsValid;
00104 
00106   bool _didSomething;
00107 
00111   bool _outCSOListChanged;
00112 
00114   bool _isOutputCSOListOwner;
00116   bool _isWorkingDirectlyOnInputCSOList;
00117 
00118   /* METHODS */
00119 
00122   bool _isInIdList(CSO *cso);
00123 
00125   void _parseCSOIds(std::set<unsigned int>& ids);
00126 
00128   void _applyChangedSettings(CSO* cso) const;
00129 
00131   static void _csoListNotifyObserverCB(void* userData, int notificationFlag);
00132 
00133   ML_MODULE_CLASS_HEADER(CSOModificator);
00134 };
00135 
00136 ML_END_NAMESPACE
00137 
00138 #endif // __CSOModificator_H
00139 
00140 
00141