![]() |
Workspace 6.21.5
|
Defines a union of an arbitrary number of regions. More...
#include <Mesh/Geometry/regionunion.h>
Public Member Functions | |
RegionUnion () | |
RegionUnion (const RegionUnion &r) | |
~RegionUnion () override | |
void | addRegion (const Region ®ion) |
void | clear () |
virtual RegionUnion * | clone () const |
RegionUnion * | cloneRegion () const override |
bool | contains (const Vector3d &p) const override |
void | destroy () override |
bool | getBoundingBox (Vector3d &minimum, Vector3d &maximum) const override |
bool | isNull () const override |
RegionUnion & | operator= (const RegionUnion &b) |
bool | visit (RegionProcessor &processor) override |
![]() | |
virtual | ~Region ()=default |
virtual Region * | cloneRegion () const =0 |
virtual bool | contains (const Vector3d &p) const =0 |
virtual void | destroy ()=0 |
virtual bool | getBoundingBox (Vector3d &minimum, Vector3d &maximum) const =0 |
virtual bool | getBoundingSphere (Vector3d ¢er, double &radius) const |
virtual bool | isNull () const =0 |
virtual bool | visit (RegionProcessor &processor)=0 |
The typical way to use this class is to add regions using addRegion(). The result of contains() will be equivalent to calling contains() on the added regions and logically OR'ing the results. The bounding box will be the smallest box that contains all the added regions.
It should be noted that when adding regions using addRegion(), the function clones its argument and stores this copy. If the original region is subsequently modified, those changes will not be reflected in this union object.
There is no facility to remove a region, but you can empty it with clear(), which makes it a null region to which you can add regions again from scratch.
RegionUnion | ( | ) |
Constructs a null region.
RegionUnion | ( | const RegionUnion & | r | ) |
r | The region to copy. |
|
override |
void addRegion | ( | const Region & | region | ) |
region | The region to add to this object. |
void clear | ( | ) |
Discards all regions held by this object.
|
virtual |
|
inlineoverridevirtual |
This function should be called clone() but the Visual Studio compilers do not handle covariant return types when multiple inheritance from a virtual base class is involved. Since Region is often combined with other Clonable classes such as ObjectGroup, we don't provide clone() but instead provide cloneRegion() which is effectively doing the same thing, albeit with the annoyance of a different function name.
Note that subclasses will need to tell DataExecution::TypedDataFactory about their cloneRegion() implementation explicitly if they do not also inherit from some other Clonable base class as well, since Region does not derive from Clonable (which means the template specializations for TypedDataFactory will not automatically detect cloneRegion()).
Implements Region.
|
overridevirtual |
p | The point to test. |
Implements Region.
|
overridevirtual |
minimum | The corner of the bounding box corresponding to the minimum values of X, Y and Z. |
maximum | The corner of the bounding box corresponding to the maximum values of X, Y and Z. |
The bounding box for a union region is the smallest box that contains all the bounding boxes of the regions participating in the union. The bounding box that results is guaranteed to contain all the points that would return true from a call to contains().
Implements Region.
|
overridevirtual |
Implements Region.
RegionUnion & operator= | ( | const RegionUnion & | b | ) |
|
overridevirtual |
Visit the specified region processor, invoking the correct processing function. Subclasses will need to override this to invoke the correct function.
Implements Region.