Itasca C++ Interface
Loading...
Searching...
No Matches
ifwall.h
Go to the documentation of this file.
1#pragma once
7#include "base/src/farray.h"
8
9namespace itasca {
10 class IThing;
11 class IGroup;
12 class IContainer;
13}
14
15namespace itascaxd {
16 class IPiece;
17 class IPieceMechanical;
18 class IBody;
19 class IContact;
20 class IHalfFacet;
21 class IHalfVertex;
22}
23
24namespace pfc {
25 using namespace itasca;
26 using namespace itascaxd;
27
45 class IFWall {
46 public:
48 inline static const TType type_ = 0x4c90658e;
50 virtual IThing * getIThing()=0;
52 virtual const IThing * getIThing() const=0;
54 virtual IBody * getIBody() = 0;
56 virtual const IBody * getIBody() const = 0;
58 virtual IString getName() const=0;
60 virtual IFWall * getNextIFWall()=0;
62 virtual const IFWall * getNextIFWall() const=0;
66 virtual const IHalfFacet *getFirstIHalfFacet() const=0;
68 virtual DExtent3 getExtent() const=0;
70 virtual double getCutoffAng() const=0;
72 virtual void setCutoffAng(const double &d) =0;
76 virtual const IContainer *getFWallAsFacetContainer() const=0;
80 virtual const IContainer *getFWallAsVertexContainer() const=0;
81
82
84 virtual int getNumberFacets() const=0;
86 virtual void getFacetList(FArray<IHalfFacet *> *ret)=0;
88 virtual void getFacetList(FArray<const IHalfFacet *> *ret) const=0;
90 virtual const IHalfFacet * findFacetWithID(uint64 id) const=0;
92 virtual IHalfFacet * findFacetWithID(uint64 id) =0;
94 virtual const IHalfFacet * findClosestFacet(const DVect &pos,const double &radius = limits<double>::max()) const=0;
96 virtual IHalfFacet * findClosestFacet(const DVect &pos,const double &radius = limits<double>::max())=0;
98 virtual void removeIHalfFacet(IHalfFacet *fac) =0;
100 virtual IHalfFacet * addFacetFromVertices(DVect verts[dim],QString &error,uint64 id=0,bool ignoreEnd=false,bool allowStar=false)=0;
102 virtual void doValidate() = 0;
103
107 virtual void getVertexList(FArray<const IHalfVertex *> *ret) const=0;
109 virtual const IHalfVertex * findVertexWithID(uint64 id) const=0;
111 virtual IHalfVertex * findVertexWithID(uint64 id) =0;
113 virtual const IHalfVertex * findClosestVertex(const DVect &pos,const double &radius = limits<double>::max()) const=0;
115 virtual IHalfVertex * findClosestVertex(const DVect &pos,const double &radius = limits<double>::max())=0;
116
118 virtual DVect getPosition() const = 0;
120 virtual DVect getCentRot() const = 0;
122 virtual DVect getVelocity() const = 0;
124 virtual DAVect getAngVelocity() const = 0;
126 virtual DVect getDisplacement() const = 0;
127#ifdef TWOD
129 virtual double getAngDisplacement() const = 0;
130#endif
132 virtual DVect getForce() const = 0;
133 virtual DVect getContactForce() const = 0;
135 virtual DAVect getMoment() const = 0;
136 virtual DAVect getContactMoment() const = 0;
138 virtual Quat getOrient() const=0;
140 virtual bool getIsClosed() const=0;
142 virtual bool getIsIn(const DVect &d) const=0;
144 virtual bool getIsConvex() const=0;
145
147 virtual void setPosition(const DVect &p) = 0;
149 virtual void setCentRot(const DVect &p) = 0;
151 virtual void setVelocity(const DVect &p) = 0;
153 virtual void setAngVelocity(const DAVect &p) = 0;
155 virtual void setDisplacement(const DVect &v) = 0;
156#ifdef TWOD
158 virtual void setAngDisplacement(const double &v) = 0;
159#endif
161 virtual void setContactForce(const DVect &v)=0;
163 virtual void setContactMoment(const DAVect &v)=0;
165 virtual void setOrient(const Quat &q)=0;
166#ifdef THREED
168 virtual DVect getEulerFromOrient() const=0;
170 virtual void setOrientFromEuler(const DVect3 &d)=0;
171#endif
173 virtual bool setProperty(const QString &name,const QVariant &v)=0;
174
177 virtual void rotate(const DVect &rotp,const DVect &axis,const double &w,bool update=true,bool noThrow = false) = 0;
178
179
181 virtual bool getVertsHaveVel() const = 0;
183 virtual void updateFWallPosition(IHalfVertex *v=0,DVect *prevPos=0)=0;
184
186 virtual int getFragmentIndex() const=0;
188 virtual void setFragmentIndex(int ind)=0;
190 virtual void getContactList(FArray<IContact *> *ret,const TType &type=0,const IPiece *p2=0)=0;
192 virtual void getContactList(FArray<const IContact *> *ret,const TType &type=0,const IPiece *p2=0) const=0;
193
195 virtual double getServoGainFactor() const =0;
197 virtual double getServoGain() const =0;
199 virtual double getServoVmax() const =0;
201 virtual DVect getServoForce() const =0;
203 virtual bool getServoActive() const =0;
205 virtual int getServoGainUpdate() const =0;
207 virtual void setServoGainFactor(const double &d) =0;
209 virtual void setServoGain(const double &d) =0;
211 virtual void setServoVmax(const double &d) =0;
213 virtual void setServoForce(const DVect &f) =0;
215 virtual void setServoActive(bool b) =0;
217 virtual void setServoGainUpdate(int i) =0;
218 };
219} // namespace pfc
220// EoF
221
An array class that attempts to minimize unnecessary heap access.
Definition farray.h:25
Definition istring.h:14
3D quaternion utility class.
Definition quat.h:108
Interface for containers of IThings.
Definition icontainer.h:21
Base class for items that will be stored in containers.
Definition ithing.h:30
Definition ibody.h:20
Interface for a facet used in the faceted wall logic. This is the interface for a triangular facet as...
Definition ihalffacet.h:37
Interface for a vertex used in the faceted wall logic. This is the interface for a vertex used in the...
Definition ihalfvertex.h:27
Definition ipiece.h:15
debug checked shorthand for std::numeric_limits<T>::
Definition limit.h:25
Interface for a faceted wall.
Definition ifwall.h:45
virtual void updateFWallPosition(IHalfVertex *v=0, DVect *prevPos=0)=0
Update the position of the wall centroid.
virtual DVect getVelocity() const =0
Return the translational velocity of the wall.
virtual const IHalfVertex * findClosestVertex(const DVect &pos, const double &radius=limits< double >::max()) const =0
Find the IHalfVertex closest to pos.
virtual void setDisplacement(const DVect &v)=0
Set the wall accumulated displacement to v.
virtual void setPosition(const DVect &p)=0
Set the wall position to p.
virtual void setOrient(const Quat &q)=0
Set the orientation.
virtual void doValidate()=0
Cause a validate, updating convexity.
virtual void rotate(const DVect &rotp, const DVect &axis, const double &w, bool update=true, bool noThrow=false)=0
virtual int getNumberFacets() const =0
Return the number of IHalfFacets.
virtual void setServoGain(const double &d)=0
Set servo gain.
virtual void getVertexList(FArray< IHalfVertex * > *ret)=0
Return a list of IHalfVertex objects.
virtual DVect getCentRot() const =0
Return the center of rotation - the point about which the wall can rotate.
virtual int getFragmentIndex() const =0
Return the wall fragment index.
virtual void getFacetList(FArray< const IHalfFacet * > *ret) const =0
Return a list of const IHalfFacets.
virtual bool setProperty(const QString &name, const QVariant &v)=0
Set the properties in prop to v for all PieceMechanicals that are in this wall.
virtual double getCutoffAng() const =0
Get the user defined cutoff angle for contact resolution - in radians.
virtual void getFacetList(FArray< IHalfFacet * > *ret)=0
Return a list of IHalfFacets.
virtual void setFragmentIndex(int ind)=0
Set the wall fragment index.
virtual IBody * getIBody()=0
Return an IBody pointer.
virtual double getServoGainFactor() const =0
Get wall servo gain relaxation factor.
virtual double getServoGain() const =0
Get wall servo gain.
virtual IContainer * getFWallAsVertexContainer()=0
Return the IContainer of vertices associated with a wall.
virtual IThing * getIThing()=0
Return an IThing interface for this object.
virtual DExtent3 getExtent() const =0
Return the DExtent3 extent of the faceted wall.
virtual IHalfFacet * findFacetWithID(uint64 id)=0
Find the IHalfFacet with ID id.
virtual void setVelocity(const DVect &p)=0
Set the wall translational velocity to p.
virtual IContainer * getFWallAsFacetContainer()=0
Return the IContainer of facets associated with a wall.
virtual const IContainer * getFWallAsVertexContainer() const =0
Return the IContainer of vertices associated with a wall.
virtual void getContactList(FArray< IContact * > *ret, const TType &type=0, const IPiece *p2=0)=0
Return a list of IContacts.
virtual const IFWall * getNextIFWall() const =0
Return the next IFWall object in the global list, or 0 if it is the last set.
virtual void setServoVmax(const double &d)=0
Set servo cap velocity.
virtual DAVect getAngVelocity() const =0
Return the angular velocity of the wall.
virtual IHalfFacet * findClosestFacet(const DVect &pos, const double &radius=limits< double >::max())=0
Find the const IHalfFacet closest to pos.
virtual void setServoGainUpdate(int i)=0
Set servo gain update interval.
virtual IHalfVertex * findClosestVertex(const DVect &pos, const double &radius=limits< double >::max())=0
Find the const IHalfFacet closest to pos.
virtual DVect getDisplacement() const =0
Return the accumulated displacement of the point corresponding to position.
virtual void getContactList(FArray< const IContact * > *ret, const TType &type=0, const IPiece *p2=0) const =0
Return a list of const IContacts.
virtual void setServoGainFactor(const double &d)=0
Set servo gain relaxation factor.
virtual IHalfVertex * findVertexWithID(uint64 id)=0
Find the IHalfVertex with ID id.
virtual DVect getPosition() const =0
Return the wall position. This is implementation dependent.
virtual bool getIsClosed() const =0
Return a boolean indicating whether or not this is a closed wall.
virtual const IHalfFacet * findFacetWithID(uint64 id) const =0
Find the const IHalfFacet with ID id;.
virtual IHalfFacet * addFacetFromVertices(DVect verts[dim], QString &error, uint64 id=0, bool ignoreEnd=false, bool allowStar=false)=0
Add a facet from vertices.
virtual int getServoGainUpdate() const =0
Get wall servo gain update interval.
virtual const IBody * getIBody() const =0
Return a const IBody pointer.
virtual bool getVertsHaveVel() const =0
Get the boolean indicating whether or not the vertices have velocities.
virtual void setAngVelocity(const DAVect &p)=0
Set the wall angular velocity to p.
virtual DVect getForce() const =0
Return the sum of all contact forces to which the wall does not react.
virtual IHalfFacet * getFirstIHalfFacet()=0
Return the first IHalfFacet associated with this FWall.
virtual DVect getServoForce() const =0
Get wall servo force.
virtual void getVertexList(FArray< const IHalfVertex * > *ret) const =0
Return a list of const IHalfVertex object.
virtual bool getIsConvex() const =0
Retuen boolean indicating convex. Returns false if not closed.
virtual void setContactMoment(const DAVect &v)=0
Set the contact moment.
virtual Quat getOrient() const =0
Return the current orientation.
virtual IString getName() const =0
Return the QString name.
virtual void setContactForce(const DVect &v)=0
Set the contact force.
virtual const IHalfFacet * findClosestFacet(const DVect &pos, const double &radius=limits< double >::max()) const =0
Find the IHalfFacet closest to pos.
virtual DAVect getMoment() const =0
Return the moment of all contacts with with wall.
virtual const IContainer * getFWallAsFacetContainer() const =0
Return the IContainer of facets associated with a wall.
virtual const IHalfVertex * findVertexWithID(uint64 id) const =0
Find the const IHalfVertex with ID id;.
virtual bool getServoActive() const =0
Get wall servo activity status.
virtual void setCentRot(const DVect &p)=0
Set the wall center of rotation to p.
virtual bool getIsIn(const DVect &d) const =0
Return a bool indicating whether or not a point is inside a wall. If not closed then returns false.
virtual void setServoActive(bool b)=0
Set servo active status.
virtual const IHalfFacet * getFirstIHalfFacet() const =0
Return the const first IHalfFacet associated with this FWall.
virtual const IThing * getIThing() const =0
Return a const IThing interface for this object.
virtual void removeIHalfFacet(IHalfFacet *fac)=0
Remove the IHalfFacet from the FWall.
virtual IFWall * getNextIFWall()=0
Return the next IFWall object in the global list, or 0 if it is the last set.
virtual double getServoVmax() const =0
Get wall servo cap velocity.
virtual void setCutoffAng(const double &d)=0
Set the user defined cutoff angle for contact resolution - provided in radians.
static const TType type_
TType for type casting.
Definition ifwall.h:48
virtual void setServoForce(const DVect &f)=0
Set servo force.
An array class that attempts to minimize unnecessary heap access.
uint32 TType
class type indicator
Definition basedef.h:46
DVect3 DVect
Vector of doubles, either 2D or 3D.
Definition dim.h:154
DAVect3 DAVect
Angular vector of doubles, either 2D or 3D.
Definition dim.h:162
namespace Itasca
Definition basememory.cpp:14
Itasca Library standard namespace, specific to 2D or 3D.
Definition icontactmodule.h:4
PFC namespace.
Definition iballfluid.h:15