41 std::vector<vector_2d>
pts;
66 virtual void getBound(
float* xMin,
float* yMin,
float* xMax,
float* yMax);
74 std::vector<vector_2d>
subCurve(
float start,
float end,
bool rev);
94 virtual void refresh()=0;
97 bool refresh(
float dpi);
138 static double evalBezier(
double t,
double p0,
double p1,
double p2,
double p3);
std::vector< vector_2d > interPoint(vector_2d pt1, vector_2d pt2, vector_2d pt3, vector_2d pt4, float t)
return a segment of the original curve
Definition: OE_curve.cpp:75
static float distPtSeg(vector_2d pt, vector_2d seg1, vector_2d seg2)
calculate the distance beetween a point and a segment
Definition: OE_curve.cpp:266
std::vector< vector_2d > discretizeFast(float maxDist)
discretise a curve using a level of detail approach
Definition: OE_curve.cpp:311
static bool ptInBounds(vector_2d pt, float *bounds)
check if a point is in a given bounding box
Definition: OE_curve.cpp:64
virtual ~OE_curve()
Definition: OE_curve.cpp:39
virtual bool check()
check if the curve is valid.
Definition: OE_curve.cpp:257
virtual void getBound(float *xMin, float *yMin, float *xMax, float *yMax)
calculate the curve bounding box
Definition: OE_curve.cpp:156
float getLength(float maxDist)
return the length of the curve.
Definition: OE_curve.cpp:43
float bounds[4]
Tight bounding box of the object [minx,miny,maxx,maxy].
Definition: OE_base.h:67
OE_curve()
Definition: OE_curve.cpp:35
static unsigned char lineColor[4]
Tight bounding box of the shape [minx,miny,maxx,maxy].
Definition: OE_curve.h:109
std::vector< vector_2d > subCurve(float start, float end, bool rev)
return a segment of the original curve
Definition: OE_curve.cpp:183
static double evalBezier(double t, double p0, double p1, double p2, double p3)
get the position of a 1D point on a bezier segment
Definition: OE_curve.cpp:69
Definition: OE_curve.h:30
bool closed
Flag indicating if shapes should be treated as closed.
Definition: OE_curve.h:103
bool controls
is displaying controls.
Definition: OE_curve.h:35
std::vector< vector_2d > discPts
the curve array of discretized points
Definition: OE_curve.h:38
void setClosed(bool closed)
set the curve closed attribute.
Definition: OE_curve.cpp:255
std::vector< vector_2d > pts
the bezier curve array of points
Definition: OE_curve.h:41
std::vector< vector_2d > discretizeRegular(float dist)
discretise a curve using uniform segment lengths
Definition: OE_curve.cpp:326
bool getClosed()
return true if the curve is set as closed.
Definition: OE_curve.cpp:254
void reverse()
reverse the curve.
Definition: OE_curve.cpp:372
int getNpts()
return the number of points in the curve (control points, without handles)
Definition: OE_curve.cpp:253
Definition: OE_utils.h:28
std::vector< vector_2d > discretizeCubicBez(vector_2d pt1, vector_2d pt2, vector_2d pt3, vector_2d pt4, float tol, int level)
discretise a curve segment to display or treating it
Definition: OE_curve.cpp:285
static void segmentBounds(float *bounds, vector_2d *segment)
calculate a segment bounding box
Definition: OE_curve.cpp:93