summaryrefslogtreecommitdiff
path: root/src/StepToGeom/StepToGeom_MakeLine.cxx
blob: d30e8cb1f7d21a71b5a27463aa3943bee05a9fcd (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
// File:	StepToGeom_MakeLine.cxx
// Created:	Fri Jul  2 17:51:47 1993
// Author:	Martine LANGLOIS
// sln 22.10.2001. CTS23496: Line is not created if direction have not been succesfully created (StepToGeom_MakeLine(...) function)

#include <StepToGeom_MakeLine.ixx>
#include <StepGeom_Line.hxx>
#include <StepGeom_Vector.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepToGeom_MakeVectorWithMagnitude.hxx>
#include <StepToGeom_MakeCartesianPoint.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Line.hxx>
#include <Geom_VectorWithMagnitude.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>

//=============================================================================
// Creation d' une Line de Geom a partir d' une Line de Step
//=============================================================================

Standard_Boolean StepToGeom_MakeLine::Convert (const Handle(StepGeom_Line)& SC, Handle(Geom_Line)& CC)
{
  Handle(Geom_CartesianPoint) P;
  if (StepToGeom_MakeCartesianPoint::Convert(SC->Pnt(),P))
  {
    // sln 22.10.2001. CTS23496: Line is not created if direction have not been succesfully created 
    Handle(Geom_VectorWithMagnitude) D;
    if (StepToGeom_MakeVectorWithMagnitude::Convert(SC->Dir(),D))
    {
      const gp_Dir V(D->Vec());
      CC = new Geom_Line(P->Pnt(), V);
      return Standard_True;
    }
  }
  return Standard_False;
}