GemaLuaCoreLib
The GeMA Lua Core library
Loading...
Searching...
No Matches
gmLuaIntegrationRule.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMALUA_INTEGRATION_RULE_H_
25#define _GEMALUA_INTEGRATION_RULE_H_
26
27#include "gmLuaObject.h"
28#include <gmCell.h>
29
32
34class GML_API_EXPORT GmLuaIntegrationRule: public GmLuaObject
35{
36public:
37 GmLuaIntegrationRule(const GmIntegrationRule* ir, bool newRule, const GmLogCategory& logger);
38
39 virtual ~GmLuaIntegrationRule();
40
41 // See comments on the base class
42 virtual const char* typeName() const { return "integrationRule"; }
43
44 virtual QString toString() const;
45
46 virtual void fillMetatable(lua_State* L, int index);
47
49 virtual void* getClassMetatableID() { static int classID = 0; return &classID; }
50
52 const GmIntegrationRule* intRule() const { return _ir; }
53
54private:
55 int ruleName (lua_State* L);
56 int numPoints (lua_State* L);
57 int integrationPoint(lua_State* L);
58 int numNaturalCoord (lua_State* L);
59 int degree (lua_State* L);
60
61protected:
63 bool _newRule;
64};
65
66
69{
70public:
71 GmLuaBorderIntegrationRule(const GmBorderIntegrationRule* ir, bool newRule, GmCellType type, const GmLogCategory& logger);
72
73 // See comments on the base class
74 virtual const char* typeName() const { return "borderIntegrationRule"; }
75
76 virtual void fillMetatable(lua_State* L, int index);
77
79 virtual void* getClassMetatableID() { static int classID = 0; return &classID; }
80
81private:
82 int numBorderCoord(lua_State* L);
83 int translatePoint(lua_State* L);
84
86};
87
88
91{
92 int parseIntegrationRuleParams(lua_State* L, const char* name, GmCellType* cellType, int* P, int* Q, int* faceType,
93 GmIntegrationRuleType* irType, int* rule1, int* rule2 = NULL, int* rule3 = NULL);
94
95 int pushIntegrationRule(lua_State* L, GmIntegrationRule* ir, GmCellType cellType, const GmLogCategory& logger);
96}
97
98
99#endif
A proxy class to export GmBorderIntegrationRule methods to the Lua environment.
Definition gmLuaIntegrationRule.h:69
GmCellGeometry _geom
The geometry corresponding to this integration rule.
Definition gmLuaIntegrationRule.h:85
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmLuaMesh object.
Definition gmLuaIntegrationRule.h:79
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaIntegrationRule.h:74
A proxy class to export GmIntegrationRule methods to the Lua environment.
Definition gmLuaIntegrationRule.h:35
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaIntegrationRule.h:42
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmLuaMesh object.
Definition gmLuaIntegrationRule.h:49
const GmIntegrationRule * intRule() const
Returns the wrapped integration rule.
Definition gmLuaIntegrationRule.h:52
bool _newRule
Does the object owns the integration rule?
Definition gmLuaIntegrationRule.h:63
const GmIntegrationRule * _ir
The integration rule 'wrapped' by this proxy object.
Definition gmLuaIntegrationRule.h:62
A proxy class to export object methods to the Lua environment.
Definition gmLuaObject.h:36
virtual QString toString() const
Default method used by the __tostring metamethod to capture the result of tostring() over an object.
Definition gmLuaObject.h:55
virtual void fillMetatable(lua_State *L, int index)=0
Function called by populateMetatable() to fill the metatable with exported methods by derived classes...
GmCellType
GmIntegrationRuleType
Declaration of the GmLuaObject class.
Aux functions used by integration rule creation functions.
Definition gmLuaIntegrationRule.h:91
int parseIntegrationRuleParams(lua_State *L, const char *name, GmCellType *cellType, int *P, int *Q, int *faceType, GmIntegrationRuleType *irType, int *rule1, int *rule2=NULL, int *rule3=NULL)
Parses the set of parameters used when creating a new integration rule.
Definition gmLuaIntegrationRule.cpp:224
int pushIntegrationRule(lua_State *L, GmIntegrationRule *ir, GmCellType cellType, const GmLogCategory &logger)
Pushes on the Lua stack the given integration rule as either a plain rule or a border rule.
Definition gmLuaIntegrationRule.cpp:310