OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimConnectableObjectListener.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts
8 //
9 //*************************************************************************
10 // $Id: ossimConnectableObjectListener.cpp 19961 2011-08-16 18:10:36Z gpotts $
11 
16 
18  "ossimConnectableObjectListener",
20 
22 {
23  switch(event.getId())
24  {
26  {
27  ossimObjectDestructingEvent* eventCast = dynamic_cast<ossimObjectDestructingEvent*>(&event);
28  if(eventCast) objectDestructingEvent(*eventCast);
29 
30  break;
31  }
34  {
35  ossimConnectionEvent* eventCast = dynamic_cast<ossimConnectionEvent*>(&event);
36 
37  if(eventCast)
38  {
39  connectionEvent(*eventCast);
40 
42  {
43  if(eventCast->isInputDirection())
44  {
45  disconnectInputEvent(*eventCast);
46  }
47  else if(eventCast->isOutputDirection())
48  {
49  disconnectOutputEvent(*eventCast);
50  }
51  else
52  {
53  ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableObjectListener::processEvent, Direction not set\n";
54  }
55  }
56  else
57  {
58  if(eventCast->isInputDirection())
59  {
60  connectInputEvent(*eventCast);
61  }
62  else if(eventCast->isOutputDirection())
63  {
64  connectOutputEvent(*eventCast);
65  }
66  else
67  {
68  ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableObjectListener::processEvent, Direction not set\n";
69  }
70  }
71  }
72  break;
73  }
75  {
76  ossimPropertyEvent* eventCast = dynamic_cast<ossimPropertyEvent*>(&event);
77  if(eventCast) propertyEvent(*eventCast);
78  break;
79  }
81  {
82  ossimContainerEvent* eventCast = dynamic_cast<ossimContainerEvent*>(&event);
83  if(eventCast)
84  {
85  containerEvent(*eventCast);
86  addObjectEvent(*eventCast);
87  }
88  break;
89  }
91  {
92  ossimContainerEvent* eventCast = dynamic_cast<ossimContainerEvent*>(&event);
93  if(eventCast)
94  {
95  containerEvent(*eventCast);
96  removeObjectEvent(*eventCast);
97  }
98  break;
99  }
101  {
102  ossimRefreshEvent* eventCast = dynamic_cast<ossimRefreshEvent*>(&event);
103  if(eventCast) refreshEvent(*eventCast);
104  break;
105  }
106  default:
107  {
109  break;
110  }
111  }
112 }
virtual void processEvent(ossimEvent &event)
ProcessEvent.
#define OSSIM_EVENT_CONNECTION_DISCONNECT_ID
Definition: ossimEventIds.h:21
virtual bool isInputDirection() const
virtual void processEvent(ossimEvent &event)
ProcessEvent.
virtual void connectOutputEvent(ossimConnectionEvent &)
#define OSSIM_EVENT_REMOVE_OBJECT_ID
Definition: ossimEventIds.h:28
virtual void refreshEvent(ossimRefreshEvent &)
virtual void propertyEvent(ossimPropertyEvent &)
virtual void addObjectEvent(ossimContainerEvent &)
#define OSSIM_EVENT_CONNECTION_CONNECT_ID
Definition: ossimEventIds.h:22
#define OSSIM_EVENT_ADD_OBJECT_ID
Definition: ossimEventIds.h:27
#define OSSIM_EVENT_OBJECT_DESTRUCTING_ID
Definition: ossimEventIds.h:18
long getId() const
Definition: ossimEvent.cpp:39
virtual void disconnectOutputEvent(ossimConnectionEvent &)
#define OSSIM_EVENT_REFRESH_ID
Definition: ossimEventIds.h:24
#define OSSIM_EVENT_PROPERTY_ID
Definition: ossimEventIds.h:31
virtual void objectDestructingEvent(ossimObjectDestructingEvent &)
virtual void removeObjectEvent(ossimContainerEvent &)
virtual void disconnectInputEvent(ossimConnectionEvent &)
virtual void containerEvent(ossimContainerEvent &)
RTTI_DEF1(ossimConnectableObjectListener, "ossimConnectableObjectListener", ossimListener)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual void connectInputEvent(ossimConnectionEvent &)
virtual void connectionEvent(ossimConnectionEvent &)
virtual bool isOutputDirection() const