1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <Standard_Type.hxx>
16 #include <StepBasic_MeasureValueMember.hxx>
18 //=======================================================================
19 //function : StepBasic_MeasureValueMember
21 //=======================================================================
22 StepBasic_MeasureValueMember::StepBasic_MeasureValueMember()
28 //=======================================================================
31 //=======================================================================
33 Standard_Boolean StepBasic_MeasureValueMember::HasName () const
39 //=======================================================================
42 //=======================================================================
44 Standard_CString StepBasic_MeasureValueMember::Name () const
48 case 1 : return "LENGTH_MEASURE";
49 case 2 : return "TIME_MEASURE";
50 case 3 : return "PLANE_ANGLE_MEASURE";
51 case 4 : return "SOLID_ANGLE_MEASURE";
52 case 5 : return "RATIO_MEASURE";
53 case 6 : return "PARAMETER_VALUE";
54 case 7 : return "CONTEXT_DEPENDANT_MEASURE";
55 case 8 : return "POSITIVE_LENGTH_MEASURE";
56 case 9 : return "POSITIVE_PLANE_ANGLE_MEASURE";
57 case 10 : return "POSITIVE_RATIO_MEASURE";
58 case 11 : return "AREA_MEASURE";
59 case 12 : return "VOLUME_MEASURE";
60 case 13 : return "MASS_MEASURE";
61 case 14 : return "THERMODYNAMIC_TEMPERATURE_MEASURE";
62 case 15 : return "COUNT_MEASURE";
69 //=======================================================================
72 //=======================================================================
74 Standard_Boolean StepBasic_MeasureValueMember::SetName (const Standard_CString name)
76 if (!name || name[0] == '\0') thecase = 0;
77 // prefiltrage par une lettre caracteristique (ne pas se tromper)
78 else if (name[0] == 'L' && !strcmp (name,"LENGTH_MEASURE")) thecase = 1;
79 else if (name[1] == 'I' && !strcmp (name,"TIME_MEASURE")) thecase = 2;
80 else if (name[1] == 'L' && !strcmp (name,"PLANE_ANGLE_MEASURE")) thecase = 3;
81 else if (name[0] == 'S' && !strcmp (name,"SOLID_ANGLE_MEASURE")) thecase = 4;
82 else if (name[2] == 'T' && !strcmp (name,"RATIO_MEASURE")) thecase = 5;
83 else if (name[2] == 'R' && !strcmp (name,"PARAMETER_VALUE")) thecase = 6;
84 else if (name[3] == 'T' && !strcmp (name,"CONTEXT_DEPENDANT_MEASURE")) thecase = 7;
85 else if (name[9] == 'L' && !strcmp (name,"POSITIVE_LENGTH_MEASURE")) thecase = 8;
86 else if (name[9] == 'P' && !strcmp (name,"POSITIVE_PLANE_ANGLE_MEASURE")) thecase = 9;
87 else if (name[9] == 'R' && !strcmp (name,"POSITIVE_RATIO_MEASURE")) thecase = 10;
88 else if (name[0] == 'A' && !strcmp (name,"AREA_MEASURE")) thecase = 11;
89 else if (name[0] == 'V' && !strcmp (name,"VOLUME_MEASURE")) thecase = 12;
90 else if (name[0] == 'M' && !strcmp (name,"MASS_MEASURE")) thecase = 13;
91 else if (name[1] == 'H' && !strcmp (name,"THERMODYNAMIC_TEMPERATURE_MEASURE")) thecase = 14;
92 else if (name[2] == 'U' && !strcmp (name,"COUNT_MEASURE")) thecase = 15;
93 else return Standard_False;