4 #include "contactmodel/interface/icontactmodel.h"
5 #include "contactmodel_global.h"
8 #include "shared/src/archivestream.h"
17 #define cmodelsxd cmodels2d
19 #define cmodelsxd cmodels3d
24 #pragma warning(disable:4251)
35 class ContactModelState;
37 static const quint32 ACTIVE_IS = 0x000001;
38 static const quint32 ACTIVATED = 0x000002;
39 static const quint32 ACTIVE_COULDBE = 0x000004;
42 enum InfoTypes {ScalarInfo=1,TextInfo,VectorInfo};
57 bool setActive(
bool b=
true) {
if (b) activeState_ |= ACTIVE_IS;
else activeState_ &=~ ACTIVE_IS;
return isActive(); }
59 bool setCouldBeActive(
bool b=
true) {
if (b) activeState_ |= ACTIVE_COULDBE;
else activeState_ &=~ ACTIVE_COULDBE;
return couldBeActive(); }
61 bool setActivated(
bool b=
true) {
if (b) activeState_ |= ACTIVATED;
else activeState_ &=~ ACTIVATED;
return activated(); }
64 bool isActive()
const {
return activeState_ & ACTIVE_IS; }
68 bool activated()
const {
return activeState_ & ACTIVATED; }
71 quint32 activeState_ = 0;
72 bool trackEnergy_ =
false;
128 int isProperty(
const QString &c,Qt::CaseSensitivity cs=Qt::CaseInsensitive)
const override;
135 bool setProperty([[maybe_unused]]uint i,[[maybe_unused]]
const QVariant &v,[[maybe_unused]]
IContact *con=0)
override {
throw Exception(
"Not at this level"); }
137 bool getPropertyReadOnly(uint)
const override {
return false; }
138 bool supportsInheritance(uint)
const override {
return false; }
139 bool getInheritance(uint)
const override {
return false;}
140 void setInheritance(uint,
bool)
override {}
142 QString getMethods()
const override {
return QString();}
145 int isMethod(
const QString &c,Qt::CaseSensitivity cs=Qt::CaseInsensitive)
const override;
157 int isEnergy(
const QString &c,Qt::CaseSensitivity cs=Qt::CaseInsensitive)
const override;
175 void destroy()
override {
delete this; }
181 void getDiskList(
const IContact *,std::vector<DVect> *,std::vector<DVect> *,std::vector<double> *,std::vector<double> *)
override {
throw Exception(
"Not at this level"); }
184 void getCylinderList(
const IContact *,std::vector<DVect> *,std::vector<DVect> *,std::vector<double> *,std::vector<double> *,std::vector<double> *)
override {
throw Exception(
"Not at this level"); }
190 void setEventVal(
int i,
int j);
201 uint getPropertyIndex(
const QString &name,Qt::CaseSensitivity cs=Qt::CaseInsensitive)
const;
204 QString getPropertyName(uint index)
const;
212 void *
operator new(
size_t size);
213 void *
operator new(
size_t size,
const char *name,
const char *file,
unsigned line);
214 void operator delete(
void *v);
215 void operator delete(
void *v,
const char *name,
const char *file,
unsigned line);
216 typedef void *(*NewFunction)(size_t,
const char *,
const char *,unsigned);
217 typedef void (*DeleteFunction)(
void *,
const char *,
const char *,unsigned);
218 typedef std::pair<NewFunction,DeleteFunction> AllocFunctions;
219 static AllocFunctions setAllocFunctions(AllocFunctions afunc);
220 static AllocFunctions getDefaultAllocFunctions();
221 static AllocFunctions getAllocFunctions() {
return AllocFunctions(newFunc_,deleteFunc_); }
228 virtual void objectPropsTypes(std::vector<std::pair<QString,InfoTypes>> *)
const { }
230 virtual void objectPropValues(std::vector<double> *,
const IContact *)
const { }
233 static NewFunction newFunc_;
234 static DeleteFunction deleteFunc_;
Base exception class for all Itasca code.
Definition: baseexception.h:10
The main program access point.
Definition: iprogram.h:37
An array class that attempts to minimize unnecessary heap access.
EXPORT_TAG unsigned getMinorVersion()
Definition: fishexample.cpp:62
EXPORT_TAG unsigned getMajorVersion()
Definition: fishexample.cpp:56
EXPORT_TAG const char * getName()
Definition: fishexample.cpp:43
namespace Itasca
Definition: basememory.cpp:10
Itasca Library standard namespace, specific to 2D or 3D.
Definition: icontactmodule.h:4