Itasca C++ Interface
Loading...
Searching...
No Matches
ibodyblock.h
Go to the documentation of this file.
1#pragma once
2//ibodyblock
8#include "utility/interface/igroup.h"
9#include "base/src/farray.h"
10
11namespace itasca {
12 class IThing;
13}
14namespace itascaxd{
15 class IGeomPoly;
16 class IGeomEdge;
17 class IGeomPoint;
18}
19
20namespace body{
21using namespace itasca;
22using namespace itascaxd;
25
26 public:
28 enum blockType{Hexahedron=1, Tetrahedron, Wedge, Default};
31 WrongTopologyFaceAttachment=-7,
32 WrongNumberOfNodes,
33 IntersectWithOthers,
34 HasConcaveFaces,
35 SelfIntersections,
36 NegativeOrZeroVolume,
37 BadDegeneracy,
38 AFaceHasAttachedBlocksFromOneSide,
39 Contained, // the block is contained inside another block
40 ValidBlock,
41 ValidButNotAttached,
42 DefaultState
43 };
44
46 inline static const TType type_=0x53a34354;
48 virtual const IThing * getIThing() const=0;
50 virtual IThing * getIThing()=0;
52 virtual uint32 getSize() const=0;
54 virtual uint32 getSizeEdges() const=0;
56 virtual uint32 getSizePoints() const=0;
58 virtual IGeomPoly* getFace(uint32 index)=0;
60 virtual const IGeomPoly* getFace(uint32 index)const =0;
62 virtual const IGeomEdge * getEdge(const uint32 index) const=0;
64 virtual IGeomEdge * getEdge(uint32 index)=0;
66 virtual const IGeomPoint * getPoint(uint32 index) const=0;
68 virtual IGeomPoint * getPoint(uint32 index)=0;
70 virtual bool isValid() const=0;
72 virtual DVect getCentroid() const=0;
74 virtual double getArea() const=0;
76 virtual double getVolume(double tol=1.0e-9) const=0;
80 virtual QString getValidStateString()const=0;
82 virtual void getEdgesOrder(FArray<QPair<uint32,uint32>> &edgesOrder)const=0;
84 virtual void getFacesOrder( FArray< FArray<uint32> > &facesOrder)const=0;
88 virtual bool isIn(const DVect &v,const double &tolerance=1e-7) const=0;
90 virtual DVect getClosestPoint(const DVect &v) const=0;
92 virtual uint32 getMultiplier() const=0;
94 virtual void setMultiplier(uint32 m)=0;
96 virtual bool getGUIselect() const=0;
98 virtual void setGUIselect(bool flag) const=0;
100 virtual bool getOKdegeneracyFlag()const=0;
102 virtual void setOKdegeneracyFlag(bool OK)const=0;
105 virtual const IGeomPoly * getTheOpositeFace(const IGeomPoly *face) const=0;
106 };
107}
An array class that attempts to minimize unnecessary heap access.
Definition farray.h:25
Definition hexahedron.h:10
Interface to provide acces to BodyBlock.
Definition ibodyblock.h:24
virtual uint32 getSizePoints() const =0
Returns the number of points associated with this block. 8-for hexahedron, 6-wedge block,...
virtual double getArea() const =0
Returns the area of the block (sum of faces areas), assuming the block is valid.
virtual bool isValid() const =0
Checks the validity of the block - the block must form fully closed convex volume.
virtual uint32 getMultiplier() const =0
Return block multiplier, 1=default, 2,3,4...
virtual uint32 getSizeEdges() const =0
Returns the number of edges associated with this block. 12-for hexahedron, 9-wedge block,...
virtual IGeomPoly * getFace(uint32 index)=0
Returns the face at index index in the list of faces associated with the block. Will return 0 if inde...
virtual IThing * getIThing()=0
returns a IThing pointer
virtual IGeomEdge * getEdge(uint32 index)=0
Returns the edge at index index in the list of edges associated with the block. Will return 0 if inde...
virtual bool getGUIselect() const =0
return GUI specific select flag
virtual void getFacesOrder(FArray< FArray< uint32 > > &facesOrder) const =0
Place ino facesOrder array of array of point indicies, each of array of point indicies correspond to ...
virtual void setOKdegeneracyFlag(bool OK) const =0
sets "degenerecy OK flag" relevant for zoning wedges and tetrahedrons (for hexahedron is always true ...
virtual void setGUIselect(bool flag) const =0
set GUI specific select flag
virtual bool getOKdegeneracyFlag() const =0
return "degenerecy OK flag" relevant for zoning wedges and tetrahedrons (for hexahedron is always tru...
virtual IGeomPoint * getPoint(uint32 index)=0
Returns the point at index index in the list of edges associated with the block. Will return 0 if ind...
static const TType type_
The type identification number for this class, for use in convert_cast() and convert_getcast().
Definition ibodyblock.h:46
blockType
Type of block enumeration ({Hexahedron=1, Tetrahedron, Wedge, Default}). Default usually means Hexahe...
Definition ibodyblock.h:28
virtual blockValidState getValidState() const =0
Returns validState flag.
virtual uint32 getSize() const =0
Returns the number of faces associated with this block. 6-for hexahedron, 5-wedge block,...
virtual const IGeomPoint * getPoint(uint32 index) const =0
Returns the point at index index in the list of edges associated with the block. Will return 0 if ind...
virtual DVect getClosestPoint(const DVect &v) const =0
Returns the closest point to /a v.
virtual const IGeomPoly * getFace(uint32 index) const =0
Returns the face at index index in the list of faces associated with the block. Will return 0 if inde...
blockValidState
Type of valid state.
Definition ibodyblock.h:30
virtual const IGeomEdge * getEdge(const uint32 index) const =0
Returns the edge at index index in the list of edges associated with the block. Will return 0 if inde...
virtual bool isIn(const DVect &v, const double &tolerance=1e-7) const =0
virtual double getVolume(double tol=1.0e-9) const =0
Returns volume of the block: for hexahedron block with nonplanar faces uses exact formula from trilin...
virtual QString getValidStateString() const =0
Return validState string message.
virtual const IGeomPoly * getTheOpositeFace(const IGeomPoly *face) const =0
virtual const IThing * getIThing() const =0
returns a const IThing pointer
virtual DVect getCentroid() const =0
Returns the centroid, calculated as the average of the point positions.
virtual void setMultiplier(uint32 m)=0
Set block multiplier, 1=default, 2,3,4...
virtual void getEdgesOrder(FArray< QPair< uint32, uint32 > > &edgesOrder) const =0
Place into edgesOrder Array of pairs of point indicies, each of the pair correspondes to an edge betw...
Base class for items that will be stored in containers.
Definition ithing.h:30
Interface for a user-defined geometric edge, defined as the line between two IGeomPoint objects.
Definition igeomedge.h:24
Interface for a user-defined geometric point.
Definition igeompoint.h:18
A class representing a single closed polygon made up of a list of edges.
Definition igeompoly.h:23
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
namespace Itasca
Definition basememory.cpp:14
Itasca Library standard namespace, specific to 2D or 3D.
Definition icontactmodule.h:4