| 1 | // Created on: 1999-02-24 |
| 2 | // Created by: Christian CAILLET |
| 3 | // Copyright (c) 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 _XSControl_ConnectedShapes_HeaderFile |
| 18 | #define _XSControl_ConnectedShapes_HeaderFile |
| 19 | |
| 20 | #include <Standard.hxx> |
| 21 | #include <Standard_Type.hxx> |
| 22 | |
| 23 | #include <IFSelect_SelectExplore.hxx> |
| 24 | #include <Standard_Boolean.hxx> |
| 25 | #include <Standard_Integer.hxx> |
| 26 | #include <TColStd_HSequenceOfTransient.hxx> |
| 27 | #include <TopAbs_ShapeEnum.hxx> |
| 28 | class XSControl_TransferReader; |
| 29 | class Standard_Transient; |
| 30 | class Interface_Graph; |
| 31 | class Interface_EntityIterator; |
| 32 | class TCollection_AsciiString; |
| 33 | class TopoDS_Shape; |
| 34 | class Transfer_TransientProcess; |
| 35 | |
| 36 | |
| 37 | class XSControl_ConnectedShapes; |
| 38 | DEFINE_STANDARD_HANDLE(XSControl_ConnectedShapes, IFSelect_SelectExplore) |
| 39 | |
| 40 | //! From a TopoDS_Shape, or from the entity which has produced it, |
| 41 | //! searches for the shapes, and the entities which have produced |
| 42 | //! them in last transfer, which are adjacent to it by VERTICES |
| 43 | class XSControl_ConnectedShapes : public IFSelect_SelectExplore |
| 44 | { |
| 45 | |
| 46 | public: |
| 47 | |
| 48 | |
| 49 | //! Creates a Selection ConnectedShapes. It remains to be set a |
| 50 | //! TransferReader |
| 51 | Standard_EXPORT XSControl_ConnectedShapes(); |
| 52 | |
| 53 | //! Creates a Selection ConnectedShapes, which will work with the |
| 54 | //! current TransferProcess brought by the TransferReader |
| 55 | Standard_EXPORT XSControl_ConnectedShapes(const Handle(XSControl_TransferReader)& TR); |
| 56 | |
| 57 | //! Sets a TransferReader to sort entities : it brings the |
| 58 | //! TransferProcess which may change, while the TransferReader does not |
| 59 | Standard_EXPORT void SetReader (const Handle(XSControl_TransferReader)& TR); |
| 60 | |
| 61 | //! Explores an entity : entities from which are connected to that |
| 62 | //! produced by this entity, including itself |
| 63 | Standard_EXPORT Standard_Boolean Explore (const Standard_Integer level, const Handle(Standard_Transient)& ent, const Interface_Graph& G, Interface_EntityIterator& explored) const Standard_OVERRIDE; |
| 64 | |
| 65 | //! Returns a text defining the criterium. |
| 66 | //! "Connected Entities through produced Shapes" |
| 67 | Standard_EXPORT TCollection_AsciiString ExploreLabel() const Standard_OVERRIDE; |
| 68 | |
| 69 | //! This functions considers a shape from a transfer and performs |
| 70 | //! the search function explained above |
| 71 | Standard_EXPORT static Handle(TColStd_HSequenceOfTransient) AdjacentEntities (const TopoDS_Shape& ashape, const Handle(Transfer_TransientProcess)& TP, const TopAbs_ShapeEnum type); |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | DEFINE_STANDARD_RTTIEXT(XSControl_ConnectedShapes,IFSelect_SelectExplore) |
| 77 | |
| 78 | protected: |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | private: |
| 84 | |
| 85 | |
| 86 | Handle(XSControl_TransferReader) theTR; |
| 87 | |
| 88 | |
| 89 | }; |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | #endif // _XSControl_ConnectedShapes_HeaderFile |