7fd59977 |
1 | |
2 | // File Visual3d_ClipPlane.cxx |
3 | // Created Mars 1992 |
4 | // Author NW,JPB,CAL |
5 | |
6 | //-Copyright MatraDatavision 1991,1992 |
7 | |
8 | //-Version |
9 | |
10 | //-Design Declaration des variables specifiques aux plans de |
11 | // clipping modele |
12 | |
13 | //-Warning Un plan de clipping est defini par son equation ou |
14 | // par un point et sa normale |
15 | // Equation : A*X + B*Y + C*Z + D = 0 |
16 | |
17 | //-References |
18 | |
19 | //-Language C++ 2.0 |
20 | |
21 | //-Declarations |
22 | |
23 | // for the class |
24 | #include <Visual3d_ClipPlane.ixx> |
25 | |
26 | #include <Graphic3d_GraphicDriver.hxx> |
27 | |
28 | //-Aliases |
29 | |
30 | //-Global data definitions |
31 | |
32 | //-Constructors |
33 | |
34 | //-Destructors |
35 | |
36 | //-Methods, in order |
37 | |
38 | Visual3d_ClipPlane::Visual3d_ClipPlane (const Standard_Real ACoefA, const Standard_Real ACoefB, const Standard_Real ACoefC, const Standard_Real ACoefD) { |
39 | |
40 | MyCPlane.WsId = -1; |
41 | MyCPlane.ViewId = 0; /* not used */ |
42 | |
43 | MyCPlane.CoefA = float (ACoefA); |
44 | MyCPlane.CoefB = float (ACoefB); |
45 | MyCPlane.CoefC = float (ACoefC); |
46 | MyCPlane.CoefD = float (ACoefD); |
47 | |
48 | MyCPlane.PlaneId = |
49 | Graphic3d_GraphicDriver::Plane (MyCPlane, Standard_False); |
50 | |
51 | } |
52 | |
53 | void Visual3d_ClipPlane::SetPlane (const Standard_Real ACoefA, const Standard_Real ACoefB, const Standard_Real ACoefC, const Standard_Real ACoefD) { |
54 | |
55 | MyCPlane.CoefA = float (ACoefA); |
56 | MyCPlane.CoefB = float (ACoefB); |
57 | MyCPlane.CoefC = float (ACoefC); |
58 | MyCPlane.CoefD = float (ACoefD); |
59 | |
60 | MyCPlane.PlaneId = |
61 | Graphic3d_GraphicDriver::Plane (MyCPlane, Standard_True); |
62 | |
63 | } |
64 | |
65 | void Visual3d_ClipPlane::Plane (Standard_Real& ACoefA, Standard_Real& ACoefB, Standard_Real& ACoefC, Standard_Real& ACoefD) const { |
66 | |
67 | ACoefA = Standard_Real (MyCPlane.CoefA); |
68 | ACoefB = Standard_Real (MyCPlane.CoefB); |
69 | ACoefC = Standard_Real (MyCPlane.CoefC); |
70 | ACoefD = Standard_Real (MyCPlane.CoefD); |
71 | |
72 | } |
73 | |
74 | Standard_Integer Visual3d_ClipPlane::Limit () { |
75 | |
76 | #ifdef GER61454 |
77 | return 4; // Obsolete method, calls instead myView->PlaneLimit() |
78 | #else |
79 | // Old method, replaced by GraphicDriver::InquirePlaneLimit () |
80 | return 0; |
81 | #endif |
82 | } |
83 | |
84 | Standard_Integer Visual3d_ClipPlane::Identification () const { |
85 | |
86 | return (Standard_Integer (MyCPlane.PlaneId)); |
87 | |
88 | } |