Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::Plane Class Reference

Public Member Functions

double distance (const dvec3 &p) const
 
std::optional< dvec3 > getIntersection (const dvec3 &start, const dvec3 &stop) const
 Get intersection point with plane and line segment. Intersects if plane is in between start and stop. Segement start point will be returned if segment lies in the plane.
 
std::optional< double > getIntersectionWeight (const dvec3 &start, const dvec3 &stop) const
 
const dvec3 & getNormal () const noexcept
 
const dvec3 & getPoint () const noexcept
 
dmat4 inPlaneBasis () const
 
bool isInside (const dvec3 &point) const
 
bool perpendicularToPlane (const dvec3 &) const
 
 Plane (dvec3 point, dvec3 normal) noexcept
 
dvec3 projectPoint (const dvec3 &p) const
 
void setNormal (const dvec3 &)
 
void setPoint (dvec3)
 
Plane transform (const dmat4 &transform) const
 

Static Public Member Functions

static std::string_view getDataInfo ()
 

Static Public Attributes

static constexpr std::string_view classIdentifier {"org.inviwo.Plane"}
 
static constexpr uvec3 colorCode {225, 174, 225}
 
static constexpr std::string_view dataName {"Plane"}
 

Member Function Documentation

◆ distance()

double inviwo::Plane::distance ( const dvec3 & p) const

Return signed distance from plane to point, i.e. dot(x - p, normal).

 Plane
   |
   p-> normal

x <-—|----> x (point) -d d

Returns
Negative distance if behind plane, positive otherwise.

◆ getIntersection()

std::optional< dvec3 > inviwo::Plane::getIntersection ( const dvec3 & start,
const dvec3 & stop ) const

Get intersection point with plane and line segment. Intersects if plane is in between start and stop. Segement start point will be returned if segment lies in the plane.

Returned intersection point is invalid if no intersection exist.

Parameters
startStart point of segment
stopEnd point of segment
Returns
Intersected point if intersecting or nullopt.

◆ getIntersectionWeight()

std::optional< double > inviwo::Plane::getIntersectionWeight ( const dvec3 & start,
const dvec3 & stop ) const

Returns the intersection point as a fraction of the distance between start and stop. The point would be start + retval * (stop -start)

◆ inPlaneBasis()

dmat4 inviwo::Plane::inPlaneBasis ( ) const

Calculate an basis in the plane, the normal will be the last component.

◆ isInside()

bool inviwo::Plane::isInside ( const dvec3 & point) const

Check if point is on positive side of plane.

         Plane
           |
           |-> normal
 (outside) |  (inside)
See also
Plane::distance
Parameters
pointto check
Returns
true if on positive side of normal or on the plane, otherwise false

◆ projectPoint()

dvec3 inviwo::Plane::projectPoint ( const dvec3 & p) const

Project point onto plane. Plane | |-> normal projection |<-— x (point)

Parameters
xPoint to project
Returns
point on the plane

The documentation for this class was generated from the following file: