42cf5bc1 |
1 | // Created on: 2001-11-26 |
2 | // Created by: Sergey ZARITCHNY |
3 | // Copyright (c) 2001-2014 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 _QANewBRepNaming_Gluing_HeaderFile |
17 | #define _QANewBRepNaming_Gluing_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_DefineAlloc.hxx> |
21 | #include <Standard_Handle.hxx> |
22 | |
23 | #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx> |
24 | #include <TopoDS_Shape.hxx> |
25 | #include <TDF_LabelMap.hxx> |
26 | #include <QANewBRepNaming_TopNaming.hxx> |
27 | #include <TopAbs_ShapeEnum.hxx> |
28 | #include <Standard_Boolean.hxx> |
29 | #include <TopTools_DataMapOfShapeInteger.hxx> |
30 | class Standard_NullObject; |
31 | class TDF_Label; |
32 | class QANewModTopOpe_Glue; |
33 | class TopoDS_Shape; |
34 | |
35 | |
36 | //! Loads a result of Gluing operation in Data Framework |
37 | class QANewBRepNaming_Gluing : public QANewBRepNaming_TopNaming |
38 | { |
39 | public: |
40 | |
41 | DEFINE_STANDARD_ALLOC |
42 | |
43 | |
44 | Standard_EXPORT QANewBRepNaming_Gluing(); |
45 | |
46 | Standard_EXPORT QANewBRepNaming_Gluing(const TDF_Label& theResultLabel); |
47 | |
48 | Standard_EXPORT void Init (const TDF_Label& theResultLabel); |
49 | |
50 | //! Loads a Gluing in a data framework |
51 | Standard_EXPORT void Load (QANewModTopOpe_Glue& theMkGluing); |
52 | |
53 | Standard_EXPORT TDF_Label Content() const; |
54 | |
55 | Standard_EXPORT void SetContext (const TopoDS_Shape& theObject, const TopoDS_Shape& theTool); |
56 | |
57 | Standard_EXPORT void SetLog (const TDF_LabelMap& theLog); |
58 | |
59 | |
60 | |
61 | |
62 | protected: |
63 | |
64 | |
65 | |
66 | |
67 | |
68 | private: |
69 | |
70 | |
71 | //! If the shape is a compound the method |
72 | //! returns the underlying shape type. |
73 | Standard_EXPORT TopAbs_ShapeEnum ShapeType (const TopoDS_Shape& theShape) const; |
74 | |
75 | //! If the shape is a compound the method |
76 | //! returns the underlying shape. |
77 | Standard_EXPORT TopoDS_Shape GetShape (const TopoDS_Shape& theShape) const; |
78 | |
79 | //! A default implementation for naming of modified shapes of the operation |
80 | Standard_EXPORT void LoadModifiedShapes (QANewModTopOpe_Glue& theMakeShape) const; |
81 | |
82 | //! A default implementation for naming of modified shapes of the operation |
83 | Standard_EXPORT void LoadDeletedShapes (QANewModTopOpe_Glue& theMakeShape) const; |
84 | |
85 | //! Loads the content of the result. |
86 | Standard_EXPORT void LoadContent (QANewModTopOpe_Glue& theMakeShape) const; |
87 | |
88 | //! Loads the result. |
89 | Standard_EXPORT void LoadResult (QANewModTopOpe_Glue& theMakeShape) const; |
90 | |
91 | //! Returns true if the result is not the same as the object shape. |
92 | Standard_EXPORT Standard_Boolean IsResultChanged (QANewModTopOpe_Glue& theMakeShape) const; |
93 | |
94 | //! Loads the deletion of the degenerated edges. |
95 | Standard_EXPORT void LoadSectionEdges (QANewModTopOpe_Glue& theMakeShape) const; |
96 | |
97 | Standard_EXPORT void AddToTheUnique (const TopoDS_Shape& theUnique, const TopoDS_Shape& theIdentifier); |
98 | |
99 | //! Reset myShared map - shapes, which are modified by both object and tool. |
100 | Standard_EXPORT void RecomputeUnique (QANewModTopOpe_Glue& theMakeShape); |
101 | |
102 | Standard_EXPORT void LoadSourceShapes (TopTools_DataMapOfShapeInteger& theSources) const; |
103 | |
104 | //! A default implementation for naming of generated shapes of the operation |
105 | Standard_EXPORT void LoadUniqueShapes (QANewModTopOpe_Glue& theMakeShape, const TopTools_DataMapOfShapeInteger& theSources); |
106 | |
107 | |
108 | TopTools_IndexedDataMapOfShapeListOfShape myUnique; |
109 | TopoDS_Shape myContext; |
110 | TDF_LabelMap myLog; |
111 | |
112 | |
113 | }; |
114 | |
115 | |
116 | |
117 | |
118 | |
119 | |
120 | |
121 | #endif // _QANewBRepNaming_Gluing_HeaderFile |