![]() |
GemaLuaCoreLib
The GeMA Lua Core library
|
A proxy class to export GmMesh methods to the Lua environment. More...
#include <gmLuaMesh.h>


Public Member Functions | |
| GmLuaMesh (GmMesh *mesh, const GmLogCategory &logger) | |
| Constructor. Receives the mesh to be wrapped. | |
| virtual | ~GmLuaMesh () |
| Destructor. | |
| virtual const char * | typeName () const |
| Returns the object type as will be stored in the object metatable. | |
| virtual QString | toString () const |
| Default method used by the __tostring metamethod to capture the result of tostring() over an object. | |
| 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. | |
| GmMesh * | mesh () const |
| Returns the wrapped mesh. | |
Public Member Functions inherited from GmLuaObject | |
| 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. | |
Public Member Functions inherited from LuaProxy::Base | |
Protected Attributes | |
| GmMesh * | _mesh |
| The mesh 'wrapped' by this proxy object. | |
Protected Attributes inherited from GmLuaObject | |
| 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. | |
Private Member Functions | |
| int | id (lua_State *L) |
| Returns the mesh id. | |
| int | hasCapability (lua_State *L) |
| Returns true or false indicating whether the mesh supports the requested capability (a string) or not. | |
| int | nodeCoordInfo (lua_State *L) |
| Returns a GmLuaValueInfo object with information about node coordinates. | |
| int | nodeCoordAccessor (lua_State *L) |
| Returns an accessor object for querying node coordinates or nil on error. | |
| int | numNodes (lua_State *L) |
| Returns the number of nodes in the mesh. | |
| int | numGhostNodes (lua_State *L) |
| Returns the number of ghost nodes in the mesh. | |
| int | totalNumNodes (lua_State *L) |
| Returns the total number of nodes in the mesh (normal nodes + ghost nodes) | |
| int | nodeSets (lua_State *L) |
| Returns a table indexed by node set names, with node set objects. | |
| int | nodeValueIds (lua_State *L) |
| Returns a table with a list of attribute ids associated to this mesh. If called with no parameters, the returned list will contain both state variables and node attributes (in this order). If called with the string "sv" as parameter, returns only state variables. If called with "attr" as parameter, returns only node attributes. | |
| int | nodeValueInfo (lua_State *L) |
| Returns a GmLuaValueInfo object with information about the requested attribute / state var. Returns nil if the requested value does not exist. | |
| int | nodeValueAccessor (lua_State *L) |
| Returns an accessor object for querying node values or nil on error. | |
| int | addNodeValueSet (lua_State *L) |
| Adds a new value set to the mesh. | |
| int | removeNodeValueSet (lua_State *L) |
| Tries to remove a node value set stored in the mesh. | |
| int | clearNodeValueSets (lua_State *L) |
| Removes the node value sets stored in the mesh. | |
| int | saveState (lua_State *L) |
| Saves the global state. Receives as parameter a string describing the save mode ('init', 'noinit' or 'copy'). Returns true if successfull. | |
| int | saveNodeValueState (lua_State *L) |
| Saves the state of the given node value. Receives as parameter the value id and a string describing the save mode ('init', 'noinit' or 'copy'). Returns true if successfull. | |
| int | numNodeValueStates (lua_State *L) |
| Returns the number of existing states for the requested id or -1 if the id doesn't exists. | |
| int | nodeValueStateTag (lua_State *L) |
| Returns the state tag attached to the requested state of the named value or "" if the id doesn't exists. | |
| int | nodeValueStateTime (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 | setNodeValueStateTag (lua_State *L) |
| Sets a tag name for the requested state of the named value. Does nothing if the id doesn't exists. | |
| int | setNodeValueStateTime (lua_State *L) |
| Sets a time tag for the requested state of the named value. Does nothing if the id doesn't exists. | |
| int | addNodes (lua_State *L) |
| Adds the specified number of nodes to the mesh node set. Returns the index of the first new value. | |
| int | addGhostNodes (lua_State *L) |
| Adds the specified number of ghost nodes to the mesh node set. Returns the index of the first new value. | |
| int | toLinearGhostIndex (lua_State *L) |
| If the given nodeIndex is a value with its high bit set, returns the index + the number of regular mesh nodes. Otherwise, returns nodeIndex. | |
| int | toLocalGhostIndex (lua_State *L) |
| Given a linear ghost index (a value > numNodes() and <= totalNumNodes()), returns a one based version of the index. If index is a 'geometry index' (nodeIndex <= numNodes()), returns nil. | |
| int | clear (lua_State *L) |
| Clears the mesh, removing nodes, cells and values associated to their attributes. | |
| int | emitMeshChanged (lua_State *L) |
| Emit signal declaring that the mesh has changed. | |
| int | print (lua_State *L) |
| Prints mesh parameters (not values) | |
| int | printValues (lua_State *L) |
| Prints mesh values. An optional boolean parameter defines if functions are evaluated or not. | |
| int | originalToLocalOrderNode (lua_State *L) |
| Translates an original model node to its local, renumbered, mesh index (but still 1 - based). When dealing with ghost nodes, accepts both values with the high bit set and linear indices. Returns the value in the same format as it was received. If the node is invalid, raises an error. If it is a valid node but does not belongs to the current mesh partition, returns 0. | |
| int | localOrderToOriginalNode (lua_State *L) |
| Translates a local, renumbered, mesh index (but still 1 - based) to the original model node index. When dealing with ghost nodes, accepts both values with the high bit set and linear indices. Returns the value in the same format as it was received. If the node is invalid, raises an error. If it is a valid node but does not have a corresponding Model index, returns 0. | |
Additional Inherited Members | |
Protected Member Functions inherited from GmLuaObject | |
| GmLuaObject (const GmLogCategory &logger) | |
| Construtor protegido. Somente classes derivadas devem ser instanciadas. | |
A proxy class to export GmMesh methods to the Lua environment.
|
private |
Adds a new value set to the mesh.
Receives on the stack a valueInfo object with the description of the new attribute / state var. 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.
|
virtual |
Prepares the object metatable for calling methods.
Implements GmLuaObject.
Reimplemented in GmLuaCellMesh, GmLuaElementMesh, and GmLuaRegularGridMesh.
|
inlinevirtual |
Returns an unique identifier to identify an user object as a GmLuaMesh object.
Implements LuaProxy::Base.
Reimplemented in GmLuaCellMesh, GmLuaElementMesh, and GmLuaRegularGridMesh.
|
private |
Returns an accessor object for querying node coordinates or nil on error.
Can optionally receive on the stack the unit in which values should be returned
|
private |
Returns an accessor object for querying node values or nil on error.
Receives as stack parameter the name of the desired attribute / state var and, optionally, the unit in which values should be returned
|
private |
Returns a GmLuaValueInfo object with information about the requested attribute / state var. Returns nil if the requested value does not exist.
Receives as stack parameter the name of the desired attribute / state var. Can optionaly receive a filter string: "sv" to return only state vars and "attr" to return only node attributes.
|
virtual |
Default method used by the __tostring metamethod to capture the result of tostring() over an object.
Reimplemented from GmLuaObject.
|
inlinevirtual |
Returns the object type as will be stored in the object metatable.
Implements GmLuaObject.
Reimplemented in GmLuaCellMesh, GmLuaElementMesh, and GmLuaRegularGridMesh.