OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimImageSourceFilter.cpp
Go to the documentation of this file.
1 
2 //*******************************************************************
3 // Copyright (C) 2000 ImageLinks Inc.
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 // Author: Garrett Potts
10 //
11 // Description:
12 //
13 //*******************************************************************
14 // $Id: ossimImageSourceFilter.cpp 18920 2011-02-18 20:06:11Z gpotts $
15 
17 #include <ossim/base/ossimTrace.h>
19 
20 static ossimTrace traceDebug("ossimImageSourceFilter:debug");
21 
23 
25  : ossimImageSource(owner,
26  1, // number of inputs
27  0, // number of outputs
28  true, // input's fixed
29  false), // outputs ar not fixed
30  theInputConnection(NULL)
31 {
32  addListener((ossimConnectableObjectListener*)this);
33 }
34 
36  : ossimImageSource(NULL,
37  1,
38  0,
39  true,
40  false),
41  theInputConnection(inputSource)
42 {
43  if(inputSource)
44  {
45  connectMyInputTo(0, inputSource);
46  }
48 }
49 
51  ossimImageSource* inputSource)
52  : ossimImageSource(owner,
53  1,
54  0,
55  true,
56  false),
57  theInputConnection(inputSource)
58 {
59  if(inputSource)
60  {
61  theInputObjectList[0] = inputSource;
62  inputSource->connectMyOutputTo(this, false);
63  }
65 }
66 
67 
69 {
71  theInputConnection = NULL;
72 }
73 
75 {
77  {
79  }
80 
81  return 0;
82 }
83 
85 {
87 }
88 
90  const char* prefix)
91 {
92  bool result = ossimImageSource::loadState(kwl, prefix);
93 
94  // make sure we have 1 input.
95  //setNumberOfInputs(1);
96 
97  // we will fix the input
98  //if(!theInputListIsFixedFlag)
99  // {
100  // theInputListIsFixedFlag = true;
101  // }
102 
103  return result;
104 }
105 
107  const char* prefix)const
108 {
109  return ossimImageSource::saveState(kwl, prefix);
110 }
111 
112 
114  const ossimConnectableObject* object)const
115 {
116 
117  return ((PTR_CAST(ossimImageSource, object)||!object) && ( inputIndex == 0 ) );
118 }
119 
121 {
122  if(traceDebug())
123  {
124  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::connectInputEvent: ";
125 
126  if(getInput())
127  {
128  ossimNotify(ossimNotifyLevel_DEBUG) << "to" << getInput()->getClassName() << std::endl;
129  }
130  else
131  {
132  ossimNotify(ossimNotifyLevel_DEBUG) << "to NULL" << std::endl;
133  }
134  }
136  initialize();
137  if(traceDebug())
138  {
140  {
141  ossimNotify(ossimNotifyLevel_DEBUG) << "theInputConnection was set to " << getInput()->getClassName() << std::endl;
142  }
143  else
144  {
145  ossimNotify(ossimNotifyLevel_DEBUG) << "theInputConnection was set to NULL" << std::endl;
146  }
147  ossimNotify(ossimNotifyLevel_DEBUG) << "Leaving ossimImageSourceFilter::connectInput" << std::endl;
148  }
149 }
151 {
152  if(traceDebug())
153  {
154  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::disconnectInputEvent" << std::endl;
155  }
157  initialize();
158  if(traceDebug())
159  {
160  ossimNotify(ossimNotifyLevel_DEBUG) << "Leaving ossimImageSourceFilter::disconnectInput" << std::endl;
161  }
162 }
164 {
165  if(traceDebug())
166  {
167  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::propertyEvent DEBUG: Entering..." << std::endl;
168  }
169  initialize();
170 
171  if(traceDebug())
172  {
173  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::propertyEvent DEBUG: Leaving..." << std::endl;
174  }
175 }
176 
178 {
179  if(traceDebug())
180  {
181  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::refreshEvent " << std::endl;
182  }
183  initialize();
184 
185  if(traceDebug())
186  {
187  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::refreshEvent " << std::endl;
188  }
189 }
190 
191 void ossimImageSourceFilter::getOutputBandList(std::vector<ossim_uint32>& bandList) const
192 {
194  {
195  return theInputConnection->getOutputBandList(bandList);
196  }
197 
198  return ossimImageSource::getOutputBandList(bandList);
199 }
200 
202 {
204 }
205 
207 {
208  return ossimImageSource::getProperty(name);
209 
210 }
211 
212 void ossimImageSourceFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
213 {
214  ossimImageSource::getPropertyNames(propertyNames);
215 }
virtual bool addListener(ossimListener *listener)
virtual void getOutputBandList(std::vector< ossim_uint32 > &bandList) const
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual ossim_uint32 getNumberOfInputBands() const
virtual void connectInputEvent(ossimConnectionEvent &event)
Represents serializable keyword/value map.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossimImageSourceFilter(ossimObject *owner=NULL)
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
virtual void disconnectInputEvent(ossimConnectionEvent &event)
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
virtual void setProperty(ossimRefPtr< ossimProperty > property)
#define RTTI_DEF2(cls, name, b1, b2)
Definition: ossimRtti.h:493
virtual void getOutputBandList(std::vector< ossim_uint32 > &bandList) const
Initializes bandList.
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
bool canConnectMyInputTo(ossim_int32 inputIndex, const ossimConnectableObject *object) const
required to be overriden by derived classes
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
ossimImageSource * theInputConnection
unsigned int ossim_uint32
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual ossim_int32 connectMyInputTo(ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
Will try to connect this objects input to the passed in object.
virtual void propertyEvent(ossimPropertyEvent &event)
virtual ossim_int32 connectMyOutputTo(ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
Will try to connect this objects output to the passed in object.
ConnectableObjectList theInputObjectList
Holds a list of input objects.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual void refreshEvent(ossimRefreshEvent &event)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32
virtual bool removeListener(ossimListener *listener)