SignElement.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * Program:   Slicer Image-Guided Navigator (The SIGN)
00004  * Module:    $RCSfile: SignElement.h,v $
00005  */
00013 #ifndef _SIGNELEMENT_H
00014 #define _SIGNELEMENT_H
00015 
00016 #include <vector>
00017 #include <map>
00018 #include <vtkObject.h>
00019 
00020 #include <SignDLL.h>
00021 
00022 class SignContext;
00023 class SignElement;
00024 class SignCompositeWidget;
00025 
00026 typedef std::map<SignElement*,bool> ElementFlagMap;
00027 typedef std::vector<SignElement*> ElementVector;
00028 
00029 class SIGN_EXPORT SignElement : public vtkObject
00030 {
00031   friend class SignElementPreviousButton;
00032 
00033  public:
00034   vtkTypeRevisionMacro(SignElement,vtkObject);
00035 
00037         void SetContext(SignContext*);
00038 
00040         bool CheckInputs();
00041 
00043         virtual bool ActivateElement()=0;
00045   virtual bool DeActivateElement() {return false;}
00046 
00048         void AddInput(SignElement* element, bool status=false);
00049 
00051         void AddToDeactivateList(SignElement *element);
00052 
00054         bool IsActive();
00055 
00057         bool IsCheckPoint();
00059   void IsCheckPoint(bool val);
00060 
00062         std::string GetTitle();
00064   void SetTitle(std::string title_);
00066   SignCompositeWidget* GetWidget();
00067 
00068 
00069  protected:
00070   SignElement();
00071   ~SignElement();
00072 
00073   SignContext* context;
00074 
00075   void Complete();
00076   void DeComplete();
00077 
00078 
00079   static void OnElementReady(vtkObject *caller,unsigned long event, void* data,void*calldata);
00080   static void OnElementNotReady(vtkObject *caller,unsigned long event, void* data,void*calldata);
00081 
00082   SignElement(const SignElement&);  // Not implemented.
00083   void operator=(const SignElement&);  // Not implemented.
00084 
00085   bool active;
00086   SignCompositeWidget* widget;
00087   bool ischeckpoint;
00088 
00089  private:
00090   ElementFlagMap InputElements;
00091   ElementVector OutputElements;
00092   ElementVector ObsoleteWhenReady;
00093   std::string title;
00094 };
00095 
00096 #endif

Generated on Mon Feb 26 12:11:16 2007 for TheSIGN by  doxygen 1.4.6