31 static ossimTrace traceDebug(
"ossimImageChain");
48 for(idx = 0; idx < outputList.size();++idx)
50 if(outputList[idx].valid())
52 outputList[idx]->fireEvent(event);
53 outputList[idx]->propagateEventToOutputs(event);
68 theLoadStateFlag(false)
113 event.setObjectList(obj);
185 std::vector<ossimRefPtr<ossimConnectableObject> >::iterator current =
imageChainList().begin();
191 if(
id == (*current)->getId())
193 return (*current).get();
211 if(
object)
return object;
222 std::vector<ossimRefPtr<ossimConnectableObject> >::iterator current =
imageChainList().begin();
226 if((*current).valid())
228 if(obj == (*current).get())
230 return (*current).get();
247 if(
object)
return object;
258 vector<ossimRefPtr<ossimConnectableObject> >::iterator current =
imageChainList().begin();
262 if((*current).valid()&&
263 (*current)->canCastTo(typeInfo))
265 return (*current).get();
296 vector<ossimRefPtr<ossimConnectableObject> >::iterator current =
imageChainList().begin();
300 if((*current).valid()&&
301 (*current)->canCastTo(className) )
303 return (*current).get();
334 ossimConnectableObject::ConnectableObjectList::iterator current =
imageChainList().begin();
338 if((*current).valid()&&
339 (*current)->canCastTo(typeInfo))
341 ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(),
344 if(iter == result.end())
346 result.push_back((*current).get());
363 for(
long index=0; index < (long)temp.size();++index)
365 ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), temp[index]);
366 if(iter == result.end())
368 result.push_back(temp[index]);
384 ossimConnectableObject::ConnectableObjectList::iterator current =
imageChainList().begin();
388 if((*current).valid()&&
389 (*current)->canCastTo(className))
391 ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(),
394 if(iter == result.end())
396 result.push_back((*current).get());
413 for(
long index=0; index < (long)temp.size();++index)
415 ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), temp[index]);
416 if(iter == result.end())
418 result.push_back(temp[index]);
433 for(
long index = 0; index < (long)
imageChainList().size(); ++index)
473 <<
"ossimImageChain::getNumberOfSources is deprecated!" 474 <<
"\nUse: ossimImageChain::getNumberOfObjects(false)" 500 object->changeOwner(0);
507 object->changeOwner(0);
511 object->disconnect();
523 (*current)->connectInputList(input);
532 for(outIndex = 0; outIndex < output.size();++outIndex)
534 output[outIndex]->connectInputList(input);
543 event.setObjectList(
object);
564 bool immediateChildrenOnlyFlag)
568 vector<ossimConnectableObject*> temp;
574 for(i = 0; i < temp.size();++i)
578 if(immediateChildrenOnlyFlag)
580 children.push_back(temp[i]);
584 children.push_back(temp[i]);
588 if(!immediateChildrenOnlyFlag)
590 for(i = 0; i < temp.size();++i)
596 interface->getChildren(children,
false);
639 if (result && source)
642 event.setObjectList(source);
652 if(!newObj&&!rightOfThisObj)
return false;
657 std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = std::find(
imageChainList().begin(),
imageChainList().end(), rightOfThisObj);
678 event.setObjectList(newObj);
714 if(!newObj&&!leftOfThisObj)
return false;
719 std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = std::find(
imageChainList().begin(),
imageChainList().end(), leftOfThisObj);
739 event.setObjectList(newObj);
810 return inputSource->
getTile(tileRect, resLevel);
825 return inputTile.
get();
848 return interface->getNumberOfOutputBands();
859 return interface->getNumberOfOutputBands();
875 return interface->getNullPixelValue(band);
886 return interface->getNullPixelValue(band);
902 return interface->getMinPixelValue(band);
913 return interface->getMinPixelValue(band);
940 return interface->getMaxPixelValue(band);
970 return interface->getOutputScalarType();
981 return interface->getOutputScalarType();
997 return interface->getTileWidth();;
1008 return interface->getTileWidth();
1024 return interface->getTileHeight();
1035 return interface->getTileHeight();
1053 return interface->getBoundingRect(resLevel);
1064 return interface->getBoundingRect();
1086 interface->getValidImageVertices(validVertices,
1099 interface->getValidImageVertices(validVertices,
1114 return interface->getImageGeometry();
1124 return interface->getImageGeometry();
1140 interface->getDecimationFactor(resLevel,
1153 interface->getDecimationFactor(resLevel, result);
1170 interface->getDecimationFactors(decimations);
1181 interface->getDecimationFactors(decimations);
1197 return interface->getNumberOfDecimationLevels();
1208 return interface->getNumberOfDecimationLevels();
1220 static const char* MODULE =
"ossimImageChain::addAllSources";
1232 vector<ossimId> inputConnectionIds;
1234 vector<ossimString> keys =
1236 long numberOfSources = (long)keys.size();
1238 int offset = (int)(copyPrefix+
"object").size();
1240 std::vector<int> theNumberList(numberOfSources);
1241 for(idx = 0; idx < (int)theNumberList.size();++idx)
1245 theNumberList[idx] = numberStr.
toInt();
1247 std::sort(theNumberList.begin(), theNumberList.end());
1248 for(idx=0;idx < (int)theNumberList.size();++idx)
1257 CLOG <<
"trying to create source with prefix: " << newPrefix
1269 CLOG <<
"Created source with prefix: " << newPrefix << std::endl;
1274 inputConnectionIds.clear();
1279 if(inputConnectionIds.size() == 0)
1300 idMapping.insert(std::make_pair(
id, inputConnectionIds));
1337 vector<ossimString> keys =
1342 std::vector<int> theNumberList(numberOfKeys);
1343 for(idx = 0; idx < theNumberList.size();++idx)
1347 theNumberList[idx] = numberStr.
toInt();
1349 std::sort(theNumberList.begin(), theNumberList.end());
1351 for(idx=0;idx < theNumberList.size();++idx)
1357 result.push_back(
ossimId(
id));
1367 if(idMapping.size())
1369 map<ossimId, vector<ossimId> >::const_iterator iter = idMapping.begin();
1372 while(iter != idMapping.end())
1388 long upperBound = (long)(*iter).second.size();
1389 for(
long index = 0; index < upperBound; ++index)
1393 if((*iter).second[index].getId() > -1)
1400 visitor.
setId( (*iter).second[index] );
1410 if (
this != inputSource )
1425 cerr <<
"Could not find " << (*iter).first <<
" for source: ";
1437 const char* prefix)
const 1454 for(;((idx >= 0)&&result);--idx, ++counter)
1471 static const char* MODULE =
"ossimImageChain::loadState(kwl, prefix)";
1480 map<ossimId, vector<ossimId> > idMapping;
1484 CLOG <<
"problems adding sources" << std::endl;
1489 CLOG <<
"problems connecting sources" << std::endl;
1499 static const char* MODULE =
"ossimImageChain::initialize()";
1500 if (traceDebug())
CLOG <<
" Entered..." << std::endl;
1504 for(
long index = upper - 1; index >= 0; --index)
1508 CLOG <<
"initilizing source: " 1522 interface->initialize();
1526 if (traceDebug())
CLOG <<
" Exited..." << std::endl;
1533 for(index = upper - 1; index >= 0; --index)
1552 for(
long index = upper - 1; index >= 0; --index)
1569 if(connectableObject)
1587 std::vector<ossimRefPtr<ossimConnectableObject> >::iterator i =
imageChainList().begin();
1614 for(; idx < upper; ++idx)
1637 for(
ossim_uint32 i = 0; i <
event.getNumberOfOldObjects(); ++i)
1658 for(
ossim_uint32 i = 0; i <
event.getNumberOfNewObjects(); ++i)
1783 visitor.
visit(
this);
1792 ConnectableObjectList::reverse_iterator current =
imageChainList().rbegin();
1818 if (!first_source.
valid())
1826 while (!obj_list.empty())
1829 output_connection = obj_list[0];
virtual void setNumberOfInputs(ossim_int32 numberOfInputs)
Will set the number of inputs.
bool deleteFirst()
Deletes the first object.
virtual void visit(ossimObject *obj)
virtual bool isSourceEnabled() const
virtual ossimRefPtr< ossimConnectableObject > disconnectMyInput(ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
Will disconnect the object at the given input index and generate a connection event.
virtual bool addListener(ossimListener *listener)
virtual ossim_int32 findInputIndex(const ossimConnectableObject *object)
Return a valid index of the input list if the passed in object is found else return -1...
virtual bool removeChild(ossimConnectableObject *object)
Will remove the child from the container.
virtual void processEvent(ossimEvent &event)
ProcessEvent.
virtual void enableSource()
virtual ossimObject * getFirstObject()
virtual void makeUniqueIds()
Will cycle through all sources setting their ids.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=NULL)
Will load the state.
void setId(const ossimId &id)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tileRect, ossim_uint32 resLevel=0)
Within the image chain will pass the head of the list.
virtual ossim_uint32 getTileWidth() const
This call is passed to the head of the list.
virtual void disconnectAllOutputs()
Will disconnect all of the output objects.
virtual void processEvent(ossimEvent &event)
ProcessEvent.
bool addLast(ossimConnectableObject *obj)
Adds it to the end.
virtual void objectDestructingEvent(ossimObjectDestructingEvent &event)
bool deleteLast()
Deletes the last object.
virtual ossimImageSource * getFirstSource()
Return the first source which is the one that first receives the getTile request. ...
virtual void propagateEventToOutputs(ossimEvent &event)
virtual ossimConnectableObject * findFirstObjectOfType(const RTTItypeid &typeInfo, bool recurse=true)=0
virtual void disconnect(ossimConnectableObject *object=0)
Will disconnect the object passed in.
virtual bool getInputListIsFixedFlag() const
virtual ossim_uint32 getNumberOfObjects(bool recurse=true) const =0
Represents serializable keyword/value map.
bool addAllSources(map< ossimId, vector< ossimId > > &idMapping, const ossimKeywordlist &kwl, const char *prefix=NULL)
For dynamic loading to take place we must allocate all objects first and then assign id's later...
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=NULL) const
Will save the state of the chain.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
const char * find(const char *key) const
const ossimObject * getCurrentObject() const
virtual bool getOutputListIsFixedFlag() const
void setVisitorType(int vType, bool on=true)
virtual void initialize()
ossimConnectableObject * operator[](ossim_uint32 index)
virtual bool connectOutputList(ConnectableObjectList &outputList)
Will disconnect itself from all outputs and reset to the passed in output list.
virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType(const RTTItypeid &typeInfo, bool recurse=true)=0
static ossimString toString(bool aValue)
Numeric to string methods.
virtual void connectInputEvent(ossimConnectionEvent &event)
virtual void disableSource()
static ossimObjectFactoryRegistry * instance()
bool insertRight(ossimConnectableObject *newObj, ossimConnectableObject *rightOfThisObj)
ossimObject * theBaseObject
virtual ossimString getClassName() const
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
virtual ossim_uint32 getNumberOfSources() const
Deprecated! Please use getNumberOfObjects(false).
void prepareForRemoval(ossimConnectableObject *connectableObject)
Inserts all of this object's children and inputs into the container provided.
virtual void disconnectOutputEvent(ossimConnectionEvent &event)
virtual ossimImageSource * getLastSource()
Return the last source which is the one that last receives the getTile request.
virtual void fireEvent(ossimEvent &event)
virtual ossimObject * getLastObject()
virtual void getOutputBandList(std::vector< ossim_uint32 > &bandList) const
Initializes bandList.
virtual ossim_uint32 getNumberOfObjects(bool recurse=true) const
Returns the number of objects within this container and all child containers.
#define OSSIM_EVENT_REMOVE_OBJECT_ID
virtual ossim_int32 indexOf(ossimConnectableObject *obj) const
void turnOffVisitorType(int vType)
bool replace(ossimConnectableObject *newObj, ossimConnectableObject *oldObj)
virtual ossimScalarType getOutputScalarType() const
This call is passed to the head of the list.
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.
const ConnectableObjectList & getInputList() const
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
virtual void getOutputBandList(std::vector< ossim_uint32 > &bandList) const
Initializes bandList.
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
virtual void changeOwner(ossimObject *owner)
Permits changing the object's owner.
const ossimObject * getObject() const
This is the originating object that originally produced the event.
virtual ~ossimImageChain()
const ossimId & getId() const
Will allow us to get this object's id.
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define OSSIM_EVENT_ADD_OBJECT_ID
virtual void getValidImageVertices(vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
unsigned int ossim_uint32
bool hasVisited(ossimObject *obj) const
virtual void enableSource()
virtual bool add(ossimConnectableObject *source)
Will return true or false if an image source was added to the chain.
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 getDecimationFactors(vector< ossimDpt > &decimations) const
virtual ossimConnectableObject * getConnectableObject(ossim_uint32 index)
Same as operator[](ossim_uint32 i)
virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt &result) const
Will return the decimation factor for the given resolution level.
RTTI_DEF3(ossimImageChain, "ossimImageChain", ossimImageSource, ossimConnectableObjectListener, ossimConnectableContainerInterface)
virtual ossim_uint32 getTileHeight() const
This call is passed to the head of the list.
ossimConnectableObject * getObject()
virtual void connectOutputEvent(ossimConnectionEvent &event)
virtual ossim_uint32 getNumberOfDecimationLevels() const
Will return the number of resolution levels.
virtual bool addChild(ossimConnectableObject *attachableObject)
Will add an object to the container and then set the added objects owner to this. ...
virtual bool connectInputList(ConnectableObjectList &inputList)
Will disconnect itself from all inputs and reset to the passed in input list.
virtual ossimConnectableObject * findObject(const ossimId &id, bool recurse=true)=0
virtual void disconnectInputEvent(ossimConnectionEvent &event)
std::vector< ossimString > getSubstringKeyList(const ossimString ®ularExpression) const
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Will pass this call to the head of the list.
const ConnectableObjectList & getOutputList() const
virtual void reset()
Resets m_object to 0, calls ossimVisitor::reset().
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
virtual ossim_int32 connectMyOutputTo(ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
Will try to connect this objects output to the passed in object.
long toLong() const
toLong's deprecated, please use the toInts...
ConnectableObjectList theInputObjectList
Holds a list of input objects.
virtual ossimConnectableObject * getOldObject(ossim_uint32 i=0)
OSSIM_DLL double defaultMax(ossimScalarType scalarType)
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
virtual void getChildren(vector< ossimConnectableObject *> &children, bool immediateChildrenOnlyFlag)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.
virtual void makeUniqueIds()=0
VisitorType getVisitorType() const
virtual ossimObject * createObject(const ossimString &name) const
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
bool theInputListIsFixedFlag
Indicates whether the theInputObjectList is fixed.
void findInputConnectionIds(vector< ossimId > &result, const ossimKeywordlist &kwl, const char *prefix=NULL)
VisitorType
Enumeration type can be a mask and will traverse a graph of connectables based on the values...
bool stopTraversal() const
virtual ossimRefPtr< ossimConnectableObject > disconnectMyOutput(ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
Will disconnect the object at the given output index and generate a connection event.
bool isPropagatingToOutputs() const
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.
bool connectAllSources(const map< ossimId, vector< ossimId > > &idMapping)
void setId(const ossimId &id)
All connectable objects will have id's.
bool theOutputListIsFixedFlag
Indicates whether the theOutputObjectList is fixed.
virtual void disconnectAllInputs()
Will disconnect all of the input objects.
virtual ossim_uint32 getNumberOfInputBands() const
this call is passed to the head of the list.
virtual bool fillContainer(ossimConnectableContainer &container)
Inserts this object and all of its children and inputs into the container provided.
virtual void disableSource()
bool insertLeft(ossimConnectableObject *newObj, const ossimId &id)
virtual void propagateEventToInputs(ossimEvent &event)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
static ossimIdManager * instance()
bool addFirst(ossimConnectableObject *obj)
Adds it to the start of the chain.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
virtual bool removeListener(ossimListener *listener)