X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModel%2FModel_AttributeRefAttr.h;h=81fbaac5255b9e83c34b7c64bb2edff4ae2a00a0;hb=4635fa2d17f7d9cca2892169b7372ffa37cd2180;hp=efb879c6d5f35a1e833708550221a10296f76ea2;hpb=4cbd08290dc7a540e3fa93913d484e8336df90d9;p=modules%2Fshaper.git diff --git a/src/Model/Model_AttributeRefAttr.h b/src/Model/Model_AttributeRefAttr.h index efb879c6d..81fbaac52 100644 --- a/src/Model/Model_AttributeRefAttr.h +++ b/src/Model/Model_AttributeRefAttr.h @@ -1,6 +1,21 @@ -// File: Model_AttributeRefAttr.h -// Created: 8 May 2014 -// Author: Mikhail PONIKAROV +// Copyright (C) 2014-2020 CEA/DEN, EDF R&D +// +// 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 Model_AttributeRefAttr_H_ #define Model_AttributeRefAttr_H_ @@ -19,18 +34,19 @@ class Model_AttributeRefAttr : public ModelAPI_AttributeRefAttr { - Handle_TDF_Reference myRef; ///< reference to the feature label - ///< ID of the referenced attirbute (empty if this is a reference to a feature) + Handle_TDF_Reference myRef; ///< reference to the feature label + TDF_Label myLab; ///< the main label of this attribute + ///< ID of the referenced attribute (empty if this is a reference to a feature) Handle_TDataStd_Comment myID; -public: + public: /// Returns true if this attribute references to a object (not to the attribute) MODEL_EXPORT virtual bool isObject(); /// Defines the reference to the attribute - MODEL_EXPORT virtual void setAttr(boost::shared_ptr theAttr); + MODEL_EXPORT virtual void setAttr(std::shared_ptr theAttr); /// Returns attribute referenced from this attribute - MODEL_EXPORT virtual boost::shared_ptr attr(); + MODEL_EXPORT virtual std::shared_ptr attr(); /// Defines the reference to the object MODEL_EXPORT virtual void setObject(ObjectPtr theFeature); @@ -38,9 +54,14 @@ public: /// Returns object referenced from this attribute MODEL_EXPORT virtual ObjectPtr object(); -protected: + /// Returns true if attribute was initialized by some value + MODEL_EXPORT virtual bool isInitialized(); + + protected: /// Objects are created for features automatically MODEL_EXPORT Model_AttributeRefAttr(TDF_Label& theLabel); + /// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc) + virtual void reinit(); friend class Model_Data; };