0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / StepElement / StepElement_MeasureOrUnspecifiedValueMember.cxx
CommitLineData
b311480e 1// Created on: 2002-12-10
2// Created by: data exchange team
973c2be1 3// Copyright (c) 2002-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 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
973c2be1 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
7fd59977 16// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0
7fd59977 17
18#include <StepElement_MeasureOrUnspecifiedValueMember.ixx>
19#include <TCollection_HAsciiString.hxx>
20
21
22static Standard_CString aContextDependedMeasure = "CONTEXT_DEPENDENT_MEASURE";
23static Standard_CString anUnspecifiedValue = "UNSPECIFIED_VALUE";
24
25//=======================================================================
26//function : StepElement_MeasureOrUnspecifiedValueMember
27//purpose :
28//=======================================================================
29
30StepElement_MeasureOrUnspecifiedValueMember::StepElement_MeasureOrUnspecifiedValueMember () : mycase(0)
31{
32}
33
34//=======================================================================
35//function : HasName
36//purpose :
37//=======================================================================
38
39Standard_Boolean StepElement_MeasureOrUnspecifiedValueMember::HasName() const
40{
41 return mycase >0;
42}
43
44//=======================================================================
45//function : Name
46//purpose :
47//=======================================================================
48
49Standard_CString StepElement_MeasureOrUnspecifiedValueMember::Name() const
50{
51 switch(mycase) {
52 case 1 : return aContextDependedMeasure;
53 case 2 : return anUnspecifiedValue;
54 default : break;
55 }
56 return "";
57}
58
59//=======================================================================
60//function : CompareNames
61//purpose :
62//=======================================================================
63
35e08fe8 64static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &/*numen*/)
7fd59977 65{
66 Standard_Integer thecase =0;
67 if (!name || name[0] == '\0') thecase = 0;
68 else if(!strcmp (name,aContextDependedMeasure)) {
69 thecase = 1;
70 }
71 else if(!strcmp (name,anUnspecifiedValue)) {
72 thecase = 2;
73 }
74 return thecase;
75}
76
77//=======================================================================
78//function : SetName
79//purpose :
80//=======================================================================
81
82Standard_Boolean StepElement_MeasureOrUnspecifiedValueMember::SetName(const Standard_CString name)
83{
84 Standard_Integer numit =0;
85 mycase = CompareNames(name,numit);
86 if(numit) SetInteger(numit);
87 return (mycase >0);
88}
89
90//=======================================================================
91//function : Matches
92//purpose :
93//=======================================================================
94
95Standard_Boolean StepElement_MeasureOrUnspecifiedValueMember::Matches(const Standard_CString name) const
96{
97 Standard_Integer numit =0;
98 Standard_Integer thecase = CompareNames(name,numit);
99 return (mycase==thecase);
100}