opennurbs_linestyle.h
1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 #if !defined(OPENNURBS_LINESTYLE_INC_)
18 #define OPENNURBS_LINESTYLE_INC_
19 
20 
21 ///////////////////////////////////////////////////////////////////////////////
22 //
23 // Class ON_DisplayMaterialRef
24 //
25 
26 /*
27 Description:
28  Objects can have per viewport display properties
29  that override a viewport's default display
30  properties. These overrides are stored on
31  ON_3dmObjectAttributes as a list of
32  ON_DisplayMaterialRefs.
33 
34 Example:
35  For example, by default a viewport
36  might display objects using a wireframe, but
37  one special object may need to be shaded.
38  In this case the special object would have
39  a display material ref with the "wireframe"
40  viewport's id and the id of a display material
41  that specified shading.
42 */
43 class ON_CLASS ON_DisplayMaterialRef
44 {
45 public:
46  /*
47  Description:
48  Default constructor sets both ids to nil.
49  */
51  int Compare(const ON_DisplayMaterialRef& other) const;
52  bool operator==(const ON_DisplayMaterialRef& other) const;
53  bool operator!=(const ON_DisplayMaterialRef& other) const;
54  bool operator<(const ON_DisplayMaterialRef& other) const;
55  bool operator<=(const ON_DisplayMaterialRef& other) const;
56  bool operator>(const ON_DisplayMaterialRef& other) const;
57  bool operator>=(const ON_DisplayMaterialRef& other) const;
58 
59  // C++ default destructor, copy constructor and operator=
60  // work fine.
61 
62  ON_UUID m_viewport_id; // identifies the ON_Viewport
63  // If nil, then the display material
64  // will be used in all viewports
65  // that are not explictly referenced
66  // in other ON_DisplayMaterialRefs.
67 
68  ON_UUID m_display_material_id; // id used to find display attributes
69 
70  // For Rhino V4 the per detail visibility attribute is implemented
71  // through a display material reference on an object. This is ONLY
72  // for for detail viewports and only for V4. Keep this uuid around
73  // so the per detail attributes in future versions of Rhino can be
74  // implemented a different way.
75  // {1403A7E4-E7AD-4a01-A2AA-41DAE6BE7ECB}
76  static const ON_UUID m_invisible_in_detail_id;
77 };
78 
79 #if defined(ON_DLL_TEMPLATE)
80 
81 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_DisplayMaterialRef>;
82 
83 #endif
84 //////////////////////////////////////////////////////////////////////
85 // class ON_LinetypeSegment
86 
87 class ON_CLASS ON_LinetypeSegment
88 {
89 public:
90 
91  static const ON_LinetypeSegment Unset;
92  static const ON_LinetypeSegment OneMillimeterLine;
93 
94 public:
95  ON_LinetypeSegment() = default;
96  ~ON_LinetypeSegment() = default;
97  ON_LinetypeSegment(const ON_LinetypeSegment&) = default;
98  ON_LinetypeSegment& operator=(const ON_LinetypeSegment&) = default;
99 
100  bool operator==( const ON_LinetypeSegment& src) const;
101  bool operator!=( const ON_LinetypeSegment& src) const;
102 
103  // For a curve to be drawn starting at the start point
104  // and ending at the endpoint, the first segment
105  // in the pattern must be a stLine type
106  enum class eSegType : unsigned int
107  {
108  Unset = 0,
109  stLine = 1,
110  stSpace = 2
111  };
112 
113  static ON_LinetypeSegment::eSegType SegmentTypeFromUnsigned(
114  unsigned int segment_type_as_unsigned
115  );
116 
118  double segment_length,
119  ON_LinetypeSegment::eSegType segment_type
120  );
121 
122  void Dump( class ON_TextLog& ) const;
123 
124  // do not add read/write functions to this class
125 
126  double m_length = 0.0; // length in millimeters on printed output
129 private:
130  unsigned int m_reserved2 = 0;
131 };
132 
133 #if defined(ON_DLL_TEMPLATE)
134 
135 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_LinetypeSegment>;
136 
137 #endif
138 
139 #endif
ON_UUID is a 16 byte universally unique identifier.
Definition: opennurbs_uuid.h:32
Objects can have per viewport display properties that override a viewport&#39;s default display propertie...
Definition: opennurbs_linestyle.h:45
class ON_LinetypeSegment
Definition: opennurbs_linestyle.h:88
Definition: opennurbs_textlog.h:20
eSegType
Definition: opennurbs_linestyle.h:107