Back to home page

EIC code displayed by LXR

 
 

    


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

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