]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelHighAPI/ModelHighAPI_Services.h
Salome HOME
Merge remote-tracking branch 'remotes/origin/HighLevelDump'
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Services.h
1 // Name   : ModelHighAPI_Services.h
2 // Purpose:
3 //
4 // History:
5 // 17/06/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_SERVICES_H_
8 #define SRC_MODELHIGHAPI_MODELHIGHAPI_SERVICES_H_
9
10 //--------------------------------------------------------------------------------------
11 #include "ModelHighAPI.h"
12
13 #include <memory>
14 #include <string>
15 //--------------------------------------------------------------------------------------
16 class GeomAPI_Ax3;
17 class GeomAPI_Dir;
18 class GeomAPI_Pnt;
19 class ModelAPI_Document;
20 class ModelAPI_Result;
21 //--------------------------------------------------------------------------------------
22 /// Return the main document (the Partset) created or open from the Modeler.
23 MODELHIGHAPI_EXPORT
24 std::shared_ptr<ModelAPI_Document> moduleDocument();
25
26 /** Return the active document.
27  *
28  *  This document can be either the main application document (i.e. the Partset) or one of documents
29  *  referred to by the main document (a Part).
30  */
31 MODELHIGHAPI_EXPORT
32 std::shared_ptr<ModelAPI_Document> activeDocument();
33
34 /** Return one of the three planes defined by the global coordinate system.
35  *
36  *  These planes are respectively referred to by name "XOY" (Z=0), "XOZ" (Y=0) or "YOZ" (X=0).
37  */
38 MODELHIGHAPI_EXPORT
39 std::shared_ptr<GeomAPI_Ax3> defaultPlane(const std::string & theName);
40
41 /// Return name of coordinate plane ("XOY", "XOZ" or "YOZ") or empty string for other planes.
42 MODELHIGHAPI_EXPORT
43 std::string defaultPlane(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
44                          const std::shared_ptr<GeomAPI_Dir>& theNormal,
45                          const std::shared_ptr<GeomAPI_Dir>& theDirX);
46
47 /** Return one of the three standard results defined in PartSet document.
48  *
49  *  These planes are respectively referred to by name "XOY" (Z=0), "XOZ" (Y=0) or "YOZ" (X=0).
50  */
51 MODELHIGHAPI_EXPORT
52 std::shared_ptr<ModelAPI_Result> standardPlane(const std::string & theName);
53
54 /** Start a data structure transaction.
55  *
56  *  Make a control point for being able to discard or undo
57  *  all operations done during this transaction.
58  */
59 MODELHIGHAPI_EXPORT
60 void begin();
61
62 /** Commit the data structure transaction.
63  *
64  *  Make all operations done since the last control point undo-able.
65  */
66 MODELHIGHAPI_EXPORT
67 void end();
68
69 /** Commit the data structure transaction and start the new one.
70  *
71  *  Make all operations done since the last control point undo-able
72  *  and continue with the new transaction.
73  */
74 MODELHIGHAPI_EXPORT
75 void apply();
76
77 /// Roll-back the data structure to the previous control point.
78 MODELHIGHAPI_EXPORT
79 void undo();
80
81 /// Restore the data structure rolled-back by the last undo.
82 MODELHIGHAPI_EXPORT
83 void redo();
84
85 /// Reset the data structure to initial state.
86 MODELHIGHAPI_EXPORT
87 void reset();
88
89 //--------------------------------------------------------------------------------------
90 //--------------------------------------------------------------------------------------
91 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_SERVICES_H_ */