1 // Project MULTIPR, IOLS WP1.2.1 - EDF/CS
2 // Partitioning/decimation module for the SALOME v3.2 platform
5 * \file MULTIPR_Profil.hxx
7 * \brief Class Profil used to managed MED profil.
8 * Profil is just a list of indices related to elements (NODES, CELLS).
9 * !!! currently not used !!!
11 * \author Olivier LE ROUX - CS, Virtual Reality Dpt
16 #ifndef MULTIPR_PROFIL_HXX
17 #define MULTIPR_PROFIL_HXX
19 //*****************************************************************************
21 //*****************************************************************************
35 //*****************************************************************************
37 //*****************************************************************************
44 * Builds an empty profil (default constructor).
49 * Destructor. Removes everything.
54 * Resets this object in its state by default (empty). Cleans memory.
59 * Creates a profil from its name (reset before).
60 * \param pName name of the profil to be created.
61 * \throw NullArgumentException if pName is NULL.
63 void create(const char* pName);
65 //---------------------------------------------------------------------
66 // Basic accessors/mutators
67 //---------------------------------------------------------------------
70 * Returns the name of this profil.
71 * \return the name of this profil.
73 const char* getName() const;
76 * Returns the nth elements of this profil.
77 * \param pIndex index of the element to get; must be in [0..NUMBER_OF_ELEMENTS-1].
78 * \return the nth elements of this profil.
79 * \throw IndexOutOfBoundsException if index is invalid.
81 med_int get(med_int pIndex) const;
84 * Adds a new element to this profil.
85 * \param pElt element to be added; must be >= 1.
87 void add(med_int pElt);
89 //---------------------------------------------------------------------
91 //---------------------------------------------------------------------
94 * Reads a Profil from a MED file.
95 * \param pMEDfile any valid MED file opened for reading.
96 * \param pIndexProfil index of the profil to be read; must be >= 1.
97 * \throw IOException if any i/o error occurs.
99 void readMED(med_idt pMEDfile, med_int pIndexProfil);
102 * Writes this profil to a MED file.
103 * \param pMEDfile any valid MED file opened for writing.
104 * \throw IOException if any i/o error occurs.
106 void writeMED(med_idt pMEDfile);
109 * Dumps any Profil to the given output stream.
110 * \param pOs any output stream.
111 * \param pP any Profil.
112 * \return the output stream pOs.
114 friend std::ostream& operator<<(std::ostream& pOs, Profil& pP);
118 char mName[MED_TAILLE_NOM + 1]; /**< Name of the profil. */
119 std::vector<med_int> mTable; /**< Table of elements. */
123 // do not allow copy constructor
124 Profil(const Profil&);
127 Profil& operator=(const Profil&);
129 // do not allow operator ==
130 bool operator==(const Profil&);
135 } // namespace MULTIPR
138 #endif // MULTIPR_PROFIL_HXX