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

#include <ossimMG4LidarReader.h>

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

Public Member Functions

 ossimMG4LidarReader ()
 default construtor More...
 
virtual ~ossimMG4LidarReader ()
 virtural destructor More...
 
virtual ossimString getShortName () const
 Returns short name. More...
 
virtual ossimString getLongName () const
 Returns long name. More...
 
virtual ossimString getClassName () const
 Returns class name. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 Method to grab a tile(rectangle) from image. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 Returns the number of bands in the image. More...
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual ossim_uint32 getImageTileWidth () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual ossim_uint32 getImageTileHeight () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual ossimScalarType getOutputScalarType () const
 Returns the output pixel type of the tile source. More...
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 Returns the number of decimation levels. More...
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 resLevel=0) const
 Gets number of lines for res level. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 resLevel=0) const
 Gets the number of samples for res level. More...
 
virtual bool open ()
 Open method. More...
 
virtual bool isOpen () const
 Method to test for open file stream. More...
 
virtual void closeEntry ()
 Method to close current entry. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
virtual ossimRefPtr< ossimImageGeometrygetInternalImageGeometry () const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. 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 void close ()
 Deletes the overview and clears the valid image vertices. More...
 
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 saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. 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 double getMinPixelValue (ossim_uint32 band=0) const
 Retuns the min pixel value. More...
 
virtual double getMaxPixelValue (ossim_uint32 band=0) const
 Returns the max pixel of the band. More...
 
virtual double getNullPixelValue (ossim_uint32 band=0) const
 Each band has a null pixel associated with it. 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 getCurrentEntry () const
 
virtual ossim_uint32 getNumberOfEntries () const
 
virtual void getEntryName (ossim_uint32 entryIdx, std::string &name) const
 Get the name of entry as a string. More...
 
virtual void getEntryList (std::vector< ossim_uint32 > &entryList) const
 
virtual void getEntryNames (std::vector< ossimString > &entryNames) const
 
bool useEntryIndex () const
 Convenience method to determine if entry index should be used for support files, e.g. More...
 
ossimFilename getOverviewFile () const
 
virtual bool setCurrentEntry (ossim_uint32 entryIdx)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) 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 bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. 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 void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. More...
 
virtual 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 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
 

Private Member Functions

ossimProjectiongetGeoProjection ()
 
void getDataType (ossim_int32 channelId)
 
void openZoomLevel (ossim_int32 zoom)
 
template<typename DTYPE >
const DTYPE getChannelElement (const ChannelData *channel, size_t idx)
 

Private Attributes

MG4PointReader * m_reader
 
Bounds m_bounds
 
ossimIrect m_imageRect
 
ossim_uint32 m_numberOfSamples
 Has sub image offset. More...
 
ossim_uint32 m_numberOfLines
 
ossimScalarType m_scalarType
 
ossimRefPtr< ossimImageDatam_tile
 

Additional Inherited Members

- 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
 
- 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 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 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

Definition at line 38 of file ossimMG4LidarReader.h.

Constructor & Destructor Documentation

◆ ossimMG4LidarReader()

ossimMG4LidarReader::ossimMG4LidarReader ( )

default construtor

◆ ~ossimMG4LidarReader()

ossimMG4LidarReader::~ossimMG4LidarReader ( )
virtual

virtural destructor

Definition at line 71 of file ossimMG4LidarReader.cpp.

References closeEntry().

72 {
73  closeEntry();
74 }
virtual void closeEntry()
Method to close current entry.

Member Function Documentation

◆ closeEntry()

void ossimMG4LidarReader::closeEntry ( )
virtual

Method to close current entry.

Note
There is a bool kdu_compressed_source::close() and a void ossimImageHandler::close(); hence, a new close to avoid conflicting return types.

Definition at line 217 of file ossimMG4LidarReader.cpp.

References ossimImageHandler::close(), m_reader, and m_tile.

Referenced by ~ossimMG4LidarReader().

218 {
219  m_tile = 0;
220 
221  if (m_reader)
222  {
223  RELEASE(m_reader);
224  m_reader = 0;
225  }
227 }
virtual void close()
Deletes the overview and clears the valid image vertices.
ossimRefPtr< ossimImageData > m_tile
MG4PointReader * m_reader

◆ getChannelElement()

template<typename DTYPE >
const DTYPE ossimMG4LidarReader::getChannelElement ( const ChannelData *  channel,
size_t  idx 
)
private

Definition at line 561 of file ossimMG4LidarReader.cpp.

562 {
563  DTYPE retval = static_cast<DTYPE>(0);
564  switch (channel->getDataType())
565  {
566  case (DATATYPE_FLOAT64):
567  retval = static_cast<DTYPE>(static_cast<const double*>(channel->getData())[idx]);
568  break;
569  case (DATATYPE_FLOAT32):
570  retval = static_cast<DTYPE>(static_cast<const float *>(channel->getData())[idx]);
571  break;
572  case (DATATYPE_SINT32):
573  retval = static_cast<DTYPE>(static_cast<const long *>(channel->getData())[idx]);
574  break;
575  case (DATATYPE_UINT32):
576  retval = static_cast<DTYPE>(static_cast<const unsigned long *>(channel->getData())[idx]);
577  break;
578  case (DATATYPE_SINT16):
579  retval = static_cast<DTYPE>(static_cast<const short *>(channel->getData())[idx]);
580  break;
581  case (DATATYPE_UINT16):
582  retval = static_cast<DTYPE>(static_cast<const unsigned short *>(channel->getData())[idx]);
583  break;
584  case (DATATYPE_SINT8):
585  retval = static_cast<DTYPE>(static_cast<const char *>(channel->getData())[idx]);
586  break;
587  case (DATATYPE_UINT8):
588  retval = static_cast<DTYPE>(static_cast<const unsigned char *>(channel->getData())[idx]);
589  break;
590  case (DATATYPE_SINT64):
591  retval = static_cast<DTYPE>(static_cast<const GIntBig *>(channel->getData())[idx]);
592  break;
593  case (DATATYPE_UINT64):
594  retval = static_cast<DTYPE>(static_cast<const GUIntBig *>(channel->getData())[idx]);
595  break;
596  default:
597  break;
598  }
599  return retval;
600 }

◆ getClassName()

ossimString ossimMG4LidarReader::getClassName ( ) const
virtual

Returns class name.

Returns
"ossimMG4LidarReader"

Reimplemented from ossimObject.

Definition at line 86 of file ossimMG4LidarReader.cpp.

87 {
88  return ossimString("ossimMG4LidarReader");
89 }

◆ getDataType()

void ossimMG4LidarReader::getDataType ( ossim_int32  channelId)
private

Definition at line 411 of file ossimMG4LidarReader.cpp.

References m_reader, m_scalarType, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, and OSSIM_UINT8.

412 {
413  if (m_reader)
414  {
415  DataType pixelType = m_reader->getChannel(channelId).getDataType();
416  switch (pixelType)
417  {
418  case DATATYPE_UINT8:
419  {
421  break;
422  }
423  case DATATYPE_SINT8:
424  {
426  break;
427  }
428  case DATATYPE_UINT16:
429  {
431  break;
432  }
433  case DATATYPE_SINT16:
434  {
436  break;
437  }
438  case DATATYPE_UINT32:
439  {
441  break;
442  }
443  case DATATYPE_SINT32:
444  {
446  break;
447  }
448  case DATATYPE_FLOAT32:
449  {
451  break;
452  }
453  case DATATYPE_FLOAT64:
454  {
456  break;
457  }
458  default:
459  {
461  break;
462  }
463  }
464  }
465 }
8 bit signed integer
64 bit floating point
16 bit unsigned integer
16 bit signed integer
32 bit floating point
32 bit unsigned integer
ossimScalarType m_scalarType
32 bit signed integer
8 bit unsigned integer
MG4PointReader * m_reader

◆ getGeoProjection()

ossimProjection * ossimMG4LidarReader::getGeoProjection ( )
private

Definition at line 467 of file ossimMG4LidarReader.cpp.

References ossimProjectionFactoryRegistry::createProjection(), ossimString::downcase(), ossimProjectionFactoryRegistry::instance(), ossimMapProjection::isGeographic(), m_numberOfLines, m_numberOfSamples, m_reader, MTRS_PER_FT, OSSIM_DEGREES, OSSIM_FEET, OSSIM_METERS, OSSIM_US_SURVEY_FEET, ossimMapProjection::setDecimalDegreesPerPixel(), ossimMapProjection::setMetersPerPixel(), ossimMapProjection::setUlTiePoints(), and US_METERS_PER_FT.

468 {
469  ossimProjection* proj = NULL;
470  if (m_reader)
471  {
472  const char* wkt = m_reader->getWKT();
473  if (wkt)
474  {
475  OGRSpatialReferenceH hSRS = NULL;
476 
477  //Translate the WKT into an OGRSpatialReference.
478  hSRS = OSRNewSpatialReference(NULL);
479  if(OSRImportFromWkt( hSRS, (char**)&wkt) != OGRERR_NONE)
480  {
481  OSRDestroySpatialReference( hSRS );
482  return NULL;
483  }
484 
485  //Determine if State Plane Coordinate System
486  const char* epsg_code = OSRGetAttrValue(hSRS, "AUTHORITY", 1);
488 
489  //get unit type
490  ossimUnitType unitType = OSSIM_METERS;
491  const char* units = OSRGetAttrValue(hSRS, "UNIT", 0);
492  bool bGeog = OSRIsGeographic(hSRS);
493  if (bGeog == false)
494  {
495  if ( units != NULL )
496  {
497  // Down case to avoid case mismatch.
498  ossimString s = units;
499  s.downcase();
500 
501  if( ( s == ossimString("us survey foot") ) ||
502  ( s == ossimString("u.s. foot") ) ||
503  ( s == ossimString("foot_us") ) )
504  {
505  unitType = OSSIM_US_SURVEY_FEET;
506  }
507  else if( s == ossimString("degree") )
508  {
509  unitType = OSSIM_DEGREES;
510  }
511  else if( s == ossimString("feet") )
512  {
513  unitType = OSSIM_FEET;
514  }
515  }
516  }
517  else
518  {
519  unitType = OSSIM_DEGREES;
520  }
521 
522  //set ul tie point and gsd
523  ossimMapProjection* mapProj = dynamic_cast<ossimMapProjection*>(proj);
524  if (mapProj)
525  {
526  double xMin = m_reader->getBounds().x.min;
527  double yMax = m_reader->getBounds().y.max;
528  double xRes = m_reader->getBounds().x.length()/m_numberOfSamples;
529  double yRes = m_reader->getBounds().y.length()/m_numberOfLines;
530  ossimDpt gsd(xRes, yRes);
531  if (mapProj->isGeographic())
532  {
533  ossimGpt tie(yMax, xMin);
534  mapProj->setUlTiePoints(tie);
535  mapProj->setDecimalDegreesPerPixel(gsd);
536  }
537  else
538  {
539  ossimDpt tie(xMin, yMax);
540  if ( unitType == OSSIM_US_SURVEY_FEET)
541  {
542  gsd = gsd * US_METERS_PER_FT;
543  tie = tie * US_METERS_PER_FT;
544  }
545  else if ( unitType == OSSIM_FEET )
546  {
547  gsd = gsd * MTRS_PER_FT;
548  tie = tie * MTRS_PER_FT;
549  }
550  mapProj->setUlTiePoints(tie);
551  mapProj->setMetersPerPixel(gsd);
552  }
553  }
554  return proj;
555  }
556  }
557  return proj;
558 }
ossimUnitType
virtual bool isGeographic() const
virtual void setDecimalDegreesPerPixel(const ossimDpt &gsd)
virtual void setMetersPerPixel(const ossimDpt &gsd)
#define US_METERS_PER_FT
ossim_uint32 m_numberOfSamples
Has sub image offset.
ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
static ossimProjectionFactoryRegistry * instance()
#define MTRS_PER_FT
virtual void setUlTiePoints(const ossimGpt &gpt)
MG4PointReader * m_reader

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimMG4LidarReader::getImageGeometry ( )
virtual

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 346 of file ossimMG4LidarReader.cpp.

References ossimImageGeometryRegistry::extendGeometry(), ossimRefPtr< T >::get(), ossimImageHandler::getExternalImageGeometry(), getInternalImageGeometry(), ossimImageGeometry::getProjection(), ossimImageHandler::initImageParameters(), ossimImageGeometryRegistry::instance(), and ossimImageHandler::theGeometry.

347 {
348  if ( !theGeometry )
349  {
350  //---
351  // Check for external geom:
352  //---
354 
355  if ( !theGeometry )
356  {
357  //---
358  // Check the internal geometry first to avoid a factory call.
359  //---
361 
362  // At this point it is assured theGeometry is set.
363 
364  // Check for set projection.
365  if ( !theGeometry->getProjection() )
366  {
367  // Try factories for projection.
369  }
370  }
371 
372  // Set image things the geometry object should know about.
374  }
375 
376  return theGeometry;
377 }
static ossimImageGeometryRegistry * instance()
ossimRefPtr< ossimImageGeometry > theGeometry
virtual bool extendGeometry(ossimImageHandler *handler) const
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry() const
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).

◆ getImageTileHeight()

ossim_uint32 ossimMG4LidarReader::getImageTileHeight ( ) const
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::getTileHeight which returns the output tile height which can be different than the internal image tile height on disk.

Implements ossimImageHandler.

Definition at line 336 of file ossimMG4LidarReader.cpp.

337 {
338  return 0;
339 }

◆ getImageTileWidth()

ossim_uint32 ossimMG4LidarReader::getImageTileWidth ( ) const
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 331 of file ossimMG4LidarReader.cpp.

332 {
333  return 0;
334 }

◆ getInternalImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimMG4LidarReader::getInternalImageGeometry ( ) const
virtual
Parameters
Methodto get geometry.

Reimplemented from ossimImageHandler.

Definition at line 379 of file ossimMG4LidarReader.cpp.

Referenced by getImageGeometry().

380 {
381  static const char MODULE[] = "ossimMG4LidarReader::getInternalImageGeometry";
382  if (traceDebug())
383  {
384  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
385  }
386 
388 
389  // Must cast away constness.
390  ossimMG4LidarReader* th = const_cast<ossimMG4LidarReader*>(this);
392 
393  geom->setProjection(proj.get());
394 
395  return geom;
396 }
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
ossimProjection * getGeoProjection()
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getLongName()

ossimString ossimMG4LidarReader::getLongName ( ) const
virtual

Returns long name.

Returns
"ossim mrsid reader"

Reimplemented from ossimObject.

Definition at line 81 of file ossimMG4LidarReader.cpp.

82 {
83  return ossimString("ossim mg4 lidar reader");
84 }

◆ getNumberOfDecimationLevels()

ossim_uint32 ossimMG4LidarReader::getNumberOfDecimationLevels ( ) const
virtual

Returns the number of decimation levels.

This returns the total number of decimation levels. It is important to note that res level 0 or full resolution is included in the list and has decimation values 1.0, 1.0

Returns
The number of decimation levels.

Reimplemented from ossimImageHandler.

Definition at line 91 of file ossimMG4LidarReader.cpp.

References ossimImageHandler::getNumberOfDecimationLevels(), ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

92 {
93  ossim_uint32 result = 1; // Add r0
94 
95  if (theOverview.valid())
96  {
97  //---
98  // Add external overviews.
99  //---
101  }
102 
103  return result;
104 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview

◆ getNumberOfInputBands()

ossim_uint32 ossimMG4LidarReader::getNumberOfInputBands ( ) const
virtual

Returns the number of bands in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageSource.

Definition at line 321 of file ossimMG4LidarReader.cpp.

322 {
323  return 1;
324 }

◆ getNumberOfLines()

ossim_uint32 ossimMG4LidarReader::getNumberOfLines ( ossim_uint32  resLevel = 0) const
virtual

Gets number of lines for res level.

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 106 of file ossimMG4LidarReader.cpp.

References ossimImageHandler::getNumberOfSamples(), m_numberOfLines, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

108 {
109  if (theOverview.valid())
110  {
111  return theOverview->getNumberOfSamples(resLevel);
112  }
113  return m_numberOfLines;
114 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.

◆ getNumberOfOutputBands()

ossim_uint32 ossimMG4LidarReader::getNumberOfOutputBands ( ) const
virtual

Returns the number of bands in a tile returned from this TileSource.

Note: we are supporting sources that can have multiple data objects. If you want to know the scalar type of an object you can pass in the

Reimplemented from ossimImageSource.

Definition at line 326 of file ossimMG4LidarReader.cpp.

327 {
328  return 1;
329 }

◆ getNumberOfSamples()

ossim_uint32 ossimMG4LidarReader::getNumberOfSamples ( ossim_uint32  resLevel = 0) const
virtual

Gets the number of samples for res level.

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 116 of file ossimMG4LidarReader.cpp.

References ossimImageHandler::getNumberOfSamples(), m_numberOfSamples, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

118 {
119  if (theOverview.valid())
120  {
121  return theOverview->getNumberOfSamples(resLevel);
122  }
123  return m_numberOfSamples;
124 }
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 m_numberOfSamples
Has sub image offset.
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.

◆ getOutputScalarType()

ossimScalarType ossimMG4LidarReader::getOutputScalarType ( ) const
virtual

Returns the output pixel type of the tile source.

Reimplemented from ossimImageSource.

Definition at line 341 of file ossimMG4LidarReader.cpp.

References m_scalarType.

Referenced by getTile().

342 {
343  return m_scalarType;
344 }
ossimScalarType m_scalarType

◆ getShortName()

ossimString ossimMG4LidarReader::getShortName ( ) const
virtual

Returns short name.

Returns
"ossim_mrsid_reader"

Reimplemented from ossimObject.

Definition at line 76 of file ossimMG4LidarReader.cpp.

77 {
78  return ossimString("ossim_mg4_lidar_reader");
79 }

◆ getTile()

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

Method to grab a tile(rectangle) from image.

Parameters
rectThe zero based rectangle to grab.
resLevelThe reduced resolution level to grab from.
Returns
The ref pointer with the image data pointer.

Reimplemented from ossimImageSource.

Definition at line 229 of file ossimMG4LidarReader.cpp.

References ossimIrect::clipToRect(), ossimIrect::completely_within(), ossimImageHandler::getBoundingRect(), getOutputScalarType(), ossimImageSource::getTile(), ossimIrect::height(), ossimIrect::intersects(), isOpen(), ossimSource::isSourceEnabled(), ossimImageHandler::isValidRLevel(), ossimImageData::loadBand(), m_bounds, m_reader, m_tile, ossimImageData::makeBlank(), ossimImageData::setImageRectangle(), ossimRectilinearDataObject::setScalarType(), ossimImageHandler::theOverview, ossimIrect::ul(), ossimRefPtr< T >::valid(), ossimImageData::validate(), ossimIrect::width(), ossimIpt::x, ossimDpt::x, ossimIpt::y, and ossimDpt::y.

231 {
232  // This tile source bypassed, or invalid res level, return null tile.
233  if(!isSourceEnabled() || !isOpen() || !isValidRLevel(resLevel))
234  {
236  }
237 
238  ossimIrect imageBound = getBoundingRect(resLevel);
239  if(!rect.intersects(imageBound))
240  {
242  }
243 
244  // Check for overview.
245  if( resLevel > 0 )
246  {
247  if(theOverview.valid())
248  {
249  ossimRefPtr<ossimImageData> tileData = theOverview->getTile(rect, resLevel);
250  tileData->setScalarType(getOutputScalarType());
251  return tileData;
252  }
253  }
254 
255  m_tile->setImageRectangle(rect);
256 
257  // Compute clip rectangle with respect to the image bounds.
258  ossimIrect clipRect = rect.clipToRect(imageBound);
259 
260  if (rect.completely_within(clipRect) == false)
261  {
262  // Not filling whole tile so blank it out first.
263  m_tile->makeBlank();
264  }
265 
266  // access the point cloud with PointSource::read()
267  const ossimDpt UL_PT(m_bounds.x.min + clipRect.ul().x, m_bounds.y.min + clipRect.ul().y);
268  const ossimDpt LR_PT(m_bounds.x.min + clipRect.ul().x + clipRect.width(), m_bounds.y.min + clipRect.ul().y + clipRect.height());
269 
270  Bounds bounds(UL_PT.lon, LR_PT.lon,
271  UL_PT.lat, LR_PT.lat,
272  -HUGE_VAL, +HUGE_VAL);
273 
274  ossim_float32 fraction = 1.0/pow(2.0, (double)resLevel);
275 
276  PointIterator* iter = m_reader->createIterator(bounds, fraction, m_reader->getPointInfo(), NULL);
277 
278  // create a buffer to store the point data
279  PointData points;
280  points.init(m_reader->getPointInfo(), clipRect.width()*clipRect.height());
281 
282  size_t count = 0;
283  ossimDpt lasPt;
284  double* dataValues = new double[clipRect.width()*clipRect.height()];
285  while((count = iter->getNextPoints(points)) != 0)
286  {
287  //loop through each point
288  for(size_t i = 0; i < count; i += 1)
289  {
290  const ChannelData* channelX = points.getChannel(CHANNEL_NAME_X);
291  const ChannelData* channelY = points.getChannel(CHANNEL_NAME_Y);
292  const ChannelData* channelZ = points.getChannel(CHANNEL_NAME_Z);
293 
294  const void *dataX = channelX->getData();
295  const void *dataY = channelY->getData();
296  const void *dataZ = channelZ->getData();
297 
298  lasPt.x = static_cast<const double*>(dataX)[i];
299  lasPt.y = static_cast<const double*>(dataY)[i];
300 
301  ossim_int32 line = static_cast<ossim_int32>(lasPt.y - UL_PT.y);
302  ossim_int32 samp = static_cast<ossim_int32>(lasPt.x - UL_PT.x);
303  ossim_int32 bufIndex = line * clipRect.width() + samp;
304 
305  if (bufIndex < clipRect.width()*clipRect.height())
306  {
307  dataValues[bufIndex] = static_cast<const double*>(dataZ)[i];
308  }
309  }
310  }
311  RELEASE(iter);
312 
313  m_tile->loadBand((void*)dataValues, clipRect, 0);
314  m_tile->validate();
315 
316  delete[] dataValues;
317 
318  return m_tile;
319 }
virtual void loadBand(const void *src, const ossimIrect &src_rect, ossim_uint32 band)
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual void setImageRectangle(const ossimIrect &rect)
bool valid() const
Definition: ossimRefPtr.h:75
float ossim_float32
double y
Definition: ossimDpt.h:165
ossim_uint32 height() const
Definition: ossimIrect.h:487
virtual bool isOpen() const
Method to test for open file stream.
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimScalarType getOutputScalarType() const
Returns the output pixel type of the tile source.
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
virtual ossimDataObjectStatus validate() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
virtual void makeBlank()
Initializes data to null pixel values.
ossimRefPtr< ossimImageHandler > theOverview
ossimRefPtr< ossimImageData > m_tile
ossim_int32 y
Definition: ossimIpt.h:142
double x
Definition: ossimDpt.h:164
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
ossim_int32 x
Definition: ossimIpt.h:141
virtual void setScalarType(ossimScalarType type)
See ossimScalarType in ossimConstants for a full list.
MG4PointReader * m_reader
int ossim_int32
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)

◆ isOpen()

bool ossimMG4LidarReader::isOpen ( ) const
virtual

Method to test for open file stream.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 212 of file ossimMG4LidarReader.cpp.

References ossimRefPtr< T >::get(), and m_tile.

Referenced by getTile().

213 {
214  return m_tile.get();
215 }
ossimRefPtr< ossimImageData > m_tile

◆ loadState()

bool ossimMG4LidarReader::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 ossimImageHandler.

Definition at line 398 of file ossimMG4LidarReader.cpp.

References ossimImageHandler::loadState(), and open().

400 {
401  bool result = false;
402 
403  if ( ossimImageHandler::loadState(kwl, prefix) )
404  {
405  result = open();
406  }
407 
408  return result;
409 }
virtual bool open()
Open method.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.

◆ open()

bool ossimMG4LidarReader::open ( )
virtual

Open method.

Returns
true on success, false on error.

Implements ossimImageHandler.

Definition at line 126 of file ossimMG4LidarReader.cpp.

Referenced by loadState().

127 {
128  static const char MODULE[] = "ossimMG4LidarReader::open";
129 
130  if (traceDebug())
131  {
133  << MODULE << " entered...\n"
134  << "image: " << theImageFile << "\n";
135  }
136 
137  bool result = false;
138 
139  if(isOpen())
140  {
141  closeEntry();
142  }
143 
144  int gen = 0;
145  bool raster = false;
146  result = Version::getMrSIDFileVersion(theImageFile.c_str(), gen, raster);
147  if (result == false)
148  {
149  return result;
150  }
151 
152  m_reader = MG4PointReader::create();
153  m_reader->init(theImageFile.c_str());
154  m_bounds = m_reader->getBounds();
155 
156  int numPoints = m_reader->getNumPoints();
157  m_numberOfSamples = m_bounds.x.length();
158  m_numberOfLines = m_bounds.y.length();
159 
160  double pts_per_area = ((double)m_reader->getNumPoints())/(m_bounds.x.length()*m_bounds.y.length());
161  double average_pt_spacing = sqrt(1.0 / pts_per_area) ;
162  double cell_side = average_pt_spacing;
163  maxRasterSize = std::max(m_bounds.x.length()/cell_side, m_bounds.y.length()/cell_side);
164  //openZoomLevel(0);
165 
166  //get data type from X channel as default
167  getDataType(0);
168 
170  {
172 
173  m_tile->initialize();
174 
175  // Call the base complete open to pick up overviews.
176  completeOpen();
177 
178  result = true;
179  }
180 
181  if (result == false)
182  {
183  closeEntry();
184  }
185 
186  if (traceDebug())
187  {
189  << MODULE << " exit status = " << (result?"true":"false\n")
190  << std::endl;
191  }
192 
193  return result;
194 }
ossimFilename theImageFile
virtual void closeEntry()
Method to close current entry.
virtual bool isOpen() const
Method to test for open file stream.
ossimScalarType m_scalarType
virtual void initialize()
Initialize the data buffer.
ossim_uint32 m_numberOfSamples
Has sub image offset.
static ossimImageDataFactory * instance()
void getDataType(ossim_int32 channelId)
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
virtual void completeOpen()
Will complete the opening process.
ossimRefPtr< ossimImageData > m_tile
#define max(a, b)
Definition: auxiliary.h:76
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
MG4PointReader * m_reader
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ openZoomLevel()

void ossimMG4LidarReader::openZoomLevel ( ossim_int32  zoom)
private

Definition at line 196 of file ossimMG4LidarReader.cpp.

References m_reader.

197 {
198  // geo dimensions
199  const double gWidth = m_reader->getBounds().x.length() ;
200  const double gHeight = m_reader->getBounds().y.length() ;
201 
202  // geo res
203  double xRes = pow(2.0, zoom) * gWidth / maxRasterSize ;
204  double yRes = pow(2.0, zoom) * gHeight / maxRasterSize ;
205  xRes = yRes = std::max(xRes, yRes);
206 
207  // pixel dimensions
208  m_numberOfSamples = static_cast<int>(gWidth / xRes + 0.5);
209  m_numberOfLines = static_cast<int>(gHeight / yRes + 0.5);
210 }
ossim_uint32 m_numberOfSamples
Has sub image offset.
#define max(a, b)
Definition: auxiliary.h:76
MG4PointReader * m_reader

Member Data Documentation

◆ m_bounds

Bounds ossimMG4LidarReader::m_bounds
private

Definition at line 195 of file ossimMG4LidarReader.h.

Referenced by getTile().

◆ m_imageRect

ossimIrect ossimMG4LidarReader::m_imageRect
private

Definition at line 196 of file ossimMG4LidarReader.h.

◆ m_numberOfLines

ossim_uint32 ossimMG4LidarReader::m_numberOfLines
private

Definition at line 199 of file ossimMG4LidarReader.h.

Referenced by getGeoProjection(), and getNumberOfLines().

◆ m_numberOfSamples

ossim_uint32 ossimMG4LidarReader::m_numberOfSamples
private

Has sub image offset.

Definition at line 198 of file ossimMG4LidarReader.h.

Referenced by getGeoProjection(), and getNumberOfSamples().

◆ m_reader

MG4PointReader* ossimMG4LidarReader::m_reader
private

◆ m_scalarType

ossimScalarType ossimMG4LidarReader::m_scalarType
private

Definition at line 200 of file ossimMG4LidarReader.h.

Referenced by getDataType(), and getOutputScalarType().

◆ m_tile

ossimRefPtr<ossimImageData> ossimMG4LidarReader::m_tile
private

Definition at line 201 of file ossimMG4LidarReader.h.

Referenced by closeEntry(), getTile(), and isOpen().


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