#include <opennurbs_hatch.h>

Public Member Functions

 ON_HatchLine ()=default
 Default constructor creates ON_HatchLine::SolidHorizontal. More...
 
 ON_HatchLine (const ON_HatchLine &)=default
 
 ON_HatchLine (double angle_in_radians, ON_2dPoint base, ON_2dVector offset, const ON_SimpleArray< double > &dashes)
 
 ON_HatchLine (double angle_in_radians)
 constructs solid line More...
 
 ~ON_HatchLine ()=default
 
double AngleDegrees () const
 
double AngleRadians () const
 Get angle of the hatch line. CCW from x-axis More...
 
void AppendDash (double dash)
 Add a dash to the pattern More...
 
ON_2dPoint Base () const
 Get this line's 2d basepoint More...
 
double Dash (int) const
 Get the dash length at index More...
 
int DashCount () const
 Get the number of gaps + dashes in the line More...
 
const ON_SimpleArray< double > & Dashes () const
 
void Dump (ON_TextLog &) const
 
void GetLineData (double &angle_radians, ON_2dPoint &base, ON_2dVector &offset, ON_SimpleArray< double > &dashes) const
 Get the line's angle, base, offset and dashes in one function call More...
 
double GetPatternLength () const
 Get the total length of a pattern repeat More...
 
bool IsValid (ON_TextLog *text_log=nullptr) const
 
ON_2dVector Offset () const
 Get this line's 2d offset for line repetitions Offset().x is shift parallel to line Offset().y is spacing perpendicular to line More...
 
bool operator!= (const ON_HatchLine &) const
 
ON_HatchLineoperator= (const ON_HatchLine &)=default
 
bool operator== (const ON_HatchLine &) const
 
bool Read (ON_BinaryArchive &)
 
void SetAngleDegrees (double angle_in_degrees)
 
void SetAngleRadians (double angle_in_radians)
 Set angle of the hatch line. CCW from x-axis More...
 
void SetBase (const ON_2dPoint &base)
 Set this line's 2d basepoint More...
 
void SetDashes (const ON_SimpleArray< double > &dashes)
 Specify a new dash array More...
 
void SetOffset (const ON_2dVector &offset)
 Get this line's 2d offset for line repetitions Offset().x is shift parallel to line Offset().y is spacing perpendicular to line More...
 
bool Write (ON_BinaryArchive &) const
 

Static Public Member Functions

static int Compare (const ON_HatchLine &a, const ON_HatchLine &b)
 

Static Public Attributes

static const ON_HatchLine SolidHorizontal
 
static const ON_HatchLine SolidVertical
 
static const ON_HatchLine Unset
 

Constructor & Destructor Documentation

◆ ON_HatchLine() [1/4]

ON_HatchLine::ON_HatchLine ( )
default

Default constructor creates ON_HatchLine::SolidHorizontal.

◆ ~ON_HatchLine()

ON_HatchLine::~ON_HatchLine ( )
default

◆ ON_HatchLine() [2/4]

ON_HatchLine::ON_HatchLine ( const ON_HatchLine )
default

◆ ON_HatchLine() [3/4]

ON_HatchLine::ON_HatchLine ( double  angle_in_radians,
ON_2dPoint  base,
ON_2dVector  offset,
const ON_SimpleArray< double > &  dashes 
)

◆ ON_HatchLine() [4/4]

ON_HatchLine::ON_HatchLine ( double  angle_in_radians)

constructs solid line

Member Function Documentation

◆ AngleDegrees()

double ON_HatchLine::AngleDegrees ( ) const

◆ AngleRadians()

double ON_HatchLine::AngleRadians ( ) const

Get angle of the hatch line. CCW from x-axis

TODODOC: Return: TODODOC: The angle in radians

◆ AppendDash()

void ON_HatchLine::AppendDash ( double  dash)

Add a dash to the pattern

Parameters
dash[in] length to append - < 0 for a gap

◆ Base()

ON_2dPoint ON_HatchLine::Base ( ) const

Get this line's 2d basepoint

TODODOC: Return: TODODOC: the base point

◆ Compare()

static int ON_HatchLine::Compare ( const ON_HatchLine a,
const ON_HatchLine b 
)
static

◆ Dash()

double ON_HatchLine::Dash ( int  ) const

Get the dash length at index

Parameters
index[in] the dash to get Return: the length of the dash ( gap if negative)

◆ DashCount()

int ON_HatchLine::DashCount ( ) const

Get the number of gaps + dashes in the line

TODODOC: Return: TODODOC: nummber of dashes in the line

◆ Dashes()

const ON_SimpleArray<double>& ON_HatchLine::Dashes ( ) const

◆ Dump()

void ON_HatchLine::Dump ( ON_TextLog ) const

◆ GetLineData()

void ON_HatchLine::GetLineData ( double &  angle_radians,
ON_2dPoint base,
ON_2dVector offset,
ON_SimpleArray< double > &  dashes 
) const

Get the line's angle, base, offset and dashes in one function call

Parameters
angle_radians[out] angle in radians CCW from x-axis
base[out] origin of the master line
offset[out] offset for line replications
dashes[out] the dash array for the line Return:

◆ GetPatternLength()

double ON_HatchLine::GetPatternLength ( ) const

Get the total length of a pattern repeat

TODODOC: Return: TODODOC: Pattern length

◆ IsValid()

bool ON_HatchLine::IsValid ( ON_TextLog text_log = nullptr) const

◆ Offset()

ON_2dVector ON_HatchLine::Offset ( ) const

Get this line's 2d offset for line repetitions Offset().x is shift parallel to line Offset().y is spacing perpendicular to line

TODODOC: Return: TODODOC: the offset

◆ operator!=()

bool ON_HatchLine::operator!= ( const ON_HatchLine ) const

◆ operator=()

ON_HatchLine& ON_HatchLine::operator= ( const ON_HatchLine )
default

◆ operator==()

bool ON_HatchLine::operator== ( const ON_HatchLine ) const

◆ Read()

bool ON_HatchLine::Read ( ON_BinaryArchive )

◆ SetAngleDegrees()

void ON_HatchLine::SetAngleDegrees ( double  angle_in_degrees)

◆ SetAngleRadians()

void ON_HatchLine::SetAngleRadians ( double  angle_in_radians)

Set angle of the hatch line. CCW from x-axis

Parameters
angle[in] angle in radians Return:

◆ SetBase()

void ON_HatchLine::SetBase ( const ON_2dPoint base)

Set this line's 2d basepoint

Parameters
base[in] the basepoint Return:

◆ SetDashes()

void ON_HatchLine::SetDashes ( const ON_SimpleArray< double > &  dashes)

Specify a new dash array

Parameters
dashes[in] array of dash lengths

◆ SetOffset()

void ON_HatchLine::SetOffset ( const ON_2dVector offset)

Get this line's 2d offset for line repetitions Offset().x is shift parallel to line Offset().y is spacing perpendicular to line

Parameters
offset[in] the shift,spacing for repeated lines Return:

◆ Write()

bool ON_HatchLine::Write ( ON_BinaryArchive ) const

Member Data Documentation

◆ SolidHorizontal

const ON_HatchLine ON_HatchLine::SolidHorizontal
static

◆ SolidVertical

const ON_HatchLine ON_HatchLine::SolidVertical
static

◆ Unset

const ON_HatchLine ON_HatchLine::Unset
static