0024428: Implementation of LGPL license
[occt.git] / src / StepElement / StepElement_CurveElementFreedomMember.cxx
1 // Created on: 2002-12-10
2 // Created by: data exchange team
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and / or modify it
8 // under the terms of the GNU Lesser General Public version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0
17
18 #include <StepElement_CurveElementFreedomMember.ixx>
19 #include <TCollection_HAsciiString.hxx>
20
21 static Standard_CString ECEF = "ENUMERATED_CURVE_ELEMENT_FREEDOM";
22 static Standard_CString ADDF = "APPLICATION_DEFINED_DEGREE_OF_FREEDOM";
23
24 //=======================================================================
25 //function : StepElement_CurveElementFreedomMember
26 //purpose  : 
27 //=======================================================================
28
29 StepElement_CurveElementFreedomMember::StepElement_CurveElementFreedomMember () : mycase(0) 
30 {
31 }
32
33 //=======================================================================
34 //function : HasName
35 //purpose  : 
36 //=======================================================================
37
38 Standard_Boolean StepElement_CurveElementFreedomMember::HasName() const
39 {
40  return mycase >0;
41 }
42
43 //=======================================================================
44 //function : Name
45 //purpose  : 
46 //=======================================================================
47
48 Standard_CString StepElement_CurveElementFreedomMember::Name() const
49 {
50   switch(mycase)  {
51     case 1  : return ECEF;
52     case 2  : return ADDF;
53     default : break;
54   }
55   return "";
56 }
57
58 //=======================================================================
59 //function : CompareNames
60 //purpose  : 
61 //=======================================================================
62
63 static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &/*numen*/) 
64 {
65   Standard_Integer thecase =0;
66   if (!name || name[0] == '\0') thecase = 0;
67   
68   else if(!strcmp (name,ECEF)){
69     thecase = 1;
70   }
71   else if(!strcmp (name,ADDF)){
72     thecase = 2;
73   }
74   return thecase;
75 }
76
77 //=======================================================================
78 //function : SetName
79 //purpose  : 
80 //=======================================================================
81
82 Standard_Boolean StepElement_CurveElementFreedomMember::SetName(const Standard_CString name) 
83 {
84   Standard_Integer numit =0;
85   mycase = CompareNames(name,numit);
86   if(numit) SetInteger(numit);
87   return (mycase >0);
88 }
89
90 //=======================================================================
91 //function : Matches
92 //purpose  : 
93 //=======================================================================
94
95 Standard_Boolean StepElement_CurveElementFreedomMember::Matches(const Standard_CString name) const
96 {
97   Standard_Integer numit =0;
98   Standard_Integer thecase = CompareNames(name,numit);
99   return (mycase==thecase);
100 }