973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
7fd59977 |
14 | |
42cf5bc1 |
15 | #include <Interface_Macros.hxx> |
16 | #include <Standard_Transient.hxx> |
17 | #include <StepBasic_SizeMember.hxx> |
18 | #include <StepBasic_SizeSelect.hxx> |
19 | #include <StepData_SelectMember.hxx> |
7fd59977 |
20 | |
21 | //======================================================================= |
22 | //function : StepBasic_SizeSelect |
23 | //purpose : |
24 | //======================================================================= |
7fd59977 |
25 | StepBasic_SizeSelect::StepBasic_SizeSelect() |
26 | { |
27 | } |
28 | |
29 | |
30 | //======================================================================= |
31 | //function : CaseNum |
32 | //purpose : |
33 | //======================================================================= |
34 | |
35 | Standard_Integer StepBasic_SizeSelect::CaseNum(const Handle(Standard_Transient)& ent) const |
36 | { |
37 | if (ent.IsNull()) return 0; |
38 | if (ent->IsKind(STANDARD_TYPE(StepBasic_SizeMember))) return 1; |
39 | return 0; |
40 | } |
41 | |
42 | |
43 | //======================================================================= |
44 | //function : NewMember |
45 | //purpose : |
46 | //======================================================================= |
47 | |
48 | Handle(StepData_SelectMember) StepBasic_SizeSelect::NewMember () const |
49 | { |
50 | return new StepBasic_SizeMember; |
51 | } |
52 | |
53 | |
54 | //======================================================================= |
55 | //function : CaseMem |
56 | //purpose : |
57 | //======================================================================= |
58 | |
59 | Standard_Integer StepBasic_SizeSelect::CaseMem (const Handle(StepData_SelectMember)& ent) const |
60 | { |
61 | if (ent.IsNull()) return 0; |
62 | //skl Interface_ParamType type = ent->ParamType(); |
63 | // Void : on admet "non defini" (en principe, on ne devrait pas) |
64 | //skl if (type != Interface_ParamVoid && type != Interface_ParamReal) return 0; |
65 | if (ent->Matches("POSITIVE_LENGTH_MEASURE")) return 1; |
66 | return 0; |
67 | } |
68 | |
69 | |
70 | //======================================================================= |
71 | //function : SetRealValue |
72 | //purpose : |
73 | //======================================================================= |
74 | |
75 | void StepBasic_SizeSelect::SetRealValue (const Standard_Real aRealValue) |
76 | { |
77 | SetReal(aRealValue,"POSITIVE_LENGTH_MEASURE"); |
78 | } |
79 | |
80 | |
81 | //======================================================================= |
82 | //function : RealValue |
83 | //purpose : |
84 | //======================================================================= |
85 | |
86 | Standard_Real StepBasic_SizeSelect::RealValue () const |
87 | { |
88 | return Real(); |
89 | } |
90 | |