1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 //#52 rln 06.01.99 writing value 1.e-07
19 //gka 19.01.99 changing size of ParamSet
20 //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000 and YYYYMMDD.HHMMSS after Y2000)
21 //#66 rln Setting IGES 5.3 by default
22 //#73 rln 10.03.99 S4135: "read.scale.unit" is applied after translation
23 #include <IGESData_GlobalSection.ixx>
24 #include <Interface_ParamType.hxx>
25 #include <Interface_FloatWriter.hxx>
26 #include <Interface_FileReaderData.hxx>
27 #include <Interface_FileParameter.hxx>
28 #include <OSD_Process.hxx>
29 #include <Quantity_Date.hxx>
30 #include <Interface_Static.hxx>
31 #include <IGESData_BasicEditor.hxx>
35 #include <Message_Msg.hxx>
37 #include <UnitsMethods.hxx>
39 // valeurs en MILLIMETRE pardefaut, reajustable
40 //static Standard_Real convunit = 1000.;
43 // Routines locales copiant une string [l`ideal serait : astr = astr->Copy()]
44 // et transformant un CString (Hollerith ou non) en HAsciiString non Holl.
48 static void CopyString (Handle(TCollection_HAsciiString)& astr);
50 static void MakeHollerith(const Handle(TCollection_HAsciiString)& astr,
51 char* text, Standard_Integer& lt);
53 void CopyString (Handle(TCollection_HAsciiString)& astr)
55 if (astr.IsNull()) return; // ne rien faire si String pas definie !
56 Handle(TCollection_HAsciiString) S = new TCollection_HAsciiString("");
57 S->AssignCat(astr); astr = S;
60 void MakeHollerith(const Handle(TCollection_HAsciiString)& astr,
61 char* text, Standard_Integer& lt)
63 lt = 0; text[0] = '\0';
64 if (astr.IsNull()) return;
65 Standard_Integer ln = astr->Length();
67 sprintf (text,"%dH%s",ln,astr->ToCString());
68 lt = ln+2; if (ln >= 10) lt ++; if (ln >= 100) lt ++; // strlen text
72 //=======================================================================
73 //function : IGESData_GlobalSection
75 //=======================================================================
77 IGESData_GlobalSection::IGESData_GlobalSection ()
80 //#73 rln 10.03.99 S4135: "read.scale.unit" is applied after translation
81 //if (Interface_Static::IVal("read.scale.unit") == 1) convunit = 1;
85 // pourrait etre une methode generale au package en fait
86 //=======================================================================
87 //function : TranslatedFromHollerith
89 //=======================================================================
91 Handle(TCollection_HAsciiString) IGESData_GlobalSection::TranslatedFromHollerith
92 (const Handle(TCollection_HAsciiString)& astr) const
94 Handle(TCollection_HAsciiString) res;
95 if (astr.IsNull()) return res;
96 Standard_Integer n = astr->Search("H");
98 if (!astr->Token("H")->IsIntegerValue()) n = 0;
100 if (n > 1 && n < astr->Length()) res = astr->SubString(n+1,astr->Length());
101 else if(astr->ToCString()== NULL)
102 res = new TCollection_HAsciiString;
103 else res = new TCollection_HAsciiString(astr->ToCString());
108 //=======================================================================
111 //=======================================================================
113 void IGESData_GlobalSection::Init(const Handle(Interface_ParamSet)& params,
114 Handle(Interface_Check)& ach)
117 // Building of messages
118 //======================================
119 //Message_Msg Msg39 ("XSTEP_39");
120 //Message_Msg Msg48 ("XSTEP_48");
121 //Message_Msg Msg49 ("XSTEP_49");
122 //======================================
124 theSeparator = ','; theEndMark = ';';
125 theSendName.Nullify(); theFileName.Nullify(); theSystemId.Nullify();
126 theInterfaceVersion.Nullify();
127 theIntegerBits = 32; // par defaut, simple = entier = 32b, double = 64
128 theMaxPower10Single = 38; theMaxDigitsSingle = 6;
129 theMaxPower10Double = 308; theMaxDigitsDouble = 15;
130 theReceiveName.Nullify();
132 theUnitFlag = 0; theUnitName.Nullify();
133 theLineWeightGrad = 1; theMaxLineWeight = 0.;
135 theResolution = 0.; theMaxCoord = 0.; hasMaxCoord = Standard_False;
136 theAuthorName.Nullify(); theCompanyName.Nullify();
137 theIGESVersion = 11;//3 //#66 rln Setting IGES 5.3 by default(To avoid misleading fails below)
138 theDraftingStandard = 0;
139 theLastChangeDate.Nullify(); // nouveaute 5.1 (peut etre absente)
140 theAppliProtocol.Nullify(); // nouveaute 5.3 (peut etre absente)
142 Standard_Integer nbp = params->NbParams();
144 for (Standard_Integer i = 1; i <= nbp; i ++) {
145 Standard_Integer intval = 0; Standard_Real realval = 0.0;
146 Handle(TCollection_HAsciiString) strval; // doit repartir a null
147 //char message[80]; //szv#4:S4163:12Mar99 unused
148 Standard_CString val = params->Param(i).CValue();
149 Interface_ParamType fpt = params->Param(i).ParamType();
150 if (fpt == Interface_ParamVoid) continue;
152 // if the param is an Integer
153 if (fpt == Interface_ParamInteger) {
154 // but a real is expected
155 if ( i == 13 || i == 17 || i == 19 || i == 20)
160 // if the param is a Real
161 else if (fpt == Interface_ParamReal || fpt == Interface_ParamEnum) {
163 Standard_Integer k , j = 0;
164 for (k = 0; k < 50; k ++) {
165 if (val[k] == 'D' || val[k] == 'd')
169 if (val[k] == '\0') break;
171 realval = Atof(text);
174 // if the param is a text
175 else if (fpt == Interface_ParamText) {
176 strval = new TCollection_HAsciiString (val);
177 if (val[0] != '\0') {
178 Standard_Integer nhol = strval->Search("H");
179 Standard_Integer lhol = strval->Length();
181 if (!strval->Token("H")->IsIntegerValue()) nhol = 0;
182 if (nhol > 1 && nhol < lhol)
183 strval = strval->SubString(nhol+1,lhol);
189 if (val[0] != '\0') sepend = val[0];
190 if (val[1] == 'H') sepend = val[2]; // prioritaire
195 case 1 : if (sepend != '\0') theSeparator = sepend; break;
196 case 2 : if (sepend != '\0') theEndMark = sepend; break;
197 case 3 : theSendName = strval; break;
198 case 4 : theFileName = strval; break;
199 case 5 : theSystemId = strval; break;
200 case 6 : theInterfaceVersion = strval; break;
201 case 7 : theIntegerBits = intval; break;
202 case 8 : theMaxPower10Single = intval; break;
203 case 9 : theMaxDigitsSingle = intval; break;
204 case 10 : theMaxPower10Double = intval; break;
205 case 11 : theMaxDigitsDouble = intval; break;
206 case 12 : theReceiveName = strval; break;
207 case 13 : theScale = realval; break;
208 case 14 : theUnitFlag = intval; break;
209 case 15 : theUnitName = strval; break;
210 case 16 : theLineWeightGrad = intval; break;
211 case 17 : theMaxLineWeight = realval; break;
212 case 18 : theDate = strval; break;
213 case 19 : theResolution = realval; break;
214 case 20 : theMaxCoord = realval;
215 hasMaxCoord = Standard_True; break;
216 case 21 : theAuthorName = strval; break;
217 case 22 : theCompanyName = strval; break;
218 case 23 : theIGESVersion = intval; break;
219 case 24 : theDraftingStandard = intval; break;
220 case 25 : theLastChangeDate = strval; break;
221 case 26 : theAppliProtocol = strval; break;
226 // Sending of message : Incorrect number of parameters (following the IGES version)
227 // Version less than 5.3
228 if (theIGESVersion < 11)
230 if ((nbp < 24) || (nbp > 25)) {
231 // 24 or 25 parameters are expected (parameter 25 is not required)
232 Message_Msg Msg39 ("XSTEP_39");
235 if (nbp < 24) ach->SendFail(Msg39);
236 else ach->SendWarning(Msg39);
240 else if ((nbp < 25) || (nbp > 26)) {
241 // 25 or 26 parameters are expected (parameter 25 is not required)
242 Message_Msg Msg39 ("XSTEP_39");
245 if (nbp < 25) ach->SendFail(Msg39);
246 else ach->SendWarning(Msg39);
249 //:45 by abv 11.12.97: if UnitFlag is not defined in the file,
250 // restore it from UnitName. Repris par CKY 13-FEV-1998
251 if ( theUnitFlag == 0 || theUnitFlag == 3 ) {
252 Standard_Integer corrected = 0 ;
253 if(theUnitName.IsNull())
254 //default (inches) value taken
257 corrected = IGESData_BasicEditor::UnitNameFlag (theUnitName->ToCString());
258 if (corrected > 0) theUnitFlag = corrected;
259 else if (theUnitFlag == 3) {
260 Message_Msg Msg49 ("XSTEP_49");
261 ach->SendWarning (Msg49);
264 Message_Msg Msg48 ("XSTEP_48");
265 ach->SendFail (Msg48);
271 //=======================================================================
272 //function : CopyRefs
274 //=======================================================================
276 void IGESData_GlobalSection::CopyRefs ()
278 CopyString(theSendName); CopyString(theFileName); CopyString(theSystemId);
279 CopyString(theInterfaceVersion); CopyString(theReceiveName);
280 CopyString(theUnitName); CopyString(theDate);
281 CopyString(theAuthorName); CopyString(theCompanyName);
282 CopyString(theLastChangeDate); CopyString(theAppliProtocol);
286 //=======================================================================
289 //=======================================================================
291 Handle(Interface_ParamSet) IGESData_GlobalSection::Params () const
293 char vide[1]; char uncar[2]; char nombre[1024]; char text[200];
295 vide[0] = uncar[1] = nombre[0] = '\0'; uncar[0] = ',';
296 Handle(Interface_ParamSet) res = new Interface_ParamSet(26); //gka 19.01.99
297 if (theSeparator == ',') res->Append (vide,0,Interface_ParamVoid,0);
298 else { uncar[0] = theSeparator; res->Append (uncar,1,Interface_ParamMisc,0); }
300 if (theEndMark == ';') res->Append (vide,0,Interface_ParamVoid,0);
301 else { uncar[0] = theEndMark; res->Append (uncar,1,Interface_ParamMisc,0); }
303 MakeHollerith (theSendName,text,lt);
304 res->Append (text,lt, Interface_ParamText,0);
306 MakeHollerith (theFileName,text,lt);
307 res->Append (text,lt, Interface_ParamText,0);
309 MakeHollerith (theSystemId,text,lt);
310 res->Append (text,lt, Interface_ParamText,0);
312 MakeHollerith (theInterfaceVersion,text,lt);
313 res->Append (text,lt, Interface_ParamText,0);
315 sprintf(nombre,"%d",theIntegerBits);
316 res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
318 sprintf(nombre,"%d",theMaxPower10Single);
319 res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
321 sprintf(nombre,"%d",theMaxDigitsSingle);
322 res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
324 sprintf(nombre,"%d",theMaxPower10Double);
325 res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
327 sprintf(nombre,"%d",theMaxDigitsDouble);
328 res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
330 MakeHollerith (theReceiveName,text,lt);
331 res->Append (text,lt, Interface_ParamText,0);
333 Interface_FloatWriter::Convert (theScale,nombre,Standard_True,0.,0.,"%f","%f");
334 // sprintf(nombre,"%f",theScale);
335 res->Append (nombre,strlen(nombre),Interface_ParamReal,0);
337 sprintf(nombre,"%d",theUnitFlag);
338 res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
340 MakeHollerith (theUnitName,text,lt);
341 res->Append (text,lt, Interface_ParamText,0);
343 sprintf(nombre,"%d",theLineWeightGrad);
344 res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
346 Interface_FloatWriter::Convert (theMaxLineWeight,nombre,Standard_True,0.,0.,"%f","%f");
347 // sprintf(nombre,"%f",theMaxLineWeight);
348 res->Append (nombre,strlen(nombre),Interface_ParamReal,0);
350 MakeHollerith (theDate,text,lt);
351 res->Append (text,lt, Interface_ParamText,0);
353 Interface_FloatWriter::Convert (theResolution,nombre,Standard_True,0.,0.,"%g","%g");
354 // sprintf(nombre,"%f",theResolution);
355 res->Append (nombre,strlen(nombre),Interface_ParamReal,0);
358 Interface_FloatWriter::Convert (theMaxCoord,nombre,Standard_True,0.,0.,"%f","%f");
359 // sprintf(nombre,"%f",theMaxCoord);
360 else nombre[0] = '\0';
361 res->Append (nombre,strlen(nombre),Interface_ParamReal,0);
363 MakeHollerith (theAuthorName,text,lt);
364 res->Append (text,lt, Interface_ParamText,0);
366 MakeHollerith (theCompanyName,text,lt);
367 res->Append (text,lt, Interface_ParamText,0);
369 sprintf(nombre,"%d",theIGESVersion);
370 res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
372 sprintf(nombre,"%d",theDraftingStandard);
373 res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
375 if (!theLastChangeDate.IsNull()) {
376 MakeHollerith (theLastChangeDate,text,lt);
377 res->Append (text,lt, Interface_ParamText,0);
380 if (!theAppliProtocol.IsNull()) {
381 MakeHollerith (theAppliProtocol,text,lt);
382 res->Append (text,lt, Interface_ParamText,0);
384 // Ici : parametre absent ignore
390 // ############### QUERIES ###############
393 //=======================================================================
394 //function : Separator
396 //=======================================================================
398 Standard_Character IGESData_GlobalSection::Separator () const
404 //=======================================================================
407 //=======================================================================
409 Standard_Character IGESData_GlobalSection::EndMark () const
415 //=======================================================================
416 //function : SendName
418 //=======================================================================
420 Handle(TCollection_HAsciiString) IGESData_GlobalSection::SendName () const
426 //=======================================================================
427 //function : FileName
429 //=======================================================================
431 Handle(TCollection_HAsciiString) IGESData_GlobalSection::FileName () const
437 //=======================================================================
438 //function : SystemId
440 //=======================================================================
442 Handle(TCollection_HAsciiString) IGESData_GlobalSection::SystemId () const
448 //=======================================================================
449 //function : InterfaceVersion
451 //=======================================================================
453 Handle(TCollection_HAsciiString) IGESData_GlobalSection::InterfaceVersion () const
455 return theInterfaceVersion;
459 //=======================================================================
460 //function : IntegerBits
462 //=======================================================================
464 Standard_Integer IGESData_GlobalSection::IntegerBits () const
466 return theIntegerBits;
470 //=======================================================================
471 //function : MaxPower10Single
473 //=======================================================================
475 Standard_Integer IGESData_GlobalSection::MaxPower10Single () const
477 return theMaxPower10Single;
481 //=======================================================================
482 //function : MaxDigitsSingle
484 //=======================================================================
486 Standard_Integer IGESData_GlobalSection::MaxDigitsSingle () const
488 return theMaxDigitsSingle;
492 //=======================================================================
493 //function : MaxPower10Double
495 //=======================================================================
497 Standard_Integer IGESData_GlobalSection::MaxPower10Double () const
499 return theMaxPower10Double;
503 //=======================================================================
504 //function : MaxDigitsDouble
506 //=======================================================================
508 Standard_Integer IGESData_GlobalSection::MaxDigitsDouble () const
510 return theMaxDigitsDouble;
514 //=======================================================================
515 //function : ReceiveName
517 //=======================================================================
519 Handle(TCollection_HAsciiString) IGESData_GlobalSection::ReceiveName () const
521 return theReceiveName;
525 //=======================================================================
528 //=======================================================================
530 Standard_Real IGESData_GlobalSection::Scale () const
536 //=======================================================================
537 //function : UnitFlag
539 //=======================================================================
541 Standard_Integer IGESData_GlobalSection::UnitFlag () const
547 //=======================================================================
548 //function : UnitName
550 //=======================================================================
552 Handle(TCollection_HAsciiString) IGESData_GlobalSection::UnitName () const
558 //=======================================================================
559 //function : LineWeightGrad
561 //=======================================================================
563 Standard_Integer IGESData_GlobalSection::LineWeightGrad () const
565 return theLineWeightGrad;
569 //=======================================================================
570 //function : MaxLineWeight
572 //=======================================================================
574 Standard_Real IGESData_GlobalSection::MaxLineWeight () const
576 return theMaxLineWeight;
580 //=======================================================================
583 //=======================================================================
585 Handle(TCollection_HAsciiString) IGESData_GlobalSection::Date () const
591 //=======================================================================
592 //function : Resolution
594 //=======================================================================
596 Standard_Real IGESData_GlobalSection::Resolution () const
598 return theResolution;
602 //=======================================================================
603 //function : MaxCoord
605 //=======================================================================
607 Standard_Real IGESData_GlobalSection::MaxCoord () const
613 //=======================================================================
614 //function : HasMaxCoord
616 //=======================================================================
618 Standard_Boolean IGESData_GlobalSection::HasMaxCoord () const
624 //=======================================================================
625 //function : AuthorName
627 //=======================================================================
629 Handle(TCollection_HAsciiString) IGESData_GlobalSection::AuthorName () const
631 return theAuthorName;
635 //=======================================================================
636 //function : CompanyName
638 //=======================================================================
640 Handle(TCollection_HAsciiString) IGESData_GlobalSection::CompanyName () const
642 return theCompanyName;
646 //=======================================================================
647 //function : IGESVersion
649 //=======================================================================
651 Standard_Integer IGESData_GlobalSection::IGESVersion () const
653 return theIGESVersion;
657 //=======================================================================
658 //function : DraftingStandard
660 //=======================================================================
662 Standard_Integer IGESData_GlobalSection::DraftingStandard () const
664 return theDraftingStandard;
668 //=======================================================================
669 //function : LastChangeDate
671 //=======================================================================
673 Handle(TCollection_HAsciiString) IGESData_GlobalSection::LastChangeDate () const
675 return theLastChangeDate;
679 //=======================================================================
680 //function : HasLastChangeDate
682 //=======================================================================
684 Standard_Boolean IGESData_GlobalSection::HasLastChangeDate () const
686 return (!theLastChangeDate.IsNull());
690 //=======================================================================
691 //function : SetLastChangeDate
693 //=======================================================================
695 void IGESData_GlobalSection::SetLastChangeDate ()
697 if (HasLastChangeDate()) return;
698 Standard_Integer mois,jour,annee,heure,minute,seconde,millisec,microsec;
700 Quantity_Date ladate = system.SystemDate();
701 ladate.Values (mois,jour,annee,heure,minute,seconde,millisec,microsec);
703 //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000)
704 theLastChangeDate = NewDateString (annee,mois,jour,heure,minute,seconde,0);
706 //#65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000)
707 theLastChangeDate = NewDateString (annee,mois,jour,heure,minute,seconde, -1);
711 //=======================================================================
712 //function : HasApplicationProtocol
714 //=======================================================================
716 Standard_Boolean IGESData_GlobalSection::HasApplicationProtocol () const
718 return !theAppliProtocol.IsNull();
722 //=======================================================================
723 //function : ApplicationProtocol
725 //=======================================================================
727 Handle(TCollection_HAsciiString) IGESData_GlobalSection::ApplicationProtocol () const
729 return theAppliProtocol;
733 //=======================================================================
734 //function : NewDateString
736 //=======================================================================
738 Handle(TCollection_HAsciiString) IGESData_GlobalSection::NewDateString
739 (const Standard_Integer annee, const Standard_Integer mois,
740 const Standard_Integer jour, const Standard_Integer heure,
741 const Standard_Integer minute, const Standard_Integer seconde,
742 const Standard_Integer mode)
744 // 0 : IGES annee a l ancienne 00-99 -1 IGES annee complete 1 lisible
746 Standard_Integer moi = mois , jou = jour , anne = annee;
747 Standard_Integer heur = heure , minut = minute , second = seconde;
749 Standard_Integer millisec,microsec;
751 Quantity_Date ladate = system.SystemDate();
752 ladate.Values (moi,jou,anne,heur,minut,second,millisec,microsec);
754 if (mode == 0 || mode == -1) {
755 Standard_Integer an = anne % 100;
756 Standard_Boolean dizaine = (an >= 10);
757 if (!dizaine) an += 10;
758 if (mode < 0) { an = anne; dizaine = Standard_True; }
759 Standard_Integer date1 = (an) * 10000 + moi * 100 + jou;
760 Standard_Integer date2 = (heur + 100) * 10000 + minut * 100 + second;
761 sprintf (madate,"%d%d",date1,date2);
762 madate[(mode == 0 ? 6: 8)] = '.';
763 if (!dizaine) madate[0] = '0';
764 } else if (mode == 1) {
765 sprintf (madate,"%4.4d-%2.2d-%2.2d:%2.2d-%2.2d-%2.2d",
766 anne,moi,jou,heur,minut,second);
768 return new TCollection_HAsciiString(madate);
772 //=======================================================================
773 //function : NewDateString
775 //=======================================================================
777 Handle(TCollection_HAsciiString) IGESData_GlobalSection::NewDateString
778 (const Handle(TCollection_HAsciiString)& date, const Standard_Integer mode)
780 Standard_Integer anne,moi,jou,heur,minut,second;
781 if (date.IsNull()) return date;
782 Standard_Integer i0 = 0;
783 if (date->Length() == 15) i0 = 2;
784 else if (date->Length() != 13) return date;
785 if (date->Value(i0+7) != '.') return date;
786 anne = (date->Value(i0+ 1) - 48) * 10 + (date->Value(i0+ 2) - 48);
789 if (anne < 1980) anne += 100;
791 anne = anne + (date->Value(1) - 48) *1000 + (date->Value(2) - 48) * 100;
793 moi = (date->Value(i0+ 3) - 48) * 10 + (date->Value(i0+ 4) - 48);
794 jou = (date->Value(i0+ 5) - 48) * 10 + (date->Value(i0+ 6) - 48);
795 heur = (date->Value(i0+ 8) - 48) * 10 + (date->Value(i0+ 9) - 48);
796 minut = (date->Value(i0+10) - 48) * 10 + (date->Value(i0+11) - 48);
797 second = (date->Value(i0+12) - 48) * 10 + (date->Value(i0+13) - 48);
799 return IGESData_GlobalSection::NewDateString (anne,moi,jou,heur,minut,second,mode);
803 //=======================================================================
804 //function : UnitValue
806 //=======================================================================
808 Standard_Real IGESData_GlobalSection::UnitValue () const
810 return UnitsMethods::GetLengthFactorValue ( theUnitFlag ) /
811 UnitsMethods::GetCasCadeLengthUnit(); //abv 22 Feb 00: adding cascade unit factor
815 // ############### UPDATES ###############
817 void IGESData_GlobalSection::SetSeparator (const Standard_Character val)
818 { theSeparator = val; }
820 void IGESData_GlobalSection::SetEndMark (const Standard_Character val)
821 { theEndMark = val; }
823 void IGESData_GlobalSection::SetSendName (const Handle(TCollection_HAsciiString)& val)
824 { theSendName = TranslatedFromHollerith(val); }
826 void IGESData_GlobalSection::SetFileName (const Handle(TCollection_HAsciiString)& val)
827 { theFileName = TranslatedFromHollerith(val); }
829 void IGESData_GlobalSection::SetSystemId (const Handle(TCollection_HAsciiString)& val)
830 { theSystemId = TranslatedFromHollerith(val); }
832 void IGESData_GlobalSection::SetInterfaceVersion (const Handle(TCollection_HAsciiString)& val)
833 { theInterfaceVersion = TranslatedFromHollerith(val); }
835 void IGESData_GlobalSection::SetIntegerBits (const Standard_Integer val)
836 { theIntegerBits = val; }
838 void IGESData_GlobalSection::SetMaxPower10Single (const Standard_Integer val)
839 { theMaxPower10Single = val; }
841 void IGESData_GlobalSection::SetMaxDigitsSingle (const Standard_Integer val)
842 { theMaxDigitsSingle = val; }
844 void IGESData_GlobalSection::SetMaxPower10Double (const Standard_Integer val)
845 { theMaxPower10Double = val; }
847 void IGESData_GlobalSection::SetMaxDigitsDouble (const Standard_Integer val)
848 { theMaxDigitsDouble = val; }
850 void IGESData_GlobalSection::SetReceiveName (const Handle(TCollection_HAsciiString)& val)
851 { theReceiveName = TranslatedFromHollerith(val); }
853 void IGESData_GlobalSection::SetScale (const Standard_Real val)
856 void IGESData_GlobalSection::SetUnitFlag (const Standard_Integer val)
857 { theUnitFlag = val; }
859 void IGESData_GlobalSection::SetUnitName (const Handle(TCollection_HAsciiString)& val)
860 { theUnitName = TranslatedFromHollerith(val); }
862 void IGESData_GlobalSection::SetLineWeightGrad (const Standard_Integer val)
863 { theLineWeightGrad = val; }
865 void IGESData_GlobalSection::SetMaxLineWeight (const Standard_Real val)
866 { theMaxLineWeight = val; }
868 void IGESData_GlobalSection::SetDate (const Handle(TCollection_HAsciiString)& val)
869 { theDate = TranslatedFromHollerith(val); }
871 void IGESData_GlobalSection::SetResolution (const Standard_Real val)
872 { theResolution = val; }
874 void IGESData_GlobalSection::SetMaxCoord (const Standard_Real val)
876 hasMaxCoord = (val > 0.);
877 theMaxCoord = (hasMaxCoord ? val : 0.);
880 void IGESData_GlobalSection::MaxMaxCoord (const Standard_Real val)
882 Standard_Real aval = Abs(val);
883 if (hasMaxCoord) { if (aval > theMaxCoord) theMaxCoord = aval; }
884 else SetMaxCoord (aval);
887 void IGESData_GlobalSection::MaxMaxCoords (const gp_XYZ& xyz)
888 { MaxMaxCoord (xyz.X()); MaxMaxCoord (xyz.Y()); MaxMaxCoord (xyz.Z()); }
891 void IGESData_GlobalSection::SetAuthorName (const Handle(TCollection_HAsciiString)& val)
892 { theAuthorName = TranslatedFromHollerith(val); }
894 void IGESData_GlobalSection::SetCompanyName (const Handle(TCollection_HAsciiString)& val)
895 { theCompanyName = TranslatedFromHollerith(val); }
897 void IGESData_GlobalSection::SetIGESVersion (const Standard_Integer val)
898 { theIGESVersion = val; }
900 void IGESData_GlobalSection::SetDraftingStandard (const Standard_Integer val)
901 { theDraftingStandard = val; }
903 void IGESData_GlobalSection::SetLastChangeDate (const Handle(TCollection_HAsciiString)& val)
904 { theLastChangeDate = TranslatedFromHollerith(val); }
906 void IGESData_GlobalSection::SetApplicationProtocol (const Handle(TCollection_HAsciiString)& val)
907 { theAppliProtocol = TranslatedFromHollerith(val); }