Itasca C++ Interface
Loading...
Searching...
No Matches
iextrudeset.h
Go to the documentation of this file.
1#pragma once
2
9#include "utility/interface/igroup.h"
10#include "base/src/farray.h"
11
12namespace itasca {
13 class IGroup;
14 class IThing;
15}
16namespace itascaxd {
17 class IGeomPoint;
18 class IRange;
19}
20
21namespace extruder {
22 using namespace itascaxd;
23
24 class IExtrudePoint;
25 class IExtrudeEdge;
26 class IExtrudeRegion;
27 class IExtrudePath;
28 struct MeshParameter;
29
33 public:
35 inline static const TType type_ = 0x4cb61c35;
36
37 shared::Signal<uint64> pointAdded;
38 shared::Signal<uint64> pointRemoved;
39 shared::Signal<uint64> edgeAdded;
40 shared::Signal<uint64> edgeRemoved;
41 shared::Signal<uint64> blockAdded;
42 shared::Signal<uint64> blockAddedLater;
43 shared::Signal<uint64> blockRemoved;
44 shared::Signal<uint64> pointMoved;
45 shared::Signal<uint64> edgeMoved;
46 shared::Signal<uint64> blockMoved;
47 shared::Signal<uint64> edgePointChanged;
48 shared::Signal<uint64> blockEdgeChanged;
49 shared::Signal<uint64> edgeTypeChanged;
50 shared::Signal<uint64, uint32> edgeControlPointAdded;// eid, index
51 shared::Signal<uint64, uint32> edgeSizeChanged;
52 shared::Signal<uint64, double> edgeRatioChanged; // id, ratio
53 shared::Signal<uint64, uint32> blockMultiplierChanged; // id, m
54 shared::Signal<uint64> blockOrientationChanged;
55 shared::Signal<> axesChanged;
56 shared::Signal<bool, int32, double, int32, int32> autoZoneChange; // on, mode, dx, n, t
57 shared::Signal<int32> metaAdded;
58 shared::Signal<int32> metaRemoved;
59 shared::Signal<int32> metaChanged;
60#ifdef THREED
61 shared::Signal<int32> segmentsChanged; // count
62 shared::Signal<int32, uint32> segmentSizeChanged; // index, size
63 shared::Signal<int32, double> segmentRatioChanged; // index, rat
64 shared::Signal<int32, double> segmentLengthChanged; // index, length
65 shared::Signal<double> segmentOriginChanged; // z0
66#endif
67
69 virtual IThing * getIThing()=0;
71 virtual const IThing * getIThing() const=0;
72
74 virtual IString getName() const=0;
75
77 virtual IExtrudePoint * createPoint(const DVect &pos)=0;
79 virtual IExtrudeEdge * createEdge(IExtrudePoint *end1,IExtrudePoint *end2,bool useDefaultSize, QString* str)=0;
81 //virtual IExtrudeRegion * createBlock()=0;
82
86 virtual const IContainer * getPointContainer() const=0;
88 virtual const IExtrudePoint *findPointWithID(uint64 id) const=0;
90 virtual IExtrudePoint * findPointWithID(uint64 id)=0;
92 virtual const IGeomPoint * findClosestPoint(const DVect &pos,const double &radius=limits<double>::max()) const=0;
94 virtual IGeomPoint * findClosestPoint(const DVect &pos,const double &radius=limits<double>::max())=0;
98 virtual const std::vector<std::vector<uint64>> findClosedPolygonAt(
99 const DVect& pos) const = 0;
101 virtual const std::vector<std::vector<uint64>> findMostExternalClosedRegion() const = 0;
103 //virtual IExtrudeRegion * findBlockByEdge(ExtrudeEdge* edge)=0;
104
108 virtual const IContainer * getEdgeContainer() const=0;
110 virtual const IExtrudeEdge * findEdgeWithID(uint64 id) const=0;
112 virtual IExtrudeEdge * findEdgeWithID(uint64 id)=0;
114 virtual const IExtrudeEdge * findClosestEdge(const DVect &pos,const double &radius=limits<double>::max()) const=0;
116 virtual IExtrudeEdge * findClosestEdge(const DVect &pos,const double &radius=limits<double>::max())=0;
118 virtual const IExtrudeEdge * findMatchingEdge(const IGeomPoint *end1,const IGeomPoint *end2) const=0;
120 virtual IExtrudeEdge * findMatchingEdge(const IGeomPoint *end1,const IGeomPoint *end2)=0;
122 virtual uint32 getEdgesByBreakAngle(uint32 edgeID, double breakAngle, bool nonIntersected, QList<uint32>* connectedEdges) const = 0;
124 virtual uint32 combineEdgesToSingleEdge(QList<uint32>* connectedEdges, QString *edgeWarning=nullptr) = 0;
126 virtual void deletePoint(IExtrudePoint *pointIn, uint32 *edgeCount=0, uint32 *blockCount=0)=0;
128 virtual void deleteEdge(IExtrudeEdge *edgeIn, uint32 *blockCount=0)=0;
130 virtual void deleteBlock(IExtrudeRegion *b) = 0;
132 virtual IExtrudeRegion * createBlockByPoints(IExtrudePoint* p0In, IExtrudePoint* p1In, IExtrudePoint* p2In, IExtrudePoint* p3In, uint32* newedgecount=0, bool ignoreerror=false) = 0;
134 virtual IExtrudeRegion * createBlockByPoints(QSet<uint64> inputPts,const MeshParameter* meshInfo =nullptr, QSet<QString> *errorsList = nullptr, QList<QString> *warningsList = nullptr, QList<QString> *infoList = nullptr) = 0;
136 virtual IExtrudeRegion * createBlockAt(DVect pos, QSet<QString> *errorsList = nullptr, QList<QString> *warningsList = nullptr, QList<QString> *infoList = nullptr) = 0;
138 virtual bool createBlocksAuto(IGroupID *group = nullptr, QSet<QString> *errorsList = nullptr, QList<QString> *warningsList = nullptr, QList<QString> *infoList = nullptr, const IRange *range = nullptr) = 0;
139
141 virtual int getPointSize() const =0;
143 virtual int getEdgeSize() const =0;
145 virtual int getBlockSize() const =0;
146
147 //metadata
150 virtual void clearMetaData()=0;
152 virtual void setMetaKeyValue(const QString &key, const QString &value)=0;
154 virtual int getMetaCount() const=0;
156 virtual QString getMetaKey(int index) const=0;
158 virtual QString getMetaValue(int index) const=0;
160 virtual int findMetaKeyIndex(const QString &key) const=0;
162 virtual QString findMetaKeyValue(const QString &key) const=0;
163
167 virtual const IContainer * getRegionsContainer() const=0;
169 virtual const IExtrudeRegion * findBlockWithID(uint64 id) const=0;
171 virtual IExtrudeRegion * findBlockWithID(uint64 id)=0;
173 virtual const IExtrudeRegion * findClosestBlock(const DVect &pos,const double &radius=limits<double>::max()) const=0;
175 virtual IExtrudeRegion * findClosestBlock(const DVect &pos,const double &radius=limits<double>::max())=0;
177 virtual void getRegionLocations(FArray<DVect> *ret,uint64 wr=0,int we=-1)=0;
178
180 virtual bool valid(QList<QString> *problems = nullptr, bool areaCheck = false) const=0;
181
183 //virtual bool testPPMerge(double atol) const=0;
185 //virtual bool testPEMerge(double atol) const=0;
187 //virtual bool testEEMerge(const IExtrudeEdge* e1 = nullptr, const double eetol = 0.05) const=0;
189 //virtual bool testBlockInvalid() const=0;
191 //virtual bool testAuto(const double eetol = 0.05) const=0;
192
194 virtual bool isAutoZone() const=0;
196 virtual double getAutoZoneEdge() const=0;
198 virtual int getAutoZoneDir() const=0;
200 virtual int getAutoZoneMode() const=0;
202 virtual int getAutoZoneSize() const=0;
204 virtual int getAutoZoneTotal() const=0;
206 virtual bool isAutoZoneTotalAllowed() const = 0;
208 virtual double computeZones2D() const=0;
209#ifdef THREED
211 virtual double computeTotalZones() const=0;
212#endif
214 //virtual void setAutoZone(bool x)=0; // AP: setting "AutoZone active on" is not compatible with irregular blocks - disabling this functionality for now
216 //virtual void setAutoZoneMode(int mode)=0;
218 //virtual void setAutoZoneDir(int dir)=0;
220 //virtual void setAutoZoneEdge(double x, Parse*)=0;
222 //virtual void setAutoZoneSize(int n, Parse*)=0;
224 //virtual void setAutoZoneTotal(int nz, Parse*)=0;
225
227 virtual const DVect &getOrigin() const=0;
229 virtual const Axes &getAxesInput() const=0;
231 virtual Axes getAxes() const=0;
233 virtual const DVect &getUAxis() const=0;
235 virtual const DVect &getVAxis() const=0;
236#ifdef THREED
238 virtual const IExtrudePath* getPath() const = 0;
240 virtual const DVect3 &getNAxis() const=0;
242 virtual double getSegmentZOrigin() const=0;
243
244 virtual void getOriginGroupList(FArray<IGroupID>*) const = 0;
245#endif
246
248 virtual void setOrigin(DVect c)=0;
249 // set one axis - compute 2
251 virtual void setUAxis(DVect u)=0;
253 virtual void setVAxis(DVect v)=0;
255 virtual void setUVAxes(DVect u,DVect v)=0;
257 virtual bool testAxesBasisNormal()=0;
259 virtual bool testAxesBasisOrthogonal()=0;
260#ifdef THREED
262 virtual void setNAxis(DVect n)=0;
263 // set two axes - compute 1
265 virtual void setUNAxes(DVect u,DVect n)=0;
267 virtual void setVNAxes(DVect v,DVect n)=0;
268
269#endif
270
272 virtual bool isAutoValidation() const=0;
274 virtual void setAutoValidation(bool x)=0;
276 virtual double getValidationTol() const=0;
278 virtual void setValidationTol(double x)=0;
280 virtual double computeValidationAbsTol() const=0;
282 virtual void setEdgeCombineTolerance(const double tol) = 0;
284 virtual double getEdgeCombineTolerance() const = 0;
285
286 // test zone quality
287
289 virtual bool countZoneQuality(int statecount[], bool areaCheck = false) const=0;
291 virtual bool anyZonesBad(bool areaCheck = false) const=0;
293 virtual QString getBadZonesReport() const=0;
295 virtual QString getZoneQualityReport(bool badonly=false) const=0;
297 virtual QString getZoneQualityReport(int statecount[]) const=0;
298
300 virtual uint32 getPointGroupNotice() const=0;
302 virtual uint32 getEdgeGroupNotice() const=0;
304 virtual uint32 getBlockGroupNotice() const=0;
306 virtual uint32 getTwoDGeomChangedNotice() const=0;
307#ifdef THREED
309 virtual uint32 getSegmentGroupNotice() const=0;
311 virtual uint32 getSegmentNodeGroupNotice() const=0;
313 virtual bool getPathModified() const = 0;
314#endif
316 virtual DExtent3 getExtent() const = 0;
318 virtual void getGroups(std::map<IString, IStringList>*) const = 0;
320 virtual void getAvailableSlots(IStringList*) const = 0;
321 };
322} // namespace f3
323// EoF
Class for specifying a particular 3D cartesian axes system, and converting to and from it.
Definition axes.h:121
An array class that attempts to minimize unnecessary heap access.
Definition farray.h:25
Definition istring.h:14
Definition istringlist.h:10
Definition idef.h:50
Interface for IExtrudeEdge objects.
Definition iextrudeedge.h:27
Provides interface to IExtrudePath. Contains containers for points, edges and blocks objects.
Definition iextrudepath.h:32
Interface for IExtrudePoint objects.
Definition iextrudepoint.h:20
Interface for IExtrudeEdge objects.
Definition iextruderegion.h:21
Provides interface to IExtrudeSet. Contains containers for points, edges and blocks objects.
Definition iextrudeset.h:32
virtual void getRegionLocations(FArray< DVect > *ret, uint64 wr=0, int we=-1)=0
Get the locations of all of the region nodes.
virtual const DVect & getVAxis() const =0
Return extrusion v-axis direction (unit length)
virtual void setAutoValidation(bool x)=0
Set auto-validation state, true means validation checks disable changes that created invalidate geome...
virtual IExtrudeRegion * createBlockAt(DVect pos, QSet< QString > *errorsList=nullptr, QList< QString > *warningsList=nullptr, QList< QString > *infoList=nullptr)=0
Create a new block at a given position.
virtual void setMetaKeyValue(const QString &key, const QString &value)=0
Add or change MetaData key and value.
virtual const IExtrudeEdge * findEdgeWithID(uint64 id) const =0
given an id, returns a const pointer to the edge object.
virtual uint32 getEdgesByBreakAngle(uint32 edgeID, double breakAngle, bool nonIntersected, QList< uint32 > *connectedEdges) const =0
given one edge, populate connectedEdges with ID's of edges which are connected to it and to one anoth...
virtual uint32 getTwoDGeomChangedNotice() const =0
Notice that 2D geometry has changed (points/edges/blocks moved or removed)
virtual const DVect & getOrigin() const =0
Set AutoZone flag state.
virtual void setEdgeCombineTolerance(const double tol)=0
Set tolerance for combining multiple edges to a single curved edge (affects amount of control points ...
virtual const IExtrudeEdge * findMatchingEdge(const IGeomPoint *end1, const IGeomPoint *end2) const =0
given the two vertices end1 and end2 of an edge, returns a pointer to the matching edge object.
virtual void clearMetaData()=0
virtual bool isAutoZoneTotalAllowed() const =0
check if AutoZone Total can be performed
virtual void getGroups(std::map< IString, IStringList > *) const =0
Gets all availables groups.
virtual IExtrudeEdge * findMatchingEdge(const IGeomPoint *end1, const IGeomPoint *end2)=0
given the two vertices end1 and end2 of an edge, returns a pointer to the matching edge object.
virtual IExtrudeEdge * findEdgeWithID(uint64 id)=0
given an id, returns a pointer to the edge object.
virtual void setVAxis(DVect v)=0
Set extrusion v-axis direction (unit length), adjust u-axis and normal.
virtual const IExtrudePoint * findPointWithID(uint64 id) const =0
given an id, returns a const pointer to the point object.
virtual bool countZoneQuality(int statecount[], bool areaCheck=false) const =0
Count number of problem zones, index 0=ok, 1,2=warnings, 3,4=bad. Return true if any bad.
virtual bool anyZonesBad(bool areaCheck=false) const =0
Return true if any bad zones.
virtual QString getMetaKey(int index) const =0
Given an index to MetaData vector, returns the MetaData key;.
virtual QString getMetaValue(int index) const =0
Given an index to MetaData vector, returns the MetaData value;.
virtual const IExtrudeRegion * findBlockWithID(uint64 id) const =0
given an id, returns a const pointer to the block object.
virtual uint32 getEdgeGroupNotice() const =0
Notice edge groups changed.
virtual void setUVAxes(DVect u, DVect v)=0
Set extrusion u,v axes, adjust v-axis, compute normal.
virtual double getAutoZoneEdge() const =0
Return AutoZone target average zone edge length.
virtual void deleteBlock(IExtrudeRegion *b)=0
Delete block from set.
virtual const IContainer * getRegionsContainer() const =0
returns a const pointer to the block container.
virtual uint32 getPointGroupNotice() const =0
Notice point groups changed.
virtual void deletePoint(IExtrudePoint *pointIn, uint32 *edgeCount=0, uint32 *blockCount=0)=0
Delete point from set.
virtual uint32 combineEdgesToSingleEdge(QList< uint32 > *connectedEdges, QString *edgeWarning=nullptr)=0
given list of edge IDs, combine them to single curved edge
virtual void getAvailableSlots(IStringList *) const =0
Gets all availables slots.
virtual IExtrudeEdge * createEdge(IExtrudePoint *end1, IExtrudePoint *end2, bool useDefaultSize, QString *str)=0
Adds a edge to the edge container and returns a pointer to the newly created object....
virtual QString getZoneQualityReport(int statecount[]) const =0
Convert countlists to string report.
virtual int getAutoZoneMode() const =0
Returns AutoZone modes: 0 for edge, 1 for size, 2 for zones.
virtual bool createBlocksAuto(IGroupID *group=nullptr, QSet< QString > *errorsList=nullptr, QList< QString > *warningsList=nullptr, QList< QString > *infoList=nullptr, const IRange *range=nullptr)=0
Automatically create new blocks in all suitable closed polygons presents in the set.
virtual const std::vector< std::vector< uint64 > > findMostExternalClosedRegion() const =0
Find most external closed region. Returns edges of the polygon.
virtual QString getBadZonesReport() const =0
Return descriptive string of warning and bad zone counts.
virtual IContainer * getRegionsContainer()=0
returns a pointer to the block container.
virtual void setUAxis(DVect u)=0
Set extrusion u-axis direction (unit length), adjust v-axis and normal.
virtual bool testAxesBasisOrthogonal()=0
Return true if u,v (and n in 3D) axes are orthogonal.
virtual double getEdgeCombineTolerance() const =0
Return tolerance for combining multiple edges.
virtual void setOrigin(DVect c)=0
Set extrusion origin.
virtual double computeZones2D() const =0
Return number of 2d zones in xy plane.
virtual IString getName() const =0
returns the set name
virtual const QList< QList< const IExtrudePoint * > > findPotentialPolygonAt(DVect pos) const =0
Test if a potential closed polygon exists at pos. Returns vertices of the polygon.
virtual Axes getAxes() const =0
Return internal Axes (modified for orthogonality and unit lengths)
virtual IExtrudePoint * createPoint(const DVect &pos)=0
Adds a point to the point container and returns a pointer to the newly created object....
virtual int getAutoZoneDir() const =0
Return AutoZone direction: 0=all, 1=x,y only, 2=normal only.
virtual int getPointSize() const =0
returns number of points.
virtual uint32 getBlockGroupNotice() const =0
Notice block groups changed.
virtual double computeValidationAbsTol() const =0
Compute absolute tolerance used in validation.
static const TType type_
The type identification number for this class, for use in convert_cast() and convert_getcast().
Definition iextrudeset.h:35
virtual int getBlockSize() const =0
returns number of blocks.
virtual const std::vector< std::vector< uint64 > > findClosedPolygonAt(const DVect &pos) const =0
Find a potential closed polygon. Returns edges of the polygon.
virtual QString findMetaKeyValue(const QString &key) const =0
Given an key, searchs the MedaData vector and returns the corresponding MetaData value;.
virtual const DVect & getUAxis() const =0
Return extrusion u-axis direction (unit length)
virtual IContainer * getEdgeContainer()=0
Test if a (quad) block exists with 2 points on a diagonal.
virtual IExtrudePoint * findPointWithID(uint64 id)=0
given an id, returns a pointer to the point object.
virtual int getAutoZoneTotal() const =0
Return AutoZone target (maximum) total number of zones.
virtual const IGeomPoint * findClosestPoint(const DVect &pos, const double &radius=limits< double >::max()) const =0
given a position pos in space, returns a const pointer to the closest point object within a given rad...
virtual int findMetaKeyIndex(const QString &key) const =0
Given an key, returns the corresponding index of the MetaData vector;.
virtual bool isAutoZone() const =0
Return true if any point-point are too close, by distance atol.
virtual QString getZoneQualityReport(bool badonly=false) const =0
Return descriptive string of bad zone counts.
virtual const IExtrudeRegion * findClosestBlock(const DVect &pos, const double &radius=limits< double >::max()) const =0
given a position pos in space, returns a const pointer to the closest block object within a given rad...
virtual IThing * getIThing()=0
returns its IThing pointer
virtual const IThing * getIThing() const =0
returns its const IThing pointer
virtual int getEdgeSize() const =0
returns number of edges.
virtual IExtrudeEdge * findClosestEdge(const DVect &pos, const double &radius=limits< double >::max())=0
given a position pos in space, returns a pointer to the closest edge object within a given radius.
virtual bool valid(QList< QString > *problems=nullptr, bool areaCheck=false) const =0
Return true if basic block geometry is good.
virtual const IContainer * getEdgeContainer() const =0
returns a const pointer to the edge container container.
virtual int getAutoZoneSize() const =0
Return AutoZone size (number of zones across largest dimension of x,y)
virtual double getValidationTol() const =0
Return relative tolerance used in auto-validation.
virtual IGeomPoint * findClosestPoint(const DVect &pos, const double &radius=limits< double >::max())=0
given a position pos in space, returns a pointer to the closest point object within a given radius.
virtual int getMetaCount() const =0
Returns the number of MetaData objects in the Metadata vector.
virtual void deleteEdge(IExtrudeEdge *edgeIn, uint32 *blockCount=0)=0
Delete edge from set.
virtual const IExtrudeEdge * findClosestEdge(const DVect &pos, const double &radius=limits< double >::max()) const =0
given a position pos in space, returns a const pointer to the closest edge object within a given radi...
virtual const IContainer * getPointContainer() const =0
returns a const pointer to the point container.
virtual DExtent3 getExtent() const =0
Get Extension.
virtual IContainer * getPointContainer()=0
Adds a block to the block container and returns a pointer to the newly created object.
virtual IExtrudeRegion * createBlockByPoints(QSet< uint64 > inputPts, const MeshParameter *meshInfo=nullptr, QSet< QString > *errorsList=nullptr, QList< QString > *warningsList=nullptr, QList< QString > *infoList=nullptr)=0
Create a new block by given set of points (point IDs)
virtual bool isAutoValidation() const =0
Return auto-validation state, true means validation checks disable changes that created invalidate ge...
virtual IExtrudeRegion * findClosestBlock(const DVect &pos, const double &radius=limits< double >::max())=0
given a position pos in space, returns a pointer to the closest block object within a given radius.
virtual IExtrudeRegion * findBlockWithID(uint64 id)=0
given an id, returns a pointer to the block object.
virtual const Axes & getAxesInput() const =0
Return input (raw) Axes.
virtual void setValidationTol(double x)=0
Set relative tolerance used in auto-validation.
virtual IExtrudeRegion * createBlockByPoints(IExtrudePoint *p0In, IExtrudePoint *p1In, IExtrudePoint *p2In, IExtrudePoint *p3In, uint32 *newedgecount=0, bool ignoreerror=false)=0
Create a new regular block by 3 or 4 points.
virtual bool testAxesBasisNormal()=0
Return true if u,v (and n in 3D) axes are unit length.
Interface for containers of IThings.
Definition icontainer.h:21
Definition igroup.h:82
Base class for items that will be stored in containers.
Definition ithing.h:30
Interface for a user-defined geometric point.
Definition igeompoint.h:18
Interface to a filter, used as the main method for filtering objects.
Definition irange.h:32
debug checked shorthand for std::numeric_limits<T>::
Definition limit.h:25
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
Interface for container of IThings.
namespace Itasca
Definition basememory.cpp:14
Itasca Library standard namespace, specific to 2D or 3D.
Definition icontactmodule.h:4