Itasca C++ Interface
imoduleclump.h
Go to the documentation of this file.
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 IContact;
19  class ICellSpace;
20  class IContainerContact;
21 }
22 
23 namespace pfc {
24  using namespace itasca;
25  using namespace itascaxd;
26 
27  class IClump;
28  class IPebble;
29  class IGhostPebble;
30  class IClumpTemplate;
31 
36  class IModuleClump {
37  public:
39  using prop_signal = shared::Signal<const QString &,const QVariant &>;
40 
42  virtual TType getClumpType() const=0;
44  virtual TType getPebbleType() const=0;
46  virtual TType getClumpTemplateType() const=0;
48  virtual TType getGhostPebbleType() const=0;
50  virtual uint32 getClumpGeometryNotice() const=0;
52  virtual uint32 getClumpPropertyNotice() const=0;
54  virtual uint32 getClumpVelocityNotice() const=0;
56  virtual uint32 getClumpCycleNotice() const=0;
58  virtual uint32 getClumpExtraNotice() const=0;
60  virtual uint32 getClumpGroupNotice() const=0;
62  virtual uint32 getClumpCleanNotice() const=0;
64  virtual uint32 getClumpRotationNotice() const=0;
66  virtual uint32 getPebbleExtraNotice() const=0;
68  virtual uint32 getPebbleGroupNotice() const=0;
69 
71  virtual const IContainer * getIContainerClump() const=0;
75  virtual const IContainer * getIContainerClumpTemplate() const=0;
78  virtual const IContainer * getIContainerClumpTemplateClumps() const=0;
79  virtual IContainer * getIContainerClumpTemplateClumps()=0;
80  virtual const IContainer * getIContainerClumpTemplatePebbles() const=0;
81  virtual IContainer * getIContainerClumpTemplatePebbles()=0;
82  virtual const IContainer * getIContainerPebble() const=0;
83  virtual IContainer * getIContainerPebble()=0;
84  virtual const IContainer * getIContainerBasePebble() const=0;
85  virtual IContainer * getIContainerBasePebble()=0;
86  virtual const IContainer * getIContainerGhostPebble() const=0;
87  virtual IContainer * getIContainerGhostPebble()=0;
88  virtual const IContainerContact *getIContainerPebblePebbleContact() const=0;
89  virtual IContainerContact * getIContainerPebblePebbleContact()=0;
90  virtual const IContainerContact *getIContainerDomainPebbleContact() const=0;
91  virtual IContainerContact * getIContainerDomainPebbleContact()=0;
92  virtual const ICellSpace * getICellSpacePebble() const=0;
93  virtual ICellSpace * getICellSpacePebble()=0;
94  virtual const IClump * findClumpWithID(uint64 id) const=0;
95  virtual IClump * findClumpWithID(uint64 id) =0;
96  virtual const IClump * findClumpClosestTo(const DVect &v,const double &radius=limits<double>::max()) const=0;
97  virtual IClump * findClumpClosestTo(const DVect &v,const double &radius=limits<double>::max())=0;
98  virtual const IClump * findClumpContaining(const DVect &v,QSet<uint64> *skip=nullptr) const=0;
99  virtual IClump * findClumpContaining(const DVect &v,QSet<uint64> *skip=nullptr)=0;
100  virtual const IPebble * findPebbleWithID(uint64 id) const=0;
101  virtual IPebble * findPebbleWithID(uint64 id) =0;
102  virtual const IPebble * findPebbleClosestTo(const DVect &v,const double &radius=limits<double>::max()) const=0;
103  virtual IPebble * findPebbleClosestTo(const DVect &v,const double &radius=limits<double>::max())=0;
104  virtual const IPebble * findPebbleContaining(const DVect &v,QSet<uint64> *skip=nullptr) const=0;
105  virtual IPebble * findPebbleContaining(const DVect &v,QSet<uint64> *skip=nullptr)=0;
106  virtual const IClumpTemplate * findClumpTemplateWithID(uint64 id) const=0;
107  virtual IClumpTemplate * findClumpTemplateWithID(uint64 id) =0;
108  virtual const IClumpTemplate * findClumpTemplateWithName(const QString &) const=0;
109  virtual IClumpTemplate * findClumpTemplateWithName(const QString &) =0;
110  virtual const IPebble * findClumpTemplatePebbleWithID(uint64 id) const=0;
111  virtual IPebble * findClumpTemplatePebbleWithID(uint64 id) =0;
112  virtual const IGhostPebble * findGhostPebbleWithID(uint64 id) const=0;
113  virtual IGhostPebble * findGhostPebbleWithID(uint64 id) =0;
114  virtual void validate()=0;
115  virtual const IEnergyMap * getIClumpEnergies() const=0;
116  virtual const IEnergyMap * getIContactPebblePebbleEnergies() const=0;
117 
119  virtual void getClumpInBoxList(const DExtent &d,FArray<IClump *> *ret,bool intersect=true)=0;
120  virtual void getClumpInBoxList(const DExtent &d,FArray<const IClump *> *ret,bool intersect=true)=0;
121 
123  virtual void getPebbleInBoxList(const DExtent &d,FArray<IPebble *> *ret,bool intersect=true)=0;
124  virtual void getPebbleInBoxList(const DExtent &d,FArray<const IPebble *> *ret,bool intersect=true)=0;
125 
126  // Populates sets of property names based on their type including the relevant notices
127  virtual void populateAttributeSets(QStringList *scalarAtts,FArray<uint32> *scalarNotices,QStringList *stringAtts,FArray<uint32> *stringNotices,QStringList *vectorAtts,FArray<uint32> *vectorNotices)const=0;
129  virtual void populatePieceAttributeSets(QStringList *valueAtts,QStringList *labelAtts,QStringList *vectorAtts)const=0;
131  virtual void populatePropertySets(QStringList *scalarProps,QStringList *stringProps,QStringList *vectorProps)const=0;
132 
134  virtual prop_signal * getPropertySignal() const = 0;
135 
138  virtual IClumpTemplate * createFromClump(const IClump &c,const QString &name)=0;
139 
141  virtual void threadedCallbackObjectClump(Callback4<void,IClump *,uint32,uint32,void *> &callback,void *v=nullptr,bool useThreads=true) const=0;
142 
144  template <class S,void (S::*MFP)(IClump *,uint32,uint32,void *)>
145  void threadedCallbackMethodClump(S *s,void *v=nullptr,bool useThreads=true) const {
147  threadedCallbackObjectClump(callback,v,useThreads);
148  }
149 
151  virtual void threadedCallbackObjectPebble(Callback4<void,IPebble *,uint32,uint32,void *> &callback,void *v=nullptr,bool useThreads=true) const=0;
152 
154  template <class S,void (S::*MFP)(IPebble *,uint32,uint32,void *)>
155  void threadedCallbackMethodPebble(S *s,void *v=nullptr,bool useThreads=true) const {
157  threadedCallbackObjectPebble(callback,v,useThreads);
158  }
159 
160  };
161 } // namespace pfc
162 // 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 clump. This is the interface for a clump. A clump is a collection of pebbles that def...
Definition: iclump.h:37
Interface for a clump template. This is the interface for a clump template. A clump template is compo...
Definition: iclumptemplate.h:25
Definition: ighostpebble.h:16
Interface for the Clump module. This is the interface for the Clump module.
Definition: imoduleclump.h:36
void threadedCallbackMethodPebble(S *s, void *v=nullptr, bool useThreads=true) const
Implementation of the multithreaded loop using the threadedCallbackObjectPebble
Definition: imoduleclump.h:155
virtual prop_signal * getPropertySignal() const =0
Return the signal associated with the addition of a new property.
virtual void getClumpInBoxList(const DExtent &d, FArray< IClump * > *ret, bool intersect=true)=0
Return the clumps in a box.
virtual const IContainer * getIContainerClumpTemplate() const =0
const access to the ClumpTemplate container
virtual void populatePropertySets(QStringList *scalarProps, QStringList *stringProps, QStringList *vectorProps) const =0
Populates sets of property names based on their type.
virtual TType getClumpTemplateType() const =0
ClumpTemplate TType for type casting.
virtual uint32 getClumpPropertyNotice() const =0
Clump property notice unsigned integer.
virtual uint32 getClumpVelocityNotice() const =0
Clump velocity notice unsigned integer.
virtual TType getClumpType() const =0
Clump TType for type casting.
virtual uint32 getPebbleGroupNotice() const =0
Pebble group notice unsigned integer.
virtual void populatePieceAttributeSets(QStringList *valueAtts, QStringList *labelAtts, QStringList *vectorAtts) const =0
Populates sets of piece property names based on their type.
virtual void threadedCallbackObjectPebble(Callback4< void, IPebble *, uint32, uint32, void * > &callback, void *v=nullptr, bool useThreads=true) const =0
Object for creation of multithreaded loop over pebbles.
virtual uint32 getClumpCycleNotice() const =0
Clump cycle notice unsigned integer.
void threadedCallbackMethodClump(S *s, void *v=nullptr, bool useThreads=true) const
Implementation of the multithreaded loop using the threadedCallbackObjectClump
Definition: imoduleclump.h:145
virtual uint32 getClumpRotationNotice() const =0
Clump rotation notice unsigned integer.
virtual uint32 getClumpExtraNotice() const =0
Clump extra notice unsigned integer.
virtual uint32 getClumpGroupNotice() const =0
Clump group notice unsigned integer.
virtual uint32 getPebbleExtraNotice() const =0
Pebble extra velocity notice unsigned integer.
virtual void threadedCallbackObjectClump(Callback4< void, IClump *, uint32, uint32, void * > &callback, void *v=nullptr, bool useThreads=true) const =0
Object for creation of multithreaded loop over clumps.
virtual void getPebbleInBoxList(const DExtent &d, FArray< IPebble * > *ret, bool intersect=true)=0
Return the pebbles in a box.
virtual IContainer * getIContainerClump()=0
access to the Clump container
virtual IContainer * getIContainerClumpTemplate()=0
access to the ClumpTemplate container
virtual uint32 getClumpCleanNotice() const =0
Clump clean notice unsigned integer.
virtual uint32 getClumpGeometryNotice() const =0
Clump geometry notice unsigned integer.
virtual TType getGhostPebbleType() const =0
GhostPebble TType for type casting.
virtual const IContainer * getIContainerClump() const =0
const access to the Clump container
shared::Signal< const QString &, const QVariant & > prop_signal
Signal emitted when a property is created or modified.
Definition: imoduleclump.h:39
virtual TType getPebbleType() const =0
Pebble TType for type casting.
virtual IClumpTemplate * createFromClump(const IClump &c, const QString &name)=0
Definition: ipebble.h:25
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