Itasca C++ Interface
imoduleball.h
1 #pragma once
8 #include "shared/interface/signal.h"
9 #include "base/src/farray.h"
10 #include "base/src/callback.h"
11 
12 namespace itasca {
13  class IContainer;
14  class IEnergyMap;
15 }
16 
17 namespace itascaxd {
18  class ICellSpace;
19  class IContainerContact;
20 }
21 
22 namespace pfc {
23  using namespace itasca;
24  using namespace itascaxd;
25 
26  class IBall;
27  class IGhostBall;
28 
33  class IModuleBall {
34  public:
36  using prop_signal = shared::Signal<const QString &,const QVariant &>;
37 
39  virtual TType getBallType() const=0;
41  virtual TType getGhostBallType() const=0;
43  virtual uint32 getBallGeometryNotice() const=0;
45  virtual uint32 getBallPropertyNotice() const=0;
47  virtual uint32 getBallVelocityNotice() const=0;
49  virtual uint32 getBallCycleNotice() const=0;
51  virtual uint32 getBallFixNotice() const=0;
53  virtual uint32 getBallExtraNotice() const=0;
55  virtual uint32 getBallGroupNotice() const=0;
57  virtual uint32 getBallCleanNotice() const=0;
59  virtual uint32 getBallRotationNotice() const=0;
60 
62  virtual const IContainer * getIContainerBall() const=0;
66  virtual const IContainer * getIContainerGhostBall() const=0;
78  virtual const ICellSpace * getICellSpace() const=0;
80  virtual ICellSpace * getICellSpace()=0;
83  virtual const IBall * findBallWithID(uint64 id) const=0;
86  virtual IBall * findBallWithID(uint64 id) =0;
89  virtual const IGhostBall * findGhostBallWithID(uint64 id) const=0;
92  virtual IGhostBall * findGhostBallWithID(uint64 id) =0;
97  virtual const IBall * findBallClosestTo(const DVect &v,const double &radius=limits<double>::max()) const=0;
102  virtual IBall * findBallClosestTo(const DVect &v,const double &radius=limits<double>::max())=0;
103  virtual const IBall * findBallContaining(const DVect &v,QSet<uint64> *skip=nullptr) const=0;
104  virtual IBall * findBallContaining(const DVect &v,QSet<uint64> *skip=nullptr)=0;
106  virtual void validate()=0;
108  virtual const IEnergyMap * getIBallEnergies() const=0;
110  virtual const IEnergyMap * getIContactBallBallEnergies() const=0;
117  virtual void getBallInBoxList(const DExtent &d,FArray<IBall *> *ret,bool intersect=true)=0;
124  virtual void getBallInBoxList(const DExtent &d,FArray<const IBall *> *ret,bool intersect=true)=0;
131  virtual IBall * createBall(double rad,DVect pos,uint64 id=0)=0;
132 
133  // Populates sets of property names based on their type including the relevant notices
134  virtual void populateAttributeSets(QStringList *scalarAtts,FArray<uint32> *scalarNotices,QStringList *stringAtts,FArray<uint32> *stringNotices,QStringList *vectorAtts,FArray<uint32> *vectorNotices)const=0;
135  // Populates sets of property names based on their type
136  virtual void populatePropertySets(QStringList *scalarProps,QStringList *stringProps,QStringList *vectorProps)const=0;
137 
139  virtual prop_signal * getPropertySignal() const = 0;
140 
142  virtual void threadedCallbackObject(Callback4<void,IBall *,uint32,uint32,void *> &callback,void *v=nullptr,bool useThreads=true) const=0;
143 
145  template <class S,void (S::*MFP)(IBall *,uint32,uint32,void *)>
146  void threadedCallbackMethod(S *s,void *v=nullptr,bool useThreads=true) const {
148  threadedCallbackObject(callback,v,useThreads);
149  }
150 
151  };
152 } // namespace pfc
153 // EoF
Definition: callback.h:37
Definition: callback.h:130
An array class that attempts to minimize unnecessary heap access.
Definition: farray.h:25
Interface for containers of IThings.
Definition: icontainer.h:21
Interface to EnergyMap class.
Definition: ienergymap.h:15
Interface to a "refining" cell space.
Definition: icellspace.h:24
Contact container class.
Definition: icontainercontact.h:29
debug checked shorthand for std::numeric_limits<T>::
Definition: limit.h:25
Interface for a ball.
Definition: iball.h:35
Definition: ighostball.h:16
Interface for the Ball module. This is the interface for the Ball module.
Definition: imoduleball.h:33
virtual const IContainer * getIContainerBall() const =0
Const access to the Ball container.
virtual uint32 getBallExtraNotice() const =0
Ball extra notice unsigned integer.
virtual uint32 getBallFixNotice() const =0
Ball fixity condition notice unsigned integer.
shared::Signal< const QString &, const QVariant & > prop_signal
Signal emitted when a property is created or modified.
Definition: imoduleball.h:36
virtual ICellSpace * getICellSpace()=0
Access to the Ball cellspace.
void threadedCallbackMethod(S *s, void *v=nullptr, bool useThreads=true) const
Implementation of the multithreaded loop using the threadedCallbackObject
Definition: imoduleball.h:146
virtual IBall * createBall(double rad, DVect pos, uint64 id=0)=0
virtual TType getGhostBallType() const =0
Ghost Ball TType for type casting.
virtual IBall * findBallClosestTo(const DVect &v, const double &radius=limits< double >::max())=0
virtual void getBallInBoxList(const DExtent &d, FArray< IBall * > *ret, bool intersect=true)=0
virtual IContainer * getIContainerBall()=0
Access to the Ball container.
virtual const IGhostBall * findGhostBallWithID(uint64 id) const =0
virtual void getBallInBoxList(const DExtent &d, FArray< const IBall * > *ret, bool intersect=true)=0
virtual uint32 getBallCycleNotice() const =0
Ball cycle notice unsigned integer.
virtual void threadedCallbackObject(Callback4< void, IBall *, uint32, uint32, void * > &callback, void *v=nullptr, bool useThreads=true) const =0
Object for creation of multithreaded loop over balls.
virtual const IBall * findBallWithID(uint64 id) const =0
virtual const IContainer * getIContainerGhostBall() const =0
Const access to the GhostBall container.
virtual const IContainerContact * getIContainerBallBallContact() const =0
Const access to the BallBallContact container.
virtual uint32 getBallGeometryNotice() const =0
Ball geometry notice unsigned integer.
virtual const IEnergyMap * getIBallEnergies() const =0
Const access to the Ball energies.
virtual IContainer * getIContainerGhostBall()=0
Access to the GhostBall container.
virtual const ICellSpace * getICellSpace() const =0
Const access to the Ball cellspace.
virtual uint32 getBallCleanNotice() const =0
Ball clean notice unsigned integer.
virtual IBall * findBallWithID(uint64 id)=0
virtual prop_signal * getPropertySignal() const =0
Return the signal associated with the addition of a new property.
virtual uint32 getBallRotationNotice() const =0
Ball rotation notice unsigned integer.
virtual TType getBallType() const =0
Ball TType for type casting.
virtual const IContainerContact * getIContainerDomainBallContact() const =0
Const access to the DomainBallContact container.
virtual uint32 getBallVelocityNotice() const =0
Ball velocity notice unsigned integer.
virtual uint32 getBallGroupNotice() const =0
Ball group notice unsigned integer.
virtual IContainerContact * getIContainerDomainBallContact()=0
Access to the DomainBallContact container.
virtual const IEnergyMap * getIContactBallBallEnergies() const =0
Const access to the BallBallContact energies.
virtual IContainerContact * getIContainerBallBallContact()=0
Access to the BallBallContact container.
virtual IGhostBall * findGhostBallWithID(uint64 id)=0
virtual void validate()=0
Validate the Ball module.
virtual uint32 getBallPropertyNotice() const =0
Ball property notice unsigned integer.
virtual const IBall * findBallClosestTo(const DVect &v, const double &radius=limits< double >::max()) const =0
An array class that attempts to minimize unnecessary heap access.
uint32 TType
class type indicator
Definition: basedef.h:46
DExtent3 DExtent
A DExtent2 in 2D, a DExtent3 in 3D.
Definition: dim.h:156
DVect3 DVect
Vector of doubles, either 2D or 3D.
Definition: dim.h:150
namespace Itasca
Definition: basememory.cpp:10
Itasca Library standard namespace, specific to 2D or 3D.
Definition: icontactmodule.h:4
PFC namespace.
Definition: iballfluid.h:15