Version: 9.12.0
SALOMEDSImpl_AttributeStudyProperties.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // File : SALOMEDSImpl_AttributeStudyProperties.hxx
24 // Author : Sergey RUIN
25 // Module : SALOME
26 //
27 #ifndef _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
28 #define _SALOMEDSImpl_AttributeStudyProperties_HeaderFile
29 
30 #include "SALOMEDSImpl_Defines.hxx"
31 #include "DF_Attribute.hxx"
32 #include "DF_Label.hxx"
33 #include <string>
34 #include <vector>
35 #include <map>
37 
39 {
40 public:
43 
44  static const std::string& GetID();
45  const std::string& ID() const;
46 
47  static SALOMEDSImpl_AttributeStudyProperties* Set(const DF_Label& label);
48 
49  void Init();
50 
51  virtual std::string Save();
52  virtual void Load(const std::string&);
53 
54  void SetModification(const std::string& theUserName,
55  const int theMinute,
56  const int theHour,
57  const int theDay,
58  const int theMonth,
59  const int theYear);
60  void GetModifications(std::vector<std::string>& theUserNames,
61  std::vector<int>& theMinutes,
62  std::vector<int>& theHours,
63  std::vector<int>& theDays,
64  std::vector<int>& theMonths,
65  std::vector<int>& theYears) const;
66 
67  std::string GetCreatorName() const;
68  bool GetCreationDate(int& theMinute,
69  int& theHour,
70  int& theDay,
71  int& theMonth,
72  int& theYear) const;
73 
74  void ChangeCreatorName(const std::string& theUserName);
75 
76  void SetUnits(const std::string& theUnits);
77  std::string GetUnits() const;
78 
79  void SetComment(const std::string& theComment);
80  std::string GetComment() const;
81 
82  void SetCreationMode(const int theMode);
83  int GetCreationMode() const;
84 
85  void SetModified(const int theModified);
86  bool IsModified() const;
87  int GetModified() const;
88 
89  void SetLocked(const bool theLocked);
90  bool IsLocked() const;
91  bool IsLockChanged(const bool theErase);
92 
93  void SetComponentsVersions( const std::map< std::string, std::vector<std::string> >& theVersions );
94  void SetComponentVersion(const std::string& theComponent, const std::string& theVersion);
95  std::vector<std::string> GetStoredComponents() const;
96  std::string GetComponentVersion(const std::string& theComponent) const;
97  std::vector<std::string> GetComponentVersions(const std::string& theComponent) const;
98  std::map< std::string, std::vector<std::string> > GetComponentsVersions() const;
99 
100  void Restore(DF_Attribute* with);
101  DF_Attribute* NewEmpty() const;
102  void Paste(DF_Attribute* into);
103 
104 private:
105  typedef std::vector<std::string> versionList;
106  typedef std::map<std::string, versionList> versionMap;
107 
108  std::vector<std::string> myUserName;
109  std::vector<int> myMinute;
110  std::vector<int> myHour;
111  std::vector<int> myDay;
112  std::vector<int> myMonth;
113  std::vector<int> myYear;
114  std::string myUnits;
115  std::string myComment;
116  int myMode;
118  bool myLocked;
121 };
122 
123 #endif
#define SALOMEDSIMPL_EXPORT
Definition: SALOMEDSImpl_Defines.hxx:34
Definition: DF_Attribute.hxx:30
virtual void Restore(DF_Attribute *theAttribute)=0
virtual const std::string & ID() const =0
virtual std::string Save()
Definition: DF_Attribute.hxx:47
virtual void Load(const std::string &)
Definition: DF_Attribute.hxx:48
virtual DF_Attribute * NewEmpty() const =0
virtual void Paste(DF_Attribute *theIntoAttribute)=0
Definition: DF_Label.hxx:65
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:39
std::vector< int > myYear
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:113
std::vector< int > myMonth
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:112
std::vector< int > myDay
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:111
~SALOMEDSImpl_AttributeStudyProperties()
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:42
std::vector< int > myMinute
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:109
std::map< std::string, versionList > versionMap
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:106
std::vector< std::string > versionList
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:105
int myModified
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:117
int myMode
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:116
std::string myUnits
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:114
std::string myComment
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:115
bool myLocked
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:118
versionMap myComponentVersions
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:120
std::vector< std::string > myUserName
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:108
bool myLockChanged
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:119
std::vector< int > myHour
Definition: SALOMEDSImpl_AttributeStudyProperties.hxx:110
Definition: SALOMEDSImpl_GenericAttribute.hxx:39
def Init()
Definition: salome_ComponentGUI.py:84
def GetComponentVersion(theComponent, all_versions=False)
Definition: salome_study.py:232