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 <gp_GTrsf.hxx>
21 #include <IGESData_TransfEntity.hxx>
22 #include <IGESData_ViewKindEntity.hxx>
23 #include <IGESDraw_View.hxx>
24 #include <IGESGeom_Plane.hxx>
25 #include <Standard_OutOfRange.hxx>
26 #include <Standard_Type.hxx>
28 IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_View,IGESData_ViewKindEntity)
30 IGESDraw_View::IGESDraw_View () { }
33 // This class inherits from IGESData_ViewKindEntity
35 void IGESDraw_View::Init
36 (const Standard_Integer aViewNum,
37 const Standard_Real aScale,
38 const Handle(IGESGeom_Plane)& aLeftPlane,
39 const Handle(IGESGeom_Plane)& aTopPlane,
40 const Handle(IGESGeom_Plane)& aRightPlane,
41 const Handle(IGESGeom_Plane)& aBottomPlane,
42 const Handle(IGESGeom_Plane)& aBackPlane,
43 const Handle(IGESGeom_Plane)& aFrontPlane)
45 theViewNumber = aViewNum;
46 theScaleFactor = aScale;
47 theLeftPlane = aLeftPlane;
48 theTopPlane = aTopPlane;
49 theRightPlane = aRightPlane;
50 theBottomPlane = aBottomPlane;
51 theBackPlane = aBackPlane;
52 theFrontPlane = aFrontPlane;
53 InitTypeAndForm(410,0);
56 Standard_Boolean IGESDraw_View::IsSingle () const
59 // Redefined to return TRUE
62 Standard_Integer IGESDraw_View::NbViews () const
65 Handle(IGESData_ViewKindEntity) IGESDraw_View::ViewItem
66 (const Standard_Integer) const
67 { return Handle(IGESData_ViewKindEntity)::DownCast (This()); }
70 Standard_Integer IGESDraw_View::ViewNumber () const
75 Standard_Real IGESDraw_View::ScaleFactor () const
77 return theScaleFactor;
80 Standard_Boolean IGESDraw_View::HasLeftPlane () const
82 return (! theLeftPlane.IsNull());
85 Handle(IGESGeom_Plane) IGESDraw_View::LeftPlane () const
90 Standard_Boolean IGESDraw_View::HasTopPlane () const
92 return (! theTopPlane.IsNull());
95 Handle(IGESGeom_Plane) IGESDraw_View::TopPlane () const
100 Standard_Boolean IGESDraw_View::HasRightPlane () const
102 return (! theRightPlane.IsNull());
105 Handle(IGESGeom_Plane) IGESDraw_View::RightPlane () const
107 return theRightPlane;
110 Standard_Boolean IGESDraw_View::HasBottomPlane () const
112 return (! theBottomPlane.IsNull());
115 Handle(IGESGeom_Plane) IGESDraw_View::BottomPlane () const
117 return theBottomPlane;
120 Standard_Boolean IGESDraw_View::HasBackPlane () const
122 return (! theBackPlane.IsNull());
125 Handle(IGESGeom_Plane) IGESDraw_View::BackPlane () const
130 Standard_Boolean IGESDraw_View::HasFrontPlane () const
132 return (! theFrontPlane.IsNull());
135 Handle(IGESGeom_Plane) IGESDraw_View::FrontPlane () const
137 return theFrontPlane;
140 Handle(IGESData_TransfEntity) IGESDraw_View::ViewMatrix () const
145 gp_XYZ IGESDraw_View::ModelToView (const gp_XYZ& coords) const
147 gp_XYZ tempCoords = coords;
148 Location().Transforms(tempCoords);