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