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#include "baseqt/src/baseqt.h"
11
12namespace itasca {
13 class IThing;
14}
15namespace itascaxd{
16 class IGeomPoly;
17 class IGeomEdge;
18 class IGeomPoint;
19}
20
21namespace body{
22using namespace itasca;
23using namespace itascaxd;
26
27 public:
29 enum blockType{Hexahedron=1, Tetrahedron, Wedge, Default};
32 WrongTopologyFaceAttachment=-7,
33 WrongNumberOfNodes,
34 IntersectWithOthers,
35 HasConcaveFaces,
36 SelfIntersections,
37 NegativeOrZeroVolume,
38 BadDegeneracy,
39 AFaceHasAttachedBlocksFromOneSide,
40 Contained, // the block is contained inside another block
41 ValidBlock,
42 ValidButNotAttached,
43 DefaultState
44 };
45
47 inline static const TType type_=0x53a34354;
49 virtual const IThing * getIThing() const=0;
51 virtual IThing * getIThing()=0;
53 virtual uint32 getSize() const=0;
55 virtual uint32 getSizeEdges() const=0;
57 virtual uint32 getSizePoints() const=0;
59 virtual IGeomPoly* getFace(uint32 index)=0;
61 virtual const IGeomPoly* getFace(uint32 index)const =0;
63 virtual const IGeomEdge * getEdge(const uint32 index) const=0;
65 virtual IGeomEdge * getEdge(uint32 index)=0;
67 virtual const IGeomPoint * getPoint(uint32 index) const=0;
69 virtual IGeomPoint * getPoint(uint32 index)=0;
71 virtual bool isValid() const=0;
73 virtual DVect getCentroid() const=0;
75 virtual double getArea() const=0;
77 virtual double getVolume(double tol=1.0e-9) const=0;
81 virtual QString getValidStateString()const=0;
83 virtual void getEdgesOrder(FArray<QPair<uint32,uint32>> &edgesOrder)const=0;
85 virtual void getFacesOrder( FArray< FArray<uint32> > &facesOrder)const=0;
89 virtual bool isIn(const DVect &v,const double &tolerance=1e-7) const=0;
91 virtual DVect getClosestPoint(const DVect &v) const=0;
93 virtual uint32 getMultiplier() const=0;
95 virtual void setMultiplier(uint32 m)=0;
97 virtual bool getGUIselect() const=0;
99 virtual void setGUIselect(bool flag) const=0;
101 virtual bool getOKdegeneracyFlag()const=0;
103 virtual void setOKdegeneracyFlag(bool OK)const=0;
106 virtual const IGeomPoly * getTheOpositeFace(const IGeomPoly *face) const=0;
107 };
108}
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:25
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:47
blockType
Type of block enumeration ({Hexahedron=1, Tetrahedron, Wedge, Default}). Default usually means Hexahe...
Definition ibodyblock.h:29
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:31
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:31
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:47
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:6