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 <Standard_Type.hxx> |
16 | #include <StepRepr_RepresentationItem.hxx> |
17 | #include <StepVisual_ContextDependentOverRidingStyledItem.hxx> |
18 | #include <StepVisual_StyleContextSelect.hxx> |
19 | #include <StepVisual_StyledItem.hxx> |
20 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
21 | |
92efcf78 |
22 | IMPLEMENT_STANDARD_RTTIEXT(StepVisual_ContextDependentOverRidingStyledItem,StepVisual_OverRidingStyledItem) |
23 | |
7fd59977 |
24 | StepVisual_ContextDependentOverRidingStyledItem::StepVisual_ContextDependentOverRidingStyledItem () {} |
25 | |
26 | void StepVisual_ContextDependentOverRidingStyledItem::Init( |
27 | const Handle(TCollection_HAsciiString)& aName, |
28 | const Handle(StepVisual_HArray1OfPresentationStyleAssignment)& aStyles, |
29 | const Handle(StepRepr_RepresentationItem)& aItem, |
30 | const Handle(StepVisual_StyledItem)& aOverRiddenStyle) |
31 | { |
32 | |
33 | StepVisual_OverRidingStyledItem::Init(aName, aStyles, aItem, aOverRiddenStyle); |
34 | } |
35 | |
36 | void StepVisual_ContextDependentOverRidingStyledItem::Init( |
37 | const Handle(TCollection_HAsciiString)& aName, |
38 | const Handle(StepVisual_HArray1OfPresentationStyleAssignment)& aStyles, |
39 | const Handle(StepRepr_RepresentationItem)& aItem, |
40 | const Handle(StepVisual_StyledItem)& aOverRiddenStyle, |
41 | const Handle(StepVisual_HArray1OfStyleContextSelect)& aStyleContext) |
42 | { |
43 | // --- classe own fields --- |
44 | styleContext = aStyleContext; |
45 | // --- classe inherited fields --- |
46 | StepVisual_OverRidingStyledItem::Init(aName, aStyles, aItem, aOverRiddenStyle); |
47 | } |
48 | |
49 | |
50 | void StepVisual_ContextDependentOverRidingStyledItem::SetStyleContext(const Handle(StepVisual_HArray1OfStyleContextSelect)& aStyleContext) |
51 | { |
52 | styleContext = aStyleContext; |
53 | } |
54 | |
55 | Handle(StepVisual_HArray1OfStyleContextSelect) StepVisual_ContextDependentOverRidingStyledItem::StyleContext() const |
56 | { |
57 | return styleContext; |
58 | } |
59 | |
60 | StepVisual_StyleContextSelect StepVisual_ContextDependentOverRidingStyledItem::StyleContextValue(const Standard_Integer num) const |
61 | { |
62 | return styleContext->Value(num); |
63 | } |
64 | |
65 | Standard_Integer StepVisual_ContextDependentOverRidingStyledItem::NbStyleContext () const |
66 | { |
67 | return styleContext->Length(); |
68 | } |