0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / IGESGraph / IGESGraph_LineFontDefPattern.hxx
1 // Created on: 1993-01-11
2 // Created by: CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _IGESGraph_LineFontDefPattern_HeaderFile
18 #define _IGESGraph_LineFontDefPattern_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TColStd_HArray1OfReal.hxx>
24 #include <IGESData_LineFontEntity.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Boolean.hxx>
28 class TCollection_HAsciiString;
29 class Standard_OutOfRange;
30
31
32 class IGESGraph_LineFontDefPattern;
33 DEFINE_STANDARD_HANDLE(IGESGraph_LineFontDefPattern, IGESData_LineFontEntity)
34
35 //! defines IGESLineFontDefPattern, Type <304> Form <2>
36 //! in package IGESGraph
37 //!
38 //! Line Font may be defined by repetition of a basic pattern
39 //! of visible-blank(or, on-off) segments superimposed on
40 //! a line or a curve. The line or curve is then displayed
41 //! according to the basic pattern.
42 class IGESGraph_LineFontDefPattern : public IGESData_LineFontEntity
43 {
44
45 public:
46
47   
48   Standard_EXPORT IGESGraph_LineFontDefPattern();
49   
50   //! This method is used to set the fields of the class
51   //! LineFontDefPattern
52   //! - allSegLength : Containing lengths of respective segments
53   //! - aPattern     : HAsciiString indicating visible-blank segments
54   Standard_EXPORT void Init (const Handle(TColStd_HArray1OfReal)& allSegLength, const Handle(TCollection_HAsciiString)& aPattern);
55   
56   //! returns the number of segments in the visible-blank pattern
57   Standard_EXPORT Standard_Integer NbSegments() const;
58   
59   //! returns the Length of Index'th segment of the basic pattern
60   //! raises exception if Index <= 0 or Index > NbSegments
61   Standard_EXPORT Standard_Real Length (const Standard_Integer Index) const;
62   
63   //! returns the string indicating which segments of the basic
64   //! pattern are visible and which are blanked.
65   //! e.g:
66   //! theNbSegments = 5 and if Bit Pattern = 10110, which means that
67   //! segments 2, 3 and 5 are visible, whereas segments 1 and 4 are
68   //! blank. The method returns "2H16" as the HAsciiString.
69   //! Note: The bits are right justified. (16h = 10110)
70   Standard_EXPORT Handle(TCollection_HAsciiString) DisplayPattern() const;
71   
72   //! The Display Pattern is decrypted to
73   //! return True if the Index'th basic pattern is Visible,
74   //! False otherwise.
75   //! If Index > NbSegments or Index <= 0 then return value is
76   //! False.
77   Standard_EXPORT Standard_Boolean IsVisible (const Standard_Integer Index) const;
78
79
80
81
82   DEFINE_STANDARD_RTTIEXT(IGESGraph_LineFontDefPattern,IGESData_LineFontEntity)
83
84 protected:
85
86
87
88
89 private:
90
91
92   Handle(TColStd_HArray1OfReal) theSegmentLengths;
93   Handle(TCollection_HAsciiString) theDisplayPattern;
94
95
96 };
97
98
99
100
101
102
103
104 #endif // _IGESGraph_LineFontDefPattern_HeaderFile