File: ShapeProcess_ShapeContext.hxx

package info (click to toggle)
opencascade 6.2-7
  • links: PTS
  • area: non-free
  • in suites: lenny
  • size: 444,652 kB
  • ctags: 256,750
  • sloc: cpp: 1,150,123; ansic: 225,762; tcl: 30,130; makefile: 12,619; sh: 7,958; xml: 3,981; lisp: 283; java: 212; csh: 203; perl: 15
file content (207 lines) | stat: -rw-r--r-- 6,853 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
// File generated by CPPExt (Transient)
//
//
//                     Copyright (C) 1991 - 2000 by  
//                      Matra Datavision SA.  All rights reserved.
//  
//                     Copyright (C) 2001 - 2004 by
//                     Open CASCADE SA.  All rights reserved.
// 
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//  
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.

#ifndef _ShapeProcess_ShapeContext_HeaderFile
#define _ShapeProcess_ShapeContext_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_ShapeProcess_ShapeContext_HeaderFile
#include <Handle_ShapeProcess_ShapeContext.hxx>
#endif

#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopTools_DataMapOfShapeShape_HeaderFile
#include <TopTools_DataMapOfShapeShape.hxx>
#endif
#ifndef _Handle_ShapeExtend_MsgRegistrator_HeaderFile
#include <Handle_ShapeExtend_MsgRegistrator.hxx>
#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
#ifndef _ShapeProcess_Context_HeaderFile
#include <ShapeProcess_Context.hxx>
#endif
#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
#ifndef _Handle_ShapeBuild_ReShape_HeaderFile
#include <Handle_ShapeBuild_ReShape.hxx>
#endif
#ifndef _Message_Gravity_HeaderFile
#include <Message_Gravity.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _GeomAbs_Shape_HeaderFile
#include <GeomAbs_Shape.hxx>
#endif
#ifndef _Handle_Message_Printer_HeaderFile
#include <Handle_Message_Printer.hxx>
#endif
class ShapeExtend_MsgRegistrator;
class TopoDS_Shape;
class TopTools_DataMapOfShapeShape;
class ShapeBuild_ReShape;
class BRepTools_Modifier;
class Message_Msg;
class Message_Printer;


//! Extends Context to handle shapes <br>
//!          Contains map of shape-shape, and messages <br>
//!          attached to shapes <br>
class ShapeProcess_ShapeContext : public ShapeProcess_Context {

public:
 // Methods PUBLIC
 // 


Standard_EXPORT ShapeProcess_ShapeContext(const Standard_CString file,const Standard_CString seq = "");

//! Initializes a tool by resource file and shape <br>
//!          to be processed <br>
Standard_EXPORT ShapeProcess_ShapeContext(const TopoDS_Shape& S,const Standard_CString file,const Standard_CString seq = "");

//! Initializes tool by a new shape and clears all results <br>
Standard_EXPORT   void Init(const TopoDS_Shape& S) ;

//! Returns shape being processed <br>
Standard_EXPORT  const TopoDS_Shape& Shape() const;

//! Returns current result <br>
Standard_EXPORT  const TopoDS_Shape& Result() const;

//! Returns map of replacements shape -> shape <br>
//!          This map is not recursive <br>
Standard_EXPORT  const TopTools_DataMapOfShapeShape& Map() const;


Standard_EXPORT  const Handle_ShapeExtend_MsgRegistrator& Messages() const;

//! Returns messages recorded during shape processing <br>
//!          It can be nullified before processing in order to <br>
//!          avoid recording messages <br>
Standard_EXPORT   Handle_ShapeExtend_MsgRegistrator& Messages() ;


Standard_EXPORT   void SetDetalisation(const TopAbs_ShapeEnum level) ;

//! Set and get value for detalisation level <br>
//!          Only shapes of types from TopoDS_COMPOUND and until <br>
//!          specified detalisation level will be recorded in maps <br>
//!          To cancel mapping, use TopAbs_SHAPE <br>
//!          To force full mapping, use TopAbs_VERTEX <br>
//!          The default level is TopAbs_FACE <br>
Standard_EXPORT   TopAbs_ShapeEnum GetDetalisation() const;

//! Sets a new result shape <br>
//!          NOTE: this method should be used very carefully <br>
//!          to keep consistency of modifications <br>
//!          It is recommended to use RecordModification() methods <br>
//!          with explicit definition of mapping from current <br>
//!          result to a new one <br>
Standard_EXPORT   void SetResult(const TopoDS_Shape& S) ;


Standard_EXPORT   void RecordModification(const TopTools_DataMapOfShapeShape& repl) ;


Standard_EXPORT   void RecordModification(const Handle(ShapeBuild_ReShape)& repl,const Handle(ShapeExtend_MsgRegistrator)& msg) ;


Standard_EXPORT   void RecordModification(const Handle(ShapeBuild_ReShape)& repl) ;

//! Records modifications and resets result accordingly <br>
//!          NOTE: modification of resulting shape should be explicitly <br>
//!          defined in the maps along with modifications of subshapes <br>
Standard_EXPORT   void RecordModification(const TopoDS_Shape& sh,const BRepTools_Modifier& repl) ;

//! Record a message for shape S <br>
//!          Shape S should be one of subshapes of original shape <br>
//!          (or whole one), but not one of intermediate shapes <br>
//!          Records only if Message() is not Null <br>
Standard_EXPORT   void AddMessage(const TopoDS_Shape& S,const Message_Msg& msg,const Message_Gravity gravity = Message_WARNING) ;

//! Get value of parameter as being of the type GeomAbs_Shape <br>
//!          Returns False if parameter is not defined or has a wrong type <br>
Standard_EXPORT   Standard_Boolean GetContinuity(const Standard_CString param,GeomAbs_Shape& val) const;

//! Get value of parameter as being of the type GeomAbs_Shape <br>
//!          If parameter is not defined or does not have expected <br>
//!          type, returns default value as specified <br>
Standard_EXPORT   GeomAbs_Shape ContinuityVal(const Standard_CString param,const GeomAbs_Shape def) const;

//! Prints statistics on Shape Processing onto the Printer. <br>
Standard_EXPORT   void PrintStatistics(const Handle(Message_Printer)& printer) const;
//Standard_EXPORT ~ShapeProcess_ShapeContext();




 // Type management
 //
 Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
 //Standard_EXPORT Standard_Boolean	       IsKind(const Handle(Standard_Type)&) const;

protected:

 // Methods PROTECTED
 // 


 // Fields PROTECTED
 //


private: 

 // Methods PRIVATE
 // 


 // Fields PRIVATE
 //
TopoDS_Shape myShape;
TopoDS_Shape myResult;
TopTools_DataMapOfShapeShape myMap;
Handle_ShapeExtend_MsgRegistrator myMsg;
TopAbs_ShapeEnum myUntil;


};





// other Inline functions and methods (like "C++: function call" methods)
//


#endif