0032667: Coding - get rid of unused forward declarations [LibCtl to StepRepr]
[occt.git] / src / ShapeExtend / ShapeExtend_Explorer.hxx
1 // Created on: 1998-06-03
2 // Created by: data exchange team
3 // Copyright (c) 1998-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 _ShapeExtend_Explorer_HeaderFile
18 #define _ShapeExtend_Explorer_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <TopTools_HSequenceOfShape.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <TopTools_ListOfShape.hxx>
27 #include <TopAbs_ShapeEnum.hxx>
28 class TopoDS_Shape;
29
30
31 //! This class is intended to
32 //! explore shapes and convert different representations
33 //! (list, sequence, compound) of complex shapes. It provides tools for:
34 //! - obtaining type of the shapes in context of TopoDS_Compound,
35 //! - exploring shapes in context of  TopoDS_Compound,
36 //! - converting different representations of shapes (list, sequence, compound).
37 class ShapeExtend_Explorer 
38 {
39 public:
40
41   DEFINE_STANDARD_ALLOC
42
43   
44   //! Creates an object Explorer
45   Standard_EXPORT ShapeExtend_Explorer();
46   
47   //! Converts a sequence of Shapes to a Compound
48   Standard_EXPORT TopoDS_Shape CompoundFromSeq (const Handle(TopTools_HSequenceOfShape)& seqval) const;
49   
50   //! Converts a Compound to a list of Shapes
51   //! if <comp> is not a compound, the list contains only <comp>
52   //! if <comp> is Null, the list is empty
53   //! if <comp> is a Compound, its sub-shapes are put into the list
54   //! then if <expcomp> is True, if a sub-shape is a Compound, it
55   //! is not put to the list but its sub-shapes are (recursive)
56   Standard_EXPORT Handle(TopTools_HSequenceOfShape) SeqFromCompound (const TopoDS_Shape& comp, const Standard_Boolean expcomp) const;
57   
58   //! Converts a Sequence of Shapes to a List of Shapes
59   //! <clear> if True (D), commands the list to start from scratch
60   //! else, the list is cumulated
61   Standard_EXPORT void ListFromSeq (const Handle(TopTools_HSequenceOfShape)& seqval, TopTools_ListOfShape& lisval, const Standard_Boolean clear = Standard_True) const;
62   
63   //! Converts a List of Shapes to a Sequence of Shapes
64   Standard_EXPORT Handle(TopTools_HSequenceOfShape) SeqFromList (const TopTools_ListOfShape& lisval) const;
65   
66   //! Returns the type of a Shape: true type if <compound> is False
67   //! If <compound> is True and <shape> is a Compound, iterates on
68   //! its items. If all are of the same type, returns this type.
69   //! Else, returns COMPOUND. If it is empty, returns SHAPE
70   //! For a Null Shape, returns SHAPE
71   Standard_EXPORT TopAbs_ShapeEnum ShapeType (const TopoDS_Shape& shape, const Standard_Boolean compound) const;
72   
73   //! Builds a COMPOUND from the given shape.
74   //! It explores the shape level by level, according to the
75   //! <explore> argument. If <explore> is False, only COMPOUND
76   //! items are explored, else all items are.
77   //! The following shapes are added to resulting compound:
78   //! - shapes which comply to <type>
79   //! - if <type> is WIRE, considers also free edges (and makes wires)
80   //! - if <type> is SHELL, considers also free faces (and makes shells)
81   //! If <compound> is True, gathers items in compounds which
82   //! correspond to starting COMPOUND,SOLID or SHELL containers, or
83   //! items directly contained in a Compound
84   Standard_EXPORT TopoDS_Shape SortedCompound (const TopoDS_Shape& shape, const TopAbs_ShapeEnum type, const Standard_Boolean explore, const Standard_Boolean compound) const;
85   
86   //! Dispatches starting list of shapes according to their type,
87   //! to the appropriate resulting lists
88   //! For each of these lists, if it is null, it is firstly created
89   //! else, new items are appended to the already existing ones
90   Standard_EXPORT void DispatchList (const Handle(TopTools_HSequenceOfShape)& list, Handle(TopTools_HSequenceOfShape)& vertices, Handle(TopTools_HSequenceOfShape)& edges, Handle(TopTools_HSequenceOfShape)& wires, Handle(TopTools_HSequenceOfShape)& faces, Handle(TopTools_HSequenceOfShape)& shells, Handle(TopTools_HSequenceOfShape)& solids, Handle(TopTools_HSequenceOfShape)& compsols, Handle(TopTools_HSequenceOfShape)& compounds) const;
91
92
93
94
95 protected:
96
97
98
99
100
101 private:
102
103
104
105
106
107 };
108
109
110
111
112
113
114
115 #endif // _ShapeExtend_Explorer_HeaderFile