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

#include <ossimPolyCutter.h>

Inheritance diagram for ossimPolyCutter:
ossimImageSourceFilter ossimImageSource ossimConnectableObjectListener ossimSource ossimListener ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced ossimGeoPolyCutter

Public Types

enum  ossimPolyCutterCutType { OSSIM_POLY_NULL_INSIDE = 0, OSSIM_POLY_NULL_OUTSIDE = 1 }
 
- 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
 

Public Member Functions

 ossimPolyCutter ()
 
 ossimPolyCutter (ossimImageSource *inputSource, const ossimPolygon &polygon)
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &tileRect, ossim_uint32 resLevel=0)
 
virtual ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 This will return the bounding rect of the source. More...
 
virtual void initialize ()
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual void setPolygon (const vector< ossimDpt > &polygon, ossim_uint32 i=0)
 
virtual void setPolygon (const vector< ossimIpt > &polygon, ossim_uint32 i=0)
 
virtual void addPolygon (const vector< ossimIpt > &polygon)
 
virtual void addPolygon (const vector< ossimDpt > &polygon)
 
virtual void addPolygon (const ossimPolygon &polygon)
 
virtual void setNumberOfPolygons (ossim_uint32 count)
 
virtual std::vector< ossimPolygon > & getPolygonList ()
 
virtual const std::vector< ossimPolygon > & getPolygonList () const
 
void setCutType (ossimPolyCutterCutType cutType)
 
ossimPolyCutterCutType getCutType () const
 
void clear ()
 
const ossimIrectgetRectangle () const
 
void setRectangle (const ossimIrect &rect)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
- Public Member Functions inherited from ossimImageSourceFilter
 ossimImageSourceFilter (ossimObject *owner=NULL)
 
 ossimImageSourceFilter (ossimImageSource *inputSource)
 
 ossimImageSourceFilter (ossimObject *owner, ossimImageSource *inputSource)
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 
virtual ossim_uint32 getNumberOfInputBands () const
 
bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 required to be overriden by derived classes More...
 
virtual void connectInputEvent (ossimConnectionEvent &event)
 
virtual void disconnectInputEvent (ossimConnectionEvent &event)
 
virtual void propertyEvent (ossimPropertyEvent &event)
 
virtual void refreshEvent (ossimRefreshEvent &event)
 
- 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 getDecimationFactor (ossim_uint32 resLevel, ossimDpt &result) const
 Will return the decimation factor for the given resolution level. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 Will return the number of resolution levels. More...
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual ossimScalarType getOutputScalarType () const
 This will be used to query the output pixel type of the tile source. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the default processing tile width. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the default processing tile height. 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 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 ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if not defined. 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 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 void enableSource ()
 
virtual void disableSource ()
 
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 propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
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...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. 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 processEvent (ossimEvent &event)
 ProcessEvent. More...
 
virtual void objectDestructingEvent (ossimObjectDestructingEvent &)
 
virtual void connectionEvent (ossimConnectionEvent &)
 
virtual void disconnectOutputEvent (ossimConnectionEvent &)
 
virtual void connectOutputEvent (ossimConnectionEvent &)
 
virtual void addObjectEvent (ossimContainerEvent &)
 
virtual void removeObjectEvent (ossimContainerEvent &)
 
virtual void containerEvent (ossimContainerEvent &)
 
- Public Member Functions inherited from ossimListener
 ossimListener ()
 
virtual ~ossimListener ()
 
void enableListener ()
 
void disableListener ()
 
void setListenerEnableFlag (bool flag)
 
bool isListenerEnabled () const
 
bool getListenerEnableFlag () const
 

Protected Member Functions

virtual ~ossimPolyCutter ()
 
void allocate ()
 Called on first getTile, will initialize all data needed. More...
 
void computeBoundingRect ()
 
- Protected Member Functions inherited from ossimImageSourceFilter
virtual ~ossimImageSourceFilter ()
 
- 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

ossimRefPtr< ossimImageDatatheTile
 
ossimIrect theBoundingRect
 
std::vector< ossimPolygonthePolygonList
 
ossimPolyCutterCutType theCutType
 
ossimImageDataHelper theHelper
 
bool m_boundingOverwrite
 
- Protected Attributes inherited from ossimImageSourceFilter
ossimImageSourcetheInputConnection
 
- 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
 

Detailed Description

Definition at line 22 of file ossimPolyCutter.h.

Member Enumeration Documentation

◆ ossimPolyCutterCutType

Enumerator
OSSIM_POLY_NULL_INSIDE 
OSSIM_POLY_NULL_OUTSIDE 

Definition at line 25 of file ossimPolyCutter.h.

Constructor & Destructor Documentation

◆ ossimPolyCutter() [1/2]

ossimPolyCutter::ossimPolyCutter ( )

Definition at line 23 of file ossimPolyCutter.cpp.

25  theTile(NULL),
27  m_boundingOverwrite(false)
28 {
29  thePolygonList.push_back(ossimPolygon());
31 }
ossimRefPtr< ossimImageData > theTile
ossimImageSourceFilter(ossimObject *owner=NULL)
void makeNan()
Definition: ossimIrect.h:329
ossimIrect theBoundingRect
std::vector< ossimPolygon > thePolygonList
ossimPolyCutterCutType theCutType

◆ ossimPolyCutter() [2/2]

ossimPolyCutter::ossimPolyCutter ( ossimImageSource inputSource,
const ossimPolygon polygon 
)

Definition at line 35 of file ossimPolyCutter.cpp.

References computeBoundingRect(), initialize(), and thePolygonList.

37  : ossimImageSourceFilter(inputSource),
38  theTile(NULL),
40  m_boundingOverwrite(false)
41 {
42  thePolygonList.push_back(polygon);
44  initialize();
45 }
ossimRefPtr< ossimImageData > theTile
ossimImageSourceFilter(ossimObject *owner=NULL)
virtual void initialize()
std::vector< ossimPolygon > thePolygonList
ossimPolyCutterCutType theCutType

◆ ~ossimPolyCutter()

ossimPolyCutter::~ossimPolyCutter ( )
protectedvirtual

Definition at line 47 of file ossimPolyCutter.cpp.

48 {
49 }

Member Function Documentation

◆ addPolygon() [1/3]

void ossimPolyCutter::addPolygon ( const vector< ossimIpt > &  polygon)
virtual

Reimplemented in ossimGeoPolyCutter.

Definition at line 305 of file ossimPolyCutter.cpp.

References computeBoundingRect(), and thePolygonList.

Referenced by ossimGeoPolyCutter::addPolygon().

306 {
307  thePolygonList.push_back(ossimPolygon(polygon));
309 }
std::vector< ossimPolygon > thePolygonList

◆ addPolygon() [2/3]

void ossimPolyCutter::addPolygon ( const vector< ossimDpt > &  polygon)
virtual

Reimplemented in ossimGeoPolyCutter.

Definition at line 311 of file ossimPolyCutter.cpp.

References computeBoundingRect(), and thePolygonList.

312 {
313  thePolygonList.push_back(ossimPolygon(polygon));
315 }
std::vector< ossimPolygon > thePolygonList

◆ addPolygon() [3/3]

void ossimPolyCutter::addPolygon ( const ossimPolygon polygon)
virtual

Reimplemented in ossimGeoPolyCutter.

Definition at line 317 of file ossimPolyCutter.cpp.

References computeBoundingRect(), and thePolygonList.

318 {
319  thePolygonList.push_back(ossimPolygon(polygon));
321 }
std::vector< ossimPolygon > thePolygonList

◆ allocate()

void ossimPolyCutter::allocate ( )
protected

Called on first getTile, will initialize all data needed.

Definition at line 200 of file ossimPolyCutter.cpp.

References ossimImageDataFactory::create(), ossimImageData::initialize(), ossimImageDataFactory::instance(), ossimImageSourceFilter::theInputConnection, and theTile.

Referenced by getTile().

201 {
202  theTile=NULL;
204  {
207  theTile->initialize();
208 
209  }
210 }
ossimRefPtr< ossimImageData > theTile
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
ossimImageSource * theInputConnection
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const

◆ clear()

void ossimPolyCutter::clear ( )

Definition at line 334 of file ossimPolyCutter.cpp.

References setNumberOfPolygons().

Referenced by ossimTilingPoly::nextFeature().

335 {
337 }
virtual void setNumberOfPolygons(ossim_uint32 count)

◆ computeBoundingRect()

void ossimPolyCutter::computeBoundingRect ( )
protected

Definition at line 355 of file ossimPolyCutter.cpp.

References ossimIrect::combine(), ossimIrect::hasNans(), ossimIrect::makeNan(), theBoundingRect, and thePolygonList.

Referenced by addPolygon(), ossimPolyCutter(), setPolygon(), and ossimGeoPolyCutter::transformVertices().

356 {
357  ossimIrect bounds;
359 
360  for(int i = 0; i < (int)thePolygonList.size(); ++i)
361  {
362  thePolygonList[i].getBoundingRect(bounds);
363 
364  if(!bounds.hasNans())
365  {
367  {
368  theBoundingRect = bounds;
369  }
370  else
371  {
373  }
374  }
375  }
376 }
void makeNan()
Definition: ossimIrect.h:329
ossimIrect theBoundingRect
bool hasNans() const
Definition: ossimIrect.h:337
std::vector< ossimPolygon > thePolygonList
ossimIrect combine(const ossimIrect &rect) const
Definition: ossimIrect.cpp:543

◆ getBoundingRect()

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

This will return the bounding rect of the source.

We can have several sources which are in a chain to modify the bounding image rect. lets say you are next to an image handler then it will return the bounding rect for that image. If you are at the right side of a resampler then you will get a bounding rect along the image view plane. This is going to be a very import method for both image writers, mosaics or anything that needs to operate only within the bounds of an image.

Reimplemented from ossimImageSource.

Definition at line 151 of file ossimPolyCutter.cpp.

References ossimImageSource::getBoundingRect(), ossimImageSource::getDecimationFactor(), ossimDpt::hasNans(), ossimIrect::hasNans(), ossimSource::isSourceEnabled(), ossimIrect::makeNan(), OSSIM_POLY_NULL_OUTSIDE, theBoundingRect, theCutType, and ossimImageSourceFilter::theInputConnection.

Referenced by getTile().

152 {
153  ossimIrect result;
154 
155  result.makeNan();
156  if(!theInputConnection)
157  {
158  return result;
159  }
160  if(!isSourceEnabled())
161  {
163  }
164 
165  result = theInputConnection->getBoundingRect(resLevel);
166 
168  {
170  {
171  ossimDpt decimation;
172  getDecimationFactor(resLevel, decimation);
173  if(decimation.hasNans())
174  {
175  result = theBoundingRect;
176  }
177  else
178  {
179  result = theBoundingRect*decimation;
180  }
181  }
182  }
183  else if(isSourceEnabled())
184  {
185  return theBoundingRect;
186  }
187 
188  return result;
189 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
ossimImageSource * theInputConnection
bool hasNans() const
Definition: ossimDpt.h:67
void makeNan()
Definition: ossimIrect.h:329
ossimIrect theBoundingRect
bool hasNans() const
Definition: ossimIrect.h:337
virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt &result) const
Will return the decimation factor for the given resolution level.
ossimPolyCutterCutType theCutType

◆ getCutType()

ossimPolyCutter::ossimPolyCutterCutType ossimPolyCutter::getCutType ( ) const

Definition at line 329 of file ossimPolyCutter.cpp.

References theCutType.

330 {
331  return theCutType;
332 }
ossimPolyCutterCutType theCutType

◆ getPolygonList() [1/2]

std::vector< ossimPolygon > & ossimPolyCutter::getPolygonList ( )
virtual

Definition at line 402 of file ossimPolyCutter.cpp.

References thePolygonList.

403 {
404  return thePolygonList;
405 }
std::vector< ossimPolygon > thePolygonList

◆ getPolygonList() [2/2]

const std::vector< ossimPolygon > & ossimPolyCutter::getPolygonList ( ) const
virtual

Definition at line 407 of file ossimPolyCutter.cpp.

References thePolygonList.

408 {
409  return thePolygonList;
410 }
std::vector< ossimPolygon > thePolygonList

◆ getProperty()

ossimRefPtr< ossimProperty > ossimPolyCutter::getProperty ( const ossimString name) const
virtual

Reimplemented from ossimImageSourceFilter.

Definition at line 344 of file ossimPolyCutter.cpp.

References ossimImageSourceFilter::getProperty().

345 {
346 
348 }
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const

◆ getPropertyNames()

void ossimPolyCutter::getPropertyNames ( std::vector< ossimString > &  propertyNames) const
virtual

Reimplemented from ossimImageSourceFilter.

Definition at line 350 of file ossimPolyCutter.cpp.

References ossimImageSourceFilter::getPropertyNames().

351 {
353 }
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const

◆ getRectangle()

const ossimIrect & ossimPolyCutter::getRectangle ( ) const

Definition at line 378 of file ossimPolyCutter.cpp.

References theBoundingRect.

Referenced by ossimTilingPoly::next(), and ossimTilingPoly::setRect().

379 {
380  return theBoundingRect;
381 }
ossimIrect theBoundingRect

◆ getTile()

ossimRefPtr< ossimImageData > ossimPolyCutter::getTile ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
virtual
Returns
the requested region of interest

Reimplemented from ossimImageSource.

Definition at line 51 of file ossimPolyCutter.cpp.

References allocate(), ossimImageDataHelper::copyInputToThis(), ossimImageDataHelper::fill(), ossimRefPtr< T >::get(), getBoundingRect(), ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageSource::getDecimationFactor(), ossimImageData::getNullPix(), ossimImageSource::getTile(), ossimDpt::hasNans(), ossimIrect::hasNans(), ossimIrect::intersects(), ossimSource::isSourceEnabled(), ossimImageData::loadTile(), ossimImageData::makeBlank(), OSSIM_EMPTY, OSSIM_NULL, OSSIM_POLY_NULL_INSIDE, OSSIM_POLY_NULL_OUTSIDE, ossimDataObject::setDataObjectStatus(), ossimImageDataHelper::setImageData(), ossimImageData::setImageRectangle(), theBoundingRect, theCutType, theHelper, ossimImageSourceFilter::theInputConnection, thePolygonList, theTile, ossimRefPtr< T >::valid(), and ossimImageData::validate().

Referenced by ossimTrimFilter::getTile().

53 {
55  {
56  return theTile;
57  }
59  resLevel);
60 
61  if(!isSourceEnabled() || theBoundingRect.hasNans() || !input.valid())
62  {
63  return input;
64  }
65 
66  if((input->getDataObjectStatus() == OSSIM_EMPTY) ||
67  (input->getDataObjectStatus() == OSSIM_NULL))
68  {
69  return input;
70  }
71 
72  if(!theTile.valid())
73  {
74  allocate(); // First time through...
75  }
76 
77  if(!theTile.valid())
78  {
79  return input;
80  }
81 
82  theTile->setImageRectangle(tileRect);
83 
84  theTile->loadTile(input.get());
86  vector<ossimPolygon>* polyList = &thePolygonList;
87  vector<ossimPolygon> scaledPoly;
88 
89  ossimIrect boundingRect = getBoundingRect(resLevel);
90  if(resLevel)
91  {
92  ossimDpt decimation;
93  getDecimationFactor(resLevel, decimation);
94 
95  if(!decimation.hasNans())
96  {
97  for(int polyIndex = 0;
98  polyIndex < (int)thePolygonList.size();
99  ++polyIndex)
100  {
101  scaledPoly.push_back(thePolygonList[polyIndex]*decimation);
102  }
103  polyList = &scaledPoly;
104  }
105  }
106 
107  if(polyList->size()&&
109  {
110 // ossimActiveEdgeTable aet;
111 
112 
114  {
115  if(boundingRect.intersects(tileRect))
116  {
117  theTile->makeBlank();
119  for(int polyIndex = 0; polyIndex < (int)polyList->size(); ++polyIndex)
120  {
122  (*polyList)[polyIndex]);
123  }
124  theTile->validate();
125  }
126  else
127  {
128  theTile->makeBlank();
129  }
130  }
132  {
133  if(boundingRect.intersects(tileRect))
134  {
136  for(int polyIndex = 0;
137  polyIndex < (int)polyList->size();
138  ++polyIndex)
139  {
141  (*polyList)[polyIndex]);
142  }
143  }
144  theTile->validate();
145  }
146 
147  }
148  return theTile;
149 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimRefPtr< ossimImageData > theTile
void setImageData(ossimImageData *imageData)
virtual void setImageRectangle(const ossimIrect &rect)
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
bool valid() const
Definition: ossimRefPtr.h:75
void allocate()
Called on first getTile, will initialize all data needed.
virtual ossimDataObjectStatus getDataObjectStatus() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
void copyInputToThis(const void *input, const ossimPolygon &region, bool clipPoly=true)
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual ossimDataObjectStatus validate() const
void fill(const double *values, const ossimIrect &rect, bool clipPoly=true)
ossimImageSource * theInputConnection
virtual const ossim_float64 * getNullPix() const
bool hasNans() const
Definition: ossimDpt.h:67
virtual void makeBlank()
Initializes data to null pixel values.
ossimImageDataHelper theHelper
virtual const void * getBuf() const
ossimIrect theBoundingRect
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
bool hasNans() const
Definition: ossimIrect.h:337
virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt &result) const
Will return the decimation factor for the given resolution level.
std::vector< ossimPolygon > thePolygonList
ossimPolyCutterCutType theCutType
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)

◆ initialize()

void ossimPolyCutter::initialize ( )
virtual

Reimplemented from ossimImageSourceFilter.

Definition at line 191 of file ossimPolyCutter.cpp.

References ossimImageSourceFilter::initialize(), and theTile.

Referenced by ossimTrimFilter::initialize(), and ossimPolyCutter().

192 {
193  // Capture the input connection.
195 
196  // Force an allocate on next getTile.
197  theTile = NULL;
198 }
ossimRefPtr< ossimImageData > theTile

◆ loadState()

bool ossimPolyCutter::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimImageSourceFilter.

Reimplemented in ossimGeoPolyCutter.

Definition at line 241 of file ossimPolyCutter.cpp.

References ossimKeywordlist::find().

243 {
244  const char* numberPolygons = kwl.find(prefix, NUMBER_POLYGONS_KW);
245 
246  ossimString newPrefix;
247  if(numberPolygons)
248  {
249  thePolygonList.clear();
250  int npolys = ossimString(numberPolygons).toLong();
251  for(int i = 0; i < npolys;++i)
252  {
253  thePolygonList.push_back(ossimPolygon());
254 
255  newPrefix = ossimString(prefix) + "polygon" + ossimString::toString(i)+".";
256 
257  thePolygonList[i].loadState(kwl, newPrefix.c_str());
258  }
259  }
260 
261  const char* lookup = kwl.find(prefix,
262  "cut_type");
263  if(lookup)
264  {
266  ossimString test = lookup;
267  if(test == "null_outside")
268  {
270  }
271  }
272  else
273  {
275  }
276 
278 
279 
280  return ossimImageSourceFilter::loadState(kwl, prefix);
281 }
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
long toLong() const
toLong&#39;s deprecated, please use the toInts...
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
std::vector< ossimPolygon > thePolygonList
ossimPolyCutterCutType theCutType

◆ saveState()

bool ossimPolyCutter::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageSourceFilter.

Reimplemented in ossimGeoPolyCutter.

Definition at line 212 of file ossimPolyCutter.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), thePolygonList, and ossimString::toString().

214 {
215  ossimString newPrefix = prefix;
216 
217  for(int i = 0; i < (int)thePolygonList.size();++i)
218  {
219  newPrefix = ossimString(prefix) + "polygon" + ossimString::toString(i)+".";
220 
221  thePolygonList[i].saveState(kwl, newPrefix.c_str());
222  }
223  kwl.add(prefix,
224  NUMBER_POLYGONS_KW,
225  (int)thePolygonList.size(),
226  true);
227 
228  ossimString fillType = "null_inside";
230  {
231  fillType = "null_outside";
232  }
233  kwl.add(prefix,
234  "cut_type",
235  fillType.c_str(),
236  true);
237 
238  return ossimImageSourceFilter::saveState(kwl, prefix);;
239 }
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
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
std::vector< ossimPolygon > thePolygonList
ossimPolyCutterCutType theCutType

◆ setCutType()

void ossimPolyCutter::setCutType ( ossimPolyCutterCutType  cutType)

Definition at line 324 of file ossimPolyCutter.cpp.

References theCutType.

Referenced by ossimTilingPoly::nextFeature().

325 {
326  theCutType = cutType;
327 }
ossimPolyCutterCutType theCutType

◆ setNumberOfPolygons()

void ossimPolyCutter::setNumberOfPolygons ( ossim_uint32  count)
virtual

Reimplemented in ossimGeoPolyCutter.

Definition at line 389 of file ossimPolyCutter.cpp.

References thePolygonList.

Referenced by clear(), ossimTrimFilter::initialize(), and ossimGeoPolyCutter::setNumberOfPolygons().

390 {
391  if(!count)
392  {
393  thePolygonList.clear();
394  thePolygonList.clear();
395  }
396  else
397  {
398  thePolygonList.resize(count);
399  }
400 }
std::vector< ossimPolygon > thePolygonList

◆ setPolygon() [1/2]

void ossimPolyCutter::setPolygon ( const vector< ossimDpt > &  polygon,
ossim_uint32  i = 0 
)
virtual

Reimplemented in ossimGeoPolyCutter.

Definition at line 283 of file ossimPolyCutter.cpp.

References computeBoundingRect(), and thePolygonList.

Referenced by ossimTrimFilter::initialize(), and ossimGeoPolyCutter::setPolygon().

285 {
286  if(index < polygon.size())
287  {
288  thePolygonList[index] = polygon;
289 
291  }
292 
293 }
std::vector< ossimPolygon > thePolygonList

◆ setPolygon() [2/2]

void ossimPolyCutter::setPolygon ( const vector< ossimIpt > &  polygon,
ossim_uint32  i = 0 
)
virtual

Reimplemented in ossimGeoPolyCutter.

Definition at line 295 of file ossimPolyCutter.cpp.

References computeBoundingRect(), and thePolygonList.

297 {
298  if(polygon.size())
299  {
300  thePolygonList[index] = polygon;
302  }
303 }
std::vector< ossimPolygon > thePolygonList

◆ setProperty()

void ossimPolyCutter::setProperty ( ossimRefPtr< ossimProperty property)
virtual

Reimplemented from ossimImageSourceFilter.

Definition at line 339 of file ossimPolyCutter.cpp.

References ossimImageSourceFilter::setProperty().

340 {
342 }
virtual void setProperty(ossimRefPtr< ossimProperty > property)

◆ setRectangle()

void ossimPolyCutter::setRectangle ( const ossimIrect rect)

Definition at line 383 of file ossimPolyCutter.cpp.

References m_boundingOverwrite, and theBoundingRect.

Referenced by ossimTilingPoly::setRect().

384 {
385  theBoundingRect = rect;
386  m_boundingOverwrite = true;
387 }
ossimIrect theBoundingRect

Member Data Documentation

◆ m_boundingOverwrite

bool ossimPolyCutter::m_boundingOverwrite
protected

Definition at line 104 of file ossimPolyCutter.h.

Referenced by setRectangle().

◆ theBoundingRect

ossimIrect ossimPolyCutter::theBoundingRect
protected

Will hold a pre-computed bounding rect of the polygon data.

Definition at line 95 of file ossimPolyCutter.h.

Referenced by computeBoundingRect(), getBoundingRect(), getRectangle(), getTile(), and setRectangle().

◆ theCutType

ossimPolyCutterCutType ossimPolyCutter::theCutType
protected

theDefault fill will be outside.

Definition at line 102 of file ossimPolyCutter.h.

Referenced by getBoundingRect(), getCutType(), getTile(), ossimGeoPolyCutter::loadState(), and setCutType().

◆ theHelper

ossimImageDataHelper ossimPolyCutter::theHelper
protected

Definition at line 103 of file ossimPolyCutter.h.

Referenced by getTile().

◆ thePolygonList

std::vector<ossimPolygon> ossimPolyCutter::thePolygonList
protected

◆ theTile

ossimRefPtr<ossimImageData> ossimPolyCutter::theTile
protected

Definition at line 89 of file ossimPolyCutter.h.

Referenced by allocate(), getTile(), and initialize().


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