1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef SALOMEDSImpl_IParameters_H
20 #define SALOMEDSImpl_IParameters_H
26 #include "SALOMEDSImpl_AttributeParameter.hxx"
27 #include "SALOMEDSImpl_Study.hxx"
30 Class which an interface to store the parameters of the objects
32 class SALOMEDSImpl_IParameters
35 SALOMEDSImpl_IParameters(const Handle(SALOMEDSImpl_AttributeParameter)& ap);
37 virtual ~SALOMEDSImpl_IParameters();
40 Appends a string value to a named list.
41 Returns a number of the added value.
42 Note: the name of the list MUST be unique
44 virtual int append(const std::string& listName, const std::string& value);
47 Returns a number elements in the list
49 virtual int nbValues(const std::string& listName);
52 Returns a list of values in the list
54 virtual std::vector<std::string> getValues(const std::string& listName);
57 Returns a value with given %index, where %index is in range [0:nbValues-1]
59 virtual std::string getValue(const std::string& listName, int index);
62 Returns a list all entries lists
64 virtual std::vector<std::string> getLists();
67 Sets a new named parameter value for the given entry
69 virtual void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value);
72 Gets a named parameter value for the given entry
74 virtual std::string getParameter(const std::string& entry, const std::string& parameterName);
77 Returns all parameter names of the given entry
79 virtual std::vector<std::string> SALOMEDSImpl_IParameters::getAllParameterNames(const std::string& entry);
82 Returns all parameter values of the given entry
84 virtual std::vector<std::string> SALOMEDSImpl_IParameters::getAllParameterValues(const std::string& entry);
87 Returns a number of parameters of the given entry
89 virtual int getNbParameters(const std::string& entry);
92 Returns a list all entries
94 virtual std::vector<std::string> getEntries();
97 Sets a global named property value
99 virtual void setProperty(const std::string& name, const std::string& value);
102 Gets a value of global named property
104 virtual std::string getProperty(const std::string& name);
107 Returns a list all properties
109 virtual std::vector<std::string> getProperties();
112 Returns decoded entry that is an absolute entry
114 virtual std::string decodeEntry(const std::string& entry);
118 Returns whether there is the dumping visual parameters
120 static bool isDumpPython(const Handle(SALOMEDSImpl_Study)& study, const string& theID = "");
123 Returns an ID of the last save point
125 static int getLastSavePoint(const Handle(SALOMEDSImpl_Study)& study, const std::string& theID = "");
128 Returns a Python script for the study, which sets up visual parameters
130 static std::string getStudyScript(const Handle(SALOMEDSImpl_Study)& study, int savePoint, const std::string& theID = "");
133 Returns a default Python script that set ups visual parameters for the given module
134 shift is a string that contain spaces to make valid Python script indentaion
136 static std::string getDefaultScript(const Handle(SALOMEDSImpl_Study)& study,
137 const std::string& moduleName,
138 const std::string& shift,
139 const std::string& theID = "");
142 Returns a default name of the component where the visula parameters are stored.
144 static std::string getDefaultVisualComponent();
147 Handle(SALOMEDSImpl_AttributeParameter) _ap;
148 Handle(SALOMEDSImpl_Study) _study;
149 std::map<std::string, std::string> _compNames;