0027104: DownCast() cannot return null for mismatched handle
[occt.git] / src / IGESSelect / IGESSelect_SelectBasicGeom.hxx
1 // Created on: 1997-04-14
2 // Created by: Christian CAILLET
3 // Copyright (c) 1997-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 _IGESSelect_SelectBasicGeom_HeaderFile
18 #define _IGESSelect_SelectBasicGeom_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Standard_Integer.hxx>
24 #include <IFSelect_SelectExplore.hxx>
25 #include <Standard_Boolean.hxx>
26 class Standard_Transient;
27 class Interface_Graph;
28 class Interface_EntityIterator;
29 class TCollection_AsciiString;
30 class IGESData_IGESEntity;
31
32
33 class IGESSelect_SelectBasicGeom;
34 DEFINE_STANDARD_HANDLE(IGESSelect_SelectBasicGeom, IFSelect_SelectExplore)
35
36 //! This selection returns the basic geometric elements
37 //! contained in an IGES Entity
38 //! Intended to run a "quick" transfer. I.E. :
39 //! - for a Group, considers its Elements
40 //! - for a Trimmed or Bounded Surface or a Face (BREP),
41 //! considers the 3D curves of each of its loops
42 //! - for a Plane (108), considers its Bounding Curve
43 //! - for a Curve itself, takes it
44 //!
45 //! Also, FREE surfaces are taken, because curve 3d is known for
46 //! them. (the ideal should be to have their natural bounds)
47 //!
48 //! If <curvesonly> is set, ONLY curves-3d are returned
49 class IGESSelect_SelectBasicGeom : public IFSelect_SelectExplore
50 {
51
52 public:
53
54   
55   //! Creates a SelectBasicGeom, which allways works recursively
56   //! mode = -1 : Returns Surfaces (without trimming)
57   //! mode = +1 : Returns Curves 3D (free or bound of surface)
58   //! mode = +2 : Returns Basic Curves 3D : as 1 but CompositeCurves
59   //! are returned in detail
60   //! mode = 0  : both
61   Standard_EXPORT IGESSelect_SelectBasicGeom(const Standard_Integer mode);
62   
63   Standard_EXPORT Standard_Boolean CurvesOnly() const;
64   
65   //! Explores an entity, to take its contained Curves 3d
66   //! Works recursively
67   Standard_EXPORT Standard_Boolean Explore (const Standard_Integer level, const Handle(Standard_Transient)& ent, const Interface_Graph& G, Interface_EntityIterator& explored) const Standard_OVERRIDE;
68   
69   //! Returns a text defining the criterium : "Curves 3d" or
70   //! "Basic Geometry"
71   Standard_EXPORT TCollection_AsciiString ExploreLabel() const Standard_OVERRIDE;
72   
73   //! This method can be called from everywhere to get the curves
74   //! as sub-elements of a given curve :
75   //! CompositeCurve : explored lists its subs + returns True
76   //! Any Curve : explored is not filled but returned is True
77   //! Other : returned is False
78   Standard_EXPORT static Standard_Boolean SubCurves (const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& explored);
79
80
81
82
83   DEFINE_STANDARD_RTTIEXT(IGESSelect_SelectBasicGeom,IFSelect_SelectExplore)
84
85 protected:
86
87
88
89
90 private:
91
92
93   Standard_Integer thegeom;
94
95
96 };
97
98
99
100
101
102
103
104 #endif // _IGESSelect_SelectBasicGeom_HeaderFile