ctkVTKObjectEventsObserver.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Library:   CTK
00004  
00005   Copyright (c) 2010  Kitware Inc.
00006 
00007   Licensed under the Apache License, Version 2.0 (the "License");
00008   you may not use this file except in compliance with the License.
00009   You may obtain a copy of the License at
00010 
00011       http://www.commontk.org/LICENSE
00012 
00013   Unless required by applicable law or agreed to in writing, software
00014   distributed under the License is distributed on an "AS IS" BASIS,
00015   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016   See the License for the specific language governing permissions and
00017   limitations under the License.
00018  
00019 =========================================================================*/
00020 
00021 #ifndef __ctkVTKObjectEventsObserver_h
00022 #define __ctkVTKObjectEventsObserver_h
00023 
00025 #include <ctkPimpl.h>
00026 
00028 #include <QObject>
00029 #include <QList>
00030 #include <QString>
00031 
00033 #include <vtkCommand.h>
00034 
00035 #include "CTKVisualizationVTKCoreExport.h"
00036 
00037 class ctkVTKConnection;
00038 class vtkObject;
00039 class ctkVTKObjectEventsObserverPrivate;
00040 
00041 class CTK_VISUALIZATION_VTK_CORE_EXPORT ctkVTKObjectEventsObserver : public QObject
00042 {
00043 Q_OBJECT
00044 
00045 public:
00046   typedef QObject Superclass;
00047   explicit ctkVTKObjectEventsObserver(QObject* parent = 0);
00048   virtual ~ctkVTKObjectEventsObserver(){}
00049 
00050   virtual void printAdditionalInfo();
00051 
00054   void setAllEnabled( bool enable );
00055   bool allEnabled()const;
00056 
00059   QString addConnection(vtkObject* vtk_obj, unsigned long vtk_event,
00060     const QObject* qt_obj, const char* qt_slot, float priority = 0.0);
00061 
00065   QString addConnection(vtkObject* old_vtk_obj, vtkObject* vtk_obj, unsigned long vtk_event,
00066     const QObject* qt_obj, const char* qt_slot, float priority = 0.0);
00067 
00071   QString reconnection(vtkObject* vtk_obj, unsigned long vtk_event,
00072                        const QObject* qt_obj, const char* qt_slot, 
00073                        float priority = 0.0);
00074 
00077   int removeConnection(vtkObject* vtk_obj, unsigned long vtk_event = vtkCommand::NoEvent,
00078                        const QObject* qt_obj = 0, const char* qt_slot = 0);
00079 
00082   inline int removeAllConnections();
00083 
00086   void blockAllConnections(bool block);
00087   
00090   int blockConnection(bool block, vtkObject* vtk_obj,
00091                       unsigned long vtk_event, const QObject* qt_obj);
00092   void blockConnection(const QString& id, bool blocked);
00093 
00094 private:
00095   CTK_DECLARE_PRIVATE(ctkVTKObjectEventsObserver);
00096 
00097 };
00098 
00099 //-----------------------------------------------------------------------------
00100 int ctkVTKObjectEventsObserver::removeAllConnections()
00101 {
00102   return this->removeConnection(0);
00103 }
00104 
00105 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 21 May 2010 for CTK by  doxygen 1.6.1