0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / StepFEA / StepFEA_SymmetricTensor23dMember.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 under
8 // the terms of the GNU Lesser General Public License 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 <StepFEA_SymmetricTensor23dMember.ixx>
19 #include <TCollection_HAsciiString.hxx>
20
21 static Standard_CString IST = "ISOTROPIC_SYMMETRIC_TENSOR2_3D";
22 static Standard_CString OST = "ORTHOTROPIC_SYMMETRIC_TENSOR2_3D";
23 static Standard_CString AST = "ANISOTROPIC_SYMMETRIC_TENSOR2_3D";
24
25 //=======================================================================
26 //function : StepFEA_SymmetricTensor23dMember
27 //purpose  : 
28 //=======================================================================
29
30 StepFEA_SymmetricTensor23dMember::StepFEA_SymmetricTensor23dMember () : mycase(0) 
31 {
32 }
33
34 //=======================================================================
35 //function : HasName
36 //purpose  : 
37 //=======================================================================
38
39 Standard_Boolean StepFEA_SymmetricTensor23dMember::HasName() const
40 {
41  return mycase >0;
42 }
43
44 //=======================================================================
45 //function : Name
46 //purpose  : 
47 //=======================================================================
48
49 Standard_CString StepFEA_SymmetricTensor23dMember::Name() const
50 {
51   switch(mycase)  {
52     case 1  : return IST;
53     case 2  : return OST;
54     case 3  : return AST;
55     default : break;
56   }
57   return "";
58 }
59
60 //=======================================================================
61 //function : CompareNames
62 //purpose  : 
63 //=======================================================================
64
65 static Standard_Integer CompareNames(const Standard_CString name)
66 {
67   Standard_Integer thecase = 0;
68   if (!name || name[0] == '\0') thecase = 0;
69    else if(!strcmp (name,IST)) thecase = 1;
70    else if(!strcmp (name,OST)) thecase = 2;
71    else if(!strcmp (name,AST)) thecase = 3;
72   return thecase;
73 }
74
75 //=======================================================================
76 //function : SetName
77 //purpose  : 
78 //=======================================================================
79
80 Standard_Boolean StepFEA_SymmetricTensor23dMember::SetName(const Standard_CString name) 
81 {
82   mycase = CompareNames(name);
83   return (mycase >0);
84 }
85
86 //=======================================================================
87 //function : Matches
88 //purpose  : 
89 //=======================================================================
90
91 Standard_Boolean StepFEA_SymmetricTensor23dMember::Matches(const Standard_CString name) const
92 {
93   Standard_Integer thecase = CompareNames(name);
94   return (mycase==thecase);
95 }