File indexing completed on 2026-09-11 09:19:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _XCAFDoc_LayerTool_HeaderFile
0017 #define _XCAFDoc_LayerTool_HeaderFile
0018
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021
0022 #include <TDataStd_GenericEmpty.hxx>
0023 #include <TDF_Label.hxx>
0024 #include <NCollection_Sequence.hxx>
0025 #include <TCollection_ExtendedString.hxx>
0026 #include <NCollection_HSequence.hxx>
0027 class XCAFDoc_ShapeTool;
0028 class TDF_Label;
0029 class Standard_GUID;
0030 class TCollection_ExtendedString;
0031 class TopoDS_Shape;
0032
0033
0034
0035
0036
0037
0038 class XCAFDoc_LayerTool : public TDataStd_GenericEmpty
0039 {
0040
0041 public:
0042 Standard_EXPORT XCAFDoc_LayerTool();
0043
0044
0045 Standard_EXPORT static occ::handle<XCAFDoc_LayerTool> Set(const TDF_Label& L);
0046
0047 Standard_EXPORT static const Standard_GUID& GetID();
0048
0049
0050 Standard_EXPORT TDF_Label BaseLabel() const;
0051
0052
0053 Standard_EXPORT const occ::handle<XCAFDoc_ShapeTool>& ShapeTool();
0054
0055
0056
0057 Standard_EXPORT bool IsLayer(const TDF_Label& lab) const;
0058
0059
0060
0061
0062 Standard_EXPORT bool GetLayer(const TDF_Label& lab, TCollection_ExtendedString& aLayer) const;
0063
0064
0065
0066
0067 Standard_EXPORT bool FindLayer(const TCollection_ExtendedString& aLayer, TDF_Label& lab) const;
0068
0069
0070
0071
0072
0073 Standard_EXPORT TDF_Label FindLayer(const TCollection_ExtendedString& aLayer,
0074 const bool theToFindWithProperty = false,
0075 const bool theToFindVisible = true) const;
0076
0077
0078
0079
0080 Standard_EXPORT TDF_Label AddLayer(const TCollection_ExtendedString& theLayer) const;
0081
0082
0083
0084
0085 Standard_EXPORT TDF_Label AddLayer(const TCollection_ExtendedString& theLayer,
0086 const bool theToFindVisible) const;
0087
0088
0089 Standard_EXPORT void RemoveLayer(const TDF_Label& lab) const;
0090
0091
0092
0093 Standard_EXPORT void GetLayerLabels(NCollection_Sequence<TDF_Label>& Labels) const;
0094
0095
0096
0097
0098
0099 Standard_EXPORT void SetLayer(const TDF_Label& L,
0100 const TDF_Label& LayerL,
0101 const bool shapeInOneLayer = false) const;
0102
0103
0104
0105
0106
0107
0108 Standard_EXPORT void SetLayer(const TDF_Label& L,
0109 const TCollection_ExtendedString& aLayer,
0110 const bool shapeInOneLayer = false) const;
0111
0112
0113 Standard_EXPORT void UnSetLayers(const TDF_Label& L) const;
0114
0115
0116
0117 Standard_EXPORT bool UnSetOneLayer(const TDF_Label& L,
0118 const TCollection_ExtendedString& aLayer) const;
0119
0120
0121
0122 Standard_EXPORT bool UnSetOneLayer(const TDF_Label& L, const TDF_Label& aLayerL) const;
0123
0124
0125
0126 Standard_EXPORT bool IsSet(const TDF_Label& L, const TCollection_ExtendedString& aLayer) const;
0127
0128
0129
0130 Standard_EXPORT bool IsSet(const TDF_Label& L, const TDF_Label& aLayerL) const;
0131
0132
0133 Standard_EXPORT bool GetLayers(
0134 const TDF_Label& L,
0135 occ::handle<NCollection_HSequence<TCollection_ExtendedString>>& aLayerS);
0136
0137
0138 Standard_EXPORT bool GetLayers(const TDF_Label& L, NCollection_Sequence<TDF_Label>& aLayerLS);
0139
0140
0141 Standard_EXPORT occ::handle<NCollection_HSequence<TCollection_ExtendedString>> GetLayers(
0142 const TDF_Label& L);
0143
0144
0145 Standard_EXPORT static void GetShapesOfLayer(const TDF_Label& theLayerL,
0146 NCollection_Sequence<TDF_Label>& theShLabels);
0147
0148
0149 Standard_EXPORT bool IsVisible(const TDF_Label& layerL) const;
0150
0151
0152
0153 Standard_EXPORT void SetVisibility(const TDF_Label& layerL, const bool isvisible = true) const;
0154
0155
0156
0157
0158
0159
0160 Standard_EXPORT bool SetLayer(const TopoDS_Shape& Sh,
0161 const TDF_Label& LayerL,
0162 const bool shapeInOneLayer = false);
0163
0164
0165
0166
0167
0168
0169 Standard_EXPORT bool SetLayer(const TopoDS_Shape& Sh,
0170 const TCollection_ExtendedString& aLayer,
0171 const bool shapeInOneLayer = false);
0172
0173
0174
0175 Standard_EXPORT bool UnSetLayers(const TopoDS_Shape& Sh);
0176
0177
0178
0179 Standard_EXPORT bool UnSetOneLayer(const TopoDS_Shape& Sh,
0180 const TCollection_ExtendedString& aLayer);
0181
0182
0183
0184 Standard_EXPORT bool UnSetOneLayer(const TopoDS_Shape& Sh, const TDF_Label& aLayerL);
0185
0186
0187
0188 Standard_EXPORT bool IsSet(const TopoDS_Shape& Sh, const TCollection_ExtendedString& aLayer);
0189
0190
0191
0192 Standard_EXPORT bool IsSet(const TopoDS_Shape& Sh, const TDF_Label& aLayerL);
0193
0194
0195 Standard_EXPORT bool GetLayers(
0196 const TopoDS_Shape& Sh,
0197 occ::handle<NCollection_HSequence<TCollection_ExtendedString>>& aLayerS);
0198
0199
0200 Standard_EXPORT bool GetLayers(const TopoDS_Shape& Sh, NCollection_Sequence<TDF_Label>& aLayerLS);
0201
0202
0203 Standard_EXPORT occ::handle<NCollection_HSequence<TCollection_ExtendedString>> GetLayers(
0204 const TopoDS_Shape& Sh);
0205
0206 Standard_EXPORT const Standard_GUID& ID() const override;
0207
0208
0209 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0210
0211 DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_LayerTool, TDataStd_GenericEmpty)
0212
0213 private:
0214 occ::handle<XCAFDoc_ShapeTool> myShapeTool;
0215 };
0216
0217 #endif