![]() |
GemaLuaCoreLib
The GeMA Lua Core library
|
A proxy class to export GmCellMesh methods to the Lua environment. More...
#include <gmLuaMesh.h>
Public Member Functions | |
GmLuaCellMesh (GmCellMesh *mesh, const GmLogCategory &logger) | |
Constructor. | |
virtual const char * | typeName () const |
Returns the object type as will be stored in the object metatable. | |
virtual void | fillMetatable (lua_State *L, int index) |
Prepares the object metatable for calling methods. | |
virtual void * | getClassMetatableID () |
Returns an unique identifier to identify an user object as a GmLuaMesh object. | |
![]() | |
GmLuaMesh (GmMesh *mesh, const GmLogCategory &logger) | |
Constructor. Receives the mesh to be wrapped. | |
virtual | ~GmLuaMesh () |
Destructor. | |
virtual QString | toString () const |
Default method used by the __tostring metamethod to capture the result of tostring() over an object. | |
GmMesh * | mesh () const |
Returns the wrapped mesh. | |
![]() | |
virtual | ~GmLuaObject () |
Destrutor. | |
virtual void | populateMetatable (lua_State *L, int index) |
Fills the object metatable to allow for the proxy to export its methods. | |
QVariant | ptrToVariant () |
Constructs a QVariant storing a POINTER to the current object. | |
void | ref () |
Increments the object reference count. Use with care. | |
Private Member Functions | |
int | numCells (lua_State *L) |
Returns the number of cells in this mesh. | |
int | numActiveCells (lua_State *L) |
Returns the number of active cells in this mesh. | |
int | cell (lua_State *L) |
Returns a cell object given the cell index inside the mesh. More... | |
int | adjacentCell (lua_State *L) |
Returns a cell object that is adjacent to a given cell through a given side (edge for surface meshes, face for solid meshes). Also returns as a second value the side from the adjacent cell. More... | |
int | nodeAdjacentNodes (lua_State *L) |
Returns the list of adjacent nodes that neigbours the given node. A second string parameter defines the query options and can be either "star" or "qstar". If not given, the "star" default is used. More... | |
int | nodeAdjacentCells (lua_State *L) |
Returns the list of adjacent cells that shares the given node. More... | |
int | edgeAdjacentCells (lua_State *L) |
Returns the list of adjacent cells that shares the given edge, identified by a cell and a local edge index. The returned list includes the original input cell. | |
int | isBorderNode (lua_State *L) |
Returns true if the given node belongs to the mesh border. | |
int | clearTopology (lua_State *L) |
Gives a hint to the mesh that the topology information will not be needed anymore and can be removed, if at all possible. | |
int | numCellTypes (lua_State *L) |
Returns a table specifying the number of cells in the mesh for each cell type. More... | |
int | numActiveCellTypes (lua_State *L) |
Returns a table specifying the number of active cells in the mesh for each cell type. More... | |
int | maxNumCellNodes (lua_State *L) |
Returns the maximum number of nodes among the cell types in use on this mesh. | |
int | maxNumCellGhostNodes (lua_State *L) |
Returns the maximum number of ghost nodes among the cells on this mesh. | |
int | maxTotalNumCellNodes (lua_State *L) |
Returns the maximum total number of nodes (common + ghost) among the cells on this mesh. | |
int | isValid (lua_State *L) |
Returns true if all the mesh cells are valid. | |
int | edgeMinLength (lua_State *L) |
Returns the minimum edge length in the mesh. More... | |
int | edgeMaxLength (lua_State *L) |
Returns the maximun edge length in the mesh. More... | |
int | cellBboxMinLength (lua_State *L) |
Returns the minimun length of a cell bounding box diagonal in the mesh. | |
int | cellBboxMaxLength (lua_State *L) |
Returns the maximun length of a cell bounding box diagonal in the mesh. | |
int | clearCellStatistics (lua_State *L) |
Clear cell statistics, forcing them to be recalculated. | |
int | printQualityHistogram (lua_State *L) |
Prints cells quality histogram. | |
int | cellGroupIds (lua_State *L) |
Returns a table with cell group names. | |
int | cellGroupIndex (lua_State *L) |
Returns the group index for a given group name or nil if not found. | |
int | numCellsInGroup (lua_State *L) |
Given a cell group index (position in list returned by cellGroupIds()), returns the number of elements in a group. | |
int | cellInGroup (lua_State *L) |
Given a cell group index (position in list returned by cellGroupIds()) and a cell index inside the group (betwwen 1 and numCellsInGroup()), returns a cell object. | |
int | cellBoundaryGroups (lua_State *L) |
Returns a table indexed by boundary group names, with cell boundary objects. | |
int | numPropertySets (lua_State *L) |
Returns the number of property sets associated to this mesh. | |
int | propertySets (lua_State *L) |
Returns a list with property cell objects tied to this mesh. | |
int | propertySetIndex (lua_State *L) |
Returns the index in the list returned by propertySets(), of the property set that contains the given property (identified by its id). Returns nil if the requested property does not exist. More... | |
int | cellPropertyInfo (lua_State *L) |
Returns a GmLuaValueInfo object with information about the requested property. Returns nil if the requested value does not exist. More... | |
int | cellPropertyAccessor (lua_State *L) |
Returns an accessor object for querying property values or nil on error. More... | |
int | cellAttributeIds (lua_State *L) |
Returns a table with a list of cell attribute ids associated to this mesh. | |
int | cellAttributeInfo (lua_State *L) |
Returns a GmLuaValueInfo object with information about the requested cell attribute. Returns nil if the requested value does not exist. More... | |
int | cellAttributeAccessor (lua_State *L) |
Returns an accessor object for querying cell attributes or nil on error. More... | |
int | addCellAttributeSet (lua_State *L) |
Adds a new cell value set to the mesh. More... | |
int | removeCellAttributeSet (lua_State *L) |
Tries to remove a cell attribute set stored in the mesh. | |
int | clearCellAttributeSets (lua_State *L) |
Removes the cell attribute sets stored in the mesh. | |
int | saveCellAttributeState (lua_State *L) |
Saves the state of the given cell value. Receives as parameter the value id and a string describing the save mode ('init', 'noinit' or 'copy'). Returns true if successfull. | |
int | numCellAttributeStates (lua_State *L) |
Returns the number of existing states for the requested id or -1 if the id doesn't exists. | |
int | cellAttributeStateTag (lua_State *L) |
Returns the state tag attached to the requested state of the named value or "" if the id doesn't exists. | |
int | cellAttributeStateTime (lua_State *L) |
Returns the time tag attached to the requested state of the named value or -1 if the id doesn't exists. | |
int | setCellAttributeStateTag (lua_State *L) |
Sets a tag name for the requested state of the named value. Does nothing if the id doesn't exists. | |
int | setCellAttributeStateTime (lua_State *L) |
Sets a time tag for the requested state of the named value. Does nothing if the id doesn't exists. | |
int | addCells (lua_State *L) |
Given a map describing the type and quantity of the cells to insert, add them to the mesh. Returns the index of the first new value. More... | |
int | addCellGroup (lua_State *L) |
Adds a new cell group to the mesh if the "editGroups" capability is supported. Receives the group name as parameter. Returns the new group index or nil if it. More... | |
int | addCellsToGroup (lua_State *L) |
Adds a list of cells to the given cell group (identified by its index). Added cells can be given as either a table with cell ids or a table with subtables containing id ranges. Requires support for the the "editGroups" capability. returns true on succes, false on error. | |
Additional Inherited Members | |
![]() | |
GmLuaObject (const GmLogCategory &logger) | |
Construtor protegido. Somente classes derivadas devem ser instanciadas. | |
![]() | |
GmMesh * | _mesh |
The mesh 'wrapped' by this proxy object. | |
![]() | |
const GmLogCategory & | _logger |
A logger used by the proxy when needed. | |
QAtomicInteger< int > | _refCount |
Lua objects are reference counted to enable sharing them among different states. This is needed to allow for passing objects as parameters in a parallel call. The garbage collection method releases memory only for the last reference. | |
A proxy class to export GmCellMesh methods to the Lua environment.
|
private |
Adds a new cell value set to the mesh.
Receives on the stack a valueInfo object with the description of the new cell attribute. Keep in mind that this should be a NEW valueInfo object since the mesh will take ownership of the info object.
Returns false if the value could not be added.
|
private |
Adds a new cell group to the mesh if the "editGroups" capability is supported. Receives the group name as parameter. Returns the new group index or nil if it.
could not be created
|
private |
Given a map describing the type and quantity of the cells to insert, add them to the mesh. Returns the index of the first new value.
The map received as parameter should be indexed by type name, having as value the number of cells of that type
|
private |
Returns a cell object that is adjacent to a given cell through a given side (edge for surface meshes, face for solid meshes). Also returns as a second value the side from the adjacent cell.
The original cell can be specified either by an id or by a cell object Returns nil if there is no adjacent cell, i.e., side is part of the mesh boundary. Also returns nil for "strange" elements that don't have topology information (non-manifold elements like bars for a surface mesh and bars, quads and triangles for solid meshes). Following Lua tradition, the index is one based
|
private |
Returns a cell object given the cell index inside the mesh.
Following Lua tradition, the index is one based
|
private |
Returns an accessor object for querying cell attributes or nil on error.
Receives as stack parameter the name of the desired cell attribute and, optionally, the unit in which values should be returned. A third optional parameter defines the state to be queried
|
private |
Returns a GmLuaValueInfo object with information about the requested cell attribute. Returns nil if the requested value does not exist.
Receives as stack parameter the name of the desired cell attribute
|
private |
Returns an accessor object for querying property values or nil on error.
Receives as stack parameter the name of the desired property and, optionally, the unit in which values should be returned
|
private |
Returns a GmLuaValueInfo object with information about the requested property. Returns nil if the requested value does not exist.
Receives as stack parameter the name of the desired property
|
private |
Returns the maximun edge length in the mesh.
IMPORTANT: only works well with linear cells
|
private |
Returns the minimum edge length in the mesh.
IMPORTANT: only works well with linear cells
|
private |
Returns the list of adjacent cells that shares the given node.
Following Lua tradition, the index is one based
|
private |
Returns the list of adjacent nodes that neigbours the given node. A second string parameter defines the query options and can be either "star" or "qstar". If not given, the "star" default is used.
Following Lua tradition, the index is one based
|
private |
Returns a table specifying the number of active cells in the mesh for each cell type.
The tabled is keyed by the cell type (string). Only the types used in the mesh have entries set in the result table.
|
private |
Returns a table specifying the number of cells in the mesh for each cell type.
The tabled is keyed by the cell type (string). Only the types used in the mesh have entries set in the result table.
|
private |
Returns the index in the list returned by propertySets(), of the property set that contains the given property (identified by its id). Returns nil if the requested property does not exist.
Receives as stack parameter the name of the desired property