973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
42cf5bc1 |
14 | |
15 | #include <Standard_Type.hxx> |
16 | #include <StepBasic_MeasureValueMember.hxx> |
7fd59977 |
17 | |
92efcf78 |
18 | IMPLEMENT_STANDARD_RTTIEXT(StepBasic_MeasureValueMember,StepData_SelectReal) |
19 | |
7fd59977 |
20 | //======================================================================= |
21 | //function : StepBasic_MeasureValueMember |
22 | //purpose : |
23 | //======================================================================= |
7fd59977 |
24 | StepBasic_MeasureValueMember::StepBasic_MeasureValueMember() |
25 | { |
26 | thecase = 0; |
27 | } |
28 | |
29 | |
30 | //======================================================================= |
31 | //function : HasName |
32 | //purpose : |
33 | //======================================================================= |
34 | |
35 | Standard_Boolean StepBasic_MeasureValueMember::HasName () const |
36 | { |
37 | return (thecase > 0); |
38 | } |
39 | |
40 | |
41 | //======================================================================= |
42 | //function : Name |
43 | //purpose : |
44 | //======================================================================= |
45 | |
46 | Standard_CString StepBasic_MeasureValueMember::Name () const |
47 | { |
48 | switch (thecase) { |
49 | case 0 : return ""; |
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"; |
28a73c1f |
64 | case 15 : return "COUNT_MEASURE"; |
7fd59977 |
65 | default : break; |
66 | } |
67 | return ""; |
68 | } |
69 | |
70 | |
71 | //======================================================================= |
72 | //function : SetName |
73 | //purpose : |
74 | //======================================================================= |
75 | |
76 | Standard_Boolean StepBasic_MeasureValueMember::SetName (const Standard_CString name) |
77 | { |
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; |
28a73c1f |
86 | else if (name[3] == 'T' && !strcmp (name,"CONTEXT_DEPENDANT_MEASURE")) thecase = 7; |
7fd59977 |
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; |
28a73c1f |
94 | else if (name[2] == 'U' && !strcmp (name,"COUNT_MEASURE")) thecase = 15; |
7fd59977 |
95 | else return Standard_False; |
96 | |
97 | return Standard_True; |
98 | } |