0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / IGESData / IGESData_WriterLib.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-04-06
2// Created by: Christian CAILLET
3// Copyright (c) 1992-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 _IGESData_WriterLib_HeaderFile
18#define _IGESData_WriterLib_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <Standard_Boolean.hxx>
25#include <Standard_Integer.hxx>
26class IGESData_NodeOfWriterLib;
27class Standard_NoSuchObject;
28class IGESData_IGESEntity;
29class IGESData_ReadWriteModule;
30class IGESData_Protocol;
31class IGESData_GlobalNodeOfWriterLib;
32class Standard_Transient;
33
34
35
36class IGESData_WriterLib
37{
38public:
39
40 DEFINE_STANDARD_ALLOC
41
42
36b9ff75 43 //! Adds a couple (Module-Protocol) into the global definition set
44 //! for this class of Library.
42cf5bc1 45 Standard_EXPORT static void SetGlobal (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(IGESData_Protocol)& aprotocol);
46
36b9ff75 47 //! Creates a Library which complies with a Protocol, that is :
48 //! Same class (criterium IsInstance)
49 //! This creation gets the Modules from the global set, those
50 //! which are bound to the given Protocol and its Resources
42cf5bc1 51 Standard_EXPORT IGESData_WriterLib(const Handle(IGESData_Protocol)& aprotocol);
52
36b9ff75 53 //! Creates an empty Library : it will later by filled by method
54 //! AddProtocol
42cf5bc1 55 Standard_EXPORT IGESData_WriterLib();
56
36b9ff75 57 //! Adds a couple (Module-Protocol) to the Library, given the
58 //! class of a Protocol. Takes Resources into account.
59 //! (if <aprotocol> is not of type TheProtocol, it is not added)
42cf5bc1 60 Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol);
61
36b9ff75 62 //! Clears the list of Modules of a library (can be used to
63 //! redefine the order of Modules before action : Clear then
64 //! refill the Library by calls to AddProtocol)
42cf5bc1 65 Standard_EXPORT void Clear();
66
36b9ff75 67 //! Sets a library to be defined with the complete Global list
68 //! (all the couples Protocol/Modules recorded in it)
42cf5bc1 69 Standard_EXPORT void SetComplete();
70
36b9ff75 71 //! Selects a Module from the Library, given an Object.
72 //! Returns True if Select has succeeded, False else.
73 //! Also Returns (as arguments) the selected Module and the Case
74 //! Number determined by the associated Protocol.
75 //! If Select has failed, <module> is Null Handle and CN is zero.
76 //! (Select can work on any criterium, such as Object DynamicType)
42cf5bc1 77 Standard_EXPORT Standard_Boolean Select (const Handle(IGESData_IGESEntity)& obj, Handle(IGESData_ReadWriteModule)& module, Standard_Integer& CN) const;
78
36b9ff75 79 //! Starts Iteration on the Modules (sets it on the first one)
42cf5bc1 80 Standard_EXPORT void Start();
81
36b9ff75 82 //! Returns True if there are more Modules to iterate on
42cf5bc1 83 Standard_EXPORT Standard_Boolean More() const;
84
36b9ff75 85 //! Iterates by getting the next Module in the list
86 //! If there is none, the exception will be raised by Value
42cf5bc1 87 Standard_EXPORT void Next();
88
36b9ff75 89 //! Returns the current Module in the Iteration
42cf5bc1 90 Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const;
91
36b9ff75 92 //! Returns the current Protocol in the Iteration
42cf5bc1 93 Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const;
94
95
96
97
98protected:
99
100
101
102
103
104private:
105
106
107
108 Handle(IGESData_NodeOfWriterLib) thelist;
109 Handle(IGESData_NodeOfWriterLib) thecurr;
110
111
112};
113
114
115
116
117
118
119
120#endif // _IGESData_WriterLib_HeaderFile