0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / StepElement / StepElement_ElementAspectMember.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 <StepElement_ElementAspectMember.ixx>
19 #include <TCollection_HAsciiString.hxx>
20
21 static Standard_CString aElementVolume = "ELEMENT_VOLUME";
22 static Standard_CString aVolume3dFace = "VOLUME_3D_FACE";
23 static Standard_CString aVolume2dFace = "VOLUME_2D_FACE";
24 static Standard_CString aVolume3dEdge = "VOLUME_3D_EDGE";
25 static Standard_CString aVolume2dEdge = "VOLUME_2D_EDGE";
26 static Standard_CString aSurface3dFace = "SURFACE_3D_FACE";
27 static Standard_CString aSurface2dFace = "SURFACE_2D_FACE";
28 static Standard_CString aSurface3dEdge = "SURFACE_3D_EDGE";
29 static Standard_CString aSurface2dEdge = "SURFACE_2D_EDGE";
30 static Standard_CString aCurveEdge = "CURVE_EDGE";
31
32 //=======================================================================
33 //function : StepElement_ElementAspectMember
34 //purpose  : 
35 //=======================================================================
36
37 StepElement_ElementAspectMember::StepElement_ElementAspectMember () : mycase(0) 
38 {
39 }
40
41 //=======================================================================
42 //function : HasName
43 //purpose  : 
44 //=======================================================================
45
46 Standard_Boolean StepElement_ElementAspectMember::HasName() const
47 {
48  return mycase >0;
49 }
50
51 //=======================================================================
52 //function : Name
53 //purpose  : 
54 //=======================================================================
55
56 Standard_CString StepElement_ElementAspectMember::Name() const
57 {
58   switch(mycase)  {
59     case 1  : return aElementVolume;
60     case 2  : return aVolume3dFace;
61     case 3  : return aVolume2dFace;
62     case 4  : return aVolume3dEdge;
63     case 5  : return aVolume2dEdge;
64     case 6  : return aSurface3dFace;
65     case 7  : return aSurface2dFace;
66     case 8  : return aSurface3dEdge;
67     case 9  : return aSurface2dEdge;
68     case 10  : return aCurveEdge;
69     default : break;
70   }
71   return "";
72 }
73
74 //=======================================================================
75 //function : CompareNames
76 //purpose  : 
77 //=======================================================================
78
79 static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &numen) 
80 {
81   Standard_Integer thecase =0;
82   if (!name || name[0] == '\0') thecase = 0;
83    else if(!strcmp (name,aElementVolume)) { 
84      thecase = 1;
85      numen =  1;
86    }
87    else if(!strcmp (name,aVolume3dFace)) thecase = 2;
88    else if(!strcmp (name,aVolume2dFace)) thecase = 3;
89    else if(!strcmp (name,aVolume3dEdge)) thecase = 4;
90    else if(!strcmp (name,aVolume2dEdge)) thecase = 5;
91    else if(!strcmp (name,aSurface3dFace)) thecase = 6;
92    else if(!strcmp (name,aSurface2dFace)) thecase = 7;
93    else if(!strcmp (name,aSurface3dEdge)) thecase = 8;
94    else if(!strcmp (name,aSurface2dEdge)) thecase = 9;
95    else if(!strcmp (name,aCurveEdge)) { 
96      thecase = 10;
97      numen =  1;
98    }
99   return thecase;
100 }
101
102 //=======================================================================
103 //function : SetName
104 //purpose  : 
105 //=======================================================================
106
107 Standard_Boolean StepElement_ElementAspectMember::SetName(const Standard_CString name) 
108 {
109   Standard_Integer numit =0;
110   mycase = CompareNames(name,numit);
111   if(numit) SetInteger(numit);
112   return (mycase >0);
113 }
114
115 //=======================================================================
116 //function : Matches
117 //purpose  : 
118 //=======================================================================
119
120 Standard_Boolean StepElement_ElementAspectMember::Matches(const Standard_CString name) const
121 {
122   Standard_Integer numit =0;
123   Standard_Integer thecase = CompareNames(name,numit);
124   return (mycase==thecase);
125 }