Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-04 08:46:41

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_LabelSequence.hxx>
0025 #include <Standard_Integer.hxx>
0026 
0027 class TDF_Label;
0028 class Standard_GUID;
0029 
0030 class XCAFDoc_ViewTool;
0031 DEFINE_STANDARD_HANDLE(XCAFDoc_ViewTool, TDataStd_GenericEmpty)
0032 
0033 //! Provides tools to store and retrieve Views
0034 //! in and from TDocStd_Document
0035 //! Each View contains parts XCAFDoc_View attribute
0036 //! with all information about camera and view window.
0037 //! Also each view contain information of displayed shapes and GDTs
0038 //! as sets of shape and GDT labels.
0039 class XCAFDoc_ViewTool : public TDataStd_GenericEmpty
0040 {
0041 
0042 public:
0043   Standard_EXPORT XCAFDoc_ViewTool();
0044 
0045   //! Creates (if not exist) ViewTool.
0046   Standard_EXPORT static Handle(XCAFDoc_ViewTool) Set(const TDF_Label& L);
0047 
0048   Standard_EXPORT static const Standard_GUID& GetID();
0049 
0050   //! Returns the label under which Views are stored
0051   Standard_EXPORT TDF_Label BaseLabel() const;
0052 
0053   //! Returns True if label belongs to a View table and
0054   //! is a View definition
0055   Standard_EXPORT Standard_Boolean IsView(const TDF_Label& theLabel) const;
0056 
0057   //! Returns a sequence of View labels currently stored
0058   //! in the View table
0059   Standard_EXPORT void GetViewLabels(TDF_LabelSequence& theLabels) const;
0060 
0061   //! Sets a link with GUID
0062   Standard_EXPORT void SetView(const TDF_LabelSequence& theShapes,
0063                                const TDF_LabelSequence& theGDTs,
0064                                const TDF_LabelSequence& theClippingPlanes,
0065                                const TDF_LabelSequence& theNotes,
0066                                const TDF_LabelSequence& theAnnotations,
0067                                const TDF_Label&         theViewL) const;
0068 
0069   //! Sets a link with GUID
0070   Standard_EXPORT void SetView(const TDF_LabelSequence& theShapes,
0071                                const TDF_LabelSequence& theGDTs,
0072                                const TDF_LabelSequence& theClippingPlanes,
0073                                const TDF_Label&         theViewL) const;
0074 
0075   //! Sets a link with GUID
0076   Standard_EXPORT void SetView(const TDF_LabelSequence& theShapes,
0077                                const TDF_LabelSequence& theGDTs,
0078                                const TDF_Label&         theViewL) const;
0079 
0080   //! Set Clipping planes to  given View
0081   Standard_EXPORT void SetClippingPlanes(const TDF_LabelSequence& theClippingPlaneLabels,
0082                                          const TDF_Label&         theViewL) const;
0083 
0084   //! Remove View
0085   Standard_EXPORT void RemoveView(const TDF_Label& theViewL);
0086 
0087   //! Returns all View labels defined for label ShapeL
0088   Standard_EXPORT Standard_Boolean GetViewLabelsForShape(const TDF_Label&   theShapeL,
0089                                                          TDF_LabelSequence& theViews) const;
0090 
0091   //! Returns all View labels defined for label GDTL
0092   Standard_EXPORT Standard_Boolean GetViewLabelsForGDT(const TDF_Label&   theGDTL,
0093                                                        TDF_LabelSequence& theViews) const;
0094 
0095   //! Returns all View labels defined for label ClippingPlaneL
0096   Standard_EXPORT Standard_Boolean GetViewLabelsForClippingPlane(const TDF_Label& theClippingPlaneL,
0097                                                                  TDF_LabelSequence& theViews) const;
0098 
0099   //! Returns all View labels defined for label NoteL
0100   Standard_EXPORT Standard_Boolean GetViewLabelsForNote(const TDF_Label&   theNoteL,
0101                                                         TDF_LabelSequence& theViews) const;
0102 
0103   //! Returns all View labels defined for label AnnotationL
0104   Standard_EXPORT Standard_Boolean GetViewLabelsForAnnotation(const TDF_Label&   theAnnotationL,
0105                                                               TDF_LabelSequence& 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 Standard_Boolean GetRefShapeLabel(const TDF_Label&   theViewL,
0113                                                     TDF_LabelSequence& 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 Standard_Boolean GetRefGDTLabel(const TDF_Label&   theViewL,
0118                                                   TDF_LabelSequence& 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 Standard_Boolean
0123     GetRefClippingPlaneLabel(const TDF_Label&   theViewL,
0124                              TDF_LabelSequence& 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 Standard_Boolean GetRefNoteLabel(const TDF_Label&   theViewL,
0129                                                    TDF_LabelSequence& 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 Standard_Boolean
0134     GetRefAnnotationLabel(const TDF_Label& theViewL, TDF_LabelSequence& theAnnotationLabels) const;
0135 
0136   //! Returns true if the given View is marked as locked
0137   Standard_EXPORT Standard_Boolean IsLocked(const TDF_Label& theViewL) const;
0138 
0139   //! Mark the given View as locked
0140   Standard_EXPORT void Lock(const TDF_Label& theViewL) const;
0141 
0142   //! Unlock the given View
0143   Standard_EXPORT void Unlock(const TDF_Label& theViewL) const;
0144 
0145   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0146 
0147   DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_ViewTool, TDataStd_GenericEmpty)
0148 };
0149 #endif // _XCAFDoc_ViewTool_HeaderFile