263271390acf9c16c83dd1b97c7ffacbe88aea88
[occt.git] / src / DBRep / DBRep_HideData.hxx
1 // Created on: 1995-09-21
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _DBRep_HideData_HeaderFile
18 #define _DBRep_HideData_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Integer.hxx>
25 #include <gp_Trsf.hxx>
26 #include <Standard_Real.hxx>
27 #include <HLRBRep_ListOfBPoint.hxx>
28 #include <TopoDS_Shape.hxx>
29 #include <Standard_Boolean.hxx>
30 class gp_Trsf;
31 class TopoDS_Shape;
32 class Draw_Display;
33 class Draw_Color;
34
35
36 //! This  class stores all the informations concerning
37 //! hidden lines on a view.
38 //!
39 //! * View number
40 //! * Matrix of projection
41 //! * Type of projection, focal
42 //! * Arrays of 3d points
43 //!
44 //! A drawable shape contains a  list of such  objects
45 //! to store  the  hidden lines  for  each view.   The
46 //! IsSame method is  used  to check if   hidden lines
47 //! must be recompiled.
48 class DBRep_HideData 
49 {
50 public:
51
52   DEFINE_STANDARD_ALLOC
53
54   
55   Standard_EXPORT DBRep_HideData();
56   
57   //! ViewId is the view number
58   //! TProj the projection
59   //! Focal <= 0 means parallel projection
60   //! Alg : the hidden lines
61   Standard_EXPORT void Set (const Standard_Integer ViewId, const gp_Trsf& TProj, const Standard_Real Focal, const TopoDS_Shape& S, const Standard_Real ang);
62   
63     Standard_Integer ViewId() const;
64   
65     Standard_Real Angle() const;
66   
67   //! Returns True if the projection is the same
68   Standard_EXPORT Standard_Boolean IsSame (const gp_Trsf& TProj, const Standard_Real Focla) const;
69   
70   Standard_EXPORT void DrawOn (Draw_Display& D, const Standard_Boolean withRg1, const Standard_Boolean withRgN, const Standard_Boolean withHid, const Draw_Color& VisCol, const Draw_Color& HidCol);
71   
72   //! Returns the subshape touched by the last pick.
73   Standard_EXPORT const TopoDS_Shape& LastPick() const;
74
75
76
77
78 protected:
79
80
81
82
83
84 private:
85
86
87
88   Standard_Integer myView;
89   gp_Trsf myTrsf;
90   Standard_Real myFocal;
91   HLRBRep_ListOfBPoint myBiPntVis;
92   HLRBRep_ListOfBPoint myBiPntHid;
93   TopoDS_Shape myPickShap;
94   Standard_Real myAngle;
95
96
97 };
98
99
100 #include <DBRep_HideData.lxx>
101
102
103
104
105
106 #endif // _DBRep_HideData_HeaderFile