0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / StepFEA / StepFEA_SymmetricTensor43dMember.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
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.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #include <StepFEA_SymmetricTensor43dMember.ixx>
15 #include <TCollection_HAsciiString.hxx>
16
17 static Standard_CString AST = "ANISOTROPIC_SYMMETRIC_TENSOR4_3D";
18 static Standard_CString IST = "FEA_ISOTROPIC_SYMMETRIC_TENSOR4_3D";
19 static Standard_CString IOST = "FEA_ISO_ORTHOTROPIC_SYMMETRIC_TENSOR4_3D";
20 static Standard_CString TIST = "FEA_TRANSVERSE_ISOTROPIC_SYMMETRIC_TENSOR4_3D";
21 static Standard_CString CNOST = "FEA_COLUMN_NORMALISED_ORTHOTROPIC_SYMMETRIC_TENSOR4_3D";
22 static Standard_CString CNMST = "FEA_COLUMN_NORMALISED_MONOCLINIC_SYMMETRIC_TENSOR4_3D";
23
24
25 //=======================================================================
26 //function : StepFEA_SymmetricTensor43dMember
27 //purpose  : 
28 //=======================================================================
29
30 StepFEA_SymmetricTensor43dMember::StepFEA_SymmetricTensor43dMember () : mycase(0) 
31 {
32 }
33
34
35 //=======================================================================
36 //function : HasName
37 //purpose  : 
38 //=======================================================================
39
40 Standard_Boolean StepFEA_SymmetricTensor43dMember::HasName() const
41 {
42   return mycase>0;
43 }
44
45
46 //=======================================================================
47 //function : Name
48 //purpose  : 
49 //=======================================================================
50
51 Standard_CString StepFEA_SymmetricTensor43dMember::Name() const
52 {
53   switch(mycase)  {
54     case 1  : return AST;
55     case 2  : return IST;
56     case 3  : return IOST;
57     case 4  : return TIST;
58     case 5  : return CNOST;
59     case 6  : return CNMST;
60     default : break;
61   }
62   return "";
63 }
64
65
66 //=======================================================================
67 //function : CompareNames
68 //purpose  : 
69 //=======================================================================
70
71 static Standard_Integer CompareNames(const Standard_CString name)
72 {
73   Standard_Integer thecase =0;
74   if (!name || name[0] == '\0') thecase = 0;
75   else if(!strcmp (name,AST)) thecase = 1;
76   else if(!strcmp (name,IST)) thecase = 2;
77   else if(!strcmp (name,IOST)) thecase = 3;
78   else if(!strcmp (name,TIST)) thecase = 4;
79   else if(!strcmp (name,CNOST)) thecase = 5;
80   else if(!strcmp (name,CNMST)) thecase = 6;
81   return thecase;
82 }
83
84
85 //=======================================================================
86 //function : SetName
87 //purpose  : 
88 //=======================================================================
89
90 Standard_Boolean StepFEA_SymmetricTensor43dMember::SetName(const Standard_CString name) 
91 {
92   mycase = CompareNames(name);
93   return (mycase >0);
94 }
95
96 //=======================================================================
97 //function : Matches
98 //purpose  : 
99 //=======================================================================
100
101 Standard_Boolean StepFEA_SymmetricTensor43dMember::Matches(const Standard_CString name) const
102 {
103   Standard_Integer thecase = CompareNames(name);
104   return (mycase==thecase);
105 }