0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / Draft / Draft_FaceInfo.cxx
CommitLineData
b311480e 1// Created on: 1994-08-31
2// Created by: Jacques GOUSSARD
3// Copyright (c) 1994-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
7fd59977 17
42cf5bc1 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>
7fd59977 24
25//=======================================================================
26//function : Draft_FaceInfo
27//purpose :
28//=======================================================================
7fd59977 29Draft_FaceInfo::Draft_FaceInfo ()
30{
31}
32
33//=======================================================================
34//function : Draft_FaceInfo
35//purpose :
36//=======================================================================
37
38Draft_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
53void Draft_FaceInfo::RootFace(const TopoDS_Face& F)
54{
55 myRootFace = F;
56}
57
58
59
60//=======================================================================
61//function : Add
62//purpose :
63//=======================================================================
64
65void 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
81const TopoDS_Face& Draft_FaceInfo::FirstFace () const
82{
83 return myF1;
84}
85
86
87//=======================================================================
88//function : SecondFace
89//purpose :
90//=======================================================================
91
92const TopoDS_Face& Draft_FaceInfo::SecondFace () const
93{
94 return myF2;
95}
96
97
98//=======================================================================
99//function : NewGeometry
100//purpose :
101//=======================================================================
102
103Standard_Boolean Draft_FaceInfo::NewGeometry() const
104{
105 return myNewGeom;
106}
107
108//=======================================================================
109//function : Geometry
110//purpose :
111//=======================================================================
112
113const Handle(Geom_Surface)& Draft_FaceInfo::Geometry() const
114{
115 return myGeom;
116}
117
118//=======================================================================
119//function : ChangeGeometry
120//purpose :
121//=======================================================================
122
123Handle(Geom_Surface)& Draft_FaceInfo::ChangeGeometry()
124{
125 return myGeom;
126}
127
128//=======================================================================
129//function : Curve
130//purpose :
131//=======================================================================
132
133const Handle(Geom_Curve)& Draft_FaceInfo::Curve() const
134{
135 return myCurv;
136}
137
138//=======================================================================
139//function : ChangeCurve
140//purpose :
141//=======================================================================
142
143Handle(Geom_Curve)& Draft_FaceInfo::ChangeCurve()
144{
145 return myCurv;
146}
147
148//=======================================================================
149//function : RootFace
150//purpose :
151//=======================================================================
152
153const TopoDS_Face & Draft_FaceInfo::RootFace() const
154{
155 return myRootFace;
156}
157
158