summaryrefslogtreecommitdiff
path: root/src/StepElement/StepElement_CurveElementFreedomMember.cxx
blob: 97984ef9e306aece791c44dc6b5f9943451a7779 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// File:	StepElement_CurveElementFreedomMember.cxx
// Created:	Tue Dec 10 18:12:57 2002 
// Author:	data exchange team
// Generator:	ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0
// Copyright:	Open CASCADE 2002

#include <StepElement_CurveElementFreedomMember.ixx>
#include <TCollection_HAsciiString.hxx>

static Standard_CString ECEF = "ENUMERATED_CURVE_ELEMENT_FREEDOM";
static Standard_CString ADDF = "APPLICATION_DEFINED_DEGREE_OF_FREEDOM";

//=======================================================================
//function : StepElement_CurveElementFreedomMember
//purpose  : 
//=======================================================================

StepElement_CurveElementFreedomMember::StepElement_CurveElementFreedomMember () : mycase(0) 
{
}

//=======================================================================
//function : HasName
//purpose  : 
//=======================================================================

Standard_Boolean StepElement_CurveElementFreedomMember::HasName() const
{
 return mycase >0;
}

//=======================================================================
//function : Name
//purpose  : 
//=======================================================================

Standard_CString StepElement_CurveElementFreedomMember::Name() const
{
  switch(mycase)  {
    case 1  : return ECEF;
    case 2  : return ADDF;
    default : break;
  }
  return "";
}

//=======================================================================
//function : CompareNames
//purpose  : 
//=======================================================================

static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &numen) 
{
  Standard_Integer thecase =0;
  if (!name || name[0] == '\0') thecase = 0;
  
  else if(!strcmp (name,ECEF)){
    thecase = 1;
  }
  else if(!strcmp (name,ADDF)){
    thecase = 2;
  }
  return thecase;
}

//=======================================================================
//function : SetName
//purpose  : 
//=======================================================================

Standard_Boolean StepElement_CurveElementFreedomMember::SetName(const Standard_CString name) 
{
  Standard_Integer numit =0;
  mycase = CompareNames(name,numit);
  if(numit) SetInteger(numit);
  return (mycase >0);
}

//=======================================================================
//function : Matches
//purpose  : 
//=======================================================================

Standard_Boolean StepElement_CurveElementFreedomMember::Matches(const Standard_CString name) const
{
  Standard_Integer numit =0;
  Standard_Integer thecase = CompareNames(name,numit);
  return (mycase==thecase);
}