opennurbs_group.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_GROUP_INC_)
18 #define OPENNURBS_GROUP_INC_
19 
20 class ON_CLASS ON_Group : public ON_ModelComponent
21 {
22  ON_OBJECT_DECLARE(ON_Group);
23 
24 public:
25  static const ON_Group Unset; // nil id
26 
27  /*
28  Parameters:
29  model_component_reference - [in]
30  none_return_value - [in]
31  value to return if ON_Material::Cast(model_component_ref.ModelComponent())
32  is nullptr
33  Returns:
34  If ON_Material::Cast(model_component_ref.ModelComponent()) is not nullptr,
35  that pointer is returned. Otherwise, none_return_value is returned.
36  */
37  static const ON_Group* FromModelComponentRef(
38  const class ON_ModelComponentReference& model_component_reference,
39  const ON_Group* none_return_value
40  );
41 
42 public:
43  ON_Group() ON_NOEXCEPT;
44  ON_Group(const ON_Group& src);
45  ~ON_Group() = default;
46  ON_Group& operator=(const ON_Group& src) = default;
47 
48 private:
49 
50  //////////////////////////////////////////////////////////////////////
51  //
52  // ON_Object overrides
53  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
54 
55  void Dump(
56  ON_TextLog& text_log
57  ) const override;
58 
59  bool Write(
60  ON_BinaryArchive& archive
61  ) const override;
62 
63  bool Read(
64  ON_BinaryArchive& archive
65  ) override;
66 
67 private:
68  bool Internal_WriteV5(
69  ON_BinaryArchive& archive
70  ) const;
71 
72  bool Internal_ReadV5(
73  ON_BinaryArchive& archive
74  );
75 };
76 
77 #if defined(ON_DLL_TEMPLATE)
78 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Group*>;
79 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Group*>;
80 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Group>;
81 #endif
82 
83 #endif
static const ON_Group Unset
Definition: opennurbs_group.h:25
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_array.h:36
Definition: opennurbs_group.h:20
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_textlog.h:20
Definition: opennurbs_archive.h:1783
Definition: opennurbs_model_component.h:1622