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_Drawing_HeaderFile
18 #define _IGESDraw_Drawing_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22 
23 #include <IGESDraw_HArray1OfViewKindEntity.hxx>
24 #include <TColgp_HArray1OfXY.hxx>
25 #include <IGESData_HArray1OfIGESEntity.hxx>
26 #include <IGESData_IGESEntity.hxx>
27 #include <Standard_Integer.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <Standard_Real.hxx>
30 class IGESData_ViewKindEntity;
31 class gp_Pnt2d;
32 class gp_XY;
33 class gp_XYZ;
34 
35 
36 class IGESDraw_Drawing;
37 DEFINE_STANDARD_HANDLE(IGESDraw_Drawing, IGESData_IGESEntity)
38 
39 //! defines IGESDrawing, Type <404> Form <0>
40 //! in package IGESDraw
41 //!
42 //! Specifies a drawing as a collection of annotation entities
43 //! defined in drawing space, and views which together
44 //! constitute a single representation of a part
45 class IGESDraw_Drawing : public IGESData_IGESEntity
46 {
47 
48 public:
49 
50 
51   Standard_EXPORT IGESDraw_Drawing();
52 
53   //! This method is used to set the fields of the class
54   //! Drawing
55   //! - allViews       : Pointers to DEs of View entities
56   //! - allViewOrigins : Origin coordinates of transformed Views
57   //! - allAnnotations : Pointers to DEs of Annotation entities
58   //! raises exception if Lengths of allViews and allViewOrigins are
59   //! not same.
60   Standard_EXPORT void Init (const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews, const Handle(TColgp_HArray1OfXY)& allViewOrigins, const Handle(IGESData_HArray1OfIGESEntity)& allAnnotations);
61 
62   //! returns the number of view pointers in <me>
63   Standard_EXPORT Standard_Integer NbViews() const;
64 
65   //! returns the ViewKindEntity indicated by ViewIndex
66   //! raises an exception if ViewIndex <= 0 or ViewIndex > NbViews().
67   Standard_EXPORT Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer ViewIndex) const;
68 
69   //! returns the Drawing space coordinates of the origin of the
70   //! Transformed view indicated by TViewIndex
71   //! raises an exception if TViewIndex <= 0 or TViewIndex > NbViews().
72   Standard_EXPORT gp_Pnt2d ViewOrigin (const Standard_Integer TViewIndex) const;
73 
74   //! returns the number of Annotation entities in <me>
75   Standard_EXPORT Standard_Integer NbAnnotations() const;
76 
77   //! returns the Annotation entity in this Drawing, indicated by the
78   //! AnnotationIndex
79   //! raises an exception if AnnotationIndex <= 0 or
80   //! AnnotationIndex > NbAnnotations().
81   Standard_EXPORT Handle(IGESData_IGESEntity) Annotation (const Standard_Integer AnnotationIndex) const;
82 
83   Standard_EXPORT gp_XY ViewToDrawing (const Standard_Integer NumView, const gp_XYZ& ViewCoords) const;
84 
85   //! Returns the Drawing Unit Value if it is specified (by a
86   //! specific property entity)
87   //! If not specified, returns False, and val as zero :
88   //! unit to consider is then the model unit in GlobalSection
89   Standard_EXPORT Standard_Boolean DrawingUnit (Standard_Real& value) const;
90 
91   //! Returns the Drawing Size if it is specified (by a
92   //! specific property entity)
93   //! If not specified, returns False, and X,Y as zero :
94   //! unit to consider is then the model unit in GlobalSection
95   Standard_EXPORT Standard_Boolean DrawingSize (Standard_Real& X, Standard_Real& Y) const;
96 
97 
98 
99 
100   DEFINE_STANDARD_RTTIEXT(IGESDraw_Drawing,IGESData_IGESEntity)
101 
102 protected:
103 
104 
105 
106 
107 private:
108 
109 
110   Handle(IGESDraw_HArray1OfViewKindEntity) theViews;
111   Handle(TColgp_HArray1OfXY) theViewOrigins;
112   Handle(IGESData_HArray1OfIGESEntity) theAnnotations;
113 
114 
115 };
116 
117 
118 
119 
120 
121 
122 
123 #endif // _IGESDraw_Drawing_HeaderFile
124