42cf5bc1 |
1 | // Created on: 1994-09-14 |
2 | // Created by: Christian CAILLET |
3 | // Copyright (c) 1994-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _StepSelect_WorkLibrary_HeaderFile |
18 | #define _StepSelect_WorkLibrary_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <Standard_Boolean.hxx> |
24 | #include <Standard_Integer.hxx> |
25 | #include <IFSelect_WorkLibrary.hxx> |
26 | #include <Standard_CString.hxx> |
27 | class Interface_InterfaceModel; |
28 | class Interface_Protocol; |
29 | class IFSelect_ContextWrite; |
30 | class Interface_EntityIterator; |
31 | class Interface_CopyTool; |
32 | class Standard_Transient; |
33 | class Message_Messenger; |
34 | |
35 | |
36 | class StepSelect_WorkLibrary; |
37 | DEFINE_STANDARD_HANDLE(StepSelect_WorkLibrary, IFSelect_WorkLibrary) |
38 | |
39 | //! Performs Read and Write a STEP File with a STEP Model |
40 | //! Following the protocols, Copy may be implemented or not |
41 | class StepSelect_WorkLibrary : public IFSelect_WorkLibrary |
42 | { |
43 | |
44 | public: |
45 | |
46 | |
47 | //! Creates a STEP WorkLibrary |
48 | //! <copymode> precises whether Copy is implemented or not |
49 | Standard_EXPORT StepSelect_WorkLibrary(const Standard_Boolean copymode = Standard_True); |
50 | |
51 | //! Selects a mode to dump entities |
52 | //! 0 (D) : prints numbers, then displays table number/label |
53 | //! 1 : prints labels, then displays table label/number |
54 | //! 2 : prints labels onky |
55 | Standard_EXPORT void SetDumpLabel (const Standard_Integer mode); |
56 | |
57 | //! Reads a STEP File and returns a STEP Model (into <mod>), |
58 | //! or lets <mod> "Null" in case of Error |
59 | //! Returns 0 if OK, 1 if Read Error, -1 if File not opened |
79104795 |
60 | Standard_EXPORT Standard_Integer ReadFile (const Standard_CString name, Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol) const Standard_OVERRIDE; |
42cf5bc1 |
61 | |
62 | //! Writes a File from a STEP Model |
63 | //! Returns False (and writes no file) if <ctx> does not bring a |
64 | //! STEP Model |
79104795 |
65 | Standard_EXPORT Standard_Boolean WriteFile (IFSelect_ContextWrite& ctx) const Standard_OVERRIDE; |
42cf5bc1 |
66 | |
67 | //! Performs the copy of entities from an original model to a new |
68 | //! one. Works according <copymode> : |
69 | //! if True, standard copy is run |
70 | //! else nothing is done and returned value is False |
71 | Standard_EXPORT virtual Standard_Boolean CopyModel (const Handle(Interface_InterfaceModel)& original, const Handle(Interface_InterfaceModel)& newmodel, const Interface_EntityIterator& list, Interface_CopyTool& TC) const Standard_OVERRIDE; |
72 | |
73 | //! Dumps an entity under STEP form, i.e. as a part of a Step file |
74 | //! Works with a StepDumper. |
75 | //! Level 0 just displays type; level 1 displays the entity itself |
76 | //! and level 2 displays the entity plus its shared ones (one |
77 | //! sub-level : immediately shared entities) |
79104795 |
78 | Standard_EXPORT void DumpEntity (const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol, const Handle(Standard_Transient)& entity, const Handle(Message_Messenger)& S, const Standard_Integer level) const Standard_OVERRIDE; |
42cf5bc1 |
79 | |
80 | |
81 | |
82 | |
92efcf78 |
83 | DEFINE_STANDARD_RTTIEXT(StepSelect_WorkLibrary,IFSelect_WorkLibrary) |
42cf5bc1 |
84 | |
85 | protected: |
86 | |
87 | |
88 | |
89 | |
90 | private: |
91 | |
92 | |
93 | Standard_Boolean thecopymode; |
94 | Standard_Integer thelabmode; |
95 | |
96 | |
97 | }; |
98 | |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | #endif // _StepSelect_WorkLibrary_HeaderFile |