E57 Simple API V1.0.312  Aug. 10, 2012
Public Member Functions | List of all members
e57::Reader Class Reference

This is the E57 Reader class. More...

#include <E57Simple.h>

Public Member Functions

 Reader (const ustring &filePath)
 This function is the constructor for the reader class.
 
bool IsOpen (void) const
 This function returns true if the file is open.
 
bool Close (void) const
 This function closes the file.
 
bool GetE57Root (E57Root &fileHeader) const
 This function returns the file header information.
 
int32_t GetImage2DCount (void) const
 This function returns the total number of Picture Blocks.
 
bool ReadImage2D (int32_t imageIndex, Image2D &image2DHeader) const
 This function returns the image2D header and positions the cursor.
 
bool GetImage2DSizes (int32_t imageIndex, e57::Image2DProjection &imageProjection, e57::Image2DType &imageType, int64_t &imageWidth, int64_t &imageHeight, int64_t &imageSize, e57::Image2DType &imageMaskType, e57::Image2DType &imageVisualType) const
 This function returns the size of the image data.
 
int64_t ReadImage2DData (int32_t imageIndex, e57::Image2DProjection imageProjection, e57::Image2DType imageType, void *pBuffer, int64_t start, int64_t count) const
 This function reads the block.
 
int32_t GetData3DCount (void) const
 This function returns the total number of Data3D Blocks.
 
bool ReadData3D (int32_t dataIndex, Data3D &data3DHeader) const
 This function returns the Data3D header and positions the cursor.
 
bool GetData3DSizes (int32_t dataIndex, int64_t &rowMax, int64_t &columnMax, int64_t &pointsSize, int64_t &groupsSize, int64_t &countSize, bool &bColumnIndex) const
 This function returns the size of the point data.
 
bool ReadData3DGroupsData (int32_t dataIndex, int32_t groupCount, int64_t *idElementValue, int64_t *startPointIndex, int64_t *pointCount) const
 This funtion writes out the group data.
 
CompressedVectorReader SetUpData3DPointsData (int32_t dataIndex, int64_t pointCount, double *cartesianX, double *cartesianY, double *cartesianZ, int8_t *cartesianInvalidState=NULL, double *intensity=NULL, int8_t *isIntensityInvalid=NULL, uint16_t *colorRed=NULL, uint16_t *colorGreen=NULL, uint16_t *colorBlue=NULL, int8_t *isColorInvalid=NULL, double *sphericalRange=NULL, double *sphericalAzimuth=NULL, double *sphericalElevation=NULL, int8_t *sphericalInvalidState=NULL, int32_t *rowIndex=NULL, int32_t *columnIndex=NULL, int8_t *returnIndex=NULL, int8_t *returnCount=NULL, double *timeStamp=NULL, int8_t *isTimeStampInvalid=NULL) const
 This function sets up the point data fields.
 
StructureNode GetRawE57Root (void)
 This function returns the file raw E57Root Structure Node.
 
VectorNode GetRawData3D (void)
 This function returns the raw Data3D Vector Node.
 
VectorNode GetRawImages2D (void)
 This function returns the raw Image2D Vector Node.
 

Detailed Description

This is the E57 Reader class.

Constructor & Destructor Documentation

Reader::Reader ( const ustring &  filePath)

This function is the constructor for the reader class.

Parameters
filePathfile path string

Member Function Documentation

int32_t Reader::GetData3DCount ( void  ) const

This function returns the total number of Data3D Blocks.

Returns
Returns number of Data3D blocks.
bool Reader::GetData3DSizes ( int32_t  dataIndex,
int64_t &  rowMax,
int64_t &  columnMax,
int64_t &  pointsSize,
int64_t &  groupsSize,
int64_t &  countSize,
bool &  bColumnIndex 
) const

This function returns the size of the point data.

Returns
Return true if sucessful, false otherwise
Parameters
dataIndexThis in the index into the images3D vector
rowMaxThis is the maximum row size
columnMaxThis is the maximum column size
pointsSizeThis is the total number of point records
groupsSizeThis is the total number of group reocrds
countSizeThis is the maximum point count per group
bColumnIndexThis indicates that the idElementName is "columnIndex"
bool Reader::GetE57Root ( E57Root fileHeader) const

This function returns the file header information.

Returns
Returns true if sucessful
Parameters
fileHeaderThis is the main header information
int32_t Reader::GetImage2DCount ( void  ) const

This function returns the total number of Picture Blocks.

Returns
Returns the number of Image2D blocks
bool Reader::GetImage2DSizes ( int32_t  imageIndex,
e57::Image2DProjection &  imageProjection,
e57::Image2DType &  imageType,
int64_t &  imageWidth,
int64_t &  imageHeight,
int64_t &  imageSize,
e57::Image2DType &  imageMaskType,
e57::Image2DType &  imageVisualType 
) const

This function returns the size of the image data.

The e57::Image2DType identifies the format representation for the image data

enum Image2DType {
        E57_NO_IMAGE = 0,       //!< No image data
        E57_JPEG_IMAGE = 1,     //!< JPEG format image data.
        E57_PNG_IMAGE = 2,      //!< PNG format image data.
        E57_PNG_IMAGE_MASK = 3  //!< PNG format image mask.
};

The e57::Image2DProjection identifies the representation for the image data

enum Image2DProjection {
        E57_NO_PROJECTION = 0,  //!< No representation for the image data is present
    E57_VISUAL = 1,             //!< VisualReferenceRepresentation for the image data
    E57_PINHOLE = 2,    //!< PinholeRepresentation for the image data
        E57_SPHERICAL = 3,      //!< SphericalRepresentation for the image data
        E57_CYLINDRICAL = 4     //!< CylindricalRepresentation for the image data
};

Returns
Returns true if sucessful
Parameters
imageIndexThis in the index into the image2D vector
imageProjectionidentifies the projection in the image2D.
imageTypeidentifies the image format of the projection.
imageWidthThe image width (in pixels).
imageHeightThe image height (in pixels).
imageSizeThis is the total number of bytes for the image blob.
imageMaskTypeThis is E57_PNG_IMAGE_MASK if "imageMask" is defined in the projection
imageVisualTypeThis is image type of the VisualReferenceRepresentation if given.
VectorNode Reader::GetRawData3D ( void  )

This function returns the raw Data3D Vector Node.

Returns
Returns the raw Data3D VectorNode
StructureNode Reader::GetRawE57Root ( void  )

This function returns the file raw E57Root Structure Node.

Returns
Returns the E57Root StructureNode
VectorNode Reader::GetRawImages2D ( void  )

This function returns the raw Image2D Vector Node.

Returns
Returns the raw Image2D VectorNode
bool Reader::ReadData3D ( int32_t  dataIndex,
Data3D data3DHeader 
) const

This function returns the Data3D header and positions the cursor.

Returns
Returns true if sucessful
Parameters
dataIndexThis in the index into the images3D vector
data3DHeaderpointer to the Data3D structure to receive the image information
bool Reader::ReadData3DGroupsData ( int32_t  dataIndex,
int32_t  groupCount,
int64_t *  idElementValue,
int64_t *  startPointIndex,
int64_t *  pointCount 
) const

This funtion writes out the group data.

Returns
Return true if sucessful, false otherwise
Parameters
dataIndexdata block index given by the NewData3D
groupCountsize of each of the buffers given
idElementValueindex for this group
startPointIndexStarting index in to the "points" data vector for the groups
pointCountsize of the groups given
bool Reader::ReadImage2D ( int32_t  imageIndex,
Image2D image2DHeader 
) const

This function returns the image2D header and positions the cursor.

Returns
Returns true if sucessful
Parameters
imageIndexThis in the index into the image2D vector
image2DHeaderpointer to the Image2D structure to receive the picture information
int64_t Reader::ReadImage2DData ( int32_t  imageIndex,
e57::Image2DProjection  imageProjection,
e57::Image2DType  imageType,
void *  pBuffer,
int64_t  start,
int64_t  count 
) const

This function reads the block.

Returns
Returns the number of bytes transferred.
Parameters
imageIndexpicture block index
imageProjectionidentifies the projection desired.
imageTypeidentifies the image format desired.
pBufferpointer the raw image buffer
startposition in the block to start reading
countsize of desired chuck or buffer size
CompressedVectorReader Reader::SetUpData3DPointsData ( int32_t  dataIndex,
int64_t  pointCount,
double *  cartesianX,
double *  cartesianY,
double *  cartesianZ,
int8_t *  cartesianInvalidState = NULL,
double *  intensity = NULL,
int8_t *  isIntensityInvalid = NULL,
uint16_t *  colorRed = NULL,
uint16_t *  colorGreen = NULL,
uint16_t *  colorBlue = NULL,
int8_t *  isColorInvalid = NULL,
double *  sphericalRange = NULL,
double *  sphericalAzimuth = NULL,
double *  sphericalElevation = NULL,
int8_t *  sphericalInvalidState = NULL,
int32_t *  rowIndex = NULL,
int32_t *  columnIndex = NULL,
int8_t *  returnIndex = NULL,
int8_t *  returnCount = NULL,
double *  timeStamp = NULL,
int8_t *  isTimeStampInvalid = NULL 
) const

This function sets up the point data fields.

All the non-NULL buffers in the call below have number of elements = pointCount. Call the CompressedVectorReader::read() until all data is read.

Returns
Return true if sucessful, false otherwise
Parameters
dataIndexdata block index given by the NewData3D
pointCountsize of each element buffer.
cartesianXpointer to a buffer with the X coordinate (in meters) of the point in Cartesian coordinates
cartesianYpointer to a buffer with the Y coordinate (in meters) of the point in Cartesian coordinates
cartesianZpointer to a buffer with the Z coordinate (in meters) of the point in Cartesian coordinates
cartesianInvalidStateValue = 0 if the point is considered valid, 1 otherwise
intensitypointer to a buffer with the Point response intensity. Unit is unspecified
isIntensityInvalidValue = 0 if the intensity is considered valid, 1 otherwise
colorRedpointer to a buffer with the Red color coefficient. Unit is unspecified
colorGreenpointer to a buffer with the Green color coefficient. Unit is unspecified
colorBluepointer to a buffer with the Blue color coefficient. Unit is unspecified
isColorInvalidValue = 0 if the color is considered valid, 1 otherwise
sphericalRangepointer to a buffer with the range (in meters) of points in spherical coordinates. Shall be non-negative
sphericalAzimuthpointer to a buffer with the Azimuth angle (in radians) of point in spherical coordinates
sphericalElevationpointer to a buffer with the Elevation angle (in radians) of point in spherical coordinates
sphericalInvalidStateValue = 0 if the range is considered valid, 1 otherwise
rowIndexpointer to a buffer with the row number of point (zero based). This is useful for data that is stored in a regular grid. Shall be in the interval (0, 2^31).
columnIndexpointer to a buffer with the column number of point (zero based). This is useful for data that is stored in a regular grid. Shall be in the interval (0, 2^31).
returnIndexpointer to a buffer with the number of this return (zero based). That is, 0 is the first return, 1 is the second, and so on. Shall be in the interval (0, returnCount). Only for multi-return sensors.
returnCountpointer to a buffer with the total number of returns for the pulse that this corresponds to. Shall be in the interval (0, 2^7). Only for multi-return sensors.
timeStamppointer to a buffer with the time (in seconds) since the start time for the data, which is given by acquisitionStart in the parent Data3D Structure. Shall be non-negative
isTimeStampInvalidValue = 0 if the timeStamp is considered valid, 1 otherwise

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