DATAKIT SDK  V2026.4
util_selection_set.hpp
Go to the documentation of this file.
1 #ifndef _UTIL_SELECTION_SET_HPP_
2 #define _UTIL_SELECTION_SET_HPP_
3 #include "def/define.h"
8 #include "util/error_dtk.hpp"
9 #include "util/util_ent_dtk.hpp"
10 #include "util/util_stl_dtk.hpp"
11 #include <cstdio>
12 #include <memory>
13 
14 
15 class Dtk_SelectionSet;
18 
19 //! \ingroup SelectionSetClasses
20 //! \class Dtk_SelectionSet
21 //! \brief Dtk_SelectionSet represents a Selection Set entity which enables selecting a group of entities in a CAD Model.
22 //! \SmartPtr{Dtk_SelectionSetPtr}
24 {
25 protected:
26 
27  struct Dtk_Handle; // Not defined here
28  std::unique_ptr<Dtk_Handle> _Private; // Handle
29 
30  enum {
32  };
33 
34  //! \brief Default constructor
36 
37  //! \brief Copy constructor
38  //! \param selectionSet the Dtk_SelectionSet to be copied
39  Dtk_SelectionSet(const Dtk_SelectionSet& selectionSet);
40 
41  //! \brief Destructor
43 
44  inline virtual Dtk_Object* Clone() { return new Dtk_SelectionSet(*this); }
45 
46  friend class Dtk_SmartPtr<Dtk_SelectionSet>;
47 
48 public:
49  //! \DtkDynamicType
51  {
52  if (inId == _typeID)
53  {
54  return 1;
55  }
56  return Dtk_Object::DtkDynamicType(inId);
57  }
58 
59  //! \DtkDynamicCast
61  {
62  if(s->DtkDynamicType(_typeID))
63  return static_cast<Dtk_SelectionSet*>(s);
64  return NULL;
65  }
66 
67  //! \return The type of the entity type - DTK_TYPE_SELECTION_SET -
69 
71 
72  //! \CreateBase
74 
75  //! \brief Delete object
77 
78  //! \brief Dump the Selection Set entities
79  //! \param inFile the output file
80  //!
81  //! \b Sample
82  //! \code
83  //! Dtk_string fileName = ...;
84  //! File * file = fileName.OpenFile(DTK_W);
85  //!
86  //! Dtk_SelectionSetPtr selectionSet;
87  //! // Read the Selection Set
88  //! selectionSet.Dump(file);
89  //! \endcode
90  Dtk_ErrorStatus Dump(FILE * inFile);
91 
92  //! \brief Returns the name of the Selection Set entity
94 
95  //! \brief Sets the name of the Selection Set entity
96  //! \param inName name
97  void SetName(const Dtk_string& inName);
98 
99  //! \brief Adds a new Node Connector to the pool of connectors related to the Selection Set object
101 
102  //! \brief Adds a sub SelectionSet related to the Selection Set object
104 
105  //! \brief Returns the array of connectors specifying the group of entities defined in the Selection Set object
107 
108  //! \brief Returns the array of sub SelectionSet specifying the group of entities defined in the Selection Set object
110 
111  //! \brief Returns the Number of connectors specifying the group of entities defined in the Selection Set object
113 
114  //! \brief Returns the Number of SelectionSet specifying the group of entities defined in the Selection Set object
116 
117  //! \brief Returns the connector of Selection Set defined by its position
119 
120  //! \brief Returns the SelectionSet of Selection Set defined by its position
122 };
123 
124 #endif
125 
126 
Dtk_SelectionSet::Dtk_SelectionSet
Dtk_SelectionSet()
Default constructor.
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_SelectionSet::Dump
Dtk_ErrorStatus Dump(FILE *inFile)
Dump the Selection Set entities.
Dtk_SelectionSetPtr
Dtk_SmartPtr< Dtk_SelectionSet > Dtk_SelectionSetPtr
Definition: util_selection_set.hpp:15
Dtk_SelectionSet::~Dtk_SelectionSet
~Dtk_SelectionSet()
Destructor.
DTK_TYPE_SELECTION_SET
@ DTK_TYPE_SELECTION_SET
Definition: define.h:555
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:711
Dtk_SelectionSet::GetName
Dtk_string GetName() const
Returns the name of the Selection Set entity.
Dtk_SelectionSet::Transform
Dtk_ErrorStatus Transform(const Dtk_transfo &inTransfo)
Dtk_SelectionSet::_Private
std::unique_ptr< Dtk_Handle > _Private
Definition: util_selection_set.hpp:27
Dtk_SelectionSet::GetNodeConnectorByPos
Dtk_NodeConnectorPtr GetNodeConnectorByPos(const Dtk_Size_t &inPos) const
Returns the connector of Selection Set defined by its position.
Dtk_SelectionSet::AddNodeConnector
Dtk_ErrorStatus AddNodeConnector(const Dtk_NodeConnectorPtr &inNodeConnector)
Adds a new Node Connector to the pool of connectors related to the Selection Set object.
Dtk_SelectionSet::Clone
virtual Dtk_Object * Clone()
Definition: util_selection_set.hpp:44
Dtk_SelectionSet
Dtk_SelectionSet represents a Selection Set entity which enables selecting a group of entities in a C...
Definition: util_selection_set.hpp:24
util_ent_dtk.hpp
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:686
dtk_maindoc_ptr.hpp
Dtk_SelectionSet::GetSelectionSetsNb
Dtk_Size_t GetSelectionSetsNb() const
Returns the Number of SelectionSet specifying the group of entities defined in the Selection Set obje...
Dtk_SelectionSet::DtkDynamicCast
static Dtk_SelectionSet * DtkDynamicCast(Dtk_Object *s)
Performs a dynamic cast - doesn't need RTTI -.
Definition: util_selection_set.hpp:60
error_dtk.hpp
Dtk_SelectionSet::Dtk_SelectionSet
Dtk_SelectionSet(const Dtk_SelectionSet &selectionSet)
Copy constructor.
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_SelectionSet::DtkDynamicType
Dtk_Int32 DtkDynamicType(const Dtk_Int32 &inId)
Retrieves the dynamic entity type.
Definition: util_selection_set.hpp:50
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
dtk_transfo.hpp
type_detk
type_detk
Definition: define.h:21
util_stl_dtk.hpp
define.h
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:84
Dtk_SelectionSetTab
Dtk_tab< Dtk_SelectionSetPtr > Dtk_SelectionSetTab
Definition: util_selection_set.hpp:17
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0
Dtk_SelectionSet::AddSelectionSet
Dtk_ErrorStatus AddSelectionSet(const Dtk_SelectionSetPtr &inSelectionSet)
Adds a sub SelectionSet related to the Selection Set object.
Dtk_SelectionSet::GetSelectionSet
Dtk_tab< Dtk_SelectionSetPtr > GetSelectionSet() const
Returns the array of sub SelectionSet specifying the group of entities defined in the Selection Set o...
Dtk_SelectionSet::Create
static Dtk_SelectionSetPtr Create()
Calls default constructor to allocate a new object.
Dtk_Object
Definition: dtk_object.hpp:8
Dtk_SelectionSet::Release
static Dtk_SelectionSetPtr Release(Dtk_SelectionSetPtr inSelectionSet)
Delete object.
dtk_string.hpp
Dtk_SelectionSet::get_type_detk
type_detk get_type_detk() const
Definition: util_selection_set.hpp:68
Dtk_SelectionSet::_typeID
@ _typeID
Definition: util_selection_set.hpp:31
Dtk_SelectionSet::SetName
void SetName(const Dtk_string &inName)
Sets the name of the Selection Set entity.
Dtk_SelectionSet::GetSelectionSetByPos
Dtk_SelectionSetPtr GetSelectionSetByPos(const Dtk_Size_t &inPos) const
Returns the SelectionSet of Selection Set defined by its position.
dtk_object.hpp
Dtk_SelectionSet::GetNodeConnectorsNb
Dtk_Size_t GetNodeConnectorsNb() const
Returns the Number of connectors specifying the group of entities defined in the Selection Set object...
Dtk_SelectionSet::GetNodeConnectors
Dtk_tab< Dtk_NodeConnectorPtr > GetNodeConnectors() const
Returns the array of connectors specifying the group of entities defined in the Selection Set object.
Dtk_Entity
Definition: util_ent_dtk.hpp:367