0024023: Revamp the OCCT Handle -- general
[occt.git] / src / V3d / V3d_Plane.hxx
CommitLineData
4269bd1b 1// Created by: GG
2// Copyright (c) 1991-1999 Matra Datavision
3// Copyright (c) 1999-2013 OPEN CASCADE SAS
4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
4269bd1b 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.
4269bd1b 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
4269bd1b 15
16#ifndef _V3d_Plane_H__
17#define _V3d_Plane_H__
18
19#include <Graphic3d_ClipPlane.hxx>
20#include <Graphic3d_Structure.hxx>
21#include <V3d_View.hxx>
22
c04c30b3 23class V3d_Plane;
4269bd1b 24DEFINE_STANDARD_HANDLE (V3d_Plane, MMgt_TShared)
25
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.
30//! Example of use:
31//! @code
32//!
33//! Handle(V3d_Plane) aPlane (0, 1, 0, -20);
34//! Handle(V3d_View) aView;
35//! aView->AddClipPlane (aPlane->ClipPlane());
36//!
37//! aPlane->Display (aView);
38//! aPlane->SetPlane (0, 1, 0, -30);
39//! aView->RemoveClipPlane (aPlane->ClipPlane());
40//!
41//! @endcode
42//! Use interface of this class to modify plane equation synchronously
43//! with clipping equation.
44class V3d_Plane : public MMgt_TShared
45{
46public:
47
48 //! Creates a clipping plane from plane coefficients.
49 Standard_EXPORT V3d_Plane (const Quantity_Parameter theA = 0.0,
50 const Quantity_Parameter theB = 0.0,
51 const Quantity_Parameter theC = 1.0,
52 const Quantity_Parameter theD = 0.0);
53
54 //! Change plane equation.
55 Standard_EXPORT void SetPlane (const Quantity_Parameter theA,
56 const Quantity_Parameter theB,
57 const Quantity_Parameter theC,
58 const Quantity_Parameter theD);
59
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);
63
64 //! Erase the plane representation.
65 Standard_EXPORT void Erase();
66
67 //! Returns the parameters of the plane.
68 Standard_EXPORT void Plane (Quantity_Parameter& theA,
69 Quantity_Parameter& theB,
70 Quantity_Parameter& theC,
71 Quantity_Parameter& theD) const;
72
ebc93ae7 73 //! Returns TRUE when the plane representation is displayed.
4269bd1b 74 Standard_EXPORT Standard_Boolean IsDisplayed() const;
75
76 //! Use this method to pass clipping plane implementation for
77 //! standard clipping workflow.
78 //! @return clipping plane implementation handle.
ebc93ae7 79 const Handle(Graphic3d_ClipPlane)& ClipPlane() const
4269bd1b 80 {
81 return myPlane;
82 }
83
84private:
85
86 //! Updates the the plane representation.
87 Standard_EXPORT void Update();
88
89protected:
90
91 Handle(Graphic3d_Structure) myGraphicStructure;
92
93private:
94
95 Handle(Graphic3d_ClipPlane) myPlane; //!< clip plane implementation.
96
97public:
98
ec357c5c 99 DEFINE_STANDARD_RTTI(V3d_Plane, MMgt_TShared)
4269bd1b 100};
101
102#endif