]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_ResultPart.h
Salome HOME
Make the movement, placement and rotation 3D features may be applied to the Part...
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultPart.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_ResultPart.h
4 // Created:     07 Jul 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ModelAPI_ResultPart_H_
8 #define ModelAPI_ResultPart_H_
9
10 #include "ModelAPI_Result.h"
11
12 #include <string>
13
14 /**\class ModelAPI_ResultPart
15  * \ingroup DataModel
16  * \brief The Part document, result of a creation of new part feature.
17  *
18  * This result leaves without feature: no parametricity for this element,
19  * only add/remove, undo/redo.
20  */
21 class ModelAPI_ResultPart : public ModelAPI_Result
22 {
23  public:
24   /// Returns the group identifier of this result
25   MODELAPI_EXPORT virtual std::string groupName();
26
27   /// Returns the group identifier of this result
28   inline static std::string group()
29   {
30     static std::string MY_GROUP = "Parts";
31     return MY_GROUP;
32   }
33
34   /// part document reference attribute
35   inline static const std::string& DOC_REF()
36   {
37     static const std::string MY_DOC_REF("PartDocument");
38     return MY_DOC_REF;
39   }
40
41   /// default color for a result body
42   inline static const std::string& DEFAULT_COLOR()
43   {
44     static const std::string RESULT_BODY_COLOR("96,157,255");
45     return RESULT_BODY_COLOR;
46   }
47
48   // Part result can not be cencealed, even by the movement features
49   MODELAPI_EXPORT virtual bool isConcealed();
50
51   /// Returns the part-document of this result
52   virtual std::shared_ptr<ModelAPI_Document> partDoc() = 0;
53
54   /// Sets this document as current and if it is not loaded yet, loads it
55   virtual void activate() = 0;
56
57   /// Returns true if document is activated (loaded into the memory)
58   virtual bool isActivated() = 0;
59
60   /// Returns the name of the shape inside of the part
61   virtual std::string nameInPart(const std::shared_ptr<GeomAPI_Shape>& theShape,
62     int& theIndex) = 0;
63   /// Updates the selection inside of the part by the selection index
64   virtual bool updateInPart(const int theIndex) = 0;
65
66   /// Applies the additional transformation ofthe part
67   virtual void setShape(std::shared_ptr<ModelAPI_Result> theThis, 
68     const std::shared_ptr<GeomAPI_Shape>& theTransformed) = 0;
69
70   /// Returns the shape by the name in the part
71   virtual std::shared_ptr<GeomAPI_Shape> shapeInPart(const std::string& theName) = 0;
72   /// Updates the shape-result of the part (called on Part feature execution)
73   virtual void updateShape() = 0;
74 };
75
76 //! Pointer on feature object
77 typedef std::shared_ptr<ModelAPI_ResultPart> ResultPartPtr;
78
79 #endif