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 IMPLEMENT_STANDARD_RTTIEXT(StepBasic_MeasureValueMember,StepData_SelectReal)
20 //=======================================================================
21 //function : StepBasic_MeasureValueMember
23 //=======================================================================
24 StepBasic_MeasureValueMember::StepBasic_MeasureValueMember()
30 //=======================================================================
33 //=======================================================================
35 Standard_Boolean StepBasic_MeasureValueMember::HasName () const
41 //=======================================================================
44 //=======================================================================
46 Standard_CString StepBasic_MeasureValueMember::Name () const
50 case 1 : return "LENGTH_MEASURE";
51 case 2 : return "TIME_MEASURE";
52 case 3 : return "PLANE_ANGLE_MEASURE";
53 case 4 : return "SOLID_ANGLE_MEASURE";
54 case 5 : return "RATIO_MEASURE";
55 case 6 : return "PARAMETER_VALUE";
56 case 7 : return "CONTEXT_DEPENDANT_MEASURE";
57 case 8 : return "POSITIVE_LENGTH_MEASURE";
58 case 9 : return "POSITIVE_PLANE_ANGLE_MEASURE";
59 case 10 : return "POSITIVE_RATIO_MEASURE";
60 case 11 : return "AREA_MEASURE";
61 case 12 : return "VOLUME_MEASURE";
62 case 13 : return "MASS_MEASURE";
63 case 14 : return "THERMODYNAMIC_TEMPERATURE_MEASURE";
64 case 15 : return "COUNT_MEASURE";
71 //=======================================================================
74 //=======================================================================
76 Standard_Boolean StepBasic_MeasureValueMember::SetName (const Standard_CString name)
78 if (!name || name[0] == '\0') thecase = 0;
79 // prefiltrage par une lettre caracteristique (ne pas se tromper)
80 else if (name[0] == 'L' && !strcmp (name,"LENGTH_MEASURE")) thecase = 1;
81 else if (name[1] == 'I' && !strcmp (name,"TIME_MEASURE")) thecase = 2;
82 else if (name[1] == 'L' && !strcmp (name,"PLANE_ANGLE_MEASURE")) thecase = 3;
83 else if (name[0] == 'S' && !strcmp (name,"SOLID_ANGLE_MEASURE")) thecase = 4;
84 else if (name[2] == 'T' && !strcmp (name,"RATIO_MEASURE")) thecase = 5;
85 else if (name[2] == 'R' && !strcmp (name,"PARAMETER_VALUE")) thecase = 6;
86 else if (name[3] == 'T' && !strcmp (name,"CONTEXT_DEPENDANT_MEASURE")) thecase = 7;
87 else if (name[9] == 'L' && !strcmp (name,"POSITIVE_LENGTH_MEASURE")) thecase = 8;
88 else if (name[9] == 'P' && !strcmp (name,"POSITIVE_PLANE_ANGLE_MEASURE")) thecase = 9;
89 else if (name[9] == 'R' && !strcmp (name,"POSITIVE_RATIO_MEASURE")) thecase = 10;
90 else if (name[0] == 'A' && !strcmp (name,"AREA_MEASURE")) thecase = 11;
91 else if (name[0] == 'V' && !strcmp (name,"VOLUME_MEASURE")) thecase = 12;
92 else if (name[0] == 'M' && !strcmp (name,"MASS_MEASURE")) thecase = 13;
93 else if (name[1] == 'H' && !strcmp (name,"THERMODYNAMIC_TEMPERATURE_MEASURE")) thecase = 14;
94 else if (name[2] == 'U' && !strcmp (name,"COUNT_MEASURE")) thecase = 15;
95 else return Standard_False;