42cf5bc1 |
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); |
67441d0c |
62 | |
63 | Standard_Integer ViewId() const { return myView; } |
64 | |
65 | Standard_Real Angle() const { return myAngle; } |
66 | |
42cf5bc1 |
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 | |
42cf5bc1 |
75 | private: |
76 | |
42cf5bc1 |
77 | Standard_Integer myView; |
78 | gp_Trsf myTrsf; |
79 | Standard_Real myFocal; |
80 | HLRBRep_ListOfBPoint myBiPntVis; |
81 | HLRBRep_ListOfBPoint myBiPntHid; |
82 | TopoDS_Shape myPickShap; |
83 | Standard_Real myAngle; |
84 | |
42cf5bc1 |
85 | }; |
86 | |
42cf5bc1 |
87 | #endif // _DBRep_HideData_HeaderFile |