1 // Created on: 2002-12-10
2 // Created by: data exchange team
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0
18 #include <Standard_Type.hxx>
19 #include <StepElement_ElementAspectMember.hxx>
20 #include <TCollection_HAsciiString.hxx>
22 IMPLEMENT_STANDARD_RTTIEXT(StepElement_ElementAspectMember,StepData_SelectNamed)
24 static Standard_CString aElementVolume = "ELEMENT_VOLUME";
25 static Standard_CString aVolume3dFace = "VOLUME_3D_FACE";
26 static Standard_CString aVolume2dFace = "VOLUME_2D_FACE";
27 static Standard_CString aVolume3dEdge = "VOLUME_3D_EDGE";
28 static Standard_CString aVolume2dEdge = "VOLUME_2D_EDGE";
29 static Standard_CString aSurface3dFace = "SURFACE_3D_FACE";
30 static Standard_CString aSurface2dFace = "SURFACE_2D_FACE";
31 static Standard_CString aSurface3dEdge = "SURFACE_3D_EDGE";
32 static Standard_CString aSurface2dEdge = "SURFACE_2D_EDGE";
33 static Standard_CString aCurveEdge = "CURVE_EDGE";
35 //=======================================================================
36 //function : StepElement_ElementAspectMember
38 //=======================================================================
40 StepElement_ElementAspectMember::StepElement_ElementAspectMember () : mycase(0)
44 //=======================================================================
47 //=======================================================================
49 Standard_Boolean StepElement_ElementAspectMember::HasName() const
54 //=======================================================================
57 //=======================================================================
59 Standard_CString StepElement_ElementAspectMember::Name() const
62 case 1 : return aElementVolume;
63 case 2 : return aVolume3dFace;
64 case 3 : return aVolume2dFace;
65 case 4 : return aVolume3dEdge;
66 case 5 : return aVolume2dEdge;
67 case 6 : return aSurface3dFace;
68 case 7 : return aSurface2dFace;
69 case 8 : return aSurface3dEdge;
70 case 9 : return aSurface2dEdge;
71 case 10 : return aCurveEdge;
77 //=======================================================================
78 //function : CompareNames
80 //=======================================================================
82 static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &numen)
84 Standard_Integer thecase =0;
85 if (!name || name[0] == '\0') thecase = 0;
86 else if(!strcmp (name,aElementVolume)) {
90 else if(!strcmp (name,aVolume3dFace)) thecase = 2;
91 else if(!strcmp (name,aVolume2dFace)) thecase = 3;
92 else if(!strcmp (name,aVolume3dEdge)) thecase = 4;
93 else if(!strcmp (name,aVolume2dEdge)) thecase = 5;
94 else if(!strcmp (name,aSurface3dFace)) thecase = 6;
95 else if(!strcmp (name,aSurface2dFace)) thecase = 7;
96 else if(!strcmp (name,aSurface3dEdge)) thecase = 8;
97 else if(!strcmp (name,aSurface2dEdge)) thecase = 9;
98 else if(!strcmp (name,aCurveEdge)) {
105 //=======================================================================
108 //=======================================================================
110 Standard_Boolean StepElement_ElementAspectMember::SetName(const Standard_CString name)
112 Standard_Integer numit =0;
113 mycase = CompareNames(name,numit);
114 if(numit) SetInteger(numit);
118 //=======================================================================
121 //=======================================================================
123 Standard_Boolean StepElement_ElementAspectMember::Matches(const Standard_CString name) const
125 Standard_Integer numit =0;
126 Standard_Integer thecase = CompareNames(name,numit);
127 return (mycase==thecase);