OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimImageChain Class Reference

#include <ossimImageChain.h>

Inheritance diagram for ossimImageChain:
ossimImageSource ossimConnectableObjectListener ossimConnectableContainerInterface ossimSource ossimListener ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced ATP::AtpAnnotatedImage ossimImageChainMtAdaptor ossimSingleImageChain

Public Member Functions

 ossimImageChain ()
 
virtual ~ossimImageChain ()
 
ossimConnectableObject::ConnectableObjectListgetChainList ()
 
const ossimConnectableObject::ConnectableObjectListgetChainList () const
 
ossimConnectableObjectoperator[] (ossim_uint32 index)
 
virtual ossimConnectableObjectgetConnectableObject (ossim_uint32 index)
 Same as operator[](ossim_uint32 i) More...
 
virtual ossim_int32 indexOf (ossimConnectableObject *obj) const
 
virtual ossimImageSourcegetFirstSource ()
 Return the first source which is the one that first receives the getTile request. More...
 
virtual const ossimImageSourcegetFirstSource () const
 
virtual ossimObjectgetFirstObject ()
 
virtual ossimImageSourcegetLastSource ()
 Return the last source which is the one that last receives the getTile request. More...
 
virtual const ossimImageSourcegetLastSource () const
 
virtual ossimObjectgetLastObject ()
 
bool addFirst (ossimConnectableObject *obj)
 Adds it to the start of the chain. More...
 
bool addLast (ossimConnectableObject *obj)
 Adds it to the end. More...
 
bool deleteFirst ()
 Deletes the first object. More...
 
bool deleteLast ()
 Deletes the last object. More...
 
bool insertRight (ossimConnectableObject *newObj, ossimConnectableObject *rightOfThisObj)
 
bool insertRight (ossimConnectableObject *newObj, const ossimId &id)
 
bool insertLeft (ossimConnectableObject *newObj, const ossimId &id)
 
bool insertLeft (ossimConnectableObject *newObj, ossimConnectableObject *leftOfThisObj)
 
bool replace (ossimConnectableObject *newObj, ossimConnectableObject *oldObj)
 
virtual bool add (ossimConnectableObject *source)
 Will return true or false if an image source was added to the chain. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 Within the image chain will pass the head of the list. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 this call is passed to the head of the list. More...
 
virtual ossimScalarType getOutputScalarType () const
 This call is passed to the head of the list. More...
 
virtual double getNullPixelValue (ossim_uint32 band=0) const
 Each band has a null pixel associated with it. More...
 
virtual double getMinPixelValue (ossim_uint32 band=0) const
 Returns the min pixel of the band. More...
 
virtual double getMaxPixelValue (ossim_uint32 band=0) const
 Returns the max pixel of the band. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual ossim_uint32 getTileWidth () const
 This call is passed to the head of the list. More...
 
virtual ossim_uint32 getTileHeight () const
 This call is passed to the head of the list. More...
 
virtual ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 Will pass this call to the head of the list. More...
 
virtual void getValidImageVertices (vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if not defined. More...
 
virtual void getDecimationFactor (ossim_uint32 resLevel, ossimDpt &result) const
 Will return the decimation factor for the given resolution level. More...
 
virtual void getDecimationFactors (vector< ossimDpt > &decimations) const
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 Will return the number of resolution levels. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=NULL) const
 Will save the state of the chain. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=NULL)
 Will load the state. More...
 
virtual void initialize ()
 
virtual void enableSource ()
 
virtual void disableSource ()
 
bool canConnectMyInputTo (ossim_int32 myInputIndex, const ossimConnectableObject *object) const
 required to be overriden by derived classes More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType(const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType(const ossimString &className, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findFirstObjectOfType(const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findFirstObjectOfType(const ossimString &className, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObject(const ossimId &id, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObject(const ossimConnectableObject *obj, bool recurse=true))
 
virtual void makeUniqueIds ()
 Will cycle through all sources setting their ids. More...
 
virtual ossim_uint32 getNumberOfObjects (bool recurse=true) const
 Returns the number of objects within this container and all child containers. More...
 
virtual ossim_uint32 getNumberOfSources () const
 Deprecated! Please use getNumberOfObjects(false). More...
 
virtual bool addChild (ossimConnectableObject *attachableObject)
 Will add an object to the container and then set the added objects owner to this. More...
 
virtual bool removeChild (ossimConnectableObject *object)
 Will remove the child from the container. More...
 
virtual ossimConnectableObjectremoveChild (const ossimId &id)
 
virtual void getChildren (vector< ossimConnectableObject *> &children, bool immediateChildrenOnlyFlag)
 
virtual void disconnectInputEvent (ossimConnectionEvent &event)
 
virtual void disconnectOutputEvent (ossimConnectionEvent &event)
 
virtual void connectInputEvent (ossimConnectionEvent &event)
 
virtual void connectOutputEvent (ossimConnectionEvent &event)
 
virtual void objectDestructingEvent (ossimObjectDestructingEvent &event)
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void processEvent (ossimEvent &event)
 ProcessEvent. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
void deleteList ()
 
virtual ossimConnectableObject::ConnectableObjectListimageChainList ()
 These access methods greatly facilitate the implementation of an image chain adaptor class. More...
 
virtual const ossimConnectableObject::ConnectableObjectListimageChainList () const
 
- Public Member Functions inherited from ossimImageSource
 ossimImageSource (ossimObject *owner=0)
 
 ossimImageSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimImageSource ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIpt &origin, ossim_uint32 resLevel=0)
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. More...
 
virtual void saveImageGeometry () const
 Default method to call input's saveImageGeometry. More...
 
virtual void saveImageGeometry (const ossimFilename &geometry_file) const
 Default method to call input's saveImageGeometry. More...
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool isIndexedData () const
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
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. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 
- Public Member Functions inherited from ossimConnectableObjectListener
 ossimConnectableObjectListener ()
 
virtual ~ossimConnectableObjectListener ()
 
virtual void connectionEvent (ossimConnectionEvent &)
 
virtual void propertyEvent (ossimPropertyEvent &)
 
virtual void addObjectEvent (ossimContainerEvent &)
 
virtual void removeObjectEvent (ossimContainerEvent &)
 
virtual void containerEvent (ossimContainerEvent &)
 
virtual void refreshEvent (ossimRefreshEvent &)
 
- Public Member Functions inherited from ossimListener
 ossimListener ()
 
virtual ~ossimListener ()
 
void enableListener ()
 
void disableListener ()
 
void setListenerEnableFlag (bool flag)
 
bool isListenerEnabled () const
 
bool getListenerEnableFlag () const
 
- Public Member Functions inherited from ossimConnectableContainerInterface
 ossimConnectableContainerInterface (ossimObject *obj)
 
virtual ~ossimConnectableContainerInterface ()
 
virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType (const RTTItypeid &typeInfo, bool recurse=true)=0
 
virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType (const ossimString &className, bool recurse=true)=0
 
virtual ossimConnectableObjectfindFirstObjectOfType (const RTTItypeid &typeInfo, bool recurse=true)=0
 
virtual ossimConnectableObjectfindFirstObjectOfType (const ossimString &className, bool recurse=true)=0
 
virtual ossimConnectableObjectfindObject (const ossimId &id, bool recurse=true)=0
 
virtual ossimConnectableObjectfindObject (const ossimConnectableObject *obj, bool recurse=true)=0
 
ossimObjectgetObject ()
 
const ossimObjectgetObject () const
 
void deleteAllChildren ()
 
virtual void getChildren (std::vector< ossimConnectableObject *> &children, bool immediateChildrenOnlyFlag)=0
 

Protected Member Functions

void prepareForRemoval (ossimConnectableObject *connectableObject)
 Inserts all of this object's children and inputs into the container provided. More...
 
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. More...
 
void findInputConnectionIds (vector< ossimId > &result, const ossimKeywordlist &kwl, const char *prefix=NULL)
 
bool connectAllSources (const map< ossimId, vector< ossimId > > &idMapping)
 
- Protected Member Functions inherited from ossimImageSource
 ossimImageSource (const ossimImageSource &rhs)
 
const ossimImageSourceoperator= (const ossimImageSource &)
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 

Protected Attributes

ossimConnectableObject::ConnectableObjectList theImageChainList
 This will hold a sequence of image sources. More...
 
ossimRefPtr< ossimImageDatatheBlankTile
 
bool theLoadStateFlag
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 
- Protected Attributes inherited from ossimListener
bool theListenerEnableFlag
 
- Protected Attributes inherited from ossimConnectableContainerInterface
ossimObjecttheBaseObject
 

Additional Inherited Members

- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 

Detailed Description

Definition at line 23 of file ossimImageChain.h.

Constructor & Destructor Documentation

◆ ossimImageChain()

ossimImageChain::ossimImageChain ( )

Definition at line 60 of file ossimImageChain.cpp.

References ossimListenerManager::addListener(), and ossimConnectableContainerInterface::theBaseObject.

62  0, // number of inputs
63  0, // number of outputs
64  false, // input's fixed
65  false), // outputs are not fixed
67  theBlankTile(NULL),
68  theLoadStateFlag(false)
69 {
71  //thePropagateEventFlag = false;
73 }
virtual bool addListener(ossimListener *listener)
ossimImageSource(ossimObject *owner=0)
ossimRefPtr< ossimImageData > theBlankTile

◆ ~ossimImageChain()

ossimImageChain::~ossimImageChain ( )
virtual

Member Function Documentation

◆ accept()

void ossimImageChain::accept ( ossimVisitor visitor)
virtual

We will add a visitor interface for all connectable objects.

Reimplemented from ossimConnectableObject.

Definition at line 1779 of file ossimImageChain.cpp.

References ossimConnectableObject::accept(), ossimRefPtr< T >::get(), ossimVisitor::getVisitorType(), ossimVisitor::hasVisited(), imageChainList(), ossimVisitor::setVisitorType(), ossimVisitor::stopTraversal(), ossimVisitor::turnOffVisitorType(), ossimVisitor::visit(), ossimVisitor::VISIT_CHILDREN, ossimVisitor::VISIT_INPUTS, and ossimVisitor::VISIT_OUTPUTS.

Referenced by ATP::AtpAnnotatedImage::AtpAnnotatedImage(), connectAllSources(), ATP::AtpGenerator::getImageHandler(), insertLeft(), insertRight(), removeChild(), and ossimIgen::setView().

1780 {
1781  if(!visitor.hasVisited(this))
1782  {
1783  visitor.visit(this);
1784  ossimVisitor::VisitorType currentType = visitor.getVisitorType();
1785  //---
1786  // Lets make sure inputs and outputs are turned off for we are traversing all children
1787  // and we should not have to have that enabled.
1788  //---
1791  {
1792  ConnectableObjectList::reverse_iterator current = imageChainList().rbegin();
1793  while((current != imageChainList().rend())&&!visitor.stopTraversal())
1794  {
1795  ossimRefPtr<ossimConnectableObject> currentObject = (*current);
1796  if(currentObject.get() && !visitor.hasVisited(currentObject.get())) currentObject->accept(visitor);
1797  ++current;
1798  }
1799  }
1800  visitor.setVisitorType(currentType);
1802  }
1803 }
virtual void visit(ossimObject *obj)
void setVisitorType(int vType, bool on=true)
void turnOffVisitorType(int vType)
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
bool hasVisited(ossimObject *obj) const
VisitorType getVisitorType() const
VisitorType
Enumeration type can be a mask and will traverse a graph of connectables based on the values...
Definition: ossimVisitor.h:27
bool stopTraversal() const
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.

◆ add()

bool ossimImageChain::add ( ossimConnectableObject source)
virtual

Will return true or false if an image source was added to the chain.

It will add and do a connection to the previous source automatically. This is a chain and the order of insertion matters. It adds it to the beginning of the list. The last one added is the first one to receive the getTile. Basically inserts to the right of the rightmost filter

Definition at line 602 of file ossimImageChain.cpp.

References ossimListenerManager::addListener(), ossimConnectableObject::changeOwner(), ossimConnectableObject::connectInputList(), ossimConnectableObject::disconnectAllOutputs(), ossimListenerManager::fireEvent(), ossimConnectableObject::getInputList(), ossimConnectableObject::getInputListIsFixedFlag(), ossimConnectableObject::getOutputListIsFixedFlag(), imageChainList(), OSSIM_EVENT_ADD_OBJECT_ID, size, ossimConnectableObject::theInputListIsFixedFlag, ossimConnectableObject::theInputObjectList, and ossimConnectableObject::theOutputListIsFixedFlag.

Referenced by addChild(), addLast(), ATP::AtpAnnotatedImage::AtpAnnotatedImage(), ATP::AtpGenerator::constructChain(), ossimChipProcTool::createInputChain(), ossimShorelineTool::doThreshold(), ossimShorelineTool::execute(), ossimIgenGenerator::generateGeoTiledSpecList(), ossimIgenGenerator::generateNoTiledSpecList(), ossimIgenGenerator::generatePixelTiledSpecList(), ossimChipProcTool::getChip(), ossimBandMergeTool::initHistogramStretch(), ossimSubImageTool::initialize(), ossimBandMergeTool::initProcessingChain(), ossimHillshadeTool::initProcessingChain(), ossimSlopeTool::initProcessingChain(), ossimShorelineTool::initProcessingChain(), ossimHdf5Tool::initProcessingChain(), ossimHlzTool::initProcessingChain(), ossimViewshedTool::initProcessingChain(), insertLeft(), insertRight(), ossimHdf5Tool::loadImageFiles(), and ossimMultiThreadSequencer::setToStartOfSequence().

603 {
604  bool result = false;
605 // if(PTR_CAST(ossimImageSource, source))
606  {
607  source->changeOwner(this);
608  if(imageChainList().size() > 0)
609  {
610  source->disconnectAllOutputs();
612  imageChainList()[0]->removeListener(this);
613  imageChainList().insert(imageChainList().begin(), source);
614  imageChainList()[0]->addListener(this);
616  imageChainList()[0]->connectMyInputTo(imageChainList()[1].get());
617  result = true;
618  }
619  else
620  {
621  theInputListIsFixedFlag = false;
622  theOutputListIsFixedFlag = false;
623 
624  if(!theInputObjectList.empty())
625  {
626  source->connectInputList(getInputList());
627  }
628  theInputObjectList = source->getInputList();
630  // theOutputObjectList = source->getOutputList();
631  // theOutputListIsFixedFlag= source->getOutputListIsFixedFlag();
632  imageChainList().push_back(source);
634  source->addListener(this);
635  result = true;
636  }
637  }
638 
639  if (result && source)
640  {
642  event.setObjectList(source);
643  fireEvent(event);
644  }
645 
646  return result;
647 }
virtual bool addListener(ossimListener *listener)
virtual void disconnectAllOutputs()
Will disconnect all of the output objects.
virtual bool getInputListIsFixedFlag() const
virtual bool getOutputListIsFixedFlag() const
virtual void fireEvent(ossimEvent &event)
const ConnectableObjectList & getInputList() const
virtual void changeOwner(ossimObject *owner)
Permits changing the object&#39;s owner.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define OSSIM_EVENT_ADD_OBJECT_ID
Definition: ossimEventIds.h:27
virtual bool connectInputList(ConnectableObjectList &inputList)
Will disconnect itself from all inputs and reset to the passed in input list.
ConnectableObjectList theInputObjectList
Holds a list of input objects.
bool theInputListIsFixedFlag
Indicates whether the theInputObjectList is fixed.
bool theOutputListIsFixedFlag
Indicates whether the theOutputObjectList is fixed.

◆ addAllSources()

bool ossimImageChain::addAllSources ( map< ossimId, vector< ossimId > > &  idMapping,
const ossimKeywordlist kwl,
const char *  prefix = NULL 
)
protected

For dynamic loading to take place we must allocate all objects first and then assign id's later.

We must remember the id's so we can do this. we will create a map that takes the id of the source as a key and a vector of input id's to connect it's inputs to.

Definition at line 1216 of file ossimImageChain.cpp.

References ossimString::c_str(), ossimKeywordlist::getSubstringKeyList(), ossimImageSource::loadState(), ossimString::toInt(), and ossimString::toString().

Referenced by loadState().

1219 {
1220  static const char* MODULE = "ossimImageChain::addAllSources";
1221  ossimString copyPrefix = prefix;
1222  bool result = ossimImageSource::loadState(kwl, copyPrefix.c_str());
1223 
1224  if(!result)
1225  {
1226  return result;
1227  }
1228  long index = 0;
1229 
1230 // ossimSource* source = NULL;
1231 
1232  vector<ossimId> inputConnectionIds;
1233  ossimString regExpression = ossimString("^(") + copyPrefix + "object[0-9]+.)";
1234  vector<ossimString> keys =
1235  kwl.getSubstringKeyList( regExpression );
1236  long numberOfSources = (long)keys.size();//kwl.getNumberOfSubstringKeys(regExpression);
1237 
1238  int offset = (int)(copyPrefix+"object").size();
1239  int idx = 0;
1240  std::vector<int> theNumberList(numberOfSources);
1241  for(idx = 0; idx < (int)theNumberList.size();++idx)
1242  {
1243  ossimString numberStr(keys[idx].begin() + offset,
1244  keys[idx].end());
1245  theNumberList[idx] = numberStr.toInt();
1246  }
1247  std::sort(theNumberList.begin(), theNumberList.end());
1248  for(idx=0;idx < (int)theNumberList.size();++idx)
1249  {
1250  ossimString newPrefix = copyPrefix;
1251  newPrefix += ossimString("object");
1252  newPrefix += ossimString::toString(theNumberList[idx]);
1253  newPrefix += ossimString(".");
1254 
1255  if(traceDebug())
1256  {
1257  CLOG << "trying to create source with prefix: " << newPrefix
1258  << std::endl;
1259  }
1261  newPrefix.c_str());
1262  ossimConnectableObject* source = PTR_CAST(ossimConnectableObject, object.get());
1263 
1264  if(source)
1265  {
1266  // we did find a source so include it in the count
1267  if(traceDebug())
1268  {
1269  CLOG << "Created source with prefix: " << newPrefix << std::endl;
1270  }
1271  //if(PTR_CAST(ossimImageSource, source))
1272  {
1273  ossimId id = source->getId();
1274  inputConnectionIds.clear();
1275 
1276  findInputConnectionIds(inputConnectionIds,
1277  kwl,
1278  newPrefix);
1279  if(inputConnectionIds.size() == 0)
1280  {
1281  // we will try to do a default connection
1282  //
1283 
1284  if(imageChainList().size())
1285  {
1286  if(traceDebug())
1287  {
1288  CLOG << "connecting " << source->getClassName() << " to "
1289  << imageChainList()[0]->getClassName() << std::endl;
1290  }
1291  source->connectMyInputTo(0, imageChainList()[0].get());
1292  }
1293  }
1294  else
1295  {
1296  // we remember the connection id's so we can connect this later.
1297  // this way we make sure all sources were actually
1298  // allocated.
1299  //
1300  idMapping.insert(std::make_pair(id, inputConnectionIds));
1301  }
1302  add(source);
1303  }
1304  // else
1305  // {
1306  source = 0;
1307  // }
1308  }
1309  else
1310  {
1311  object = 0;
1312  source = 0;
1313  }
1314 
1315  ++index;
1316  }
1317  if(imageChainList().size())
1318  {
1320  if(obj)
1321  {
1323  }
1324  }
1325 
1326  return result;
1327 }
virtual void setNumberOfInputs(ossim_int32 numberOfInputs)
Will set the number of inputs.
#define CLOG
Definition: ossimTrace.h:23
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
static ossimString toString(bool aValue)
Numeric to string methods.
static ossimObjectFactoryRegistry * instance()
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
const ossimId & getId() const
Will allow us to get this object&#39;s id.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
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.
std::vector< ossimString > getSubstringKeyList(const ossimString &regularExpression) const
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.
virtual ossimObject * createObject(const ossimString &name) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
void findInputConnectionIds(vector< ossimId > &result, const ossimKeywordlist &kwl, const char *prefix=NULL)
int ossim_int32

◆ addChild()

bool ossimImageChain::addChild ( ossimConnectableObject attachableObject)
virtual

Will add an object to the container and then set the added objects owner to this.

Implements ossimConnectableContainerInterface.

Definition at line 479 of file ossimImageChain.cpp.

References add().

480 {
481  return add(object);
482 }
virtual bool add(ossimConnectableObject *source)
Will return true or false if an image source was added to the chain.

◆ addFirst()

bool ossimImageChain::addFirst ( ossimConnectableObject obj)

Adds it to the start of the chain.

This is the first one to receive the getTile request. This basically inserts it to the right of the right most filter. Returns true on success, false on error.

Definition at line 81 of file ossimImageChain.cpp.

References getFirstObject(), and insertRight().

Referenced by ossimSingleImageChain::addBandSelector(), ossimSingleImageChain::addBrightnessContrast(), ossimSingleImageChain::addCache(), ossimSingleImageChain::addGeoPolyCutter(), ossimSingleImageChain::addHistogramRemapper(), ossimSingleImageChain::addNullPixelFlip(), ossimSingleImageChain::addResampler(), ossimSingleImageChain::addScalarRemapper(), ossimSingleImageChain::addSharpen(), ossimSingleImageChain::createRenderedChain(), and ossimIgen::outputProduct().

82 {
83  ossimConnectableObject* rightOfThisObj =
85 
86  return insertRight(obj, rightOfThisObj);
87 }
virtual ossimObject * getFirstObject()
bool insertRight(ossimConnectableObject *newObj, ossimConnectableObject *rightOfThisObj)

◆ addLast()

bool ossimImageChain::addLast ( ossimConnectableObject obj)

Adds it to the end.

this is the last one to receive the getTile request. This basically inserts it to the left of the left most filter. Returns true on success, false on error.

Definition at line 89 of file ossimImageChain.cpp.

References add(), ossimListenerManager::addListener(), ossimConnectableObject::changeOwner(), ossimConnectableObject::connectInputList(), ossimConnectableObject::connectMyInputTo(), ossimConnectableObject::disconnectAllInputs(), ossimListenerManager::fireEvent(), ossimConnectableObject::getInputList(), ossimConnectableObject::getInputListIsFixedFlag(), ossimConnectableObject::getNumberOfInputs(), imageChainList(), OSSIM_EVENT_ADD_OBJECT_ID, ossimConnectableObject::setNumberOfInputs(), size, and ossimConnectableObject::theInputListIsFixedFlag.

Referenced by ossimSingleImageChain::addImageHandler(), insertLeft(), and ossimHdf5Tool::loadImageFiles().

90 {
91  if(imageChainList().size() > 0)
92  {
93  ossimConnectableObject* lastSource = imageChainList()[ imageChainList().size() -1].get();
94 // if(dynamic_cast<ossimImageSource*>(obj)&&lastSource)
95  if(lastSource)
96  {
97 // obj->disconnect();
99  lastSource->disconnectAllInputs();
100  lastSource->connectMyInputTo(obj);
101  obj->changeOwner(this);
102  obj->connectInputList(tempIn);
103 
104  tempIn = obj->getInputList();
107  imageChainList().push_back(obj);
108 
110  // Send an event to any listeners.
111  ossimContainerEvent event((ossimObject*)this,
113  event.setObjectList(obj);
114  fireEvent(event);
115  return true;
116  }
117  }
118  else
119  {
120  return add(obj);
121  }
122 
123  return false;;
124 }
virtual void setNumberOfInputs(ossim_int32 numberOfInputs)
Will set the number of inputs.
virtual bool addListener(ossimListener *listener)
virtual bool getInputListIsFixedFlag() const
virtual void fireEvent(ossimEvent &event)
const ConnectableObjectList & getInputList() const
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
virtual void changeOwner(ossimObject *owner)
Permits changing the object&#39;s owner.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define OSSIM_EVENT_ADD_OBJECT_ID
Definition: ossimEventIds.h:27
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 bool connectInputList(ConnectableObjectList &inputList)
Will disconnect itself from all inputs and reset to the passed in input list.
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.
bool theInputListIsFixedFlag
Indicates whether the theInputObjectList is fixed.
virtual void disconnectAllInputs()
Will disconnect all of the input objects.

◆ canConnectMyInputTo()

bool ossimImageChain::canConnectMyInputTo ( ossim_int32  myInputIndex,
const ossimConnectableObject object 
) const
inlinevirtual

required to be overriden by derived classes

Implements ossimConnectableObject.

Definition at line 207 of file ossimImageChain.h.

References ossimConnectableObject::canConnectMyInputTo(), and PTR_CAST.

209  {
210  if(theImageChainList.size()&&
211  theImageChainList[theImageChainList.size()-1].valid())
212  {
214  if(obj)
215  {
216  return obj->canConnectMyInputTo(myInputIndex,
217  object);
218  }
219  }
220  else if(!theImageChainList.size())
221  {
222  return true;
223  }
224  return false;
225  }
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
ossimConnectableObject::ConnectableObjectList theImageChainList
This will hold a sequence of image sources.
virtual bool canConnectMyInputTo(ossim_int32 myInputIndex, const ossimConnectableObject *object) const =0
required to be overriden by derived classes

◆ connectAllSources()

bool ossimImageChain::connectAllSources ( const map< ossimId, vector< ossimId > > &  idMapping)
protected

Definition at line 1363 of file ossimImageChain.cpp.

References accept(), ossimConnectableObject::connectMyInputTo(), ossimConnectableObject::disconnectMyInput(), ossimConnectableContainerInterface::findObject(), ossimIdVisitor::getObject(), PTR_CAST, ossimIdVisitor::reset(), ossimIdVisitor::setId(), and ossimVisitor::VISIT_CHILDREN.

Referenced by loadState().

1364 {
1365  // cout << "this->getId(): " << this->getId() << endl;
1366 
1367  if(idMapping.size())
1368  {
1369  map<ossimId, vector<ossimId> >::const_iterator iter = idMapping.begin();
1370 
1371 
1372  while(iter != idMapping.end())
1373  {
1374  // cout << "(*iter).first): " << (*iter).first << endl;
1375 #if 0
1376  ossimConnectableObject* currentSource = findObject((*iter).first);
1377 #else
1378  ossimIdVisitor visitor( (*iter).first,
1380  // ossimVisitor::VISIT_INPUTS ) );
1381  accept( visitor );
1382  ossimConnectableObject* currentSource = visitor.getObject();
1383 #endif
1384 
1385  if(currentSource)
1386  {
1387  // cout << "currentSource->getClassName: " << currentSource->getClassName() << endl;
1388  long upperBound = (long)(*iter).second.size();
1389  for(long index = 0; index < upperBound; ++index)
1390  {
1391  //cout << "(*iter).second[index]: " << (*iter).second[index] << endl;
1392 
1393  if((*iter).second[index].getId() > -1)
1394  {
1395 #if 0
1396  ossimConnectableObject* inputSource =
1397  PTR_CAST(ossimConnectableObject, findObject((*iter).second[index]));
1398 #else
1399  visitor.reset();
1400  visitor.setId( (*iter).second[index] );
1401  accept( visitor );
1402  ossimConnectableObject* inputSource = visitor.getObject();
1403 #endif
1404  // cout << "inputSource is " << (inputSource?"good...":"null...") << endl;
1405  if ( inputSource )
1406  {
1407  // cout << "inputSource->getClassName(): " << inputSource->getClassName() << endl;
1408 
1409  // Check for connection to self.
1410  if ( this != inputSource )
1411  {
1412  currentSource->connectMyInputTo(index, inputSource);
1413  }
1414  // else warning???
1415  }
1416  }
1417  else // -1 id
1418  {
1419  currentSource->disconnectMyInput((ossim_int32)index);
1420  }
1421  }
1422  }
1423  else
1424  {
1425  cerr << "Could not find " << (*iter).first << " for source: ";
1426  return false;
1427  }
1428  ++iter;
1429  }
1430  }
1431 
1432  // abort();
1433  return true;
1434 }
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 void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
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 ossimConnectableObject * findObject(const ossimId &id, bool recurse=true)=0
int ossim_int32

◆ connectInputEvent()

void ossimImageChain::connectInputEvent ( ossimConnectionEvent event)
virtual

Reimplemented from ossimConnectableObjectListener.

Definition at line 1650 of file ossimImageChain.cpp.

References ossimConnectableObject::findInputIndex(), ossimEvent::getObject(), imageChainList(), initialize(), size, and theLoadStateFlag.

1651 {
1652  if(imageChainList().size())
1653  {
1654  if(event.getObject()==this)
1655  {
1656  if(imageChainList()[imageChainList().size()-1].valid())
1657  {
1658  for(ossim_uint32 i = 0; i < event.getNumberOfNewObjects(); ++i)
1659  {
1660  ossimConnectableObject* obj = event.getNewObject(i);
1661  imageChainList()[imageChainList().size()-1]->connectMyInputTo(findInputIndex(obj),
1662  obj,
1663  false);
1664  }
1665  }
1666  }
1667  else if(event.getObject() == imageChainList()[0].get())
1668  {
1669  if(!theLoadStateFlag)
1670  {
1671 // theInputObjectList = imageChainList()[0]->getInputList();
1672  }
1673  }
1674  initialize();
1675  }
1676 }
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 void initialize()
const ossimObject * getObject() const
This is the originating object that originally produced the event.
Definition: ossimEvent.cpp:64
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32

◆ connectOutputEvent()

void ossimImageChain::connectOutputEvent ( ossimConnectionEvent event)
virtual

Reimplemented from ossimConnectableObjectListener.

Definition at line 1678 of file ossimImageChain.cpp.

1679 {
1680 }

◆ deleteFirst()

bool ossimImageChain::deleteFirst ( )

Deletes the first object.

Note this is really most right of the chain. Returns true if deletion occurred, false if the chain is empty.

Definition at line 1577 of file ossimImageChain.cpp.

References ossimListenerManager::fireEvent(), imageChainList(), OSSIM_EVENT_REMOVE_OBJECT_ID, prepareForRemoval(), and size.

1578 {
1579  if (imageChainList().size() == 0) return false;
1580 
1582  prepareForRemoval(imageChainList()[0].get());
1583  // Clear any listeners, memory.
1584  event.setObjectList(imageChainList()[0].get());
1585  imageChainList()[0] = 0;
1586  // Remove from the vector.
1587  std::vector<ossimRefPtr<ossimConnectableObject> >::iterator i = imageChainList().begin();
1588  imageChainList().erase(i);
1589  fireEvent(event);
1590  return true;
1591 }
void prepareForRemoval(ossimConnectableObject *connectableObject)
Inserts all of this object&#39;s children and inputs into the container provided.
virtual void fireEvent(ossimEvent &event)
#define OSSIM_EVENT_REMOVE_OBJECT_ID
Definition: ossimEventIds.h:28
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ deleteLast()

bool ossimImageChain::deleteLast ( )

Deletes the last object.

Note this is really most left of the chain. Returns true if deletion occurred, false if the chain is empty.

Definition at line 1593 of file ossimImageChain.cpp.

References ossimListenerManager::fireEvent(), imageChainList(), OSSIM_EVENT_REMOVE_OBJECT_ID, prepareForRemoval(), and size.

Referenced by ossimSingleImageChain::reset().

1594 {
1595  if (imageChainList().size() == 0) return false;
1596 
1598  // Clear any listeners, memory.
1599  ossim_uint32 idx = (ossim_uint32)imageChainList().size() - 1;
1600  prepareForRemoval(imageChainList()[idx].get());
1601  event.setObjectList(imageChainList()[idx].get());
1602  imageChainList()[idx] = 0;
1603  // Remove from the vector.
1604  imageChainList().pop_back();
1605  fireEvent(event);
1606  return true;
1607 }
void prepareForRemoval(ossimConnectableObject *connectableObject)
Inserts all of this object&#39;s children and inputs into the container provided.
virtual void fireEvent(ossimEvent &event)
#define OSSIM_EVENT_REMOVE_OBJECT_ID
Definition: ossimEventIds.h:28
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32

◆ deleteList()

void ossimImageChain::deleteList ( )

Definition at line 1609 of file ossimImageChain.cpp.

References ossimListenerManager::fireEvent(), imageChainList(), OSSIM_EVENT_REMOVE_OBJECT_ID, and prepareForRemoval().

Referenced by loadState(), and ~ossimImageChain().

1610 {
1611  ossim_uint32 upper = (ossim_uint32) imageChainList().size();
1612  ossim_uint32 idx = 0;
1614  for(; idx < upper; ++idx)
1615  {
1616  if(imageChainList()[idx].valid())
1617  {
1618  event.getObjectList().push_back(imageChainList()[idx].get());
1619  prepareForRemoval(imageChainList()[idx].get());
1620  imageChainList()[idx] = 0;
1621  }
1622  }
1623 
1624  imageChainList().clear();
1625  fireEvent(event);
1626 }
void prepareForRemoval(ossimConnectableObject *connectableObject)
Inserts all of this object&#39;s children and inputs into the container provided.
virtual void fireEvent(ossimEvent &event)
#define OSSIM_EVENT_REMOVE_OBJECT_ID
Definition: ossimEventIds.h:28
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32

◆ disableSource()

void ossimImageChain::disableSource ( )
virtual

Reimplemented from ossimSource.

Definition at line 1548 of file ossimImageChain.cpp.

References ossimSource::disableSource(), imageChainList(), PTR_CAST, and ossimSource::theEnableFlag.

1549 {
1550  long upper = (ossim_uint32)imageChainList().size();
1551 
1552  for(long index = upper - 1; index >= 0; --index)
1553  {
1554  // make sure we initialize in reverse order.
1555  // some source may depend on the initialization of
1556  // its inputs
1557  ossimSource* source = PTR_CAST(ossimSource, imageChainList()[index].get());
1558  if(source)
1559  {
1560  source->disableSource();
1561  }
1562  }
1563 
1564  theEnableFlag = false;
1565 }
bool theEnableFlag
Definition: ossimSource.h:62
virtual void disableSource()
Definition: ossimSource.cpp:89
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ disconnectInputEvent()

void ossimImageChain::disconnectInputEvent ( ossimConnectionEvent event)
virtual

Reimplemented from ossimConnectableObjectListener.

Definition at line 1629 of file ossimImageChain.cpp.

References ossimEvent::getObject(), ossimConnectionEvent::getOldObject(), imageChainList(), and size.

1630 {
1631  if(imageChainList().size())
1632  {
1633  if(event.getObject()==this)
1634  {
1635  if(imageChainList()[imageChainList().size()-1].valid())
1636  {
1637  for(ossim_uint32 i = 0; i < event.getNumberOfOldObjects(); ++i)
1638  {
1639  imageChainList()[imageChainList().size()-1]->disconnectMyInput(event.getOldObject(i));
1640  }
1641  }
1642  }
1643  }
1644 }
const ossimObject * getObject() const
This is the originating object that originally produced the event.
Definition: ossimEvent.cpp:64
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32
virtual ossimConnectableObject * getOldObject(ossim_uint32 i=0)

◆ disconnectOutputEvent()

void ossimImageChain::disconnectOutputEvent ( ossimConnectionEvent event)
virtual

Reimplemented from ossimConnectableObjectListener.

Definition at line 1646 of file ossimImageChain.cpp.

1647 {
1648 }

◆ enableSource()

void ossimImageChain::enableSource ( )
virtual

Reimplemented from ossimSource.

Definition at line 1529 of file ossimImageChain.cpp.

References ossimSource::enableSource(), imageChainList(), PTR_CAST, and ossimSource::theEnableFlag.

1530 {
1531  ossim_int32 upper = static_cast<ossim_int32>(imageChainList().size());
1532  ossim_int32 index = 0;
1533  for(index = upper - 1; index >= 0; --index)
1534  {
1535  // make sure we initialize in reverse order.
1536  // some source may depend on the initialization of
1537  // its inputs
1538  ossimSource* source = PTR_CAST(ossimSource, imageChainList()[index].get());
1539  if(source)
1540  {
1541  source->enableSource();
1542  }
1543  }
1544 
1545  theEnableFlag = true;
1546 }
bool theEnableFlag
Definition: ossimSource.h:62
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual void enableSource()
Definition: ossimSource.cpp:84
int ossim_int32

◆ findInputConnectionIds()

void ossimImageChain::findInputConnectionIds ( vector< ossimId > &  result,
const ossimKeywordlist kwl,
const char *  prefix = NULL 
)
protected

Definition at line 1329 of file ossimImageChain.cpp.

References ossimKeywordlist::find(), ossimKeywordlist::getSubstringKeyList(), ossimString::toInt(), ossimString::toLong(), and ossimString::toString().

1332 {
1333  ossimString copyPrefix = prefix;
1334  ossim_uint32 idx = 0;
1335 
1336  ossimString regExpression = ossimString("^") + ossimString(prefix) + "input_connection[0-9]+";
1337  vector<ossimString> keys =
1338  kwl.getSubstringKeyList( regExpression );
1339 
1340  ossim_int32 offset = (ossim_int32)(copyPrefix+"input_connection").size();
1341  ossim_uint32 numberOfKeys = (ossim_uint32)keys.size();
1342  std::vector<int> theNumberList(numberOfKeys);
1343  for(idx = 0; idx < theNumberList.size();++idx)
1344  {
1345  ossimString numberStr(keys[idx].begin() + offset,
1346  keys[idx].end());
1347  theNumberList[idx] = numberStr.toInt();
1348  }
1349  std::sort(theNumberList.begin(), theNumberList.end());
1350  copyPrefix += ossimString("input_connection");
1351  for(idx=0;idx < theNumberList.size();++idx)
1352  {
1353  const char* lookup = kwl.find(copyPrefix,ossimString::toString(theNumberList[idx]));
1354  if(lookup)
1355  {
1356  long id = ossimString(lookup).toLong();
1357  result.push_back(ossimId(id));
1358  }
1359  }
1360 }
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
unsigned int ossim_uint32
std::vector< ossimString > getSubstringKeyList(const ossimString &regularExpression) const
long toLong() const
toLong&#39;s deprecated, please use the toInts...
int ossim_int32

◆ getBoundingRect()

ossimIrect ossimImageChain::getBoundingRect ( ossim_uint32  resLevel = 0) const
virtual

Will pass this call to the head of the list.

Reimplemented from ossimImageSource.

Definition at line 1043 of file ossimImageChain.cpp.

References ossimConnectableObject::getInput(), imageChainList(), ossimSource::isSourceEnabled(), ossimDrect::makeNan(), PTR_CAST, and size.

Referenced by ossimChipProcTool::computeAdjustedViewFromGrect(), and ossimIgen::initializeChain().

1044 {
1045  if((imageChainList().size() > 0)&&(isSourceEnabled()))
1046  {
1047 
1049  imageChainList()[0].get());
1050 
1051  if(interface)
1052  {
1053  return interface->getBoundingRect(resLevel);
1054  }
1055  }
1056  else
1057  {
1058  if(getInput(0))
1059  {
1061  getInput(0));
1062  if(interface)
1063  {
1064  return interface->getBoundingRect();
1065  }
1066  }
1067  }
1068  ossimDrect rect;
1069  rect.makeNan();
1070 
1071  return rect;
1072 
1073 }
void makeNan()
Definition: ossimDrect.h:388
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getChainList() [1/2]

ossimConnectableObject::ConnectableObjectList& ossimImageChain::getChainList ( )
inline

Definition at line 31 of file ossimImageChain.h.

31 {return theImageChainList;}
ossimConnectableObject::ConnectableObjectList theImageChainList
This will hold a sequence of image sources.

◆ getChainList() [2/2]

const ossimConnectableObject::ConnectableObjectList& ossimImageChain::getChainList ( ) const
inline

Definition at line 32 of file ossimImageChain.h.

32 {return theImageChainList;}
ossimConnectableObject::ConnectableObjectList theImageChainList
This will hold a sequence of image sources.

◆ getChildren()

void ossimImageChain::getChildren ( vector< ossimConnectableObject *> &  children,
bool  immediateChildrenOnlyFlag 
)
virtual

Definition at line 563 of file ossimImageChain.cpp.

References imageChainList(), and PTR_CAST.

565 {
566  ossim_uint32 i = 0;
567 
568  vector<ossimConnectableObject*> temp;
569  for(i = 0; i < imageChainList().size();++i)
570  {
571  temp.push_back(imageChainList()[i].get());
572  }
573 
574  for(i = 0; i < temp.size();++i)
575  {
577  temp[i]);
578  if(immediateChildrenOnlyFlag)
579  {
580  children.push_back(temp[i]);
581  }
582  else if(!interface)
583  {
584  children.push_back(temp[i]);
585  }
586  }
587 
588  if(!immediateChildrenOnlyFlag)
589  {
590  for(i = 0; i < temp.size();++i)
591  {
593  temp[i]);
594  if(interface)
595  {
596  interface->getChildren(children, false);
597  }
598  }
599  }
600 }
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getConnectableObject()

ossimConnectableObject * ossimImageChain::getConnectableObject ( ossim_uint32  index)
virtual

Same as operator[](ossim_uint32 i)

Parameters
indexIndex of object to get.
See also
getNumberOfObjects(false) to get the number of objects inside the container.
Returns
Container's object at that index or NULL if out of range.
Note
This does not recurse into other containers.

Implements ossimConnectableContainerInterface.

Definition at line 1753 of file ossimImageChain.cpp.

References imageChainList(), and size.

Referenced by operator[]().

1755 {
1756  if(imageChainList().size() && (index < imageChainList().size()))
1757  {
1758  return imageChainList()[index].get();
1759  }
1760 
1761  return 0;
1762 }
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ getDecimationFactor()

void ossimImageChain::getDecimationFactor ( ossim_uint32  resLevel,
ossimDpt result 
) const
virtual

Will return the decimation factor for the given resolution level.

the decimation is the scale from Resolution 0 or full res. Usually this is a power of 2 decimation where the decimation result is 1.0/2^resoltion.

Reimplemented from ossimImageSource.

Definition at line 1131 of file ossimImageChain.cpp.

References ossimConnectableObject::getInput(), imageChainList(), ossimSource::isSourceEnabled(), ossimDpt::makeNan(), PTR_CAST, and size.

1133 {
1134  if((imageChainList().size() > 0)&&(isSourceEnabled()))
1135  {
1137  imageChainList()[0].get());
1138  if(interface)
1139  {
1140  interface->getDecimationFactor(resLevel,
1141  result);
1142  return;
1143  }
1144  }
1145  else
1146  {
1147  if(getInput(0))
1148  {
1150  getInput(0));
1151  if(interface)
1152  {
1153  interface->getDecimationFactor(resLevel, result);
1154  return;
1155  }
1156  }
1157  }
1158 
1159  result.makeNan();
1160 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
void makeNan()
Definition: ossimDpt.h:65

◆ getDecimationFactors()

void ossimImageChain::getDecimationFactors ( vector< ossimDpt > &  decimations) const
virtual

Definition at line 1162 of file ossimImageChain.cpp.

References ossimConnectableObject::getInput(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

1163 {
1164  if((imageChainList().size() > 0)&&(isSourceEnabled()))
1165  {
1167  imageChainList()[0].get());
1168  if(interface)
1169  {
1170  interface->getDecimationFactors(decimations);
1171  }
1172  }
1173  else
1174  {
1175  if(getInput(0))
1176  {
1178  getInput(0));
1179  if(interface)
1180  {
1181  interface->getDecimationFactors(decimations);
1182  return;
1183  }
1184  }
1185  }
1186 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getFirstObject()

ossimObject * ossimImageChain::getFirstObject ( )
virtual

Definition at line 144 of file ossimImageChain.cpp.

References imageChainList(), and size.

Referenced by addFirst().

145 {
146  if(imageChainList().size()>0)
147  {
148  return dynamic_cast<ossimImageSource*>(imageChainList()[0].get());
149  }
150 
151  return 0;
152 }
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ getFirstSource() [1/2]

ossimImageSource * ossimImageChain::getFirstSource ( )
virtual

Return the first source which is the one that first receives the getTile request.

Definition at line 126 of file ossimImageChain.cpp.

References imageChainList(), and size.

Referenced by ossimShorelineTool::autoComputeThreshold(), processEvent(), and ossimImageChainMtAdaptor::setOriginalChain().

127 {
128  if(imageChainList().size()>0)
129  {
130  return dynamic_cast<ossimImageSource*>(imageChainList()[0].get());
131  }
132 
133  return 0;
134 }
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ getFirstSource() [2/2]

const ossimImageSource * ossimImageChain::getFirstSource ( ) const
virtual

Definition at line 136 of file ossimImageChain.cpp.

References imageChainList(), and size.

137 {
138  if(imageChainList().size()>0)
139  return dynamic_cast<const ossimImageSource*>(imageChainList()[0].get());
140 
141  return 0;
142 }
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimImageChain::getImageGeometry ( )
virtual

Returns the image geometry object associated with this tile source or NULL if not defined.

The geometry contains full-to-local image transform as well as projection (image-to-world). Default implementation returns the image geometry object associated with the next
(left) input source (if any) connected to this source in the chain, or NULL.

Reimplemented from ossimImageSource.

Definition at line 1107 of file ossimImageChain.cpp.

References ossimConnectableObject::getInput(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

Referenced by ossimSingleImageChain::addGeoPolyCutter(), ossimSubImageTool::execute(), ATP::AtpGenerator::initialize(), and ossimIgen::initializeChain().

1108 {
1109  if((imageChainList().size() > 0)&&(isSourceEnabled()))
1110  {
1111  ossimImageSource* interface = PTR_CAST(ossimImageSource, imageChainList()[0].get());
1112  if( interface )
1113  {
1114  return interface->getImageGeometry();
1115  }
1116  }
1117  else
1118  {
1119  if(getInput(0))
1120  {
1122  if(interface)
1123  {
1124  return interface->getImageGeometry();
1125  }
1126  }
1127  }
1129 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getLastObject()

ossimObject * ossimImageChain::getLastObject ( )
virtual

Definition at line 172 of file ossimImageChain.cpp.

References imageChainList(), and size.

173 {
174  if(imageChainList().size()>0)
175  {
176  return dynamic_cast<ossimImageSource*>((*(imageChainList().end()-1)).get());
177  }
178 
179  return 0;
180 }
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ getLastSource() [1/2]

ossimImageSource * ossimImageChain::getLastSource ( )
virtual

Return the last source which is the one that last receives the getTile request.

Definition at line 154 of file ossimImageChain.cpp.

References imageChainList(), and size.

Referenced by ATP::AtpGenerator::getValidVertices().

155 {
156  if(imageChainList().size()>0)
157  {
158  return dynamic_cast<ossimImageSource*>((*(imageChainList().end()-1)).get());
159  }
160 
161  return NULL;
162 }
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ getLastSource() [2/2]

const ossimImageSource * ossimImageChain::getLastSource ( ) const
virtual

Definition at line 164 of file ossimImageChain.cpp.

References imageChainList(), and size.

165 {
166  if(imageChainList().size()>0)
167  return dynamic_cast<const ossimImageSource*>((*(imageChainList().end()-1)).get());
168 
169  return NULL;
170 }
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ getMaxPixelValue()

double ossimImageChain::getMaxPixelValue ( ossim_uint32  band = 0) const
virtual

Returns the max pixel of the band.

Reimplemented from ossimImageSource.

Definition at line 921 of file ossimImageChain.cpp.

References ossim::defaultMax(), ossimConnectableObject::getInput(), ossimImageSource::getMaxPixelValue(), getOutputScalarType(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

922 {
923  if((imageChainList().size() > 0)&&(isSourceEnabled()))
924  {
926  imageChainList()[0].get());
927  if(inter)
928  {
929  return inter->getMaxPixelValue(band);
930  }
931  }
932  else
933  {
934  if(getInput(0))
935  {
937  getInput(0));
938  if(interface)
939  {
940  return interface->getMaxPixelValue(band);
941  }
942  }
943  }
944 
946 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
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.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
OSSIM_DLL double defaultMax(ossimScalarType scalarType)
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.

◆ getMinPixelValue()

double ossimImageChain::getMinPixelValue ( ossim_uint32  band = 0) const
virtual

Returns the min pixel of the band.

Reimplemented from ossimImageSource.

Definition at line 894 of file ossimImageChain.cpp.

References ossim::defaultMin(), ossimConnectableObject::getInput(), getOutputScalarType(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

895 {
896  if((imageChainList().size() > 0)&&(isSourceEnabled()))
897  {
899  imageChainList()[0].get());
900  if(interface)
901  {
902  return interface->getMinPixelValue(band);
903  }
904  }
905  else
906  {
907  if(getInput(0))
908  {
910  getInput(0));
911  if(interface)
912  {
913  return interface->getMinPixelValue(band);
914  }
915  }
916  }
917 
919 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
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.
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
Definition: ossimCommon.cpp:73
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getNullPixelValue()

double ossimImageChain::getNullPixelValue ( ossim_uint32  band = 0) const
virtual

Each band has a null pixel associated with it.

The null pixel represents an invalid value.

Reimplemented from ossimImageSource.

Definition at line 867 of file ossimImageChain.cpp.

References ossim::defaultNull(), ossimConnectableObject::getInput(), getOutputScalarType(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

Referenced by ossimViewshedTool::computeViewshed().

868 {
869  if((imageChainList().size() > 0)&&(isSourceEnabled()))
870  {
872  imageChainList()[0].get());
873  if(interface)
874  {
875  return interface->getNullPixelValue(band);
876  }
877  }
878  else
879  {
880  if(getInput(0))
881  {
883  getInput(0));
884  if(interface)
885  {
886  return interface->getNullPixelValue(band);
887  }
888  }
889  }
890 
892 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
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.
yy_size_t size
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getNumberOfDecimationLevels()

ossim_uint32 ossimImageChain::getNumberOfDecimationLevels ( ) const
virtual

Will return the number of resolution levels.

Note: resolution level 0 is included in the return count.

Reimplemented from ossimImageSource.

Definition at line 1188 of file ossimImageChain.cpp.

References ossimConnectableObject::getInput(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

1189 {
1190  if((imageChainList().size() > 0)&&(isSourceEnabled()))
1191  {
1193  imageChainList()[0].get());
1194 
1195  if(interface)
1196  {
1197  return interface->getNumberOfDecimationLevels();
1198  }
1199  }
1200  else
1201  {
1202  if(getInput(0))
1203  {
1205  getInput(0));
1206  if(interface)
1207  {
1208  return interface->getNumberOfDecimationLevels();
1209  }
1210  }
1211  }
1212 
1213  return 1;
1214 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getNumberOfInputBands()

ossim_uint32 ossimImageChain::getNumberOfInputBands ( ) const
virtual

this call is passed to the head of the list.

Implements ossimImageSource.

Definition at line 840 of file ossimImageChain.cpp.

References ossimConnectableObject::getInput(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

841 {
842  if((imageChainList().size() > 0)&&(isSourceEnabled()))
843  {
845  imageChainList()[0].get());
846  if(interface)
847  {
848  return interface->getNumberOfOutputBands();
849  }
850  }
851  else
852  {
853  if(getInput(0))
854  {
856  getInput(0));
857  if(interface)
858  {
859  return interface->getNumberOfOutputBands();
860  }
861  }
862  }
863 
864  return 0;
865 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getNumberOfObjects()

ossim_uint32 ossimImageChain::getNumberOfObjects ( bool  recurse = true) const
virtual

Returns the number of objects within this container and all child containers.

Parameters
recurseIf true and object is a contains containers; all objects will be conter. If false only the objects of this container will be counted (theImageChainList.size()).

Implements ossimConnectableContainerInterface.

Definition at line 451 of file ossimImageChain.cpp.

References ossimConnectableContainerInterface::getNumberOfObjects(), imageChainList(), and PTR_CAST.

Referenced by getNumberOfSources().

452 {
453  ossim_uint32 result = (ossim_uint32)imageChainList().size();
454 
455  if(recurse)
456  {
457  for(ossim_uint32 i = 0; i < imageChainList().size(); ++i)
458  {
460  if(child)
461  {
462  result += child->getNumberOfObjects(true);
463  }
464  }
465  }
466 
467  return result;
468 }
virtual ossim_uint32 getNumberOfObjects(bool recurse=true) const =0
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getNumberOfSources()

ossim_uint32 ossimImageChain::getNumberOfSources ( ) const
virtual

Deprecated! Please use getNumberOfObjects(false).

Returns
The number of objects in this container or (theImageChainList.size()).

Definition at line 470 of file ossimImageChain.cpp.

References getNumberOfObjects(), ossimNotify(), and ossimNotifyLevel_NOTICE.

471 {
473  << "ossimImageChain::getNumberOfSources is deprecated!"
474  << "\nUse: ossimImageChain::getNumberOfObjects(false)"
475  << std::endl;
476  return getNumberOfObjects(false);
477 }
virtual ossim_uint32 getNumberOfObjects(bool recurse=true) const
Returns the number of objects within this container and all child containers.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getOutputBandList()

void ossimImageChain::getOutputBandList ( std::vector< ossim_uint32 > &  bandList) const
virtual

Initializes bandList.

This implementation initializes to the zero based order of input bands. Derived classes that are band selectors should override.

Parameters
bandListInitialized by this.

Reimplemented from ossimImageSource.

Definition at line 948 of file ossimImageChain.cpp.

References ossimImageSource::getOutputBandList(), imageChainList(), ossimSource::isSourceEnabled(), size, and ossimRefPtr< T >::valid().

949 {
950  if( (imageChainList().size() > 0) && isSourceEnabled() )
951  {
953  dynamic_cast<const ossimImageSource*>( imageChainList()[0].get() );
954  if( inter.valid() )
955  {
956  // cout << "cn: " << inter->getClassName() << endl;
957  inter->getOutputBandList(bandList);
958  }
959  }
960 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
bool valid() const
Definition: ossimRefPtr.h:75
virtual void getOutputBandList(std::vector< ossim_uint32 > &bandList) const
Initializes bandList.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ getOutputScalarType()

ossimScalarType ossimImageChain::getOutputScalarType ( ) const
virtual

This call is passed to the head of the list.

Reimplemented from ossimImageSource.

Definition at line 962 of file ossimImageChain.cpp.

References ossimConnectableObject::getInput(), imageChainList(), ossimSource::isSourceEnabled(), OSSIM_SCALAR_UNKNOWN, PTR_CAST, and size.

Referenced by ATP::AtpGenerator::constructChain(), ossimChipProcTool::createInputChain(), getMaxPixelValue(), getMinPixelValue(), getNullPixelValue(), and ossimHdf5Tool::loadImageFiles().

963 {
964  if((imageChainList().size() > 0)&&(isSourceEnabled()))
965  {
967  imageChainList()[0].get());
968  if(interface)
969  {
970  return interface->getOutputScalarType();
971  }
972  }
973  else
974  {
975  if(getInput(0))
976  {
978  getInput(0));
979  if(interface)
980  {
981  return interface->getOutputScalarType();
982  }
983  }
984  }
985 
986  return OSSIM_SCALAR_UNKNOWN;
987 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getTile()

ossimRefPtr< ossimImageData > ossimImageChain::getTile ( const ossimIrect tileRect,
ossim_uint32  resLevel = 0 
)
virtual

Within the image chain will pass the head of the list.

Reimplemented from ossimImageSource.

Reimplemented in ossimImageChainMtAdaptor.

Definition at line 796 of file ossimImageChain.cpp.

References ossimRefPtr< T >::get(), ossimConnectableObject::getInput(), ossimImageSource::getTile(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

Referenced by ossimHlzTool::getChip(), ossimShorelineTool::getChip(), ossimViewshedTool::getChip(), ossimChipProcTool::getChip(), and ossimImageChainMtAdaptor::getTile().

799 {
800  if((imageChainList().size() > 0)&&(isSourceEnabled()))
801  {
803  imageChainList()[0].get());
804 
805  if(inputSource)
806  {
807  // make sure we initialize in reverse order.
808  // some source may depend on the initialization of
809  // its inputs
810  return inputSource->getTile(tileRect, resLevel);
811  }
812  }
813  else
814  {
815  if(getInput(0))
816  {
818  if(inputSource)
819  {
820  ossimRefPtr<ossimImageData> inputTile = inputSource->getTile(tileRect, resLevel);
821 // if(inputTile.valid())
822 // {
823 // std::cout << *(inputTile.get()) << std::endl;
824 // }
825  return inputTile.get();
826  }
827  }
828  }
829 // std::cout << "RETURNING A BLANK TILE!!!!" << std::endl;
830 /*
831  if(theBlankTile.get())
832  {
833  theBlankTile->setImageRectangle(tileRect);
834  }
835  return theBlankTile;
836  */
837  return 0;
838 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)

◆ getTileHeight()

ossim_uint32 ossimImageChain::getTileHeight ( ) const
virtual

This call is passed to the head of the list.

Reimplemented from ossimImageSource.

Definition at line 1016 of file ossimImageChain.cpp.

References ossimConnectableObject::getInput(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

1017 {
1018  if((imageChainList().size() > 0)&&(isSourceEnabled()))
1019  {
1021  imageChainList()[0].get());
1022  if(interface)
1023  {
1024  return interface->getTileHeight();
1025  }
1026  }
1027  else
1028  {
1029  if(getInput(0))
1030  {
1032  getInput(0));
1033  if(interface)
1034  {
1035  return interface->getTileHeight();
1036  }
1037  }
1038  }
1039 
1040  return 0;
1041 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getTileWidth()

ossim_uint32 ossimImageChain::getTileWidth ( ) const
virtual

This call is passed to the head of the list.

Reimplemented from ossimImageSource.

Definition at line 989 of file ossimImageChain.cpp.

References ossimConnectableObject::getInput(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

990 {
991  if((imageChainList().size() > 0)&&(isSourceEnabled()))
992  {
994  imageChainList()[0].get());
995  if(interface)
996  {
997  return interface->getTileWidth();;
998  }
999  }
1000  else
1001  {
1002  if(getInput(0))
1003  {
1005  getInput(0));
1006  if(interface)
1007  {
1008  return interface->getTileWidth();
1009  }
1010  }
1011  }
1012 
1013  return 0;
1014 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ getValidImageVertices()

void ossimImageChain::getValidImageVertices ( vector< ossimIpt > &  validVertices,
ossimVertexOrdering  ordering = OSSIM_CLOCKWISE_ORDER,
ossim_uint32  resLevel = 0 
) const
virtual

Definition at line 1075 of file ossimImageChain.cpp.

References ossimConnectableObject::getInput(), imageChainList(), ossimSource::isSourceEnabled(), PTR_CAST, and size.

1078 {
1079  if((imageChainList().size() > 0)&&(isSourceEnabled()))
1080  {
1082  imageChainList()[0].get());
1083 
1084  if(interface)
1085  {
1086  interface->getValidImageVertices(validVertices,
1087  ordering,
1088  resLevel);
1089  }
1090  }
1091  else
1092  {
1093  if(getInput(0))
1094  {
1096  getInput(0));
1097  if(interface)
1098  {
1099  interface->getValidImageVertices(validVertices,
1100  ordering,
1101  resLevel);
1102  }
1103  }
1104  }
1105 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ imageChainList() [1/2]

virtual ossimConnectableObject::ConnectableObjectList& ossimImageChain::imageChainList ( )
inlinevirtual

◆ imageChainList() [2/2]

virtual const ossimConnectableObject::ConnectableObjectList& ossimImageChain::imageChainList ( ) const
inlinevirtual

Reimplemented in ossimImageChainMtAdaptor.

Definition at line 374 of file ossimImageChain.h.

374 { return theImageChainList; }
ossimConnectableObject::ConnectableObjectList theImageChainList
This will hold a sequence of image sources.

◆ indexOf()

ossim_int32 ossimImageChain::indexOf ( ossimConnectableObject obj) const
virtual

Definition at line 1764 of file ossimImageChain.cpp.

References imageChainList().

Referenced by replace().

1765 {
1766  ossim_uint32 idx = 0;
1767 
1768  for(idx = 0; idx < imageChainList().size();++idx)
1769  {
1770  if(imageChainList()[idx] == obj)
1771  {
1772  return (ossim_int32)idx;
1773  }
1774  }
1775 
1776  return -1;
1777 }
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32
int ossim_int32

◆ initialize()

void ossimImageChain::initialize ( )
virtual

Implements ossimImageSource.

Reimplemented in ossimImageChainMtAdaptor.

Definition at line 1497 of file ossimImageChain.cpp.

Referenced by ATP::AtpAnnotatedImage::AtpAnnotatedImage(), connectInputEvent(), ossimSingleImageChain::createRenderedChain(), ossimShorelineTool::execute(), ossimIgen::initializeChain(), and ossimHdf5Tool::loadImageFiles().

1498 {
1499  static const char* MODULE = "ossimImageChain::initialize()";
1500  if (traceDebug()) CLOG << " Entered..." << std::endl;
1501 
1502  long upper = (ossim_uint32)imageChainList().size();
1503 
1504  for(long index = upper - 1; index >= 0; --index)
1505  {
1506  if(traceDebug())
1507  {
1508  CLOG << "initilizing source: "
1509  << imageChainList()[index]->getClassName()
1510  << std::endl;
1511  }
1512  if(imageChainList()[index].valid())
1513  {
1514  ossimSource* interface =
1515  PTR_CAST(ossimSource, imageChainList()[index].get());
1516 
1517  if(interface)
1518  {
1519  // make sure we initialize in reverse order.
1520  // some source may depend on the initialization of
1521  // its inputs
1522  interface->initialize();
1523  }
1524  }
1525  }
1526  if (traceDebug()) CLOG << " Exited..." << std::endl;
1527 }
#define CLOG
Definition: ossimTrace.h:23
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ insertLeft() [1/2]

bool ossimImageChain::insertLeft ( ossimConnectableObject newObj,
const ossimId id 
)

Definition at line 748 of file ossimImageChain.cpp.

References accept(), ossimConnectableContainerInterface::findObject(), ossimIdVisitor::getObject(), ossimVisitor::VISIT_CHILDREN, and ossimVisitor::VISIT_INPUTS.

Referenced by ossimSingleImageChain::addScalarRemapper().

750 {
751 #if 1
752  ossimIdVisitor visitor( id,
754  accept( visitor );
755  ossimConnectableObject* obj = visitor.getObject();
756  if ( obj )
757  {
758  return insertLeft(newObj, obj);
759  }
760  return false;
761 #else
762  ossimConnectableObject* obj = findObject(id, false);
763  if(obj)
764  {
765  return insertLeft(newObj, obj);
766  }
767  return false;
768 #endif
769 }
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.
virtual ossimConnectableObject * findObject(const ossimId &id, bool recurse=true)=0
bool insertLeft(ossimConnectableObject *newObj, const ossimId &id)

◆ insertLeft() [2/2]

bool ossimImageChain::insertLeft ( ossimConnectableObject newObj,
ossimConnectableObject leftOfThisObj 
)

Definition at line 711 of file ossimImageChain.cpp.

References add(), addLast(), ossimListenerManager::addListener(), ossimConnectableObject::changeOwner(), ossimConnectableObject::connectInputList(), ossimConnectableObject::connectMyInputTo(), ossimConnectableObject::disconnectAllInputs(), ossimListenerManager::fireEvent(), ossimConnectableObject::getInputList(), imageChainList(), OSSIM_EVENT_ADD_OBJECT_ID, and size.

713 {
714  if(!newObj&&!leftOfThisObj) return false;
715  if(!imageChainList().size())
716  {
717  return add(newObj);
718  }
719  std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = std::find(imageChainList().begin(), imageChainList().end(), leftOfThisObj);
720  if(iter!=imageChainList().end())
721  {
722  if((iter+1)==imageChainList().end())
723  {
724  return addLast(newObj);
725  }
726  else
727  {
728  ossimConnectableObject::ConnectableObjectList inputList = leftOfThisObj->getInputList();
729 
730  newObj->connectInputList(inputList);
731 
732  leftOfThisObj->disconnectAllInputs();
733  leftOfThisObj->connectMyInputTo(newObj);
734  newObj->changeOwner(this);
736  imageChainList().insert(iter+1, newObj);
737  // Send an event to any listeners.
739  event.setObjectList(newObj);
740  fireEvent(event);
741  return true;
742  }
743  }
744 
745  return false;
746 }
virtual bool addListener(ossimListener *listener)
bool addLast(ossimConnectableObject *obj)
Adds it to the end.
virtual void fireEvent(ossimEvent &event)
const ConnectableObjectList & getInputList() const
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
virtual void changeOwner(ossimObject *owner)
Permits changing the object&#39;s owner.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define OSSIM_EVENT_ADD_OBJECT_ID
Definition: ossimEventIds.h:27
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 bool connectInputList(ConnectableObjectList &inputList)
Will disconnect itself from all inputs and reset to the passed in input list.
virtual void disconnectAllInputs()
Will disconnect all of the input objects.

◆ insertRight() [1/2]

bool ossimImageChain::insertRight ( ossimConnectableObject newObj,
ossimConnectableObject rightOfThisObj 
)

Definition at line 649 of file ossimImageChain.cpp.

References add(), ossimListenerManager::addListener(), ossimConnectableObject::changeOwner(), ossimConnectableObject::connectMyInputTo(), ossimConnectableObject::connectOutputList(), ossimConnectableObject::disconnectAllOutputs(), ossimListenerManager::fireEvent(), ossimConnectableObject::getOutputList(), imageChainList(), OSSIM_EVENT_ADD_OBJECT_ID, and size.

Referenced by addFirst(), and insertRight().

651 {
652  if(!newObj&&!rightOfThisObj) return false;
653  if(!imageChainList().size())
654  {
655  return add(newObj);
656  }
657  std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = std::find(imageChainList().begin(), imageChainList().end(), rightOfThisObj);
658 
659  if(iter!=imageChainList().end())
660  {
661  if(iter == imageChainList().begin())
662  {
663  return add(newObj);
664  }
665  else //if(PTR_CAST(ossimImageSource, newObj))
666  {
667  ossimConnectableObject::ConnectableObjectList outputList = rightOfThisObj->getOutputList();
668  rightOfThisObj->disconnectAllOutputs();
669 
670  // Core dump fix. Connect input prior to outputs. (drb)
671  newObj->connectMyInputTo(rightOfThisObj);
672  newObj->connectOutputList(outputList);
673  newObj->changeOwner(this);
675  imageChainList().insert(iter, newObj);
676  // Send event to any listeners.
678  event.setObjectList(newObj);
679  fireEvent(event);
680  return true;
681  }
682  }
683 
684  return false;
685 }
virtual bool addListener(ossimListener *listener)
virtual void disconnectAllOutputs()
Will disconnect all of the output objects.
virtual bool connectOutputList(ConnectableObjectList &outputList)
Will disconnect itself from all outputs and reset to the passed in output list.
virtual void fireEvent(ossimEvent &event)
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
virtual void changeOwner(ossimObject *owner)
Permits changing the object&#39;s owner.
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define OSSIM_EVENT_ADD_OBJECT_ID
Definition: ossimEventIds.h:27
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.
const ConnectableObjectList & getOutputList() const

◆ insertRight() [2/2]

bool ossimImageChain::insertRight ( ossimConnectableObject newObj,
const ossimId id 
)

Definition at line 687 of file ossimImageChain.cpp.

References accept(), ossimConnectableContainerInterface::findObject(), ossimIdVisitor::getObject(), insertRight(), and ossimVisitor::VISIT_CHILDREN.

689 {
690 
691 #if 1
693  accept( visitor );
694  ossimConnectableObject* obj = visitor.getObject();
695  if ( obj )
696  {
697  return insertRight(newObj, obj);
698  }
699  return false;
700 #else
701  ossimConnectableObject* obj = findObject(id, false);
702  if(obj)
703  {
704  return insertRight(newObj, obj);
705  }
706 
707  return false;
708 #endif
709 }
bool insertRight(ossimConnectableObject *newObj, ossimConnectableObject *rightOfThisObj)
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.
virtual ossimConnectableObject * findObject(const ossimId &id, bool recurse=true)=0

◆ loadState()

bool ossimImageChain::loadState ( const ossimKeywordlist kwl,
const char *  prefix = NULL 
)
virtual

Will load the state.

Reimplemented from ossimImageSource.

Reimplemented in ossimImageChainMtAdaptor.

Definition at line 1468 of file ossimImageChain.cpp.

References addAllSources(), CLOG, connectAllSources(), deleteList(), ossimImageSource::loadState(), and theLoadStateFlag.

1470 {
1471  static const char* MODULE = "ossimImageChain::loadState(kwl, prefix)";
1472  deleteList();
1473 
1474  ossimImageSource::loadState(kwl, prefix);
1475 
1476 
1477  theLoadStateFlag = true;
1478  bool result = true;
1479 
1480  map<ossimId, vector<ossimId> > idMapping;
1481  result = addAllSources(idMapping, kwl, prefix);
1482  if(!result)
1483  {
1484  CLOG << "problems adding sources" << std::endl;
1485  }
1486  result = connectAllSources(idMapping);
1487  if(!result)
1488  {
1489  CLOG << "problems connecting sources" << std::endl;
1490  }
1491 
1492  theLoadStateFlag = false;
1493  return result;
1494 }
#define CLOG
Definition: ossimTrace.h:23
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&#39;s later...
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
bool connectAllSources(const map< ossimId, vector< ossimId > > &idMapping)

◆ makeUniqueIds()

void ossimImageChain::makeUniqueIds ( )
virtual

Will cycle through all sources setting their ids.

the idLast wlil be updated so we can recurse into other containers.

Implements ossimConnectableContainerInterface.

Definition at line 430 of file ossimImageChain.cpp.

References imageChainList(), ossimIdManager::instance(), ossimConnectableContainerInterface::makeUniqueIds(), PTR_CAST, and ossimConnectableObject::setId().

431 {
432  setId(ossimIdManager::instance()->generateId());
433  for(long index = 0; index < (long)imageChainList().size(); ++index)
434  {
436  imageChainList()[index].get());
437  if(container)
438  {
439  container->makeUniqueIds();
440  }
441  else
442  {
443  if(imageChainList()[index].valid())
444  {
445  imageChainList()[index]->setId(ossimIdManager::instance()->generateId());
446  }
447  }
448  }
449 }
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
void setId(const ossimId &id)
All connectable objects will have id&#39;s.
static ossimIdManager * instance()

◆ objectDestructingEvent()

void ossimImageChain::objectDestructingEvent ( ossimObjectDestructingEvent event)
virtual

Reimplemented from ossimConnectableObjectListener.

Definition at line 1706 of file ossimImageChain.cpp.

References ossimEvent::getObject(), imageChainList(), PTR_CAST, and removeChild().

1707 {
1708  if(!event.getObject()) return;
1709 
1710  if(imageChainList().size()&&(event.getObject()!=this))
1711  {
1713  event.getObject()));
1714  }
1715 }
virtual bool removeChild(ossimConnectableObject *object)
Will remove the child from the container.
const ossimObject * getObject() const
This is the originating object that originally produced the event.
Definition: ossimEvent.cpp:64
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ operator[]()

ossimConnectableObject * ossimImageChain::operator[] ( ossim_uint32  index)
Parameters
indexIndex of object to get.
See also
getNumberOfObjects(false) to get the number of objects inside the container.
Returns
Container's object at that index or NULL if out of range.

Definition at line 1748 of file ossimImageChain.cpp.

References getConnectableObject().

1749 {
1750  return getConnectableObject(index);
1751 }
virtual ossimConnectableObject * getConnectableObject(ossim_uint32 index)
Same as operator[](ossim_uint32 i)

◆ OSSIM_DEPRECATE_METHOD() [1/6]

ossimImageChain::OSSIM_DEPRECATE_METHOD ( virtual ossimConnectableObject::ConnectableObjectList   findAllObjectsOfTypeconst RTTItypeid &typeInfo, bool recurse=true)

These methods are now deprecated. You can achieve the same thing by using the new visitor design pattern. If this does not achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor

   ossimTypeIdVisitor visitor(tyeId, false, ossimVisitor::VISIT_CHILDREN);
   connectableObject->accept(visitor);
   ossimCollectionVisitor::List& collection = visitor.getObjects();

◆ OSSIM_DEPRECATE_METHOD() [2/6]

ossimImageChain::OSSIM_DEPRECATE_METHOD ( virtual ossimConnectableObject::ConnectableObjectList   findAllObjectsOfTypeconst ossimString &className, bool recurse=true)

These methods are now deprecated. You can achieve the same thing by using the new visitor design pattern. If this does not achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor

   ossimTypeNameVisitor visitor(typeName, false, ossimVisitor::VISIT_CHILDREN);
   connectableObject->accept(visitor);
   ossimCollectionVisitor::List& collection = visitor.getObjects();

◆ OSSIM_DEPRECATE_METHOD() [3/6]

ossimImageChain::OSSIM_DEPRECATE_METHOD ( virtual ossimConnectableObject findFirstObjectOfTypeconst RTTItypeid &typeInfo, bool recurse=true)

These methods are now deprecated. You can achieve the same thing by using the new visitor design pattern. If this does not achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor

   ossimTypeIdVisitor visitor(tyeId, true, ossimVisitor::VISIT_CHILDREN);
   connectableObject->accept(visitor);
   ossimRefPtr<ossimConnectableObject> obj = visitor.getObject();

◆ OSSIM_DEPRECATE_METHOD() [4/6]

ossimImageChain::OSSIM_DEPRECATE_METHOD ( virtual ossimConnectableObject findFirstObjectOfTypeconst ossimString &className, bool recurse=true)

These methods are now deprecated. You can achieve the same thing by using the new visitor design pattern. If this does not achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor

   ossimTypeNameVisitor visitor(className, true, ossimVisitor::VISIT_CHILDREN);
   connectableObject->accept(visitor);
   ossimRefPtr<ossimConnectableObject> obj = visitor.getObject();

◆ OSSIM_DEPRECATE_METHOD() [5/6]

ossimImageChain::OSSIM_DEPRECATE_METHOD ( virtual ossimConnectableObject findObjectconst ossimId &id, bool recurse=true)

These methods are now deprecated. You can achieve the same thing by using the new visitor design pattern. If this does not achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor

   ossimIdVisitor visitor(tyeId, true, ossimVisitor::VISIT_CHILDREN);
   connectableObject->accept(visitor);
   ossimRefPtr<ossimConnectableObject> obj = visitor.getObject();

◆ OSSIM_DEPRECATE_METHOD() [6/6]

ossimImageChain::OSSIM_DEPRECATE_METHOD ( virtual ossimConnectableObject findObjectconst ossimConnectableObject *obj, bool recurse=true)

◆ prepareForRemoval()

void ossimImageChain::prepareForRemoval ( ossimConnectableObject connectableObject)
protected

Inserts all of this object's children and inputs into the container provided.

Since this is itself a form of container, this method will consolidate this chain with the argument container. Consequently, this chain object will not be represented in the container, but its children will be, with correct input and output connections to external objects. Ownership of children will pass to the argument container.

Returns
Returns TRUE if successful.

Definition at line 1567 of file ossimImageChain.cpp.

References ossimConnectableObject::changeOwner(), ossimConnectableObject::disconnect(), and ossimListenerManager::removeListener().

Referenced by deleteFirst(), deleteLast(), and deleteList().

1568 {
1569  if(connectableObject)
1570  {
1571  connectableObject->removeListener((ossimConnectableObjectListener*)this);
1572  connectableObject->changeOwner(0);
1573  connectableObject->disconnect();
1574  }
1575 }
virtual void disconnect(ossimConnectableObject *object=0)
Will disconnect the object passed in.
virtual void changeOwner(ossimObject *owner)
Permits changing the object&#39;s owner.
virtual bool removeListener(ossimListener *listener)

◆ processEvent()

void ossimImageChain::processEvent ( ossimEvent event)
virtual

ProcessEvent.

The defaul is to do nothing. Derived classes need to override this class.

Reimplemented from ossimConnectableObjectListener.

Reimplemented in ossimImageChainMtAdaptor.

Definition at line 37 of file ossimImageChain.cpp.

References ossimEvent::getCurrentObject(), getFirstSource(), ossimConnectableObject::getOutputList(), ossimEvent::isPropagatingToOutputs(), ossimConnectableObjectListener::processEvent(), and PTR_CAST.

38 {
41 
43  {
44  if(event.isPropagatingToOutputs())
45  {
47  ossim_uint32 idx = 0;
48  for(idx = 0; idx < outputList.size();++idx)
49  {
50  if(outputList[idx].valid())
51  {
52  outputList[idx]->fireEvent(event);
53  outputList[idx]->propagateEventToOutputs(event);
54  }
55  }
56  }
57  }
58 }
virtual void processEvent(ossimEvent &event)
ProcessEvent.
virtual ossimImageSource * getFirstSource()
Return the first source which is the one that first receives the getTile request. ...
const ossimObject * getCurrentObject() const
Definition: ossimEvent.cpp:74
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
unsigned int ossim_uint32
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
const ConnectableObjectList & getOutputList() const
bool isPropagatingToOutputs() const
Definition: ossimEvent.cpp:99

◆ propagateEventToInputs()

void ossimImageChain::propagateEventToInputs ( ossimEvent event)
virtual

Reimplemented from ossimConnectableObject.

Definition at line 1732 of file ossimImageChain.cpp.

References imageChainList(), and size.

1733 {
1734 // if(thePropagateEventFlag) return;
1735 
1736 // thePropagateEventFlag = true;
1737  if(imageChainList().size())
1738  {
1739  if(imageChainList()[0].valid())
1740  {
1741  imageChainList()[0]->fireEvent(event);
1742  imageChainList()[0]->propagateEventToInputs(event);
1743  }
1744  }
1745 // thePropagateEventFlag = false;
1746 }
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ propagateEventToOutputs()

void ossimImageChain::propagateEventToOutputs ( ossimEvent event)
virtual

Reimplemented from ossimConnectableObject.

Definition at line 1716 of file ossimImageChain.cpp.

References imageChainList(), and size.

1717 {
1718  //if(thePropagateEventFlag) return;
1719 
1720  //thePropagateEventFlag = true;
1721  if(imageChainList().size())
1722  {
1723  if(imageChainList()[imageChainList().size()-1].valid())
1724  {
1725  imageChainList()[imageChainList().size()-1]->fireEvent(event);
1726  imageChainList()[imageChainList().size()-1]->propagateEventToOutputs(event);
1727  }
1728  }
1729  //ossimConnectableObject::propagateEventToOutputs(event);
1730  // thePropagateEventFlag = false;
1731 }
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...

◆ removeChild() [1/2]

bool ossimImageChain::removeChild ( ossimConnectableObject object)
virtual

Will remove the child from the container.

Changes the owner of the child to be NULL;

Implements ossimConnectableContainerInterface.

Definition at line 484 of file ossimImageChain.cpp.

References ossimListenerManager::addListener(), ossimListenerManager::fireEvent(), imageChainList(), OSSIM_EVENT_REMOVE_OBJECT_ID, size, ossimConnectableObject::theInputListIsFixedFlag, and ossimConnectableObject::theInputObjectList.

Referenced by ossimSingleImageChain::close(), objectDestructingEvent(), and removeChild().

485 {
486  bool result = false;
487  vector<ossimRefPtr<ossimConnectableObject> >::iterator current = std::find(imageChainList().begin(), imageChainList().end(), object);
488 
489 
490  if(current!=imageChainList().end())
491  {
492  result = true;
493  object->removeListener((ossimConnectableObjectListener*)this);
494  if(current == imageChainList().begin())
495  {
496  object->removeListener((ossimConnectableObjectListener*)this);
497  }
498  if(imageChainList().size() == 1)
499  {
500  object->changeOwner(0);
501  current = imageChainList().erase(current);
502  }
503  else
504  {
505  ossimConnectableObject::ConnectableObjectList input = object->getInputList();
506  ossimConnectableObject::ConnectableObjectList output = object->getOutputList();
507  object->changeOwner(0);// set the owner to 0
508  bool erasingBeginning = (current == imageChainList().begin());
509  // bool erasingEnd = (current+1) == imageChainList().end();
510  current = imageChainList().erase(current);
511  object->disconnect();
512 
513  if(!imageChainList().empty())
514  {
515  if(erasingBeginning) // the one that receives the first getTile
516  {
517  (*imageChainList().begin())->addListener(this);
518  }
519 
520  else if(current==imageChainList().end()) // one that receives the last getTIle
521  {
522  current = imageChainList().begin()+(imageChainList().size()-1);
523  (*current)->connectInputList(input);
524  theInputObjectList = (*current)->getInputList();
525  theInputListIsFixedFlag = (*current)->getInputListIsFixedFlag();
526  }
527  else
528  {
529  // prepare interior setup and removal and connect surrounding nodes
530  // take the outputs of the node we are removing and connect them to the old inputs
531  ossim_uint32 outIndex = 0;
532  for(outIndex = 0; outIndex < output.size();++outIndex)
533  {
534  output[outIndex]->connectInputList(input);
535  }
536  }
537  }
538  }
539 
540  // Send an event to any listeners.
541  ossimContainerEvent event((ossimObject*)this,
543  event.setObjectList(object);
544  fireEvent(event);
545  }
546 
547  return result;
548 }
virtual bool addListener(ossimListener *listener)
virtual void fireEvent(ossimEvent &event)
#define OSSIM_EVENT_REMOVE_OBJECT_ID
Definition: ossimEventIds.h:28
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
yy_size_t size
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32
ConnectableObjectList theInputObjectList
Holds a list of input objects.
bool theInputListIsFixedFlag
Indicates whether the theInputObjectList is fixed.

◆ removeChild() [2/2]

ossimConnectableObject * ossimImageChain::removeChild ( const ossimId id)
virtual

Definition at line 550 of file ossimImageChain.cpp.

References accept(), ossimIdVisitor::getObject(), removeChild(), ossimVisitor::VISIT_CHILDREN, and ossimVisitor::VISIT_INPUTS.

551 {
552  ossimIdVisitor visitor( id,
554  accept( visitor );
555  ossimConnectableObject* obj = visitor.getObject();
556  if ( obj )
557  {
558  removeChild(obj);
559  }
560  return obj;
561 }
virtual bool removeChild(ossimConnectableObject *object)
Will remove the child from the container.
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.

◆ replace()

bool ossimImageChain::replace ( ossimConnectableObject newObj,
ossimConnectableObject oldObj 
)

Definition at line 771 of file ossimImageChain.cpp.

References ossimListenerManager::addListener(), ossimConnectableObject::changeOwner(), ossimConnectableObject::connectInputList(), ossimConnectableObject::connectOutputList(), ossimConnectableObject::getInputList(), ossimConnectableObject::getOutputList(), imageChainList(), indexOf(), and ossimListenerManager::removeListener().

773 {
774  ossim_int32 idx = indexOf(oldObj);
775  if(idx >= 0)
776  {
780  oldObj->removeListener(this);
781  oldObj->changeOwner(0);
782  imageChainList()[idx] = newObj;
783  newObj->connectInputList(inputList);
784  newObj->connectOutputList(outputList);
785  newObj->changeOwner(this);
787  if(idx == 0)
788  {
789  newObj->addListener(this);
790  }
791  }
792 
793  return (idx >= 0);
794 }
virtual bool addListener(ossimListener *listener)
virtual bool connectOutputList(ConnectableObjectList &outputList)
Will disconnect itself from all outputs and reset to the passed in output list.
virtual ossim_int32 indexOf(ossimConnectableObject *obj) const
const ConnectableObjectList & getInputList() const
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
virtual void changeOwner(ossimObject *owner)
Permits changing the object&#39;s owner.
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
virtual bool connectInputList(ConnectableObjectList &inputList)
Will disconnect itself from all inputs and reset to the passed in input list.
const ConnectableObjectList & getOutputList() const
int ossim_int32
virtual bool removeListener(ossimListener *listener)

◆ saveState()

bool ossimImageChain::saveState ( ossimKeywordlist kwl,
const char *  prefix = NULL 
) const
virtual

Will save the state of the chain.

Reimplemented from ossimImageSource.

Reimplemented in ossimImageChainMtAdaptor.

Definition at line 1436 of file ossimImageChain.cpp.

References ossimString::c_str(), imageChainList(), ossimImageSource::saveState(), and ossimString::toString().

Referenced by ossimIgenGenerator::generateGeoTiledSpecList(), ossimIgenGenerator::generateNoTiledSpecList(), and ossimIgenGenerator::generatePixelTiledSpecList().

1438 {
1439  bool result = true;
1440 
1441  result = ossimImageSource::saveState(kwl, prefix);
1442 
1443  if(!result)
1444  {
1445  return result;
1446  }
1447  ossim_uint32 upper = (ossim_uint32)imageChainList().size();
1448  ossim_uint32 counter = 1;
1449 
1450  if (upper)
1451  {
1452  ossim_int32 idx = upper-1;
1453  // start with the tail and go to the head fo the list.
1454  for(;((idx >= 0)&&result);--idx, ++counter)
1455  {
1456  ossimString newPrefix = prefix;
1457 
1458  newPrefix += (ossimString("object") +
1459  ossimString::toString(counter) +
1460  ossimString("."));
1461  result = imageChainList()[idx]->saveState(kwl, newPrefix.c_str());
1462  }
1463  }
1464 
1465  return result;
1466 }
static ossimString toString(bool aValue)
Numeric to string methods.
virtual ossimConnectableObject::ConnectableObjectList & imageChainList()
These access methods greatly facilitate the implementation of an image chain adaptor class...
unsigned int ossim_uint32
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
int ossim_int32

Member Data Documentation

◆ theBlankTile

ossimRefPtr<ossimImageData> ossimImageChain::theBlankTile
protected

Definition at line 396 of file ossimImageChain.h.

◆ theImageChainList

ossimConnectableObject::ConnectableObjectList ossimImageChain::theImageChainList
protected

This will hold a sequence of image sources.

theFirst one in the list will be the head of the list and the last one is the tail.

Definition at line 394 of file ossimImageChain.h.

Referenced by ossimImageChainMtAdaptor::imageChainList().

◆ theLoadStateFlag

bool ossimImageChain::theLoadStateFlag
mutableprotected

Definition at line 398 of file ossimImageChain.h.

Referenced by connectInputEvent(), and loadState().


The documentation for this class was generated from the following files: