mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-01 10:26:12 +03:00
License statement text corrected; compiler warnings caused by Bison 2.41 disabled for MSVC; a few other compiler warnings on 54-bit Windows eliminated by appropriate type cast Wrong license statements corrected in several files. Copyright and license statements added in XSD and GLSL files. Copyright year updated in some files. Obsolete documentation files removed from DrawResources.
121 lines
4.2 KiB
C++
121 lines
4.2 KiB
C++
// Created on: 1993-06-17
|
|
// Created by: Martine LANGLOIS
|
|
// Copyright (c) 1993-1999 Matra Datavision
|
|
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
|
//
|
|
// This file is part of Open CASCADE Technology software library.
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify it under
|
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
// by the Free Software Foundation, with special exception defined in the file
|
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
// distribution for complete text of the license and disclaimer of any warranty.
|
|
//
|
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
// commercial license or contractual agreement.
|
|
|
|
#include <GeomToStep_MakeDirection.ixx>
|
|
#include <StdFail_NotDone.hxx>
|
|
#include <gp_Dir.hxx>
|
|
#include <gp_Dir2d.hxx>
|
|
#include <Geom_Direction.hxx>
|
|
#include <Geom2d_Direction.hxx>
|
|
#include <StepGeom_Direction.hxx>
|
|
#include <TColStd_HArray1OfReal.hxx>
|
|
#include <TCollection_HAsciiString.hxx>
|
|
|
|
//=============================================================================
|
|
// Creation d' une direction de prostep a partir d' une Dir de gp
|
|
//=============================================================================
|
|
|
|
GeomToStep_MakeDirection::GeomToStep_MakeDirection( const gp_Dir& D)
|
|
{
|
|
Handle(StepGeom_Direction) Dir = new StepGeom_Direction;
|
|
Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,3);
|
|
Standard_Real X, Y, Z;
|
|
|
|
D.Coord(X, Y, Z);
|
|
aDirRatios->SetValue(1,X);
|
|
aDirRatios->SetValue(2,Y);
|
|
aDirRatios->SetValue(3,Z);
|
|
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
|
Dir->Init(name, aDirRatios);
|
|
theDirection = Dir;
|
|
done = Standard_True;
|
|
}
|
|
//=============================================================================
|
|
// Creation d' une direction de prostep a partir d' une Dir2d de gp
|
|
//=============================================================================
|
|
|
|
GeomToStep_MakeDirection::GeomToStep_MakeDirection( const gp_Dir2d& D)
|
|
{
|
|
Handle(StepGeom_Direction) Dir = new StepGeom_Direction;
|
|
Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,2);
|
|
Standard_Real X, Y;
|
|
|
|
D.Coord(X, Y);
|
|
aDirRatios->SetValue(1,X);
|
|
aDirRatios->SetValue(2,Y);
|
|
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
|
Dir->Init(name, aDirRatios);
|
|
theDirection = Dir;
|
|
done = Standard_True;
|
|
}
|
|
|
|
//=============================================================================
|
|
// Creation d' une direction de prostep a partir d' une Direction de Geom
|
|
//=============================================================================
|
|
|
|
GeomToStep_MakeDirection::GeomToStep_MakeDirection
|
|
( const Handle(Geom_Direction)& Direc)
|
|
{
|
|
gp_Dir D;
|
|
Handle(StepGeom_Direction) Dir = new StepGeom_Direction;
|
|
Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,3);
|
|
Standard_Real X, Y, Z;
|
|
|
|
D=Direc->Dir();
|
|
D.Coord(X, Y, Z);
|
|
aDirRatios->SetValue(1,X);
|
|
aDirRatios->SetValue(2,Y);
|
|
aDirRatios->SetValue(3,Z);
|
|
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
|
Dir->Init(name, aDirRatios);
|
|
theDirection = Dir;
|
|
done = Standard_True;
|
|
|
|
}
|
|
//=============================================================================
|
|
// Creation d' une direction de prostep a partir d' une Direction de Geom2d
|
|
//=============================================================================
|
|
|
|
GeomToStep_MakeDirection::GeomToStep_MakeDirection
|
|
( const Handle(Geom2d_Direction)& Direc)
|
|
{
|
|
gp_Dir2d D;
|
|
Handle(StepGeom_Direction) Dir = new StepGeom_Direction;
|
|
Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,2);
|
|
Standard_Real X, Y;
|
|
|
|
D=Direc->Dir2d();
|
|
D.Coord(X, Y);
|
|
aDirRatios->SetValue(1,X);
|
|
aDirRatios->SetValue(2,Y);
|
|
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
|
Dir->Init(name, aDirRatios);
|
|
theDirection = Dir;
|
|
done = Standard_True;
|
|
|
|
}
|
|
|
|
//=============================================================================
|
|
// renvoi des valeurs
|
|
//=============================================================================
|
|
|
|
const Handle(StepGeom_Direction) &
|
|
GeomToStep_MakeDirection::Value() const
|
|
{
|
|
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
|
return theDirection;
|
|
}
|