0023634: Eliminate Polyline and Polygon usage in drawers
[occt.git] / src / StdSelect / StdSelect.cxx
CommitLineData
b311480e 1// Created on: 1995-03-27
2// Created by: Robert COUBLANC
3// Copyright (c) 1995-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
7fd59977 22#include <StdSelect.ixx>
23#include <SelectMgr_Selection.hxx>
24#include <Graphic3d_StructureManager.hxx>
25#include <Graphic3d_Group.hxx>
26#include <Select3D_SensitiveSegment.hxx>
27#include <Select3D_SensitiveCurve.hxx>
28#include <Select3D_SensitiveFace.hxx>
29#include <Graphic3d_AspectLine3d.hxx>
30#include <Graphic3d_Structure.hxx>
7fd59977 31#include <Quantity_NameOfColor.hxx>
32#include <Aspect_TypeOfLine.hxx>
33#include <TColgp_HArray1OfPnt.hxx>
34#include <gp_Pnt.hxx>
35#include <gp_Dir.hxx>
36#include <gp_Ax3.hxx>
37#include <V3d_PerspectiveView.hxx>
38#include <StdSelect_BRepOwner.hxx>
7fd59977 39
4952a30a 40Handle(Select3D_Projector) StdSelect::GetProjector(const Handle(V3d_View)& aViou)
7fd59977 41{
42 Standard_Real Focale=0.,Xat,Yat,Zat,XUp,YUp,ZUp,DX,DY,DZ;
43 Standard_Boolean Pers=Standard_False;
44 // NKV - 31/07/07 - Fix for perspective view
45 if ( aViou->Type() == V3d_PERSPECTIVE ) {
46 Pers = Standard_True;
47 Focale = aViou->Focale();} // must be replaced by the method Focale
48
49 aViou->At(Xat,Yat,Zat);
50 aViou->Up(XUp,YUp,ZUp);
51 aViou->Proj(DX,DY,DZ);
52 gp_Pnt At (Xat,Yat,Zat);
53 gp_Dir Zpers (DX,DY,DZ);
54 gp_Dir Ypers (XUp,YUp,ZUp);
55 gp_Dir Xpers = Ypers.Crossed(Zpers);
56 gp_Ax3 Axe (At, Zpers, Xpers);
57 gp_Trsf T;
58 T.SetTransformation(Axe);
4952a30a 59 return new Select3D_Projector(T,Pers,Focale);
7fd59977 60
61}
62
63//=======================================================================
64//function : SetDrawerForBRepOwner
65//purpose :
66//=======================================================================
67
68void StdSelect::SetDrawerForBRepOwner(const Handle(SelectMgr_Selection)& Sel,
69 const Handle(Prs3d_Drawer)& Drwr)
70{
71// Handle(StdSelect_BRepOwner) BROWN;
72
73// for(Sel->Init();Sel->More();Sel->Next()){
74// BROWN = Handle(StdSelect_BRepOwner)::DownCast(Sel->Sensitive()->OwnerId());
75// if(!BROWN.IsNull())
76// BROWN->SetDrawer(Drwr);
77// }
78}