54class ARCANE_MESH_EXPORT ItemConnectivitySelector
61 virtual ~ItemConnectivitySelector()
67 ARCCORE_DEPRECATED_2021(
"This method always return 'nullptr'")
70 ARCCORE_DEPRECATED_2021(
"This method doesn't do anything")
72 virtual void checkValidConnectivityList()
const =0;
73 virtual void compactConnectivities() =0;
77 void setPreAllocatedSize(
Integer size);
78 Integer preAllocatedSize()
const {
return m_pre_allocated_size; }
79 Int32 itemConnectivityIndex()
const {
return m_item_connectivity_index; }
83 virtual void _createCustomConnectivity(
const String& name) =0;
84 virtual void _buildCustomConnectivity() =0;
90 String m_connectivity_name;
93 Int32 m_item_connectivity_index;
104class ARCANE_MESH_EXPORT ItemConnectivitySelectorT
105:
public ItemConnectivitySelector
110 const String& connectivity_name)
111 : ItemConnectivitySelector(source_family,target_family,connectivity_name,ConnectivityIndexType::connectivityIndex())
112 , m_custom_connectivity(
nullptr)
115 ~ItemConnectivitySelectorT()
124 return trueCustomConnectivity();
127 void checkValidConnectivityList()
const override
129 if (m_item_connectivity_index<0)
131 auto x = m_item_connectivity_list;
133 x->containerView(m_item_connectivity_index).
checkSame(ref_con_view);
136 void compactConnectivities()
override
138 if (m_custom_connectivity)
139 m_custom_connectivity->compactConnectivityList();
146 if (m_custom_connectivity)
147 m_custom_connectivity->addConnectedItem(item_lid,sub_item_lid);
152 if (m_custom_connectivity)
153 m_custom_connectivity->removeConnectedItem(item_lid,sub_item_lid);
158 if (m_custom_connectivity)
159 m_custom_connectivity->removeConnectedItems(item_lid);
164 if (m_custom_connectivity)
165 m_custom_connectivity->replaceConnectedItems(item_lid,sub_item_lids);
170 if (m_custom_connectivity)
171 m_custom_connectivity->replaceConnectedItem(item_lid,index,sub_item_lid);
176 if (m_custom_connectivity)
177 return m_custom_connectivity->hasConnectedItem(source_item,target_local_id);
182 CustomType* trueCustomConnectivity()
const {
return m_custom_connectivity; }
186 void _createCustomConnectivity(
const String& name)
override
188 m_custom_connectivity =
new CustomType(m_source_family,m_target_family,name);
193 template <
class SourceFamily,
class TargetFamily>
194 void _createCustomConnectivity(
const String& name)
196 m_custom_connectivity =
new typename CustomConnectivity<SourceFamily,TargetFamily>::type(m_source_family,m_target_family,name);
199 void _buildCustomConnectivity()
override
203 if (m_custom_connectivity)
204 m_custom_connectivity->setItemConnectivityList(m_item_connectivity_list,
205 m_item_connectivity_index);
210 template<
class SourceFamily,
class TargetFamily>
216 _createCustomConnectivity<SourceFamily,TargetFamily>(m_connectivity_name);
217 info() <<
"Family: " << m_source_family->fullName()
218 <<
" create new connectivity: " << m_connectivity_name;
220 _buildCustomConnectivity();
226 CustomType* m_custom_connectivity;