chai3d::cMultiImage Class Reference

This class implements an array of 2D image structures. More...

#include <CMultiImage.h>

Inheritance diagram for chai3d::cMultiImage:

Public Member Functions

 cMultiImage ()
 Default constructor of cMultiImage. More...
 
virtual ~cMultiImage ()
 Destructor of cMultiImage. More...
 
cMultiImagePtr copy ()
 This method creates a copy itself. More...
 
bool allocate (const unsigned int a_width, const unsigned int a_height, const unsigned int a_slices, const GLenum a_format=GL_RGB, const GLenum a_type=GL_UNSIGNED_BYTE)
 This method allocates a new multi image array by defining its size, pixel format and pixel type. More...
 
void erase ()
 This method deletes all image data from memory. More...
 
virtual unsigned int getImageCount () const
 This method returns the number of images stored. More...
 
bool convert (const unsigned int a_newFormat)
 This method converts the image to a new format passed as argument. More...
 
virtual unsigned long getCurrentIndex ()
 This method returns the index number of the current image. More...
 
virtual bool selectImage (unsigned long a_index)
 This method sets the current image. More...
 
bool addImage (cImage &a_image, unsigned long a_index=-1)
 This method adds an image to the set if size and format are compatible. More...
 
bool removeImage (unsigned long a_index)
 This method removes an image from the set. More...
 
virtual void setTransparentColor (const cColorb &a_color, const unsigned char a_transparencyLevel)
 This method defines a pixel color for all images to be transparent. More...
 
virtual void setTransparentColor (const unsigned char a_r, const unsigned char a_g, const unsigned char a_b, const unsigned char a_transparencyLevel)
 This method defines a pixel color to be transparent for all images. More...
 
virtual void setTransparency (const unsigned char a_transparencyLevel)
 This method defines a transparent level to all pixels of image set. More...
 
virtual void flipHorizontal ()
 This method flips all images horizontally. More...
 
virtual void getVoxelLocation (const cVector3d &a_texCoord, int &a_voxelX, int &a_voxelY, int &a_voxelZ, bool a_clampToImageSize=true) const
 This method retrieves the nearest voxel location from a texture coordinate. More...
 
virtual void getVoxelLocationInterpolated (const cVector3d &a_texCoord, double &a_voxelX, double &a_voxelY, double &a_voxelZ, bool a_clampToImageSize=true) const
 This method retrieves the voxel location from a texture coordinate. More...
 
virtual unsigned char * getVoxelData (const unsigned int a_x, const unsigned int a_y, const unsigned int a_z) const
 This method returns a pointer to voxel memory data. More...
 
virtual bool getVoxelColor (const unsigned int a_x, const unsigned int a_y, const unsigned int a_z, cColorb &a_color) const
 This method returns the color of an image voxel at location (x,y,z). More...
 
virtual bool getVoxelColor (const unsigned int a_x, const unsigned int a_y, const unsigned int a_z, cColorf &a_color) const
 This method returns the color of an image voxel at location (x,y,z). More...
 
virtual bool getVoxelColorInterpolated (const double a_x, const double a_y, const double a_z, cColorb &a_color) const
 This method returns the interpolated color of an image voxel at location (x,y,z). More...
 
virtual bool getVoxelColorInterpolated (const double a_x, const double a_y, const double a_z, cColorf &a_color) const
 This method returns the interpolated color of an image voxel at location (x,y,z). More...
 
virtual void setVoxelColor (const unsigned int a_x, const unsigned int a_y, const unsigned int a_z, const cColorb &a_color)
 This method sets the color of an image voxel at location (x,y,z). More...
 
virtual void setVoxelColor (const unsigned int a_x, const unsigned int a_y, const unsigned int a_z, const unsigned char a_r, const unsigned char a_g, const unsigned char a_b)
 This method sets the color of an image voxel at location (x,y,z). More...
 
virtual void setVoxelColor (const unsigned int a_x, const unsigned int a_y, const unsigned int a_z, const unsigned char a_grayLevel)
 This method sets the gray level of an image voxel at location (x,y,z). More...
 
unsigned char * getArray ()
 This method returns a pointer to the actual image data array. Use with care! More...
 
virtual bool loadFromFile (const std::string &a_filename)
 This method loads an image file. More...
 
virtual int loadFromFiles (const std::vector< std::string > &a_filename)
 This method loads an image set from a set of files. More...
 
virtual int loadFromFiles (const std::string &a_basename, const std::string &a_extension, unsigned long a_max=9999)
 This method loads an image set from a set of similarly named images. More...
 
virtual bool addFromFile (const std::string &a_filename, unsigned long a_index=-1)
 This method adds an image file to the set if size and format are compatible. More...
 
virtual bool saveToFiles (const std::string &a_basename, const std::string &a_extension)
 This method saves all images to a set of files. More...
 
- Public Member Functions inherited from chai3d::cImage
 cImage ()
 Default constructor of cImage. More...
 
 cImage (const unsigned int a_width, const unsigned int a_height, const GLenum a_format=GL_RGB, const GLenum a_type=GL_UNSIGNED_BYTE)
 Constructor of cImage. Initializes an image by passing its width, height, pixel format and pixel type. More...
 
virtual ~cImage ()
 Destructor of cImage. More...
 
cImagePtr copy ()
 This method creates a copy itself. More...
 
bool allocate (const unsigned int a_width, const unsigned int a_height, const GLenum a_format=GL_RGB, const GLenum a_type=GL_UNSIGNED_BYTE)
 This method allocates a new image by defining its size, pixel format and pixel type. More...
 
void erase ()
 This method deletes all image data from memory. More...
 
bool isInitialized () const
 This method returns true if the image has been allocated in memory, false otherwise. More...
 
void setSize (const unsigned int a_width, const unsigned int a_height)
 This method sets and allocates the size of the image by defining its width and height. More...
 
unsigned int getWidth () const
 This method returns the width of the image. More...
 
unsigned int getHeight () const
 This method returns the height of the image. More...
 
GLenum getFormat () const
 This method returns the pixel format of the image (GL_RGB, GL_RGBA, GL_LUMINANCE for instance). More...
 
GLenum getType () const
 This method returns the pixel data type. (GL_UNSIGNED_BYTE, GL_UNSIGNED_INT for instance). More...
 
unsigned int getBitsPerPixel () const
 This method returns the number of bits per pixel used to store this image. More...
 
unsigned int getBytesPerPixel () const
 This method returns the number of bytes per pixel used to store this image. More...
 
unsigned int getSizeInBytes () const
 This method returns the size in bytes of the current image. More...
 
bool convert (const unsigned int a_newFormat)
 This method converts the image to a new format passed as argument. More...
 
cImagegetImage ()
 This method returns a pointer to this cImage object. More...
 
virtual unsigned char * getData ()
 This method returns a pointer to the actual image data. Use with care! More...
 
virtual void setData (unsigned char *a_data, const unsigned int a_dataSizeInBytes, const bool a_dealloc=false)
 This method modifies the pointer to the actual image data. Use with care! More...
 
bool setProperties (const unsigned int a_width, const unsigned int a_height, const GLenum a_format, const GLenum a_type)
 This method overrides the properties of the image. Use with care! More...
 
virtual void clear ()
 This method clears all image pixels with a black color. More...
 
virtual void clear (const cColorb &a_color)
 This method clears all image pixels with a color passed as argument. More...
 
virtual void clear (const unsigned char a_r, const unsigned char a_g, const unsigned char a_b, const unsigned char a_a=0xff)
 This method clears all image pixels with a color passed as argument. More...
 
virtual void clear (const unsigned char a_grayLevel)
 This method clears all image pixels with a level of gray passed as argument. More...
 
virtual void getPixelLocation (const cVector3d &a_texCoord, int &a_pixelX, int &a_pixelY, bool a_clampToImageSize=true) const
 This method retrieves the nearest pixel location from a texture coordinate. More...
 
virtual void getPixelLocationInterpolated (const cVector3d &a_texCoord, double &a_pixelX, double &a_pixelY, bool a_clampToImageSize=true) const
 This method retrieves a pixel location from a texture coordinate. More...
 
virtual bool getPixelColor (const unsigned int a_x, const unsigned int a_y, cColorb &a_color) const
 This method returns the color of a pixel at location (x,y). More...
 
virtual bool getPixelColor (const unsigned int a_x, const unsigned int a_y, cColorf &a_color) const
 This method returns the color of a pixel at location (x,y). More...
 
virtual bool getPixelColorInterpolated (const double a_x, const double a_y, cColorb &a_color) const
 This method returns the interpolated color of an image pixel at location (x,y). More...
 
virtual bool getPixelColorInterpolated (const double a_x, const double a_y, cColorf &a_color) const
 This method returns the interpolated color of an image pixel at location (x,y). More...
 
virtual void setPixelColor (const unsigned int a_x, const unsigned int a_y, const cColorb &a_color)
 This method sets the color of a pixel at location (x,y). More...
 
virtual void setPixelColor (const unsigned int a_x, const unsigned int a_y, const unsigned char a_r, const unsigned char a_g, const unsigned char a_b)
 This method sets the color of a pixel at location (x,y). More...
 
virtual void setPixelColor (const unsigned int a_x, const unsigned int a_y, const unsigned char a_grayLevel)
 This method sets the gray scale of a pixel at location (x,y). More...
 
void copyTo (const unsigned int a_sourcePosX, const unsigned int a_sourcePosY, const unsigned int a_sourceSizeX, const unsigned int a_sourceSizeY, cImagePtr a_destImage, const unsigned int a_destPosX=0, const unsigned int a_destPosY=0)
 This method copies a section of this current image to a destination image. More...
 
void copyTo (cImagePtr a_destImage, const unsigned int a_destPosX=0, const unsigned int a_destPosY=0)
 This method copies the entire image to a destination image. More...
 
virtual bool saveToFile (const std::string &a_filename)
 This method saves an image file by passing a filename as argument. More...
 
std::string getFilename () const
 This method returns the filename from which this image was last loaded or saved. More...
 

Static Public Member Functions

static cMultiImagePtr create ()
 Shared cMultiImage allocator. More...
 
- Static Public Member Functions inherited from chai3d::cImage
static cImagePtr create ()
 Shared cImage allocator. More...
 
static int queryBytesPerPixel (const GLenum a_format, const GLenum a_type)
 This method queries the number of bytes per pixel for a given format. More...
 

Protected Member Functions

void defaults ()
 This method initializes all member variables. More...
 
void cleanup ()
 This method deletes memory and rid ourselves of any image previously stored. More...
 
virtual bool addFromFilePrealloc (const std::string &a_filename, unsigned long a_index)
 Add an image file to a preallocated set if size and format are compatible. More...
 
bool addImagePrealloc (cImage &a_image, unsigned long a_index)
 Add an image to a preallocated set if size and format are compatible. More...
 
- Protected Member Functions inherited from chai3d::cImage
void defaults ()
 This method initializes all member variables. More...
 
void cleanup ()
 This method deletes memory and rid ourselves of any image previously stored. More...
 

Protected Attributes

unsigned char * m_array
 The image array data that holds all images contiguously. More...
 
unsigned long m_imageCount
 Number of images contained in the structure. More...
 
unsigned long m_currentIndex
 Index of the currently selected image. More...
 
- Protected Attributes inherited from chai3d::cImage
std::string m_filename
 Image filename. More...
 
unsigned int m_width
 Width in pixels of the current image. More...
 
unsigned int m_height
 Height in pixels of the current image. More...
 
GLenum m_format
 Pixel format of the image (GL_RGB, GL_RGBA, GL_LUMINANCE). More...
 
GLenum m_type
 Pixel data type. (GL_UNSIGNED_BYTE, GL_UNSIGNED_INT). More...
 
unsigned int m_bytesPerPixel
 Number of bytes per pixel. More...
 
unsigned char * m_data
 The image data itself. More...
 
unsigned int m_memorySize
 Size of current image in bytes. More...
 
bool m_allocated
 If true, then the image has been allocated in memory, false otherwise. More...
 
bool m_responsibleForMemoryAllocation
 If true, then this object actually performed the memory allocation for this object. More...
 

Additional Inherited Members

- Public Attributes inherited from chai3d::cImage
cColorb m_borderColor
 Returned color when accessing pixels located outside of the image. More...
 

Detailed Description

cMultiImage provides a child class to cImage that handles multiple images with similar properties (size and format). Each image can be used either as a slice of a volume representation, or a frame of a time lapse. The images are treated as a set of pixel arrays, all sharing common properties and geometry. All pixel arrays are guaranteed to be allocated contiguously in a single memory array.

Constructor & Destructor Documentation

chai3d::cMultiImage::cMultiImage ( )

Default constructor of cMultiImage.

chai3d::cMultiImage::~cMultiImage ( )
virtual

Destructor of cMultiImage.

Member Function Documentation

static cMultiImagePtr chai3d::cMultiImage::create ( )
inlinestatic
cMultiImagePtr chai3d::cMultiImage::copy ( )

This method creates a copy of itself.

Returns
Pointer to new object.
bool chai3d::cMultiImage::allocate ( const unsigned int  a_width,
const unsigned int  a_height,
const unsigned int  a_slices,
const GLenum  a_format = GL_RGB,
const GLenum  a_type = GL_UNSIGNED_BYTE 
)

Allocate a new image by defining its width, height and pixel format.

Parameters
a_widthWidth of images.
a_heightHeight of images.
a_slicesNumber of images in the set.
a_formatPixel format. Accepted values are: GL_LUMINANCE, GL_RGB, GL_RGBA
a_typePixel type. Accepted values are: GL_UNSIGNED_BYTE, GL_UNSIGNED_INT
void chai3d::cMultiImage::erase ( )
inline
virtual unsigned int chai3d::cMultiImage::getImageCount ( ) const
inlinevirtual

Reimplemented from chai3d::cImage.

bool chai3d::cMultiImage::convert ( const unsigned int  a_newFormat)

This method converts all images in the set into a new pixel format.

Parameters
a_newFormatNew desired pixel format: GL_LUMINANCE, GL_RGB, GL_RGBA.
Returns
true if operation succeeds, false otherwise.
virtual unsigned long chai3d::cMultiImage::getCurrentIndex ( )
inlinevirtual

Reimplemented from chai3d::cImage.

bool chai3d::cMultiImage::selectImage ( unsigned long  a_index)
virtual

This method select the image from the set that will be displayed by the cImage parent object.

Returns
true if operation succeeds, __false_otherwise.

Reimplemented from chai3d::cImage.

bool chai3d::cMultiImage::addImage ( cImage a_image,
unsigned long  a_index = -1 
)

This method adds an image to the image set. If it is the first image, it will define the properties of the whole set. Otherwise, this method checks that the new image matches the properties of the images already in the set. If the image properties do not match, the image is ignored.

Parameters
a_imageThe image to be added to the image set.
a_indexThe index in the set where the image should be added. By default, the image is added at the end of the set.
Returns
true if insertion is successful, false otherwise.
bool chai3d::cMultiImage::removeImage ( unsigned long  a_index)

This method removes an image from the image set.

Parameters
a_indexIndex of the image to remove from the set.
Returns
true if the removal succeeds, false otherwise.
void chai3d::cMultiImage::setTransparentColor ( const cColorb a_color,
const unsigned char  a_transparencyLevel 
)
virtual

This method defines a voxel color to be transparent for all images in the set. If the images are not in GL_RGBA format, they are first converted in order to enable pixel transparency capabilities.

Parameters
a_colorSelected pixel color.
a_transparencyLevelTransparency level.

Reimplemented from chai3d::cImage.

virtual void chai3d::cMultiImage::setTransparentColor ( const unsigned char  a_r,
const unsigned char  a_g,
const unsigned char  a_b,
const unsigned char  a_transparencyLevel 
)
inlinevirtual

Reimplemented from chai3d::cImage.

void chai3d::cMultiImage::setTransparency ( const unsigned char  a_transparencyLevel)
virtual

This method assigns a transparent value to all pixels of this image set. If the images are not in GL_RGBA format, they are first converted in order to enable pixel transparency capabilities.

Parameters
a_transparencyLevelTransparency level.

Reimplemented from chai3d::cImage.

void chai3d::cMultiImage::flipHorizontal ( )
virtual

This method flips all images horizontally.

Reimplemented from chai3d::cImage.

void chai3d::cMultiImage::getVoxelLocation ( const cVector3d a_texCoord,
int &  a_voxelX,
int &  a_voxelY,
int &  a_voxelZ,
bool  a_clampToImageSize = true 
) const
virtual

This method returns the nearest voxel from a texture coordinate.

Parameters
a_texCoordTexture coordinate.
a_voxelXReturn value for voxel coordinate X.
a_voxelYReturn value for voxel coordinate Y.
a_voxelZReturn value for voxel coordinate Z.
a_clampToImageSizeIf true then pixel value is clamped to image size.

Reimplemented from chai3d::cImage.

void chai3d::cMultiImage::getVoxelLocationInterpolated ( const cVector3d a_texCoord,
double &  a_voxelX,
double &  a_voxelY,
double &  a_voxelZ,
bool  a_clampToImageSize = true 
) const
virtual

This method retrieves the voxel location from a texture coordinate.

Parameters
a_texCoordTexture coordinate.
a_voxelXReturn value for voxel coordinate X.
a_voxelYReturn value for voxel coordinate Y.
a_voxelZReturn value for voxel coordinate Z.
a_clampToImageSizeIf true then pixel value is clamped to image size.

Reimplemented from chai3d::cImage.

unsigned char * chai3d::cMultiImage::getVoxelData ( const unsigned int  a_x,
const unsigned int  a_y,
const unsigned int  a_z 
) const
virtual

This method returns a pointer to voxel memory data.

Parameters
a_xX coordinate of the voxel.
a_yY coordinate of the voxel.
a_zZ coordinate of the voxel.
Returns
Pointer to voxel in memory.
bool chai3d::cMultiImage::getVoxelColor ( const unsigned int  a_x,
const unsigned int  a_y,
const unsigned int  a_z,
cColorb a_color 
) const
virtual

This method returns the color of a voxel by passing its x, y and z coordinates.

Parameters
a_xX coordinate of the voxel.
a_yY coordinate of the voxel.
a_zZ coordinate of the voxel.
a_colorReturn color of the voxel.
Returns
true if the operation succeeds, false otherwise.

Reimplemented from chai3d::cImage.

bool chai3d::cMultiImage::getVoxelColor ( const unsigned int  a_x,
const unsigned int  a_y,
const unsigned int  a_z,
cColorf a_color 
) const
virtual

This method returns the color of a voxel by passing its x, y and z coordinates.

Parameters
a_xX coordinate of the voxel.
a_yY coordinate of the voxel.
a_zZ coordinate of the voxel.
a_colorReturn color of the voxel.
Returns
true if the operation succeeds, false otherwise.
bool chai3d::cMultiImage::getVoxelColorInterpolated ( const double  a_x,
const double  a_y,
const double  a_z,
cColorb a_color 
) const
virtual

This method returns the interpolated color of an image voxel at location (x,y,z).

Parameters
a_xX coordinate of the voxel.
a_yY coordinate of the voxel.
a_zZ coordinate of the voxel.
a_colorReturn color of the voxel.
Returns
true if the operation succeeds, false otherwise.

Reimplemented from chai3d::cImage.

bool chai3d::cMultiImage::getVoxelColorInterpolated ( const double  a_x,
const double  a_y,
const double  a_z,
cColorf a_color 
) const
virtual

This method returns the interpolated color of an image voxel at location (x,y,z).

Parameters
a_xX coordinate of the voxel.
a_yY coordinate of the voxel.
a_zZ coordinate of the voxel.
a_colorReturn color of the voxel.
Returns
true if the operation succeeds, false otherwise.

Reimplemented from chai3d::cImage.

void chai3d::cMultiImage::setVoxelColor ( const unsigned int  a_x,
const unsigned int  a_y,
const unsigned int  a_z,
const cColorb a_color 
)
virtual

This method sets the color of a voxel.

Parameters
a_xX coordinate of the voxel.
a_yY coordinate of the voxel.
a_zZ coordinate of the voxel.
a_colorNew color of the voxel.

Reimplemented from chai3d::cImage.

virtual void chai3d::cMultiImage::setVoxelColor ( const unsigned int  a_x,
const unsigned int  a_y,
const unsigned int  a_z,
const unsigned char  a_r,
const unsigned char  a_g,
const unsigned char  a_b 
)
inlinevirtual

Reimplemented from chai3d::cImage.

void chai3d::cMultiImage::setVoxelColor ( const unsigned int  a_x,
const unsigned int  a_y,
const unsigned int  a_z,
const unsigned char  a_grayLevel 
)
virtual

This method sets the color of a voxel.

Parameters
a_xX coordinate of the voxel.
a_yY coordinate of the voxel.
a_zZ coordinate of the voxel.
a_grayLevelNew luminance value of the voxel.

Reimplemented from chai3d::cImage.

unsigned char* chai3d::cMultiImage::getArray ( )
inline
bool chai3d::cMultiImage::loadFromFile ( const std::string &  a_filename)
virtual

This method loads an image from the specified file. The method returns true if all goes well. Note that regardless of whether it succeeds, this over-writes any image that had previously been loaded by this object.

Parameters
a_filenameImage filename.
Returns
true if file loaded successfully, false otherwise.

Reimplemented from chai3d::cImage.

int chai3d::cMultiImage::loadFromFiles ( const std::vector< std::string > &  a_filename)
virtual

This method loads a set of images from a set of files. The filenames are contained in a vector, and the files are loaded in the order they are stored in the vector.

The first image defines the properties of the whole set. Each subsequent image must match the properties of the first image, otherwise it will be ignored. This routine erases and replaces any previous content.

Parameters
a_filenameThe vector containing the filenames.
Returns
The number of images actually loaded in the set.
int chai3d::cMultiImage::loadFromFiles ( const std::string &  a_basename,
const std::string &  a_extension,
unsigned long  a_max = 9999 
)
virtual

This method loads a set of images from a set of files. The filenames are defined by the basename, a numeric index and the extension. The files are loaded chronologically. The numeric index in the file names match the number of digits of the a_max argument. The first image defines the properties of the whole set. Each subsequent image must match the properties of the first image, otherwise it will be ignored. This routine erases and replaces any previous content.

E.g. loadFromFiles("img", "png", 18) will attempt to load: "img0.png", "img00.png", "img1.png", "img01.png", ..., "img10.png", "img11.png", ...

Parameters
a_basenameThe common path and filename component of the files.
a_extensionThe images file extension.
a_maxThe maximum number of files to search for.
Returns
The number of images loaded into the set.
bool chai3d::cMultiImage::addFromFile ( const std::string &  a_filename,
unsigned long  a_index = -1 
)
virtual

This method adds an image to the image set. If it is the first image, it will define the properties of the whole set. Otherwise, this method checks that the new image matches the properties of the images already in the set. If the image properties do not match, the image is ignored.

Parameters
a_filenameThe path and filename of the image to be added to the set.
a_indexThe index in the set where the image should be added. By default, the image is added at the end of the set.
Returns
_true__ if insertion is successful, false otherwise.
bool chai3d::cMultiImage::saveToFiles ( const std::string &  a_basename,
const std::string &  a_extension 
)
virtual

This method saves all 3D imaging data as a set of 2D images. The filenames are define by the basename, a numeric index and the extension. The files are saved chronologically and the number index is generated automatically for each file.

E.g. saveToFiles("img", "png")

Parameters
a_basenameThe common path and filename component of the files.
a_extensionThe images file extension.
Returns
true if operation succeeded, false otherwise.
void chai3d::cMultiImage::defaults ( )
protected

This method initializes internal variables.

void chai3d::cMultiImage::cleanup ( )
protected

This method frees memory that was used for image data, and re-initialize internal variables.

bool chai3d::cMultiImage::addFromFilePrealloc ( const std::string &  a_filename,
unsigned long  a_index 
)
protectedvirtual

This method adds an image file to a preallocated image set. The set must be preallocated by calling loadFromFiles(). This method checks that the new image matches the properties of the images already in the set. If the image properties do not match, the image is not loaded and an error is returned.

Parameters
a_filenameThe path and filename of the image to be added to the set.
a_indexThe index in the set where the image should be added. By default, the image is added at the end of the set.
Returns
true if insertion is successful, false otherwise.
bool chai3d::cMultiImage::addImagePrealloc ( cImage a_image,
unsigned long  a_index 
)
protected

This method adds an image to a preallocated image set. The set must be preallocated by calling loadFromFiles(). This method checks that the new image matches the properties of the images already in the set. If the image properties do not match, the image is not loaded and an error is returned.

Parameters
a_imageThe image to be added to the image set.
a_indexThe index in the set where the image should be added. By default, the image is added at the end of the set.
Returns
true if the insertion is successful, false otherwise.

Member Data Documentation

unsigned char* chai3d::cMultiImage::m_array
protected
unsigned long chai3d::cMultiImage::m_imageCount
protected
unsigned long chai3d::cMultiImage::m_currentIndex
protected

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