Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-02 09:14:32

0001 // Created on: 2016-10-19
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_ViewTool_HeaderFile
0017 #define _XCAFDoc_ViewTool_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <TDataStd_GenericEmpty.hxx>
0023 #include <Standard_Boolean.hxx>
0024 #include <TDF_Label.hxx>
0025 #include <NCollection_Sequence.hxx>
0026 #include <Standard_Integer.hxx>
0027 
0028 class TDF_Label;
0029 class Standard_GUID;
0030 
0031 //! Provides tools to store and retrieve Views
0032 //! in and from TDocStd_Document
0033 //! Each View contains parts XCAFDoc_View attribute
0034 //! with all information about camera and view window.
0035 //! Also each view contain information of displayed shapes and GDTs
0036 //! as sets of shape and GDT labels.
0037 class XCAFDoc_ViewTool : public TDataStd_GenericEmpty
0038 {
0039 
0040 public:
0041   Standard_EXPORT XCAFDoc_ViewTool();
0042 
0043   //! Creates (if not exist) ViewTool.
0044   Standard_EXPORT static occ::handle<XCAFDoc_ViewTool> Set(const TDF_Label& L);
0045 
0046   Standard_EXPORT static const Standard_GUID& GetID();
0047 
0048   //! Returns the label under which Views are stored
0049   Standard_EXPORT TDF_Label BaseLabel() const;
0050 
0051   //! Returns True if label belongs to a View table and
0052   //! is a View definition
0053   Standard_EXPORT bool IsView(const TDF_Label& theLabel) const;
0054 
0055   //! Returns a sequence of View labels currently stored
0056   //! in the View table
0057   Standard_EXPORT void GetViewLabels(NCollection_Sequence<TDF_Label>& theLabels) const;
0058 
0059   //! Sets a link with GUID
0060   Standard_EXPORT void SetView(const NCollection_Sequence<TDF_Label>& theShapes,
0061                                const NCollection_Sequence<TDF_Label>& theGDTs,
0062                                const NCollection_Sequence<TDF_Label>& theClippingPlanes,
0063                                const NCollection_Sequence<TDF_Label>& theNotes,
0064                                const NCollection_Sequence<TDF_Label>& theAnnotations,
0065                                const TDF_Label&                       theViewL) const;
0066 
0067   //! Sets a link with GUID
0068   Standard_EXPORT void SetView(const NCollection_Sequence<TDF_Label>& theShapes,
0069                                const NCollection_Sequence<TDF_Label>& theGDTs,
0070                                const NCollection_Sequence<TDF_Label>& theClippingPlanes,
0071                                const TDF_Label&                       theViewL) const;
0072 
0073   //! Sets a link with GUID
0074   Standard_EXPORT void SetView(const NCollection_Sequence<TDF_Label>& theShapes,
0075                                const NCollection_Sequence<TDF_Label>& theGDTs,
0076                                const TDF_Label&                       theViewL) const;
0077 
0078   //! Set Clipping planes to given View
0079   Standard_EXPORT void SetClippingPlanes(
0080     const NCollection_Sequence<TDF_Label>& theClippingPlaneLabels,
0081     const TDF_Label&                       theViewL) const;
0082 
0083   //! Remove View
0084   Standard_EXPORT void RemoveView(const TDF_Label& theViewL);
0085 
0086   //! Returns all View labels defined for label ShapeL
0087   Standard_EXPORT bool GetViewLabelsForShape(const TDF_Label&                 theShapeL,
0088                                              NCollection_Sequence<TDF_Label>& theViews) const;
0089 
0090   //! Returns all View labels defined for label GDTL
0091   Standard_EXPORT bool GetViewLabelsForGDT(const TDF_Label&                 theGDTL,
0092                                            NCollection_Sequence<TDF_Label>& theViews) const;
0093 
0094   //! Returns all View labels defined for label ClippingPlaneL
0095   Standard_EXPORT bool GetViewLabelsForClippingPlane(
0096     const TDF_Label&                 theClippingPlaneL,
0097     NCollection_Sequence<TDF_Label>& theViews) const;
0098 
0099   //! Returns all View labels defined for label NoteL
0100   Standard_EXPORT bool GetViewLabelsForNote(const TDF_Label&                 theNoteL,
0101                                             NCollection_Sequence<TDF_Label>& theViews) const;
0102 
0103   //! Returns all View labels defined for label AnnotationL
0104   Standard_EXPORT bool GetViewLabelsForAnnotation(const TDF_Label&                 theAnnotationL,
0105                                                   NCollection_Sequence<TDF_Label>& theViews) const;
0106 
0107   //! Adds a view definition to a View table and returns its label
0108   Standard_EXPORT TDF_Label AddView();
0109 
0110   //! Returns shape labels defined for label theViewL
0111   //! Returns False if the theViewL is not in View table
0112   Standard_EXPORT bool GetRefShapeLabel(const TDF_Label&                 theViewL,
0113                                         NCollection_Sequence<TDF_Label>& theShapeLabels) const;
0114 
0115   //! Returns GDT labels defined for label theViewL
0116   //! Returns False if the theViewL is not in View table
0117   Standard_EXPORT bool GetRefGDTLabel(const TDF_Label&                 theViewL,
0118                                       NCollection_Sequence<TDF_Label>& theGDTLabels) const;
0119 
0120   //! Returns ClippingPlane labels defined for label theViewL
0121   //! Returns False if the theViewL is not in View table
0122   Standard_EXPORT bool GetRefClippingPlaneLabel(
0123     const TDF_Label&                 theViewL,
0124     NCollection_Sequence<TDF_Label>& theClippingPlaneLabels) const;
0125 
0126   //! Returns Notes labels defined for label theViewL
0127   //! Returns False if the theViewL is not in View table
0128   Standard_EXPORT bool GetRefNoteLabel(const TDF_Label&                 theViewL,
0129                                        NCollection_Sequence<TDF_Label>& theNoteLabels) const;
0130 
0131   //! Returns Annotation labels defined for label theViewL
0132   //! Returns False if the theViewL is not in View table
0133   Standard_EXPORT bool GetRefAnnotationLabel(
0134     const TDF_Label&                 theViewL,
0135     NCollection_Sequence<TDF_Label>& theAnnotationLabels) const;
0136 
0137   //! Returns true if the given View is marked as locked
0138   Standard_EXPORT bool IsLocked(const TDF_Label& theViewL) const;
0139 
0140   //! Mark the given View as locked
0141   Standard_EXPORT void Lock(const TDF_Label& theViewL) const;
0142 
0143   //! Unlock the given View
0144   Standard_EXPORT void Unlock(const TDF_Label& theViewL) const;
0145 
0146   Standard_EXPORT const Standard_GUID& ID() const override;
0147 
0148   DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_ViewTool, TDataStd_GenericEmpty)
0149 };
0150 #endif // _XCAFDoc_ViewTool_HeaderFile