Clipping planes are used to clip parts of the geometry in the scene to be able to look inside. More...
Public Member Functions | |
size_t | planeCount () const |
Returns the number of clipping planes defined for the view. More... | |
const Plane & | plane (size_t index) const |
Returns the clipping plane at the given index. More... | |
void | addPlane (const Plane &plane) |
Adds a clipping plane to the view. More... | |
void | setPlane (size_t index, const Plane &plane) |
Sets a clipping plane at the given index. More... | |
void | removePlane (size_t index) |
Removes the clipping plane at the given index. More... | |
void | removeAllPlanes () |
Removes all clipping planes defined for the view. More... | |
bool | mustBeBehindAllPlanesToClip () const |
Returns how clipping will be performed if more than one plane has been specified. More... | |
void | setMustBeBehindAllPlanesToClip (bool mustBeBehindAllToClip) |
Controls how clipping will be done if more than one plane is specified. More... | |
void | setupRayDistancesFilters (Ray *ray) const |
Sets up the ray's distance filter based on the current clipping planes. More... | |
![]() | |
void | addRef () const |
Increments the reference count for this object. More... | |
void | release () const |
Decrements the reference count for this object. More... | |
int | refCount () const |
Returns the reference count for this object. More... | |
void | setRefCountZero () const |
Sets the ref count to zero, but DOES NOT delete the object. More... | |
Clipping planes are used to clip parts of the geometry in the scene to be able to look inside.
Anything behind (on the opposite side of the plane normal) the given planes is hidden.
Ceetron Desktop Components supports bounded clipping planes. This allows for cutting out parts of the model in many different ways. Normal clipping planes will clip an object/fragment if it is on the wrong side of any of the active clipping planes. By default an object/fragment will be clipped if it is behind (on the opposite side of the plane normal) at least one of the specified planes. Setting mustBeBehindAllToClip to true will require that an object/fragment be behind all the specified planes in order to be clipped.
No clipping:
Model with 5 clipping plane defining the bottom, right, back, left and top clipping plane. setMustBeBehindAllPlanesToClip(true) is used:
void cee::vis::Clipping::addPlane | ( | const Plane & | plane | ) |
Adds a clipping plane to the view.
The plane clips anything behind the plane (on the opposite side of the plane normal).
bool cee::vis::Clipping::mustBeBehindAllPlanesToClip | ( | ) | const |
Returns how clipping will be performed if more than one plane has been specified.
const Plane & cee::vis::Clipping::plane | ( | size_t | index | ) | const |
Returns the clipping plane at the given index.
The plane clips anything behind the plane (on the opposite side of the plane normal)
size_t cee::vis::Clipping::planeCount | ( | ) | const |
Returns the number of clipping planes defined for the view.
void cee::vis::Clipping::removeAllPlanes | ( | ) |
Removes all clipping planes defined for the view.
void cee::vis::Clipping::removePlane | ( | size_t | index | ) |
Removes the clipping plane at the given index.
void cee::vis::Clipping::setMustBeBehindAllPlanesToClip | ( | bool | mustBeBehindAllToClip | ) |
Controls how clipping will be done if more than one plane is specified.
This setting is useful for creating "bounded clipping planes" where you define multiple planes in such a way that only fragments clipped by all planes (e.g. inside a box) will be rejected. This allows for "cutting into" a model without removing everything one one side of a plane.
By default an object/fragment will be clipped if it is behind (on the opposite side of the plane normal) at least one of the specified planes. Setting mustBeBehindAllToClip to true will require that an object/fragment be behind all the specified planes in order to be clipped.
Original model
No clipping.
Bounded clipping planes
Model with 5 clipping plane defining the bottom, right, back, left and top clipping plane. setMustBeBehindAllPlanesToClip(true) is used:
void cee::vis::Clipping::setPlane | ( | size_t | index, |
const Plane & | plane | ||
) |
Sets a clipping plane at the given index.
The plane clips anything behind the plane (on the opposite side of the plane normal).
void cee::vis::Clipping::setupRayDistancesFilters | ( | Ray * | ray | ) | const |
Sets up the ray's distance filter based on the current clipping planes.
When doing rayIntersect the distance filter stored in the ray is used for determine if the hit item is visible or not (hidden by clipping planes or not).
This function will setup the legal distance ranges of the given ray so it will respect the current clipping planes in the view.