Core 1.0
SmoothSegment2 Class Reference

A segment primitve with a cubic falloff. More...

#include <smooth.h>

Inheritance diagram for SmoothSegment2:
Segment2

Public Member Functions

 SmoothSegment2 (const Vector2 &, const Vector2 &, const double &, const double &=1.0, bool=true)
 Create a smooth box.
double Value (const Vector2 &) const
 Compute the intensity.
double Radius () const
 Return the radius.
Box2 GetBox () const
 Compute the bounding box.

Protected Attributes

double r = 0.0
 Falloff radius.
double s = 1.0
 Intensity.
bool cubic = true
 Cubic falloff, or quadric falloff.
Protected Attributes inherited from Segment2
Vector2 b = Vector2::X
 End vertices of the segment.

Additional Inherited Members

Protected Member Functions inherited from Segment2
 Segment2 ()
 Empty.
 Segment2 (const Vector2 &, const Vector2 &)
 Creates a planar segment given end vertices.
 Segment2 (const Segment &)
 Creates a planar segment given a three dimensional segment.
 ~Segment2 ()
 Empty.
Vector2 Vertex (int) const
 Return one of the end vertex of the axis.
Vector2 & Vertex (int)
 Return one of the end vertex of the axis.
Vector2 VertexAt (const double &) const
 Compute a point on the segment.
Vector2 Center () const
 Compute the center of the segment.
Vector2 GetAxis () const
 Returns the normalized axis vector.
Box2 GetBox () const
 Compute the bounding box of the segment.
Vector2 Orthogonal () const
 Compute an orthogonal vector to the segment.
void Translate (const Vector2 &)
 Translates a segment.
void Rotate (const Matrix2 &)
 Translates a segment.
void Scale (const double &)
 Uniformly scales a segment.
Segment2 Translated (const Vector2 &) const
 Translates a segment.
Segment2 Extended (const double &) const
 Extend the length of a segment by a given distance.
double Length () const
 Return axis length.
void Draw (QGraphicsScene &, const QPen &=QPen()) const
 Draw a segment.
void DrawArrow (QGraphicsScene &, const double &, const QPen &=QPen(), const QBrush &=QBrush(QColor(255, 255, 255))) const
 Draw a segment as an arrow.
double R (const Vector2 &) const
 Compute the squared distance to the segment.
double R (const Vector2 &, double &) const
 Compute the squared distance to the axis edge characterized by its end points.
Vector2 Normal (const Vector2 &) const
 Compute the normal vector between a point and its projection onto the segment.
bool Intersect (const Segment2 &) const
 Test if two segments intersect.
bool Intersection (const Segment2 &, Vector2 &) const
 Compute the intersection between two segments.
Segment2 Shrinked (const double &) const
 Create a new segment by shrinking the current segment.
Static Protected Member Functions inherited from Segment2
static Vector2 Intersect (const Vector2 &, const Vector2 &, const double, const double, const double=0.0)
 Compute the intersection between the line f(x)=y and a line such that f(a)=va and f(b)=vb, on the segment ab.
Static Protected Attributes inherited from Segment2
static constexpr const double epsilon = 1e-8
 Epsilon value for intersection test.

Detailed Description

A segment primitve with a cubic falloff.

Constructor & Destructor Documentation

◆ SmoothSegment2()

SmoothSegment2::SmoothSegment2 ( const Vector2 & a,
const Vector2 & b,
const double & r,
const double & s = 1.0,
bool cubic = true )
explicit

Create a smooth box.

Parameters
a,bPoints defining the segment.
rFalloff radius.
sIntensity.
cubicWhether to use cubic interpolation.

Member Function Documentation

◆ Value()

double SmoothSegment2::Value ( const Vector2 & p) const

Compute the intensity.

Parameters
pPoint.