Salome HOME
Implement double sided map for displayed objects in order to improve performance
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultCompSolid.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef ModelAPI_ResultCompSolid_H_
22 #define ModelAPI_ResultCompSolid_H_
23
24 #include "ModelAPI_Result.h"
25 #include "ModelAPI_ResultBody.h"
26 #include <string>
27
28 /**\class ModelAPI_ResultCompSolid
29 * \ingroup DataModel
30 * \brief The comp solid (container of results) result of a feature.
31 *
32 * Provides a conainer of body result that may be displayed in the viewer.
33 */
34 class ModelAPI_ResultCompSolid : public ModelAPI_ResultBody
35 {
36 public:
37   MODELAPI_EXPORT virtual ~ModelAPI_ResultCompSolid();
38   /// Returns the group identifier of this result
39
40   /// Returns the number of sub-elements
41   virtual int numberOfSubs(bool forTree = false) const = 0;
42
43   /// Returns the sub-result by zero-base index
44   virtual std::shared_ptr<ModelAPI_ResultBody> subResult(const int theIndex,
45                                                          bool forTree = false) const = 0;
46
47   /// Returns true if feature or reuslt belong to this composite feature as subs
48   /// Returns theIndex - zero based index of sub if found
49   virtual bool isSub(ObjectPtr theObject, int& theIndex) const = 0;
50
51   /// Set displayed flag to the result and all sub results
52   /// \param theDisplay a boolean value
53   MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay);
54
55 protected:
56 };
57
58 //! Pointer on feature object
59 typedef std::shared_ptr<ModelAPI_ResultCompSolid> ResultCompSolidPtr;
60
61 #endif