]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelHighAPI/ModelHighAPI_Services.h
Salome HOME
Merge branch 'Pre_2.8.0_development'
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Services.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_SERVICES_H_
22 #define SRC_MODELHIGHAPI_MODELHIGHAPI_SERVICES_H_
23
24 //--------------------------------------------------------------------------------------
25 #include "ModelHighAPI.h"
26
27 #include <memory>
28 #include <string>
29 //--------------------------------------------------------------------------------------
30 class GeomAPI_Ax3;
31 class GeomAPI_Dir;
32 class GeomAPI_Pnt;
33 class ModelAPI_Document;
34 class ModelAPI_Result;
35 //--------------------------------------------------------------------------------------
36 /// Return the main document (the Partset) created or open from the Modeler.
37 MODELHIGHAPI_EXPORT
38 std::shared_ptr<ModelAPI_Document> moduleDocument();
39
40 /** Return the active document.
41  *
42  *  This document can be either the main application document (i.e. the Partset) or one of documents
43  *  referred to by the main document (a Part).
44  */
45 MODELHIGHAPI_EXPORT
46 std::shared_ptr<ModelAPI_Document> activeDocument();
47
48 /** Return one of the three planes defined by the global coordinate system.
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<GeomAPI_Ax3> defaultPlane(const std::string & theName);
54
55 /// Return name of coordinate plane ("XOY", "XOZ" or "YOZ") or empty string for other planes.
56 MODELHIGHAPI_EXPORT
57 std::string defaultPlane(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
58                          const std::shared_ptr<GeomAPI_Dir>& theNormal,
59                          const std::shared_ptr<GeomAPI_Dir>& theDirX);
60
61 /** Return one of the three standard results defined in PartSet document.
62  *
63  *  These planes are respectively referred to by name "XOY" (Z=0), "XOZ" (Y=0) or "YOZ" (X=0).
64  */
65 MODELHIGHAPI_EXPORT
66 std::shared_ptr<ModelAPI_Result> standardPlane(const std::string & theName);
67
68 /** Start a data structure transaction.
69  *
70  *  Make a control point for being able to discard or undo
71  *  all operations done during this transaction.
72  */
73 MODELHIGHAPI_EXPORT
74 void begin();
75
76 /** Commit the data structure transaction.
77  *
78  *  Make all operations done since the last control point undo-able.
79  */
80 MODELHIGHAPI_EXPORT
81 void end();
82
83 /** Commit the data structure transaction and start the new one.
84  *
85  *  Make all operations done since the last control point undo-able
86  *  and continue with the new transaction.
87  */
88 MODELHIGHAPI_EXPORT
89 void apply();
90
91 /** Executes features, created or updated before.
92  *
93  *  This method flushes creation and update events in order to make all
94  *  features up to date.
95  */
96 MODELHIGHAPI_EXPORT
97 void updateFeatures();
98
99 /// Roll-back the data structure to the previous control point.
100 MODELHIGHAPI_EXPORT
101 void undo();
102
103 /// Restore the data structure rolled-back by the last undo.
104 MODELHIGHAPI_EXPORT
105 void redo();
106
107 /// Reset the data structure to initial state.
108 MODELHIGHAPI_EXPORT
109 void reset();
110
111 //--------------------------------------------------------------------------------------
112 //--------------------------------------------------------------------------------------
113 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_SERVICES_H_ */