0024135: Result of reading step file is invalid.
[occt.git] / src / StepToGeom / StepToGeom_MakeConic.cxx
CommitLineData
b311480e 1// Created on: 1993-07-02
2// Created by: Martine LANGLOIS
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21//:p0 abv 19.02.99: management of 'done' flag improved
22
23#include <StepToGeom_MakeConic.ixx>
24#include <StepGeom_Conic.hxx>
25#include <StepGeom_Circle.hxx>
26#include <StepToGeom_MakeCircle.hxx>
27#include <StepGeom_Ellipse.hxx>
28#include <StepToGeom_MakeEllipse.hxx>
29#include <StepGeom_Hyperbola.hxx>
30#include <StepToGeom_MakeHyperbola.hxx>
31#include <StepGeom_Parabola.hxx>
32#include <StepToGeom_MakeParabola.hxx>
33
34//=============================================================================
35// Creation d' une Conic de Geom a partir d' une Conic de Step
36//=============================================================================
37
38Standard_Boolean StepToGeom_MakeConic::Convert
39 (const Handle(StepGeom_Conic)& SC,
40 Handle(Geom_Conic)& CC)
41{
42 if (SC->IsKind(STANDARD_TYPE(StepGeom_Circle))) {
43 const Handle(StepGeom_Circle) Cir = Handle(StepGeom_Circle)::DownCast(SC);
44 return StepToGeom_MakeCircle::Convert(Cir,*((Handle(Geom_Circle)*)&CC));
45 }
46 if (SC->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
47 const Handle(StepGeom_Ellipse) Ell = Handle(StepGeom_Ellipse)::DownCast(SC);
48 return StepToGeom_MakeEllipse::Convert(Ell,*((Handle(Geom_Ellipse)*)&CC));
49 }
50 if (SC->IsKind(STANDARD_TYPE(StepGeom_Hyperbola))) {
51 const Handle(StepGeom_Hyperbola) Hyp = Handle(StepGeom_Hyperbola)::DownCast(SC);
52 return StepToGeom_MakeHyperbola::Convert(Hyp,*((Handle(Geom_Hyperbola)*)&CC));
53 }
54 if (SC->IsKind(STANDARD_TYPE(StepGeom_Parabola))) {
55 const Handle(StepGeom_Parabola) Par = Handle(StepGeom_Parabola)::DownCast(SC);
56 return StepToGeom_MakeParabola::Convert(Par,*((Handle(Geom_Parabola)*)&CC));
57 }
58 // Attention : Other conic shall be implemented !
59 return Standard_False;
60}