1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_ResultConstruction.hxx
4 // Created: 07 Jul 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef Model_ResultConstruction_H_
8 #define Model_ResultConstruction_H_
11 #include <ModelAPI_ResultConstruction.h>
14 /**\class Model_ResultConstruction
16 * \brief The construction element result of a feature.
18 * Provides a shape that may be displayed in the viewer.
19 * Intermediate, light result that in many cases produces a result on the fly.
21 class Model_ResultConstruction : public ModelAPI_ResultConstruction
23 std::shared_ptr<ModelAPI_Feature> myOwner; ///< owner of this result
24 std::shared_ptr<GeomAPI_Shape> myShape; ///< shape of this result created "on the fly"
25 bool myFacesUpToDate; ///< is true if faces in myuFaces are computed and up to date
26 /// stores the up to date faces if they exist
27 std::vector<std::shared_ptr<GeomAPI_Face> > myFaces;
31 /// Retuns the parameters of color definition in the resources config manager
32 MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName,
33 std::string& theDefault);
35 /// By default object is displayed in the object browser.
36 MODEL_EXPORT virtual bool isInHistory()
42 MODEL_EXPORT virtual void setShape(std::shared_ptr<GeomAPI_Shape> theShape);
43 /// Returns the shape-result produced by this feature
44 MODEL_EXPORT virtual std::shared_ptr<GeomAPI_Shape> shape();
46 /// Sets the flag that it must be displayed in history (default is true)
47 MODEL_EXPORT virtual void setIsInHistory(const bool myIsInHistory);
49 /// if the construction result may be used as faces, this method returns not zero number of faces
50 MODEL_EXPORT virtual int facesNum();
51 /// if the construction result may be used as faces, this method returns face by zero based index
52 MODEL_EXPORT virtual std::shared_ptr<GeomAPI_Face> face(const int theIndex);
54 /// By default object is not infinite.
55 MODEL_EXPORT virtual bool isInfinite();
56 /// Sets the flag that it is infinite
57 MODEL_EXPORT virtual void setInfinite(const bool theInfinite);
58 /// The construction element is never concealed
59 MODEL_EXPORT virtual void setIsConcealed(const bool theValue);
62 /// Makes a body on the given feature
63 Model_ResultConstruction();
65 friend class Model_Objects;