1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
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>
27 IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_SegmentedViewsVisible,IGESData_ViewKindEntity)
29 IGESDraw_SegmentedViewsVisible::IGESDraw_SegmentedViewsVisible () { }
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)
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) )
51 throw Standard_DimensionMismatch("IGESDraw_SegmentedViewsVisible : Init");
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);
64 Standard_Boolean IGESDraw_SegmentedViewsVisible::IsSingle () const
66 return Standard_False;
69 Standard_Integer IGESDraw_SegmentedViewsVisible::NbViews () const
71 return theViews->Length();
74 Standard_Integer IGESDraw_SegmentedViewsVisible::NbSegmentBlocks () const
76 return theViews->Length();
79 Handle(IGESData_ViewKindEntity) IGESDraw_SegmentedViewsVisible::ViewItem
80 (const Standard_Integer ViewIndex) const
82 return theViews->Value(ViewIndex);
85 Standard_Real IGESDraw_SegmentedViewsVisible::BreakpointParameter
86 (const Standard_Integer BreakpointIndex) const
88 return theBreakpointParameters->Value(BreakpointIndex);
91 Standard_Integer IGESDraw_SegmentedViewsVisible::DisplayFlag
92 (const Standard_Integer FlagIndex) const
94 return theDisplayFlags->Value(FlagIndex);
97 Standard_Boolean IGESDraw_SegmentedViewsVisible::IsColorDefinition
98 (const Standard_Integer ColorIndex) const
100 return ( !theColorDefinitions->Value(ColorIndex).IsNull() );
103 Standard_Integer IGESDraw_SegmentedViewsVisible::ColorValue
104 (const Standard_Integer ColorIndex) const
106 return theColorValues->Value(ColorIndex);
109 Handle(IGESGraph_Color) IGESDraw_SegmentedViewsVisible::ColorDefinition
110 (const Standard_Integer ColorIndex) const
112 return theColorDefinitions->Value(ColorIndex);
115 Standard_Boolean IGESDraw_SegmentedViewsVisible::IsFontDefinition
116 (const Standard_Integer FontIndex) const
118 return ( !theLineFontDefinitions->Value(FontIndex).IsNull() );
121 Standard_Integer IGESDraw_SegmentedViewsVisible::LineFontValue
122 (const Standard_Integer FontIndex) const
124 return theLineFontValues->Value(FontIndex);
127 Handle(IGESData_LineFontEntity)
128 IGESDraw_SegmentedViewsVisible::LineFontDefinition
129 (const Standard_Integer FontIndex) const
131 return theLineFontDefinitions->Value(FontIndex);
134 Standard_Integer IGESDraw_SegmentedViewsVisible::LineWeightItem
135 (const Standard_Integer WeightIndex) const
137 return theLineWeights->Value(WeightIndex);