14bbbdcb |
1 | // Created on: 2017-06-16 |
2 | // Created by: Natalia ERMOLAEVA |
3 | // Copyright (c) 2017 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 | |
0cb512c0 |
16 | #include <inspector/VInspector_Tools.hxx> |
14bbbdcb |
17 | |
18 | #include <AIS_ListIteratorOfListOfInteractive.hxx> |
19 | #include <AIS_ListOfInteractive.hxx> |
6822a3be |
20 | #if OCC_VERSION_HEX < 0x060901 |
21 | #include <AIS_LocalContext.hxx> |
22 | #endif |
14bbbdcb |
23 | #include <AIS_Selection.hxx> |
24 | #include <AIS_Shape.hxx> |
25 | #include <AIS_Trihedron.hxx> |
26 | #include <BRep_Builder.hxx> |
27 | #include <BRepTools.hxx> |
28 | #include <gp_Trsf.hxx> |
29 | #include <SelectMgr_StateOfSelection.hxx> |
30 | #include <SelectMgr_TypeOfUpdate.hxx> |
31 | #include <SelectMgr_TypeOfBVHUpdate.hxx> |
32 | #include <Standard_Version.hxx> |
33 | #include <StdSelect_BRepOwner.hxx> |
34 | |
130eb114 |
35 | #include <Standard_WarningsDisable.hxx> |
14bbbdcb |
36 | #include <QStringList> |
130eb114 |
37 | #include <Standard_WarningsRestore.hxx> |
14bbbdcb |
38 | |
39 | #include <sstream> |
40 | |
41 | // ======================================================================= |
42 | // function : GetShapeTypeInfo |
43 | // purpose : |
44 | // ======================================================================= |
45 | TCollection_AsciiString VInspector_Tools::GetShapeTypeInfo (const TopAbs_ShapeEnum& theType) |
46 | { |
47 | Standard_SStream aSStream; |
48 | TopAbs::Print (theType, aSStream); |
49 | return aSStream.str().c_str(); |
50 | } |
51 | |
52 | // ======================================================================= |
53 | // function : GetPointerInfo |
54 | // purpose : |
55 | // ======================================================================= |
56 | TCollection_AsciiString VInspector_Tools::GetPointerInfo (const Handle(Standard_Transient)& thePointer, const bool isShortInfo) |
57 | { |
58 | std::ostringstream aPtrStr; |
59 | aPtrStr << thePointer.operator->(); |
60 | if (!isShortInfo) |
61 | return aPtrStr.str().c_str(); |
62 | |
63 | TCollection_AsciiString anInfoPtr (aPtrStr.str().c_str()); |
64 | for (int aSymbolId = 1; aSymbolId < anInfoPtr.Length(); aSymbolId++) |
65 | { |
66 | if (anInfoPtr.Value(aSymbolId) != '0') |
67 | { |
68 | anInfoPtr = anInfoPtr.SubString(aSymbolId, anInfoPtr.Length()); |
69 | anInfoPtr.Prepend("0x"); |
70 | return anInfoPtr; |
71 | } |
72 | } |
73 | return aPtrStr.str().c_str(); |
74 | } |
75 | |
76 | // ======================================================================= |
77 | // function : SelectedOwners |
78 | // purpose : |
79 | // ======================================================================= |
80 | int VInspector_Tools::SelectedOwners (const Handle(AIS_InteractiveContext)& theContext, |
81 | const Handle(AIS_InteractiveObject)& theObject, |
82 | const bool theShapeInfoOnly) |
83 | { |
84 | QStringList anObjects; |
85 | if (theContext.IsNull()) |
86 | return 0; |
87 | |
88 | QList<size_t> aSelectedIds; // Remember of selected address in order to avoid duplicates |
89 | for (theContext->InitSelected(); theContext->MoreSelected(); theContext->NextSelected()) |
90 | { |
91 | Handle(SelectMgr_EntityOwner) anOwner = theContext->SelectedOwner(); |
92 | if (anOwner.IsNull()) // TODO: check why it is possible |
93 | continue; |
94 | |
95 | if (!theObject.IsNull()) |
96 | { |
97 | Handle(AIS_InteractiveObject) anOwnerPresentation = |
98 | Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable()); |
99 | if (anOwnerPresentation != theObject) |
100 | continue; |
101 | } |
102 | Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast (anOwner); |
103 | if (theShapeInfoOnly && BROwnr.IsNull()) |
104 | continue; |
105 | |
106 | Standard_Transient* anOwnerPtr = anOwner.operator->(); |
107 | if (aSelectedIds.contains ((size_t)anOwnerPtr)) |
108 | continue; |
109 | aSelectedIds.append ((size_t)anOwnerPtr); |
110 | |
111 | anObjects.append (VInspector_Tools::GetPointerInfo (anOwnerPtr, true).ToCString()); |
112 | } |
113 | return anObjects.size(); |
114 | } |
115 | |
116 | // ======================================================================= |
117 | // function : IsOwnerSelected |
118 | // purpose : |
119 | // ======================================================================= |
120 | bool VInspector_Tools::IsOwnerSelected (const Handle(AIS_InteractiveContext)& theContext, |
121 | const Handle(SelectBasics_EntityOwner)& theOwner) |
122 | { |
123 | bool anIsSelected = false; |
124 | Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (theOwner); |
125 | for (theContext->InitSelected(); theContext->MoreSelected() && !anIsSelected; theContext->NextSelected()) |
126 | anIsSelected = theContext->SelectedOwner() == anOwner; |
127 | return anIsSelected; |
128 | } |
129 | |
130 | // ======================================================================= |
131 | // function : ContextOwners |
132 | // purpose : |
133 | // ======================================================================= |
134 | NCollection_List<Handle(SelectBasics_EntityOwner)> VInspector_Tools::ContextOwners ( |
135 | const Handle(AIS_InteractiveContext)& theContext) |
136 | { |
137 | NCollection_List<Handle(SelectBasics_EntityOwner)> aResultOwners; |
138 | if (theContext.IsNull()) |
139 | return aResultOwners; |
140 | |
141 | AIS_ListOfInteractive aListOfIO; |
142 | theContext->DisplayedObjects (aListOfIO); |
143 | QList<size_t> aSelectedIds; // Remember of selected address in order to avoid duplicates |
144 | for (AIS_ListIteratorOfListOfInteractive aIt(aListOfIO); aIt.More(); aIt.Next()) |
145 | { |
146 | Handle(AIS_InteractiveObject) anIO = aIt.Value(); |
147 | if (anIO.IsNull()) |
148 | continue; |
6822a3be |
149 | #if OCC_VERSION_HEX < 0x070201 |
150 | for (anIO->Init(); anIO->More(); anIO->Next()) |
151 | { |
152 | Handle(SelectMgr_Selection) aSelection = anIO->CurrentSelection(); |
153 | if (aSelection.IsNull()) |
154 | continue; |
155 | for (aSelection->Init(); aSelection->More(); aSelection->Next()) |
156 | { |
157 | Handle(SelectMgr_SensitiveEntity) anEntity = aSelection->Sensitive(); |
158 | #else |
b5cce1ab |
159 | for (SelectMgr_SequenceOfSelection::Iterator aSelIter (anIO->Selections()); aSelIter.More(); aSelIter.Next()) |
14bbbdcb |
160 | { |
b5cce1ab |
161 | Handle(SelectMgr_Selection) aSelection = aSelIter.Value(); |
14bbbdcb |
162 | if (aSelection.IsNull()) |
163 | continue; |
b5cce1ab |
164 | for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (aSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next()) |
14bbbdcb |
165 | { |
b5cce1ab |
166 | Handle(SelectMgr_SensitiveEntity) anEntity = aSelEntIter.Value(); |
6822a3be |
167 | #endif |
14bbbdcb |
168 | if (anEntity.IsNull()) |
169 | continue; |
170 | const Handle(SelectBasics_SensitiveEntity)& aBase = anEntity->BaseSensitive(); |
171 | Handle(SelectBasics_EntityOwner) anOwner = aBase->OwnerId(); |
172 | Standard_Transient* anOwnerPtr = anOwner.operator->(); |
173 | if (aSelectedIds.contains ((size_t)anOwnerPtr)) |
174 | continue; |
175 | aSelectedIds.append ((size_t)anOwnerPtr); |
176 | aResultOwners.Append (anOwner); |
177 | } |
178 | } |
179 | } |
180 | return aResultOwners; |
181 | } |
182 | |
183 | // ======================================================================= |
184 | // function : ActiveOwners |
185 | // purpose : |
186 | // ======================================================================= |
187 | NCollection_List<Handle(SelectBasics_EntityOwner)> VInspector_Tools::ActiveOwners ( |
188 | const Handle(AIS_InteractiveContext)& theContext, |
189 | NCollection_List<Handle(SelectBasics_EntityOwner)>& theEmptySelectableOwners) |
190 | { |
191 | NCollection_List<Handle(SelectBasics_EntityOwner)> aResultOwners; |
192 | |
193 | // only local context is processed: TODO for global context |
194 | Handle(AIS_InteractiveContext) aContext = theContext; |
195 | if (aContext.IsNull()) |
196 | return aResultOwners; |
197 | NCollection_List<Handle(SelectBasics_EntityOwner)> anActiveOwners; |
198 | // OCCT BUG:1 - equal pointer owners are appears in the list |
199 | #if OCC_VERSION_HEX > 0x060901 |
200 | aContext->MainSelector()->ActiveOwners (anActiveOwners); |
201 | #else |
202 | anActiveOwners = aContext->MainSelector()->ActiveOwners(); |
203 | #endif |
204 | QList<size_t> aSelectedIds; // Remember of selected address in order to avoid duplicates |
205 | Handle(SelectMgr_EntityOwner) anOwner; |
206 | for (NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt (anActiveOwners); |
207 | anOwnersIt.More(); anOwnersIt.Next()) |
208 | { |
209 | anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value()); |
210 | if (anOwner.IsNull()) |
211 | continue; |
212 | |
213 | Standard_Transient* anOwnerPtr = anOwner.operator->(); |
214 | if (aSelectedIds.contains ((size_t)anOwnerPtr)) |
215 | continue; |
216 | aSelectedIds.append ((size_t)anOwnerPtr); |
217 | |
218 | aResultOwners.Append (anOwner); |
219 | Handle(SelectMgr_SelectableObject) aSelectable = anOwner->Selectable(); |
220 | if (aSelectable.IsNull() || |
221 | !theContext->IsDisplayed(Handle(AIS_InteractiveObject)::DownCast (aSelectable))) |
222 | theEmptySelectableOwners.Append (anOwner); |
223 | } |
224 | return aResultOwners; |
225 | } |
226 | |
227 | // ======================================================================= |
228 | // function : AddOrRemoveSelectedShapes |
229 | // purpose : |
230 | // ======================================================================= |
231 | void VInspector_Tools::AddOrRemoveSelectedShapes (const Handle(AIS_InteractiveContext)& theContext, |
232 | const NCollection_List<Handle(SelectBasics_EntityOwner)>& theOwners) |
233 | { |
234 | // TODO: the next two rows are to be removed later |
235 | theContext->UnhilightSelected(false); |
236 | theContext->ClearSelected(false); |
237 | |
238 | theContext->UnhilightSelected(Standard_False); |
239 | |
6822a3be |
240 | //TODO: processing in local context only |
241 | #if OCC_VERSION_HEX < 0x060901 |
242 | Handle(AIS_LocalContext) aLContext = theContext->LocalContext(); |
243 | TCollection_AsciiString aSelectionName = aLContext->SelectionName(); |
244 | aLContext->UnhilightPicked(Standard_False); |
245 | #endif |
246 | |
14bbbdcb |
247 | for (NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt(theOwners); |
248 | anOwnersIt.More(); anOwnersIt.Next()) |
249 | { |
250 | Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value()); |
6822a3be |
251 | #if OCC_VERSION_HEX > 0x060901 |
14bbbdcb |
252 | theContext->AddOrRemoveSelected (anOwner, Standard_False); |
6822a3be |
253 | #else |
254 | AIS_Selection::Selection(aSelectionName.ToCString())->Select(anOwner); |
255 | anOwner->SetSelected(Standard_True); |
256 | #endif |
14bbbdcb |
257 | } |
258 | theContext->UpdateCurrentViewer(); |
259 | } |
260 | |
261 | // ======================================================================= |
262 | // function : AddOrRemovePresentations |
263 | // purpose : |
264 | // ======================================================================= |
265 | void VInspector_Tools::AddOrRemovePresentations (const Handle(AIS_InteractiveContext)& theContext, |
266 | const NCollection_List<Handle(AIS_InteractiveObject)>& thePresentations) |
267 | { |
268 | // TODO: the next two rows are to be removed later |
269 | theContext->UnhilightSelected(false); |
270 | theContext->ClearSelected(false); |
271 | |
272 | for (NCollection_List<Handle(AIS_InteractiveObject)>::Iterator anIOIt (thePresentations); anIOIt.More(); anIOIt.Next()) |
273 | theContext->AddOrRemoveSelected (anIOIt.Value(), false); |
274 | |
275 | theContext->UpdateCurrentViewer(); |
276 | } |
277 | |
278 | // ======================================================================= |
279 | // function : GetInfo |
280 | // purpose : |
281 | // ======================================================================= |
282 | QList<QVariant> VInspector_Tools::GetInfo (Handle(AIS_InteractiveObject)& theObject) |
283 | { |
284 | QList<QVariant> anInfo; |
285 | anInfo.append (theObject->DynamicType()->Name()); |
286 | anInfo.append (VInspector_Tools::GetPointerInfo (theObject, true).ToCString()); |
287 | |
288 | Handle(AIS_Shape) aShapeIO = Handle(AIS_Shape)::DownCast (theObject); |
289 | if (aShapeIO.IsNull()) |
290 | return anInfo; |
291 | |
292 | const TopoDS_Shape& aShape = aShapeIO->Shape(); |
293 | if (!aShape.IsNull()) |
294 | anInfo.append (VInspector_Tools::GetShapeTypeInfo (aShape.ShapeType()).ToCString()); |
295 | |
296 | return anInfo; |
297 | } |
298 | |
299 | // ======================================================================= |
300 | // function : GetHighlightInfo |
301 | // purpose : |
302 | // ======================================================================= |
303 | QList<QVariant> VInspector_Tools::GetHighlightInfo (const Handle(AIS_InteractiveContext)& theContext) |
304 | { |
305 | QList<QVariant> aValues; |
306 | if (theContext.IsNull()) |
307 | return aValues; |
308 | |
309 | QStringList aSelectedNames; |
310 | QStringList aSelectedPointers; |
311 | QStringList aSelectedTypes; |
312 | QStringList aSelectedOwners; |
313 | QList<size_t> aSelectedIds; // Remember of selected address in order to avoid duplicates |
314 | for (theContext->InitDetected(); theContext->MoreDetected(); theContext->NextDetected()) |
315 | { |
316 | Handle(SelectMgr_EntityOwner) anOwner = theContext->DetectedOwner(); |
317 | if (anOwner.IsNull()) |
318 | continue; |
319 | Standard_Transient* anOwnerPtr = anOwner.operator->(); |
320 | if (aSelectedIds.contains ((size_t)anOwnerPtr)) |
321 | continue; |
322 | aSelectedIds.append ((size_t)anOwnerPtr); |
323 | Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable()); |
324 | if (anIO.IsNull()) |
325 | continue; |
326 | QList<QVariant> anIOInfo = VInspector_Tools::GetInfo (anIO); |
327 | if (anIOInfo.size() == 3) |
328 | { |
329 | aSelectedNames.append (anIOInfo[0].toString()); |
330 | aSelectedPointers.append (anIOInfo[1].toString()); |
331 | aSelectedTypes.append (anIOInfo[2].toString()); |
332 | } |
333 | aSelectedOwners.append (VInspector_Tools::GetPointerInfo (anOwnerPtr, true).ToCString()); |
334 | } |
335 | aValues.append (aSelectedNames.join (", ")); |
336 | aValues.append (aSelectedPointers.join (", ")); |
337 | aValues.append (aSelectedTypes.join (", ")); |
338 | aValues.append (aSelectedOwners.join (", ")); |
339 | |
340 | return aValues; |
341 | } |
342 | |
343 | // ======================================================================= |
344 | // function : GetSelectedInfo |
345 | // purpose : |
346 | // ======================================================================= |
347 | QList<QVariant> VInspector_Tools::GetSelectedInfo (const Handle(AIS_InteractiveContext)& theContext) |
348 | { |
349 | QList<QVariant> aValues; |
350 | if (theContext.IsNull()) |
351 | return aValues; |
352 | |
353 | QStringList aSelectedNames; |
354 | QStringList aSelectedPointers; |
355 | QStringList aSelectedTypes; |
356 | QStringList aSelectedOwners; |
357 | QList<size_t> aSelectedIds; // Remember of selected address in order to avoid duplicates |
358 | for (theContext->InitSelected(); theContext->MoreSelected(); theContext->NextSelected()) |
359 | { |
360 | Handle(SelectMgr_EntityOwner) anOwner = theContext->SelectedOwner(); |
361 | if (anOwner.IsNull()) |
362 | continue; |
363 | Standard_Transient* anOwnerPtr = anOwner.operator->(); |
364 | if (aSelectedIds.contains ((size_t)anOwnerPtr)) |
365 | continue; |
366 | aSelectedIds.append ((size_t)anOwnerPtr); |
367 | Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable()); |
368 | if (anIO.IsNull()) |
369 | continue; |
370 | |
371 | QList<QVariant> anIOInfo = VInspector_Tools::GetInfo (anIO); |
372 | if (anIOInfo.size() == 3) |
373 | { |
374 | aSelectedNames.append (anIOInfo[0].toString()); |
375 | aSelectedPointers.append (anIOInfo[1].toString()); |
376 | aSelectedTypes.append (anIOInfo[2].toString()); |
377 | } |
378 | aSelectedOwners.append (VInspector_Tools::GetPointerInfo (anOwnerPtr, true).ToCString()); |
379 | } |
380 | aValues.append (aSelectedNames.join (", ")); |
381 | aValues.append (aSelectedPointers.join (", ")); |
382 | aValues.append (aSelectedTypes.join (", ")); |
383 | aValues.append (aSelectedOwners.join (", ")); |
384 | return aValues; |
385 | } |
386 | |
387 | // ======================================================================= |
388 | // function : GetSelectedInfoPointers |
389 | // purpose : |
390 | // ======================================================================= |
391 | QString VInspector_Tools::GetSelectedInfoPointers (const Handle(AIS_InteractiveContext)& theContext) |
392 | { |
393 | QList<QVariant> aSelectedInfo = VInspector_Tools::GetSelectedInfo (theContext); |
394 | return aSelectedInfo.size() > 2 ? aSelectedInfo[1].toString() : QString(); |
395 | } |
396 | |
397 | // ======================================================================= |
398 | // function : ToName |
399 | // purpose : |
400 | // ======================================================================= |
401 | TCollection_AsciiString VInspector_Tools::ToName (const VInspector_SelectionType theType, const int theValue) |
402 | { |
403 | switch (theType) |
404 | { |
405 | case VInspector_SelectionType_TypeOfUpdate: |
406 | { |
407 | switch (theValue) |
408 | { |
409 | case SelectMgr_TOU_Full: return "Full"; |
410 | case SelectMgr_TOU_Partial: return "Partial"; |
411 | case SelectMgr_TOU_None: return "None"; |
412 | default: break; |
413 | } |
414 | } |
415 | break; |
416 | case VInspector_SelectionType_StateOfSelection: |
417 | { |
418 | switch (theValue) |
419 | { |
420 | case SelectMgr_SOS_Activated: return "Activated"; |
421 | case SelectMgr_SOS_Deactivated: return "Deactivated"; |
422 | case SelectMgr_SOS_Sleeping: return "Sleeping"; |
423 | case SelectMgr_SOS_Any: return "Any"; |
424 | case SelectMgr_SOS_Unknown: return "Unknown"; |
425 | default: break; |
426 | } |
427 | } |
428 | break; |
429 | case VInspector_SelectionType_TypeOfBVHUpdate: |
430 | { |
431 | switch (theValue) |
432 | { |
433 | case SelectMgr_TBU_Add: return "Add"; |
434 | case SelectMgr_TBU_Remove: return "Remove"; |
435 | case SelectMgr_TBU_Renew: return "Renew"; |
436 | case SelectMgr_TBU_Invalidate: return "Invalidate"; |
437 | case SelectMgr_TBU_None: return "None"; |
438 | default: break; |
439 | } |
440 | } |
441 | default: break; |
442 | } |
443 | return ""; |
444 | } |
445 | |
446 | // ======================================================================= |
447 | // function : SelectionModeToName |
448 | // purpose : |
449 | // ======================================================================= |
450 | TCollection_AsciiString VInspector_Tools::SelectionModeToName (int theMode, const Handle(AIS_InteractiveObject)& thePresentation) |
451 | { |
452 | // types are obtained by comment of SelectMgr_Selection class; |
453 | Handle(AIS_Shape) aShapePresentation = Handle(AIS_Shape)::DownCast (thePresentation); |
454 | if (!aShapePresentation.IsNull()) |
455 | return VInspector_Tools::GetShapeTypeInfo (AIS_Shape::SelectionType (theMode)).ToCString(); |
456 | else |
457 | { |
458 | Handle(AIS_Trihedron) aTrihedronPresentation = Handle(AIS_Trihedron)::DownCast (thePresentation); |
459 | if (!aTrihedronPresentation.IsNull()) |
460 | { |
461 | switch (theMode) |
462 | { |
463 | case 0: return "Trihedron"; |
464 | case 1: return "Trihedron Origin"; |
465 | case 2: return "Trihedron Axes"; |
466 | case 3: return "Trihedron Planes"; |
467 | default: break; |
468 | } |
469 | } |
470 | } |
471 | return TCollection_AsciiString (theMode); |
472 | } |
473 | |
474 | // ======================================================================= |
475 | // function : OrientationToName |
476 | // purpose : |
477 | // ======================================================================= |
478 | TCollection_AsciiString VInspector_Tools::OrientationToName (const TopAbs_Orientation& theOrientation) |
479 | { |
480 | Standard_SStream aSStream; |
481 | TopAbs::Print(theOrientation, aSStream); |
482 | return aSStream.str().c_str(); |
483 | } |
484 | |
485 | // ======================================================================= |
486 | // function : LocationToName |
487 | // purpose : |
488 | // ======================================================================= |
489 | TCollection_AsciiString VInspector_Tools::LocationToName (const TopLoc_Location& theLocation) |
490 | { |
491 | gp_Trsf aTrsf = theLocation.Transformation(); |
492 | |
493 | TCollection_AsciiString aValues; |
494 | for (int aRowId = 1; aRowId <= 3; aRowId++) |
495 | { |
496 | for (int aColId = 1; aColId <= 4; aColId++) { |
497 | aValues += TCollection_AsciiString (aTrsf.Value(aRowId, aColId)); |
498 | if (aColId != 4) |
499 | aValues += ","; |
500 | } |
501 | if (aRowId != 3) |
502 | aValues += " "; |
503 | } |
504 | return aValues; |
505 | } |
506 | |
507 | // ======================================================================= |
508 | // function : ReadShape |
509 | // purpose : |
510 | // ======================================================================= |
511 | TopoDS_Shape VInspector_Tools::ReadShape (const TCollection_AsciiString& theFileName) |
512 | { |
513 | TopoDS_Shape aShape; |
514 | |
515 | BRep_Builder aBuilder; |
516 | BRepTools::Read (aShape, theFileName.ToCString(), aBuilder); |
517 | |
518 | return aShape; |
519 | } |