Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MeshMaterialBackup.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* MeshMaterialBackup.h (C) 2000-2023 */
9/* */
10/* Sauvegarde/restauration des valeurs des matériaux et milieux. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_MESHMATERIALBACKUP_H
13#define ARCANE_MATERIALS_MESHMATERIALBACKUP_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/ArrayView.h"
19#include "arcane/utils/Array.h"
20#include "arcane/utils/Ref.h"
21#include "arcane/utils/String.h"
22
23#include "arcane/core/ItemUniqueId.h"
24
26
27#include <map>
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32namespace Arcane::Materials
33{
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
49class ARCANE_MATERIALS_EXPORT MeshMaterialBackup
50: public TraceAccessor
51{
52 struct VarData;
53
54 public:
55
58
59 public:
60
62 void setCompressorServiceName(const String& name);
63 const String& compressorServiceName() const { return m_compressor_service_name; }
64
65 public:
66
67 void saveValues();
68 void restoreValues();
69
70 private:
71
72 IMeshMaterialMng* m_material_mng;
73 bool m_use_unique_ids;
74 std::map<IMeshMaterialVariable*, VarData*> m_saved_data;
75 std::map<IMeshComponent*, SharedArray<Int32>> m_ids_array;
76 std::map<IMeshComponent*, SharedArray<ItemUniqueId>> m_unique_ids_array;
78 bool m_use_v2 = false;
79 String m_compressor_service_name;
80
81 private:
82
83 void _save();
84 void _restore();
85 void _saveIds(IMeshComponent* component);
86 bool _isValidComponent(IMeshMaterialVariable* var, IMeshComponent* component);
87 void _saveV1();
88 void _saveV2();
89 void _restoreV1();
90 void _restoreV2();
91};
92
93/*---------------------------------------------------------------------------*/
94/*---------------------------------------------------------------------------*/
95
96}
97
98/*---------------------------------------------------------------------------*/
99/*---------------------------------------------------------------------------*/
100
101#endif
102
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Interface d'un composant (matériau ou milieu) d'un maillage.
Interface du gestionnaire des matériaux et des milieux d'un maillage.
Interface d'une variable matériau d'un maillage.
Sauvegarde/restoration des valeurs des matériaux et milieux.
Chaîne de caractères unicode.
Active toujours les traces dans les parties Arcane concernant les matériaux.