b311480e |
1 | // Created by: NW,JPB,CAL |
2 | // Copyright (c) 1991-1999 Matra Datavision |
973c2be1 |
3 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | //-Version |
17 | |
18 | //-Design Declaration des variables specifiques aux contextes |
19 | // de reperage. |
20 | |
21 | //-Warning Un contexte de reperage est defini par : |
22 | // - l'ouverture de la fenetre |
23 | // - la profondeur demandee |
24 | // - l'ordre de parcours des structures |
25 | |
26 | //-References |
27 | |
28 | //-Language C++ 2.0 |
29 | |
30 | //-Declarations |
31 | |
32 | // for the class |
33 | #include <Visual3d_ContextPick.ixx> |
34 | |
35 | //-Aliases |
36 | |
37 | //-Global data definitions |
38 | |
39 | // -- ouverture ou taille de la fenetre de reperage |
40 | // MyAperture : Standard_Real; |
41 | |
42 | // -- profondeur ou nombre de structures a reperer |
43 | // MyDepth : Standard_Integer; |
44 | |
45 | // -- ordre de parcours des structures reperees |
46 | // MyOrder : TypeOfOrder; |
47 | |
48 | //-Constructors |
49 | |
50 | //-Destructors |
51 | |
52 | //-Methods, in order |
53 | |
54 | Visual3d_ContextPick::Visual3d_ContextPick (): |
55 | MyAperture (4.0), |
56 | MyDepth (10), |
57 | MyOrder (Visual3d_TOO_TOPFIRST) { |
58 | } |
59 | |
60 | Visual3d_ContextPick::Visual3d_ContextPick (const Standard_Real Aperture, const Standard_Integer Depth, const Visual3d_TypeOfOrder Order): |
61 | MyAperture (Aperture), |
62 | MyDepth (Depth), |
63 | MyOrder (Order) { |
64 | |
65 | if (Aperture <= 0.0) |
66 | Visual3d_ContextPickDefinitionError::Raise |
67 | ("Bad value for PickAperture"); |
68 | |
69 | if (Depth <= 0) |
70 | Visual3d_ContextPickDefinitionError::Raise |
71 | ("Bad value for PickDepth"); |
72 | |
73 | } |
74 | |
75 | void Visual3d_ContextPick::SetAperture (const Standard_Real Aperture) { |
76 | |
77 | if (Aperture <= 0.0) |
78 | Visual3d_ContextPickDefinitionError::Raise |
79 | ("Bad value for PickAperture"); |
80 | |
81 | MyAperture = Aperture; |
82 | |
83 | } |
84 | |
85 | Standard_Real Visual3d_ContextPick::Aperture () const { |
86 | |
87 | return (MyAperture); |
88 | |
89 | } |
90 | |
91 | void Visual3d_ContextPick::SetDepth (const Standard_Integer Depth) { |
92 | |
93 | if (Depth <= 0) |
94 | Visual3d_ContextPickDefinitionError::Raise |
95 | ("Bad value for PickDepth"); |
96 | |
97 | MyDepth = Depth; |
98 | |
99 | } |
100 | |
101 | Standard_Integer Visual3d_ContextPick::Depth () const { |
102 | |
103 | return (MyDepth); |
104 | |
105 | } |
106 | |
107 | void Visual3d_ContextPick::SetOrder (const Visual3d_TypeOfOrder Order) { |
108 | |
109 | MyOrder = Order; |
110 | |
111 | } |
112 | |
113 | Visual3d_TypeOfOrder Visual3d_ContextPick::Order () const { |
114 | |
115 | return (MyOrder); |
116 | |
117 | } |