b311480e |
1 | // Created on: 1995-03-27 |
2 | // Created by: Robert COUBLANC |
3 | // Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
973c2be1 |
8 | // This library is free software; you can redistribute it and / or modify it |
9 | // under the terms of the GNU Lesser General Public 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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
7fd59977 |
17 | #include <StdSelect.ixx> |
18 | #include <SelectMgr_Selection.hxx> |
19 | #include <Graphic3d_StructureManager.hxx> |
20 | #include <Graphic3d_Group.hxx> |
21 | #include <Select3D_SensitiveSegment.hxx> |
22 | #include <Select3D_SensitiveCurve.hxx> |
23 | #include <Select3D_SensitiveFace.hxx> |
24 | #include <Graphic3d_AspectLine3d.hxx> |
25 | #include <Graphic3d_Structure.hxx> |
7fd59977 |
26 | #include <Quantity_NameOfColor.hxx> |
27 | #include <Aspect_TypeOfLine.hxx> |
28 | #include <TColgp_HArray1OfPnt.hxx> |
29 | #include <gp_Pnt.hxx> |
30 | #include <gp_Dir.hxx> |
31 | #include <gp_Ax3.hxx> |
7fd59977 |
32 | #include <StdSelect_BRepOwner.hxx> |
7fd59977 |
33 | |
4952a30a |
34 | Handle(Select3D_Projector) StdSelect::GetProjector(const Handle(V3d_View)& aViou) |
7fd59977 |
35 | { |
36 | Standard_Real Focale=0.,Xat,Yat,Zat,XUp,YUp,ZUp,DX,DY,DZ; |
37 | Standard_Boolean Pers=Standard_False; |
38 | // NKV - 31/07/07 - Fix for perspective view |
39 | if ( aViou->Type() == V3d_PERSPECTIVE ) { |
40 | Pers = Standard_True; |
41 | Focale = aViou->Focale();} // must be replaced by the method Focale |
42 | |
43 | aViou->At(Xat,Yat,Zat); |
44 | aViou->Up(XUp,YUp,ZUp); |
45 | aViou->Proj(DX,DY,DZ); |
46 | gp_Pnt At (Xat,Yat,Zat); |
47 | gp_Dir Zpers (DX,DY,DZ); |
48 | gp_Dir Ypers (XUp,YUp,ZUp); |
49 | gp_Dir Xpers = Ypers.Crossed(Zpers); |
50 | gp_Ax3 Axe (At, Zpers, Xpers); |
51 | gp_Trsf T; |
52 | T.SetTransformation(Axe); |
4952a30a |
53 | return new Select3D_Projector(T,Pers,Focale); |
7fd59977 |
54 | |
55 | } |
56 | |
57 | //======================================================================= |
58 | //function : SetDrawerForBRepOwner |
59 | //purpose : |
60 | //======================================================================= |
61 | |
35e08fe8 |
62 | void StdSelect::SetDrawerForBRepOwner(const Handle(SelectMgr_Selection)& /*Sel*/, |
63 | const Handle(Prs3d_Drawer)& /*Drwr*/) |
7fd59977 |
64 | { |
65 | // Handle(StdSelect_BRepOwner) BROWN; |
66 | |
67 | // for(Sel->Init();Sel->More();Sel->Next()){ |
68 | // BROWN = Handle(StdSelect_BRepOwner)::DownCast(Sel->Sensitive()->OwnerId()); |
69 | // if(!BROWN.IsNull()) |
70 | // BROWN->SetDrawer(Drwr); |
71 | // } |
72 | } |