1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_ResultCompSolid.h
4 // Created: 20 Jul 2015
5 // Author: Natalia ERMOLAEVA
7 #ifndef Model_ResultCompSolid_H_
8 #define Model_ResultCompSolid_H_
11 #include <ModelAPI_ResultCompSolid.h>
13 /**\class Model_ResultCompSolid
15 * \brief The compsolid (container of body results) result of a feature.
17 * Provides a container of shapes that may be displayed in the viewer.
19 class Model_ResultCompSolid : public ModelAPI_ResultCompSolid
22 /// All features of this sketch (list of references)
23 inline static const std::string& BODIES_ID()
25 static const std::string MY_BODIES_ID("Bodies");
29 /// Removes the stored builders
30 MODEL_EXPORT virtual ~Model_ResultCompSolid();
32 /// Request for initialization of data model of the object: adding all attributes
33 MODEL_EXPORT virtual void initAttributes();
35 /// Adds result to the sketch and to its document
36 /// \param theIndex an index of the created body result in the compsolid
37 /// The real index in the document of the result is an incremented given index
38 /// The reason is that the first index is used for the comp solid result on the data
39 virtual std::shared_ptr<ModelAPI_ResultBody> addResult(const int theIndex);
41 /// Returns the number of sub-elements
42 virtual int numberOfSubs(bool forTree = false) const;
44 /// Returns the sub-result by zero-base index
45 virtual std::shared_ptr<ModelAPI_ResultBody> subResult(const int theIndex,
46 bool forTree = false) const;
48 /// Returns the sub-feature unique identifier in this composite feature by zero-base index
49 //virtual int subResultId(const int theIndex) const;
51 /// Returns true if feature or reuslt belong to this composite feature as subs
52 virtual bool isSub(ObjectPtr theObject) const;
54 /// This method to inform that sub-feature is removed and must be removed from the internal data
55 /// structures of the owner (the remove from the document will be done outside just after)
56 virtual void removeResult(std::shared_ptr<ModelAPI_ResultBody> theResult);
59 /// Makes a body on the given feature
60 Model_ResultCompSolid();
62 friend class Model_Objects;