0028726: Quantity_NameOfColor should be replaced by Quantity_Color in function input...
[occt.git] / src / Prs3d / Prs3d_Projector.cxx
1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15
16 #include <gp_Ax3.hxx>
17 #include <gp_Dir.hxx>
18 #include <gp_Pnt.hxx>
19 #include <gp_Trsf.hxx>
20 #include <HLRAlgo_Projector.hxx>
21 #include <Prs3d_Projector.hxx>
22 #include <Standard_Type.hxx>
23
24 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_Projector,MMgt_TShared)
25
26 Prs3d_Projector::Prs3d_Projector (const HLRAlgo_Projector& HLPr): MyProjector(HLPr)
27 {}
28
29
30
31 Prs3d_Projector::Prs3d_Projector (const Standard_Boolean Pers,
32                                 const Quantity_Length Focus,
33                                 const Quantity_Length DX,
34                                 const Quantity_Length DY,
35                                 const Quantity_Length DZ,
36                                 const Quantity_Length XAt,
37                                 const Quantity_Length YAt,
38                                 const Quantity_Length ZAt,
39                                 const Quantity_Length XUp,
40                                 const Quantity_Length YUp,
41                                 const Quantity_Length ZUp) 
42 {
43   gp_Pnt At (XAt,YAt,ZAt);
44   gp_Dir Zpers (DX,DY,DZ);
45   gp_Dir Ypers (XUp,YUp,ZUp);
46   gp_Dir Xpers = Ypers.Crossed(Zpers);
47   gp_Ax3 Axe (At, Zpers, Xpers);
48   gp_Trsf T;
49   T.SetTransformation(Axe);
50   MyProjector = HLRAlgo_Projector(T,Pers,Focus);
51 }
52
53
54 HLRAlgo_Projector Prs3d_Projector::Projector () const 
55 {
56   return MyProjector;
57 }