![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
The Hatcher is an algorithm to compute cross hatchings in a 2d plane. It is mainly dedicated to display purpose. More...
#include <Hatch_Hatcher.hxx>
Public Member Functions | |
| Hatch_Hatcher (const double Tol, const bool Oriented=true) | |
| Returns an empty hatcher. <Tol> is the tolerance for intersections. | |
| void | Tolerance (const double Tol) |
| double | Tolerance () const |
| void | AddLine (const gp_Lin2d &L, const Hatch_LineForm T=Hatch_ANYLINE) |
| Add a line <L> to be trimmed. <T> the type is only kept from information. It is not used in the computation. | |
| void | AddLine (const gp_Dir2d &D, const double Dist) |
| Add an infinite line on direction <D> at distance <Dist> from the origin to be trimmed. <Dist> may be negative. | |
| void | AddXLine (const double X) |
| Add an infinite line parallel to the Y-axis at abciss <X>. | |
| void | AddYLine (const double Y) |
| Add an infinite line parallel to the X-axis at ordinate <Y>. | |
| void | Trim (const gp_Lin2d &L, const int Index=0) |
| Trims the lines at intersections with <L>. | |
| void | Trim (const gp_Lin2d &L, const double Start, const double End, const int Index=0) |
| Trims the lines at intersections with <L> in the parameter range <Start>, <End> | |
| void | Trim (const gp_Pnt2d &P1, const gp_Pnt2d &P2, const int Index=0) |
| Trims the line at intersection with the oriented segment P1,P2. | |
| int | NbIntervals () const |
| Returns the total number of intervals on all the lines. | |
| int | NbLines () const |
| Returns the number of lines. | |
| const gp_Lin2d & | Line (const int I) const |
| Returns the line of index . | |
| Hatch_LineForm | LineForm (const int I) const |
| Returns the type of the line of index . | |
| bool | IsXLine (const int I) const |
| Returns True if the line of index has a constant X value. | |
| bool | IsYLine (const int I) const |
| Returns True if the line of index has a constant Y value. | |
| double | Coordinate (const int I) const |
| Returns the X or Y coordinate of the line of index if it is a X or a Y line. | |
| int | NbIntervals (const int I) const |
| Returns the number of intervals on line of index . | |
| double | Start (const int I, const int J) const |
| Returns the first parameter of interval <J> on line . | |
| void | StartIndex (const int I, const int J, int &Index, double &Par2) const |
| Returns the first Index and Par2 of interval <J> on line . | |
| double | End (const int I, const int J) const |
| Returns the last parameter of interval <J> on line . | |
| void | EndIndex (const int I, const int J, int &Index, double &Par2) const |
| Returns the last Index and Par2 of interval <J> on line . | |
The Hatcher is an algorithm to compute cross hatchings in a 2d plane. It is mainly dedicated to display purpose.
Computing cross hatchings is a 3 steps process :
The result is a set of parameter intervals on the line. The first parameter of an Interval may be RealFirst() and the last may be RealLast().
A line can be a line parallel to the axis (X or Y line or a 2D line.
The Hatcher has two modes :
Returns an empty hatcher. <Tol> is the tolerance for intersections.
Add an infinite line on direction <D> at distance <Dist> from the origin to be trimmed. <Dist> may be negative.
If O is the origin of the 2D plane, and V the vector perpendicular to D (in the direct direction).
A point P is on the line if : OP dot V = Dist The parameter of P on the line is OP dot D
| void Hatch_Hatcher::AddLine | ( | const gp_Lin2d & | L, |
| const Hatch_LineForm | T = Hatch_ANYLINE ) |
Add a line <L> to be trimmed. <T> the type is only kept from information. It is not used in the computation.
Add an infinite line parallel to the Y-axis at abciss <X>.
Add an infinite line parallel to the X-axis at ordinate <Y>.
Returns the X or Y coordinate of the line of index if it is a X or a Y line.
Returns the last parameter of interval <J> on line .
Returns the last Index and Par2 of interval <J> on line .
Returns True if the line of index has a constant X value.
Returns True if the line of index has a constant Y value.
| Hatch_LineForm Hatch_Hatcher::LineForm | ( | const int | I | ) | const |
Returns the type of the line of index .
| int Hatch_Hatcher::NbIntervals | ( | ) | const |
Returns the total number of intervals on all the lines.
Returns the number of intervals on line of index .
| int Hatch_Hatcher::NbLines | ( | ) | const |
Returns the number of lines.
Returns the first parameter of interval <J> on line .
Returns the first Index and Par2 of interval <J> on line .
| double Hatch_Hatcher::Tolerance | ( | ) | const |
| void Hatch_Hatcher::Trim | ( | const gp_Lin2d & | L, |
| const double | Start, | ||
| const double | End, | ||
| const int | Index = 0 ) |
Trims the lines at intersections with <L> in the parameter range <Start>, <End>
Trims the lines at intersections with <L>.
Trims the line at intersection with the oriented segment P1,P2.