Hide menu
Loading...
Searching...
No Matches

Represents an area filled with a pattern. More...

#include <cadex/Drawing/Hatch.hxx>

Inheritance diagram for cadex::Drawing::Hatch:
cadex::Drawing::Element cadex::BaseObject

Public Types

enum class  PatternType {
  Solid , ANSI_31 , ANSI_32 , ANSI_33 ,
  ANSI_34 , ANSI_35 , ANSI_36 , ANSI_37 ,
  ANSI_38 , ISO_02 , ISO_03 , ISO_04 ,
  ISO_05 , ISO_06 , ISO_07 , ISO_08 ,
  ISO_09 , ISO_10 , ISO_11 , ISO_12 ,
  ISO_13 , ISO_14 , ISO_15 , Custom = 1000
}
 
enum class  StyleType { Standard , Mirrored , Double }
 
enum class  ContourType { Inner , Outer }
 
- Public Types inherited from cadex::BaseObject
typedef std::shared_ptr< internal::BaseObjectImpl > ImplType
 

Public Member Functions

 Hatch ()
 Constructor.
 
bool AddContour (const PiecewiseContour &theContour, ContourType theType=ContourType::Outer)
 Adds the hatch contour.
 
size_t NumberOfContours () const
 Returns the number of hatch contours.
 
const PiecewiseContourContour (size_t theIndex) const
 Returns the contour.
 
ContourType TypeOfContour (size_t theIndex) const
 Returns the type of hatch contour.
 
void SetStyle (StyleType theStyle)
 Sets the style for the hatch pattern.
 
StyleType Style () const
 Returns the style for the hatch pattern.
 
void SetPattern (PatternType thePattern)
 Set the hatch pattern.
 
PatternType Pattern () const
 Returns the pattern of the hatch.
 
void SetScale (double theScale)
 Set the scale of the hatch.
 
double Scale () const
 Returns the scale of the hatch.
 
void SetAngle (double theAngle)
 Set the angle of the hatch.
 
double Angle () const
 Returns the angle of the hatch.
 
void AddDefinitionLine (const HatchDefinitionLine &theDefinitionLine)
 Adds the definition line to the hatch.
 
size_t NumberOfDefenitionLines () const
 Returns the number of definition lines.
 
const HatchDefinitionLineDefinitionLine (size_t theIndex) const
 Returns the definition line.
 
- Public Member Functions inherited from cadex::Drawing::Element
void SetUuid (const Uuid &theUuid)
 
cadex::Uuid Uuid () const
 
void Accept (ElementVisitor &theVisitor) const
 
- Public Member Functions inherited from cadex::BaseObject
size_t Id () const
 Return unique identifier of public object.
 
internal::BaseObjectImpl * Impl () const
 
bool IsNull () const
 
 operator bool () const
 
template<typename T >
bool IsOfType () const
 
template<typename T >
T * Impl () const
 Reserved for internal use.
 

Static Public Member Functions

static bool CompareType (const BaseObject &theObject)
 
- Static Public Member Functions inherited from cadex::Drawing::Element
static bool CompareType (const BaseObject &theObject)
 

Additional Inherited Members

- Protected Member Functions inherited from cadex::Drawing::Element
 Element (const ImplType &theImpl)
 
- Protected Member Functions inherited from cadex::BaseObject
 BaseObject (const ImplType &theImpl)
 

Detailed Description

Represents an area filled with a pattern.

The hatch pattern can be composed of solid, dashed or dash-doted lines. The pattern can be mirrored or composed with its mirror image to create double hatch. It follows the scheme used by AutoCAD to represent the set of ANSI-standard hatch patterns.

Three types of pattern styles are supported:

  • Standard
    Example of standard hatch pattern style
  • Mirrored
    Example of mirrored hatch pattern style
  • Double
    Example of double hatch pattern style

Member Enumeration Documentation

◆ PatternType

Represents pattern for drawing hatch.

◆ StyleType

Represents style for drawing hatch.

Member Function Documentation

◆ AddContour()

bool cadex::Drawing::Hatch::AddContour ( const PiecewiseContour & theContour,
ContourType theType = ContourType::Outer )

Adds the hatch contour.

The contour must be closed otherwise it will not be added and the function will return false.

◆ Contour()

const PiecewiseContour & cadex::Drawing::Hatch::Contour ( size_t theIndex) const

Returns the contour.

theIndex must be in the range [0, NumberOfContours()-1]. Otherwise the result is undefined.

◆ DefinitionLine()

const HatchDefinitionLine & cadex::Drawing::Hatch::DefinitionLine ( size_t theIndex) const

Returns the definition line.

theIndex must be in the range [0, NumberOfDefenitionLines()-1]. Otherwise the result is undefined.

◆ TypeOfContour()

Hatch::ContourType cadex::Drawing::Hatch::TypeOfContour ( size_t theIndex) const

Returns the type of hatch contour.

theIndex must be in the range [0; NumberOfContours()-1]. Otherwise the behavior is undefined.