Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:19:40

0001 // Created on: 2016-11-29
0002 // Created by: Irina KRYLOVA
0003 // Copyright (c) 2016 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 _XCAFDoc_ClippingPlaneTool_HeaderFile
0017 #define _XCAFDoc_ClippingPlaneTool_HeaderFile
0018 
0019 #include <gp_Pln.hxx>
0020 #include <TCollection_HAsciiString.hxx>
0021 #include <TDF_Label.hxx>
0022 #include <NCollection_Sequence.hxx>
0023 #include <TDataStd_GenericEmpty.hxx>
0024 
0025 //! Provide tool for management of ClippingPlane section of document.
0026 //! Provide tool to store, retrieve, remove and modify clipping planes.
0027 //! Each clipping plane consists of gp_Pln and its name.
0028 class XCAFDoc_ClippingPlaneTool : public TDataStd_GenericEmpty
0029 {
0030 
0031 public:
0032   Standard_EXPORT XCAFDoc_ClippingPlaneTool();
0033 
0034   //! Creates (if not exist) ClippingPlaneTool.
0035   Standard_EXPORT static occ::handle<XCAFDoc_ClippingPlaneTool> Set(const TDF_Label& theLabel);
0036 
0037   Standard_EXPORT static const Standard_GUID& GetID();
0038 
0039   //! returns the label under which ClippingPlanes are stored
0040   Standard_EXPORT TDF_Label BaseLabel() const;
0041 
0042   //! Returns True if label belongs to a ClippingPlane table and
0043   //! is a ClippingPlane definition
0044   Standard_EXPORT bool IsClippingPlane(const TDF_Label& theLabel) const;
0045 
0046   //! Returns ClippingPlane defined by label lab
0047   //! Returns False if the label is not in ClippingPlane table
0048   //! or does not define a ClippingPlane
0049   Standard_EXPORT bool GetClippingPlane(const TDF_Label&            theLabel,
0050                                         gp_Pln&                     thePlane,
0051                                         TCollection_ExtendedString& theName,
0052                                         bool&                       theCapping) const;
0053 
0054   //! Returns ClippingPlane defined by label lab
0055   //! Returns False if the label is not in ClippingPlane table
0056   //! or does not define a ClippingPlane
0057   Standard_EXPORT bool GetClippingPlane(const TDF_Label&                       theLabel,
0058                                         gp_Pln&                                thePlane,
0059                                         occ::handle<TCollection_HAsciiString>& theName,
0060                                         bool&                                  theCapping) const;
0061 
0062   //! Adds a clipping plane definition to a ClippingPlane table and returns
0063   //! its label (returns existing label if the same clipping plane
0064   //! is already defined)
0065   Standard_EXPORT TDF_Label AddClippingPlane(const gp_Pln&                     thePlane,
0066                                              const TCollection_ExtendedString& theName,
0067                                              const bool                        theCapping) const;
0068 
0069   //! Adds a clipping plane definition to a ClippingPlane table and returns
0070   //! its label (returns existing label if the same clipping plane
0071   //! is already defined)
0072   Standard_EXPORT TDF_Label AddClippingPlane(const gp_Pln&                                thePlane,
0073                                              const occ::handle<TCollection_HAsciiString>& theName,
0074                                              const bool theCapping) const;
0075 
0076   //! Adds a clipping plane definition to a ClippingPlane table and returns
0077   //! its label (returns existing label if the same clipping plane
0078   //! is already defined)
0079   Standard_EXPORT TDF_Label AddClippingPlane(const gp_Pln&                     thePlane,
0080                                              const TCollection_ExtendedString& theName) const;
0081 
0082   //! Adds a clipping plane definition to a ClippingPlane table and returns
0083   //! its label (returns existing label if the same clipping plane
0084   //! is already defined)
0085   Standard_EXPORT TDF_Label
0086     AddClippingPlane(const gp_Pln&                                thePlane,
0087                      const occ::handle<TCollection_HAsciiString>& theName) const;
0088 
0089   //! Removes clipping plane from the ClippingPlane table
0090   //! Return false and do nothing if clipping plane is referenced in at least one View
0091   Standard_EXPORT bool RemoveClippingPlane(const TDF_Label& theLabel) const;
0092 
0093   //! Returns a sequence of clipping planes currently stored
0094   //! in the ClippingPlane table
0095   Standard_EXPORT void GetClippingPlanes(NCollection_Sequence<TDF_Label>& Labels) const;
0096 
0097   //! Sets new value of plane and name to the given clipping plane label
0098   //! or do nothing, if the given label is not a clipping plane label
0099   Standard_EXPORT void UpdateClippingPlane(const TDF_Label&                  theLabelL,
0100                                            const gp_Pln&                     thePlane,
0101                                            const TCollection_ExtendedString& theName) const;
0102 
0103   //! Set new value of capping for given clipping plane label
0104   Standard_EXPORT void SetCapping(const TDF_Label& theClippingPlaneL, const bool theCapping);
0105 
0106   //! Get capping value for given clipping plane label
0107   //! Return capping value
0108   Standard_EXPORT bool GetCapping(const TDF_Label& theClippingPlaneL) const;
0109 
0110   //! Get capping value for given clipping plane label
0111   //! Return true if Label is valid and capping exists.
0112   Standard_EXPORT bool GetCapping(const TDF_Label& theClippingPlaneL, bool& theCapping) const;
0113 
0114   Standard_EXPORT const Standard_GUID& ID() const override;
0115 
0116   DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_ClippingPlaneTool, TDataStd_GenericEmpty)
0117 };
0118 #endif // _XCAFDoc_ClippingPlaneTool_HeaderFile