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
351 ON_HatchPattern& operator=(const ON_HatchPattern&) = default;
354 static const ON_HatchPattern Unset;
355 static const ON_HatchPattern Solid;
356 static const ON_HatchPattern Hatch1;
357 static const ON_HatchPattern Hatch2;
358 static const ON_HatchPattern Hatch3;
359 static const ON_HatchPattern HatchDash;
360 static const ON_HatchPattern Grid;
361 static const ON_HatchPattern Grid60;
362 static const ON_HatchPattern Plus;
363 static const ON_HatchPattern Squares;
367 const ON_HatchPattern& a,
368 const ON_HatchPattern& b
373 static
int CompareAppearance(
374 const ON_HatchPattern& a,
375 const ON_HatchPattern& b
389 static const ON_HatchPattern* FromModelComponentRef(
391 const ON_HatchPattern* none_return_value
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:327
static const ON_2dPoint Origin
Definition: opennurbs_point.h:290
The ON_ModelComponent class is a base class for all components in a model and manages the index...
Definition: opennurbs_model_component.h:24
Definition: opennurbs_hatch.h:25
HatchFillType
Definition: opennurbs_hatch.h:378
ON_Curve is a pure virtual class for curve objects
Definition: opennurbs_curve.h:93
ON_Object array is used to store lists of classes that are derived from ON_Object. It differs from ON_ClassArray in that the virtual ON_Object::MemoryRelocate function is called when growing the dynamic array requires changing the location of the memory buffer used to store the elements in the array.
Definition: opennurbs_array.h:725
Definition: opennurbs_string.h:2020
Definition: opennurbs_hatch.h:134
Base class for all geometry classes that must provide runtime class id. Provides interface for common...
Definition: opennurbs_geometry.h:37
Definition: opennurbs_point.h:277
eLoopType
Definition: opennurbs_hatch.h:47
Definition: opennurbs_bounding_box.h:25
Definition: opennurbs_hatch.h:539
Definition: opennurbs_brep.h:1472
Definition: opennurbs_textlog.h:20
Definition: opennurbs_archive.h:1783
static const ON_wString EmptyString
Definition: opennurbs_string.h:2026
Definition: opennurbs_model_component.h:1622
Definition: opennurbs_point.h:460
Definition: opennurbs_plane.h:20
static const ON_2dVector ZeroVector
Definition: opennurbs_point.h:852
Definition: opennurbs_point.h:839