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

Class used for rendering point cloud data into a raster tile. More...

#include <ossimPointCloudImageHandler.h>

Inheritance diagram for ossimPointCloudImageHandler:
ossimImageHandler ossimImageSource ossimSource ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Classes

class  PcrBucket
 

Public Types

enum  Components {
  INTENSITY =0, HIGHEST, LOWEST, RETURNS,
  RGB, NUM_COMPONENTS
}
 
- Public Types inherited from ossimImageHandler
enum  ossimImageHandlerOverviewCompressionType {
  OSSIM_OVERVIEW_COMPRESSION_NONE = 0, OSSIM_OVERVIEW_COMPRESSION_JPEG, OSSIM_OVERVIEW_COMPRESSION_LZW, OSSIM_OVERVIEW_COMPRESSION_DEFLATE,
  OSSIM_OVERVIEW_COMPRESSION_PACKBITS
}
 
- 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

 ossimPointCloudImageHandler ()
 
virtual ~ossimPointCloudImageHandler ()
 
virtual bool open ()
 open method. More...
 
virtual bool isOpen () const
 is open method. More...
 
virtual void close ()
 Close method. More...
 
ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0) override
 Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab from the image. More...
 
bool getTile (ossimImageData *result, ossim_uint32 resLevel=0) override
 Method to get a tile. More...
 
ossim_uint32 getNumberOfInputBands () const override
 Gets bands. More...
 
ossim_uint32 getNumberOfLines (ossim_uint32 resLevel=0) const override
 Gets lines. More...
 
ossim_uint32 getNumberOfSamples (ossim_uint32 resLevel=0) const override
 Gets samples. More...
 
ossim_uint32 getImageTileWidth () const override
 Gets tile width. More...
 
ossim_uint32 getImageTileHeight () const override
 Gets tile height. More...
 
ossim_uint32 getTileWidth () const override
 
ossim_uint32 getTileHeight () const override
 
ossimScalarType getOutputScalarType () const override
 
void getEntryList (std::vector< ossim_uint32 > &entryList) const override
 Gets entry list. More...
 
void getEntryNames (std::vector< ossimString > &entryNames) const override
 
ossim_uint32 getCurrentEntry () const override
 
bool setCurrentEntry (ossim_uint32 entryIdx) override
 
ossimString getShortName () const override
 
ossimString getLongName () const override
 
ossimRefPtr< ossimImageGeometrygetImageGeometry () override
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
double getMinPixelValue (ossim_uint32 band) const override
 
double getMaxPixelValue (ossim_uint32 band) const override
 
double getNullPixelValue (ossim_uint32 band) const override
 
ossim_uint32 getNumberOfDecimationLevels () const override
 
bool saveState (ossimKeywordlist &kwl, const char *prefix) const override
 Method to save the state of an object to a keyword list. More...
 
bool loadState (const ossimKeywordlist &kwl, const char *prefix) override
 Method to the load (recreate) the state of an object from a keyword list. More...
 
void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering, ossim_uint32 resLevel) const override
 ordering specifies how the vertices should be arranged. More...
 
void setProperty (ossimRefPtr< ossimProperty > property) override
 The reader properties are: – the GSD ("meters_per_pixel") which overrides computed nominal GSD – the GSD factor ("gsd_factor") scales the computed nominal GSD, defaults to 1.0. More...
 
ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const override
 
bool setPointCloudHandler (ossimPointCloudHandler *pch)
 Permits backdoor for setting the input point cloud handler object. More...
 
void getGSD (ossimDpt &gsd, ossim_uint32 resLevel) const
 Get the GSD for resLevel. More...
 
void setGSD (const ossim_float64 &gsd)
 Sets m_gsd data member and projection if projection is set. More...
 
- Public Member Functions inherited from ossimImageHandler
 ossimImageHandler ()
 Constructor (default): More...
 
virtual ~ossimImageHandler ()
 Destructor: Derived classes should implement. More...
 
virtual void initialize ()
 initialize Does nothing in this class. More...
 
virtual bool openOverview ()
 Searches for an overview. More...
 
virtual bool openOverview (const ossimFilename &overview_file)
 Calls closeOverview(), then attempts to open the overview_file. More...
 
virtual void closeOverview ()
 If theOverview is initialized it will be deleted and set to NULL. More...
 
virtual const ossimImageHandlergetOverview () const
 
virtual bool hasOverviews () const
 
virtual ossimFilename createDefaultOverviewFilename () const
 
virtual ossimFilename createDefaultGeometryFilename () const
 
virtual ossimFilename createDefaultMetadataFilename () const
 
virtual ossimFilename createDefaultHistogramFilename () const
 
virtual ossimFilename createDefaultValidVerticesFilename () const
 
virtual bool writeValidImageVertices (const std::vector< ossimIpt > &vertices, const ossimFilename &file=ossimFilename(""))
 Outputs vertices to file and updates the internal vertex array variable "theValidImageVertices". More...
 
virtual bool openValidVertices (const ossimFilename &vertices_file)
 Opens the valid image vertices file and sets theValidImageVerticesFile variable. More...
 
virtual bool openValidVertices ()
 Creates vertices file name based on image, then tries to open. More...
 
virtual bool open (const ossimFilename &imageFile, ossim_uint32 entryIndex)
 Opens the image file. More...
 
virtual bool open (const ossimFilename &imageFile)
 
virtual bool open (std::shared_ptr< ossim::ImageHandlerState > state)
 
virtual bool buildHistogram (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histogram for image file. More...
 
virtual bool buildAllHistograms (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histograms for all image entries. More...
 
virtual bool buildOverview (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for theImageFile. More...
 
virtual bool buildAllOverviews (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for all image entries. More...
 
virtual bool buildOverview (const ossimFilename &filename, ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build an over file for filename. More...
 
ossimRefPtr< ossimMultiResLevelHistogramgetImageHistogram () const
 Fetches the current entry image's histogram. More...
 
virtual void setImageGeometry (ossimImageGeometry *geom)
 Sets the image geometry object. More...
 
virtual void saveImageGeometry () const
 Saves the image geometry to a file that will be made based on the image file name. More...
 
virtual void saveImageGeometry (const ossimFilename &geometry_file) const
 Saves the image geometry to a file that will be made based on the image file name. More...
 
virtual ossimIrect getImageRectangle (ossim_uint32 resLevel=0) const
 Returns zero-based bounding rectangle of the image. More...
 
virtual ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 Returns zero-based bounding rectangle of the image. More...
 
virtual void getDecimationFactor (ossim_uint32 resLevel, ossimDpt &result) const
 
virtual void getDecimationFactors (vector< ossimDpt > &decimations) const
 This returns all decimation for all levels. More...
 
virtual ossim_uint32 getNumberOfReducedResSets () const
 This method is obsolete. More...
 
virtual void setFilename (const ossimFilename &filename)
 Sets the filename. More...
 
virtual const ossimFilenamegetFilename () const
 Returns the filename. More...
 
virtual bool isValidRLevel (ossim_uint32 resLevel) const
 Determines if the passed in reslution level is valid. More...
 
bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 Connection rule. More...
 
virtual void getValidImageVertices (vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual bool isBandSelector () const
 Indicates whether or not the image handler can control output band selection via the setOutputBandList method. More...
 
virtual bool setOutputBandList (const std::vector< ossim_uint32 > &band_list)
 If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled. More...
 
virtual bool setOutputToInputBandList ()
 If the image handler "isBandSeletor()" then the band selection of the output are set to input or identity. More...
 
virtual bool isIdentityBandList (const std::vector< ossim_uint32 > &bandList) const
 Convenience method to see if band list is identity. More...
 
virtual bool isImageTiled () const
 Indicates whether or not the image is tiled internally. More...
 
virtual bool hasMetaData () const
 
virtual ossimRefPtr< ossimNBandLutDataObjectgetLut () const
 
virtual bool hasLut () const
 
virtual void loadMetaData ()
 There is an external file with an omd extension. More...
 
virtual void setMinPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set min pixel value. More...
 
virtual void setMaxPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set max pixel value. More...
 
virtual void setNullPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set null pixel value. More...
 
virtual ossim_uint32 getNumberOfEntries () const
 
virtual void getEntryName (ossim_uint32 entryIdx, std::string &name) const
 Get the name of entry as a string. More...
 
bool useEntryIndex () const
 Convenience method to determine if entry index should be used for support files, e.g. More...
 
ossimFilename getOverviewFile () const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
ossimFilename getFilenameWithThisExtension (const ossimString &ext, bool set_e0_prefix=false) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
void getFilenameWithThisExt (const ossimString &ext, ossimFilename &f) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
ossim_uint32 getStartingResLevel () const
 
void setStartingResLevel (ossim_uint32 level)
 
bool getOpenOverviewFlag () const
 
void setOpenOverviewFlag (bool flag)
 Sets theOpenOverviewFlag. More...
 
virtual void setSupplementaryDirectory (const ossimFilename &dir)
 Sets the supplementary directory. More...
 
virtual const ossimFilenamegetSupplementaryDirectory () const
 Returns the supplementary directory. More...
 
const ossimStringgetImageID () const
 Fetches the image ID. More...
 
void setImageID (const ossimString &id)
 Sets the image ID in case it is externally generated. More...
 
ossimPixelType getPixelType () const
 Returns the raster pixel alignment type. More...
 
virtual bool getRgbBandList (std::vector< ossim_uint32 > &bandList) const
 Convenience method to get the zero based rgb output band list. More...
 
template<class T >
std::shared_ptr< T > getStateAs ()
 
template<class T >
std::shared_ptr< const T > getStateAs () const
 
std::shared_ptr< ossim::ImageHandlerState > getState ()
 
std::shared_ptr< const ossim::ImageHandlerState > getState () const
 
void setState (std::shared_ptr< ossim::ImageHandlerState > state)
 
- 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 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 getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. 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 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
 

Protected Member Functions

void initTile ()
 
void addSample (std::map< ossim_int32, PcrBucket *> &accumulator, ossim_int32 index, const ossimPointRecord *sample)
 
void normalize (std::map< ossim_int32, PcrBucket *> &accumulator)
 
ossim_uint32 componentToFieldCode () const
 
- Protected Member Functions inherited from ossimImageHandler
virtual ossimRefPtr< ossimImageGeometrygetExternalImageGeometry () const
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
virtual ossimRefPtr< ossimImageGeometrygetInternalImageGeometry () const
 
virtual bool getOverviewTile (ossim_uint32 resLevel, ossimImageData *result)
 Method to get an overview tile. More...
 
bool initVertices (const char *file)
 Opens file and attempts to initialize the valid image vertices. More...
 
virtual void completeOpen ()
 Will complete the opening process. More...
 
void initImageParameters (ossimImageGeometry *geom) const
 Convenience method to set things needed in the image geometry from the image handler. More...
 
virtual void establishDecimationFactors ()
 Virtual method determines the decimation factors at each resolution level. More...
 
virtual bool setOutputBandList (const std::vector< ossim_uint32 > &inBandList, std::vector< ossim_uint32 > &outBandList)
 Convenience method to set output band list. More...
 
void getFilenameWithNoExtension (ossimFilename &f) const
 Get filename with no extension, using supplentary directory for dirname if set. More...
 
- 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< ossimPointCloudHandlerm_pch
 
ossim_float32 m_maxPixel
 
ossim_float32 m_minPixel
 
ossimDpt m_gsd
 
ossim_float64 m_gsdFactor
 
ossimRefPtr< ossimImageDatam_tile
 
std::mutex m_mutex
 
Components m_activeComponent
 
std::vector< ossimStringm_componentNames
 
- Protected Attributes inherited from ossimImageHandler
ossimFilename theImageFile
 
ossimFilename theOverviewFile
 
ossimFilename theSupplementaryDirectory
 
ossimRefPtr< ossimImageHandlertheOverview
 
vector< ossimIpttheValidImageVertices
 
ossimImageMetaData theMetaData
 
ossimRefPtr< ossimImageGeometrytheGeometry
 
ossimRefPtr< ossimNBandLutDataObjecttheLut
 
std::vector< ossimDpttheDecimationFactors
 
ossimString theImageID
 
ossim_uint32 theStartingResLevel
 theStartingResLevel If set to something other than zero(default) this is indicative that the reader is an overview. More...
 
bool theOpenOverviewFlag
 If true opening of overviews will be attempted. More...
 
ossimPixelType thePixelType
 
std::shared_ptr< ossim::ImageHandlerState > m_state
 
- 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
 

Detailed Description

Class used for rendering point cloud data into a raster tile.

It is derived from ossimImageHandler so that it can be included in the available file formats for reading as maintained by the ossimImageHandlerRegistry. This base class implementation exposes the data elements represented by the base-class ossimPointCloudSource and the individual point base-class ossimPointCloudRecord, namely, intensity, RGB color, elevation, and number of returns.

For sensor systems providing additional renderable data items, a derived class will be required to expose those components.

Definition at line 35 of file ossimPointCloudImageHandler.h.

Member Enumeration Documentation

◆ Components

Constructor & Destructor Documentation

◆ ossimPointCloudImageHandler()

ossimPointCloudImageHandler::ossimPointCloudImageHandler ( )

Definition at line 81 of file ossimPointCloudImageHandler.cpp.

References m_componentNames, m_gsd, and ossimDpt::makeNan().

83  m_maxPixel(1.0),
84  m_minPixel(0.0),
85  m_gsd(),
86  m_gsdFactor (1.0),
87  m_tile(0),
88  m_mutex(),
90 {
91  //---
92  // Nan out as can be set in several places, i.e. setProperty,
93  // loadState and initProjection.
94  //---
95  m_gsd.makeNan();
96 
97  m_componentNames.emplace_back(INTENSITY_KW);
98  m_componentNames.emplace_back(HIGHEST_KW);
99  m_componentNames.emplace_back(LOWEST_KW);
100  m_componentNames.emplace_back(RETURNS_KW);
101  m_componentNames.emplace_back(RGB_KW);
102 }
ossimRefPtr< ossimImageData > m_tile
std::vector< ossimString > m_componentNames
ossimImageHandler()
Constructor (default):
void makeNan()
Definition: ossimDpt.h:65

◆ ~ossimPointCloudImageHandler()

ossimPointCloudImageHandler::~ossimPointCloudImageHandler ( )
virtual

Definition at line 104 of file ossimPointCloudImageHandler.cpp.

References close().

105 {
106  close();
107 }
virtual void close()
Close method.

Member Function Documentation

◆ addSample()

void ossimPointCloudImageHandler::addSample ( std::map< ossim_int32, PcrBucket *> &  accumulator,
ossim_int32  index,
const ossimPointRecord sample 
)
protected

Definition at line 354 of file ossimPointCloudImageHandler.cpp.

References ossimPointRecord::Blue, ossimPointRecord::getField(), ossimPointRecord::getPosition(), ossimPointRecord::Green, ossimGpt::hgt, HIGHEST, ossimPointRecord::Intensity, INTENSITY, LOWEST, m_activeComponent, ossimPointCloudImageHandler::PcrBucket::m_bucket, ossimPointRecord::NumberOfReturns, ossimPointRecord::Red, RETURNS, and RGB.

Referenced by getTile().

357 {
358  if (sample == 0)
359  return;
360 
361  //cout << "sample: "<<*sample<<endl;//TODO: REMOVE DEBUG
362 
363  // Search map for exisiting point in that location:
364  auto iter = accumulator.find(index);
365  if (iter == accumulator.end())
366  {
367  // First hit. Initialize location with current sample:
369  {
370  accumulator[index] = new PcrBucket(sample->getField(ossimPointRecord::Intensity));
371  }
372  else if (m_activeComponent == RGB)
373  {
374  ossim_float32 color[3];
375  color[0] = sample->getField(ossimPointRecord::Red);
376  color[1] = sample->getField(ossimPointRecord::Green);
377  color[2] = sample->getField(ossimPointRecord::Blue);
378  accumulator[index] = new PcrBucket(color, 3);
379  }
380  else if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST))
381  accumulator[index] = new PcrBucket(sample->getPosition().hgt);
382  else if (m_activeComponent == RETURNS)
383  accumulator[index] = new PcrBucket(sample->getField(ossimPointRecord::NumberOfReturns));
384  }
385  else
386  {
387  // Not the first hit at this location, accumulate:
388  // First hit. Initialize location with current sample:
390  {
391  iter->second->m_bucket[0] += sample->getField(ossimPointRecord::Intensity);
392  }
393  else if (m_activeComponent == RGB)
394  {
395  iter->second->m_bucket[0] += sample->getField(ossimPointRecord::Red);
396  iter->second->m_bucket[1] += sample->getField(ossimPointRecord::Green);
397  iter->second->m_bucket[2] += sample->getField(ossimPointRecord::Blue);
398  }
399  else if ((m_activeComponent == HIGHEST) &&
400  (sample->getPosition().hgt > iter->second->m_bucket[0]))
401  iter->second->m_bucket[0] = sample->getPosition().hgt;
402  else if ((m_activeComponent == LOWEST) &&
403  (sample->getPosition().hgt < iter->second->m_bucket[0]))
404  iter->second->m_bucket[0] = sample->getPosition().hgt;
405  else if (m_activeComponent == RETURNS)
406  iter->second->m_bucket[0] += sample->getField(ossimPointRecord::NumberOfReturns);
407 
408  iter->second->m_numSamples++;
409  }
410 }
float ossim_float32
ossim_float32 getField(FIELD_CODES fc) const
Return the float value of the requested field.
ossim_float64 hgt
Height in meters above the ellipsiod.
Definition: ossimGpt.h:274
const ossimGpt & getPosition() const
Returns the 3D position vector in the dataset&#39;s coodinate reference system (available from the ossimP...

◆ close()

void ossimPointCloudImageHandler::close ( )
virtual

Close method.

Reimplemented from ossimImageHandler.

Definition at line 145 of file ossimPointCloudImageHandler.cpp.

References ossimPointCloudHandler::close(), ossimImageHandler::close(), isOpen(), m_pch, and m_tile.

Referenced by open(), setPointCloudHandler(), and ~ossimPointCloudImageHandler().

146 {
147  if (isOpen())
148  {
149  m_pch->close();
150  m_tile = 0;
152  }
153 }
ossimRefPtr< ossimPointCloudHandler > m_pch
ossimRefPtr< ossimImageData > m_tile
virtual bool isOpen() const
is open method.
virtual void close()
Deletes the overview and clears the valid image vertices.
virtual void close()=0
Closes the point cloud file(s).

◆ componentToFieldCode()

ossim_uint32 ossimPointCloudImageHandler::componentToFieldCode ( ) const
protected

◆ getCurrentEntry()

ossim_uint32 ossimPointCloudImageHandler::getCurrentEntry ( ) const
overridevirtual
Returns
The current entry number.

Reimplemented from ossimImageHandler.

Definition at line 522 of file ossimPointCloudImageHandler.cpp.

References m_activeComponent.

523 {
525 }
unsigned int ossim_uint32

◆ getEntryList()

void ossimPointCloudImageHandler::getEntryList ( std::vector< ossim_uint32 > &  entryList) const
overridevirtual

Gets entry list.

This list reflects the data component entry list provided by the derived point-cloud handler. This base class understands the basic (LIDAR-biased) entries: "Intensity", "RGB", "Elevation", and "Return". If a sensor provides other components, then a derived image handler will be needed to rasterize that data channel as well.

Parameters
entryListThis is the list to initialize with entry indexes.

Reimplemented from ossimImageHandler.

Definition at line 508 of file ossimPointCloudImageHandler.cpp.

References m_componentNames.

509 {
510  entryList.clear();
511  for (ossim_uint32 i = 0; i < m_componentNames.size(); i++)
512  {
513  entryList.emplace_back(i);
514  }
515 }
std::vector< ossimString > m_componentNames
unsigned int ossim_uint32

◆ getEntryNames()

void ossimPointCloudImageHandler::getEntryNames ( std::vector< ossimString > &  entryNames) const
overridevirtual
Parameters
getEntryNamesList to initialize with strings associated with entries.
Note
This implementation calls getEntryList and converts entries in the list to strings. Derived classes that support multiple entries with associated strings should re-implement.

Reimplemented from ossimImageHandler.

Definition at line 517 of file ossimPointCloudImageHandler.cpp.

References m_componentNames.

518 {
519  entryNames = m_componentNames;
520 }
std::vector< ossimString > m_componentNames

◆ getGSD()

void ossimPointCloudImageHandler::getGSD ( ossimDpt gsd,
ossim_uint32  resLevel 
) const

Get the GSD for resLevel.

Definition at line 616 of file ossimPointCloudImageHandler.cpp.

References m_gsd, ossimDpt::x, and ossimDpt::y.

Referenced by getTile(), and writeRaster().

617 {
618  // std::pow(2.0, 0) returns 1.
619  ossim_float64 d = std::pow(2.0, static_cast<double>(resLevel));
620  gsd.x = m_gsd.x * d;
621  gsd.y = m_gsd.y * d;
622 }
double y
Definition: ossimDpt.h:165
double ossim_float64
double x
Definition: ossimDpt.h:164

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimPointCloudImageHandler::getImageGeometry ( )
overridevirtual

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

The geometry contains full-to-local image transform as well as projection (image-to-world).

Reimplemented from ossimImageHandler.

Definition at line 155 of file ossimPointCloudImageHandler.cpp.

References ossimEpsgProjectionFactory::createProjection(), ossimPointCloudHandler::getBounds(), ossimImageHandler::getExternalImageGeometry(), ossimPointCloudSource::getNumPoints(), ossimDpt::hasNans(), ossimGrect::heightMeters(), ossimEpsgProjectionFactory::instance(), isOpen(), m_gsd, m_gsdFactor, m_pch, ossimDpt::makeNan(), setGSD(), ossimMapProjection::setOrigin(), ossimImageGeometry::setProjection(), ossimMapProjection::setUlTiePoints(), ossimImageHandler::theGeometry, ossimGrect::ul(), ossimRefPtr< T >::valid(), and ossimGrect::widthMeters().

Referenced by ossimPointCloudTool::loadPC(), open(), and setPointCloudHandler().

156 {
157  if (!isOpen())
158  return 0;
159 
160  if (theGeometry.valid())
161  return theGeometry;
162 
163  // Check for external geom (i.e., a *.geom file)
165  if (theGeometry.valid())
166  return theGeometry;
167 
169  ossimString epsgCode ("EPSG:4326");
170  ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>( // NOLINT
172  if (!proj)
173  return 0;
174  theGeometry->setProjection(proj);
175 
176  // Need to establish image bounds and optimal GSD given ground rect. Use this switch to also
177  // initialize the UL tiepoint of image projection:
178  ossimGrect bounds;
179  m_pch->getBounds(bounds);
180  proj->setOrigin(bounds.ul());
181  proj->setUlTiePoints(bounds.ul());
182 
183  // The GSD depends on the point density on the ground. count all final returns and
184  // assume they are evenly distributed over the bounding ground rect. Note that this can have
185  // up to a sqrt(2)X error if the collection was taken in a cardinal-diagonal direction.
186  // Also use this point loop to latch the ground quad vertices vertices.
187  ossim_uint32 numPulses = m_pch->getNumPoints(); // count of final returns
188  if (numPulses == 0)
189  {
190  // Not yet determined. Set GSD to NAN and expect it will be set later:
191  m_gsd.makeNan();
192  }
193  else if (m_gsd.hasNans())
194  {
195  ossimDpt delta (bounds.widthMeters(), bounds.heightMeters());
196  ossim_float64 gsd = sqrt(delta.x * delta.y / numPulses) * m_gsdFactor;
197  setGSD(gsd); // also recomputes the image size
198  }
199 
200  return theGeometry;
201 }
ossimRefPtr< ossimImageGeometry > theGeometry
virtual ossim_uint32 getNumPoints() const =0
Returns the total number of points in the dataset (not just the block returned in getPoints) ...
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
ossimRefPtr< ossimPointCloudHandler > m_pch
bool valid() const
Definition: ossimRefPtr.h:75
virtual void setOrigin(const ossimGpt &origin)
Sets theOrigin to origin.
virtual void getBounds(ossimGrect &bounds) const
virtual bool isOpen() const
is open method.
ossim_float64 widthMeters() const
Returns the width of a rectangle in meters using the center lat for scaling EW direction.
Definition: ossimGrect.cpp:292
double ossim_float64
void setGSD(const ossim_float64 &gsd)
Sets m_gsd data member and projection if projection is set.
unsigned int ossim_uint32
const ossimGpt & ul() const
Definition: ossimGrect.h:252
bool hasNans() const
Definition: ossimDpt.h:67
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
STUB. Not implemented.
ossim_float64 heightMeters() const
Returns the height of a rectangle in meters.
Definition: ossimGrect.cpp:286
virtual void setUlTiePoints(const ossimGpt &gpt)
static ossimEpsgProjectionFactory * instance()
Implements singleton pattern.
void makeNan()
Definition: ossimDpt.h:65

◆ getImageTileHeight()

ossim_uint32 ossimPointCloudImageHandler::getImageTileHeight ( ) const
overridevirtual

Gets tile height.

Satisfies ossimImageHandler::getImageTileHeight pure virtual.

Returns
The tile width of the image or 0 if the image is not tiled. Note: this is not the same as the ossimImageSource::getTileWidth which returns the output tile width which can be different than the internal image tile width on disk.

Implements ossimImageHandler.

Definition at line 484 of file ossimPointCloudImageHandler.cpp.

References getTileHeight().

485 {
486  return getTileHeight();
487 }
ossim_uint32 getTileHeight() const override

◆ getImageTileWidth()

ossim_uint32 ossimPointCloudImageHandler::getImageTileWidth ( ) const
overridevirtual

Gets tile width.

Satisfies ossimImageHandler::getImageTileWidth pure virtual.

Returns
The tile width of the image or 0 if the image is not tiled. Note: this is not the same as the ossimImageSource::getTileWidth which returns the output tile width which can be different than the internal image tile width on disk.

Implements ossimImageHandler.

Definition at line 479 of file ossimPointCloudImageHandler.cpp.

References getTileWidth().

480 {
481  return getTileWidth();
482 }
ossim_uint32 getTileWidth() const override

◆ getLongName()

ossimString ossimPointCloudImageHandler::getLongName ( ) const
overridevirtual
Returns
"ossim point cloud to image renderer"

Reimplemented from ossimObject.

Definition at line 565 of file ossimPointCloudImageHandler.cpp.

566 {
567  return ossimString("ossim point cloud to image renderer");
568 }

◆ getMaxPixelValue()

double ossimPointCloudImageHandler::getMaxPixelValue ( ossim_uint32  band) const
overridevirtual
Returns
Min pixel value.

Reimplemented from ossimImageHandler.

Definition at line 575 of file ossimPointCloudImageHandler.cpp.

References m_maxPixel.

Referenced by initTile().

576 {
577  return m_maxPixel;
578 }

◆ getMinPixelValue()

double ossimPointCloudImageHandler::getMinPixelValue ( ossim_uint32  band) const
overridevirtual
Returns
Min pixel value.

Reimplemented from ossimImageHandler.

Definition at line 570 of file ossimPointCloudImageHandler.cpp.

References m_minPixel.

Referenced by initTile().

571 {
572  return m_minPixel;
573 }

◆ getNullPixelValue()

double ossimPointCloudImageHandler::getNullPixelValue ( ossim_uint32  band) const
overridevirtual
Returns
Min pixel value.

Reimplemented from ossimImageHandler.

Definition at line 580 of file ossimPointCloudImageHandler.cpp.

References OSSIM_DEFAULT_NULL_PIX_FLOAT.

Referenced by initTile().

581 {
583 }
#define OSSIM_DEFAULT_NULL_PIX_FLOAT

◆ getNumberOfDecimationLevels()

ossim_uint32 ossimPointCloudImageHandler::getNumberOfDecimationLevels ( ) const
overridevirtual
Returns
The total number of decimation levels.

Reimplemented from ossimImageHandler.

Definition at line 585 of file ossimPointCloudImageHandler.cpp.

References getNumberOfLines(), and getNumberOfSamples().

586 {
587  // Can support any number of rlevels.
588  ossim_uint32 result = 1;
589  const ossim_uint32 STOP_DIMENSION = 16;
590  ossim_uint32 largestImageDimension =
592  while (largestImageDimension > STOP_DIMENSION)
593  {
594  largestImageDimension /= 2;
595  ++result;
596  }
597  return result;
598 }
ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const override
Gets samples.
ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const override
Gets lines.
unsigned int ossim_uint32

◆ getNumberOfInputBands()

ossim_uint32 ossimPointCloudImageHandler::getNumberOfInputBands ( ) const
overridevirtual

Gets bands.

Satisfies ossimImageSource::getNumberOfInputBands pure virtual. Number of bands.

Implements ossimImageSource.

Definition at line 436 of file ossimPointCloudImageHandler.cpp.

References HIGHEST, INTENSITY, LOWEST, m_activeComponent, m_pch, RETURNS, RGB, and ossimRefPtr< T >::valid().

Referenced by getTile().

437 {
438  ossim_uint32 numBands = 0;
439  if (m_pch.valid())
440  {
442  numBands = 1;
443  else if (m_activeComponent == RGB)
444  numBands = 3;
445  else if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST))
446  numBands = 1;
447  else if (m_activeComponent == RETURNS)
448  numBands = 1;
449  }
450  return numBands;
451 }
ossimRefPtr< ossimPointCloudHandler > m_pch
bool valid() const
Definition: ossimRefPtr.h:75
unsigned int ossim_uint32

◆ getNumberOfLines()

ossim_uint32 ossimPointCloudImageHandler::getNumberOfLines ( ossim_uint32  resLevel = 0) const
overridevirtual

Gets lines.

Satisfies ossimImageHandler::getNumberOfLines pure virtual.

Parameters
resLevelReduced resolution level to return lines of. Default = 0
Returns
The number of lines for specified reduced resolution level.

Implements ossimImageHandler.

Definition at line 453 of file ossimPointCloudImageHandler.cpp.

References ossimImageGeometry::getImageSize(), isOpen(), ossimIpt::line, ossimImageHandler::theGeometry, and ossimRefPtr< T >::valid().

Referenced by getNumberOfDecimationLevels().

454 {
455  ossim_uint32 result = 0;
456  if (isOpen() && theGeometry.valid())
457  {
458  ossimIpt image_size(theGeometry->getImageSize());
459  result = image_size.line;
460  if (resLevel)
461  result = (result >> resLevel);
462  }
463  return result;
464 }
ossimRefPtr< ossimImageGeometry > theGeometry
const ossimIpt & getImageSize() const
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool isOpen() const
is open method.
unsigned int ossim_uint32
ossim_int32 line
Definition: ossimIpt.h:142

◆ getNumberOfSamples()

ossim_uint32 ossimPointCloudImageHandler::getNumberOfSamples ( ossim_uint32  resLevel = 0) const
overridevirtual

Gets samples.

Satisfies ossimImageHandler::getNumberOfSamples

Parameters
resLevelReduced resolution level to return samples of. Default = 0
Returns
The number of samples for specified reduced resolution level.

Implements ossimImageHandler.

Definition at line 466 of file ossimPointCloudImageHandler.cpp.

References ossimImageGeometry::getImageSize(), isOpen(), ossimIpt::samp, ossimImageHandler::theGeometry, and ossimRefPtr< T >::valid().

Referenced by getNumberOfDecimationLevels().

467 {
468  ossim_uint32 result = 0;
469  if (isOpen() && theGeometry.valid())
470  {
471  ossimIpt image_size(theGeometry->getImageSize());
472  result = image_size.samp;
473  if (resLevel)
474  result = (result >> resLevel);
475  }
476  return result;
477 }
ossimRefPtr< ossimImageGeometry > theGeometry
const ossimIpt & getImageSize() const
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool isOpen() const
is open method.
unsigned int ossim_uint32
ossim_int32 samp
Definition: ossimIpt.h:141

◆ getOutputScalarType()

ossimScalarType ossimPointCloudImageHandler::getOutputScalarType ( ) const
overridevirtual
Returns
The output pixel type of the tile source.

Reimplemented from ossimImageSource.

Definition at line 503 of file ossimPointCloudImageHandler.cpp.

References OSSIM_FLOAT32.

Referenced by initTile().

504 {
505  return OSSIM_FLOAT32;
506 }
32 bit floating point

◆ getProperty()

ossimRefPtr< ossimProperty > ossimPointCloudImageHandler::getProperty ( const ossimString name) const
overridevirtual

Reimplemented from ossimImageHandler.

Definition at line 784 of file ossimPointCloudImageHandler.cpp.

References m_gsd, ossimKeywordNames::METERS_PER_PIXEL_KW, ossimString::toString(), and ossimDpt::x.

785 {
788  {
790  prop = new ossimStringProperty(name, value);
791  }
792  else if ( name == GSD_FACTOR_KW )
793  {
795  }
796  else if ( name == ossimKeywordNames::ENTRY_KW )
797  {
799  }
800  else if ( name == COMPONENT_KW )
801  {
803  }
804  else
805  {
806  prop = ossimImageHandler::getProperty(name);
807  }
808  return prop;
809 }
static ossimString toString(bool aValue)
Numeric to string methods.
std::vector< ossimString > m_componentNames
unsigned int ossim_uint32
static const char * ENTRY_KW
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
static const char * METERS_PER_PIXEL_KW
double x
Definition: ossimDpt.h:164

◆ getShortName()

ossimString ossimPointCloudImageHandler::getShortName ( ) const
overridevirtual
Returns
"point-cloud"

Reimplemented from ossimObject.

Definition at line 560 of file ossimPointCloudImageHandler.cpp.

561 {
562  return ossimString("Point Cloud Image Handler");
563 }

◆ getTile() [1/2]

ossimRefPtr< ossimImageData > ossimPointCloudImageHandler::getTile ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
overridevirtual

Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab from the image.

Satisfies pure virtual from TileSource class.

Reimplemented from ossimImageSource.

Definition at line 203 of file ossimPointCloudImageHandler.cpp.

References ossimRefPtr< T >::get(), ossimDataObject::getDataObjectStatus(), initTile(), m_tile, ossimImageData::makeBlank(), OSSIM_NULL, ossimImageData::setImageRectangle(), and ossimRefPtr< T >::valid().

Referenced by ossimPointCloudUtilityFilter::getTile().

205 {
206  if (!m_tile.valid())
207  initTile();
208 
209  // Image rectangle must be set prior to calling getTile.
210  m_tile->setImageRectangle(tile_rect);
211  if (!getTile(m_tile.get(), resLevel))
212  {
214  m_tile->makeBlank();
215  }
216 
217  return m_tile;
218 }
virtual void setImageRectangle(const ossimIrect &rect)
ossimRefPtr< ossimImageData > m_tile
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimDataObjectStatus getDataObjectStatus() const
ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0) override
Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab fr...
virtual void makeBlank()
Initializes data to null pixel values.

◆ getTile() [2/2]

bool ossimPointCloudImageHandler::getTile ( ossimImageData result,
ossim_uint32  resLevel = 0 
)
overridevirtual

Method to get a tile.

Parameters
resultThe tile to stuff. Note The requested rectangle in full image space and bands should be set in the result tile prior to passing. It will be an error if: result.getNumberOfBands() != this->getNumberOfOutputBands()
Returns
true on success false on error. If return is false, result is undefined so caller should handle appropriately with makeBlank or whatever.

Reimplemented from ossimImageSource.

Definition at line 220 of file ossimPointCloudImageHandler.cpp.

References addSample(), ossimIrect::area(), ossimPointBlock::clear(), componentToFieldCode(), ossimPointCloudHandler::DEFAULT_BLOCK_SIZE, ossimPointCloudHandler::getBlock(), ossimDataObject::getDataObjectStatus(), ossimImageData::getFloatBuf(), getGSD(), ossimImageData::getImageRectangle(), ossimPointCloudHandler::getNextFileBlock(), ossimImageData::getNumberOfBands(), getNumberOfInputBands(), ossimPointCloudSource::getNumPoints(), ossimRectilinearDataObject::getScalarType(), ossimDpt::hasNans(), ossimIrect::height(), ossimIrect::lr(), m_gsd, m_pch, ossimImageData::makeBlank(), normalize(), OSSIM_DEFAULT_NULL_PIX_FLOAT, OSSIM_FLOAT32, OSSIM_NULL, ossimNotify(), ossimNotifyLevel_FATAL, ossimGrect::pointWithin(), ossimPointCloudHandler::rewind(), ossimImageGeometry::rnToWorld(), ossimPointBlock::setFieldCode(), ossimImageData::setNullPix(), ossimPointBlock::size(), ossimImageHandler::theGeometry, ossimIrect::ul(), ossimRefPtr< T >::valid(), ossimImageData::validate(), ossimIrect::width(), ossimImageGeometry::worldToRn(), ossimIpt::x, ossimDpt::x, x, ossimIpt::y, ossimDpt::y, and y.

221 {
222  // check for all systems go and valid args:
223  if (!m_pch.valid() || !result || (result->getScalarType() != OSSIM_FLOAT32)
224  || (result->getDataObjectStatus() == OSSIM_NULL) || m_gsd.hasNans())
225  {
226  return false;
227  }
228 
229  // Overviews achieved with GSD setting. This may be too slow.
230  ossimDpt gsd (m_gsd);
231  if (resLevel > 0)
232  getGSD(gsd, resLevel);
233 
234  // Establish the ground and image rects for this tile:
235  const ossimIrect img_tile_rect = result->getImageRectangle();
236  const ossimIpt tile_offset (img_tile_rect.ul());
237  const ossim_uint32 tile_width = img_tile_rect.width();
238  const ossim_uint32 tile_height = img_tile_rect.height();
239  const ossim_uint32 tile_size = img_tile_rect.area();
240 
241  ossimGpt gnd_ul, gnd_lr;
242  ossimDpt dpt_ul (img_tile_rect.ul().x - 0.5, img_tile_rect.ul().y - 0.5);
243  ossimDpt dpt_lr (img_tile_rect.lr().x + 0.5, img_tile_rect.lr().y + 0.5);
244  theGeometry->rnToWorld(dpt_ul, resLevel, gnd_ul);
245  theGeometry->rnToWorld(dpt_lr, resLevel, gnd_lr);
246  const ossimGrect gnd_rect (gnd_ul, gnd_lr);
247 
248  // Create array of buckets to store accumulated point data.
249  ossim_uint32 numBands = result->getNumberOfBands();
250  if (numBands > getNumberOfInputBands())
251  {
252  // This should never happen;
254  << "ossimPointCloudImageHandler::getTile() ERROR: \n"
255  << "More bands were requested than was available from the point cloud source. Returning "
256  << "blank tile." << endl;
257  result->makeBlank();
258  return false;
259  }
260  std::map<ossim_int32, PcrBucket*> accumulator;
261 
262  // initialize a point block with desired fields as requested in the reader properties
263  ossimPointBlock pointBlock (this);
264  pointBlock.setFieldCode(componentToFieldCode());
265  m_pch->rewind();
266 
267  ossimDpt ipt;
268  ossimGpt pos;
269 
270 #define USE_GETBLOCK
271 #ifdef USE_GETBLOCK
272  m_pch->getBlock(gnd_rect, pointBlock);
273  for (ossim_uint32 id=0; id<pointBlock.size(); ++id)
274  {
275  pos = pointBlock[id]->getPosition();
276  theGeometry->worldToRn(pos, resLevel, ipt);
277  ipt.x = ossim::round<double,double>(ipt.x) - tile_offset.x;
278  ipt.y = ossim::round<double,double>(ipt.y) - tile_offset.y;
279 
280  ossim_int32 bucketIndex = ipt.y*tile_width + ipt.x;
281  if ((bucketIndex >= 0) && (bucketIndex < (ossim_int32)tile_size))
282  addSample(accumulator, bucketIndex, pointBlock[id]);
283  }
284 
285 #else // using getFileBlock
286  ossim_uint32 numPoints = m_pch->getNumPoints();
289 
290  // Loop to read all point blocks:
291  do
292  {
293  pointBlock.clear();
294  m_pch->getNextFileBlock(pointBlock, numPoints);
295  //m_pch->normalizeBlock(pointBlock);
296 
297  for (ossim_uint32 id=0; id<pointBlock.size(); ++id)
298  {
299  // Check that each point in read block is inside the ROI before accumulating it:
300  pos = pointBlock[id]->getPosition();
301  if (gnd_rect.pointWithin(pos))
302  {
303  theGeometry->worldToRn(pos, resLevel, ipt);
304  ipt.x = ossim::round<double,double>(ipt.x) - tile_offset.x;
305  ipt.y = ossim::round<double,double>(ipt.y) - tile_offset.y;
306 
307  ossim_int32 bucketIndex = ipt.y*tile_width + ipt.x;
308  if ((bucketIndex >= 0) && (bucketIndex < (ossim_int32)tile_size))
309  addSample(accumulator, bucketIndex, pointBlock[id]);
310  }
311  }
312  } while (pointBlock.size() == numPoints);
313 #endif
314 
315  // Finished accumulating, need to normalize and fill the tile.
316  // We must always blank out the tile as we may not have a point for every pixel.
317  normalize(accumulator);
318  auto buf = new ossim_float32*[numBands];
319  std::map<ossim_int32, PcrBucket*>::iterator accum_iter;
321  result->setNullPix(null_pixel);
322  for (ossim_uint32 band = 0; band < numBands; band++)
323  {
324  ossim_uint32 index = 0;
325  buf[band] = result->getFloatBuf(band);
326  for (ossim_uint32 y = 0; y < tile_height; y++)
327  {
328  for (ossim_uint32 x = 0; x < tile_width; x++)
329  {
330  accum_iter = accumulator.find(index);
331  if (accum_iter != accumulator.end())
332  buf[band][index] = accum_iter->second->m_bucket[band];
333  else
334  buf[band][index] = null_pixel;
335  ++index;
336  }
337  }
338  }
339 
340  delete [] buf;
341  buf = 0;
342 
343  auto pcr_iter = accumulator.begin();
344  while (pcr_iter != accumulator.end())
345  {
346  delete pcr_iter->second;
347  pcr_iter++;
348  }
349 
350  result->validate();
351  return true;
352 }
ossim_uint32 x
ossimRefPtr< ossimImageGeometry > theGeometry
virtual ossim_uint32 getNumPoints() const =0
Returns the total number of points in the dataset (not just the block returned in getPoints) ...
virtual ossim_uint32 getNumberOfBands() const
ossimRefPtr< ossimPointCloudHandler > m_pch
ossim_uint32 y
bool valid() const
Definition: ossimRefPtr.h:75
float ossim_float32
double y
Definition: ossimDpt.h:165
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
32 bit floating point
void getGSD(ossimDpt &gsd, ossim_uint32 resLevel) const
Get the GSD for resLevel.
virtual void setNullPix(ossim_float64 null_pix)
ossim_uint32 getNumberOfInputBands() const override
Gets bands.
static ossim_uint32 DEFAULT_BLOCK_SIZE
void addSample(std::map< ossim_int32, PcrBucket *> &accumulator, ossim_int32 index, const ossimPointRecord *sample)
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
void rnToWorld(const ossimDpt &rnPt, ossim_uint32 resolutionLevel, ossimGpt &wpt) const
rnToWorld is a utility method that takes a rn resolution image point and maps it to the world point...
void worldToRn(const ossimGpt &wpt, ossim_uint32 resolutionLevel, ossimDpt &rnPt) const
worldToRn is a utility method that takes a world point allows one to transform all the way back to an...
ossim_uint32 width() const
Definition: ossimIrect.h:500
bool hasNans() const
Definition: ossimDpt.h:67
virtual const ossim_float32 * getFloatBuf() const
virtual ossimScalarType getScalarType() const
virtual void makeBlank()
Initializes data to null pixel values.
virtual void getBlock(const ossimGrect &bounds, ossimPointBlock &block) const
Fetches the block of points inside the block bounds.
virtual void rewind() const
ossim_int32 y
Definition: ossimIpt.h:142
ossim_uint32 area() const
Definition: ossimIrect.h:396
double x
Definition: ossimDpt.h:164
#define OSSIM_DEFAULT_NULL_PIX_FLOAT
ossim_int32 x
Definition: ossimIpt.h:141
void normalize(std::map< ossim_int32, PcrBucket *> &accumulator)
virtual void getNextFileBlock(ossimPointBlock &block, ossim_uint32 maxNumPoints=0xFFFFFFFF) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ getTileHeight()

ossim_uint32 ossimPointCloudImageHandler::getTileHeight ( ) const
overridevirtual
Returns
The height of the output tile.

Reimplemented from ossimImageSource.

Definition at line 496 of file ossimPointCloudImageHandler.cpp.

References ossim::defaultTileSize(), and ossimIpt::y.

Referenced by getImageTileHeight(), and initTile().

497 {
498  ossimIpt ipt;
500  return ipt.y;
501 }
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
ossim_int32 y
Definition: ossimIpt.h:142

◆ getTileWidth()

ossim_uint32 ossimPointCloudImageHandler::getTileWidth ( ) const
overridevirtual
Returns
The width of the output tile.

Reimplemented from ossimImageSource.

Definition at line 489 of file ossimPointCloudImageHandler.cpp.

References ossim::defaultTileSize(), and ossimIpt::x.

Referenced by getImageTileWidth(), and initTile().

490 {
491  ossimIpt ipt;
493  return ipt.x;
494 }
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
ossim_int32 x
Definition: ossimIpt.h:141

◆ getValidImageVertices()

void ossimPointCloudImageHandler::getValidImageVertices ( std::vector< ossimIpt > &  validVertices,
ossimVertexOrdering  ordering,
ossim_uint32  resLevel 
) const
overridevirtual

ordering specifies how the vertices should be arranged.

valid image vertices is basically the tightly fit convex hull of the image. Usually an image has NULL values and are internally not upright rectangular. This can cause problems some spatial filters.

The default implementation is to return the bounding rect.

Reimplemented from ossimImageSource.

Definition at line 703 of file ossimPointCloudImageHandler.cpp.

References ossimPointCloudHandler::getBounds(), ossimGrect::ll(), ossimGrect::lr(), m_pch, OSSIM_COUNTERCLOCKWISE_ORDER, ossimImageHandler::theGeometry, ossimGrect::ul(), ossimGrect::ur(), ossimRefPtr< T >::valid(), and ossimImageGeometry::worldToLocal().

706 {
707  validVertices.clear();
708  if (!m_pch.valid())
709  return;
710  int divisor = 1;
711  if (resLevel)
712  divisor = resLevel<<1;
713 
714  // Transform the world coords for the four vertices into image vertices:
715  ossimDpt r0Pt;
716  ossimGrect bounds;
717  m_pch->getBounds(bounds);
718  theGeometry->worldToLocal(bounds.ul(), r0Pt);
719  validVertices.emplace_back(r0Pt);
720  theGeometry->worldToLocal(bounds.ur(), r0Pt);
721  validVertices.emplace_back(r0Pt);
722  theGeometry->worldToLocal(bounds.lr(), r0Pt);
723  validVertices.emplace_back(r0Pt);
724  theGeometry->worldToLocal(bounds.ll(), r0Pt);
725  validVertices.emplace_back(r0Pt);
726 
727  if (ordering == OSSIM_COUNTERCLOCKWISE_ORDER)
728  {
729  for (int i=3; i>=0; i--)
730  validVertices.emplace_back(validVertices[i]/divisor);
731  validVertices.erase(validVertices.begin(), validVertices.begin()+4);
732  }
733 }
ossimRefPtr< ossimImageGeometry > theGeometry
ossimRefPtr< ossimPointCloudHandler > m_pch
bool valid() const
Definition: ossimRefPtr.h:75
virtual void getBounds(ossimGrect &bounds) const
const ossimGpt & ul() const
Definition: ossimGrect.h:252
ossimGpt ur() const
Definition: ossimGrect.h:257
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
const ossimGpt & lr() const
Definition: ossimGrect.h:269
ossimGpt ll() const
Definition: ossimGrect.h:263

◆ initTile()

void ossimPointCloudImageHandler::initTile ( )
protected

Definition at line 600 of file ossimPointCloudImageHandler.cpp.

References getMaxPixelValue(), getMinPixelValue(), getNullPixelValue(), ossimImageSource::getNumberOfOutputBands(), getOutputScalarType(), getTileHeight(), getTileWidth(), ossimImageData::initialize(), m_tile, ossimImageData::setMaxPix(), ossimImageData::setMinPix(), and ossimImageData::setNullPix().

Referenced by getTile().

601 {
602  const ossim_uint32 BANDS = getNumberOfOutputBands();
603 
605 
606  for (ossim_uint32 band = 0; band < BANDS; ++band)
607  {
608  m_tile->setMinPix(getMinPixelValue(band), band);
609  m_tile->setMaxPix(getMaxPixelValue(band), band);
610  m_tile->setNullPix(getNullPixelValue(band), band);
611  }
612 
613  m_tile->initialize();
614 }
ossimRefPtr< ossimImageData > m_tile
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
ossimScalarType getOutputScalarType() const override
double getNullPixelValue(ossim_uint32 band) const override
virtual void initialize()
Initialize the data buffer.
ossim_uint32 getTileHeight() const override
virtual void setNullPix(ossim_float64 null_pix)
unsigned int ossim_uint32
double getMaxPixelValue(ossim_uint32 band) const override
double getMinPixelValue(ossim_uint32 band) const override
virtual void setMaxPix(ossim_float64 max_pix)
ossim_uint32 getTileWidth() const override
virtual void setMinPix(ossim_float64 min_pix)

◆ isOpen()

virtual bool ossimPointCloudImageHandler::isOpen ( ) const
inlinevirtual

is open method.

Satisfies ossimImageHandler::isOpen pure virtual.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 59 of file ossimPointCloudImageHandler.h.

Referenced by close(), getImageGeometry(), getNumberOfLines(), and getNumberOfSamples().

59 { return m_pch.valid(); }
ossimRefPtr< ossimPointCloudHandler > m_pch
bool valid() const
Definition: ossimRefPtr.h:75

◆ loadState()

bool ossimPointCloudImageHandler::loadState ( const ossimKeywordlist kwl,
const char *  prefix 
)
overridevirtual

Method to the load (recreate) the state of an object from a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageHandler.

Definition at line 669 of file ossimPointCloudImageHandler.cpp.

References ossimImageHandler::theDecimationFactors.

670 {
671  static const char MODULE[] = "ossimPointCloudImageHandler::loadState()";
672  theDecimationFactors.clear();
673  if(traceDebug())
674  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " DEBUG: entered ..."<< std::endl;
675 
676  ossimImageHandler::loadState(kwl, prefix);
678  {
680  << "WARNING: error detected in keyword list! State not load." << std::endl;
681  return false;
682  }
683 
685  ossimString value = kwl.find(prefix, ossimKeywordNames::ENTRY_KW);
686  if (!value.empty())
687  {
688  ossim_uint32 i = value.toUInt32();
689  if (i < NUM_COMPONENTS)
691  }
692 
693  value = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW);
694  if (!value.empty())
695  setGSD(value.toDouble());
696 
697  // The rest of the state is established by opening the file:
698  bool good_open = open();
699 
700  return good_open;
701 }
const char * find(const char *key) const
std::vector< ossimDpt > theDecimationFactors
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 const ossimErrorCode OSSIM_ERROR
ossim_uint32 toUInt32() const
void setGSD(const ossim_float64 &gsd)
Sets m_gsd data member and projection if projection is set.
unsigned int ossim_uint32
double toDouble() const
static const char * ENTRY_KW
virtual ossimErrorCode getErrorStatus() const
static const char * METERS_PER_PIXEL_KW
bool empty() const
Definition: ossimString.h:411
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ normalize()

void ossimPointCloudImageHandler::normalize ( std::map< ossim_int32, PcrBucket *> &  accumulator)
protected

Definition at line 412 of file ossimPointCloudImageHandler.cpp.

References HIGHEST, LOWEST, m_activeComponent, RETURNS, and RGB.

Referenced by getTile().

413 {
414  // highest and lowest elevations latch extremes, no mean is computed but needs to be normalized
417  return;
418 
419  int numBands = 1;
420  if (m_activeComponent == RGB)
421  numBands = 3;
422 
423  auto iter = accumulator.begin();
424  ossim_float32 avg;
425  while (iter != accumulator.end())
426  {
427  for (int i=0; i<numBands; i++)
428  {
429  avg = iter->second->m_bucket[i] / iter->second->m_numSamples;
430  iter->second->m_bucket[i] = avg;
431  }
432  iter++;
433  }
434 }
float ossim_float32

◆ open()

bool ossimPointCloudImageHandler::open ( )
virtual

open method.

Satisfies ossimImageHandler::open pure virtual.

Returns
Returns true on success, false on error.
Note
This method relies on the data member ossimImageData::theImageFile being set. Callers should do a "setFilename" prior to calling this method or use the ossimImageHandler::open that takes a file name and an entry index.

Implements ossimImageHandler.

Definition at line 109 of file ossimPointCloudImageHandler.cpp.

References close(), ossimImageHandler::completeOpen(), getImageGeometry(), ossimPointCloudHandlerRegistry::instance(), m_activeComponent, m_pch, ossimPointCloudHandlerRegistry::open(), setCurrentEntry(), ossimImageHandler::theImageFile, and ossimRefPtr< T >::valid().

110 {
111  close();
112 
113  // Need to utilize the Point Cloud handler registry to open the PC file:
115  if (!m_pch.valid())
116  return false;
117 
120 
121  // Needed here after open to make sure that min/max pixels are set for active component/entry
123 
124  return true;
125 }
ossimFilename theImageFile
ossimRefPtr< ossimPointCloudHandler > m_pch
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimPointCloudHandler * open(const ossimFilename &fileName) const
ossimRefPtr< ossimImageGeometry > getImageGeometry() override
Returns the image geometry object associated with this tile source or NULL if non defined...
unsigned int ossim_uint32
bool setCurrentEntry(ossim_uint32 entryIdx) override
static ossimPointCloudHandlerRegistry * instance()
virtual void completeOpen()
Will complete the opening process.
virtual void close()
Close method.

◆ saveState()

bool ossimPointCloudImageHandler::saveState ( ossimKeywordlist kwl,
const char *  prefix 
) const
overridevirtual

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

Return true if ok or false on error.

Reimplemented from ossimImageHandler.

Definition at line 651 of file ossimPointCloudImageHandler.cpp.

References ossimKeywordlist::add(), ossimKeywordNames::ENTRY_KW, ossimErrorStatusInterface::getErrorStatus(), m_activeComponent, m_gsd, ossimKeywordNames::METERS_PER_PIXEL_KW, ossimErrorCodes::OSSIM_ERROR, ossimNotify(), ossimNotifyLevel_WARN, ossimImageHandler::saveState(), and ossimDpt::x.

652 {
653  static const char MODULE[] = "ossimPointCloudImageHandler::saveState()";
654 
655  ossimImageHandler::saveState(kwl, prefix);
657  {
659  << " ERROR detected in keyword list! State not saved." << std::endl;
660  return false;
661  }
662 
663  kwl.add(prefix, ossimKeywordNames::ENTRY_KW, (int) m_activeComponent, true);
665 
666  return true;
667 }
static const ossimErrorCode OSSIM_ERROR
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static const char * ENTRY_KW
virtual ossimErrorCode getErrorStatus() const
static const char * METERS_PER_PIXEL_KW
double x
Definition: ossimDpt.h:164
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ setCurrentEntry()

bool ossimPointCloudImageHandler::setCurrentEntry ( ossim_uint32  entryIdx)
overridevirtual
Parameters
entryIdxEntry number to select.
Returns
true if it was able to set the current entry and false otherwise.

Reimplemented from ossimImageHandler.

Definition at line 527 of file ossimPointCloudImageHandler.cpp.

References ossimPointRecord::getField(), ossimPointCloudHandler::getMaxPoint(), ossimPointCloudHandler::getMinPoint(), ossimPointRecord::getPosition(), ossimGpt::hgt, HIGHEST, ossimPointRecord::Intensity, INTENSITY, LOWEST, m_activeComponent, m_maxPixel, m_minPixel, m_pch, NUM_COMPONENTS, ossimPointRecord::NumberOfReturns, ossimPointRecord::Red, RETURNS, RGB, and ossimRefPtr< T >::valid().

Referenced by ossimPointCloudUtilityFilter::getTile(), open(), setPointCloudHandler(), and writeRaster().

528 {
529  if (entryIdx >= NUM_COMPONENTS)
530  return false;
531 
532  m_activeComponent = (Components) entryIdx;
533  if (m_pch.valid() && m_pch->getMinPoint() && m_pch->getMaxPoint())
534  {
536  {
539  }
540  else if (m_activeComponent == RGB)
541  {
544  }
545  else if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST))
546  {
549  }
550  else if (m_activeComponent == RETURNS)
551  {
552  m_minPixel = 0;
554  }
555  }
556 
557  return true;
558 }
ossimRefPtr< ossimPointCloudHandler > m_pch
bool valid() const
Definition: ossimRefPtr.h:75
ossim_float32 getField(FIELD_CODES fc) const
Return the float value of the requested field.
ossim_float64 hgt
Height in meters above the ellipsiod.
Definition: ossimGpt.h:274
virtual const ossimPointRecord * getMaxPoint() const
virtual const ossimPointRecord * getMinPoint() const
Assigns the two points with fields representing the extremes of the dataset.
const ossimGpt & getPosition() const
Returns the 3D position vector in the dataset&#39;s coodinate reference system (available from the ossimP...

◆ setGSD()

void ossimPointCloudImageHandler::setGSD ( const ossim_float64 gsd)

Sets m_gsd data member and projection if projection is set.

Definition at line 624 of file ossimPointCloudImageHandler.cpp.

References ossimPointCloudHandler::getBounds(), ossimImageGeometry::getProjection(), ossim::isnan(), ossimGrect::lr(), m_gsd, m_gsdFactor, m_pch, ossimImageGeometry::setImageSize(), ossimMapProjection::setMetersPerPixel(), ossimImageHandler::theGeometry, ossimGrect::ul(), ossimRefPtr< T >::valid(), ossimImageGeometry::worldToLocal(), ossimIpt::x, ossimDpt::x, ossimIpt::y, and ossimDpt::y.

Referenced by getImageGeometry(), and setProperty().

625 {
626  if (ossim::isnan(gsd) || (gsd<=0.0) || !theGeometry.valid())
627  return;
628 
629  m_gsd = ossimDpt(gsd, gsd);
630  m_gsdFactor = 1.0; // resets after GSD adjusted
631 
633  if (!proj)
634  return;
635 
636  proj->setMetersPerPixel(m_gsd);
637 
638  ossimGrect bounds;
639  m_pch->getBounds(bounds);
640 
641  ossimDpt ipt_ul, ipt_lr;
642  theGeometry->worldToLocal(bounds.ul(), ipt_ul);
643  theGeometry->worldToLocal(bounds.lr(), ipt_lr);
644  ossimIpt image_size;
645  image_size.x = ossim::round<ossim_int32,double>(ipt_lr.x - ipt_ul.x) + 1;
646  image_size.y = ossim::round<ossim_int32,double>(ipt_lr.y - ipt_ul.y) + 1;
647 
648  theGeometry->setImageSize(image_size);
649 }
ossimRefPtr< ossimImageGeometry > theGeometry
ossimRefPtr< ossimPointCloudHandler > m_pch
bool valid() const
Definition: ossimRefPtr.h:75
double y
Definition: ossimDpt.h:165
virtual void getBounds(ossimGrect &bounds) const
void setImageSize(const ossimIpt &size)
virtual void setMetersPerPixel(const ossimDpt &gsd)
const ossimGpt & ul() const
Definition: ossimGrect.h:252
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
ossim_int32 y
Definition: ossimIpt.h:142
double x
Definition: ossimDpt.h:164
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
ossim_int32 x
Definition: ossimIpt.h:141
const ossimGpt & lr() const
Definition: ossimGrect.h:269
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ setPointCloudHandler()

bool ossimPointCloudImageHandler::setPointCloudHandler ( ossimPointCloudHandler pch)

Permits backdoor for setting the input point cloud handler object.

Useful for debug

Definition at line 127 of file ossimPointCloudImageHandler.cpp.

References close(), ossimImageHandler::completeOpen(), getImageGeometry(), m_activeComponent, m_pch, setCurrentEntry(), and ossimRefPtr< T >::valid().

Referenced by ossimDemTool::doOMG(), ossimPointCloudTool::loadPC(), and writeRaster().

128 {
129  close();
130 
131  // Need to utilize the Point Cloud handler registry to open the PC file:
132  m_pch = pch;
133  if (!m_pch.valid())
134  return false;
135 
138 
139  // Needed here after open to make sure that min/max pixels are set for active component/entry
141 
142  return true;
143 }
ossimRefPtr< ossimPointCloudHandler > m_pch
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageGeometry > getImageGeometry() override
Returns the image geometry object associated with this tile source or NULL if non defined...
unsigned int ossim_uint32
bool setCurrentEntry(ossim_uint32 entryIdx) override
virtual void completeOpen()
Will complete the opening process.
virtual void close()
Close method.

◆ setProperty()

void ossimPointCloudImageHandler::setProperty ( ossimRefPtr< ossimProperty property)
overridevirtual

The reader properties are: – the GSD ("meters_per_pixel") which overrides computed nominal GSD – the GSD factor ("gsd_factor") scales the computed nominal GSD, defaults to 1.0.

– the active component as entry number ("entry") with possible values [0 - 4] corresponding to "component" property (listed below) – the active component ("component") as string with possible values "intensity", "highest", "lowest", "returns", or "rgb", respectively (case insensitive)

Reimplemented from ossimImageHandler.

Definition at line 735 of file ossimPointCloudImageHandler.cpp.

References ossimString::empty(), ossimProperty::getName(), ossim::isnan(), ossimKeywordNames::METERS_PER_PIXEL_KW, setGSD(), ossimString::toFloat64(), and ossimRefPtr< T >::valid().

Referenced by writeRaster().

736 {
737  if (!property.valid())
738  return;
739 
740  ossimString s;
741  property->valueToString(s);
742  if (s.empty())
743  return;
744 
745  // The user should select either explicit GSD or relative GSD factor, never both:
746  if ( property->getName() == ossimKeywordNames::METERS_PER_PIXEL_KW )
747  {
748  ossim_float64 gsd = s.toFloat64();
749  if (!ossim::isnan(gsd))
750  setGSD(gsd);
751  }
752  else if ( property->getName() == GSD_FACTOR_KW )
753  {
754  m_gsdFactor = s.toDouble();
756  {
757  if (!m_gsd.hasNans())
759  }
760  else
761  m_gsdFactor = 1.0;
762  }
763  else if ( property->getName() == ossimKeywordNames::ENTRY_KW )
764  {
766  }
767  else if ( property->getName() == COMPONENT_KW )
768  {
769  for (int i=0; i<NUM_COMPONENTS; i++)
770  {
771  if (s.upcase() == m_componentNames[i])
772  {
774  break;
775  }
776  }
777  }
778  else
779  {
781  }
782 }
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 toUInt32() const
virtual void setProperty(ossimRefPtr< ossimProperty > property)
std::vector< ossimString > m_componentNames
double ossim_float64
void setGSD(const ossim_float64 &gsd)
Sets m_gsd data member and projection if projection is set.
double toDouble() const
ossim_float64 toFloat64() const
bool hasNans() const
Definition: ossimDpt.h:67
static const char * ENTRY_KW
static const char * METERS_PER_PIXEL_KW
double x
Definition: ossimDpt.h:164
bool empty() const
Definition: ossimString.h:411
const ossimString & getName() const
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

Member Data Documentation

◆ m_activeComponent

Components ossimPointCloudImageHandler::m_activeComponent
protected

◆ m_componentNames

std::vector<ossimString> ossimPointCloudImageHandler::m_componentNames
protected

◆ m_gsd

ossimDpt ossimPointCloudImageHandler::m_gsd
protected

◆ m_gsdFactor

ossim_float64 ossimPointCloudImageHandler::m_gsdFactor
protected

Definition at line 248 of file ossimPointCloudImageHandler.h.

Referenced by getImageGeometry(), and setGSD().

◆ m_maxPixel

ossim_float32 ossimPointCloudImageHandler::m_maxPixel
protected

Definition at line 245 of file ossimPointCloudImageHandler.h.

Referenced by getMaxPixelValue(), and setCurrentEntry().

◆ m_minPixel

ossim_float32 ossimPointCloudImageHandler::m_minPixel
protected

Definition at line 246 of file ossimPointCloudImageHandler.h.

Referenced by getMinPixelValue(), and setCurrentEntry().

◆ m_mutex

std::mutex ossimPointCloudImageHandler::m_mutex
protected

Definition at line 250 of file ossimPointCloudImageHandler.h.

◆ m_pch

ossimRefPtr<ossimPointCloudHandler> ossimPointCloudImageHandler::m_pch
protected

◆ m_tile

ossimRefPtr<ossimImageData> ossimPointCloudImageHandler::m_tile
protected

Definition at line 249 of file ossimPointCloudImageHandler.h.

Referenced by close(), getTile(), and initTile().


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