Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:59:44

0001 // Created on: 1997-06-10
0002 // Created by: Yves FRICAUD
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _TNaming_Localizer_HeaderFile
0018 #define _TNaming_Localizer_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <TopoDS_Shape.hxx>
0026 #include <NCollection_List.hxx>
0027 #include <TopTools_ShapeMapHasher.hxx>
0028 #include <NCollection_Map.hxx>
0029 #include <NCollection_IndexedDataMap.hxx>
0030 #include <TopAbs_ShapeEnum.hxx>
0031 #include <TNaming_Evolution.hxx>
0032 #include <TNaming_NamedShape.hxx>
0033 class TNaming_UsedShapes;
0034 class TopoDS_Shape;
0035 class TDF_Label;
0036 class TNaming_NamedShape;
0037 
0038 class TNaming_Localizer
0039 {
0040 public:
0041   DEFINE_STANDARD_ALLOC
0042 
0043   Standard_EXPORT TNaming_Localizer();
0044 
0045   Standard_EXPORT void Init(const occ::handle<TNaming_UsedShapes>& US, const int CurTrans);
0046 
0047   Standard_EXPORT const NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>& SubShapes(
0048     const TopoDS_Shape&    S,
0049     const TopAbs_ShapeEnum Type);
0050 
0051   Standard_EXPORT const NCollection_IndexedDataMap<TopoDS_Shape,
0052                                                    NCollection_List<TopoDS_Shape>,
0053                                                    TopTools_ShapeMapHasher>&
0054                         Ancestors(const TopoDS_Shape& S, const TopAbs_ShapeEnum Type);
0055 
0056   Standard_EXPORT void FindFeaturesInAncestors(
0057     const TopoDS_Shape&                                     S,
0058     const TopoDS_Shape&                                     In,
0059     NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>& AncInFeatures);
0060 
0061   Standard_EXPORT void GoBack(const TopoDS_Shape&                                S,
0062                               const TDF_Label&                                   Lab,
0063                               const TNaming_Evolution                            Evol,
0064                               NCollection_List<TopoDS_Shape>&                    OldS,
0065                               NCollection_List<occ::handle<TNaming_NamedShape>>& OldLab);
0066 
0067   Standard_EXPORT void Backward(
0068     const occ::handle<TNaming_NamedShape>&                  NS,
0069     const TopoDS_Shape&                                     S,
0070     NCollection_Map<occ::handle<TNaming_NamedShape>>&       Primitives,
0071     NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>& ValidShapes);
0072 
0073   Standard_EXPORT void FindNeighbourg(
0074     const TopoDS_Shape&                                     Cont,
0075     const TopoDS_Shape&                                     S,
0076     NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>& Neighbourg);
0077 
0078   Standard_EXPORT static bool IsNew(const TopoDS_Shape&                    S,
0079                                     const occ::handle<TNaming_NamedShape>& NS);
0080 
0081   Standard_EXPORT static void FindGenerator(const occ::handle<TNaming_NamedShape>& NS,
0082                                             const TopoDS_Shape&                    S,
0083                                             NCollection_List<TopoDS_Shape>& theListOfGenerators);
0084 
0085   //! Finds context of the shape <S>.
0086   Standard_EXPORT static void FindShapeContext(const occ::handle<TNaming_NamedShape>& NS,
0087                                                const TopoDS_Shape&                    theS,
0088                                                TopoDS_Shape&                          theSC);
0089 
0090 private:
0091   int                                                                      myCurTrans;
0092   occ::handle<TNaming_UsedShapes>                                          myUS;
0093   NCollection_List<TopoDS_Shape>                                           myShapeWithSubShapes;
0094   NCollection_List<NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>> mySubShapes;
0095   NCollection_List<TopoDS_Shape>                                           myShapeWithAncestors;
0096   NCollection_List<NCollection_IndexedDataMap<TopoDS_Shape,
0097                                               NCollection_List<TopoDS_Shape>,
0098                                               TopTools_ShapeMapHasher>>
0099     myAncestors;
0100 };
0101 
0102 #endif // _TNaming_Localizer_HeaderFile