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