mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
Output to cout activated previously in Debug mode by #ifdef DEB is suppressed by using macro <PACKAGE>_DEB instead of DEB
88 lines
3.2 KiB
C++
88 lines
3.2 KiB
C++
// Created on: 1993-06-22
|
|
// 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_MakeSurface.ixx>
|
|
#include <StdFail_NotDone.hxx>
|
|
#include <StepGeom_Surface.hxx>
|
|
#include <GeomToStep_MakeSurface.hxx>
|
|
#include <Geom_BoundedSurface.hxx>
|
|
#include <GeomToStep_MakeBoundedSurface.hxx>
|
|
#include <Geom_ElementarySurface.hxx>
|
|
#include <GeomToStep_MakeElementarySurface.hxx>
|
|
#include <Geom_SweptSurface.hxx>
|
|
#include <GeomToStep_MakeSweptSurface.hxx>
|
|
#include <TCollection_HAsciiString.hxx>
|
|
#include <Geom_OffsetSurface.hxx>
|
|
#include <StepGeom_OffsetSurface.hxx>
|
|
#include <StepData_Logical.hxx>
|
|
#include <UnitsMethods.hxx>
|
|
|
|
//=============================================================================
|
|
// Creation d' une Surface de prostep a partir d' une Surface de Geom
|
|
//=============================================================================
|
|
|
|
GeomToStep_MakeSurface::GeomToStep_MakeSurface ( const Handle(Geom_Surface)& S)
|
|
{
|
|
done = Standard_True;
|
|
if (S->IsKind(STANDARD_TYPE(Geom_BoundedSurface))) {
|
|
Handle(Geom_BoundedSurface) S1 =
|
|
Handle(Geom_BoundedSurface)::DownCast(S);
|
|
GeomToStep_MakeBoundedSurface MkBoundedS(S1);
|
|
theSurface = MkBoundedS.Value();
|
|
}
|
|
else if (S->IsKind(STANDARD_TYPE(Geom_ElementarySurface))) {
|
|
Handle(Geom_ElementarySurface) S1 =
|
|
Handle(Geom_ElementarySurface)::DownCast(S);
|
|
GeomToStep_MakeElementarySurface MkElementaryS(S1);
|
|
theSurface = MkElementaryS.Value();
|
|
}
|
|
else if (S->IsKind(STANDARD_TYPE(Geom_SweptSurface))) {
|
|
Handle(Geom_SweptSurface) S1 =
|
|
Handle(Geom_SweptSurface)::DownCast(S);
|
|
GeomToStep_MakeSweptSurface MkSwept(S1);
|
|
theSurface = MkSwept.Value();
|
|
}
|
|
else if (S->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) {
|
|
Handle(Geom_OffsetSurface) S1 =
|
|
Handle(Geom_OffsetSurface)::DownCast(S);
|
|
GeomToStep_MakeSurface MkBasis(S1->BasisSurface());
|
|
done = MkBasis.IsDone();
|
|
if (!done) return;
|
|
Handle(StepGeom_OffsetSurface) Surf = new StepGeom_OffsetSurface;
|
|
Surf->Init (new TCollection_HAsciiString(""),
|
|
MkBasis.Value(),S1->Offset()/UnitsMethods::LengthFactor(),StepData_LFalse);
|
|
theSurface = Surf;
|
|
}
|
|
else {
|
|
done = Standard_False;
|
|
#ifdef GEOMTOSTEP_DEB
|
|
cout << " unknown type " << S->DynamicType()->Name() << endl;
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
//=============================================================================
|
|
// renvoi des valeurs
|
|
//=============================================================================
|
|
|
|
const Handle(StepGeom_Surface) &
|
|
GeomToStep_MakeSurface::Value() const
|
|
{
|
|
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
|
return theSurface;
|
|
}
|