42cf5bc1 |
1 | // Created on: 1997-01-08 |
2 | // Created by: VAUTHIER Jean-Claude |
3 | // Copyright (c) 1997-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _DNaming_HeaderFile |
18 | #define _DNaming_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Integer.hxx> |
25 | #include <Standard_Boolean.hxx> |
26 | #include <TopAbs_ShapeEnum.hxx> |
27 | #include <TopTools_DataMapOfShapeShape.hxx> |
28 | #include <Standard_CString.hxx> |
29 | #include <TopTools_ListOfShape.hxx> |
30 | #include <Draw_Interpretor.hxx> |
31 | class TDataStd_Real; |
32 | class TFunction_Function; |
33 | class TDataStd_Integer; |
34 | class TDataStd_Name; |
35 | class TNaming_NamedShape; |
36 | class gp_Ax1; |
37 | class TDataStd_UAttribute; |
38 | class TopoDS_Shape; |
39 | class BRepBuilderAPI_MakeShape; |
40 | class TNaming_Builder; |
41 | class TDF_Label; |
42 | class BRepAlgoAPI_BooleanOperation; |
43 | class TDF_Data; |
44 | class TCollection_AsciiString; |
45 | class DNaming_BoxDriver; |
46 | class DNaming_CylinderDriver; |
47 | class DNaming_SphereDriver; |
48 | class DNaming_SelectionDriver; |
49 | class DNaming_BooleanOperationDriver; |
50 | class DNaming_FilletDriver; |
51 | class DNaming_TransformationDriver; |
52 | class DNaming_PrismDriver; |
53 | class DNaming_RevolutionDriver; |
54 | class DNaming_PointDriver; |
55 | class DNaming_Line3DDriver; |
56 | |
57 | |
58 | |
59 | class DNaming |
60 | { |
61 | public: |
62 | |
63 | DEFINE_STANDARD_ALLOC |
64 | |
65 | |
66 | Standard_EXPORT static Handle(TDataStd_Real) GetReal (const Handle(TFunction_Function)& theFunction, const Standard_Integer thePosition); |
67 | |
68 | Standard_EXPORT static Handle(TDataStd_Integer) GetInteger (const Handle(TFunction_Function)& theFunction, const Standard_Integer thePosition); |
69 | |
70 | Standard_EXPORT static Handle(TDataStd_Name) GetString (const Handle(TFunction_Function)& theFunction, const Standard_Integer thePosition); |
71 | |
72 | Standard_EXPORT static Standard_Boolean ComputeAxis (const Handle(TNaming_NamedShape)& theNS, gp_Ax1& theAx1); |
73 | |
74 | Standard_EXPORT static Handle(TNaming_NamedShape) GetFunctionResult (const Handle(TFunction_Function)& theFunction); |
75 | |
76 | Standard_EXPORT static Handle(TDataStd_UAttribute) GetObjectArg (const Handle(TFunction_Function)& theFunction, const Standard_Integer thePosition); |
77 | |
78 | Standard_EXPORT static void SetObjectArg (const Handle(TFunction_Function)& theFunction, const Standard_Integer thePosition, const Handle(TDataStd_UAttribute)& theNewValue); |
79 | |
80 | Standard_EXPORT static Handle(TNaming_NamedShape) GetObjectValue (const Handle(TDataStd_UAttribute)& theObject); |
81 | |
82 | Standard_EXPORT static Handle(TFunction_Function) GetLastFunction (const Handle(TDataStd_UAttribute)& theObject); |
83 | |
84 | Standard_EXPORT static Handle(TFunction_Function) GetFirstFunction (const Handle(TDataStd_UAttribute)& theObject); |
85 | |
86 | Standard_EXPORT static Handle(TFunction_Function) GetPrevFunction (const Handle(TFunction_Function)& theFunction); |
87 | |
88 | Standard_EXPORT static Handle(TDataStd_UAttribute) GetObjectFromFunction (const Handle(TFunction_Function)& theFunction); |
89 | |
90 | Standard_EXPORT static Standard_Boolean IsAttachment (const Handle(TDataStd_UAttribute)& theObject); |
91 | |
92 | Standard_EXPORT static Handle(TNaming_NamedShape) GetAttachmentsContext (const Handle(TDataStd_UAttribute)& theObject); |
93 | |
94 | Standard_EXPORT static Standard_Boolean ComputeSweepDir (const TopoDS_Shape& theShape, gp_Ax1& theAxis); |
95 | |
96 | Standard_EXPORT static void LoadAndOrientModifiedShapes (BRepBuilderAPI_MakeShape& MakeShape, const TopoDS_Shape& ShapeIn, const TopAbs_ShapeEnum GeneratedFrom, TNaming_Builder& Buider, const TopTools_DataMapOfShapeShape& SubShapesOfResult); |
97 | |
98 | Standard_EXPORT static void LoadAndOrientGeneratedShapes (BRepBuilderAPI_MakeShape& MakeShape, const TopoDS_Shape& ShapeIn, const TopAbs_ShapeEnum GeneratedFrom, TNaming_Builder& Buider, const TopTools_DataMapOfShapeShape& SubShapesOfResult); |
99 | |
100 | Standard_EXPORT static void LoadDeletedShapes (BRepBuilderAPI_MakeShape& MakeShape, const TopoDS_Shape& ShapeIn, const TopAbs_ShapeEnum KindOfDeletedShape, TNaming_Builder& Buider); |
101 | |
102 | Standard_EXPORT static void LoadResult (const TDF_Label& theLabel, BRepAlgoAPI_BooleanOperation& MS); |
103 | |
104 | Standard_EXPORT static TopoDS_Shape CurrentShape (const Standard_CString ShapeEntry, const Handle(TDF_Data)& Data); |
105 | |
106 | Standard_EXPORT static void GetShape (const Standard_CString ShapeEntry, const Handle(TDF_Data)& Data, TopTools_ListOfShape& Shapes); |
107 | |
9fd2d2c3 |
108 | //! theStatus = 0 Not found, |
109 | //! theStatus = 1 One shape, |
110 | //! theStatus = 2 More than one shape. |
111 | Standard_EXPORT static TCollection_AsciiString GetEntry (const TopoDS_Shape& Shape, const Handle(TDF_Data)& Data, Standard_Integer& theStatus); |
42cf5bc1 |
112 | |
113 | //! Loads the Shape to DF |
114 | Standard_EXPORT static void LoadImportedShape (const TDF_Label& theResultLabel, const TopoDS_Shape& theShape); |
115 | |
116 | //! Reloads sub-shapes of the Shape to DF |
117 | Standard_EXPORT static void LoadPrime (const TDF_Label& theResultLabel, const TopoDS_Shape& theShape); |
118 | |
119 | Standard_EXPORT static void AllCommands (Draw_Interpretor& DI); |
120 | |
121 | //! commands relatives to NamedShape |
122 | Standard_EXPORT static void BasicCommands (Draw_Interpretor& DI); |
123 | |
124 | Standard_EXPORT static void ToolsCommands (Draw_Interpretor& DI); |
125 | |
126 | //! commands relatives to Naming |
127 | Standard_EXPORT static void SelectionCommands (Draw_Interpretor& DI); |
128 | |
129 | //! commands for testing Naming |
130 | Standard_EXPORT static void ModelingCommands (Draw_Interpretor& DI); |
131 | |
132 | |
133 | |
134 | |
135 | protected: |
136 | |
137 | |
138 | |
139 | |
140 | |
141 | private: |
142 | |
143 | |
144 | |
145 | |
146 | friend class DNaming_BoxDriver; |
147 | friend class DNaming_CylinderDriver; |
148 | friend class DNaming_SphereDriver; |
149 | friend class DNaming_SelectionDriver; |
150 | friend class DNaming_BooleanOperationDriver; |
151 | friend class DNaming_FilletDriver; |
152 | friend class DNaming_TransformationDriver; |
153 | friend class DNaming_PrismDriver; |
154 | friend class DNaming_RevolutionDriver; |
155 | friend class DNaming_PointDriver; |
156 | friend class DNaming_Line3DDriver; |
157 | |
158 | }; |
159 | |
160 | |
161 | |
162 | |
163 | |
164 | |
165 | |
166 | #endif // _DNaming_HeaderFile |