X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBox.h;h=3f9fe828fda88ede3f4b63b0d1be7d9237d1932c;hb=cb74ad8d12e03d219df87c69f6caef29afee4cfc;hp=d5f06710ffda4b87718702077d48b425c4f0edd2;hpb=93d88be3faa40557ad9279e2f32b2f9518fa839f;p=bbtk.git diff --git a/kernel/src/bbtkBlackBox.h b/kernel/src/bbtkBlackBox.h index d5f0671..3f9fe82 100644 --- a/kernel/src/bbtkBlackBox.h +++ b/kernel/src/bbtkBlackBox.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBox.h,v $ Language: C++ - Date: $Date: 2008/04/21 12:43:05 $ - Version: $Revision: 1.7 $ + Date: $Date: 2008/06/19 09:46:41 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -43,6 +43,7 @@ namespace bbtk struct Void { Void(int = 0) {} }; class Factory; + class Connection; class BBTK_EXPORT BlackBox : public Object { @@ -66,7 +67,6 @@ namespace bbtk virtual BlackBox::Pointer bbClone(const std::string& name) = 0; /// User overloadable destruction method of a black box - /// UNUSED FOR THE MOMENT virtual void bbUserDelete(); /// Returns the Name of the Type of the BlackBox @@ -83,8 +83,6 @@ namespace bbtk /// Returns the name with the name of the parent prepended if any virtual std::string bbGetNameWithParent() const; - /// Sets the parent of the BlackBox - void bbSetParent(BlackBox::Pointer p) { bbmParent = p; } /// Returns the parent of the BlackBox, i.e the BlackBox that contains it (0 if none) BlackBox::Pointer bbGetParent() const { return bbmParent.lock(); } @@ -146,18 +144,6 @@ bool reaction = true); /// Sets the data of the output called virtual void bbSetOutput( const std::string &name, Data data) = 0; - /// Connects the input to the connection c - virtual void bbConnectInput( const std::string& name, - Connection::Pointer c); - /// Connects the output to the connection c - virtual void bbConnectOutput( const std::string& name, - Connection::Pointer c); - /// Disconnects the input from the connection c - virtual void bbDisconnectInput( const std::string& name, - Connection::Pointer c); - /// Disconnects the output from the connection c - virtual void bbDisconnectOutput( const std::string& name, - Connection::Pointer c); /// Returns the input connectors map InputConnectorMapType& bbGetInputConnectorMap() @@ -251,6 +237,10 @@ bool reaction = true); virtual void Check(bool recursive = true); + virtual void bbUserOnShow() { } + void bbUserOnShowWidget(std::string nameInput); + + protected: //================================================================== // PROTECTED PART : ACCESSIBLE TO THE BlackBox DEVELOPER @@ -267,6 +257,27 @@ bool reaction = true); void bbSetStatus( IOStatus t) { bbmStatus = t; } //================================================================== + private: + friend class Connection; + friend class ComplexBlackBox; + + /// Sets the parent of the BlackBox + void bbSetParent(BlackBox::Pointer p) { bbmParent = p; } + + + /// Connects the input to the connection c + virtual void bbConnectInput( const std::string& name, + Connection* c); + /// Connects the output to the connection c + virtual void bbConnectOutput( const std::string& name, + Connection* c); + /// Disconnects the input from the connection c + virtual void bbDisconnectInput( const std::string& name, + Connection* c); + /// Disconnects the output from the connection c + virtual void bbDisconnectOutput( const std::string& name, + Connection* c); + /// @name Pipeline processing methods @@ -291,7 +302,7 @@ bool reaction = true); /// - calls bbProcess which is the user callback which does the actual processing /// - calls bbUpdateChildren /// - calls bbShowWidget which shows the widget associated to the box (if any) - public: + protected: virtual IOStatus bbBackwardUpdate(Connection::Pointer caller) = 0; //================================================================== @@ -331,8 +342,9 @@ bool reaction = true); /// (called after bbProcess during bbExecute) /// Does nothing here but overloaded in WxBlackBox and WxContainerBlackBox virtual void bbShowWindow(Connection::Pointer caller) { } - + virtual void bbHideWindow() {} + virtual void bbCloseWindow() { } //================================================================== //@} @@ -348,7 +360,7 @@ bool reaction = true); /// which means execute in response to an input change virtual bool bbCanReact() const; - + protected: static void bbGlobalAddToExecutionList( BlackBox::Pointer b ); static void bbGlobalProcessExecutionList(); @@ -370,7 +382,7 @@ bool reaction = true); /// Black box deleter /// 1) Calls the user overloadable bbDelete method /// 2) Releases the box descriptor - struct Deleter : public Object::Deleter + struct BBTK_EXPORT Deleter : public Object::Deleter { Deleter(); void Delete(Object* p);