OCC22357 Hidden face selection
[occt.git] / src / StdSelect / StdSelect.cxx
CommitLineData
7fd59977 1// Copyright: Matra-Datavision 1995
2// File: StdSelect.cxx
3// Created: Mon Mar 27 17:07:10 1995
4// Author: Robert COUBLANC
5// <rob>
6
7fd59977 7#include <StdSelect.ixx>
8#include <SelectMgr_Selection.hxx>
9#include <Graphic3d_StructureManager.hxx>
10#include <Graphic3d_Group.hxx>
11#include <Select3D_SensitiveSegment.hxx>
12#include <Select3D_SensitiveCurve.hxx>
13#include <Select3D_SensitiveFace.hxx>
14#include <Graphic3d_AspectLine3d.hxx>
15#include <Graphic3d_Structure.hxx>
16#include <Graphic3d_Array1OfVertex.hxx>
17#include <Quantity_NameOfColor.hxx>
18#include <Aspect_TypeOfLine.hxx>
19#include <TColgp_HArray1OfPnt.hxx>
20#include <gp_Pnt.hxx>
21#include <gp_Dir.hxx>
22#include <gp_Ax3.hxx>
23#include <V3d_PerspectiveView.hxx>
24#include <StdSelect_BRepOwner.hxx>
7fd59977 25
4952a30a 26Handle(Select3D_Projector) StdSelect::GetProjector(const Handle(V3d_View)& aViou)
7fd59977 27{
28 Standard_Real Focale=0.,Xat,Yat,Zat,XUp,YUp,ZUp,DX,DY,DZ;
29 Standard_Boolean Pers=Standard_False;
30 // NKV - 31/07/07 - Fix for perspective view
31 if ( aViou->Type() == V3d_PERSPECTIVE ) {
32 Pers = Standard_True;
33 Focale = aViou->Focale();} // must be replaced by the method Focale
34
35 aViou->At(Xat,Yat,Zat);
36 aViou->Up(XUp,YUp,ZUp);
37 aViou->Proj(DX,DY,DZ);
38 gp_Pnt At (Xat,Yat,Zat);
39 gp_Dir Zpers (DX,DY,DZ);
40 gp_Dir Ypers (XUp,YUp,ZUp);
41 gp_Dir Xpers = Ypers.Crossed(Zpers);
42 gp_Ax3 Axe (At, Zpers, Xpers);
43 gp_Trsf T;
44 T.SetTransformation(Axe);
4952a30a 45 return new Select3D_Projector(T,Pers,Focale);
7fd59977 46
47}
48
49//=======================================================================
50//function : SetDrawerForBRepOwner
51//purpose :
52//=======================================================================
53
54void StdSelect::SetDrawerForBRepOwner(const Handle(SelectMgr_Selection)& Sel,
55 const Handle(Prs3d_Drawer)& Drwr)
56{
57// Handle(StdSelect_BRepOwner) BROWN;
58
59// for(Sel->Init();Sel->More();Sel->Next()){
60// BROWN = Handle(StdSelect_BRepOwner)::DownCast(Sel->Sensitive()->OwnerId());
61// if(!BROWN.IsNull())
62// BROWN->SetDrawer(Drwr);
63// }
64}