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>
23 DEFINE_STANDARD_HANDLE (V3d_Plane, MMgt_TShared)
25 //! Obsolete clip plane presentation class.
26 //! Ported on new core of Graphic3d_ClipPlane approach.
27 //! Please access Graphic3d_ClipPlane via ClipPlane() method
28 //! to use it for standard clipping workflow.
32 //! Handle(V3d_Plane) aPlane (0, 1, 0, -20);
33 //! Handle(V3d_View) aView;
34 //! aView->AddClipPlane (aPlane->ClipPlane());
36 //! aPlane->Display (aView);
37 //! aPlane->SetPlane (0, 1, 0, -30);
38 //! aView->RemoveClipPlane (aPlane->ClipPlane());
41 //! Use interface of this class to modify plane equation synchronously
42 //! with clipping equation.
43 class V3d_Plane : public MMgt_TShared
47 //! Creates a clipping plane from plane coefficients.
48 Standard_EXPORT V3d_Plane (const Quantity_Parameter theA = 0.0,
49 const Quantity_Parameter theB = 0.0,
50 const Quantity_Parameter theC = 1.0,
51 const Quantity_Parameter theD = 0.0);
53 //! Change plane equation.
54 Standard_EXPORT void SetPlane (const Quantity_Parameter theA,
55 const Quantity_Parameter theB,
56 const Quantity_Parameter theC,
57 const Quantity_Parameter theD);
59 //! Display the plane representation in the choosen view.
60 Standard_EXPORT virtual void Display (const Handle(V3d_View)& theView,
61 const Quantity_Color& theColor = Quantity_NOC_GRAY);
63 //! Erase the plane representation.
64 Standard_EXPORT void Erase();
66 //! Returns the parameters of the plane.
67 Standard_EXPORT void Plane (Quantity_Parameter& theA,
68 Quantity_Parameter& theB,
69 Quantity_Parameter& theC,
70 Quantity_Parameter& theD) const;
72 //! Returns TRUE when the plane representation is displayed.
73 Standard_EXPORT Standard_Boolean IsDisplayed() const;
75 //! Use this method to pass clipping plane implementation for
76 //! standard clipping workflow.
77 //! @return clipping plane implementation handle.
78 const Handle(Graphic3d_ClipPlane)& ClipPlane() const
85 //! Updates the the plane representation.
86 Standard_EXPORT void Update();
90 Handle(Graphic3d_Structure) myGraphicStructure;
94 Handle(Graphic3d_ClipPlane) myPlane; //!< clip plane implementation.
98 DEFINE_STANDARD_RTTI(V3d_Plane)