0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / UnitsAPI / UnitsAPI.cxx
1 // Copyright (c) 1998-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15
16 #include <OSD_Environment.hxx>
17 #include <Resource_Manager.hxx>
18 #include <Standard_NoSuchObject.hxx>
19 #include <TCollection_AsciiString.hxx>
20 #include <Units.hxx>
21 #include <Units_Dimensions.hxx>
22 #include <Units_Quantity.hxx>
23 #include <Units_Unit.hxx>
24 #include <Units_UnitsSystem.hxx>
25 #include <UnitsAPI.hxx>
26
27 static Handle(Resource_Manager) CurrentUnits,SICurrentUnits,MDTVCurrentUnits;
28 static Units_UnitsSystem LocalSystemUnits,SILocalSystemUnits,MDTVLocalSystemUnits;
29 static TCollection_AsciiString rstring;
30 static UnitsAPI_SystemUnits localSystem = UnitsAPI_SI;
31 static UnitsAPI_SystemUnits currentSystem = UnitsAPI_DEFAULT;
32
33 //=======================================================================
34 //function : CheckLoading
35 //purpose  :
36 //=======================================================================
37
38 void UnitsAPI::CheckLoading (const UnitsAPI_SystemUnits aSystemUnits)
39 {
40   if( currentSystem != aSystemUnits || CurrentUnits.IsNull()) {
41     switch (aSystemUnits) {
42       case UnitsAPI_DEFAULT :
43         if( !CurrentUnits.IsNull() ) break;
44         Standard_FALLTHROUGH
45       case UnitsAPI_SI :  
46         currentSystem = UnitsAPI_SI; 
47         if( SICurrentUnits.IsNull() ) {
48 #ifdef _WIN32
49           OSD_Environment env3("CSF_CurrentUnits");
50           TCollection_AsciiString csfcurrent (env3.Value());
51           if( csfcurrent.Length() > 0 )
52                 SICurrentUnits = new Resource_Manager(csfcurrent.ToCString());
53           else
54                 SICurrentUnits = new Resource_Manager("CurrentUnits");
55 #else
56                 SICurrentUnits = new Resource_Manager("CurrentUnits");
57 #endif
58         }
59         CurrentUnits = SICurrentUnits;
60         LocalSystemUnits = SILocalSystemUnits;
61         break;
62       case UnitsAPI_MDTV :  
63         currentSystem = UnitsAPI_MDTV; 
64         if( MDTVCurrentUnits.IsNull() )  {
65 #ifdef _WIN32
66           OSD_Environment env4("CSF_MDTVCurrentUnits");
67           TCollection_AsciiString csfmdtvcurrent (env4.Value());
68           if( csfmdtvcurrent.Length() > 0 )
69                 MDTVCurrentUnits = new Resource_Manager(csfmdtvcurrent.ToCString());
70           else
71                 MDTVCurrentUnits = new Resource_Manager("MDTVCurrentUnits");
72 #else
73                 MDTVCurrentUnits = new Resource_Manager("MDTVCurrentUnits");
74 #endif
75         }
76         CurrentUnits = MDTVCurrentUnits;
77         if( MDTVLocalSystemUnits.IsEmpty() ) {
78           MDTVLocalSystemUnits.Specify("LENGTH","mm");
79           MDTVLocalSystemUnits.Specify("AREA","mm\xB2");
80           MDTVLocalSystemUnits.Specify("VOLUME","mm\xB3");
81           MDTVLocalSystemUnits.Specify("INERTIA","mm**4");
82           MDTVLocalSystemUnits.Specify("SPEED","mm/s");
83           MDTVLocalSystemUnits.Specify("ACCELERATION","mm/s\xB2");
84           MDTVLocalSystemUnits.Specify("VOLUMIC MASS","kg/mm\xB3");
85           MDTVLocalSystemUnits.Specify("VOLUME FLOW","mm\xB3/s");
86           MDTVLocalSystemUnits.Specify("CONSUMPTION","mm\xB2");
87           MDTVLocalSystemUnits.Specify("QUANTITY OF MOVEMENT","kg*mm/s");
88           MDTVLocalSystemUnits.Specify("KINETIC MOMENT","kg*mm\xB2/s");
89           MDTVLocalSystemUnits.Specify("MOMENT OF INERTIA","kg*mm\xB2");
90           MDTVLocalSystemUnits.Specify("FORCE","kg*mm/s\xB2");
91           MDTVLocalSystemUnits.Specify("LINEIC FORCE","kg/s\xB2");
92           MDTVLocalSystemUnits.Specify("MOMENT OF A FORCE","kg*mm\xB2/s\xB2");
93           MDTVLocalSystemUnits.Specify("PRESSURE","kg/(mm*s\xB2)");
94           MDTVLocalSystemUnits.Specify("DYNAMIC VISCOSITY","kg/(mm*s)");
95           MDTVLocalSystemUnits.Specify("KINETIC VISCOSITY","mm\xB2/s");
96           MDTVLocalSystemUnits.Specify("TENSION SUPERFICIELLE","mm/s\xB2");
97           MDTVLocalSystemUnits.Specify("ENERGY","kg*mm\xB2/s\xB2");
98           MDTVLocalSystemUnits.Specify("POWER","kg*mm\xB2/s\xB3");
99           MDTVLocalSystemUnits.Specify("LINEIC POWER","kg*mm/s\xB3");
100           MDTVLocalSystemUnits.Specify("SURFACIC POWER","kg/s\xB3");
101           MDTVLocalSystemUnits.Specify("VOLUMIC POWER","kg/(mm*s\xB3)");
102           MDTVLocalSystemUnits.Specify("THERMICAL CONDUCTIVITY","kg*mm/(s\xB3*\xB0K)");
103           MDTVLocalSystemUnits.Specify("THERMICAL CONVECTIVITY","kg/(s\xB3*\xB0K)");
104           MDTVLocalSystemUnits.Specify("THERMICAL MASSIC CAPACITY","mm\xB2/(s\xB2*\xB0K)");
105           MDTVLocalSystemUnits.Specify("ENTROPY","kg*mm\xB2/(s\xB2*\xB0K)");
106           MDTVLocalSystemUnits.Specify("ENTHALPY","kg*mm\xB2/s\xB2");
107           MDTVLocalSystemUnits.Specify("LUMINANCE","cd/mm\xB2");
108           MDTVLocalSystemUnits.Specify("LUMINOUS EFFICACITY","s\xB3*Lu/(kg*mm\xB2)");
109           MDTVLocalSystemUnits.Specify("ELECTRIC FIELD","V/mm");
110           MDTVLocalSystemUnits.Specify("ELECTRIC CAPACITANCE","s**4*A\xB2/(kg*mm\xB2)");
111           MDTVLocalSystemUnits.Specify("MAGNETIC FIELD","A/mm");
112           MDTVLocalSystemUnits.Specify("MAGNETIC FLUX","kg*mm\xB2/(s\xB2*A)");
113           MDTVLocalSystemUnits.Specify("INDUCTANCE","kg*mm\xB2/(s\xB2*A\xB2)");
114           MDTVLocalSystemUnits.Specify("RELUCTANCE","s\xB2*A\xB2/(kg*mm\xB2)");
115           MDTVLocalSystemUnits.Specify("RESISTIVITY","O*mm");
116           MDTVLocalSystemUnits.Specify("CONDUCTIVITY","S/mm");
117           MDTVLocalSystemUnits.Specify("MOLAR MASS","kg/mol");
118           MDTVLocalSystemUnits.Specify("MOLAR VOLUME","mm\xB3/mol");
119           MDTVLocalSystemUnits.Specify("CONCENTRATION","kg/mm\xB3");
120           MDTVLocalSystemUnits.Specify("MOLAR CONCENTRATION","mol/mm\xB3");
121           MDTVLocalSystemUnits.Specify("ACCOUSTIC INTENSITY","mm/A\xB2");
122           MDTVLocalSystemUnits.Specify("DOSE EQUIVALENT","mm\xB2/s\xB2");
123           MDTVLocalSystemUnits.Specify("ABSORBED DOSE","mm\xB2/s\xB2");
124           MDTVLocalSystemUnits.Specify("FLUX OF MAGNETIC INDUCTION","kg*mm\xB2/(s\xB2*A)");
125           MDTVLocalSystemUnits.Specify("ROTATION ACCELERATION","rad/s\xB2");
126           MDTVLocalSystemUnits.Specify("TRANSLATION STIFFNESS","kg/s\xB2");
127           MDTVLocalSystemUnits.Specify("ROTATION STIFFNESS","kg*mm\xB2/(s\xB2*rad)");
128           MDTVLocalSystemUnits.Activates();
129         }
130         LocalSystemUnits = MDTVLocalSystemUnits;
131         break;
132     }
133   }
134 }
135
136
137 //=======================================================================
138 //function : CurrentToLS
139 //purpose  :
140 //=======================================================================
141
142 Standard_Real UnitsAPI::CurrentToLS(const Standard_Real aData,
143                                     const Standard_CString aQuantity)
144 {
145   Standard_Real aValue = aData;
146   CheckLoading (localSystem); 
147   if( CurrentUnits->Find(aQuantity) ) {
148     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
149     aValue = Units::ToSI(aData,current.ToCString());
150     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(aQuantity,aValue);
151   }
152 #ifdef OCCT_DEBUG
153   else {
154     std::cout <<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << std::endl;
155   }
156 #endif
157
158   return aValue;
159 }
160
161
162 //=======================================================================
163 //function : CurrentToSI
164 //purpose  :
165 //=======================================================================
166
167 Standard_Real UnitsAPI::CurrentToSI(const Standard_Real aData,
168                                     const Standard_CString aQuantity)
169 {
170   Standard_Real aValue = aData;
171   CheckLoading (UnitsAPI_DEFAULT); 
172   if( CurrentUnits->Find(aQuantity) ) {
173     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
174     aValue = Units::ToSI(aData,current.ToCString());
175   }
176 #ifdef OCCT_DEBUG
177   else {
178     std::cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << std::endl;
179   }
180 #endif
181
182   return aValue;
183 }
184
185
186 //=======================================================================
187 //function : CurrentFromLS
188 //purpose  :
189 //=======================================================================
190
191 Standard_Real UnitsAPI::CurrentFromLS(const Standard_Real aData,
192                                       const Standard_CString aQuantity)
193 {
194   Standard_Real aValue = aData;
195   CheckLoading (localSystem); 
196   if( CurrentUnits->Find(aQuantity) ) {
197     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
198     aValue = LocalSystemUnits.ConvertUserSystemValueToSI(aQuantity,aData);
199     aValue = Units::FromSI(aValue,current.ToCString());
200   }
201 #ifdef OCCT_DEBUG
202   else {
203     std::cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << std::endl;
204   }
205 #endif
206
207   return aValue;
208 }
209
210
211 //=======================================================================
212 //function : CurrentFromSI
213 //purpose  :
214 //=======================================================================
215
216 Standard_Real UnitsAPI::CurrentFromSI(const Standard_Real aData,
217                                       const Standard_CString aQuantity)
218 {
219   Standard_Real aValue = aData;
220   CheckLoading (UnitsAPI_DEFAULT); 
221   if( CurrentUnits->Find(aQuantity) ) {
222     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
223     aValue = Units::FromSI(aData,current.ToCString());
224   }
225 #ifdef OCCT_DEBUG
226   else {
227     std::cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << std::endl;
228   }
229 #endif
230
231   return aValue;
232 }
233
234
235 //=======================================================================
236 //function : CurrentToAny
237 //purpose  :
238 //=======================================================================
239
240 Standard_Real UnitsAPI::CurrentToAny(const Standard_Real aData,
241                                      const Standard_CString aQuantity,
242                                      const Standard_CString aUnit) {
243   Standard_Real aValue = aData;
244   CheckLoading (UnitsAPI_DEFAULT); 
245   if( CurrentUnits->Find(aQuantity) ) {
246     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
247     aValue = AnyToAny(aData,current.ToCString(),aUnit);
248   }
249 #ifdef OCCT_DEBUG
250   else {
251     std::cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << std::endl;
252   }
253 #endif
254
255   return aValue;
256 }
257
258
259 //=======================================================================
260 //function : CurrentFromAny
261 //purpose  :
262 //=======================================================================
263
264 Standard_Real UnitsAPI::CurrentFromAny(const Standard_Real aData,
265                                        const Standard_CString aQuantity,
266                                        const Standard_CString aUnit)
267 {
268   Standard_Real aValue = aData;
269   CheckLoading (UnitsAPI_DEFAULT); 
270   if( CurrentUnits->Find(aQuantity) ) {
271     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
272     aValue = AnyToAny(aData,aUnit,current.ToCString());
273   }
274 #ifdef OCCT_DEBUG
275   else {
276     std::cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << std::endl;
277   }
278 #endif
279
280   return aValue;
281 }
282
283
284 //=======================================================================
285 //function : AnyToLS
286 //purpose  :
287 //=======================================================================
288
289 Standard_Real UnitsAPI::AnyToLS(const Standard_Real aData,
290                                 const Standard_CString aUnit)
291 {
292   Standard_Real aValue = aData;
293   CheckLoading (localSystem); 
294   Handle(Units_Dimensions) aDim;
295   aValue = Units::ToSI(aValue,aUnit,aDim);
296   if(aDim.IsNull())
297     return aValue;
298   Standard_CString quantity = aDim->Quantity();
299   if( quantity ) {
300     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(quantity,aValue);
301   }
302 #ifdef OCCT_DEBUG
303   else
304     std::cout<<"Warning: BAD Quantity returns in UnitsAPI::AnyToLS(" << aData << "," << aUnit << ")" << std::endl;
305 #endif
306   return aValue;
307 }
308
309
310 //=======================================================================
311 //function : AnyToLS
312 //purpose  :
313 //=======================================================================
314
315 Standard_Real UnitsAPI::AnyToLS(const Standard_Real aData,
316                                 const Standard_CString aUnit,
317                                 Handle(Units_Dimensions) &aDim)
318 {
319   Standard_Real aValue = aData;
320   CheckLoading (localSystem); 
321   aValue = Units::ToSI(aValue,aUnit,aDim);
322   Standard_CString quantity = aDim->Quantity();
323   if(aDim.IsNull())
324     return aValue;
325   if( quantity ) {
326     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(quantity,aValue);
327   }
328 #ifdef OCCT_DEBUG
329   else
330     std::cout<<"Warning: BAD Quantity returns in UnitsAPI::AnyToLS(" << aData << "," << aUnit << "," << aDim.get() << ")" << std::endl;
331 #endif
332   return aValue;
333 }
334
335
336 //=======================================================================
337 //function : AnyToSI
338 //purpose  :
339 //=======================================================================
340
341 Standard_Real UnitsAPI::AnyToSI(const Standard_Real aData,
342                                 const Standard_CString aUnit)
343 {
344   Standard_Real aValue;
345   CheckLoading (UnitsAPI_DEFAULT); 
346   aValue = Units::ToSI(aData,aUnit);
347   return aValue;
348 }
349
350
351 //=======================================================================
352 //function : AnyToSI
353 //purpose  :
354 //=======================================================================
355
356 Standard_Real UnitsAPI::AnyToSI(const Standard_Real aData,
357                                 const Standard_CString aUnit,
358                                 Handle(Units_Dimensions) &aDim)
359 {
360   Standard_Real aValue;
361   CheckLoading (UnitsAPI_DEFAULT);
362   aValue = Units::ToSI(aData,aUnit,aDim);
363   return aValue;
364 }
365
366
367 //=======================================================================
368 //function : AnyFromLS
369 //purpose  :
370 //=======================================================================
371
372 Standard_Real UnitsAPI::AnyFromLS(const Standard_Real aData,
373                                   const Standard_CString aUnit)
374 {
375   Standard_Real aValue = aData;
376   CheckLoading (localSystem); 
377   Handle(Units_Dimensions) aDim;
378   aValue = Units::FromSI(aValue,aUnit,aDim);
379   Standard_CString quantity = aDim->Quantity();
380   if( quantity ) {
381     aValue = LocalSystemUnits.ConvertUserSystemValueToSI(quantity,aValue);
382   }
383 #ifdef OCCT_DEBUG
384   else
385     std::cout<<"Warning: BAD Quantity returns in UnitsAPI::AnyToLS(" << aData << "," << aUnit << ")" << std::endl;
386 #endif
387
388   return aValue;
389 }
390
391
392 //=======================================================================
393 //function : AnyFromSI
394 //purpose  :
395 //=======================================================================
396
397 Standard_Real UnitsAPI::AnyFromSI(const Standard_Real aData,
398                                   const Standard_CString aUnit)
399 {
400   Standard_Real aValue;
401   CheckLoading (UnitsAPI_DEFAULT); 
402   aValue = Units::FromSI(aData,aUnit);
403   return aValue;
404 }
405
406
407 //=======================================================================
408 //function : AnyToAny
409 //purpose  :
410 //=======================================================================
411
412 Standard_Real UnitsAPI::AnyToAny(const Standard_Real aData,
413                                  const Standard_CString aUnit1,
414                                  const Standard_CString aUnit2)
415 {
416   Standard_Real aValue = aData;
417   CheckLoading (UnitsAPI_DEFAULT); 
418   aValue = Units::Convert(aValue,aUnit1,aUnit2);
419   return aValue;
420 }
421
422
423 //=======================================================================
424 //function : LSToSI
425 //purpose  :
426 //=======================================================================
427
428 Standard_Real UnitsAPI::LSToSI(const Standard_Real aData,
429                                const Standard_CString aQuantity)
430 {
431   Standard_Real aValue = aData;
432   CheckLoading (localSystem); 
433   if( CurrentUnits->Find(aQuantity) ) {
434     aValue = LocalSystemUnits.ConvertUserSystemValueToSI(aQuantity,aData);
435   }
436 #ifdef OCCT_DEBUG
437   else {
438     std::cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << std::endl;
439   }
440 #endif
441
442   return aValue;
443 }
444
445
446 //=======================================================================
447 //function : SIToLS
448 //purpose  :
449 //=======================================================================
450
451 Standard_Real UnitsAPI::SIToLS(const Standard_Real aData,
452                                const Standard_CString aQuantity)
453 {
454   Standard_Real aValue = aData;
455   CheckLoading (localSystem); 
456   if( CurrentUnits->Find(aQuantity) ) {
457     aValue = LocalSystemUnits.ConvertSIValueToUserSystem(aQuantity,aValue);
458   }
459 #ifdef OCCT_DEBUG
460   else {
461     std::cout<<"Warning: UnitsAPI,the quantity '" << aQuantity << "' does not exist in the current units system" << std::endl;
462   }
463 #endif
464
465   return aValue;
466 }
467
468
469 //=======================================================================
470 //function : SetLocalSystem
471 //purpose  :
472 //=======================================================================
473
474 void UnitsAPI::SetLocalSystem(const UnitsAPI_SystemUnits aSystemUnits)
475 {
476   CheckLoading (aSystemUnits); 
477   localSystem = currentSystem; 
478 }
479
480
481 //=======================================================================
482 //function : LocalSystem
483 //purpose  :
484 //=======================================================================
485
486 UnitsAPI_SystemUnits UnitsAPI::LocalSystem()
487 {
488   return localSystem; 
489 }
490
491
492 //=======================================================================
493 //function : SetCurrentUnit
494 //purpose  :
495 //=======================================================================
496
497 void UnitsAPI::SetCurrentUnit(const Standard_CString aQuantity,
498                               const Standard_CString anUnit)
499 {
500   CheckLoading(localSystem);
501   CurrentUnits->SetResource(aQuantity,anUnit);
502 }
503
504
505 //=======================================================================
506 //function : Save
507 //purpose  :
508 //=======================================================================
509
510 void UnitsAPI::Save()
511 {
512   CheckLoading(localSystem);
513   CurrentUnits->Save();
514 }
515
516
517 //=======================================================================
518 //function : Reload
519 //purpose  :
520 //=======================================================================
521
522 void UnitsAPI::Reload()
523 {
524   currentSystem = UnitsAPI_DEFAULT;
525   CheckLoading(localSystem);
526 }
527
528
529 //=======================================================================
530 //function : CurrentUnit
531 //purpose  :
532 //=======================================================================
533
534 static TCollection_AsciiString astring;
535 Standard_CString UnitsAPI::CurrentUnit(const Standard_CString aQuantity)
536 {
537   CheckLoading(localSystem);
538   astring = CurrentUnits->Value(aQuantity);
539   return astring.ToCString();
540 }
541
542
543 //=======================================================================
544 //function : Dimensions
545 //purpose  :
546 //=======================================================================
547
548 Handle(Units_Dimensions) UnitsAPI::Dimensions(const Standard_CString aType)
549 {
550  return  Units::Dimensions(aType);
551 }
552
553
554 //=======================================================================
555 //function : DimensionLess
556 //purpose  :
557 //=======================================================================
558
559 Handle(Units_Dimensions) UnitsAPI::DimensionLess()
560 {
561   return Units_Dimensions::ALess();
562 }
563
564
565 //=======================================================================
566 //function : DimensionMass
567 //purpose  :
568 //=======================================================================
569
570 Handle(Units_Dimensions) UnitsAPI::DimensionMass()
571 {
572  return Units_Dimensions::AMass();
573 }
574
575
576 //=======================================================================
577 //function : DimensionLength
578 //purpose  :
579 //=======================================================================
580
581 Handle(Units_Dimensions) UnitsAPI::DimensionLength()
582 {
583  return  Units_Dimensions::ALength();
584 }
585
586
587 //=======================================================================
588 //function : DimensionTime
589 //purpose  :
590 //=======================================================================
591
592 Handle(Units_Dimensions) UnitsAPI::DimensionTime()
593 {
594  return Units_Dimensions::ATime() ;
595 }
596
597
598 //=======================================================================
599 //function : DimensionElectricCurrent
600 //purpose  :
601 //=======================================================================
602
603 Handle(Units_Dimensions) UnitsAPI::DimensionElectricCurrent()
604 {
605  return Units_Dimensions::AElectricCurrent() ;
606 }
607
608
609 //=======================================================================
610 //function : DimensionThermodynamicTemperature
611 //purpose  :
612 //=======================================================================
613
614 Handle(Units_Dimensions) UnitsAPI::DimensionThermodynamicTemperature()
615 {
616  return Units_Dimensions::AThermodynamicTemperature();
617 }
618
619
620 //=======================================================================
621 //function : DimensionAmountOfSubstance
622 //purpose  :
623 //=======================================================================
624
625 Handle(Units_Dimensions) UnitsAPI::DimensionAmountOfSubstance()
626 {
627  return Units_Dimensions::AAmountOfSubstance();
628 }
629
630
631 //=======================================================================
632 //function : DimensionLuminousIntensity
633 //purpose  :
634 //=======================================================================
635
636 Handle(Units_Dimensions) UnitsAPI::DimensionLuminousIntensity()
637 {
638  return Units_Dimensions::ALuminousIntensity();
639 }
640
641
642 //=======================================================================
643 //function : DimensionPlaneAngle
644 //purpose  :
645 //=======================================================================
646
647 Handle(Units_Dimensions) UnitsAPI::DimensionPlaneAngle()
648 {
649  return Units_Dimensions::APlaneAngle();
650 }
651
652
653 //=======================================================================
654 //function : DimensionSolidAngle
655 //purpose  :
656 //=======================================================================
657
658 Handle(Units_Dimensions) UnitsAPI::DimensionSolidAngle()
659 {
660  return Units_Dimensions::ASolidAngle();
661 }
662
663
664 //=======================================================================
665 //function : Check
666 //purpose  :
667 //=======================================================================
668
669 Standard_Boolean UnitsAPI::Check(const Standard_CString aQuantity, 
670                                  const Standard_CString /*aUnit*/)
671 {
672   Standard_Boolean status = Standard_False;
673   CheckLoading (UnitsAPI_DEFAULT); 
674   if( CurrentUnits->Find(aQuantity) ) {
675     TCollection_AsciiString current(CurrentUnits->Value(aQuantity));
676 //    aValue = AnyToAny(aData,current.ToCString(),aUnit);
677 //    aValue = Units::Convert(aValue,aUnit1,aUnit2);
678   }
679
680   return status;
681 }