File indexing completed on 2025-01-18 10:03:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _IGESData_ParamReader_HeaderFile
0018 #define _IGESData_ParamReader_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 #include <Standard_Integer.hxx>
0025 #include <IGESData_ReadStage.hxx>
0026 #include <Interface_ParamType.hxx>
0027 #include <Standard_CString.hxx>
0028 #include <IGESData_Status.hxx>
0029 #include <IGESData_ParamCursor.hxx>
0030 #include <Standard_Type.hxx>
0031 #include <TColStd_HArray1OfInteger.hxx>
0032 #include <TColStd_HArray1OfReal.hxx>
0033 #include <Interface_HArray1OfHAsciiString.hxx>
0034 #include <IGESData_HArray1OfIGESEntity.hxx>
0035
0036 class Interface_ParamList;
0037 class Interface_Check;
0038 class IGESData_IGESEntity;
0039 class IGESData_IGESReaderData;
0040 class Message_Msg;
0041 class gp_XY;
0042 class gp_XYZ;
0043 class TCollection_HAsciiString;
0044 class Interface_EntityList;
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 class IGESData_ParamReader
0058 {
0059 public:
0060
0061 DEFINE_STANDARD_ALLOC
0062
0063
0064
0065
0066
0067
0068 Standard_EXPORT IGESData_ParamReader(const Handle(Interface_ParamList)& list, const Handle(Interface_Check)& ach, const Standard_Integer base = 1, const Standard_Integer nbpar = 0, const Standard_Integer num = 0);
0069
0070
0071 Standard_EXPORT Standard_Integer EntityNumber() const;
0072
0073
0074 Standard_EXPORT void Clear();
0075
0076
0077
0078
0079
0080
0081
0082 Standard_EXPORT Standard_Integer CurrentNumber() const;
0083
0084
0085
0086
0087
0088
0089
0090
0091 Standard_EXPORT void SetCurrentNumber (const Standard_Integer num);
0092
0093
0094 Standard_EXPORT IGESData_ReadStage Stage() const;
0095
0096
0097 Standard_EXPORT void NextStage();
0098
0099
0100 Standard_EXPORT void EndAll();
0101
0102
0103
0104 Standard_EXPORT Standard_Integer NbParams() const;
0105
0106
0107
0108 Standard_EXPORT Interface_ParamType ParamType (const Standard_Integer num) const;
0109
0110
0111 Standard_EXPORT Standard_CString ParamValue (const Standard_Integer num) const;
0112
0113
0114
0115 Standard_EXPORT Standard_Boolean IsParamDefined (const Standard_Integer num) const;
0116
0117
0118
0119
0120 Standard_EXPORT Standard_Boolean IsParamEntity (const Standard_Integer num) const;
0121
0122
0123
0124 Standard_EXPORT Standard_Integer ParamNumber (const Standard_Integer num) const;
0125
0126
0127 Standard_EXPORT Handle(IGESData_IGESEntity) ParamEntity (const Handle(IGESData_IGESReaderData)& IR, const Standard_Integer num);
0128
0129
0130
0131 Standard_EXPORT IGESData_ParamCursor Current() const;
0132
0133
0134
0135
0136
0137 Standard_EXPORT IGESData_ParamCursor CurrentList (const Standard_Integer nb, const Standard_Integer size = 1) const;
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154 Standard_EXPORT Standard_Boolean DefinedElseSkip();
0155
0156 Standard_EXPORT Standard_Boolean ReadInteger (const IGESData_ParamCursor& PC, Standard_Integer& val);
0157
0158
0159
0160
0161
0162
0163
0164 Standard_EXPORT Standard_Boolean ReadInteger (const IGESData_ParamCursor& PC, const Standard_CString mess, Standard_Integer& val);
0165
0166 Standard_EXPORT Standard_Boolean ReadBoolean (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Standard_Boolean& val, const Standard_Boolean exact = Standard_True);
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176 Standard_EXPORT Standard_Boolean ReadBoolean (const IGESData_ParamCursor& PC, const Standard_CString mess, Standard_Boolean& val, const Standard_Boolean exact = Standard_True);
0177
0178 Standard_EXPORT Standard_Boolean ReadReal (const IGESData_ParamCursor& PC, Standard_Real& val);
0179
0180
0181
0182
0183
0184 Standard_EXPORT Standard_Boolean ReadReal (const IGESData_ParamCursor& PC, const Standard_CString mess, Standard_Real& val);
0185
0186 Standard_EXPORT Standard_Boolean ReadXY (const IGESData_ParamCursor& PC, Message_Msg& amsg, gp_XY& val);
0187
0188
0189
0190
0191
0192 Standard_EXPORT Standard_Boolean ReadXY (const IGESData_ParamCursor& PC, const Standard_CString mess, gp_XY& val);
0193
0194 Standard_EXPORT Standard_Boolean ReadXYZ (const IGESData_ParamCursor& PC, Message_Msg& amsg, gp_XYZ& val);
0195
0196
0197
0198
0199
0200
0201 Standard_EXPORT Standard_Boolean ReadXYZ (const IGESData_ParamCursor& PC, const Standard_CString mess, gp_XYZ& val);
0202
0203 Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& thePC, const Message_Msg& theMsg, Handle(TCollection_HAsciiString)& theVal);
0204
0205
0206
0207
0208
0209 Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(TCollection_HAsciiString)& val);
0210
0211 Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, IGESData_Status& aStatus, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False);
0212
0213
0214
0215
0216
0217
0218
0219
0220
0221 Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False);
0222
0223 Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, IGESData_Status& aStatus, const Handle(Standard_Type)& type, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False);
0224
0225
0226 template <class T>
0227 Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, IGESData_Status& aStatus, const Handle(Standard_Type)& type, Handle(T)& val, const Standard_Boolean canbenul = Standard_False)
0228 {
0229 Handle(IGESData_IGESEntity) aVal = val;
0230 Standard_Boolean aRes = ReadEntity (IR, PC, aStatus, type, aVal, canbenul);
0231 val = Handle(T)::DownCast(aVal);
0232 return aRes && (canbenul || ! val.IsNull());
0233 }
0234
0235
0236
0237
0238
0239
0240 Standard_EXPORT Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, const Standard_CString mess, const Handle(Standard_Type)& type, Handle(IGESData_IGESEntity)& val, const Standard_Boolean canbenul = Standard_False);
0241
0242
0243 template <class T>
0244 Standard_Boolean ReadEntity (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, const Standard_CString mess, const Handle(Standard_Type)& type, Handle(T)& val, const Standard_Boolean canbenul = Standard_False)
0245 {
0246 Handle(IGESData_IGESEntity) aVal = val;
0247 Standard_Boolean aRes = ReadEntity (IR, PC, mess, type, aVal, canbenul);
0248 val = Handle(T)::DownCast(aVal);
0249 return aRes && (canbenul || ! val.IsNull());
0250 }
0251
0252 Standard_EXPORT Standard_Boolean ReadInts (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(TColStd_HArray1OfInteger)& val, const Standard_Integer index = 1);
0253
0254
0255
0256
0257
0258
0259
0260 Standard_EXPORT Standard_Boolean ReadInts (const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(TColStd_HArray1OfInteger)& val, const Standard_Integer index = 1);
0261
0262 Standard_EXPORT Standard_Boolean ReadReals (const IGESData_ParamCursor& PC, Message_Msg& amsg, Handle(TColStd_HArray1OfReal)& val, const Standard_Integer index = 1);
0263
0264
0265
0266
0267
0268
0269
0270 Standard_EXPORT Standard_Boolean ReadReals (const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(TColStd_HArray1OfReal)& val, const Standard_Integer index = 1);
0271
0272 Standard_EXPORT Standard_Boolean ReadTexts (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(Interface_HArray1OfHAsciiString)& val, const Standard_Integer index = 1);
0273
0274
0275
0276
0277
0278
0279 Standard_EXPORT Standard_Boolean ReadTexts (const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(Interface_HArray1OfHAsciiString)& val, const Standard_Integer index = 1);
0280
0281 Standard_EXPORT Standard_Boolean ReadEnts (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(IGESData_HArray1OfIGESEntity)& val, const Standard_Integer index = 1);
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292 Standard_EXPORT Standard_Boolean ReadEnts (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, const Standard_CString mess, Handle(IGESData_HArray1OfIGESEntity)& val, const Standard_Integer index = 1);
0293
0294 Standard_EXPORT Standard_Boolean ReadEntList (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, Message_Msg& amsg, Interface_EntityList& val, const Standard_Boolean ord = Standard_True);
0295
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305
0306 Standard_EXPORT Standard_Boolean ReadEntList (const Handle(IGESData_IGESReaderData)& IR, const IGESData_ParamCursor& PC, const Standard_CString mess, Interface_EntityList& val, const Standard_Boolean ord = Standard_True);
0307
0308 Standard_EXPORT Standard_Boolean ReadingReal (const Standard_Integer num, Standard_Real& val);
0309
0310
0311
0312 Standard_EXPORT Standard_Boolean ReadingReal (const Standard_Integer num, const Standard_CString mess, Standard_Real& val);
0313
0314 Standard_EXPORT Standard_Boolean ReadingEntityNumber (const Standard_Integer num, Standard_Integer& val);
0315
0316
0317
0318
0319
0320
0321
0322 Standard_EXPORT Standard_Boolean ReadingEntityNumber (const Standard_Integer num, const Standard_CString mess, Standard_Integer& val);
0323
0324 Standard_EXPORT void SendFail (const Message_Msg& amsg);
0325
0326 Standard_EXPORT void SendWarning (const Message_Msg& amsg);
0327
0328 Standard_EXPORT void AddFail (const Standard_CString afail, const Standard_CString bfail = "");
0329
0330
0331 Standard_EXPORT void AddFail (const Handle(TCollection_HAsciiString)& af, const Handle(TCollection_HAsciiString)& bf);
0332
0333 Standard_EXPORT void AddWarning (const Standard_CString awarn, const Standard_CString bwarn = "");
0334
0335
0336 Standard_EXPORT void AddWarning (const Handle(TCollection_HAsciiString)& aw, const Handle(TCollection_HAsciiString)& bw);
0337
0338 Standard_EXPORT void Mend (const Standard_CString pref = "");
0339
0340
0341 Standard_EXPORT Standard_Boolean HasFailed() const;
0342
0343
0344
0345 Standard_EXPORT const Handle(Interface_Check)& Check() const;
0346
0347
0348
0349 Standard_EXPORT Handle(Interface_Check)& CCheck();
0350
0351
0352
0353 Standard_EXPORT Standard_Boolean IsCheckEmpty() const;
0354
0355
0356
0357
0358 protected:
0359
0360
0361
0362
0363
0364 private:
0365
0366
0367 Standard_EXPORT Standard_Boolean PrepareRead (const IGESData_ParamCursor& PC, const Standard_Boolean several, const Standard_Integer size = 1);
0368
0369
0370
0371
0372
0373
0374
0375
0376 Standard_EXPORT Standard_Boolean PrepareRead (const IGESData_ParamCursor& PC, const Standard_CString mess, const Standard_Boolean several, const Standard_Integer size = 1);
0377
0378
0379
0380
0381 Standard_EXPORT Standard_Integer FirstRead (const Standard_Integer nb = 1);
0382
0383
0384
0385
0386 Standard_EXPORT Standard_Integer NextRead (const Standard_Integer nb = 1);
0387
0388
0389
0390
0391
0392 Standard_EXPORT void AddFail (const Standard_CString idm, const Handle(TCollection_HAsciiString)& af, const Handle(TCollection_HAsciiString)& bf);
0393
0394
0395
0396 Standard_EXPORT void AddFail (const Standard_CString idm, const Standard_CString afail, const Standard_CString bfail);
0397
0398
0399
0400
0401
0402 Standard_EXPORT void AddWarning (const Standard_CString idm, const Handle(TCollection_HAsciiString)& aw, const Handle(TCollection_HAsciiString)& bw);
0403
0404
0405
0406 Standard_EXPORT void AddWarning (const Standard_CString idm, const Standard_CString aw, const Standard_CString bw);
0407
0408
0409 Handle(Interface_ParamList) theparams;
0410 Handle(Interface_Check) thecheck;
0411 Standard_Integer thebase;
0412 Standard_Integer thenbpar;
0413 Standard_Integer thecurr;
0414 IGESData_ReadStage thestage;
0415 Standard_Boolean thelast;
0416 Standard_Integer theindex;
0417 Standard_Integer thenbitem;
0418 Standard_Integer theitemsz;
0419 Standard_Integer theoffset;
0420 Standard_Integer thetermsz;
0421 Standard_Integer themaxind;
0422 Standard_Integer thenbterm;
0423 Standard_Integer pbrealint;
0424 Standard_Integer pbrealform;
0425 Standard_Integer thenum;
0426
0427
0428 };
0429
0430
0431
0432
0433
0434
0435
0436 #endif