0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / IGESDraw / IGESDraw_DrawingWithRotation.hxx
1 // Created on: 1993-01-09
2 // Created by: CKY / Contract Toubro-Larsen ( TCD )
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 _IGESDraw_DrawingWithRotation_HeaderFile
18 #define _IGESDraw_DrawingWithRotation_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <IGESDraw_HArray1OfViewKindEntity.hxx>
24 #include <TColgp_HArray1OfXY.hxx>
25 #include <TColStd_HArray1OfReal.hxx>
26 #include <IGESData_HArray1OfIGESEntity.hxx>
27 #include <IGESData_IGESEntity.hxx>
28 #include <Standard_Integer.hxx>
29 #include <Standard_Real.hxx>
30 #include <Standard_Boolean.hxx>
31 class Standard_DimensionMismatch;
32 class Standard_OutOfRange;
33 class IGESData_ViewKindEntity;
34 class gp_Pnt2d;
35 class IGESData_IGESEntity;
36 class gp_XY;
37 class gp_XYZ;
38
39
40 class IGESDraw_DrawingWithRotation;
41 DEFINE_STANDARD_HANDLE(IGESDraw_DrawingWithRotation, IGESData_IGESEntity)
42
43 //! defines IGESDrawingWithRotation, Type <404> Form <1>
44 //! in package IGESDraw
45 //!
46 //! Permits rotation, in addition to transformation and
47 //! scaling, between the view and drawing coordinate systems
48 class IGESDraw_DrawingWithRotation : public IGESData_IGESEntity
49 {
50
51 public:
52
53   
54   Standard_EXPORT IGESDraw_DrawingWithRotation();
55   
56   //! This method is used to set the fields of the class
57   //! DrawingWithRotation
58   //! - allViews             : Pointers to View entities
59   //! - allViewOrigins       : Origin coords of transformed views
60   //! - allOrientationAngles : Orientation angles of transformed views
61   //! - allAnnotations       : Pointers to Annotation entities
62   //! raises exception if Lengths of allViews, allViewOrigins and
63   //! allOrientationAngles are not same.
64   Standard_EXPORT void Init (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews, const Handle(TColgp_HArray1OfXY)& allViewOrigins, const Handle(TColStd_HArray1OfReal)& allOrientationAngles, const Handle(IGESData_HArray1OfIGESEntity)& allAnnotations);
65   
66   //! returns the number of view pointers in <me>
67   Standard_EXPORT Standard_Integer NbViews() const;
68   
69   //! returns the View entity indicated by Index
70   //! raises an exception if Index <= 0 or Index > NbViews().
71   Standard_EXPORT Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer Index) const;
72   
73   //! returns the Drawing space coordinates of the origin of the
74   //! Transformed view indicated by Index
75   //! raises an exception if Index <= 0 or Index > NbViews().
76   Standard_EXPORT gp_Pnt2d ViewOrigin (const Standard_Integer Index) const;
77   
78   //! returns the Orientation angle for the Transformed view
79   //! indicated by Index
80   //! raises an exception if Index <= 0 or Index > NbViews().
81   Standard_EXPORT Standard_Real OrientationAngle (const Standard_Integer Index) const;
82   
83   //! returns the number of Annotation entities in <me>
84   Standard_EXPORT Standard_Integer NbAnnotations() const;
85   
86   //! returns the Annotation entity in this Drawing, indicated by Index
87   //! raises an exception if Index <= 0 or Index > NbAnnotations().
88   Standard_EXPORT Handle(IGESData_IGESEntity) Annotation (const Standard_Integer Index) const;
89   
90   Standard_EXPORT gp_XY ViewToDrawing (const Standard_Integer NumView, const gp_XYZ& ViewCoords) const;
91   
92   //! Returns the Drawing Unit Value if it is specified (by a
93   //! specific property entity)
94   //! If not specified, returns False, and val as zero :
95   //! unit to consider is then the model unit in GlobalSection
96   Standard_EXPORT Standard_Boolean DrawingUnit (Standard_Real& value) const;
97   
98   //! Returns the Drawing Size if it is specified (by a
99   //! specific property entity)
100   //! If not specified, returns False, and X,Y as zero :
101   //! unit to consider is then the model unit in GlobalSection
102   Standard_EXPORT Standard_Boolean DrawingSize (Standard_Real& X, Standard_Real& Y) const;
103
104
105
106
107   DEFINE_STANDARD_RTTIEXT(IGESDraw_DrawingWithRotation,IGESData_IGESEntity)
108
109 protected:
110
111
112
113
114 private:
115
116
117   Handle(IGESDraw_HArray1OfViewKindEntity) theViews;
118   Handle(TColgp_HArray1OfXY) theViewOrigins;
119   Handle(TColStd_HArray1OfReal) theOrientationAngles;
120   Handle(IGESData_HArray1OfIGESEntity) theAnnotations;
121
122
123 };
124
125
126
127
128
129
130
131 #endif // _IGESDraw_DrawingWithRotation_HeaderFile