Workspace 6.21.5
|
Abstract base class defining an arbitrary region in 3D space. More...
#include <Mesh/Geometry/region.h>
Public Member Functions | |
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 |
Ideally, this class would inherit from Clonable, but this leads to problems when using the Visual Studio compilers. See the documentation for cloneRegion() for further details.
|
virtualdefault |
|
pure virtual |
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()).
Implemented in BoundingBox, BoundingCylinder, BoundingPlane, BoundingSphere, RegionIntersection, RegionNegate, RegionTransform, and RegionUnion.
|
pure virtual |
p | The point to test. |
Implemented in BoundingBox, BoundingCylinder, BoundingPlane, BoundingSphere, RegionIntersection, RegionNegate, RegionTransform, and RegionUnion.
|
pure virtual |
Destroys the object. This function is usually implemented by calling operator delete on the object.
Implemented in BoundingBox, BoundingCylinder, BoundingPlane, BoundingSphere, RegionIntersection, RegionNegate, RegionTransform, and RegionUnion.
minimum | If the function returns true, then at exit this will hold the corner of the bounding box corresponding to the minimum values of X, Y and Z. |
maximum | If the function returns true, then at exit this will hold the corner of the bounding box corresponding to the maximum values of X, Y and Z. |
The bounding box is guaranteed to contain all the regions for which a point passed to contains() will return true. It can be useful as a way of short-circuiting a more expensive test for whether a point is contained in a complex region. How conservative the bounding box is will be determined entirely by the subclass. It is allowable for the subclass to return the entire 3D domain as the bounding box (and indeed some subclasses logically have to do this, such as RegionNegate).
Implemented in BoundingBox, BoundingCylinder, BoundingPlane, BoundingSphere, RegionIntersection, RegionNegate, RegionTransform, and RegionUnion.
|
virtual |
center | This will hold the center of the bounding sphere if the function is successful. If not successful, the function leaves it unmodified from the passed in value. |
radius | This will hold the radius of the bounding sphere if the function is successful. If not successful, the function leaves it unmodified from the passed in value. |
This function must work out the bounding sphere around the region such that all parts of the region will be inside or on the boundary of the bounding sphere. The default implementation is fairly naive. All it does is return the bounding sphere around the result of getBoundingBox(). If any dimensions of that bounding box are infinite, the radius returned will be infinite and the center will be left unchanged since it has no meaning in such cases. Subclasses will likely be able to return a more compact bounding sphere or perform the calculation more efficiently.
Reimplemented in BoundingCylinder, and BoundingSphere.
|
pure virtual |
A null region is one that has not been fully defined or which has no possible region. Null regions are often created in the default constructor of Region subclasses to indicate that the region has not yet been set up. Another common situation where null regions are encountered is when the intersection of non-overlapping regions is calculated.
Null regions obviously cannot contain anything and therefore will always return false from contains().
Implemented in BoundingBox, BoundingCylinder, BoundingPlane, BoundingSphere, RegionIntersection, RegionNegate, RegionTransform, and RegionUnion.
|
pure virtual |
Visit the specified region processor, invoking the correct processing function. Subclasses will need to override this to invoke the correct function.
Implemented in BoundingBox, BoundingCylinder, BoundingPlane, BoundingSphere, RegionIntersection, RegionNegate, RegionTransform, and RegionUnion.