17 #ifndef OPENNURBS_HATCH_H_INCLUDED 18 #define OPENNURBS_HATCH_H_INCLUDED 23 Represents a 3d boundary loop curve
28 #if defined(OPENNURBS_EXPORTS) || defined(OPENNURBS_IMPORTS) 35 void*
operator new(size_t);
36 void operator delete(
void*);
39 void*
operator new[] (size_t);
40 void operator delete[] (
void*);
43 void*
operator new(size_t,
void*);
44 void operator delete(
void*,
void*);
60 bool IsValid(
ON_TextLog* text_log =
nullptr )
const;
87 bool SetCurve(
const ON_Curve& curve);
116 Represents one line of a hatch pattern
117 Similar to AutoCAD's .pat file definition
118 ON_HatchLine's are used by ON_HatchPattern
119 to specify the dashes and offset patterns of the lines.
121 Each line has the following information:
122 Angle is the direction of the line CCW from the x axis
123 The first line origin is at base
124 Each line repetition is offset by offset from the previous line
125 offset.x is parallel to the line and
126 offset.y is perpendicular to the line
127 The base and offset values are rotated by the line's angle to
128 produce a location in the hatch pattern's coordinate system
129 There can be gaps and dashes specified for drawing the line
131 If there are no dashes, the line is solid
132 Negative length dashes are gaps
133 Positive length dashes are drawn as line segments
155 double angle_in_radians,
163 double angle_in_radians
169 bool IsValid(
ON_TextLog* text_log =
nullptr )
const;
194 double AngleRadians()
const;
196 double AngleDegrees()
const;
206 void SetAngleRadians(
207 double angle_in_radians
210 void SetAngleDegrees(
211 double angle_in_degrees
260 int DashCount()
const;
270 double Dash(
int)
const;
278 void AppendDash(
double dash);
302 double& angle_radians,
314 double GetPatternLength()
const;
317 double m_angle_radians = 0.0;
326 #if defined(ON_DLL_TEMPLATE) 335 Fill definition for a hatch
337 The hatch will be one of
338 ON_Hatch::ON_HatchPattern::HatchFillType::Lines - pat file style definition
339 ON_Hatch::ON_HatchPattern::HatchFillType::Gradient - uses a color function
340 ON_Hatch::ON_HatchPattern::HatchFillType::Solid - uses entity color
373 static int CompareAppearance(
404 unsigned hatch_fill_type_as_unsigned
410 bool IsValid(
class ON_TextLog* text_log =
nullptr )
const override;
447 const wchar_t* pDescription
468 int HatchLineCount()
const;
505 bool RemoveHatchLine(
518 void RemoveAllHatchLines();
552 #if defined(ON_DLL_TEMPLATE) 561 Represents a hatch in planar boundary loop or loops
562 This is a 2d entity with a plane defining a local coordinate system
563 The loops, patterns, angles, etc are all in this local coordinate system
565 The ON_Hatch object manages the plane and loop array
566 Fill definitions are in the ON_HatchPattern or class derived from ON_HatchPattern
567 ON_Hatch has an index to get the pattern definition from the pattern table
586 double pattern_rotation_radians,
587 double pattern_scale,
591 void Internal_Destroy();
592 void Internal_CopyFrom(
const ON_Hatch& src);
595 virtual ON_Hatch* DuplicateHatch()
const;
599 bool IsValid(
class ON_TextLog* text_log =
nullptr )
const override;
603 ON::object_type ObjectType()
const override;
610 int Dimension()
const override;
613 bool GetBBox(
double* boxmin,
double* boxmax,
bool bGrowBox =
false )
const override;
616 bool GetTightBoundingBox(
class ON_BoundingBox& tight_bbox,
bool bGrowBox =
false,
const class ON_Xform* xform =
nullptr )
const override;
630 bool Transform(
const ON_Xform&)
override;
673 double pattern_rotation,
674 double pattern_scale);
692 void SetPlane(
const ON_Plane& plane);
704 double PatternRotation()
const;
716 void SetPatternRotation(
double rotation);
728 double PatternScale()
const;
740 void SetPatternScale(
double scale);
749 int LoopCount()
const;
772 bool InsertLoop(
int index,
783 bool RemoveLoop(
int index);
806 ON_Curve* LoopCurve3d(
int index)
const;
815 int PatternIndex()
const;
824 void SetPatternIndex(
int index);
873 double m_pattern_scale = 1.0;
874 double m_pattern_rotation = 0.0;
877 int m_pattern_index = -1;
Definition: opennurbs_hatch.h:343
static const ON_HatchPattern HatchDash
index = -5, id set, unique and persistent
Definition: opennurbs_hatch.h:359
static const ON_2dPoint Origin
(0.0,0.0)
Definition: opennurbs_point.h:305
Definition: opennurbs_model_component.h:25
static const ON_HatchPattern Unset
index = ON_UNSET_INT_INDEX, id = nil
Definition: opennurbs_hatch.h:354
Definition: opennurbs_hatch.h:25
HatchFillType
Definition: opennurbs_hatch.h:396
static const ON_HatchPattern Hatch2
index = -3, id set, unique and persistent
Definition: opennurbs_hatch.h:357
static const ON_HatchPattern Grid60
index = -7, id set, unique and persistent
Definition: opennurbs_hatch.h:361
Definition: opennurbs_curve.h:91
Definition: opennurbs_array.h:732
Definition: opennurbs_string.h:2089
Definition: opennurbs_hatch.h:136
Definition: opennurbs_geometry.h:36
static const ON_HatchPattern Grid
index = -6, id set, unique and persistent
Definition: opennurbs_hatch.h:360
eLoopType m_type
loop type flag - inner or outer
Definition: opennurbs_hatch.h:107
Definition: opennurbs_point.h:292
static const ON_HatchLine SolidHorizontal
angle = 0
Definition: opennurbs_hatch.h:146
eLoopType
Definition: opennurbs_hatch.h:47
Definition: opennurbs_bounding_box.h:25
static const ON_HatchPattern Squares
index = -9, id set, unique and persistent
Definition: opennurbs_hatch.h:363
static const ON_HatchPattern Hatch3
index = -4, id set, unique and persistent
Definition: opennurbs_hatch.h:358
static const ON_HatchLine Unset
angle = unset
Definition: opennurbs_hatch.h:145
Definition: opennurbs_hatch.h:570
static const ON_HatchPattern Solid
index = -1, id set, unique and persistent
Definition: opennurbs_hatch.h:355
Definition: opennurbs_brep.h:1513
ON_Curve * m_p2dCurve
Definition: opennurbs_hatch.h:108
static const ON_HatchPattern Plus
index = -8, id set, unique and persistent
Definition: opennurbs_hatch.h:362
static const ON_HatchPattern Hatch1
index = -2, id set, unique and persistent
Definition: opennurbs_hatch.h:356
Definition: opennurbs_textlog.h:20
< use for generic serialization of binary data
Definition: opennurbs_archive.h:1866
static const ON_wString EmptyString
Definition: opennurbs_string.h:2095
Definition: opennurbs_model_component.h:1686
static const ON_HatchLine SolidVertical
angle = pi/2
Definition: opennurbs_hatch.h:147
Definition: opennurbs_point.h:480
Definition: opennurbs_plane.h:20
static const ON_2dVector ZeroVector
(0.0,0.0)
Definition: opennurbs_point.h:881
Definition: opennurbs_point.h:868