1 // File: HLRAppli_ReflectLines.cxx
2 // Created: 05.12.12 12:55:50
3 // Created by: Julia GERASIMOVA
4 // Copyright (c) 2001-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License 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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <HLRAppli_ReflectLines.hxx>
18 #include <HLRBRep_Algo.hxx>
19 #include <HLRBRep_HLRToShape.hxx>
20 #include <BRep_Builder.hxx>
22 #include <BRepLib.hxx>
25 //=======================================================================
26 //function : HLRAppli_ReflectLines
27 //purpose : Constructor
28 //=======================================================================
30 HLRAppli_ReflectLines::HLRAppli_ReflectLines(const TopoDS_Shape& aShape)
35 //=======================================================================
38 //=======================================================================
40 void HLRAppli_ReflectLines::SetAxes(const Standard_Real Nx,
41 const Standard_Real Ny,
42 const Standard_Real Nz,
43 const Standard_Real XAt,
44 const Standard_Real YAt,
45 const Standard_Real ZAt,
46 const Standard_Real XUp,
47 const Standard_Real YUp,
48 const Standard_Real ZUp)
50 Standard_Boolean IsPerspective = Standard_False;
51 Standard_Real aFocus = 1;
52 //Prs3d_Projector aPrs3dProjector(IsPerspective, aFocus, Nx, Ny, Nz, XAt, YAt, ZAt, XUp, YUp, ZUp);
54 gp_Pnt At (XAt,YAt,ZAt);
55 gp_Dir Zpers (Nx,Ny,Nz);
56 gp_Dir Ypers (XUp,YUp,ZUp);
57 gp_Dir Xpers = Ypers.Crossed(Zpers);
58 gp_Ax3 Axe (At, Zpers, Xpers);
60 T.SetTransformation(Axe);
62 //myProjector = aPrs3dProjector.Projector();
63 myProjector = HLRAlgo_Projector(T,IsPerspective,aFocus);
66 //=======================================================================
69 //=======================================================================
71 void HLRAppli_ReflectLines::Perform()
73 Handle(HLRBRep_Algo) aHLRAlgo = new HLRBRep_Algo();
74 aHLRAlgo->Add( myShape, 0 );
75 aHLRAlgo->Projector( myProjector );
78 HLRBRep_HLRToShape aHLRToShape( aHLRAlgo );
80 myCompound = aHLRToShape.OutLineVCompound3d();
82 BRepLib::SameParameter(myCompound,Precision::PConfusion(),Standard_False);
85 //=======================================================================
86 //function : GetResult
88 //=======================================================================
90 TopoDS_Shape HLRAppli_ReflectLines::GetResult() const