File indexing completed on 2026-09-27 09:19:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _XSControl_Controller_HeaderFile
0018 #define _XSControl_Controller_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022
0023 #include <TCollection_AsciiString.hxx>
0024 #include <Standard_Transient.hxx>
0025 #include <NCollection_Sequence.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <TCollection_HAsciiString.hxx>
0028 #include <NCollection_Array1.hxx>
0029 #include <NCollection_HArray1.hxx>
0030 #include <NCollection_DynamicArray.hxx>
0031 #include <IFSelect_ReturnStatus.hxx>
0032 #include <NCollection_DataMap.hxx>
0033 #include <Message_ProgressRange.hxx>
0034
0035 class IFSelect_WorkLibrary;
0036 class Interface_Protocol;
0037 class Transfer_ActorOfTransientProcess;
0038 class Transfer_ActorOfFinderProcess;
0039 class XSControl_WorkSession;
0040 class Interface_InterfaceModel;
0041 class Transfer_FinderProcess;
0042 class TopoDS_Shape;
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 class XSControl_Controller : public Standard_Transient
0060 {
0061 public:
0062
0063
0064
0065 Standard_EXPORT void SetNames(const char* const theLongName, const char* const theShortName);
0066
0067
0068
0069 void AutoRecord() const
0070 {
0071 Record(Name(true));
0072 Record(Name(false));
0073 }
0074
0075
0076
0077 Standard_EXPORT void Record(const char* const name) const;
0078
0079
0080
0081 Standard_EXPORT static occ::handle<XSControl_Controller> Recorded(const char* const name);
0082
0083
0084
0085
0086 const char* Name(const bool rsc = false) const
0087 {
0088 return (rsc ? myShortName.ToCString() : myLongName.ToCString());
0089 }
0090
0091
0092 const occ::handle<Interface_Protocol>& Protocol() const { return myAdaptorProtocol; }
0093
0094
0095
0096
0097
0098
0099
0100 const occ::handle<IFSelect_WorkLibrary>& WorkLibrary() const { return myAdaptorLibrary; }
0101
0102
0103
0104 Standard_EXPORT virtual occ::handle<Interface_InterfaceModel> NewModel() const = 0;
0105
0106
0107
0108
0109 Standard_EXPORT virtual occ::handle<Transfer_ActorOfTransientProcess> ActorRead(
0110 const occ::handle<Interface_InterfaceModel>& model) const;
0111
0112
0113
0114 Standard_EXPORT virtual occ::handle<Transfer_ActorOfFinderProcess> ActorWrite() const;
0115
0116
0117
0118
0119
0120 Standard_EXPORT void SetModeWrite(const int modemin, const int modemax, const bool shape = true);
0121
0122
0123 Standard_EXPORT void SetModeWriteHelp(const int modetrans,
0124 const char* const help,
0125 const bool shape = true);
0126
0127
0128
0129
0130 Standard_EXPORT bool ModeWriteBounds(int& modemin, int& modemax, const bool shape = true) const;
0131
0132
0133
0134 Standard_EXPORT bool IsModeWrite(const int modetrans, const bool shape = true) const;
0135
0136
0137
0138 Standard_EXPORT const char* ModeWriteHelp(const int modetrans, const bool shape = true) const;
0139
0140
0141
0142
0143
0144 Standard_EXPORT virtual bool RecognizeWriteTransient(const occ::handle<Standard_Transient>& obj,
0145 const int modetrans = 0) const;
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157 Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteTransient(
0158 const occ::handle<Standard_Transient>& obj,
0159 const occ::handle<Transfer_FinderProcess>& FP,
0160 const occ::handle<Interface_InterfaceModel>& model,
0161 const int modetrans = 0,
0162 const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
0163
0164
0165
0166 Standard_EXPORT virtual bool RecognizeWriteShape(const TopoDS_Shape& shape,
0167 const int modetrans = 0) const;
0168
0169
0170
0171
0172
0173
0174
0175 Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteShape(
0176 const TopoDS_Shape& shape,
0177 const occ::handle<Transfer_FinderProcess>& FP,
0178 const occ::handle<Interface_InterfaceModel>& model,
0179 const int modetrans = 0,
0180 const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190 Standard_EXPORT void AddSessionItem(const occ::handle<Standard_Transient>& theItem,
0191 const char* const theName,
0192 const bool toApply = false);
0193
0194
0195
0196 Standard_EXPORT occ::handle<Standard_Transient> SessionItem(const char* const theName) const;
0197
0198
0199 Standard_EXPORT virtual void Customise(occ::handle<XSControl_WorkSession>& WS);
0200
0201 const NCollection_DataMap<TCollection_AsciiString, occ::handle<Standard_Transient>>&
0202 AdaptorSession() const
0203 {
0204 return myAdaptorSession;
0205 }
0206
0207 DEFINE_STANDARD_RTTIEXT(XSControl_Controller, Standard_Transient)
0208
0209 protected:
0210
0211
0212
0213 Standard_EXPORT XSControl_Controller(const char* const theLongName,
0214 const char* const theShortName);
0215
0216
0217 Standard_EXPORT void TraceStatic(const char* const theName, const int theUse);
0218
0219 TCollection_AsciiString myShortName;
0220 TCollection_AsciiString myLongName;
0221 occ::handle<IFSelect_WorkLibrary> myAdaptorLibrary;
0222 occ::handle<Interface_Protocol> myAdaptorProtocol;
0223
0224 occ::handle<Transfer_ActorOfTransientProcess> myAdaptorRead;
0225 occ::handle<Transfer_ActorOfFinderProcess> myAdaptorWrite;
0226 NCollection_DataMap<TCollection_AsciiString, occ::handle<Standard_Transient>> myAdaptorSession;
0227
0228 private:
0229 NCollection_Sequence<occ::handle<Standard_Transient>> myAdaptorApplied;
0230 NCollection_DynamicArray<occ::handle<Standard_Transient>> myParams;
0231 NCollection_DynamicArray<int> myParamUses;
0232 occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>> myModeWriteShapeN;
0233 };
0234
0235 #endif