eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::EGrid Class Reference

Represents a rectangular grid, to be used by readers to read QRCodes, matrix codes, or bar codes. More...

#include <eVision/Easy/EGrid.h>

Inheritance diagram for eVision::EGrid:
Collaboration diagram for eVision::EGrid:

Public Member Functions

 EGrid ()
 Constructs a EGrid object.
 EGrid (uint32_t numCellsX, uint32_t numCellsY, const eVision::ERectangle &area, float extension)
 Constructs a EGrid object.
 EGrid (const eVision::EGrid &other)
 Constructs a EGrid object.
virtual ~EGrid () throw ()
eVision::EGrid & operator= (const eVision::EGrid &other)
 Copies all the data from another EGrid object into the current EGrid object.
uint32_t GetNumRows () const
 Returns the number of rows in the grid.
uint32_t GetNumCols () const
 Returns the number of columns in the grid.
void SetEnableRow (uint32_t row, bool enable)
 Enable/Disable Row.
void SetEnableColumn (uint32_t column, bool enable)
 Enable/Disable Column.
void SetEnableCell (uint32_t column, uint32_t row, bool enable)
 Enable/Disable Cell.
void SetEnableAll (bool enable)
 Enable/Disable all cells.
bool GetCellEnabled (uint32_t column, uint32_t row) const
 Returns true if Cell is enabled and false otherwise.
eVision::ERegion GetCellRegion (uint32_t column, uint32_t row)
 Returns the region of a grid cell given its indices in an EGrid object.
void SetArea (const eVision::ERectangle &area)
 Set the area of an EGrid object.
eVision::ERectangle GetArea () const
 Returns the area of an EGrid object.
void SetExtension (float extension)
 Set the extension of an EGrid object.
float GetExtension () const
 Returns the extension of an EGrid object.
void DrawGrid (eVision::EDrawAdapter *drawAdapter, const eVision::EGridDrawOptions &options, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY) const
 Draws the grid.
void DrawGrid (eVision::EDrawAdapter *drawAdapter, const eVision::EGridDrawOptions &options, float zoomX, float zoomY, float panX, float panY) const
 Draws the grid.
eVision::EEditionMode HitTest (int x, int y, float zoomX, float zoomY, float panX, float panY)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int x, int y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY)
 Detects if the cursor is placed over one of the dragging handles.
virtual void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY)
 Moves the specified handle to a new position and updates all placement parameters of the grid.
virtual void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX)
 Moves the specified handle to a new position and updates all placement parameters of the grid.
virtual void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY)
 Moves the specified handle to a new position and updates all placement parameters of the grid.
virtual void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX)
 Moves the specified handle to a new position and updates all placement parameters of the grid.
virtual void Drag (int32_t x, int32_t y, const eVision::EFrame &frame)
 Moves the specified handle to a new position and updates all placement parameters of the grid.
void Drag (int32_t x, int32_t y, float zoomX, float zoomY, float panX, float panY)
 Moves the specified handle to a new position and updates all placement parameters of the grid.
void Drag (int32_t x, int32_t y, float zoomX, float zoomY, float panX)
 Moves the specified handle to a new position and updates all placement parameters of the grid.
void Drag (int32_t x, int32_t y, float zoomX, float zoomY)
 Moves the specified handle to a new position and updates all placement parameters of the grid.
void Drag (int32_t x, int32_t y, float zoomX)
 Moves the specified handle to a new position and updates all placement parameters of the grid.
void Drag (int32_t x, int32_t y)
 Moves the specified handle to a new position and updates all placement parameters of the grid.
void SetEditionMode (eVision::EEditionMode editionMode)
 Graphical edition mode.
eVision::EEditionMode GetEditionMode () const
 Graphical edition mode.
void Load (const std::string &path)
 Load the EGrid configuration. The given ESerializer must have been created for reading.
void Load (eVision::ESerializer *serializer)
 Load the EGrid configuration. The given ESerializer must have been created for reading.
void Save (const std::string &path)
 Save the EGrid configuration. The given ESerializer must have been created for writing.
void Save (eVision::ESerializer *serializer)
 Save the EGrid configuration. The given ESerializer must have been created for writing.
 EGrid (CppWrapperInternal::InternalConstructor)

Public Attributes

CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

Represents a rectangular grid, to be used by readers to read QRCodes, matrix codes, or bar codes.

An EGrid object only contains geometrical information, such as the area, extension, and indices of the grid. Specialized implementations can be found for QRCodes, matrix codes, and bar codes.

License(s): EasyQRCode or EasyMatrixCode or EasyBarCode

Constructor & Destructor Documentation

◆ EGrid() [1/4]

eVision::EGrid::EGrid ( )

Constructs a EGrid object.

◆ EGrid() [2/4]

eVision::EGrid::EGrid ( uint32_t numCellsX,
uint32_t numCellsY,
const eVision::ERectangle & area,
float extension )

Constructs a EGrid object.

Parameters
numCellsXNumber of cells in column direction.
numCellsYNumber of cells in row direction.
areaArea of the grid.
extensionextension of the cells grid.

◆ EGrid() [3/4]

eVision::EGrid::EGrid ( const eVision::EGrid & other)

Constructs a EGrid object.

Parameters
otherAnother EGrid object to be copied in the new EGrid object.

◆ ~EGrid()

eVision::EGrid::~EGrid ( )
throw ( )
virtual

◆ EGrid() [4/4]

eVision::EGrid::EGrid ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ Drag() [1/10]

void eVision::EGrid::Drag ( int32_t x,
int32_t y )

Moves the specified handle to a new position and updates all placement parameters of the grid.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ Drag() [2/10]

void eVision::EGrid::Drag ( int32_t x,
int32_t y,
const eVision::EFrame & frame )
virtual

Moves the specified handle to a new position and updates all placement parameters of the grid.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
frameFrame to transform coordinates with.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ Drag() [3/10]

void eVision::EGrid::Drag ( int32_t x,
int32_t y,
const eVision::EFrame & frame,
float zoomX )
virtual

Moves the specified handle to a new position and updates all placement parameters of the grid.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
frameFrame to transform coordinates with.
zoomXHorizontal zoom factor. By default, true scale is used.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ Drag() [4/10]

void eVision::EGrid::Drag ( int32_t x,
int32_t y,
const eVision::EFrame & frame,
float zoomX,
float zoomY )
virtual

Moves the specified handle to a new position and updates all placement parameters of the grid.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
frameFrame to transform coordinates with.
zoomXHorizontal zoom factor. By default, true scale is used.
zoomYVertical zoom factor. By default, true scale is used.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ Drag() [5/10]

void eVision::EGrid::Drag ( int32_t x,
int32_t y,
const eVision::EFrame & frame,
float zoomX,
float zoomY,
float panX )
virtual

Moves the specified handle to a new position and updates all placement parameters of the grid.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
frameFrame to transform coordinates with.
zoomXHorizontal zoom factor. By default, true scale is used.
zoomYVertical zoom factor. By default, true scale is used.
panXHorizontal pan offset. By default, no pan is added.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ Drag() [6/10]

void eVision::EGrid::Drag ( int32_t x,
int32_t y,
const eVision::EFrame & frame,
float zoomX,
float zoomY,
float panX,
float panY )
virtual

Moves the specified handle to a new position and updates all placement parameters of the grid.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
frameFrame to transform coordinates with.
zoomXHorizontal zoom factor. By default, true scale is used.
zoomYVertical zoom factor. By default, true scale is used.
panXHorizontal pan offset. By default, no pan is added.
panYVertical pan offset. By default, no pan is added.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ Drag() [7/10]

void eVision::EGrid::Drag ( int32_t x,
int32_t y,
float zoomX )

Moves the specified handle to a new position and updates all placement parameters of the grid.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
zoomXHorizontal zoom factor. By default, true scale is used.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ Drag() [8/10]

void eVision::EGrid::Drag ( int32_t x,
int32_t y,
float zoomX,
float zoomY )

Moves the specified handle to a new position and updates all placement parameters of the grid.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
zoomXHorizontal zoom factor. By default, true scale is used.
zoomYVertical zoom factor. By default, true scale is used.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ Drag() [9/10]

void eVision::EGrid::Drag ( int32_t x,
int32_t y,
float zoomX,
float zoomY,
float panX )

Moves the specified handle to a new position and updates all placement parameters of the grid.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
zoomXHorizontal zoom factor. By default, true scale is used.
zoomYVertical zoom factor. By default, true scale is used.
panXHorizontal pan offset. By default, no pan is added.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ Drag() [10/10]

void eVision::EGrid::Drag ( int32_t x,
int32_t y,
float zoomX,
float zoomY,
float panX,
float panY )

Moves the specified handle to a new position and updates all placement parameters of the grid.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
zoomXHorizontal zoom factor. By default, true scale is used.
zoomYVertical zoom factor. By default, true scale is used.
panXHorizontal pan offset. By default, no pan is added.
panYVertical pan offset. By default, no pan is added.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ DrawGrid() [1/2]

void eVision::EGrid::DrawGrid ( eVision::EDrawAdapter * drawAdapter,
const eVision::EGridDrawOptions & options,
const eVision::EFrame & frame,
float zoomX,
float zoomY,
float panX,
float panY ) const

Draws the grid.

Parameters
drawAdapterHandle to the device context of the destination window.
optionsOptions for grid drawing.
frameFrame associated with the pattern.
zoomXHorizontal zooming factor.
zoomYVertical zooming factor. If set to 0, the horizontal zooming factor will be used for isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.
panYVertical panning value expressed in pixels. By default, no panning occurs.

The zoomX, zoomY, panX and panY parameters can be used to scale and/or translate the drawing operations.

◆ DrawGrid() [2/2]

void eVision::EGrid::DrawGrid ( eVision::EDrawAdapter * drawAdapter,
const eVision::EGridDrawOptions & options,
float zoomX,
float zoomY,
float panX,
float panY ) const

Draws the grid.

Parameters
drawAdapterHandle to the device context of the destination window.
optionsOptions for grid drawing.
zoomXHorizontal zooming factor.
zoomYVertical zooming factor. If set to 0, the horizontal zooming factor will be used for isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.
panYVertical panning value expressed in pixels. By default, no panning occurs.

The zoomX, zoomY, panX and panY parameters can be used to scale and/or translate the drawing operations.

◆ GetArea()

eVision::ERectangle eVision::EGrid::GetArea ( ) const

Returns the area of an EGrid object.

◆ GetCellEnabled()

bool eVision::EGrid::GetCellEnabled ( uint32_t column,
uint32_t row ) const

Returns true if Cell is enabled and false otherwise.

Parameters
columnThe column of the cell.
rowThe row of the cell.

By default, all grid cells are enabled.

◆ GetCellRegion()

eVision::ERegion eVision::EGrid::GetCellRegion ( uint32_t column,
uint32_t row )

Returns the region of a grid cell given its indices in an EGrid object.

Parameters
columnThe column of the cell.
rowThe row of the cell.

◆ GetEditionMode()

eVision::EEditionMode eVision::EGrid::GetEditionMode ( ) const

Graphical edition mode.

◆ GetExtension()

float eVision::EGrid::GetExtension ( ) const

Returns the extension of an EGrid object.

◆ GetNumCols()

uint32_t eVision::EGrid::GetNumCols ( ) const

Returns the number of columns in the grid.

◆ GetNumRows()

uint32_t eVision::EGrid::GetNumRows ( ) const

Returns the number of rows in the grid.

◆ HitTest() [1/2]

eVision::EEditionMode eVision::EGrid::HitTest ( int x,
int y,
const eVision::EFrame & frame,
float zoomX,
float zoomY,
float panX,
float panY )

Detects if the cursor is placed over one of the dragging handles.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
frameFrame of reference in which the grid is defined.
zoomXHorizontal zoom factor. By default, true scale is used.
zoomYVertical zoom factor. By default, true scale is used.
panXHorizontal pan offset. By default, no pan is added.
panYVertical pan offset. By default, no pan is added.

Returns an EEditionMode indicating the type of handle under the mouse.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ HitTest() [2/2]

eVision::EEditionMode eVision::EGrid::HitTest ( int x,
int y,
float zoomX,
float zoomY,
float panX,
float panY )

Detects if the cursor is placed over one of the dragging handles.

Parameters
xx-coordinate of the mouse cursor.
yy-coordinate of the mouse cursor.
zoomXHorizontal zoom factor. By default, true scale is used.
zoomYVertical zoom factor. By default, true scale is used.
panXHorizontal pan offset. By default, no pan is added.
panYVertical pan offset. By default, no pan is added.

Returns an EEditionMode indicating the type of handle under the mouse.

If zooming and/or panning were used when drawing the region, the same values must be used with EGrid::HitTest and EGrid::Drag.

◆ Load() [1/2]

void eVision::EGrid::Load ( const std::string & path)

Load the EGrid configuration. The given ESerializer must have been created for reading.

Parameters
pathThe file path.

◆ Load() [2/2]

void eVision::EGrid::Load ( eVision::ESerializer * serializer)

Load the EGrid configuration. The given ESerializer must have been created for reading.

Parameters
serializerThe serializer.

◆ operator=()

eVision::EGrid & eVision::EGrid::operator= ( const eVision::EGrid & other)

Copies all the data from another EGrid object into the current EGrid object.

Parameters
otherEGrid object to be copied

◆ Save() [1/2]

void eVision::EGrid::Save ( const std::string & path)

Save the EGrid configuration. The given ESerializer must have been created for writing.

Parameters
pathThe file path.

◆ Save() [2/2]

void eVision::EGrid::Save ( eVision::ESerializer * serializer)

Save the EGrid configuration. The given ESerializer must have been created for writing.

Parameters
serializerThe serializer.

◆ SetArea()

void eVision::EGrid::SetArea ( const eVision::ERectangle & area)

Set the area of an EGrid object.

Parameters
areaThe area of the cell.

◆ SetEditionMode()

void eVision::EGrid::SetEditionMode ( eVision::EEditionMode editionMode)

Graphical edition mode.

Parameters
editionModeEEditionMode flags

◆ SetEnableAll()

void eVision::EGrid::SetEnableAll ( bool enable)

Enable/Disable all cells.

By default, all grid cells are enabled.

◆ SetEnableCell()

void eVision::EGrid::SetEnableCell ( uint32_t column,
uint32_t row,
bool enable )

Enable/Disable Cell.

Parameters
columnThe column of the cell to (dis/en)able.
rowThe row of the cell to (dis/en)able.
enableWhether to enable or disable the cell.

By default, all grid cells are enabled.

◆ SetEnableColumn()

void eVision::EGrid::SetEnableColumn ( uint32_t column,
bool enable )

Enable/Disable Column.

Parameters
columnThe column of the cells to (dis/en)able.
enableWhether to enable or disable the cells.

By default, all grid cells are enabled.

◆ SetEnableRow()

void eVision::EGrid::SetEnableRow ( uint32_t row,
bool enable )

Enable/Disable Row.

Parameters
rowThe row of the cells to (dis/en)able.
enableWhether to enable or disable the cells.

By default, all grid cells are enabled.

◆ SetExtension()

void eVision::EGrid::SetExtension ( float extension)

Set the extension of an EGrid object.

Parameters
extensionThe extension of the cell.

Member Data Documentation

◆ wrappedClass_

CppWrapperInternal::WrappedClass eVision::EGrid::wrappedClass_