Salome HOME
Move functions from Python model.services to C++ ModelHighAPI_Services
[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 ModelAPI_Document;
18 //--------------------------------------------------------------------------------------
19 /// Return the main document (the Partset) created or open from the Modeler.
20 MODELHIGHAPI_EXPORT
21 std::shared_ptr<ModelAPI_Document> moduleDocument();
22
23 /** Return the active document.
24  *
25  *  This document can be either the main application document (i.e. the Partset) or one of documents
26  *  referred to by the main document (a Part).
27  */
28 MODELHIGHAPI_EXPORT
29 std::shared_ptr<ModelAPI_Document> activeDocument();
30
31 /** Return one of the three planes defined by the global coordinate system.
32  *
33  *  These planes are respectively referred to by name "XOY" (Z=0), "XOZ" (Y=0) or "YOZ" (X=0).
34  */
35 MODELHIGHAPI_EXPORT
36 std::shared_ptr<GeomAPI_Ax3> defaultPlane(const std::string & theName);
37
38 /** Start a data structure transaction.
39  *
40  *  Make a control point for being able to discard or undo
41  *  all operations done during this transaction.
42  */
43 MODELHIGHAPI_EXPORT
44 void begin();
45
46 /** Commit the data structure transaction.
47  *
48  *  Make all operations done since the last control point undo-able.
49  */
50 MODELHIGHAPI_EXPORT
51 void end();
52
53 /** Commit the data structure transaction and start the new one.
54  *
55  *  Make all operations done since the last control point undo-able
56  *  and continue with the new transaction.
57  */
58 MODELHIGHAPI_EXPORT
59 void apply();
60
61 /// Roll-back the data structure to the previous control point.
62 MODELHIGHAPI_EXPORT
63 void undo();
64
65 /// Restore the data structure rolled-back by the last undo.
66 MODELHIGHAPI_EXPORT
67 void redo();
68
69 /// Reset the data structure to initial state.
70 MODELHIGHAPI_EXPORT
71 void reset();
72
73 //--------------------------------------------------------------------------------------
74 //--------------------------------------------------------------------------------------
75 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_SERVICES_H_ */