Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:30

0001 // Created by: GG
0002 // Copyright (c) 1991-1999 Matra Datavision
0003 // Copyright (c) 1999-2013 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef V3d_Plane_HeaderFile
0017 #define V3d_Plane_HeaderFile
0018 
0019 #include <V3d_View.hxx>
0020 
0021 class V3d_Plane;
0022 DEFINE_STANDARD_HANDLE (V3d_Plane, Standard_Transient)
0023 
0024 //! Obsolete clip plane presentation class.
0025 //! Ported on new core of Graphic3d_ClipPlane approach.
0026 //! Please access Graphic3d_ClipPlane via ClipPlane() method
0027 //! to use it for standard clipping workflow.
0028 //! Example of use:
0029 //! @code
0030 //!
0031 //! Handle(V3d_Plane) aPlane (0, 1, 0, -20);
0032 //! Handle(V3d_View) aView;
0033 //! aView->AddClipPlane (aPlane->ClipPlane());
0034 //!
0035 //! aPlane->Display (aView);
0036 //! aPlane->SetPlane (0, 1, 0, -30);
0037 //! aView->RemoveClipPlane (aPlane->ClipPlane());
0038 //!
0039 //! @endcode
0040 //! Use interface of this class to modify plane equation synchronously
0041 //! with clipping equation.
0042 class V3d_Plane : public Standard_Transient
0043 {
0044 public:
0045 
0046   //! Creates a clipping plane from plane coefficients.
0047   Standard_EXPORT V3d_Plane (const Standard_Real theA = 0.0,
0048                              const Standard_Real theB = 0.0,
0049                              const Standard_Real theC = 1.0,
0050                              const Standard_Real theD = 0.0);
0051 
0052   //! Change plane equation.
0053   Standard_EXPORT void SetPlane (const Standard_Real theA,
0054                                  const Standard_Real theB,
0055                                  const Standard_Real theC,
0056                                  const Standard_Real theD);
0057 
0058   //! Display the plane representation in the chosen view.
0059   Standard_EXPORT virtual void Display (const Handle(V3d_View)& theView,
0060                                         const Quantity_Color& theColor = Quantity_NOC_GRAY);
0061 
0062   //! Erase the plane representation.
0063   Standard_EXPORT void Erase();
0064 
0065   //! Returns the parameters of the plane.
0066   Standard_EXPORT void Plane (Standard_Real& theA,
0067                               Standard_Real& theB,
0068                               Standard_Real& theC,
0069                               Standard_Real& theD) const;
0070 
0071   //! Returns TRUE when the plane representation is displayed.
0072   Standard_EXPORT Standard_Boolean IsDisplayed() const;
0073 
0074   //! Use this method to pass clipping plane implementation for
0075   //! standard clipping workflow.
0076   //! @return clipping plane implementation handle.
0077   const Handle(Graphic3d_ClipPlane)& ClipPlane() const
0078   {
0079     return myPlane;
0080   }
0081 
0082 private:
0083 
0084   //! Updates the plane representation.
0085   Standard_EXPORT void Update();
0086 
0087 protected:
0088 
0089   Handle(Graphic3d_Structure) myGraphicStructure;
0090 
0091 private:
0092 
0093   Handle(Graphic3d_ClipPlane) myPlane; //!< clip plane implementation.
0094 
0095 public:
0096 
0097   DEFINE_STANDARD_RTTIEXT(V3d_Plane,Standard_Transient)
0098 };
0099 
0100 #endif