Back to home page

EIC code displayed by LXR

 
 

    


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

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