summaryrefslogtreecommitdiff
path: root/src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.cxx
blob: 588079989ee1cbdf2d0efb58bf885b1e701b77bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// File:	GeomToStep_MakeSurfaceOfRevolution.cxx
// Created:	Thu Jun 17 12:45:12 1993
// Author:	Martine LANGLOIS
//		<mla@mastox>

#include <GeomToStep_MakeSurfaceOfRevolution.ixx>
#include <GeomToStep_MakeAxis1Placement.hxx>
#include <GeomToStep_MakeCurve.hxx>
#include <gp_Ax1.hxx>
#include <StepGeom_Curve.hxx>
#include <StepGeom_Axis1Placement.hxx>
#include <StdFail_NotDone.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <StepGeom_SurfaceOfRevolution.hxx>
#include <TCollection_HAsciiString.hxx>

//=============================================================================
// Creation d' une surface_of_revolution de prostep a partir d' une
// SurfaceOfRevolution de Geom
//=============================================================================

GeomToStep_MakeSurfaceOfRevolution::GeomToStep_MakeSurfaceOfRevolution
  ( const Handle(Geom_SurfaceOfRevolution)& S )
	
{
  Handle(StepGeom_SurfaceOfRevolution) Surf;
  Handle(StepGeom_Curve) aSweptCurve;
  Handle(StepGeom_Axis1Placement) aAxisPosition;
  
  GeomToStep_MakeCurve MkSwept(S->BasisCurve());
  GeomToStep_MakeAxis1Placement MkAxis1(S->Axis());
  aSweptCurve = MkSwept.Value();
  aAxisPosition = MkAxis1.Value();
  Surf = new StepGeom_SurfaceOfRevolution;
  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
  Surf->Init(name, aSweptCurve, aAxisPosition);
  theSurfaceOfRevolution = Surf;
  done = Standard_True;
}

//=============================================================================
// renvoi des valeurs
//=============================================================================

const Handle(StepGeom_SurfaceOfRevolution) &
      GeomToStep_MakeSurfaceOfRevolution::Value() const
{
  StdFail_NotDone_Raise_if(!done == Standard_True,"");
  return theSurfaceOfRevolution;
}