Integration of OCCT 6.5.0 from SVN
[occt.git] / src / StepElement / StepElement_SurfaceElementPurposeMember.cxx
CommitLineData
7fd59977 1// File: StepElement_SurfaceElementPurposeMember.cxx
2// Created: Tue Dec 10 18:13:04 2002
3// Author: data exchange team
4// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0
5// Copyright: Open CASCADE 2002
6
7#include <StepElement_SurfaceElementPurposeMember.ixx>
8#include <TCollection_HAsciiString.hxx>
9
10static Standard_CString ESEP = "ENUMERATED_SURFACE_ELEMENT_PURPOSE";
11static Standard_CString ADEP = "APPLICATION_DEFINED_ELEMENT_PURPOSE";
12
13
14//=======================================================================
15//function : StepElement_SurfaceElementPurposeMember
16//purpose :
17//=======================================================================
18
19StepElement_SurfaceElementPurposeMember::StepElement_SurfaceElementPurposeMember () : mycase(0)
20{
21}
22
23//=======================================================================
24//function : HasName
25//purpose :
26//=======================================================================
27
28Standard_Boolean StepElement_SurfaceElementPurposeMember::HasName() const
29{
30 return mycase >0;
31}
32
33//=======================================================================
34//function : Name
35//purpose :
36//=======================================================================
37
38Standard_CString StepElement_SurfaceElementPurposeMember::Name() const
39{
40 switch(mycase) {
41 case 1 : return ESEP;
42 case 2 : return ADEP;
43 default : break;
44 }
45 return "";
46}
47
48//=======================================================================
49//function : CompareNames
50//purpose :
51//=======================================================================
52
53static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &numen)
54{
55 Standard_Integer thecase =0;
56 if (!name || name[0] == '\0') thecase = 0;
57 else if(!strcmp (name,ESEP)) {
58 thecase = 1;
59 }
60 else if(!strcmp (name,ADEP)) {
61 thecase = 1;
62 }
63 return thecase;
64}
65
66//=======================================================================
67//function : SetName
68//purpose :
69//=======================================================================
70
71Standard_Boolean StepElement_SurfaceElementPurposeMember::SetName(const Standard_CString name)
72{
73 Standard_Integer numit =0;
74 mycase = CompareNames(name,numit);
75 if(numit) SetInteger(numit);
76 return (mycase >0);
77}
78
79//=======================================================================
80//function : Matches
81//purpose :
82//=======================================================================
83
84Standard_Boolean StepElement_SurfaceElementPurposeMember::Matches(const Standard_CString name) const
85{
86 Standard_Integer numit =0;
87 Standard_Integer thecase = CompareNames(name,numit);
88 return (mycase==thecase);
89}