X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Expression.h;h=a4a481b20f9e0216ccda54bbaf8368905244a2c8;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=fd00670cc7618efe8a9260f50b4ff010fde77013;hpb=423c10234142d14d0d5de89383f2f96a4ec5930f;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Expression.h b/src/ModelAPI/ModelAPI_Expression.h index fd00670cc..a4a481b20 100644 --- a/src/ModelAPI/ModelAPI_Expression.h +++ b/src/ModelAPI/ModelAPI_Expression.h @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: ModelAPI_Expression.h -// Created: 5 Aug 2015 -// Author: Sergey POKHODENKO +// Copyright (C) 2014-2023 CEA, EDF +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef ModelAPI_Expression_H_ #define ModelAPI_Expression_H_ @@ -30,10 +43,10 @@ class ModelAPI_Expression MODELAPI_EXPORT virtual void setInitialized(); /// Sets the text of this Expression - MODELAPI_EXPORT virtual void setText(const std::string& theText) = 0; + MODELAPI_EXPORT virtual void setText(const std::wstring& theText) = 0; /// Returns the text of this Expression - MODELAPI_EXPORT virtual std::string text() const = 0; + MODELAPI_EXPORT virtual std::wstring text() const = 0; /// Allows to set expression (text) as invalid (by the parameters listener) MODELAPI_EXPORT virtual void setInvalid(const bool theFlag) = 0; @@ -49,19 +62,26 @@ class ModelAPI_Expression /// Defines the used parameters (by the parameters listener) MODELAPI_EXPORT virtual - void setUsedParameters(const std::set& theUsedParameters) = 0; + void setUsedParameters(const std::set& theUsedParameters) = 0; /// Returns the used parameters - MODELAPI_EXPORT virtual std::set usedParameters() const = 0; + MODELAPI_EXPORT virtual std::set usedParameters() const = 0; /// Returns True if the given string can be defined as a name of an expression variable MODELAPI_EXPORT static bool isVariable(const std::string& theString); + /// Returns True if the given string can be defined as a name of an expression variable + MODELAPI_EXPORT static bool isVariable(const std::wstring& theString); + protected: /// Objects are created for features automatically MODELAPI_EXPORT ModelAPI_Expression(); /// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc) MODELAPI_EXPORT virtual void reinit() = 0; + /// Resets attribute to deafult state. + MODELAPI_EXPORT virtual void reset() { + myIsInitialized = false; + }; bool myIsInitialized; ///< is some value assigned to this attribute