Warnings on vc14 were eliminated
[occt.git] / src / Draft / Draft_FaceInfo.cxx
1 // Created on: 1994-08-31
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1994-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
18 #include <Draft_FaceInfo.hxx>
19 #include <Geom_Curve.hxx>
20 #include <Geom_RectangularTrimmedSurface.hxx>
21 #include <Geom_Surface.hxx>
22 #include <Standard_DomainError.hxx>
23 #include <TopoDS_Face.hxx>
24
25 //=======================================================================
26 //function : Draft_FaceInfo
27 //purpose  : 
28 //=======================================================================
29 Draft_FaceInfo::Draft_FaceInfo ()
30 {
31 }
32
33 //=======================================================================
34 //function : Draft_FaceInfo
35 //purpose  : 
36 //=======================================================================
37
38 Draft_FaceInfo::Draft_FaceInfo (const Handle(Geom_Surface)& S,\
39                                 const Standard_Boolean HasNewGeometry):
40        myNewGeom(HasNewGeometry)
41 {
42   Handle(Geom_RectangularTrimmedSurface) T = Handle(Geom_RectangularTrimmedSurface)::DownCast(S);
43   if (!T.IsNull()) myGeom = T->BasisSurface();
44   else             myGeom = S;
45 }
46
47
48 //=======================================================================
49 //function : RootFace
50 //purpose  : 
51 //=======================================================================
52
53 void Draft_FaceInfo::RootFace(const TopoDS_Face& F)
54 {
55   myRootFace = F;
56 }
57
58
59
60 //=======================================================================
61 //function : Add
62 //purpose  : 
63 //=======================================================================
64
65 void Draft_FaceInfo::Add(const TopoDS_Face& F)
66 {
67   if (myF1.IsNull()) {
68     myF1 = F;
69   }
70   else if (myF2.IsNull()) {
71     myF2 = F;
72   }
73 }
74
75
76 //=======================================================================
77 //function : FirstFace
78 //purpose  : 
79 //=======================================================================
80
81 const TopoDS_Face& Draft_FaceInfo::FirstFace () const
82 {
83   return myF1;
84 }
85
86
87 //=======================================================================
88 //function : SecondFace
89 //purpose  : 
90 //=======================================================================
91
92 const TopoDS_Face& Draft_FaceInfo::SecondFace () const
93 {
94   return myF2;
95 }
96
97
98 //=======================================================================
99 //function : NewGeometry
100 //purpose  : 
101 //=======================================================================
102
103 Standard_Boolean Draft_FaceInfo::NewGeometry() const
104 {
105   return myNewGeom;
106 }
107
108 //=======================================================================
109 //function : Geometry
110 //purpose  : 
111 //=======================================================================
112
113 const Handle(Geom_Surface)& Draft_FaceInfo::Geometry() const
114 {
115   return myGeom;
116 }
117
118 //=======================================================================
119 //function : ChangeGeometry
120 //purpose  : 
121 //=======================================================================
122
123 Handle(Geom_Surface)& Draft_FaceInfo::ChangeGeometry()
124 {
125   return myGeom;
126 }
127
128 //=======================================================================
129 //function : Curve
130 //purpose  : 
131 //=======================================================================
132
133 const Handle(Geom_Curve)& Draft_FaceInfo::Curve() const
134 {
135   return myCurv;
136 }
137
138 //=======================================================================
139 //function : ChangeCurve
140 //purpose  : 
141 //=======================================================================
142
143 Handle(Geom_Curve)& Draft_FaceInfo::ChangeCurve()
144 {
145   return myCurv;
146 }
147
148 //=======================================================================
149 //function : RootFace
150 //purpose  : 
151 //=======================================================================
152
153 const TopoDS_Face & Draft_FaceInfo::RootFace() const
154 {
155   return myRootFace;
156 }
157
158