0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / DNaming / DNaming.hxx
CommitLineData
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>
31class TDataStd_Real;
32class TFunction_Function;
33class TDataStd_Integer;
34class TDataStd_Name;
35class TNaming_NamedShape;
36class gp_Ax1;
37class TDataStd_UAttribute;
38class TopoDS_Shape;
39class BRepBuilderAPI_MakeShape;
40class TNaming_Builder;
41class TDF_Label;
42class BRepAlgoAPI_BooleanOperation;
43class TDF_Data;
44class TCollection_AsciiString;
45class DNaming_BoxDriver;
46class DNaming_CylinderDriver;
47class DNaming_SphereDriver;
48class DNaming_SelectionDriver;
49class DNaming_BooleanOperationDriver;
50class DNaming_FilletDriver;
51class DNaming_TransformationDriver;
52class DNaming_PrismDriver;
53class DNaming_RevolutionDriver;
54class DNaming_PointDriver;
55class DNaming_Line3DDriver;
56
57
58
59class DNaming
60{
61public:
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
135protected:
136
137
138
139
140
141private:
142
143
144
145
146friend class DNaming_BoxDriver;
147friend class DNaming_CylinderDriver;
148friend class DNaming_SphereDriver;
149friend class DNaming_SelectionDriver;
150friend class DNaming_BooleanOperationDriver;
151friend class DNaming_FilletDriver;
152friend class DNaming_TransformationDriver;
153friend class DNaming_PrismDriver;
154friend class DNaming_RevolutionDriver;
155friend class DNaming_PointDriver;
156friend class DNaming_Line3DDriver;
157
158};
159
160
161
162
163
164
165
166#endif // _DNaming_HeaderFile