2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2013 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _V3d_Plane_H__
17 #define _V3d_Plane_H__
19 #include <Graphic3d_ClipPlane.hxx>
20 #include <Graphic3d_Structure.hxx>
21 #include <V3d_View.hxx>
24 DEFINE_STANDARD_HANDLE (V3d_Plane, Standard_Transient)
26 //! Obsolete clip plane presentation class.
27 //! Ported on new core of Graphic3d_ClipPlane approach.
28 //! Please access Graphic3d_ClipPlane via ClipPlane() method
29 //! to use it for standard clipping workflow.
33 //! Handle(V3d_Plane) aPlane (0, 1, 0, -20);
34 //! Handle(V3d_View) aView;
35 //! aView->AddClipPlane (aPlane->ClipPlane());
37 //! aPlane->Display (aView);
38 //! aPlane->SetPlane (0, 1, 0, -30);
39 //! aView->RemoveClipPlane (aPlane->ClipPlane());
42 //! Use interface of this class to modify plane equation synchronously
43 //! with clipping equation.
44 class V3d_Plane : public Standard_Transient
48 //! Creates a clipping plane from plane coefficients.
49 Standard_EXPORT V3d_Plane (const Standard_Real theA = 0.0,
50 const Standard_Real theB = 0.0,
51 const Standard_Real theC = 1.0,
52 const Standard_Real theD = 0.0);
54 //! Change plane equation.
55 Standard_EXPORT void SetPlane (const Standard_Real theA,
56 const Standard_Real theB,
57 const Standard_Real theC,
58 const Standard_Real theD);
60 //! Display the plane representation in the choosen view.
61 Standard_EXPORT virtual void Display (const Handle(V3d_View)& theView,
62 const Quantity_Color& theColor = Quantity_NOC_GRAY);
64 //! Erase the plane representation.
65 Standard_EXPORT void Erase();
67 //! Returns the parameters of the plane.
68 Standard_EXPORT void Plane (Standard_Real& theA,
71 Standard_Real& theD) const;
73 //! Returns TRUE when the plane representation is displayed.
74 Standard_EXPORT Standard_Boolean IsDisplayed() const;
76 //! Use this method to pass clipping plane implementation for
77 //! standard clipping workflow.
78 //! @return clipping plane implementation handle.
79 const Handle(Graphic3d_ClipPlane)& ClipPlane() const
86 //! Updates the the plane representation.
87 Standard_EXPORT void Update();
91 Handle(Graphic3d_Structure) myGraphicStructure;
95 Handle(Graphic3d_ClipPlane) myPlane; //!< clip plane implementation.
99 DEFINE_STANDARD_RTTIEXT(V3d_Plane,Standard_Transient)