Open CASCADE Technology  6.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
Hatch_Hatcher Class Reference

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 :

More...

#include <Hatch_Hatcher.hxx>

Public Member Functions

 Hatch_Hatcher (const Standard_Real Tol, const Standard_Boolean Oriented=Standard_True)
 Returns a empty hatcher. <Tol> is the tolerance
for intersections.
More...
 
void Tolerance (const Standard_Real Tol)
 
Standard_Real 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 <br>
     only kept from information. It is not used  in the <br>
     computation. <br>


More...

 
void AddLine (const gp_Dir2d &D, const Standard_Real Dist)
 
 Add an infinite line on  direction <D> at distance <br>
     <Dist> from the origin  to be  trimmed. <Dist> may <br>
     be negative. <br>


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

More...

 
void AddXLine (const Standard_Real X)
 
 Add an infinite line   parallel to the Y-axis   at <br>
     abciss <X>. <br>


More...

 
void AddYLine (const Standard_Real Y)
 
 Add an infinite line   parallel to the X-axis   at <br>
     ordinate <Y>. <br>


More...

 
void Trim (const gp_Lin2d &L, const Standard_Integer Index=0)
 
 Trims the lines at intersections with  <L>. <br>


More...

 
void Trim (const gp_Lin2d &L, const Standard_Real Start, const Standard_Real End, const Standard_Integer Index=0)
 
 Trims the lines at intersections  with <L>  in the <br>
     parameter range <Start>, <End> <br>


More...

 
void Trim (const gp_Pnt2d &P1, const gp_Pnt2d &P2, const Standard_Integer Index=0)
 
 Trims the line at  intersection with  the oriented <br>
     segment P1,P2. <br>


More...

 
Standard_Integer NbIntervals () const
 Returns the total number of intervals on all the
lines.
More...
 
Standard_Integer NbLines () const
 Returns the number of lines.
More...
 
const gp_Lin2dLine (const Standard_Integer I) const
 Returns the line of index .
More...
 
Hatch_LineForm LineForm (const Standard_Integer I) const
 Returns the type of the line of index .
More...
 
Standard_Boolean IsXLine (const Standard_Integer I) const
 Returns True if the line of index has a
constant X value.
More...
 
Standard_Boolean IsYLine (const Standard_Integer I) const
 Returns True if the line of index has a
constant Y value.
More...
 
Standard_Real Coordinate (const Standard_Integer I) const
 Returns the X or Y coordinate of the line of index
if it is a X or a Y line.
More...
 
Standard_Integer NbIntervals (const Standard_Integer I) const
 Returns the number of intervals on line of index .
More...
 
Standard_Real Start (const Standard_Integer I, const Standard_Integer J) const
 Returns the first parameter of interval <J> on
line .
More...
 
void StartIndex (const Standard_Integer I, const Standard_Integer J, Standard_Integer &Index, Standard_Real &Par2) const
 Returns the first Index and Par2 of interval <J> on
line .
More...
 
Standard_Real End (const Standard_Integer I, const Standard_Integer J) const
 Returns the last parameter of interval <J> on
line .
More...
 
void EndIndex (const Standard_Integer I, const Standard_Integer J, Standard_Integer &Index, Standard_Real &Par2) const
 Returns the last Index and Par2 of interval <J> on
line .
More...
 

Detailed Description

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 :

     1.  The users stores in the   Hatcher a set  of 2d <br>
     lines to   be  trimmed. Methods   in  the  "Lines" <br>
     category. <br>


  1. The user trims the lines with a boundary. The
    inside of a boundary is on the left side. Methods
    in the "Trimming" category.

  2. The user reads back the trimmed lines. Methods
    in the "Results" category.

    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 :

Constructor & Destructor Documentation

Hatch_Hatcher::Hatch_Hatcher ( const Standard_Real  Tol,
const Standard_Boolean  Oriented = Standard_True 
)

Returns a empty hatcher. <Tol> is the tolerance
for intersections.

Member Function Documentation

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 <br>
     only kept from information. It is not used  in the <br>
     computation. <br>


void Hatch_Hatcher::AddLine ( const gp_Dir2d D,
const Standard_Real  Dist 
)

 Add an infinite line on  direction <D> at distance <br>
     <Dist> from the origin  to be  trimmed. <Dist> may <br>
     be negative. <br>


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::AddXLine ( const Standard_Real  X)

 Add an infinite line   parallel to the Y-axis   at <br>
     abciss <X>. <br>


void Hatch_Hatcher::AddYLine ( const Standard_Real  Y)

 Add an infinite line   parallel to the X-axis   at <br>
     ordinate <Y>. <br>


Standard_Real Hatch_Hatcher::Coordinate ( const Standard_Integer  I) const

Returns the X or Y coordinate of the line of index
if it is a X or a Y line.

Standard_Real Hatch_Hatcher::End ( const Standard_Integer  I,
const Standard_Integer  J 
) const

Returns the last parameter of interval <J> on
line .

void Hatch_Hatcher::EndIndex ( const Standard_Integer  I,
const Standard_Integer  J,
Standard_Integer Index,
Standard_Real Par2 
) const

Returns the last Index and Par2 of interval <J> on
line .

Standard_Boolean Hatch_Hatcher::IsXLine ( const Standard_Integer  I) const

Returns True if the line of index has a
constant X value.

Standard_Boolean Hatch_Hatcher::IsYLine ( const Standard_Integer  I) const

Returns True if the line of index has a
constant Y value.

const gp_Lin2d& Hatch_Hatcher::Line ( const Standard_Integer  I) const

Returns the line of index .

Hatch_LineForm Hatch_Hatcher::LineForm ( const Standard_Integer  I) const

Returns the type of the line of index .

Standard_Integer Hatch_Hatcher::NbIntervals ( ) const

Returns the total number of intervals on all the
lines.

Standard_Integer Hatch_Hatcher::NbIntervals ( const Standard_Integer  I) const

Returns the number of intervals on line of index .

Standard_Integer Hatch_Hatcher::NbLines ( ) const

Returns the number of lines.

Standard_Real Hatch_Hatcher::Start ( const Standard_Integer  I,
const Standard_Integer  J 
) const

Returns the first parameter of interval <J> on
line .

void Hatch_Hatcher::StartIndex ( const Standard_Integer  I,
const Standard_Integer  J,
Standard_Integer Index,
Standard_Real Par2 
) const

Returns the first Index and Par2 of interval <J> on
line .

void Hatch_Hatcher::Tolerance ( const Standard_Real  Tol)
Standard_Real Hatch_Hatcher::Tolerance ( ) const
void Hatch_Hatcher::Trim ( const gp_Lin2d L,
const Standard_Integer  Index = 0 
)

 Trims the lines at intersections with  <L>. <br>


void Hatch_Hatcher::Trim ( const gp_Lin2d L,
const Standard_Real  Start,
const Standard_Real  End,
const Standard_Integer  Index = 0 
)

 Trims the lines at intersections  with <L>  in the <br>
     parameter range <Start>, <End> <br>


void Hatch_Hatcher::Trim ( const gp_Pnt2d P1,
const gp_Pnt2d P2,
const Standard_Integer  Index = 0 
)

 Trims the line at  intersection with  the oriented <br>
     segment P1,P2. <br>



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