2df785d7 |
1 | // Created on: 2016-10-19 |
2 | // Created by: Irina KRYLOVA |
3 | // Copyright (c) 2016 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _XCAFDoc_ViewTool_HeaderFile |
17 | #define _XCAFDoc_ViewTool_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_Type.hxx> |
21 | |
22 | #include <TDF_Attribute.hxx> |
23 | #include <Standard_Boolean.hxx> |
24 | #include <TDF_LabelSequence.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | |
27 | class XCAFDoc_ShapeTool; |
28 | class XCAFDoc_DimTolTool; |
29 | class TDF_Label; |
30 | class Standard_GUID; |
31 | class TDF_Attribute; |
32 | |
33 | |
34 | class XCAFDoc_ViewTool; |
35 | DEFINE_STANDARD_HANDLE(XCAFDoc_ViewTool, TDF_Attribute) |
36 | |
37 | //! Provides tools to store and retrieve Views |
38 | //! in and from TDocStd_Document |
39 | //! Each View contains parts XCAFDoc_View attribute |
40 | //! with all information about camera and view window. |
41 | //! Also each view contain information of displayed shapes and GDTs |
42 | //! as sets of shape and GDT labels. |
43 | class XCAFDoc_ViewTool : public TDF_Attribute |
44 | { |
45 | |
46 | public: |
47 | |
48 | |
49 | Standard_EXPORT XCAFDoc_ViewTool(); |
50 | |
51 | //! Creates (if not exist) ViewTool. |
52 | Standard_EXPORT static Handle(XCAFDoc_ViewTool) Set (const TDF_Label& L); |
53 | |
54 | Standard_EXPORT static const Standard_GUID& GetID(); |
55 | |
56 | //! Returns the label under which Views are stored |
57 | Standard_EXPORT TDF_Label BaseLabel() const; |
58 | |
59 | //! Returns True if label belongs to a View table and |
60 | //! is a View definition |
61 | Standard_EXPORT Standard_Boolean IsView (const TDF_Label& theLabel) const; |
62 | |
63 | //! Returns a sequence of View labels currently stored |
64 | //! in the View table |
65 | Standard_EXPORT void GetViewLabels (TDF_LabelSequence& theLabels) const; |
66 | |
67 | //! Sets a link with GUID |
0c63f2f8 |
68 | Standard_EXPORT void SetView (const TDF_LabelSequence& theShapes, |
69 | const TDF_LabelSequence& theGDTs, |
70 | const TDF_LabelSequence& theClippingPlanes, |
71 | const TDF_Label& theViewL) const; |
72 | |
73 | //! Sets a link with GUID |
74 | Standard_EXPORT void SetView(const TDF_LabelSequence& theShapes, |
75 | const TDF_LabelSequence& theGDTs, |
76 | const TDF_Label& theViewL) const; |
77 | |
78 | //! Set Clipping planes to given View |
79 | Standard_EXPORT void SetClippingPlanes(const TDF_LabelSequence& theClippingPlaneLabels, |
80 | const TDF_Label& theViewL) const; |
81 | |
82 | //! Remove View |
83 | Standard_EXPORT void RemoveView(const TDF_Label& theViewL); |
2df785d7 |
84 | |
85 | //! Returns all View labels defined for label ShapeL |
86 | Standard_EXPORT Standard_Boolean GetViewLabelsForShape (const TDF_Label& theShapeL, TDF_LabelSequence& theViews) const; |
87 | |
88 | //! Returns all View labels defined for label GDTL |
89 | Standard_EXPORT Standard_Boolean GetViewLabelsForGDT (const TDF_Label& theGDTL, TDF_LabelSequence& theViews) const; |
0c63f2f8 |
90 | |
91 | //! Returns all View labels defined for label ClippingPlaneL |
92 | Standard_EXPORT Standard_Boolean GetViewLabelsForClippingPlane(const TDF_Label& theClippingPlaneL, TDF_LabelSequence& theViews) const; |
2df785d7 |
93 | |
94 | //! Adds a view definition to a View table and returns its label |
95 | Standard_EXPORT TDF_Label AddView() ; |
96 | |
97 | //! Returns shape labels defined for label theViewL |
98 | //! Returns False if the theViewL is not in View table |
99 | Standard_EXPORT Standard_Boolean GetRefShapeLabel (const TDF_Label& theViewL, TDF_LabelSequence& theShapeLabels) const; |
100 | |
101 | //! Returns GDT labels defined for label theViewL |
102 | //! Returns False if the theViewL is not in View table |
103 | Standard_EXPORT Standard_Boolean GetRefGDTLabel (const TDF_Label& theViewL, TDF_LabelSequence& theGDTLabels) const; |
0c63f2f8 |
104 | |
105 | //! Returns ClippingPlane labels defined for label theViewL |
106 | //! Returns False if the theViewL is not in View table |
107 | Standard_EXPORT Standard_Boolean GetRefClippingPlaneLabel(const TDF_Label& theViewL, TDF_LabelSequence& theClippingPlaneLabels) const; |
108 | |
109 | //! Returns true if the given View is marked as locked |
110 | Standard_EXPORT Standard_Boolean IsLocked(const TDF_Label& theViewL) const; |
111 | |
112 | //! Mark the given View as locked |
113 | Standard_EXPORT void Lock(const TDF_Label& theViewL) const; |
114 | |
115 | //! Unlock the given View |
116 | Standard_EXPORT void Unlock(const TDF_Label& theViewL) const; |
2df785d7 |
117 | |
118 | Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; |
119 | |
120 | Standard_EXPORT void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE; |
121 | |
122 | Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; |
123 | |
124 | Standard_EXPORT void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE; |
125 | |
126 | DEFINE_STANDARD_RTTIEXT(XCAFDoc_ViewTool, TDF_Attribute) |
127 | |
128 | }; |
129 | #endif // _XCAFDoc_ViewTool_HeaderFile |