0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / IGESDraw / IGESDraw_PerspectiveView.hxx
1 // Created on: 1993-02-03
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 _IGESDraw_PerspectiveView_HeaderFile
18 #define _IGESDraw_PerspectiveView_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Standard_Integer.hxx>
24 #include <Standard_Real.hxx>
25 #include <gp_XYZ.hxx>
26 #include <gp_XY.hxx>
27 #include <IGESData_ViewKindEntity.hxx>
28 #include <Standard_Boolean.hxx>
29 class Standard_OutOfRange;
30 class gp_XYZ;
31 class gp_XY;
32 class IGESData_ViewKindEntity;
33 class gp_Vec;
34 class gp_Pnt;
35 class gp_Pnt2d;
36 class IGESData_TransfEntity;
37
38
39 class IGESDraw_PerspectiveView;
40 DEFINE_STANDARD_HANDLE(IGESDraw_PerspectiveView, IGESData_ViewKindEntity)
41
42 //! defines IGESPerspectiveView, Type <410> Form <1>
43 //! in package IGESDraw
44 //!
45 //! Supports a perspective view.
46 //! Any geometric projection is defined by a view plane
47 //! and the projectors that pass through the view plane.
48 //! Projectors can be visualized as rays of light that
49 //! form an image by passing through the viewed object
50 //! and striking the view plane.
51 //! The projectors are defined via a point called the
52 //! Centre-of-Projection or the eye-point.
53 //! A perspective view is formed by all projectors that
54 //! emanate from the Centre-of-Projection and pass
55 //! through the view plane.
56 class IGESDraw_PerspectiveView : public IGESData_ViewKindEntity
57 {
58
59 public:
60
61   
62   Standard_EXPORT IGESDraw_PerspectiveView();
63   
64   //! This method is used to set the fields of the class
65   //! PerspectiveView
66   //! - aViewNumber         : The desired view
67   //! - aScaleFactor        : Scale factor
68   //! - aViewNormalVector   : View plane normal vector (model space)
69   //! - aViewReferencePoint : View reference point     (model space)
70   //! - aCenterOfProjection : Center Of Projection     (model space)
71   //! - aViewUpVector       : View up vector           (model space)
72   //! - aViewPlaneDistance  : View plane distance      (model space)
73   //! - aTopLeft            : Top-left point of clipping window
74   //! - aBottomRight        : Bottom-right point of clipping window
75   //! - aDepthClip          : Depth clipping indicator
76   //! - aBackPlaneDistance  : Distance of back clipping plane
77   //! - aFrontPlaneDistance : Distance of front clipping plane
78   Standard_EXPORT void Init (const Standard_Integer aViewNumber, const Standard_Real aScaleFactor, const gp_XYZ& aViewNormalVector, const gp_XYZ& aViewReferencePoint, const gp_XYZ& aCenterOfProjection, const gp_XYZ& aViewUpVector, const Standard_Real aViewPlaneDistance, const gp_XY& aTopLeft, const gp_XY& aBottomRight, const Standard_Integer aDepthClip, const Standard_Real aBackPlaneDistance, const Standard_Real aFrontPlaneDistance);
79   
80   //! Returns True (for a single view)
81   Standard_EXPORT Standard_Boolean IsSingle() const Standard_OVERRIDE;
82   
83   //! Returns 1 (single view)
84   Standard_EXPORT Standard_Integer NbViews() const Standard_OVERRIDE;
85   
86   //! For a single view, returns <me> whatever <num>
87   Standard_EXPORT Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer num) const Standard_OVERRIDE;
88   
89   //! returns the view number associated with <me>
90   Standard_EXPORT Standard_Integer ViewNumber() const;
91   
92   //! returns the scale factor associated with <me>
93   Standard_EXPORT Standard_Real ScaleFactor() const;
94   
95   //! returns the View plane normal vector (model space)
96   Standard_EXPORT gp_Vec ViewNormalVector() const;
97   
98   //! returns the View reference point (model space)
99   Standard_EXPORT gp_Pnt ViewReferencePoint() const;
100   
101   //! returns the Center Of Projection (model space)
102   Standard_EXPORT gp_Pnt CenterOfProjection() const;
103   
104   //! returns the View up vector (model space)
105   Standard_EXPORT gp_Vec ViewUpVector() const;
106   
107   //! returns the View plane distance (model space)
108   Standard_EXPORT Standard_Real ViewPlaneDistance() const;
109   
110   //! returns the top left point of the clipping window
111   Standard_EXPORT gp_Pnt2d TopLeft() const;
112   
113   //! returns the bottom right point of the clipping window
114   Standard_EXPORT gp_Pnt2d BottomRight() const;
115   
116   //! returns the Depth clipping indicator
117   //! 0 = No depth clipping
118   //! 1 = Back clipping plane ON
119   //! 2 = Front clipping plane ON
120   //! 3 = Back and front clipping planes ON
121   Standard_EXPORT Standard_Integer DepthClip() const;
122   
123   //! returns the View coordinate denoting the location of
124   //! the back clipping plane
125   Standard_EXPORT Standard_Real BackPlaneDistance() const;
126   
127   //! returns the View coordinate denoting the location of
128   //! the front clipping plane
129   Standard_EXPORT Standard_Real FrontPlaneDistance() const;
130   
131   //! returns the Transformation Matrix
132   Standard_EXPORT Handle(IGESData_TransfEntity) ViewMatrix() const;
133   
134   //! returns XYX from the Model space to the View space by
135   //! applying the View Matrix
136   Standard_EXPORT gp_XYZ ModelToView (const gp_XYZ& coords) const;
137
138
139
140
141   DEFINE_STANDARD_RTTIEXT(IGESDraw_PerspectiveView,IGESData_ViewKindEntity)
142
143 protected:
144
145
146
147
148 private:
149
150
151   Standard_Integer theViewNumber;
152   Standard_Real theScaleFactor;
153   gp_XYZ theViewNormalVector;
154   gp_XYZ theViewReferencePoint;
155   gp_XYZ theCenterOfProjection;
156   gp_XYZ theViewUpVector;
157   Standard_Real theViewPlaneDistance;
158   gp_XY theTopLeft;
159   gp_XY theBottomRight;
160   Standard_Integer theDepthClip;
161   Standard_Real theBackPlaneDistance;
162   Standard_Real theFrontPlaneDistance;
163
164
165 };
166
167
168
169
170
171
172
173 #endif // _IGESDraw_PerspectiveView_HeaderFile