MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLCSO/CSOBase/CSOModuleBase/CSOGenerator.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00009 //----------------------------------------------------------------------------------
00010 
00011 #ifndef __CSOGenerator_H
00012 #define __CSOGenerator_H
00013 
00014 #include "CSOBaseModule.h"
00015 #include "CSOGeneratorBase.h"
00016 
00017 ML_START_NAMESPACE
00018 
00024 class MLCSO_EXPORT CSOGenerator : public CSOBaseModule, public CSOGeneratorBase
00025 {
00026 
00027 public:
00028 
00030   CSOGenerator(std::string type="CSOGenerator", int numInImg=0, int numOutImg=0);
00031 
00033   inline std::string getType() const { return _type; }
00034 
00036   static const char* addCSOToGroupModeStrings[3];
00037 
00038 protected:
00039 
00040   /* FIELDS */
00041 
00044   BoolField* _emptyGroupBeforeGenerationFld;
00045     
00047   EnumField* _addCSOToGroupMode;
00048 
00051   StringField* _addCSOToGroupWithLabelFld;
00052 
00055   IntField* _addCSOToGroupWithIdFld;
00056 
00059   IntField*    _idFld;
00060 
00062   EnumField* _pathPointStyleFld;
00064   FloatField* _pathPointWidthFld;
00066   ColorField* _pathPointColorFld;
00068   FloatField* _pathPointAlphaFld;
00069 
00071   EnumField* _seedPointStyleFld;
00073   FloatField* _seedPointSizeFld;
00075   ColorField* _seedPointColorFld;
00077   FloatField* _seedPointAlphaFld;
00078 
00080   EnumField* _voxelWriteModeFld;
00082   FloatField* _voxelWriteValueFld;
00083 
00084 
00085   /* MEMBER VARIABLES */
00086 
00087 
00088   /* METHODS */
00089 
00090   // The indirection of the following three methods is not really necessary, we
00091   // could call those methods implemented in CSOGeneratorBase directly where needed.
00092 
00093   // The indirection is here because we do not want to change all calls in all
00094   // other modules (which may be implemented by external colleagues).
00095 
00096 
00105   CSO* _addCSO(CSOList* csoList, std::string groupLabel, bool useUndoRedo=true) { return generatorAddCSO(csoList, groupLabel, useUndoRedo); }
00107   CSOGroup* _getParentGroup(CSOList* csoList, bool useUndoRedo=false, bool generate=false) { return generatorGetParentGroup(csoList, useUndoRedo, generate); }
00109   void _emptyGroupOnDemand(CSOList* csoList) { generatorEmptyGroupOnDemand(csoList); }
00110 
00112   virtual int getModuleCreatorId() const { return _idFld->getIntValue(); }
00114   virtual std::string getModuleType() const { return getType(); }
00115 
00118   virtual bool getShouldEmptyBeforeGeneration() const { return _emptyGroupBeforeGenerationFld->getBoolValue(); }
00120   virtual int getAddCSOToGroupMode() const { return _addCSOToGroupMode->getEnumValue(); }
00122   virtual std::string getAddCSOToGroupLabel() const { return _addCSOToGroupWithLabelFld->getStringValue(); }
00124   virtual int getAddCSOToGroupId() const { return _addCSOToGroupWithIdFld->getIntValue(); }
00125 
00127   virtual int getDefaultPathPointStyle() const { return _pathPointStyleFld->getEnumValue(); }
00129   virtual float getDefaultPathPointWidth() const { return _pathPointWidthFld->getFloatValue(); }
00131   virtual Vector3 getDefaultPathPointColor() const { return _pathPointColorFld->getVector3Value(); }
00133   virtual float getDefaultPathPointAlpha() const { return _pathPointAlphaFld->getFloatValue(); }
00134 
00136   virtual int getDefaultSeedPointStyle() const { return _seedPointStyleFld->getEnumValue(); }
00138   virtual float getDefaultSeedPointSize() const { return _seedPointSizeFld->getFloatValue(); }
00140   virtual Vector3 getDefaultSeedPointColor() const { return _seedPointColorFld->getVector3Value(); }
00142   virtual float getDefaultSeedPointAlpha() const { return _seedPointAlphaFld->getFloatValue(); }
00143 
00145   virtual int getDefaultVoxelWriteMode() const { return _voxelWriteModeFld->getEnumValue(); }
00147   virtual float getDefaultVoxelWriteValue() const { return _voxelWriteValueFld->getFloatValue(); }
00148 
00150   virtual ~CSOGenerator();
00151 
00152 private:
00153 
00154   ML_MODULE_CLASS_HEADER(CSOGenerator);
00155 };
00156 
00158 
00159 
00160 ML_END_NAMESPACE
00161 
00162 #endif // __CSOInteraction_H
00163