0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
[occt.git] / src / IGESDraw / IGESDraw_SegmentedViewsVisible.cxx
CommitLineData
b311480e 1// Created by: CKY / Contract Toubro-Larsen
2// Copyright (c) 1993-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
7fd59977 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.
7fd59977 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
16//--------------------------------------------------------------------
7fd59977 17//--------------------------------------------------------------------
18
42cf5bc1 19#include <IGESData_LineFontEntity.hxx>
20#include <IGESData_ViewKindEntity.hxx>
21#include <IGESDraw_SegmentedViewsVisible.hxx>
22#include <IGESGraph_Color.hxx>
23#include <Standard_DimensionMismatch.hxx>
24#include <Standard_OutOfRange.hxx>
25#include <Standard_Type.hxx>
7fd59977 26
92efcf78 27IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_SegmentedViewsVisible,IGESData_ViewKindEntity)
28
b311480e 29IGESDraw_SegmentedViewsVisible::IGESDraw_SegmentedViewsVisible () { }
7fd59977 30
31
32 void IGESDraw_SegmentedViewsVisible::Init
33 (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews,
34 const Handle(TColStd_HArray1OfReal)& allBreakpointParameters,
35 const Handle(TColStd_HArray1OfInteger)& allDisplayFlags,
36 const Handle(TColStd_HArray1OfInteger)& allColorValues,
37 const Handle(IGESGraph_HArray1OfColor)& allColorDefinitions,
38 const Handle(TColStd_HArray1OfInteger)& allLineFontValues,
39 const Handle(IGESBasic_HArray1OfLineFontEntity)& allLineFontDefinitions,
40 const Handle(TColStd_HArray1OfInteger)& allLineWeights)
41{
42 Standard_Integer Len = allViews->Length();
43 if ( allViews->Lower() != 1 ||
44 (allBreakpointParameters->Lower() != 1 || allBreakpointParameters->Length() != Len) ||
45 (allDisplayFlags->Lower() != 1 || allDisplayFlags->Length() != Len) ||
46 (allColorValues->Lower() != 1 || allColorValues->Length() != Len) ||
47 (allColorDefinitions->Lower() != 1 || allColorDefinitions->Length() != Len) ||
48 (allLineFontValues->Lower() != 1 || allLineFontValues->Length() != Len) ||
49 (allLineFontDefinitions->Lower() != 1 || allLineFontDefinitions->Length() != Len) ||
50 (allLineWeights->Lower() != 1 || allLineWeights->Length() != Len) )
9775fa61 51 throw Standard_DimensionMismatch("IGESDraw_SegmentedViewsVisible : Init");
7fd59977 52
53 theViews = allViews;
54 theBreakpointParameters = allBreakpointParameters;
55 theDisplayFlags = allDisplayFlags;
56 theColorValues = allColorValues;
57 theColorDefinitions = allColorDefinitions;
58 theLineFontValues = allLineFontValues;
59 theLineFontDefinitions = allLineFontDefinitions;
60 theLineWeights = allLineWeights;
61 InitTypeAndForm(402,19);
62}
63
64 Standard_Boolean IGESDraw_SegmentedViewsVisible::IsSingle () const
65{
66 return Standard_False;
67}
68
69 Standard_Integer IGESDraw_SegmentedViewsVisible::NbViews () const
70{
71 return theViews->Length();
72}
73
74 Standard_Integer IGESDraw_SegmentedViewsVisible::NbSegmentBlocks () const
75{
76 return theViews->Length();
77}
78
79 Handle(IGESData_ViewKindEntity) IGESDraw_SegmentedViewsVisible::ViewItem
80 (const Standard_Integer ViewIndex) const
81{
82 return theViews->Value(ViewIndex);
83}
84
85 Standard_Real IGESDraw_SegmentedViewsVisible::BreakpointParameter
86 (const Standard_Integer BreakpointIndex) const
87{
88 return theBreakpointParameters->Value(BreakpointIndex);
89}
90
91 Standard_Integer IGESDraw_SegmentedViewsVisible::DisplayFlag
92 (const Standard_Integer FlagIndex) const
93{
94 return theDisplayFlags->Value(FlagIndex);
95}
96
97 Standard_Boolean IGESDraw_SegmentedViewsVisible::IsColorDefinition
98 (const Standard_Integer ColorIndex) const
99{
100 return ( !theColorDefinitions->Value(ColorIndex).IsNull() );
101}
102
103 Standard_Integer IGESDraw_SegmentedViewsVisible::ColorValue
104 (const Standard_Integer ColorIndex) const
105{
106 return theColorValues->Value(ColorIndex);
107}
108
109 Handle(IGESGraph_Color) IGESDraw_SegmentedViewsVisible::ColorDefinition
110 (const Standard_Integer ColorIndex) const
111{
112 return theColorDefinitions->Value(ColorIndex);
113}
114
115 Standard_Boolean IGESDraw_SegmentedViewsVisible::IsFontDefinition
116 (const Standard_Integer FontIndex) const
117{
118 return ( !theLineFontDefinitions->Value(FontIndex).IsNull() );
119}
120
121 Standard_Integer IGESDraw_SegmentedViewsVisible::LineFontValue
122 (const Standard_Integer FontIndex) const
123{
124 return theLineFontValues->Value(FontIndex);
125}
126
127 Handle(IGESData_LineFontEntity)
128 IGESDraw_SegmentedViewsVisible::LineFontDefinition
129 (const Standard_Integer FontIndex) const
130{
131 return theLineFontDefinitions->Value(FontIndex);
132}
133
134 Standard_Integer IGESDraw_SegmentedViewsVisible::LineWeightItem
135 (const Standard_Integer WeightIndex) const
136{
137 return theLineWeights->Value(WeightIndex);
138}