0032641: Coding - get rid of unused forward declarations [IGESAppli to LDOM]
[occt.git] / src / IMeshData / IMeshData_Face.hxx
1 // Created on: 2016-04-07
2 // Copyright (c) 2016 OPEN CASCADE SAS
3 // Created by: Oleg AGASHIN
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
16 #ifndef _IMeshData_Face_HeaderFile
17 #define _IMeshData_Face_HeaderFile
18
19 #include <IMeshData_TessellatedShape.hxx>
20 #include <IMeshData_StatusOwner.hxx>
21 #include <Standard_Type.hxx>
22 #include <TopoDS_Face.hxx>
23 #include <TopoDS.hxx>
24 #include <IMeshData_Status.hxx>
25 #include <IMeshData_Types.hxx>
26 #include <BRepAdaptor_Surface.hxx>
27
28 class TopoDS_Wire;
29
30 //! Interface class representing discrete model of a face.
31 //! Face model contains one or several wires.
32 //! First wire is always outer one.
33 class IMeshData_Face : public IMeshData_TessellatedShape, public IMeshData_StatusOwner
34 {
35 public:
36
37   //! Destructor.
38   virtual ~IMeshData_Face()
39   {
40   }
41
42   //! Returns number of wires.
43   Standard_EXPORT virtual Standard_Integer WiresNb () const = 0;
44
45   //! Adds wire to discrete model of face.
46   Standard_EXPORT virtual const IMeshData::IWireHandle& AddWire (
47     const TopoDS_Wire&     theWire,
48     const Standard_Integer theEdgeNb = 0) = 0;
49
50   //! Returns discrete edge with the given index.
51   Standard_EXPORT virtual const IMeshData::IWireHandle& GetWire (
52     const Standard_Integer theIndex) const = 0;
53
54   //! Returns face's surface.
55   const Handle(BRepAdaptor_Surface)& GetSurface() const
56   {
57     return mySurface;
58   }
59
60   //! Returns TopoDS_Face attached to model.
61   const TopoDS_Face& GetFace () const
62   {
63     return TopoDS::Face (GetShape ());
64   }
65
66   //! Returns whether the face discrete model is valid.
67   Standard_Boolean IsValid () const
68   {
69     return (IsEqual(IMeshData_NoError) ||
70             IsEqual(IMeshData_ReMesh)  ||
71             IsEqual(IMeshData_UnorientedWire));
72   }
73
74   DEFINE_STANDARD_RTTIEXT(IMeshData_Face, IMeshData_TessellatedShape)
75
76 protected:
77
78   //! Constructor.
79   //! Initializes empty model.
80   IMeshData_Face (const TopoDS_Face& theFace)
81     : IMeshData_TessellatedShape(theFace)
82   {
83     BRepAdaptor_Surface aSurfAdaptor(GetFace(), Standard_False);
84     mySurface = new BRepAdaptor_Surface(aSurfAdaptor);
85   }
86
87 private:
88
89   mutable Handle(BRepAdaptor_Surface)  mySurface;
90 };
91
92 #endif