X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_ResultConstruction.h;h=2ac871e02b52fdf7c78c1749508baac7910bf075;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=5c37e9961c05091e57676cc381059e95f6e86c84;hpb=4cbd08290dc7a540e3fa93913d484e8336df90d9;p=modules%2Fshaper.git diff --git a/src/Model/Model_ResultConstruction.h b/src/Model/Model_ResultConstruction.h index 5c37e9961..2ac871e02 100644 --- a/src/Model/Model_ResultConstruction.h +++ b/src/Model/Model_ResultConstruction.h @@ -1,14 +1,33 @@ -// File: ModelAPI_ResultConstruction.hxx -// Created: 07 Jul 2014 -// Author: Mikhail PONIKAROV +// Copyright (C) 2014-2023 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_ResultConstruction_H_ #define Model_ResultConstruction_H_ #include "Model.h" #include +#include -/**\class ModelAPI_ResultConstruction +class ModelAPI_Document; +class TDF_Label; + +/**\class Model_ResultConstruction * \ingroup DataModel * \brief The construction element result of a feature. * @@ -17,26 +36,51 @@ */ class Model_ResultConstruction : public ModelAPI_ResultConstruction { - boost::shared_ptr myOwner; ///< owner of this result - boost::shared_ptr myShape; ///< shape of this result created "on the fly" - bool myIsInHistory; -public: - /// By default object is displayed in the object browser. - MODEL_EXPORT virtual bool isInHistory() {return myIsInHistory;} - + std::shared_ptr myOwner; ///< owner of this result + std::shared_ptr myShape; ///< shape of this result created "on the fly" + public: + /// Retuns the parameters of color definition in the resources config manager + MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName, + std::string& theDefault); + + /// By default object is displayed in the object browser. + MODEL_EXPORT virtual bool isInHistory(); /// Sets the result - MODEL_EXPORT virtual void setShape(boost::shared_ptr theShape); + MODEL_EXPORT virtual void setShape(std::shared_ptr theShape); /// Returns the shape-result produced by this feature - MODEL_EXPORT virtual boost::shared_ptr& shape(); + MODEL_EXPORT virtual std::shared_ptr shape(); /// Sets the flag that it must be displayed in history (default is true) MODEL_EXPORT virtual void setIsInHistory(const bool myIsInHistory); -protected: + /// if the construction result may be used as faces, this method returns not zero number of faces + /// \param theUpdateNaming is false of keeping the naming structure untouched (on load) + MODEL_EXPORT virtual int facesNum(const bool theUpdateNaming = true); + /// if the construction result may be used as faces, this method returns face by zero based index + MODEL_EXPORT virtual std::shared_ptr face(const int theIndex); + /// Change the order of faces + MODEL_EXPORT + virtual void setFacesOrder(const std::list >& theFaces); + + /// By default object is not infinite. + MODEL_EXPORT virtual bool isInfinite(); + /// Sets the flag that it is infinite + MODEL_EXPORT virtual void setInfinite(const bool theInfinite); + /// The construction element may be concealed only by "delete" feature + MODEL_EXPORT virtual void setIsConcealed(const bool theValue, const bool theForced = false); + + /// Updates the shape taking the current value from the data structure, returns true + /// if update has been correctly done + MODEL_EXPORT virtual bool updateShape(); + + protected: /// Makes a body on the given feature Model_ResultConstruction(); - friend class Model_Document; + /// Stores shape in the data structure to allow identification it by the naming + void storeShape(std::shared_ptr theShape); + + friend class Model_Objects; }; #endif