Itasca C++ Interface
irblockmodule.h
1 #pragma once
2 #include "base/src/farray.h"
3 #include "shared/interface/signal.h"
4 #include "base/src/callback.h"
5 
6 namespace itasca {
7  class IContainer;
8  class IEnergyMap;
9 }
10 
11 namespace itascaxd {
12  class IContact;
13  class ICellSpace;
14  class IContainerContact;
15 }
16 
17 namespace rblock {
18  using namespace itasca;
19  using namespace itascaxd;
20 
21  class IRBlock;
22  class IGhostRBlock;
23  class IRBlockTemplate;
24 
25  class IRBlockModule {
26  public:
28  using prop_signal = shared::Signal<const QString &,const QVariant &>;
29 
31  virtual TType getRBlockType() const=0;
33  virtual TType getRBlockTemplateType() const=0;
35  virtual TType getGhostRBlockType() const=0;
37  virtual uint getRBlockGeometryNotice() const=0;
39  virtual uint getRBlockHideNotice() const=0;
41  virtual uint getRBlockSelectNotice() const=0;
43  virtual uint getRBlockCycleNotice() const=0;
45  virtual uint getRBlockFixNotice() const=0;
47  virtual uint getRBlockPropertyNotice() const=0;
49  virtual uint getRBlockExtraNotice() const=0;
51  virtual uint getRBlockGroupNotice() const=0;
53  virtual const IContainer * getIContainerRBlock() const=0;
57  virtual const IContainer * getIContainerRBlockTemplate() const=0;
61  virtual const IContainer * getIContainerGhostRBlock() const=0;
65  virtual const IContainerContact * getIContainerRBlockRBlock() const=0;
68 
70  virtual const ICellSpace * getRBlockCellSpace() const=0;
74  virtual const IRBlock * findIRBlockWithID(quint64 id) const=0;
76  virtual IRBlock * findIRBlockWithID(quint64 id) =0;
78  virtual const IRBlockTemplate * findIRBlockTemplateWithID(quint64 id) const=0;
80  virtual IRBlockTemplate * findIRBlockTemplateWithID(quint64 id) =0;
82  virtual const IRBlockTemplate * findIRBlockTemplateWithName(const QString &s) const=0;
84  virtual IRBlockTemplate * findIRBlockTemplateWithName(const QString &s) =0;
86  virtual const IGhostRBlock * findIGhostRBlockWithID(quint64 id) const=0;
88  virtual IGhostRBlock * findIGhostRBlockWithID(quint64 id) =0;
90  virtual const IRBlock * findIRBlockClosestTo(const DVect &v,const double &radius=limits<double>::max()) const=0;
92  virtual IRBlock * findIRBlockClosestTo(const DVect &v,const double &radius=limits<double>::max())=0;
94  virtual const IRBlock * findIRBlockContaining(const DVect &v,QSet<quint64> *skip=nullptr) const=0;
96  virtual IRBlock * findIRBlockContaining(const DVect &v,QSet<quint64> *skip=nullptr)=0;
98  virtual bool collide(IRBlock *rb1, IRBlock *rb2) const = 0;
99 
101  virtual const IEnergyMap * getIRBlockEnergies() const=0;
102 
103  virtual int claimBit()=0;
104  virtual void releaseBit(int bit)=0;
105 
107  virtual void getIRBlocksInBoxList(const DExtent &d,FArray<IRBlock *> *ret,bool intersect=true)=0;
108  virtual void getIRBlocksInBoxList(const DExtent &d,FArray<const IRBlock *> *ret,bool intersect=true)=0;
109 
111  virtual void populateAttributeSets(QStringList *scalarAtts,FArray<uint> *scalarNotices,QStringList *stringAtts,FArray<uint> *stringNotices,QStringList *vectorAtts,FArray<uint> *vectorNotices) const=0;
113  virtual void populatePropertySets(QStringList *valueProps,QStringList *labelProps,QStringList *vectorProps)const=0;
115  virtual prop_signal * getPropertySignal() const = 0;
116 
118  virtual void threadedCallbackObject(Callback4<void,IRBlock *,quint32,quint32,void *> &callback,void *v=nullptr,bool useThreads=true) const=0;
119 
121  template <class S,void (S::*MFP)(IRBlock *,quint32,quint32,void *)>
122  void threadedCallbackMethod(S *s,void *v=nullptr,bool useThreads=true) const {
124  threadedCallbackObject(callback,v,useThreads);
125  }
126  };
127 } // namespace rblock
128 // 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
Definition: ighostrblock.h:16
Definition: irblock.h:25
Definition: irblockmodule.h:25
virtual IContainer * getIContainerRBlock()=0
Return the IContainer of the RBlocks.
virtual void getIRBlocksInBoxList(const DExtent &d, FArray< IRBlock * > *ret, bool intersect=true)=0
Return the RBlocks in a box.
virtual uint getRBlockSelectNotice() const =0
Return the RBlock select notice.
virtual void populateAttributeSets(QStringList *scalarAtts, FArray< uint > *scalarNotices, QStringList *stringAtts, FArray< uint > *stringNotices, QStringList *vectorAtts, FArray< uint > *vectorNotices) const =0
Populates sets of property names based on their type.
virtual IRBlock * findIRBlockContaining(const DVect &v, QSet< quint64 > *skip=nullptr)=0
Find the RBlock containing to v.
virtual IContainerContact * getIContainerRBlockRBlock()=0
Return the IContainerContact of RBlock-RBlock contacts.
virtual prop_signal * getPropertySignal() const =0
Return the signal associated with the addition of a new property.
virtual const IRBlock * findIRBlockContaining(const DVect &v, QSet< quint64 > *skip=nullptr) const =0
Find the const RBlock containing to v.
virtual IRBlockTemplate * findIRBlockTemplateWithName(const QString &s)=0
Find the IRBlock with name s that is a template.
virtual uint getRBlockExtraNotice() const =0
Return the RBlock extra notice.
virtual const IRBlock * findIRBlockClosestTo(const DVect &v, const double &radius=limits< double >::max()) const =0
Find the const RBlock closest to v.
virtual uint getRBlockCycleNotice() const =0
Return the RBlock cycle notice.
virtual const IRBlock * findIRBlockWithID(quint64 id) const =0
Find the const IRBlock with ID id;.
virtual const IContainer * getIContainerRBlock() const =0
Return the const IContainer of the RBlocks.
virtual const IContainer * getIContainerGhostRBlock() const =0
Return the const IContainer of the Ghost RBlocks.
virtual const ICellSpace * getRBlockCellSpace() const =0
Return a const ICellSpace pointer to the RBlock cell space.
virtual const IContainerContact * getIContainerRBlockRBlock() const =0
Return the IContainerContact of RBlock-RBlock contacts.
virtual ICellSpace * getRBlockCellSpace()=0
Return an ICellSpace pointer to the RBlock cell space.
virtual const IGhostRBlock * findIGhostRBlockWithID(quint64 id) const =0
Find the const IGhostRBlock with ID id;.
virtual IRBlock * findIRBlockWithID(quint64 id)=0
Find the IRBlock with ID id.
virtual uint getRBlockHideNotice() const =0
Return the RBlock hide notice.
virtual bool collide(IRBlock *rb1, IRBlock *rb2) const =0
Returns a boolean indicating whether a two rigid blocks intersect.
virtual const IEnergyMap * getIRBlockEnergies() const =0
Return the EnergyMap attached to the rblocks.
virtual IContainer * getIContainerGhostRBlock()=0
Return the IContainer of the Ghost RBlocks.
virtual uint getRBlockGroupNotice() const =0
Return the RBlock group notice.
virtual const IContainer * getIContainerRBlockTemplate() const =0
Return the const IContainer of the RBlock templates.
virtual IContainer * getIContainerRBlockTemplate()=0
Return the IContainer of the RBlock templates.
virtual const IRBlockTemplate * findIRBlockTemplateWithID(quint64 id) const =0
Find the const IRBlock with ID id that is a template;.
virtual uint getRBlockPropertyNotice() const =0
Return the RBlock property notice.
virtual TType getRBlockTemplateType() const =0
Get the RBlock template TType.
shared::Signal< const QString &, const QVariant & > prop_signal
Typedef for the small granularity signal used to indicate to the gui that a propery has been added.
Definition: irblockmodule.h:28
virtual IRBlock * findIRBlockClosestTo(const DVect &v, const double &radius=limits< double >::max())=0
Find the RBlock closest to v.
virtual TType getRBlockType() const =0
Return the RBlock TType.
virtual uint getRBlockGeometryNotice() const =0
Return the RBlock geometry notice.
virtual IGhostRBlock * findIGhostRBlockWithID(quint64 id)=0
Find the IGhostRBlock with ID id.
virtual uint getRBlockFixNotice() const =0
Return the RBlock fixity notice.
virtual const IRBlockTemplate * findIRBlockTemplateWithName(const QString &s) const =0
Find the const IRBlock with name s that is a template;.
virtual void populatePropertySets(QStringList *valueProps, QStringList *labelProps, QStringList *vectorProps) const =0
Populates sets of property names based on their type.
virtual IRBlockTemplate * findIRBlockTemplateWithID(quint64 id)=0
Find the IRBlock with ID id that is a template.
virtual TType getGhostRBlockType() const =0
Get the GhostRBlock TType.
void threadedCallbackMethod(S *s, void *v=nullptr, bool useThreads=true) const
Implementation of the multithreaded loop using the threadedCallbackObjectRBlock
Definition: irblockmodule.h:122
Definition: irblocktemplate.h:11
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