Workspace 6.21.5
|
Describes a bounding plane region in 3D space. More...
#include <Mesh/Geometry/boundingplane.h>
Public Member Functions | |
BoundingPlane () | |
BoundingPlane (const BoundingPlane &plane) | |
BoundingPlane (const Vector3d &point, const Vector3d &normal) | |
BoundingPlane * | clone () const override |
BoundingPlane * | cloneRegion () const override |
bool | contains (const Vector3d &p) const override |
void | destroy () override |
bool | getBoundingBox (Vector3d &minimum, Vector3d &maximum) const override |
Vector3d | getNormal () const |
Vector3d | getPoint () const |
bool | isNull () const override |
bool | operator!= (const BoundingPlane &v) const |
bool | operator== (const BoundingPlane &b) const |
void | setNormal (const Vector3d &n) |
void | setPoint (const Vector3d &p) |
bool | visit (RegionProcessor &processor) override |
Public Member Functions inherited from Region | |
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 |
Public Member Functions inherited from ObjectGroup | |
~ObjectGroup () override | |
bool | add (const QString &name, DataObject &obj) |
bool | canSerialize () const override |
ObjectGroup * | clone () const override=0 |
bool | empty () const |
void | ensureGroupHasData () |
void | erase (int index) |
DataObject * | getChild (const QString &name) |
const DataObject * | getChild (const QString &name) const |
DataObject & | getDataObject (int index) |
const DataObject & | getDataObject (int index) const |
int | getIndex (const QString &name) const |
const QString & | getName (int index) const |
virtual QString | getPreferedWidget (const QString &name) const |
bool | hasData () const |
bool | haveName (const QString &name) const |
bool | insert (const QString &name, DataObject &obj, int index=-1) |
bool | load (const QJsonDocument &doc) |
bool | load (const SerializedItem &item) override |
bool | save (QJsonDocument &doc) const |
bool | save (SerializedItem &item) const override |
unsigned | size () const |
Public Member Functions inherited from Clonable | |
virtual | ~Clonable ()=default |
virtual Clonable * | clone () const =0 |
Public Member Functions inherited from Serialize | |
virtual | ~Serialize ()=default |
virtual bool | canSerialize () const =0 |
virtual bool | load (const SerializedItem &item)=0 |
virtual bool | save (SerializedItem &item) const =0 |
Additional Inherited Members | |
Protected Member Functions inherited from ObjectGroup | |
ObjectGroup () | |
void | clear () |
ObjectGroup & | operator= (const ObjectGroup &rhs) |
bool | operator== (const ObjectGroup &rhs) const |
void | swap (ObjectGroup &rhs) |
A bounding plane defines a region on the side of the plane that the normal vector points to. Clients should take care to ensure that they don't assign a zero vector to the plane's normal. Doing so will likely result in nonsense being returned from contains() and will also make getBoundingBox() return false to indicate failure.
BoundingPlane | ( | ) |
Constructs a plane at the origin with normal along the positive X axis.
BoundingPlane | ( | const BoundingPlane & | plane | ) |
plane | The bounding plane to copy. |
BoundingPlane | ( | const Vector3d & | point, |
const Vector3d & | normal | ||
) |
point | A point on the plane. |
normal | The normal vector of the plane. It should never be a zero vector. |
|
overridevirtual |
We redeclare this function only so that the more derived return type is available without casting.
Implements ObjectGroup.
|
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 | 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).
Implements Region.
Vector3d getNormal | ( | ) | const |
Vector3d getPoint | ( | ) | const |
|
overridevirtual |
Implements Region.
|
inline |
bool operator== | ( | const BoundingPlane & | b | ) | const |
void setNormal | ( | const Vector3d & | n | ) |
n | The new normal vector of the plane. It should never be a zero vector. |
void setPoint | ( | const Vector3d & | p | ) |
p | The new point on the plane. |
|
overridevirtual |
Visit the specified region processor, invoking the correct processing function. Subclasses will need to override this to invoke the correct function.
Implements Region.