1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
25 //-Design Declaration des variables specifiques aux plans de
28 //-Warning Un plan de clipping est defini par son equation ou
29 // par un point et sa normale
30 // Equation : A*X + B*Y + C*Z + D = 0
39 #include <Visual3d_ClipPlane.ixx>
41 #include <Graphic3d_GraphicDriver.hxx>
45 //-Global data definitions
53 Visual3d_ClipPlane::Visual3d_ClipPlane (const Standard_Real ACoefA, const Standard_Real ACoefB, const Standard_Real ACoefC, const Standard_Real ACoefD) {
56 MyCPlane.ViewId = 0; /* not used */
58 MyCPlane.CoefA = float (ACoefA);
59 MyCPlane.CoefB = float (ACoefB);
60 MyCPlane.CoefC = float (ACoefC);
61 MyCPlane.CoefD = float (ACoefD);
64 Graphic3d_GraphicDriver::Plane (MyCPlane, Standard_False);
68 void Visual3d_ClipPlane::SetPlane (const Standard_Real ACoefA, const Standard_Real ACoefB, const Standard_Real ACoefC, const Standard_Real ACoefD) {
70 MyCPlane.CoefA = float (ACoefA);
71 MyCPlane.CoefB = float (ACoefB);
72 MyCPlane.CoefC = float (ACoefC);
73 MyCPlane.CoefD = float (ACoefD);
76 Graphic3d_GraphicDriver::Plane (MyCPlane, Standard_True);
80 void Visual3d_ClipPlane::Plane (Standard_Real& ACoefA, Standard_Real& ACoefB, Standard_Real& ACoefC, Standard_Real& ACoefD) const {
82 ACoefA = Standard_Real (MyCPlane.CoefA);
83 ACoefB = Standard_Real (MyCPlane.CoefB);
84 ACoefC = Standard_Real (MyCPlane.CoefC);
85 ACoefD = Standard_Real (MyCPlane.CoefD);
89 Standard_Integer Visual3d_ClipPlane::Limit () {
92 return 4; // Obsolete method, calls instead myView->PlaneLimit()
94 // Old method, replaced by GraphicDriver::InquirePlaneLimit ()
99 Standard_Integer Visual3d_ClipPlane::Identification () const {
101 return (Standard_Integer (MyCPlane.PlaneId));