1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

4
src/StepToGeom/FILES Executable file
View File

@@ -0,0 +1,4 @@
StepToGeom_MakeBSplineCurve.pxx
StepToGeom_WOKSteps.edl
StepToGeom_CMPLRS.edl

65
src/StepToGeom/StepToGeom.cdl Executable file
View File

@@ -0,0 +1,65 @@
-- File: StepToGeom.cdl
-- Created: Fri Jun 11 18:17:21 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
package StepToGeom
--- Purpose: Creation des entites geometriques de Geom a partir du schema
-- StepGeom (Part42, geometric)
uses gp, Geom, Geom2d, StepGeom, StdFail
is
private deferred class Root;
class MakeCartesianPoint;
class MakeCartesianPoint2d;
class MakeAxisPlacement;
class MakeAxis1Placement;
class MakeAxis2Placement;
class MakeDirection;
class MakeDirection2d;
class MakeVectorWithMagnitude;
class MakeVectorWithMagnitude2d;
class MakeCurve;
class MakeTrimmedCurve;
class MakeTrimmedCurve2d;
class MakeCurve2d;
class MakeConic;
class MakeConic2d;
class MakeBoundedCurve;
class MakeBoundedCurve2d;
class MakeEllipse;
class MakeEllipse2d;
class MakeHyperbola;
class MakeHyperbola2d;
class MakeParabola;
class MakeParabola2d;
class MakeCircle;
class MakeCircle2d;
class MakeBSplineCurve;
class MakeBSplineCurve2d;
class MakeLine;
class MakeLine2d;
class MakePolyline;
class MakePolyline2d;
class MakePlane;
class MakeSurface;
class MakeBoundedSurface;
class MakeElementarySurface;
class MakeSweptSurface;
class MakeConicalSurface;
class MakeCylindricalSurface;
class MakeRectangularTrimmedSurface;
class MakeSphericalSurface;
class MakeSurfaceOfLinearExtrusion;
class MakeSurfaceOfRevolution;
class MakeToroidalSurface;
class MakeBSplineSurface;
class MakeTransformation3d;
class MakeTransformation2d;
-- class CheckSurfaceClosure;
end StepToGeom;

View File

@@ -0,0 +1,17 @@
-- File: CMPLRS.edl
-- Author: Christian CAILLET
-- History: Wed May 21 10:57:28 1997
-- Copyright: Matra Datavision 1997
-- Pb compil gros code HP-UX sous WOK++
-- trop de warning -> shut up
@if ( %Station == "sil" ) then
@string %CMPLRS_CXX_Options = %CMPLRS_CXX_Options " -w ";
-- Pb optimiseur (O2) pas fiable
@set %ModeOpt = "+O1";
@endif;

View File

@@ -0,0 +1,20 @@
-- File: StepToGeom_MakeAxis1Placement.cdl
-- Created: Mon Jun 14 11:05:20 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeAxis1Placement from StepToGeom
---Purpose: This class implements the mapping between classes
-- Axis1Placement from Step and Axis1Placement from Geom
uses Axis1Placement from Geom,
Axis1Placement from StepGeom
is
Convert ( myclass; SA : Axis1Placement from StepGeom;
CA : out Axis1Placement from Geom )
returns Boolean from Standard;
end MakeAxis1Placement;

View File

@@ -0,0 +1,38 @@
// File: StepToGeom_MakeAxis1Placement.cxx
// Created: Tue Jun 15 18:35:17 1993
// Author: Martine LANGLOIS
// sln 22.10.2001. CTS23496: If problems with creation of axis's direction occur default direction is used (StepToGeom_MakeAxis1Placement(...) function)
#include <StepToGeom_MakeAxis1Placement.ixx>
#include <StepGeom_Direction.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepToGeom_MakeDirection.hxx>
#include <StepToGeom_MakeCartesianPoint.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Direction.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <Geom_Axis1Placement.hxx>
//=============================================================================
// Creation d' un Ax1Placement de Geom a partir d' un axis1_placement de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeAxis1Placement::Convert (const Handle(StepGeom_Axis1Placement)& SA, Handle(Geom_Axis1Placement)& CA)
{
Handle(Geom_CartesianPoint) P;
if (StepToGeom_MakeCartesianPoint::Convert(SA->Location(),P))
{
// sln 22.10.2001. CTS23496: If problems with creation of axis direction occur default direction is used
gp_Dir D(0.,0.,1.);
if (SA->HasAxis())
{
Handle(Geom_Direction) D1;
if (StepToGeom_MakeDirection::Convert(SA->Axis(),D1))
D = D1->Dir();
}
CA = new Geom_Axis1Placement(P->Pnt(),D);
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,20 @@
-- File: StepToGeom_MakeAxis2Placement.cdl
-- Created: Mon Jun 14 11:17:16 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeAxis2Placement from StepToGeom
---Purpose: This class implements the mapping between classes
-- Axis2Placement from Step and Axis2Placement from Geom
uses Axis2Placement from Geom,
Axis2Placement3d from StepGeom
is
Convert ( myclass; SA : Axis2Placement3d from StepGeom;
CA : out Axis2Placement from Geom )
returns Boolean from Standard;
end MakeAxis2Placement;

View File

@@ -0,0 +1,58 @@
// File: StepToGeom_MakeAxis2Placement.cxx
// Created: Thu Jul 1 16:41:35 1993
// Author: Martine LANGLOIS
// sln 22.10.2001. CTS23496: If problems with creation of direction occur default direction is used (StepToGeom_MakeAxis2Placement(...) function)
#include <StepToGeom_MakeAxis2Placement.ixx>
#include <StepToGeom_MakeCartesianPoint.hxx>
#include <StepToGeom_MakeDirection.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Direction.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax2.hxx>
//=============================================================================
// Creation d' un Axis2Placement de Geom a partir d' un axis2_placement_3d
// de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeAxis2Placement::Convert (const Handle(StepGeom_Axis2Placement3d)& SA, Handle(Geom_Axis2Placement)& CA)
{
Handle(Geom_CartesianPoint) P;
if (StepToGeom_MakeCartesianPoint::Convert(SA->Location(),P))
{
const gp_Pnt Pgp = P->Pnt();
// sln 22.10.2001. CTS23496: If problems with creation of direction occur default direction is used (StepToGeom_MakeLine(...) function)
gp_Dir Ngp(0.,0.,1.);
if (SA->HasAxis())
{
Handle(Geom_Direction) D;
if (StepToGeom_MakeDirection::Convert(SA->Axis(),D))
Ngp = D->Dir();
}
gp_Ax2 gpAx2;
Standard_Boolean isDefaultDirectionUsed = Standard_True;
if (SA->HasRefDirection())
{
Handle(Geom_Direction) D;
if (StepToGeom_MakeDirection::Convert(SA->RefDirection(),D))
{
const gp_Dir Vxgp = D->Dir();
if (!Ngp.IsParallel(Vxgp,Precision::Angular()))
{
gpAx2 = gp_Ax2(Pgp, Ngp, Vxgp);
isDefaultDirectionUsed = Standard_False;
}
}
}
if(isDefaultDirectionUsed)
gpAx2 = gp_Ax2(Pgp, Ngp);
CA = new Geom_Axis2Placement(gpAx2);
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,20 @@
-- File: StepToGeom_MakeAxisPlacemant.cdl
-- Created: Fri Aug 26 12:09:08 1994
-- Author: Frederic MAUPAS
---Copyright: Matra Datavision 1994
class MakeAxisPlacement from StepToGeom
---Purpose: This class implements the mapping between classes
-- Axis2Placement2d from Step and AxisPlacement from Geom2d
uses AxisPlacement from Geom2d,
Axis2Placement2d from StepGeom
is
Convert ( myclass; SA : Axis2Placement2d from StepGeom;
CA : out AxisPlacement from Geom2d )
returns Boolean from Standard;
end MakeAxisPlacement;

View File

@@ -0,0 +1,38 @@
// File: StepToGeom_MakeAxisPlacemant.cxx
// Created: Fri Aug 26 12:11:31 1994
// Author: Frederic MAUPAS
// sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is used
#include <StepToGeom_MakeAxisPlacement.ixx>
#include <StepToGeom_MakeCartesianPoint2d.hxx>
#include <StepToGeom_MakeDirection2d.hxx>
#include <Geom2d_CartesianPoint.hxx>
#include <Geom2d_Direction.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Dir2d.hxx>
//=============================================================================
// Creation d' un AxisPlacement de Geom2d a partir d' un axis2_placement_3d
// de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeAxisPlacement::Convert
(const Handle(StepGeom_Axis2Placement2d)& SA,
Handle(Geom2d_AxisPlacement)& CA)
{
Handle(Geom2d_CartesianPoint) P;
if (StepToGeom_MakeCartesianPoint2d::Convert(SA->Location(),P))
{
// sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is used
gp_Dir2d Vxgp(1.,0.);
if (SA->HasRefDirection()) {
Handle(Geom2d_Direction) Vx;
if (StepToGeom_MakeDirection2d::Convert(SA->RefDirection(),Vx))
Vxgp = Vx->Dir2d();
}
CA = new Geom2d_AxisPlacement(P->Pnt2d(),Vxgp);
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,21 @@
-- File: StepToGeom_MakeBSplineCurve.cdl
-- Created: Mon Jun 14 15:22:02 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeBSplineCurve from StepToGeom
---Purpose: This class implements the mapping between all classes of
-- BSplineCurve from StepGeom and BSplineCurve from Geom
uses
BSplineCurve from Geom,
BSplineCurve from StepGeom
is
Convert ( myclass; SC : BSplineCurve from StepGeom;
CC : out BSplineCurve from Geom )
returns Boolean from Standard;
end MakeBSplineCurve;

View File

@@ -0,0 +1,45 @@
// File: StepToGeom_MakeBSplineCurve.cxx
// Created: Thu Jul 1 17:35:13 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeBSplineCurve.ixx>
#include <gp_Pnt.hxx>
#include <StepGeom_HArray1OfCartesianPoint.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <StepGeom_BSplineCurveWithKnots.hxx>
#include <StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepToGeom_MakeCartesianPoint.hxx>
#include <Geom_CartesianPoint.hxx>
//=============================================================================
// Creation d' une BSplineCurve de Geom a partir d' une BSplineCurve de Step
//=============================================================================
#define Array1OfPnt_gen TColgp_Array1OfPnt
#define Pnt_gen gp_Pnt
#define Pnt_fonc Pnt
#define CartesianPoint_gen Handle(Geom_CartesianPoint)
#define StepToGeom_MakeCartesianPoint_gen StepToGeom_MakeCartesianPoint
#define BSplineCurve_gen Geom_BSplineCurve
#define BSplineCurve_retour Handle(Geom_BSplineCurve)
#define StepToGeom_MakeBSplineCurve_gen StepToGeom_MakeBSplineCurve
Standard_Boolean StepToGeom_MakeBSplineCurve::Convert
(const Handle(StepGeom_BSplineCurve)& SC,
Handle(Geom_BSplineCurve)& CC)
#include <StepToGeom_MakeBSplineCurve.pxx>
#undef Array1OfPnt_gen
#undef Pnt_gen
#undef Pnt_fonc
#undef CartesianPoint_gen
#undef StepToGeom_MakeCartesianPoint_gen
#undef BSplineCurve_gen
#undef StepToGeom_MakeBSplineCurve_gen
#undef BSplineCurve_retour

View File

@@ -0,0 +1,92 @@
// File: StepToGeom_MakeBSplineCurve.pxx
// Created: Fri Jul 2 15:16:54 1993
// Author: Martine LANGLOIS
{
Handle(StepGeom_BSplineCurveWithKnots) BSCW;
Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) BSCWR;
if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) {
BSCWR =
Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)
::DownCast(SC);
BSCW =
Handle(StepGeom_BSplineCurveWithKnots)
::DownCast(BSCWR->BSplineCurveWithKnots());
}
else
BSCW = Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC);
const Standard_Integer Deg = BSCW->Degree();
const Standard_Integer NbPoles = BSCW->NbControlPointsList();
//aControlPointsList = new StepGeom_HArray1OfCartesianPoint(1,NbPoles);
const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList = BSCW->ControlPointsList();
Array1OfPnt_gen Poles(1,NbPoles);
Standard_Integer i;
CartesianPoint_gen P;
for (i=1; i<=NbPoles; i++)
{
if (StepToGeom_MakeCartesianPoint_gen::Convert(aControlPointsList->Value(i),P))
Poles.SetValue(i,P->Pnt_fonc());
else
return Standard_False;
}
const Standard_Integer NbKnots = BSCW->NbKnotMultiplicities();
//aKnotMultiplicities = new TColStd_HArray1OfInteger(1,NbKnots);
const Handle(TColStd_HArray1OfInteger)& aKnotMultiplicities = BSCW->KnotMultiplicities();
TColStd_Array1OfInteger Mult(1,NbKnots);
for (i=1; i<=NbKnots; i++) {
Mult.SetValue(i,aKnotMultiplicities->Value(i));
}
//aKnots = new TColStd_HArray1OfReal(1,NbKnots);
const Handle(TColStd_HArray1OfReal)& aKnots = BSCW->Knots();
TColStd_Array1OfReal Kn(1,NbKnots);
for (i=1; i<=NbKnots; i++) {
Kn.SetValue(i,aKnots->Value(i));
}
// --- Does the Curve descriptor LOOKS like a periodic descriptor ? ---
Standard_Integer SumMult = 0;
for (i=1; i<=NbKnots; i++) {
SumMult += aKnotMultiplicities->Value(i);
}
Standard_Boolean shouldBePeriodic;
if (SumMult == (NbPoles + Deg + 1)) {
shouldBePeriodic = Standard_False;
}
else if ((aKnotMultiplicities->Value(1) ==
aKnotMultiplicities->Value(NbKnots)) &&
((SumMult - aKnotMultiplicities->Value(1)) == NbPoles)) {
shouldBePeriodic = Standard_True;
}
else { // --- What is that ??? ---
shouldBePeriodic = Standard_False;
//cout << "Strange BSpline Curve Descriptor" << endl;
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) {
const Handle(TColStd_HArray1OfReal)& aWeight = BSCWR->WeightsData();
TColStd_Array1OfReal W(1,NbPoles);
for (i=1; i<=NbPoles; i++)
W.SetValue(i,aWeight->Value(i));
CC = new BSplineCurve_gen(Poles, W, Kn, Mult, Deg, shouldBePeriodic);
}
else
CC = new BSplineCurve_gen(Poles, Kn, Mult, Deg, shouldBePeriodic);
// abv 04.07.00 CAX-IF TRJ4: trj4_k1_top-md-203.stp #716 (face #581):
// force periodicity on closed curves
if ( SC->ClosedCurve() && CC->Degree() >1 && CC->IsClosed() ) {
CC->SetPeriodic();
//#ifdef DEB
// cout << "Warning: "__FILE__": Closed curve made periodic" << endl;
//#endif
}
return Standard_True;
}

View File

@@ -0,0 +1,21 @@
-- File: StepToGeom_MakeBSplineCurve2d.cdl
-- Created: Tue Jul 6 12:11:06 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeBSplineCurve2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- BSplineCurve from StepGeom and BSplineCurve from Geom2d
uses
BSplineCurve from Geom2d,
BSplineCurve from StepGeom
is
Convert ( myclass; SC : BSplineCurve from StepGeom;
CC : out BSplineCurve from Geom2d)
returns Boolean from Standard;
end MakeBSplineCurve2d;

View File

@@ -0,0 +1,46 @@
// File: StepToGeom_MakeBSplineCurve2d.cxx
// Created: Fri Jul 2 15:43:42 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeBSplineCurve2d.ixx>
#include <gp_Pnt2d.hxx>
#include <StepGeom_HArray1OfCartesianPoint.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <StepGeom_BSplineCurveWithKnots.hxx>
#include <StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepToGeom_MakeCartesianPoint2d.hxx>
#include <Geom2d_CartesianPoint.hxx>
//=============================================================================
// Creation d' une BSplineCurve de Geom2d a partir d' une
// BSplineCurveWithKnotsAndRationalBSplineCurve de Step
//=============================================================================
#define Array1OfPnt_gen TColgp_Array1OfPnt2d
#define Pnt_gen gp_Pnt2d
#define CartesianPoint_gen Handle(Geom2d_CartesianPoint)
#define StepToGeom_MakeCartesianPoint_gen StepToGeom_MakeCartesianPoint2d
#define Pnt_fonc Pnt2d
#define BSplineCurve_gen Geom2d_BSplineCurve
#define BSplineCurve_retour Handle(Geom2d_BSplineCurve)
#define StepToGeom_MakeBSplineCurve_gen StepToGeom_MakeBSplineCurve2d
Standard_Boolean StepToGeom_MakeBSplineCurve2d::Convert
(const Handle(StepGeom_BSplineCurve)& SC,
Handle(Geom2d_BSplineCurve)& CC)
#include <StepToGeom_MakeBSplineCurve.pxx>
#undef Array1OfPnt_gen
#undef Pnt_gen
#undef CartesianPoint_gen
#undef StepToGeom_MakeCartesianPoint_gen
#undef Pnt_fonc
#undef BSplineCurve_gen
#undef StepToGeom_MakeBSplineCurve_gen
#undef BSplineCurve_retour

View File

@@ -0,0 +1,21 @@
-- File: StepToGeom_BSplineSurface.cdl
-- Created: Tue Jun 22 10:33:07 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeBSplineSurface from StepToGeom
---Purpose: This class implements the mapping between classes
-- BSplineSurface from StepGeom
-- and class BSplineSurface from Geom
uses BSplineSurface from Geom,
BSplineSurface from StepGeom
is
Convert ( myclass; SS : BSplineSurface from StepGeom;
CS : out BSplineSurface from Geom)
returns Boolean from Standard;
end MakeBSplineSurface;

View File

@@ -0,0 +1,151 @@
// File: StepToGeom_MakeBSplineSurface.cxx
// Created: Fri Jul 2 12:05:11 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeBSplineSurface.ixx>
#include <StepGeom_BSplineSurfaceWithKnots.hxx>
#include <StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray2OfReal.hxx>
#include <StepGeom_HArray2OfCartesianPoint.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepToGeom_MakeCartesianPoint.hxx>
#include <Geom_CartesianPoint.hxx>
#include <gp_Pnt.hxx>
//=============================================================================
// Creation d' une BSplineSurface de Geom a partir d' une
// BSplineSurface de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeBSplineSurface::Convert
(const Handle(StepGeom_BSplineSurface)& SS,
Handle(Geom_BSplineSurface)& CS)
{
Standard_Integer i, j;
Handle(StepGeom_BSplineSurfaceWithKnots) BS;
Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BSR;
if (SS->
IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface))) {
BSR =
Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)
::DownCast(SS);
BS =
Handle(StepGeom_BSplineSurfaceWithKnots)
::DownCast(BSR->BSplineSurfaceWithKnots());
}
else
BS = Handle(StepGeom_BSplineSurfaceWithKnots)::DownCast(SS);
const Standard_Integer UDeg = BS->UDegree();
const Standard_Integer VDeg = BS->VDegree();
const Standard_Integer NUPoles = BS->NbControlPointsListI();
const Standard_Integer NVPoles = BS->NbControlPointsListJ();
const Handle(StepGeom_HArray2OfCartesianPoint)& aControlPointsList = BS->ControlPointsList();
Handle(Geom_CartesianPoint) P;
TColgp_Array2OfPnt Poles(1,NUPoles,1,NVPoles);
for (i=1; i<=NUPoles; i++) {
for (j=1; j<=NVPoles; j++) {
if (StepToGeom_MakeCartesianPoint::Convert(aControlPointsList->Value(i,j),P))
Poles.SetValue(i,j,P->Pnt());
else
return Standard_False;
}
}
const Standard_Integer NUKnots = BS->NbUMultiplicities();
const Handle(TColStd_HArray1OfInteger)& aUMultiplicities = BS->UMultiplicities();
TColStd_Array1OfInteger UMult(1,NUKnots);
for (i=1; i<=NUKnots; i++) {
UMult.SetValue(i,aUMultiplicities->Value(i));
}
const Standard_Integer NVKnots = BS->NbVMultiplicities();
const Handle(TColStd_HArray1OfInteger)& aVMultiplicities = BS->VMultiplicities();
TColStd_Array1OfInteger VMult(1,NVKnots);
for (i=1; i<=NVKnots; i++) {
VMult.SetValue(i,aVMultiplicities->Value(i));
}
const Handle(TColStd_HArray1OfReal)& aUKnots = BS->UKnots();
TColStd_Array1OfReal KUn(1,NUKnots);
for (i=1; i<=NUKnots; i++) {
KUn.SetValue(i,aUKnots->Value(i));
}
const Handle(TColStd_HArray1OfReal)& aVKnots = BS->VKnots();
TColStd_Array1OfReal KVn(1,NVKnots);
for (i=1; i<=NVKnots; i++) {
KVn.SetValue(i,aVKnots->Value(i));
}
// --- Does the Surface Descriptor LOOKS like a U and/or V Periodic ---
// --- Descriptor ? ---
// --- U Periodic ? ---
Standard_Integer SumMult = 0;
for (i=1; i<=NUKnots; i++) {
SumMult += aUMultiplicities->Value(i);
}
Standard_Boolean shouldBeUPeriodic = Standard_False;
if (SumMult == (NUPoles + UDeg + 1)) {
//shouldBeUPeriodic = Standard_False;
}
else if ((aUMultiplicities->Value(1) ==
aUMultiplicities->Value(NUKnots)) &&
((SumMult - aUMultiplicities->Value(1))== NUPoles)) {
shouldBeUPeriodic = Standard_True;
}
/*else { // --- What is that ??? ---
shouldBeUPeriodic = Standard_False;
#ifdef DEBUG
cout << "Strange BSpline Surface Descriptor" << endl;
#endif
}*/
// --- V Periodic ? ---
SumMult = 0;
for (i=1; i<=NVKnots; i++) {
SumMult += aVMultiplicities->Value(i);
}
Standard_Boolean shouldBeVPeriodic = Standard_False;
if (SumMult == (NVPoles + VDeg + 1)) {
//shouldBeVPeriodic = Standard_False;
}
else if ((aVMultiplicities->Value(1) ==
aVMultiplicities->Value(NVKnots)) &&
((SumMult - aVMultiplicities->Value(1)) == NVPoles)) {
shouldBeVPeriodic = Standard_True;
}
/*else { // --- What is that ??? ---
shouldBeVPeriodic = Standard_False;
#ifdef DEBUG
cout << "Strange BSpline Surface Descriptor" << endl;
#endif
}*/
if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface))) {
const Handle(TColStd_HArray2OfReal)& aWeight = BSR->WeightsData();
TColStd_Array2OfReal W(1,NUPoles,1,NVPoles);
for (i=1; i<=NUPoles; i++) {
for (j=1; j<=NVPoles; j++) {
W.SetValue(i,j,aWeight->Value(i,j));
}
}
CS = new Geom_BSplineSurface(Poles, W, KUn, KVn, UMult,
VMult, UDeg, VDeg,
shouldBeUPeriodic,
shouldBeVPeriodic);
}
else
CS = new Geom_BSplineSurface(Poles, KUn, KVn, UMult,
VMult, UDeg, VDeg,
shouldBeUPeriodic,
shouldBeVPeriodic);
return Standard_True;
}

View File

@@ -0,0 +1,24 @@
-- File: StepToGeom_MakeBoundedCurve.cdl
-- Created: Mon Jun 21 11:31:39 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeBoundedCurve from StepToGeom
---Purpose: This class implements the mapping between classes
-- BoundedCurve from
-- StepGeom which describes a BoundedCurve from
-- prostep and BoundedCurve from Geom.
-- As BoundedCurve is an abstract BoundedCurve this class
-- is an access to the sub-class required.
uses BoundedCurve from Geom,
BoundedCurve from StepGeom
is
Convert ( myclass; SC : BoundedCurve from StepGeom;
CC : out BoundedCurve from Geom )
returns Boolean from Standard;
end MakeBoundedCurve;

View File

@@ -0,0 +1,170 @@
// File: StepToGeom_MakeBoundedCurve.cxx
// Created: Fri Jul 2 12:34:13 1993
// Author: Martine LANGLOIS
//:n6 abv 15.02.99: S4132: adding translation of polyline
//:p0 abv 19.02.99: management of 'done' flag improved; trimmed_curve treated
#include <StepToGeom_MakeBoundedCurve.ixx>
#include <StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
#include <StepGeom_BSplineCurveWithKnots.hxx>
#include <StepGeom_BezierCurve.hxx>
#include <StepGeom_UniformCurve.hxx>
#include <StepGeom_UniformCurveAndRationalBSplineCurve.hxx>
#include <StepGeom_QuasiUniformCurve.hxx>
#include <StepGeom_QuasiUniformCurveAndRationalBSplineCurve.hxx>
#include <StepGeom_Polyline.hxx>
#include <StepGeom_TrimmedCurve.hxx>
#include <StepGeom_KnotType.hxx>
#include <StepToGeom_MakeBSplineCurve.hxx>
#include <StepGeom_Polyline.hxx>
#include <StepToGeom_MakePolyline.hxx>
#include <StepToGeom_MakeTrimmedCurve.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
//=============================================================================
// Creation d' une BoundedCurve de Geom a partir d' une BoundedCurve de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeBoundedCurve::Convert
(const Handle(StepGeom_BoundedCurve)& SC,
Handle(Geom_BoundedCurve)& CC)
{
if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) {
const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)
Bspli = Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC);
return StepToGeom_MakeBSplineCurve::Convert(Bspli,*((Handle(Geom_BSplineCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnots))) {
const Handle(StepGeom_BSplineCurveWithKnots)
Bspli = Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC);
return StepToGeom_MakeBSplineCurve::Convert(Bspli,*((Handle(Geom_BSplineCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) {
const Handle(StepGeom_TrimmedCurve) L = Handle(StepGeom_TrimmedCurve)::DownCast(SC);
return StepToGeom_MakeTrimmedCurve::Convert(L,*((Handle(Geom_TrimmedCurve)*)&CC));
}
// STEP BezierCurve, UniformCurve and QuasiUniformCurve are transformed into
// STEP BSplineCurve before being mapped onto CAS.CADE/SF
if (SC->IsKind(STANDARD_TYPE(StepGeom_BezierCurve))) {
const Handle(StepGeom_BezierCurve) BzC = Handle(StepGeom_BezierCurve)::DownCast(SC);
const Handle(StepGeom_BSplineCurveWithKnots) BSPL = new StepGeom_BSplineCurveWithKnots;
BSPL->SetDegree(BzC->Degree());
BSPL->SetControlPointsList(BzC->ControlPointsList());
BSPL->SetCurveForm(BzC->CurveForm());
BSPL->SetClosedCurve(BzC->ClosedCurve());
BSPL->SetSelfIntersect(BzC->SelfIntersect());
// Compute Knots and KnotsMultiplicity
const Handle(TColStd_HArray1OfInteger) Kmult = new TColStd_HArray1OfInteger(1,2);
const Handle(TColStd_HArray1OfReal) Knots = new TColStd_HArray1OfReal(1,2);
Kmult->SetValue(1, BzC->Degree() + 1);
Kmult->SetValue(2, BzC->Degree() + 1);
Knots->SetValue(1, 0.);
Knots->SetValue(2, 1.);
BSPL->SetKnotMultiplicities(Kmult);
BSPL->SetKnots(Knots);
return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurve))) {
//#ifdef DEBUG
// cout << "Warning : converting UniformCurve onto BSplineCurveWithKnots" << endl;
//#endif
const Handle(StepGeom_UniformCurve) UC = Handle(StepGeom_UniformCurve)::DownCast(SC);
const Handle(StepGeom_BSplineCurveWithKnots) BSPL = new StepGeom_BSplineCurveWithKnots;
BSPL->SetDegree(UC->Degree());
BSPL->SetControlPointsList(UC->ControlPointsList());
BSPL->SetCurveForm(UC->CurveForm());
BSPL->SetClosedCurve(UC->ClosedCurve());
BSPL->SetSelfIntersect(UC->SelfIntersect());
// Compute Knots and KnotsMultiplicity
const Standard_Integer nbK = BSPL->NbControlPointsList() + BSPL->Degree() + 1;
const Handle(TColStd_HArray1OfInteger) Kmult = new TColStd_HArray1OfInteger(1,nbK);
const Handle(TColStd_HArray1OfReal) Knots = new TColStd_HArray1OfReal(1,nbK);
for (Standard_Integer iUC = 1 ; iUC <= nbK ; iUC ++) {
Kmult->SetValue(iUC, 1);
Knots->SetValue(iUC, iUC - 1.);
}
BSPL->SetKnotMultiplicities(Kmult);
BSPL->SetKnots(Knots);
return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurve))) {
//#ifdef DEBUG
// cout << "Warning : converting QuasiUniformCurve onto BSplineCurveWithKnots" << endl;
//#endif
const Handle(StepGeom_QuasiUniformCurve) QUC =
Handle(StepGeom_QuasiUniformCurve)::DownCast(SC);
const Handle(StepGeom_BSplineCurveWithKnots) BSPL = new StepGeom_BSplineCurveWithKnots;
BSPL->SetDegree(QUC->Degree());
BSPL->SetControlPointsList(QUC->ControlPointsList());
BSPL->SetCurveForm(QUC->CurveForm());
BSPL->SetClosedCurve(QUC->ClosedCurve());
BSPL->SetSelfIntersect(QUC->SelfIntersect());
// Compute Knots and KnotsMultiplicity
const Standard_Integer nbK = BSPL->NbControlPointsList() - BSPL->Degree() + 1;
const Handle(TColStd_HArray1OfInteger) Kmult = new TColStd_HArray1OfInteger(1,nbK);
const Handle(TColStd_HArray1OfReal) Knots = new TColStd_HArray1OfReal(1,nbK);
for (Standard_Integer iQUC = 1 ; iQUC <= nbK ; iQUC ++) {
Kmult->SetValue(iQUC, 1);
Knots->SetValue(iQUC, iQUC - 1.);
}
Kmult->SetValue(1, BSPL->Degree() + 1);
Kmult->SetValue(nbK, BSPL->Degree() + 1);
BSPL->SetKnotMultiplicities(Kmult);
BSPL->SetKnots(Knots);
return StepToGeom_MakeBSplineCurve::Convert(BSPL,*((Handle(Geom_BSplineCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurveAndRationalBSplineCurve))) {
//#ifdef DEBUG
// cout << "Warning : converting Rational UniformCurve onto BSplineCurveWithKnots" << endl;
//#endif
const Handle(StepGeom_UniformCurveAndRationalBSplineCurve) RUC =
Handle(StepGeom_UniformCurveAndRationalBSplineCurve)::DownCast(SC);
const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) RBSPL =
new StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve;
// Compute Knots and KnotsMultiplicity
const Standard_Integer nbK = RUC->NbControlPointsList() + RUC->Degree() + 1;
const Handle(TColStd_HArray1OfInteger) Kmult = new TColStd_HArray1OfInteger(1,nbK);
const Handle(TColStd_HArray1OfReal) Knots = new TColStd_HArray1OfReal(1,nbK);
for (Standard_Integer iUC = 1 ; iUC <= nbK ; iUC ++) {
Kmult->SetValue(iUC, 1);
Knots->SetValue(iUC, iUC - 1.);
}
// Initialize the BSplineCurveWithKnotsAndRationalBSplineCurve
RBSPL->Init(RUC->Name(), RUC->Degree(), RUC->ControlPointsList(), RUC->CurveForm(),
RUC->ClosedCurve(), RUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified,
RUC->WeightsData());
return StepToGeom_MakeBSplineCurve::Convert(RBSPL,*((Handle(Geom_BSplineCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurveAndRationalBSplineCurve))) {
//#ifdef DEBUG
// cout << "Warning : converting Rational QuasiUniformCurve onto BSplineCurveWithKnots" << endl;
//#endif
const Handle(StepGeom_QuasiUniformCurveAndRationalBSplineCurve) RQUC =
Handle(StepGeom_QuasiUniformCurveAndRationalBSplineCurve)::DownCast(SC);
const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) RBSPL =
new StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve;
// Compute Knots and KnotsMultiplicity
const Standard_Integer nbK = RQUC->NbControlPointsList() - RQUC->Degree() + 1;
const Handle(TColStd_HArray1OfInteger) Kmult = new TColStd_HArray1OfInteger(1,nbK);
const Handle(TColStd_HArray1OfReal) Knots = new TColStd_HArray1OfReal(1,nbK);
for (Standard_Integer iRQUC = 1 ; iRQUC <= nbK ; iRQUC ++) {
Kmult->SetValue(iRQUC, 1);
Knots->SetValue(iRQUC, iRQUC - 1.);
}
Kmult->SetValue(1, RQUC->Degree() + 1);
Kmult->SetValue(nbK, RQUC->Degree() + 1);
// Initialize the BSplineCurveWithKnotsAndRationalBSplineCurve
RBSPL->Init(RQUC->Name(), RQUC->Degree(), RQUC->ControlPointsList(), RQUC->CurveForm(),
RQUC->ClosedCurve(), RQUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified,
RQUC->WeightsData());
return StepToGeom_MakeBSplineCurve::Convert(RBSPL,*((Handle(Geom_BSplineCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_Polyline))) { //:n6 abv 15 Feb 99
const Handle(StepGeom_Polyline) PL = Handle(StepGeom_Polyline)::DownCast (SC);
return StepToGeom_MakePolyline::Convert(PL,*((Handle(Geom_BSplineCurve)*)&CC));
}
return Standard_False;
}

View File

@@ -0,0 +1,24 @@
-- File: StepToGeom_MakeBoundedCurve2d.cdl
-- Created: Wed Aug 4 11:06:25 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeBoundedCurve2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- BoundedCurve from
-- StepGeom which describes a BoundedCurve from
-- prostep and BoundedCurve from Geom2d.
-- As BoundedCurve is an abstract BoundedCurve this class
-- is an access to the sub-class required.
uses BoundedCurve from Geom2d,
BoundedCurve from StepGeom
is
Convert ( myclass; SC : BoundedCurve from StepGeom;
CC : out BoundedCurve from Geom2d )
returns Boolean from Standard;
end MakeBoundedCurve2d;

View File

@@ -0,0 +1,41 @@
// File: StepToGeom_MakeBoundedCurve2d.cxx
// Created: Wed Aug 4 11:08:11 1993
// Author: Martine LANGLOIS
//:n6 abv 15.02.99: S4132: adding translation of polyline
//:p0 abv 19.02.99: management of 'done' flag improved
#include <StepToGeom_MakeBoundedCurve2d.ixx>
#include <StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
#include <StepGeom_BSplineCurveWithKnots.hxx>
#include <StepGeom_TrimmedCurve.hxx>
#include <StepToGeom_MakeTrimmedCurve2d.hxx>
#include <StepToGeom_MakeBSplineCurve2d.hxx>
#include <StepGeom_Polyline.hxx>
#include <StepToGeom_MakePolyline2d.hxx>
//=============================================================================
// Creation d' une BoundedCurve de Geom a partir d' une BoundedCurve de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeBoundedCurve2d::Convert (const Handle(StepGeom_BoundedCurve)& SC, Handle(Geom2d_BoundedCurve)& CC)
{
if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) {
const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)
Bspli = Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC);
return StepToGeom_MakeBSplineCurve2d::Convert(Bspli,*((Handle(Geom2d_BSplineCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnots))) {
const Handle(StepGeom_BSplineCurveWithKnots)
Bspli = Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC);
return StepToGeom_MakeBSplineCurve2d::Convert(Bspli,*((Handle(Geom2d_BSplineCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) {
const Handle(StepGeom_TrimmedCurve) TC = Handle(StepGeom_TrimmedCurve)::DownCast(SC);
return StepToGeom_MakeTrimmedCurve2d::Convert(TC,*((Handle(Geom2d_BSplineCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_Polyline))) { //:n6 abv 15 Feb 99
const Handle(StepGeom_Polyline) PL = Handle(StepGeom_Polyline)::DownCast(SC);
return StepToGeom_MakePolyline2d::Convert(PL,*((Handle(Geom2d_BSplineCurve)*)&CC));
}
return Standard_False;
}

View File

@@ -0,0 +1,24 @@
-- File: StepToGeom_MakeBoundedSurface.cdl
-- Created: Tue Jun 22 12:37:10 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeBoundedSurface from StepToGeom
---Purpose: This class implements the mapping between classes
-- BoundedSurface from
-- StepGeom which describes a BoundedSurface from
-- prostep and the class BoundedSurface from Geom.
-- As BoundedSurface is an abstract BoundedSurface this class
-- is an access to the sub-class required.
uses BoundedSurface from Geom,
BoundedSurface from StepGeom
is
Convert ( myclass; SS : BoundedSurface from StepGeom;
CS : out BoundedSurface from Geom )
returns Boolean from Standard;
end MakeBoundedSurface;

View File

@@ -0,0 +1,245 @@
// File: StepToGeom_MakeBoundedSurface.cxx
// Created: Fri Jul 2 16:04:19 1993
// Author: Martine LANGLOIS
//:p0 abv 19.02.99: management of 'done' flag improved
//:j7 abv 05.04.99: S4136: ass-tol2.stp #9861: avoid using CheckSurfaceClosure
// rln 02.06.99 removing #include <StepToGeom_CheckSurfaceClosure.hxx>
#include <StepToGeom_MakeBoundedSurface.ixx>
#include <Geom_BSplineSurface.hxx>
//rln 02.06.99 #include <StepToGeom_CheckSurfaceClosure.hxx>
#include <StepToGeom_MakeBoundedSurface.hxx>
#include <StepToGeom_MakeBSplineSurface.hxx>
#include <StepToGeom_MakeRectangularTrimmedSurface.hxx>
#include <StepGeom_RectangularTrimmedSurface.hxx>
#include <StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
#include <StepGeom_BSplineSurfaceWithKnots.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <StepGeom_BezierSurface.hxx>
#include <StepGeom_UniformSurface.hxx>
#include <StepGeom_QuasiUniformSurface.hxx>
#include <StepGeom_UniformSurfaceAndRationalBSplineSurface.hxx>
#include <StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface.hxx>
#include <StepGeom_KnotType.hxx>
//=============================================================================
// Creation d' une BoundedSurface de Geom a partir d' une BoundedSurface
// de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeBoundedSurface::Convert (const Handle(StepGeom_BoundedSurface)& SS, Handle(Geom_BoundedSurface)& CS)
{
if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface))) {
const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BS =
Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)::DownCast(SS);
return StepToGeom_MakeBSplineSurface::Convert(BS,*((Handle(Geom_BSplineSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnots))) {
const Handle(StepGeom_BSplineSurfaceWithKnots) BS
= Handle(StepGeom_BSplineSurfaceWithKnots)::DownCast(SS);
return StepToGeom_MakeBSplineSurface::Convert(BS,*((Handle(Geom_BSplineSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_RectangularTrimmedSurface))) {
const Handle(StepGeom_RectangularTrimmedSurface) Sur =
Handle(StepGeom_RectangularTrimmedSurface)::DownCast(SS);
return StepToGeom_MakeRectangularTrimmedSurface::Convert(Sur,*((Handle(Geom_RectangularTrimmedSurface)*)&CS));
}
// STEP BezierSurface, UniformSurface and QuasiUniformSurface are transformed
// into STEP BSplineSurface before being mapped onto CAS.CADE/SF
if (SS->IsKind(STANDARD_TYPE(StepGeom_BezierSurface))) {
const Handle(StepGeom_BezierSurface) BzS = Handle(StepGeom_BezierSurface)::DownCast(SS);
const Handle(StepGeom_BSplineSurfaceWithKnots) BSPL = new StepGeom_BSplineSurfaceWithKnots;
BSPL->SetUDegree(BzS->UDegree());
BSPL->SetVDegree(BzS->VDegree());
BSPL->SetControlPointsList(BzS->ControlPointsList());
BSPL->SetSurfaceForm(BzS->SurfaceForm());
BSPL->SetUClosed(BzS->UClosed());
BSPL->SetVClosed(BzS->VClosed());
BSPL->SetSelfIntersect(BzS->SelfIntersect());
// Compute Knots and KnotsMultiplicity
const Handle(TColStd_HArray1OfInteger) UKmult = new TColStd_HArray1OfInteger(1,2);
const Handle(TColStd_HArray1OfInteger) VKmult = new TColStd_HArray1OfInteger(1,2);
const Handle(TColStd_HArray1OfReal) UKnots = new TColStd_HArray1OfReal(1,2);
const Handle(TColStd_HArray1OfReal) VKnots = new TColStd_HArray1OfReal(1,2);
UKmult->SetValue(1, BzS->UDegree() + 1);
UKmult->SetValue(2, BzS->UDegree() + 1);
VKmult->SetValue(1, BzS->VDegree() + 1);
VKmult->SetValue(2, BzS->VDegree() + 1);
UKnots->SetValue(1, 0.);
UKnots->SetValue(2, 1.);
VKnots->SetValue(1, 0.);
VKnots->SetValue(2, 1.);
BSPL->SetUMultiplicities(UKmult);
BSPL->SetVMultiplicities(VKmult);
BSPL->SetUKnots(UKnots);
BSPL->SetVKnots(VKnots);
return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurface))) {
//#ifdef DEBUG
// cout << "Warning : converting UniformSurface onto BSplineSurfaceWithKnots" << endl;
//#endif
const Handle(StepGeom_UniformSurface) US = Handle(StepGeom_UniformSurface)::DownCast(SS);
const Handle(StepGeom_BSplineSurfaceWithKnots) BSPL = new StepGeom_BSplineSurfaceWithKnots;
BSPL->SetUDegree(US->UDegree());
BSPL->SetVDegree(US->VDegree());
BSPL->SetControlPointsList(US->ControlPointsList());
BSPL->SetSurfaceForm(US->SurfaceForm());
BSPL->SetUClosed(US->UClosed());
BSPL->SetVClosed(US->VClosed());
BSPL->SetSelfIntersect(US->SelfIntersect());
// Compute Knots and KnotsMultiplicity for U Direction
const Standard_Integer nbKU = BSPL->NbControlPointsListI() + BSPL->UDegree() + 1;
const Handle(TColStd_HArray1OfInteger) UKmult = new TColStd_HArray1OfInteger(1,nbKU);
const Handle(TColStd_HArray1OfReal) UKnots = new TColStd_HArray1OfReal(1,nbKU);
for (Standard_Integer iU = 1 ; iU <= nbKU ; iU ++) {
UKmult->SetValue(iU, 1);
UKnots->SetValue(iU, iU - 1.);
}
BSPL->SetUMultiplicities(UKmult);
BSPL->SetUKnots(UKnots);
// Compute Knots and KnotsMultiplicity for V Direction
const Standard_Integer nbKV = BSPL->NbControlPointsListJ() + BSPL->VDegree() + 1;
const Handle(TColStd_HArray1OfInteger) VKmult = new TColStd_HArray1OfInteger(1,nbKV);
const Handle(TColStd_HArray1OfReal) VKnots = new TColStd_HArray1OfReal(1,nbKV);
for (Standard_Integer iV = 1 ; iV <= nbKV ; iV ++) {
VKmult->SetValue(iV, 1);
VKnots->SetValue(iV, iV - 1.);
}
BSPL->SetVMultiplicities(VKmult);
BSPL->SetVKnots(VKnots);
return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurface))) {
//#ifdef DEBUG
// cout << "Warning : converting QuasiUniformSurface onto BSplineSurfaceWithKnots" << endl;
//#endif
const Handle(StepGeom_QuasiUniformSurface) QUS =
Handle(StepGeom_QuasiUniformSurface)::DownCast(SS);
const Handle(StepGeom_BSplineSurfaceWithKnots) BSPL = new StepGeom_BSplineSurfaceWithKnots;
BSPL->SetUDegree(QUS->UDegree());
BSPL->SetVDegree(QUS->VDegree());
BSPL->SetControlPointsList(QUS->ControlPointsList());
BSPL->SetSurfaceForm(QUS->SurfaceForm());
BSPL->SetUClosed(QUS->UClosed());
BSPL->SetVClosed(QUS->VClosed());
BSPL->SetSelfIntersect(QUS->SelfIntersect());
// Compute Knots and KnotsMultiplicity for U Direction
const Standard_Integer nbKU = BSPL->NbControlPointsListI() - BSPL->UDegree() + 1;
const Handle(TColStd_HArray1OfInteger) UKmult = new TColStd_HArray1OfInteger(1,nbKU);
const Handle(TColStd_HArray1OfReal) UKnots = new TColStd_HArray1OfReal(1,nbKU);
for (Standard_Integer iU = 1 ; iU <= nbKU ; iU ++) {
UKmult->SetValue(iU, 1);
UKnots->SetValue(iU, iU - 1.);
}
UKmult->SetValue(1, BSPL->UDegree() + 1);
UKmult->SetValue(nbKU, BSPL->UDegree() + 1);
BSPL->SetUMultiplicities(UKmult);
BSPL->SetUKnots(UKnots);
// Compute Knots and KnotsMultiplicity for V Direction
const Standard_Integer nbKV = BSPL->NbControlPointsListJ() - BSPL->VDegree() + 1;
const Handle(TColStd_HArray1OfInteger) VKmult = new TColStd_HArray1OfInteger(1,nbKV);
const Handle(TColStd_HArray1OfReal) VKnots = new TColStd_HArray1OfReal(1,nbKV);
for (Standard_Integer iV = 1 ; iV <= nbKV ; iV ++) {
VKmult->SetValue(iV, 1);
VKnots->SetValue(iV, iV - 1.);
}
VKmult->SetValue(1, BSPL->VDegree() + 1);
VKmult->SetValue(nbKV, BSPL->VDegree() + 1);
BSPL->SetVMultiplicities(VKmult);
BSPL->SetVKnots(VKnots);
return StepToGeom_MakeBSplineSurface::Convert(BSPL,*((Handle(Geom_BSplineSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurfaceAndRationalBSplineSurface))) {
//#ifdef DEBUG
// cout << "Warning : converting Rational UniformSurface onto BSplineSurfaceWithKnots" << endl;
//#endif
const Handle(StepGeom_UniformSurfaceAndRationalBSplineSurface) RUS =
Handle(StepGeom_UniformSurfaceAndRationalBSplineSurface)::DownCast(SS);
const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) RBSPL =
new StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface;
// Compute Knots and KnotsMultiplicity for U Direction
const Standard_Integer nbKU = RUS->NbControlPointsListI() + RUS->UDegree() + 1;
const Handle(TColStd_HArray1OfInteger) UKmult = new TColStd_HArray1OfInteger(1,nbKU);
const Handle(TColStd_HArray1OfReal) UKnots = new TColStd_HArray1OfReal(1,nbKU);
for (Standard_Integer iU = 1 ; iU <= nbKU ; iU ++) {
UKmult->SetValue(iU, 1);
UKnots->SetValue(iU, iU - 1.);
}
// Compute Knots and KnotsMultiplicity for V Direction
const Standard_Integer nbKV = RUS->NbControlPointsListJ() + RUS->VDegree() + 1;
const Handle(TColStd_HArray1OfInteger) VKmult = new TColStd_HArray1OfInteger(1,nbKV);
const Handle(TColStd_HArray1OfReal) VKnots = new TColStd_HArray1OfReal(1,nbKV);
for (Standard_Integer iV = 1 ; iV <= nbKV ; iV ++) {
VKmult->SetValue(iV, 1);
VKnots->SetValue(iV, iV - 1.);
}
// Initialize the BSplineSurfaceWithKnotsAndRationalBSplineSurface
RBSPL->Init(RUS->Name(), RUS->UDegree(), RUS->VDegree(),
RUS->ControlPointsList(), RUS->SurfaceForm(),
RUS->UClosed(), RUS->VClosed(), RUS->SelfIntersect(),
UKmult, VKmult, UKnots, VKnots, StepGeom_ktUnspecified,
RUS->WeightsData());
return StepToGeom_MakeBSplineSurface::Convert(RBSPL,*((Handle(Geom_BSplineSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface))) {
//#ifdef DEBUG
// cout << "Warning : converting Rational QuasiUniformSurface onto BSplineSurfaceWithKnots" << endl;
//#endif
const Handle(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface) RQUS =
Handle(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface)::DownCast(SS);
const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) RBSPL =
new StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface;
// Compute Knots and KnotsMultiplicity for U Direction
const Standard_Integer nbKU = RQUS->NbControlPointsListI() - RQUS->UDegree() + 1;
const Handle(TColStd_HArray1OfInteger) UKmult = new TColStd_HArray1OfInteger(1,nbKU);
const Handle(TColStd_HArray1OfReal) UKnots = new TColStd_HArray1OfReal(1,nbKU);
for (Standard_Integer iU = 1 ; iU <= nbKU ; iU ++) {
UKmult->SetValue(iU, 1);
UKnots->SetValue(iU, iU - 1.);
}
UKmult->SetValue(1, RQUS->UDegree() + 1);
UKmult->SetValue(nbKU, RQUS->UDegree() + 1);
// Compute Knots and KnotsMultiplicity for V Direction
const Standard_Integer nbKV = RQUS->NbControlPointsListJ() - RQUS->VDegree() + 1;
const Handle(TColStd_HArray1OfInteger) VKmult = new TColStd_HArray1OfInteger(1,nbKV);
const Handle(TColStd_HArray1OfReal) VKnots = new TColStd_HArray1OfReal(1,nbKV);
for (Standard_Integer iV = 1 ; iV <= nbKV ; iV ++) {
VKmult->SetValue(iV, 1);
VKnots->SetValue(iV, iV - 1.);
}
VKmult->SetValue(1, RQUS->VDegree() + 1);
VKmult->SetValue(nbKV, RQUS->VDegree() + 1);
// Initialize the BSplineSurfaceWithKnotsAndRationalBSplineSurface
RBSPL->Init(RQUS->Name(), RQUS->UDegree(), RQUS->VDegree(), RQUS->ControlPointsList(),
RQUS->SurfaceForm(), RQUS->UClosed(), RQUS->VClosed(),
RQUS->SelfIntersect(), UKmult, VKmult, UKnots, VKnots, StepGeom_ktUnspecified,
RQUS->WeightsData());
return StepToGeom_MakeBSplineSurface::Convert(RBSPL,*((Handle(Geom_BSplineSurface)*)&CS));
}
/* //:S4136: ass-tol2.stp #9861
// UPDATE FMA 15-03-96
// For BSplineSurface, the surface could be U and/or VClosed within the
// file tolerance. In this case, the closure flag is enforced
if (done && //:i6
theBoundedSurface->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) {
Handle(Geom_BSplineSurface) theBSP =
Handle(Geom_BSplineSurface)::DownCast(theBoundedSurface);
if (!theBSP->IsURational() &&
!theBSP->IsVRational()) {
StepToGeom_CheckSurfaceClosure CheckClose(theBSP);
theBoundedSurface = CheckClose.Surface();
}
}
*/
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeCartesianPoint.cdl
-- Created: Fri Jun 11 18:43:50 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeCartesianPoint from StepToGeom
---Purpose: This class implements the mapping between classes
-- CartesianPoint from StepGeom which describes a point from
-- Prostep and CartesianPoint from Geom.
uses
CartesianPoint from Geom,
CartesianPoint from StepGeom
is
Convert ( myclass; SP : CartesianPoint from StepGeom;
CP : out CartesianPoint from Geom )
returns Boolean from Standard;
end MakeCartesianPoint;

View File

@@ -0,0 +1,27 @@
// File: StepToGeom_MakeCartesianPoint.cxx
// Created: Fri Jul 2 16:09:46 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeCartesianPoint.ixx>
#include <StepGeom_CartesianPoint.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' un CartesianPoint de Geom a partir d' un CartesianPoint de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeCartesianPoint::Convert
(const Handle(StepGeom_CartesianPoint)& SP,
Handle(Geom_CartesianPoint)& CP)
{
if (SP->NbCoordinates() == 3)
{
const Standard_Real LF = UnitsMethods::LengthFactor();
const Standard_Real X = SP->CoordinatesValue(1) * LF;
const Standard_Real Y = SP->CoordinatesValue(2) * LF;
const Standard_Real Z = SP->CoordinatesValue(3) * LF;
CP = new Geom_CartesianPoint(X, Y, Z);
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeCartesianPoint2d.cdl
-- Created: Tue Jul 6 16:30:29 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeCartesianPoint2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- CartesianPoint from StepGeom which describes a point from
-- Prostep and CartesianPoint from Geom2d.
uses
CartesianPoint from Geom2d,
CartesianPoint from StepGeom
is
Convert ( myclass; SP : CartesianPoint from StepGeom;
CP : out CartesianPoint from Geom2d )
returns Boolean from Standard;
end MakeCartesianPoint2d;

View File

@@ -0,0 +1,26 @@
// File: StepToGeom_MakeCartesianPoint2d.cxx
// Created: Fri Jul 2 16:21:08 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeCartesianPoint2d.ixx>
#include <StepGeom_CartesianPoint.hxx>
#include <Geom2d_CartesianPoint.hxx>
//=============================================================================
// Creation d' un CartesianPoint de Geom2d a partir d' un CartesianPoint de
// Step
//=============================================================================
Standard_Boolean StepToGeom_MakeCartesianPoint2d::Convert
(const Handle(StepGeom_CartesianPoint)& SP,
Handle(Geom2d_CartesianPoint)& CP)
{
if (SP->NbCoordinates() == 2)
{
const Standard_Real X = SP->CoordinatesValue(1);
const Standard_Real Y = SP->CoordinatesValue(2);
CP = new Geom2d_CartesianPoint(X, Y);
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeCircle.cdl
-- Created: Mon Jun 14 15:18:28 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeCircle from StepToGeom
---Purpose: This class implements the mapping between classes
-- Circle from StepGeom which describes a circle from
-- Prostep and Circle from Geom.
uses
Circle from Geom,
Circle from StepGeom
is
Convert ( myclass; SC : Circle from StepGeom;
CC : out Circle from Geom )
returns Boolean from Standard;
end MakeCircle;

View File

@@ -0,0 +1,33 @@
// File: StepToGeom_MakeCircle.cxx
// Created: Fri Jul 2 16:37:06 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeCircle.ixx>
#include <StepGeom_Circle.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <Geom_Axis2Placement.hxx>
#include <StepToGeom_MakeAxis2Placement.hxx>
#include <gp_Ax2.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' un Circle de Geom a partir d' un Circle de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeCircle::Convert
(const Handle(StepGeom_Circle)& SC,
Handle(Geom_Circle)& CC)
{
const StepGeom_Axis2Placement AxisSelect = SC->Position();
if (AxisSelect.CaseNum(AxisSelect.Value()) == 2)
{
Handle(Geom_Axis2Placement) A;
if (StepToGeom_MakeAxis2Placement::Convert
(Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()),A))
{
CC = new Geom_Circle(A->Ax2(),SC->Radius() * UnitsMethods::LengthFactor());
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeCircle2d.cdl
-- Created: Fri Aug 26 11:42:22 1994
-- Author: Frederic MAUPAS
---Copyright: Matra Datavision 1994
class MakeCircle2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- Circle from StepGeom which describes a circle from
-- Prostep and Circle from Geom2d.
uses
Circle from Geom2d,
Circle from StepGeom
is
Convert ( myclass; SC : Circle from StepGeom;
CC : out Circle from Geom2d )
returns Boolean from Standard;
end MakeCircle2d;

View File

@@ -0,0 +1,33 @@
// File: StepToGeom_MakeCircle2d.cxx
// Created: Fri Aug 26 11:45:44 1994
// Author: Frederic MAUPAS
#include <StepToGeom_MakeCircle2d.ixx>
#include <StepGeom_Circle.hxx>
#include <StepGeom_Axis2Placement2d.hxx>
#include <Geom2d_AxisPlacement.hxx>
#include <StepToGeom_MakeAxisPlacement.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax22d.hxx>
//=============================================================================
// Creation d' un Circle de Geom2d a partir d' un Circle de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeCircle2d::Convert
(const Handle(StepGeom_Circle)& SC,
Handle(Geom2d_Circle)& CC)
{
const StepGeom_Axis2Placement AxisSelect = SC->Position();
if (AxisSelect.CaseNum(AxisSelect.Value()) == 1) {
Handle(Geom2d_AxisPlacement) A1;
if (StepToGeom_MakeAxisPlacement::Convert
(Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()),A1))
{
const gp_Ax22d A( A1->Ax2d() );
CC = new Geom2d_Circle(A, SC->Radius());
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,23 @@
-- File: StepToGeom_MakeConic.cdl
-- Created: Mon Jun 21 11:18:38 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeConic from StepToGeom
---Purpose: This class implements the mapping between classes
-- Conic from StepGeom
-- which describes a Conic from prostep and Conic from Geom .
-- As Conic is an abstract class
-- this class is an access to the sub-class required.
uses Conic from Geom,
Conic from StepGeom
is
Convert ( myclass; SC : Conic from StepGeom;
CC : out Conic from Geom )
returns Boolean from Standard;
end MakeConic;

View File

@@ -0,0 +1,43 @@
// File: StepToGeom_MakeConic.cxx
// Created: Fri Jul 2 16:51:20 1993
// Author: Martine LANGLOIS
//:p0 abv 19.02.99: management of 'done' flag improved
#include <StepToGeom_MakeConic.ixx>
#include <StepGeom_Conic.hxx>
#include <StepGeom_Circle.hxx>
#include <StepToGeom_MakeCircle.hxx>
#include <StepGeom_Ellipse.hxx>
#include <StepToGeom_MakeEllipse.hxx>
#include <StepGeom_Hyperbola.hxx>
#include <StepToGeom_MakeHyperbola.hxx>
#include <StepGeom_Parabola.hxx>
#include <StepToGeom_MakeParabola.hxx>
//=============================================================================
// Creation d' une Conic de Geom a partir d' une Conic de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeConic::Convert
(const Handle(StepGeom_Conic)& SC,
Handle(Geom_Conic)& CC)
{
if (SC->IsKind(STANDARD_TYPE(StepGeom_Circle))) {
const Handle(StepGeom_Circle) Cir = Handle(StepGeom_Circle)::DownCast(SC);
return StepToGeom_MakeCircle::Convert(Cir,*((Handle(Geom_Circle)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
const Handle(StepGeom_Ellipse) Ell = Handle(StepGeom_Ellipse)::DownCast(SC);
return StepToGeom_MakeEllipse::Convert(Ell,*((Handle(Geom_Ellipse)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_Hyperbola))) {
const Handle(StepGeom_Hyperbola) Hyp = Handle(StepGeom_Hyperbola)::DownCast(SC);
return StepToGeom_MakeHyperbola::Convert(Hyp,*((Handle(Geom_Hyperbola)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_Parabola))) {
const Handle(StepGeom_Parabola) Par = Handle(StepGeom_Parabola)::DownCast(SC);
return StepToGeom_MakeParabola::Convert(Par,*((Handle(Geom_Parabola)*)&CC));
}
// Attention : Other conic shall be implemented !
return Standard_False;
}

View File

@@ -0,0 +1,23 @@
-- File: StepToGeom_MakeConic2d.cdl
-- Created: Fri Aug 26 11:36:35 1994
-- Author: Frederic MAUPAS
---Copyright: Matra Datavision 1994
class MakeConic2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- Conic from StepGeom
-- which describes a Conic from prostep and Conic from Geom2d.
-- As Conic is an abstract class
-- this class is an access to the sub-class required.
uses Conic from Geom2d,
Conic from StepGeom
is
Convert ( myclass; SC : Conic from StepGeom;
CC : out Conic from Geom2d )
returns Boolean from Standard;
end MakeConic2d;

View File

@@ -0,0 +1,43 @@
// File: StepToGeom_MakeConic2d.cxx
// Created: Fri Aug 26 11:38:37 1994
// Author: Frederic MAUPAS
//:p0 abv 19.02.99: management of 'done' flag improved
#include <StepToGeom_MakeConic2d.ixx>
#include <StepGeom_Conic.hxx>
#include <StepGeom_Circle.hxx>
#include <StepGeom_Ellipse.hxx>
#include <StepGeom_Hyperbola.hxx>
#include <StepGeom_Parabola.hxx>
#include <StepToGeom_MakeCircle2d.hxx>
#include <StepToGeom_MakeEllipse2d.hxx>
#include <StepToGeom_MakeHyperbola2d.hxx>
#include <StepToGeom_MakeParabola2d.hxx>
//=============================================================================
// Creation d' une Conic de Geom2d a partir d' une Conic de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeConic2d::Convert
(const Handle(StepGeom_Conic)& SC,
Handle(Geom2d_Conic)& CC)
{
if (SC->IsKind(STANDARD_TYPE(StepGeom_Circle))) {
const Handle(StepGeom_Circle) Cir = Handle(StepGeom_Circle)::DownCast(SC);
return StepToGeom_MakeCircle2d::Convert(Cir,*((Handle(Geom2d_Circle)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
const Handle(StepGeom_Ellipse) Ell = Handle(StepGeom_Ellipse)::DownCast(SC);
return StepToGeom_MakeEllipse2d::Convert(Ell,*((Handle(Geom2d_Ellipse)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_Hyperbola))) {
const Handle(StepGeom_Hyperbola) Hyp = Handle(StepGeom_Hyperbola)::DownCast(SC);
return StepToGeom_MakeHyperbola2d::Convert(Hyp,*((Handle(Geom2d_Hyperbola)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_Parabola))) {
const Handle(StepGeom_Parabola) Par = Handle(StepGeom_Parabola)::DownCast(SC);
return StepToGeom_MakeParabola2d::Convert(Par,*((Handle(Geom2d_Parabola)*)&CC));
}
// Attention : Other conic shall be implemented !
return Standard_False;
}

View File

@@ -0,0 +1,21 @@
-- File: StepToGeom_MakeConicalSurface.cdl
-- Created: Mon Jun 14 16:05:32 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeConicalSurface from StepToGeom
---Purpose: This class implements the mapping between class
-- ConicalSurface from StepGeom which describes a
-- conical_surface from Prostep and ConicalSurface from Geom
uses ConicalSurface from Geom,
ConicalSurface from StepGeom
is
Convert ( myclass; SS : ConicalSurface from StepGeom;
CS : out ConicalSurface from Geom )
returns Boolean from Standard;
end MakeConicalSurface;

View File

@@ -0,0 +1,31 @@
// File: StepToGeom_MakeConicalSurface.cxx
// Created: Fri Jul 2 16:54:36 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeConicalSurface.ixx>
#include <Geom_ConicalSurface.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepToGeom_MakeAxis2Placement.hxx>
#include <Geom_Axis2Placement.hxx>
#include <gp_Ax2.hxx>
#include <Precision.hxx>//#2(K3-3) rln
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' une ConicalSurface de Geom a partir d' une ConicalSurface de
// Step
//=============================================================================
Standard_Boolean StepToGeom_MakeConicalSurface::Convert (const Handle(StepGeom_ConicalSurface)& SS, Handle(Geom_ConicalSurface)& CS)
{
Handle(Geom_Axis2Placement) A;
if (StepToGeom_MakeAxis2Placement::Convert(SS->Position(),A))
{
const Standard_Real R = SS->Radius() * UnitsMethods::LengthFactor();
const Standard_Real Ang = SS->SemiAngle() * UnitsMethods::PlaneAngleFactor();
//#2(K3-3) rln 12/02/98 ProSTEP ct_turbine-A.stp entity #518, #3571 (gp::Resolution() is too little)
CS = new Geom_ConicalSurface(A->Ax2(), Max(Ang, Precision::Angular()), R);
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,23 @@
-- File: StepToGeom_MakeCurve.cdl
-- Created: Mon Jun 21 10:14:42 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeCurve from StepToGeom
---Purpose: This class implements the mapping between classes
-- class Curve from StepGeom which
-- describes a Curve from prostep and Curve from Geom.
-- As Curve is an abstract class
-- this class an access to the sub-class required.
uses Curve from Geom,
Curve from StepGeom
is
Convert ( myclass; SC : Curve from StepGeom;
CC : out Curve from Geom )
returns Boolean from Standard;
end MakeCurve;

View File

@@ -0,0 +1,96 @@
// File: StepToGeom_MakeCurve.cxx
// Created: Fri Jul 2 17:07:46 1993
// Author: Martine LANGLOIS
//:n7 abv 16.02.99: S4132: adding translation of curve_replica
//:o2 abv 17.02.99: S4132: adding translation of offset_curve_3d
//:o5 abv 17.02.99: bm4_sd_seal_c.stp #58720: translate surface_curve (3d only)
//:p0 abv 19.02.99: management of 'done' flag improved
#include <StepToGeom_MakeCurve.ixx>
#include <Geom_OffsetCurve.hxx>
#include <Geom_Direction.hxx>
#include <StepGeom_Curve.hxx>
#include <StepGeom_TrimmedCurve.hxx>
#include <StepGeom_Line.hxx>
#include <StepGeom_Conic.hxx>
#include <StepGeom_BoundedCurve.hxx>
#include <StepGeom_CartesianTransformationOperator3d.hxx>
#include <StepGeom_CurveReplica.hxx>
#include <StepGeom_OffsetCurve3d.hxx>
#include <StepGeom_SurfaceCurve.hxx>
#include <StepToGeom_MakeDirection.hxx>
#include <StepToGeom_MakeTrimmedCurve.hxx>
#include <StepToGeom_MakeCurve.hxx>
#include <StepToGeom_MakeLine.hxx>
#include <StepToGeom_MakeConic.hxx>
#include <StepToGeom_MakeBoundedCurve.hxx>
#include <StepToGeom_MakeTransformation3d.hxx>
//=============================================================================
// Creation d' une Curve de Geom a partir d' une Curve de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeCurve::Convert (const Handle(StepGeom_Curve)& SC, Handle(Geom_Curve)& CC)
{
if (SC->IsKind(STANDARD_TYPE(StepGeom_Line))) {
const Handle(StepGeom_Line) L = Handle(StepGeom_Line)::DownCast(SC);
return StepToGeom_MakeLine::Convert(L,*((Handle(Geom_Line)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) {
const Handle(StepGeom_TrimmedCurve) TC = Handle(StepGeom_TrimmedCurve)::DownCast(SC);
return StepToGeom_MakeTrimmedCurve::Convert(TC,*((Handle(Geom_TrimmedCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_Conic))) {
const Handle(StepGeom_Conic) CO = Handle(StepGeom_Conic)::DownCast(SC);
return StepToGeom_MakeConic::Convert(CO,*((Handle(Geom_Conic)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_BoundedCurve))) {
const Handle(StepGeom_BoundedCurve) BC = Handle(StepGeom_BoundedCurve)::DownCast(SC);
return StepToGeom_MakeBoundedCurve::Convert(BC,*((Handle(Geom_BoundedCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_CurveReplica))) { //:n7 abv 16 Feb 99
const Handle(StepGeom_CurveReplica) CR = Handle(StepGeom_CurveReplica)::DownCast(SC);
const Handle(StepGeom_Curve) PC = CR->ParentCurve();
const Handle(StepGeom_CartesianTransformationOperator3d) T =
Handle(StepGeom_CartesianTransformationOperator3d)::DownCast(CR->Transformation());
// protect against cyclic references and wrong type of cartop
if ( !T.IsNull() && PC != SC )
{
Handle(Geom_Curve) C1;
if (StepToGeom_MakeCurve::Convert(PC,C1))
{
gp_Trsf T1;
if (StepToGeom_MakeTransformation3d::Convert(T,T1))
{
C1->Transform ( T1 );
CC = C1;
return Standard_True;
}
}
}
}
else if (SC->IsKind(STANDARD_TYPE(StepGeom_OffsetCurve3d))) { //:o2 abv 17 Feb 99
const Handle(StepGeom_OffsetCurve3d) OC = Handle(StepGeom_OffsetCurve3d)::DownCast(SC);
const Handle(StepGeom_Curve) BC = OC->BasisCurve();
if ( BC != SC ) { // protect against loop
Handle(Geom_Curve) C1;
if (StepToGeom_MakeCurve::Convert(BC,C1))
{
Handle(Geom_Direction) RD;
if (StepToGeom_MakeDirection::Convert(OC->RefDirection(),RD))
{
CC = new Geom_OffsetCurve ( C1, -OC->Distance(), RD->Dir() );
return Standard_True;
}
}
}
}
else if (SC->IsKind(STANDARD_TYPE(StepGeom_SurfaceCurve))) { //:o5 abv 17 Feb 99
const Handle(StepGeom_SurfaceCurve) SurfC = Handle(StepGeom_SurfaceCurve)::DownCast(SC);
return StepToGeom_MakeCurve::Convert(SurfC->Curve3d(),CC);
}
return Standard_False;
}

View File

@@ -0,0 +1,23 @@
-- File: StepToGeom_MakeCurve2d.cdl
-- Created: Wed Aug 4 10:42:37 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeCurve2d from StepToGeom
---Purpose: This class implements the mapping between
-- class Curve from StepGeom which
-- describes a Curve from prostep and Curve from Geom2d.
-- As Curve is an abstract class
-- this class an access to the sub-class required.
uses Curve from Geom2d,
Curve from StepGeom
is
Convert ( myclass; SC : Curve from StepGeom;
CC : out Curve from Geom2d )
returns Boolean from Standard;
end MakeCurve2d;

View File

@@ -0,0 +1,65 @@
// File: StepToGeom_MakeCurve2d.cxx
// Created: Wed Aug 4 10:45:01 1993
// Author: Martine LANGLOIS
//:n7 abv 15.02.99: S4132: adding translation of curve_replica
//:p0 abv 19.02.99: management of 'done' flag improved
#include <StepToGeom_MakeCurve2d.ixx>
#include <StepGeom_Curve.hxx>
#include <StepGeom_TrimmedCurve.hxx>
#include <StepGeom_HArray1OfTrimmingSelect.hxx>
#include <StepToGeom_MakeLine2d.hxx>
#include <StepToGeom_MakeConic2d.hxx>
#include <StepGeom_Line.hxx>
#include <StepGeom_Conic.hxx>
#include <StepGeom_BoundedCurve.hxx>
#include <StepToGeom_MakeBoundedCurve2d.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2dConvert.hxx>
#include <StepGeom_CurveReplica.hxx>
#include <StepGeom_CartesianTransformationOperator2d.hxx>
#include <StepToGeom_MakeTransformation2d.hxx>
#include <gp_Trsf2d.hxx>
//=============================================================================
// Creation d' une Curve de Geom2d a partir d' une Curve de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeCurve2d::Convert (const Handle(StepGeom_Curve)& SC, Handle(Geom2d_Curve)& CC)
{
if (SC->IsKind(STANDARD_TYPE(StepGeom_Line))) {
const Handle(StepGeom_Line) L = Handle(StepGeom_Line)::DownCast(SC);
return StepToGeom_MakeLine2d::Convert(L,*((Handle(Geom2d_Line)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_Conic))) {
const Handle(StepGeom_Conic) L = Handle(StepGeom_Conic)::DownCast(SC);
return StepToGeom_MakeConic2d::Convert(L,*((Handle(Geom2d_Conic)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_BoundedCurve))) {
const Handle(StepGeom_BoundedCurve) L = Handle(StepGeom_BoundedCurve)::DownCast(SC);
return StepToGeom_MakeBoundedCurve2d::Convert(L,*((Handle(Geom2d_BoundedCurve)*)&CC));
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_CurveReplica))) { //:n7 abv 16 Feb 99
const Handle(StepGeom_CurveReplica) CR = Handle(StepGeom_CurveReplica)::DownCast(SC);
const Handle(StepGeom_Curve) PC = CR->ParentCurve();
const Handle(StepGeom_CartesianTransformationOperator2d) T =
Handle(StepGeom_CartesianTransformationOperator2d)::DownCast(CR->Transformation());
// protect against cyclic references and wrong type of cartop
if ( !T.IsNull() && PC != SC )
{
Handle(Geom2d_Curve) C1;
if (StepToGeom_MakeCurve2d::Convert(PC,C1))
{
gp_Trsf2d T1;
if (StepToGeom_MakeTransformation2d::Convert(T,T1))
{
C1->Transform ( T1 );
CC = C1;
return Standard_True;
}
}
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeCylindricalSurface.cdl
-- Created: Mon Jun 14 16:09:17 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeCylindricalSurface from StepToGeom
---Purpose: This class implements the mapping between class
-- CylindricalSurface from StepGeom which describes a
-- cylindrical_surface from Prostep and CylindricalSurface
-- from Geom
uses CylindricalSurface from Geom,
CylindricalSurface from StepGeom
is
Convert ( myclass; SS : CylindricalSurface from StepGeom;
CS : out CylindricalSurface from Geom )
returns Boolean from Standard;
end MakeCylindricalSurface;

View File

@@ -0,0 +1,27 @@
// File: StepToGeom_MakeCylindricalSurface.cxx
// Created: Fri Jul 2 17:20:46 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeCylindricalSurface.ixx>
#include <Geom_CylindricalSurface.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepToGeom_MakeAxis2Placement.hxx>
#include <Geom_Axis2Placement.hxx>
#include <gp_Ax2.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' une CylindricalSurface de Geom a partir d' une
// CylindricalSurface de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeCylindricalSurface::Convert (const Handle(StepGeom_CylindricalSurface)& SS, Handle(Geom_CylindricalSurface)& CS)
{
Handle(Geom_Axis2Placement) A;
if (StepToGeom_MakeAxis2Placement::Convert(SS->Position(),A))
{
CS = new Geom_CylindricalSurface(A->Ax2(), SS->Radius() * UnitsMethods::LengthFactor());
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeDirection.cdl
-- Created: Mon Jun 14 14:53:21 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeDirection from StepToGeom
---Purpose: This class implements the mapping between classes
-- Direction from StepGeom which describes a direction
-- from Prostep and Direction from Geom.
uses
Direction from Geom,
Direction from StepGeom
is
Convert ( myclass; SD : Direction from StepGeom;
CD : out Direction from Geom )
returns Boolean from Standard;
end MakeDirection;

View File

@@ -0,0 +1,28 @@
// File: StepToGeom_MakeDirection.cxx
// Created: Fri Jul 2 17:32:04 1993
// Author: Martine LANGLOIS
// sln 22.10.2001. CTS23496: Direction is not created if it has null magnitude (StepToGeom_MakeDirection(...) function)
#include <StepToGeom_MakeDirection.ixx>
#include <StepGeom_Direction.hxx>
//=============================================================================
// Creation d' un Direction de Geom a partir d' un Direction de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeDirection::Convert (const Handle(StepGeom_Direction)& SD, Handle(Geom_Direction)& CD)
{
if (SD->NbDirectionRatios() >= 3)
{
const Standard_Real X = SD->DirectionRatiosValue(1);
const Standard_Real Y = SD->DirectionRatiosValue(2);
const Standard_Real Z = SD->DirectionRatiosValue(3);
// sln 22.10.2001. CTS23496: Direction is not created if it has null magnitude
if (gp_XYZ(X, Y, Z).SquareModulus() > gp::Resolution()*gp::Resolution())
{
CD = new Geom_Direction(X, Y, Z);
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeDirection2d.cdl
-- Created: Wed Aug 4 11:49:16 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeDirection2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- Direction from StepGeom which describes a direction
-- from Prostep and Direction from Geom2d.
uses
Direction from Geom2d,
Direction from StepGeom
is
Convert ( myclass; SD : Direction from StepGeom;
CD : out Direction from Geom2d )
returns Boolean from Standard;
end MakeDirection2d;

View File

@@ -0,0 +1,27 @@
// File: StepToGeom_MakeDirection2d.cxx
// Created: Wed Aug 4 11:50:31 1993
// Author: Martine LANGLOIS
// sln 23.10.2001. CTS23496: Direction is not created if it has null magnitude (StepToGeom_MakeDirection2d(...) function)
#include <StepToGeom_MakeDirection2d.ixx>
#include <StepGeom_Direction.hxx>
//=============================================================================
// Creation d' un Direction de Geom2d a partir d' un Direction de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeDirection2d::Convert (const Handle(StepGeom_Direction)& SD, Handle(Geom2d_Direction)& CD)
{
if (SD->NbDirectionRatios() >= 2)
{
const Standard_Real X = SD->DirectionRatiosValue(1);
const Standard_Real Y = SD->DirectionRatiosValue(2);
// sln 23.10.2001. CTS23496: Direction is not created if it has null magnitude
if(gp_XY(X,Y).SquareModulus() > gp::Resolution()*gp::Resolution())
{
CD = new Geom2d_Direction(X, Y);
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,23 @@
-- File: StepToGeom_MakeElementarySurface.cdl
-- Created: Tue Jun 22 14:24:10 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeElementarySurface from StepToGeom
---Purpose: This class implements the mapping between classes
-- ElementarySurface from StepGeom which describes
-- a ElementarySurface from Step and ElementarySurface from
-- Geom. As ElementarySurface is an abstract Surface this
-- class is an access to the sub-class required.
uses ElementarySurface from Geom,
ElementarySurface from StepGeom
is
Convert ( myclass; SS : ElementarySurface from StepGeom;
CS : out ElementarySurface from Geom )
returns Boolean from Standard;
end MakeElementarySurface;

View File

@@ -0,0 +1,47 @@
// File: StepToGeom_MakeElementarySurface.cxx
// Created: Fri Jul 2 17:38:21 1993
// Author: Martine LANGLOIS
//:p0 abv 19.02.99: management of 'done' flag improved
#include <StepToGeom_MakeElementarySurface.ixx>
#include <StepGeom_ElementarySurface.hxx>
#include <StepGeom_CylindricalSurface.hxx>
#include <StepGeom_ConicalSurface.hxx>
#include <StepGeom_SphericalSurface.hxx>
#include <StepGeom_ToroidalSurface.hxx>
#include <StepGeom_Plane.hxx>
#include <StepToGeom_MakeCylindricalSurface.hxx>
#include <StepToGeom_MakeConicalSurface.hxx>
#include <StepToGeom_MakeSphericalSurface.hxx>
#include <StepToGeom_MakeToroidalSurface.hxx>
#include <StepToGeom_MakePlane.hxx>
//=============================================================================
// Creation d' une ElementarySurface de Geom a partir d' une
// ElementarySurface de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeElementarySurface::Convert (const Handle(StepGeom_ElementarySurface)& SS, Handle(Geom_ElementarySurface)& CS)
{
if (SS->IsKind(STANDARD_TYPE(StepGeom_Plane))) {
const Handle(StepGeom_Plane) Sur = Handle(StepGeom_Plane)::DownCast(SS);
return StepToGeom_MakePlane::Convert(Sur,*((Handle(Geom_Plane)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_CylindricalSurface))) {
const Handle(StepGeom_CylindricalSurface) Sur = Handle(StepGeom_CylindricalSurface)::DownCast(SS);
return StepToGeom_MakeCylindricalSurface::Convert(Sur,*((Handle(Geom_CylindricalSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_ConicalSurface))) {
const Handle(StepGeom_ConicalSurface) Sur = Handle(StepGeom_ConicalSurface)::DownCast(SS);
return StepToGeom_MakeConicalSurface::Convert(Sur,*((Handle(Geom_ConicalSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_SphericalSurface))) {
const Handle(StepGeom_SphericalSurface) Sur = Handle(StepGeom_SphericalSurface)::DownCast(SS);
return StepToGeom_MakeSphericalSurface::Convert(Sur,*((Handle(Geom_SphericalSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_ToroidalSurface))) {
const Handle(StepGeom_ToroidalSurface) Sur = Handle(StepGeom_ToroidalSurface)::DownCast(SS);
return StepToGeom_MakeToroidalSurface::Convert(Sur,*((Handle(Geom_ToroidalSurface)*)&CS));
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeEllipse.cdl
-- Created: Thu Sep 1 13:46:53 1994
-- Author: Frederic MAUPAS
---Copyright: Matra Datavision 1994
class MakeEllipse from StepToGeom
---Purpose: This class implements the mapping between classes
-- Ellipse from StepGeom which describes a Ellipse from
-- Prostep and Ellipse from Geom.
uses
Ellipse from Geom,
Ellipse from StepGeom
is
Convert ( myclass; SC : Ellipse from StepGeom;
CC : out Ellipse from Geom )
returns Boolean from Standard;
end MakeEllipse;

View File

@@ -0,0 +1,45 @@
// File: StepToGeom_MakeEllipse.cxx
// Created: Thu Sep 1 13:48:41 1994
// Author: Frederic MAUPAS
//:o9 abv 19.02.99: bm4_id_punch_b.stp #678: treatment of ellipse with minR > maxR
// NOTE: parametrisation of resulting ellipse shifted on pi/2
#include <StepToGeom_MakeEllipse.ixx>
#include <StepGeom_Ellipse.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <Geom_Axis2Placement.hxx>
#include <StepToGeom_MakeAxis2Placement.hxx>
#include <gp_Ax2.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' un Ellipse de Geom a partir d' un Ellipse de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeEllipse::Convert
(const Handle(StepGeom_Ellipse)& SC,
Handle(Geom_Ellipse)& CC)
{
const StepGeom_Axis2Placement AxisSelect = SC->Position();
if (AxisSelect.CaseNum(AxisSelect.Value()) == 2) {
Handle(Geom_Axis2Placement) A1;
if (StepToGeom_MakeAxis2Placement::Convert
(Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()),A1))
{
gp_Ax2 A( A1->Ax2() );
const Standard_Real LF = UnitsMethods::LengthFactor();
const Standard_Real majorR = SC->SemiAxis1() * LF;
const Standard_Real minorR = SC->SemiAxis2() * LF;
if ( majorR - minorR >= 0. ) { //:o9 abv 19 Feb 99
CC = new Geom_Ellipse(A, majorR, minorR);
}
//:o9 abv 19 Feb 99
else {
A.SetXDirection ( A.XDirection() ^ A.Direction() );
CC = new Geom_Ellipse(A, minorR, majorR);
}
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeEllipse2d.cdl
-- Created: Thu Sep 1 13:56:44 1994
-- Author: Frederic MAUPAS
---Copyright: Matra Datavision 1994
class MakeEllipse2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- Ellipse from StepGeom which describes a Ellipse from
-- Prostep and Ellipse from Geom2d.
uses
Ellipse from Geom2d,
Ellipse from StepGeom
is
Convert ( myclass; SC : Ellipse from StepGeom;
CC : out Ellipse from Geom2d )
returns Boolean from Standard;
end MakeEllipse2d;

View File

@@ -0,0 +1,44 @@
// File: StepToGeom_MakeEllipse2d.cxx
// Created: Thu Sep 1 13:57:24 1994
// Author: Frederic MAUPAS
//:o9 abv 19.02.99: bm4_id_punch_b.stp #678: treatment of minR > maxR
// NOTE: parametrisation of resulting ellipse shifted on pi/2
#include <StepToGeom_MakeEllipse2d.ixx>
#include <StepGeom_Ellipse.hxx>
#include <StepGeom_Axis2Placement2d.hxx>
#include <Geom2d_AxisPlacement.hxx>
#include <StepToGeom_MakeAxisPlacement.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax22d.hxx>
//=============================================================================
// Creation d' un Ellipse de Geom2d a partir d' un Ellipse de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeEllipse2d::Convert
(const Handle(StepGeom_Ellipse)& SC,
Handle(Geom2d_Ellipse)& CC)
{
const StepGeom_Axis2Placement AxisSelect = SC->Position();
if (AxisSelect.CaseNum(AxisSelect.Value()) == 1) {
Handle(Geom2d_AxisPlacement) A1;
if (StepToGeom_MakeAxisPlacement::Convert
(Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()),A1))
{
gp_Ax22d A( A1->Ax2d() );
const Standard_Real majorR = SC->SemiAxis1();
const Standard_Real minorR = SC->SemiAxis2();
if ( majorR - minorR >= 0. ) { //:o9 abv 19 Feb 99: bm4_id_punch_b.stp #678: protection
CC = new Geom2d_Ellipse(A, majorR, minorR);
}
else {
const gp_Dir2d X = A.XDirection();
A.SetXDirection ( gp_Dir2d ( X.X(), -X.Y() ) );
CC = new Geom2d_Ellipse(A, minorR, majorR);
}
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeHyperbola.cdl
-- Created: Thu Sep 8 08:24:18 1994
-- Author: Frederic MAUPAS
---Copyright: Matra Datavision 1994
class MakeHyperbola from StepToGeom
---Purpose: This class implements the mapping between classes
-- Hyperbola from StepGeom which describes a Hyperbola from
-- Prostep and Hyperbola from Geom.
uses
Hyperbola from Geom,
Hyperbola from StepGeom
is
Convert ( myclass; SC : Hyperbola from StepGeom;
CC : out Hyperbola from Geom )
returns Boolean from Standard;
end MakeHyperbola;

View File

@@ -0,0 +1,35 @@
// File: StepToGeom_MakeHyperbola.cxx
// Created: Thu Sep 8 08:25:12 1994
// Author: Frederic MAUPAS
#include <StepToGeom_MakeHyperbola.ixx>
#include <StepGeom_Hyperbola.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <Geom_Axis2Placement.hxx>
#include <StepToGeom_MakeAxis2Placement.hxx>
#include <gp_Ax2.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' un Hyperbola de Geom a partir d' un Hyperbola de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeHyperbola::Convert
(const Handle(StepGeom_Hyperbola)& SC,
Handle(Geom_Hyperbola)& CC)
{
const StepGeom_Axis2Placement AxisSelect = SC->Position();
if (AxisSelect.CaseNum(AxisSelect.Value()) == 2)
{
Handle(Geom_Axis2Placement) A1;
if (StepToGeom_MakeAxis2Placement::Convert
(Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()),A1))
{
const gp_Ax2 A( A1->Ax2() );
const Standard_Real LF = UnitsMethods::LengthFactor();
CC = new Geom_Hyperbola(A, SC->SemiAxis() * LF, SC->SemiImagAxis() * LF);
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeHyperbola2d.cdl
-- Created: Tue May 9 10:42:44 1995
-- Author: Dieter THIEMANN
---Copyright: Matra Datavision 1994
class MakeHyperbola2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- Hyperbola from StepGeom which describes a Hyperbola from
-- Prostep and Hyperbola from Geom2d.
uses
Hyperbola from Geom2d,
Hyperbola from StepGeom
is
Convert ( myclass; SC : Hyperbola from StepGeom;
CC : out Hyperbola from Geom2d )
returns Boolean from Standard;
end MakeHyperbola2d;

View File

@@ -0,0 +1,33 @@
// File: StepToGeom_MakeHyperbola2d.cxx
// Created: Thu Sep 1 13:57:24 1994
// Author: Frederic MAUPAS
#include <StepToGeom_MakeHyperbola2d.ixx>
#include <StepGeom_Hyperbola.hxx>
#include <StepGeom_Axis2Placement2d.hxx>
#include <Geom2d_AxisPlacement.hxx>
#include <StepToGeom_MakeAxisPlacement.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax22d.hxx>
//=============================================================================
// Creation d' un Hyperbola de Geom2d a partir d' un Hyperbola de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeHyperbola2d::Convert
(const Handle(StepGeom_Hyperbola)& SC,
Handle(Geom2d_Hyperbola)& CC)
{
const StepGeom_Axis2Placement AxisSelect = SC->Position();
if (AxisSelect.CaseNum(AxisSelect.Value()) == 1) {
Handle(Geom2d_AxisPlacement) A1;
if (StepToGeom_MakeAxisPlacement::Convert
(Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()),A1))
{
const gp_Ax22d A( A1->Ax2d() );
CC = new Geom2d_Hyperbola(A, SC->SemiAxis(), SC->SemiImagAxis());
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeLine.cdl
-- Created: Mon Jun 14 15:51:51 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeLine from StepToGeom
---Purpose: This class implements the mapping between classes
-- Line from StepGeom which describes a line from
-- Prostep and Line from Geom.
uses
Line from Geom,
Line from StepGeom
is
Convert ( myclass; SC : Line from StepGeom;
CC : out Line from Geom )
returns Boolean from Standard;
end MakeLine;

View File

@@ -0,0 +1,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;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeLine2d.cdl
-- Created: Wed Aug 4 10:53:16 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeLine2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- Line from StepGeom which describes a line from
-- Prostep and Line from Geom2d.
uses
Line from Geom2d,
Line from StepGeom
is
Convert ( myclass; SC : Line from StepGeom;
CC : out Line from Geom2d )
returns Boolean from Standard;
end MakeLine2d;

View File

@@ -0,0 +1,39 @@
// File: StepToGeom_MakeLine2d.cxx
// Created: Wed Aug 4 10:55:40 1993
// Author: Martine LANGLOIS
// sln 23.10.2001. CTS23496: Line is not created if direction have not been succesfully created (StepToGeom_MakeLine2d(...) function)
#include <StepToGeom_MakeLine2d.ixx>
#include <StepGeom_Line.hxx>
#include <StepGeom_Vector.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepToGeom_MakeVectorWithMagnitude2d.hxx>
#include <StepToGeom_MakeCartesianPoint2d.hxx>
#include <Geom2d_CartesianPoint.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_Vector.hxx>
#include <Geom2d_VectorWithMagnitude.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Dir2d.hxx>
//=============================================================================
// Creation d' une Line de Geom2d a partir d' une Line de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeLine2d::Convert (const Handle(StepGeom_Line)& SC, Handle(Geom2d_Line)& CC)
{
Handle(Geom2d_CartesianPoint) P;
if (StepToGeom_MakeCartesianPoint2d::Convert(SC->Pnt(),P))
{
// sln 23.10.2001. CTS23496: Line is not created if direction have not been succesfully created
Handle(Geom2d_VectorWithMagnitude) D;
if (StepToGeom_MakeVectorWithMagnitude2d::Convert(SC->Dir(),D))
{
const gp_Dir2d D1(D->Vec2d());
CC = new Geom2d_Line(P->Pnt2d(), D1);
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeParabola.cdl
-- Created: Thu Sep 8 09:00:04 1994
-- Author: Frederic MAUPAS
---Copyright: Matra Datavision 1994
class MakeParabola from StepToGeom
---Purpose: This class implements the mapping between classes
-- Parabola from StepGeom which describes a Parabola from
-- Prostep and Parabola from Geom.
uses
Parabola from Geom,
Parabola from StepGeom
is
Convert ( myclass; SC : Parabola from StepGeom;
CC : out Parabola from Geom )
returns Boolean from Standard;
end MakeParabola;

View File

@@ -0,0 +1,33 @@
// File: StepToGeom_MakeParabola.cxx
// Created: Thu Sep 8 09:00:36 1994
// Author: Frederic MAUPAS
#include <StepToGeom_MakeParabola.ixx>
#include <StepGeom_Parabola.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <Geom_Axis2Placement.hxx>
#include <StepToGeom_MakeAxis2Placement.hxx>
#include <gp_Ax2.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' un Parabola de Geom a partir d' un Parabola de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeParabola::Convert
(const Handle(StepGeom_Parabola)& SC,
Handle(Geom_Parabola)& CC)
{
const StepGeom_Axis2Placement AxisSelect = SC->Position();
if (AxisSelect.CaseNum(AxisSelect.Value()) == 2)
{
Handle(Geom_Axis2Placement) A;
if (StepToGeom_MakeAxis2Placement::Convert
(Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()),A))
{
CC = new Geom_Parabola(A->Ax2(), SC->FocalDist() * UnitsMethods::LengthFactor());
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeParabola2d.cdl
-- Created: Tue May 9 10:42:44 1995
-- Author: Dieter THIEMANN
---Copyright: Matra Datavision 1994
class MakeParabola2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- Parabola from StepGeom which describes a Parabola from
-- Prostep and Parabola from Geom2d.
uses
Parabola from Geom2d,
Parabola from StepGeom
is
Convert ( myclass; SC : Parabola from StepGeom;
CC : out Parabola from Geom2d )
returns Boolean from Standard;
end MakeParabola2d;

View File

@@ -0,0 +1,33 @@
// File: StepToGeom_MakeParabola2d.cxx
// Created: Thu Sep 1 13:57:24 1994
// Author: Frederic MAUPAS
#include <StepToGeom_MakeParabola2d.ixx>
#include <StepGeom_Parabola.hxx>
#include <StepGeom_Axis2Placement2d.hxx>
#include <Geom2d_AxisPlacement.hxx>
#include <StepToGeom_MakeAxisPlacement.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax22d.hxx>
//=============================================================================
// Creation d' un Parabola de Geom2d a partir d' un Parabola de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeParabola2d::Convert
(const Handle(StepGeom_Parabola)& SC,
Handle(Geom2d_Parabola)& CC)
{
const StepGeom_Axis2Placement AxisSelect = SC->Position();
if (AxisSelect.CaseNum(AxisSelect.Value()) == 1) {
Handle(Geom2d_AxisPlacement) A1;
if (StepToGeom_MakeAxisPlacement::Convert
(Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()),A1))
{
const gp_Ax22d A( A1->Ax2d() );
CC = new Geom2d_Parabola(A, SC->FocalDist());
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakePlane.cdl
-- Created: Mon Jun 14 15:54:27 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakePlane from StepToGeom
---Purpose: This class implements the mapping between classes
-- Plane from StepGeom which describes a plane from
-- Prostep and Plane form Geom.
uses
Plane from Geom,
Plane from StepGeom
is
Convert ( myclass; SP : Plane from StepGeom;
CP : out Plane from Geom )
returns Boolean from Standard;
end MakePlane;

View File

@@ -0,0 +1,24 @@
// File: StepToGeom_MakePlane.cxx
// Created: Fri Jul 2 18:22:22 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakePlane.ixx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepToGeom_MakeAxis2Placement.hxx>
#include <Geom_Axis2Placement.hxx>
#include <gp_Ax2.hxx>
//=============================================================================
// Creation d' un Plane de Geom a partir d' un plane de Step
//=============================================================================
Standard_Boolean StepToGeom_MakePlane::Convert (const Handle(StepGeom_Plane)& SP, Handle(Geom_Plane)& CP)
{
Handle(Geom_Axis2Placement) A;
if (StepToGeom_MakeAxis2Placement::Convert(SP->Position(),A))
{
CP = new Geom_Plane(A->Ax2());
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,21 @@
-- File: StepToGeom_MakePolyline.cdl
-- Created: Mon Feb 15 15:01:21 1999
-- Author: Andrey BETENEV
---Copyright: Matra Datavision 1999
class MakePolyline from StepToGeom inherits Root from StepToGeom
---Purpose: Translates polyline entity into Geom_BSpline
-- In case if polyline has more than 2 points bspline will be C0
uses
Polyline from StepGeom,
BSplineCurve from Geom
is
Convert ( myclass; SPL : Polyline from StepGeom;
CC : out BSplineCurve from Geom )
returns Boolean from Standard;
end MakePolyline;

View File

@@ -0,0 +1,48 @@
// File: StepToGeom_MakePolyline.cxx
// Created: Mon Feb 15 15:05:36 1999
// Author: Andrey BETENEV
#include <StepToGeom_MakePolyline.ixx>
#include <StepToGeom_MakeCartesianPoint.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <Geom_CartesianPoint.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
//=======================================================================
//function : StepToGeom_MakePolyline
//purpose :
//=======================================================================
Standard_Boolean StepToGeom_MakePolyline::Convert (const Handle(StepGeom_Polyline)& SPL, Handle(Geom_BSplineCurve)& CC)
{
if (SPL.IsNull())
return Standard_False;
const Standard_Integer nbp = SPL->NbPoints();
if (nbp > 1)
{
TColgp_Array1OfPnt Poles ( 1, nbp );
TColStd_Array1OfReal Knots ( 1, nbp );
TColStd_Array1OfInteger Mults ( 1, nbp );
Handle(Geom_CartesianPoint) P;
for ( Standard_Integer i=1; i <= nbp; i++ )
{
if (StepToGeom_MakeCartesianPoint::Convert(SPL->PointsValue(i),P))
Poles.SetValue ( i, P->Pnt() );
else
return Standard_False;
Knots.SetValue ( i, Standard_Real(i-1) );
Mults.SetValue ( i, 1 );
}
Mults.SetValue ( 1, 2 );
Mults.SetValue ( nbp, 2 );
CC = new Geom_BSplineCurve ( Poles, Knots, Mults, 1 );
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,21 @@
-- File: StepToGeom_MakePolyline2d.cdl
-- Created: Mon Feb 15 15:01:21 1999
-- Author: Andrey BETENEV
---Copyright: Matra Datavision 1999
class MakePolyline2d from StepToGeom
---Purpose: Translates Polyline entity into Geom2d_BSpline
-- In case if Polyline has more than 2 points bspline will be C0
uses
Polyline from StepGeom,
BSplineCurve from Geom2d
is
Convert ( myclass; SPL : Polyline from StepGeom;
CC : out BSplineCurve from Geom2d )
returns Boolean from Standard;
end MakePolyline2d;

View File

@@ -0,0 +1,48 @@
// File: StepToGeom_MakePolyline2d.cxx
// Created: Mon Feb 15 15:05:36 1999
// Author: Andrey BETENEV
#include <StepToGeom_MakePolyline2d.ixx>
#include <StepToGeom_MakeCartesianPoint2d.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <Geom2d_CartesianPoint.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
//=======================================================================
//function : StepToGeom_MakePolyline2d
//purpose :
//=======================================================================
Standard_Boolean StepToGeom_MakePolyline2d::Convert (const Handle(StepGeom_Polyline)& SPL, Handle(Geom2d_BSplineCurve)& CC)
{
if (SPL.IsNull())
return Standard_False;
const Standard_Integer nbp = SPL->NbPoints();
if (nbp > 1)
{
TColgp_Array1OfPnt2d Poles ( 1, nbp );
TColStd_Array1OfReal Knots ( 1, nbp );
TColStd_Array1OfInteger Mults ( 1, nbp );
Handle(Geom2d_CartesianPoint) P;
for ( Standard_Integer i=1; i <= nbp; i++ )
{
if (StepToGeom_MakeCartesianPoint2d::Convert(SPL->PointsValue(i),P))
Poles.SetValue ( i, P->Pnt2d() );
else
return Standard_False;
Knots.SetValue ( i, Standard_Real(i-1) );
Mults.SetValue ( i, 1 );
}
Mults.SetValue ( 1, 2 );
Mults.SetValue ( nbp, 2 );
CC = new Geom2d_BSplineCurve ( Poles, Knots, Mults, 1 );
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,21 @@
-- File: StepToGeom_MakeRectangularTrimmedSurface.cdl
-- Created: Thu Jan 25 11:59:46 1996
-- Author: Frederic MAUPAS
---Copyright: Matra Datavision 1996
class MakeRectangularTrimmedSurface from StepToGeom
---Purpose: This class implements the mapping between classes
-- RectangularTrimmedSurface from StepGeom
-- and class RectangularTrimmedSurface from Geom
uses RectangularTrimmedSurface from Geom,
RectangularTrimmedSurface from StepGeom
is
Convert ( myclass; SS : RectangularTrimmedSurface from StepGeom;
CS : out RectangularTrimmedSurface from Geom )
returns Boolean from Standard;
end MakeRectangularTrimmedSurface;

View File

@@ -0,0 +1,65 @@
// File: StepToGeom_MakeRectangularTrimmedSurface.cxx
// Created: Thu Jan 25 12:01:33 1996
// Author: Frederic MAUPAS
#include <StepToGeom_MakeRectangularTrimmedSurface.ixx>
#include <StepToGeom_MakeSurface.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_ConicalSurface.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_Plane.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' une RectangularTrimmedSurface de Geom a partir d' une
// RectangularTrimmedSurface de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeRectangularTrimmedSurface::Convert (const Handle(StepGeom_RectangularTrimmedSurface)& SS,
Handle(Geom_RectangularTrimmedSurface)& CS)
{
Handle(Geom_Surface) theBasis;
if (StepToGeom_MakeSurface::Convert(SS->BasisSurface(),theBasis))
{
// -----------------------------------------
// Modification of the Trimming Parameters ?
// -----------------------------------------
Standard_Real uFact = 1.;
Standard_Real vFact = 1.;
const Standard_Real LengthFact = UnitsMethods::LengthFactor();
const Standard_Real AngleFact = UnitsMethods::PlaneAngleFactor(); // abv 30.06.00 trj4_k1_geo-tc-214.stp #1477: PI/180.;
if (theBasis->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ||
theBasis->IsKind(STANDARD_TYPE(Geom_ToroidalSurface))) {
uFact = vFact = AngleFact;
}
else if (theBasis->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
uFact = AngleFact;
vFact = LengthFact;
}
else if ( theBasis->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) {
uFact = AngleFact;
}
else if (theBasis->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) {
const Handle(Geom_ConicalSurface) conicS = Handle(Geom_ConicalSurface)::DownCast(theBasis);
uFact = AngleFact;
vFact = LengthFact / Cos(conicS->SemiAngle());
}
else if (theBasis->IsKind(STANDARD_TYPE(Geom_Plane))) {
uFact = vFact = LengthFact;
}
const Standard_Real U1 = SS->U1() * uFact;
const Standard_Real U2 = SS->U2() * uFact;
const Standard_Real V1 = SS->V1() * vFact;
const Standard_Real V2 = SS->V2() * vFact;
CS = new Geom_RectangularTrimmedSurface(theBasis, U1, U2, V1, V2, SS->Usense(), SS->Vsense());
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,21 @@
-- File: StepToGeom_MakeSphericalSurface.cdl
-- Created: Mon Jun 14 16:15:22 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeSphericalSurface from StepToGeom
---Purpose: This class implements the mapping between class
-- SphericalSurface from StepGeom which describes a
-- spherical_surface from Prostepand SphericalSurface from Geom
uses SphericalSurface from Geom,
SphericalSurface from StepGeom
is
Convert ( myclass; Surf : SphericalSurface from StepGeom;
CS : out SphericalSurface from Geom )
returns Boolean from Standard;
end MakeSphericalSurface;

View File

@@ -0,0 +1,28 @@
// File: StepToGeom_MakeSphericalSurface.cxx
// Created: Fri Jul 2 18:35:52 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeSphericalSurface.ixx>
#include <StepGeom_SphericalSurface.hxx>
#include <Geom_SphericalSurface.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepToGeom_MakeAxis2Placement.hxx>
#include <Geom_Axis2Placement.hxx>
#include <gp_Ax2.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' une SphericalSurface de Geom a partir d' une
// SphericalSurface de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeSphericalSurface::Convert (const Handle(StepGeom_SphericalSurface)& SS, Handle(Geom_SphericalSurface)& CS)
{
Handle(Geom_Axis2Placement) A;
if (StepToGeom_MakeAxis2Placement::Convert(SS->Position(),A))
{
CS = new Geom_SphericalSurface(A->Ax2(), SS->Radius() * UnitsMethods::LengthFactor());
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,23 @@
-- File: StepToGeom_MakeSurface.cdl
-- Created: Tue Jun 22 12:19:43 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeSurface from StepToGeom
---Purpose: This class implements the mapping between classes
-- Surface from StepGeom which describes a Surface
-- from prostep and Surface from Geom.
-- As Surface is an abstract
-- Surface this class is an access to the sub-class required.
uses Surface from Geom,
Surface from StepGeom
is
Convert ( myclass; SS : Surface from StepGeom;
CS : out Surface from Geom )
returns Boolean from Standard;
end MakeSurface;

View File

@@ -0,0 +1,120 @@
// File: StepToGeom_MakeSurface.cxx
// Created: Mon Jul 5 09:56:37 1993
// Author: Martine LANGLOIS
//:n7 abv 15.02.99: S4132: adding translation of surface_replica
//:p0 abv 19.02.99: management of 'done' flag improved
//:s5 abv 22.04.99 Adding debug printouts in catch {} blocks
//sln 03.10.01. BUC61003. creation of offset surface is corrected
#include <StepToGeom_MakeSurface.ixx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <StepGeom_Surface.hxx>
#include <StepToGeom_MakeSurface.hxx>
#include <StepGeom_BoundedSurface.hxx>
#include <StepToGeom_MakeBoundedSurface.hxx>
#include <StepGeom_ElementarySurface.hxx>
#include <StepToGeom_MakeElementarySurface.hxx>
#include <StepGeom_SweptSurface.hxx>
#include <StepToGeom_MakeSweptSurface.hxx>
//:d4
#include <StepGeom_OffsetSurface.hxx>
#include <Geom_OffsetSurface.hxx>
#include <StepGeom_SurfaceReplica.hxx>
#include <StepGeom_CartesianTransformationOperator3d.hxx>
#include <StepToGeom_MakeTransformation3d.hxx>
#include <UnitsMethods.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <TopoDS_Face.hxx>
#include <ShapeAlgo.hxx>
#include <ShapeAlgo_AlgoContainer.hxx>
#include <TopoDS.hxx>
#include <BRep_Tool.hxx>
#include <gp_Trsf.hxx>
//=============================================================================
// Creation d' une Surface de Geom a partir d' une Surface de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeSurface::Convert (const Handle(StepGeom_Surface)& SS, Handle(Geom_Surface)& CS)
{
// sln 01.10.2001 BUC61003. If entry shell is NULL do nothing
if(SS.IsNull()) {
//#ifdef DEB
// cout<<"Warning: StepToGeom_MakeSurface: Null Surface:";
//#endif
return Standard_False;
}
try {
OCC_CATCH_SIGNALS
if (SS->IsKind(STANDARD_TYPE(StepGeom_BoundedSurface))) {
const Handle(StepGeom_BoundedSurface) S1 = Handle(StepGeom_BoundedSurface)::DownCast(SS);
return StepToGeom_MakeBoundedSurface::Convert(S1,*((Handle(Geom_BoundedSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_ElementarySurface))) {
const Handle(StepGeom_ElementarySurface) S1 = Handle(StepGeom_ElementarySurface)::DownCast(SS);
return StepToGeom_MakeElementarySurface::Convert(S1,*((Handle(Geom_ElementarySurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_SweptSurface))) {
const Handle(StepGeom_SweptSurface) S1 = Handle(StepGeom_SweptSurface)::DownCast(SS);
return StepToGeom_MakeSweptSurface::Convert(S1,*((Handle(Geom_SweptSurface)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_OffsetSurface))) { //:d4 abv 12 Mar 98
const Handle(StepGeom_OffsetSurface) OS = Handle(StepGeom_OffsetSurface)::DownCast(SS);
Handle(Geom_Surface) aBasisSurface;
if (StepToGeom_MakeSurface::Convert(OS->BasisSurface(),aBasisSurface))
{
// sln 03.10.01. BUC61003. creation of offset surface is corrected
const Standard_Real anOffset = OS->Distance() * UnitsMethods::LengthFactor();
if (aBasisSurface->Continuity() == GeomAbs_C0)
{
const BRepBuilderAPI_MakeFace aBFace(aBasisSurface);
if (aBFace.IsDone())
{
const TopoDS_Shape aResult = ShapeAlgo::AlgoContainer()->C0ShapeToC1Shape(aBFace.Face(), Abs(anOffset));
if (aResult.ShapeType() == TopAbs_FACE)
{
aBasisSurface = BRep_Tool::Surface(TopoDS::Face(aResult));
}
}
}
if(aBasisSurface->Continuity() != GeomAbs_C0)
{
CS = new Geom_OffsetSurface ( aBasisSurface, anOffset );
return Standard_True;
}
}
}
else if (SS->IsKind(STANDARD_TYPE(StepGeom_SurfaceReplica))) { //:n7 abv 16 Feb 99
const Handle(StepGeom_SurfaceReplica) SR = Handle(StepGeom_SurfaceReplica)::DownCast(SS);
const Handle(StepGeom_Surface) PS = SR->ParentSurface();
const Handle(StepGeom_CartesianTransformationOperator3d) T =
Handle(StepGeom_CartesianTransformationOperator3d)::DownCast(SR->Transformation());
// protect against cyclic references and wrong type of cartop
if ( !T.IsNull() && PS != SS ) {
Handle(Geom_Surface) S1;
if (StepToGeom_MakeSurface::Convert(PS,S1))
{
gp_Trsf T1;
if (StepToGeom_MakeTransformation3d::Convert(T,T1))
{
S1->Transform ( T1 );
CS = S1;
return Standard_True;
}
}
}
}
}
catch(Standard_Failure) {
// ShapeTool_DB ?
#ifdef DEB //:s5
cout<<"Warning: StepToGeom_MakeSurface: Exception:";
Standard_Failure::Caught()->Print(cout); cout << endl;
#endif
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeSurfaceOfLinearExtrusion.cdl
-- Created: Mon Jun 14 16:16:49 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeSurfaceOfLinearExtrusion from StepToGeom
---Purpose: This class implements the mapping between class
-- SurfaceOfLinearExtrusion from StepGeom which describes a
-- surface_of_linear_extrusion from Prostep and
-- SurfaceOfLinearExtrusion from Geom.
uses SurfaceOfLinearExtrusion from Geom,
SurfaceOfLinearExtrusion from StepGeom
is
Convert ( myclass; SS : SurfaceOfLinearExtrusion from StepGeom;
CS : out SurfaceOfLinearExtrusion from Geom )
returns Boolean from Standard;
end MakeSurfaceOfLinearExtrusion;

View File

@@ -0,0 +1,37 @@
// File: StepToGeom_MakeSurfaceOfLinearExtrusion.cxx
// Created: Mon Jul 5 10:04:34 1993
// Author: Martine LANGLOIS
// sln 23.10.2001. CTS23496: Surface is not created if extrusion axis have not been succesfully created (StepToGeom_MakeSurfaceOfLinearExtrusion(...) function)
#include <StepToGeom_MakeSurfaceOfLinearExtrusion.ixx>
#include <StepGeom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_VectorWithMagnitude.hxx>
#include <StepToGeom_MakeVectorWithMagnitude.hxx>
#include <Geom_Curve.hxx>
#include <StepToGeom_MakeCurve.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
//=============================================================================
// Creation d' une SurfaceOfLinearExtrusion de Geom a partir d' une
// SurfaceOfLinearExtrusion de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeSurfaceOfLinearExtrusion::Convert (const Handle(StepGeom_SurfaceOfLinearExtrusion)& SS,
Handle(Geom_SurfaceOfLinearExtrusion)& CS)
{
Handle(Geom_Curve) C;
if (StepToGeom_MakeCurve::Convert(SS->SweptCurve(),C))
{
// sln 23.10.2001. CTS23496: Surface is not created if extrusion axis have not been succesfully created
Handle(Geom_VectorWithMagnitude) V;
if (StepToGeom_MakeVectorWithMagnitude::Convert(SS->ExtrusionAxis(),V))
{
const gp_Dir D(V->Vec());
CS = new Geom_SurfaceOfLinearExtrusion(C,D);
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeSurfaceOfRevolution.cdl
-- Created: Mon Jun 14 16:20:58 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeSurfaceOfRevolution from StepToGeom
---Purpose: This class implements the mapping between class
-- SurfaceOfRevolution from StepGeom which describes a
-- surface_of_revolution from Prostep and SurfaceOfRevolution
-- from Geom
uses SurfaceOfRevolution from Geom,
SurfaceOfRevolution from StepGeom
is
Convert ( myclass; SS : SurfaceOfRevolution from StepGeom;
CS : out SurfaceOfRevolution from Geom )
returns Boolean from Standard;
end MakeSurfaceOfRevolution;

View File

@@ -0,0 +1,56 @@
// File: StepToGeom_MakeSurfaceOfRevolution.cxx
// Created: Mon Jul 5 10:37:59 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeSurfaceOfRevolution.ixx>
#include <StepGeom_SurfaceOfRevolution.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_Axis1Placement.hxx>
#include <StepToGeom_MakeAxis1Placement.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <StepToGeom_MakeCurve.hxx>
#include <gp_Ax1.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <gp_Lin.hxx>
//=============================================================================
// Creation d' une SurfaceOfRevolution de Geom a partir d' une
// SurfaceOfRevolution de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeSurfaceOfRevolution::Convert (const Handle(StepGeom_SurfaceOfRevolution)& SS, Handle(Geom_SurfaceOfRevolution)& CS)
{
Handle(Geom_Curve) C;
if (StepToGeom_MakeCurve::Convert(SS->SweptCurve(),C))
{
Handle(Geom_Axis1Placement) A1;
if (StepToGeom_MakeAxis1Placement::Convert(SS->AxisPosition(),A1))
{
const gp_Ax1 A( A1->Ax1() );
//skl for OCC952 (one bad case revolution of circle)
if ( C->IsKind(STANDARD_TYPE(Geom_Circle)) || C->IsKind(STANDARD_TYPE(Geom_Ellipse)) )
{
const Handle(Geom_Conic) conic = Handle(Geom_Conic)::DownCast(C);
const gp_Pnt pc = conic->Location();
const gp_Lin rl (A);
if (rl.Distance(pc) < Precision::Confusion()) { //pc lies on A2
const gp_Dir dirline = A.Direction();
const gp_Dir norm = conic->Axis().Direction();
if( dirline.IsNormal(norm,Precision::Angular()) ) { //A2 lies on plane of circle
//change parametrization for trimming
gp_Ax2 axnew(pc,norm,dirline.Reversed());
conic->SetPosition(axnew);
C = new Geom_TrimmedCurve(conic, 0., PI);
}
}
}
CS = new Geom_SurfaceOfRevolution(C, A);
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -0,0 +1,23 @@
-- File: StepToGeom_MakeSweptSurface.cdl
-- Created: Tue Jun 22 14:40:20 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeSweptSurface from StepToGeom
---Purpose: This class implements the mapping between classes
-- SweptSurface from StepGeom which describes a SweptSurface
-- from prostep and SweptSurface from Geom.
-- As SweptSurface is an abstract SweptSurface this class
-- is an access to the sub-class required.
uses SweptSurface from Geom,
SweptSurface from StepGeom
is
Convert ( myclass; SS : SweptSurface from StepGeom;
CS : out SweptSurface from Geom )
returns Boolean from Standard;
end MakeSweptSurface;

View File

@@ -0,0 +1,30 @@
// File: StepToGeom_MakeSweptSurface.cxx
// Created: Mon Jul 5 10:52:45 1993
// Author: Martine LANGLOIS
//:p0 abv 19.02.99: management of 'done' flag improved
#include <StepToGeom_MakeSweptSurface.ixx>
#include <StepGeom_SweptSurface.hxx>
#include <StepToGeom_MakeSweptSurface.hxx>
#include <StepGeom_SurfaceOfLinearExtrusion.hxx>
#include <StepGeom_SurfaceOfRevolution.hxx>
#include <StepToGeom_MakeSurfaceOfLinearExtrusion.hxx>
#include <StepToGeom_MakeSurfaceOfRevolution.hxx>
//=============================================================================
// Creation d' une SweptSurface de prostep a partir d' une
// SweptSurface de Geom
//=============================================================================
Standard_Boolean StepToGeom_MakeSweptSurface::Convert (const Handle(StepGeom_SweptSurface)& SS, Handle(Geom_SweptSurface)& CS)
{
if (SS->IsKind(STANDARD_TYPE(StepGeom_SurfaceOfLinearExtrusion))) {
const Handle(StepGeom_SurfaceOfLinearExtrusion) Sur = Handle(StepGeom_SurfaceOfLinearExtrusion)::DownCast(SS);
return StepToGeom_MakeSurfaceOfLinearExtrusion::Convert(Sur,*((Handle(Geom_SurfaceOfLinearExtrusion)*)&CS));
}
if (SS->IsKind(STANDARD_TYPE(StepGeom_SurfaceOfRevolution))) {
const Handle(StepGeom_SurfaceOfRevolution) Sur = Handle(StepGeom_SurfaceOfRevolution)::DownCast(SS);
return StepToGeom_MakeSurfaceOfRevolution::Convert(Sur,*((Handle(Geom_SurfaceOfRevolution)*)&CS));
}
return Standard_False;
}

View File

@@ -0,0 +1,21 @@
-- File: StepToGeom_MakeToroidalSurface.cdl
-- Created: Mon Jun 14 16:23:51 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeToroidalSurface from StepToGeom
---Purpose: This class implements the mapping between class
-- ToroidalSurface from StepGeom which describes a
-- toroidal_surface from Prostep and ToroidalSurface from Geom
uses ToroidalSurface from Geom,
ToroidalSurface from StepGeom
is
Convert ( myclass; SS : ToroidalSurface from StepGeom;
CS : out ToroidalSurface from Geom )
returns Boolean from Standard;
end MakeToroidalSurface;

View File

@@ -0,0 +1,29 @@
// File: StepToGeom_MakeToroidalSurface.cxx
// Created: Mon Jul 5 11:06:16 1993
// Author: Martine LANGLOIS
#include <StepToGeom_MakeToroidalSurface.ixx>
#include <StepGeom_ToroidalSurface.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepToGeom_MakeAxis2Placement.hxx>
#include <Geom_Axis2Placement.hxx>
#include <gp_Ax2.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' une ToroidalSurface de Geom a partir d' une
// ToroidalSurface de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeToroidalSurface::Convert (const Handle(StepGeom_ToroidalSurface)& SS, Handle(Geom_ToroidalSurface)& CS)
{
Handle(Geom_Axis2Placement) A;
if (StepToGeom_MakeAxis2Placement::Convert(SS->Position(),A))
{
const Standard_Real LF = UnitsMethods::LengthFactor();
CS = new Geom_ToroidalSurface(A->Ax2(), Abs(SS->MajorRadius() * LF), Abs(SS->MinorRadius() * LF));
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,20 @@
-- File: StepToGeom_MakeTransformation2d.cdl
-- Created: Tue Feb 16 11:14:36 1999
-- Author: Andrey BETENEV
---Copyright: Matra Datavision 1999
class MakeTransformation2d from StepToGeom
---Purpose: Convert cartesian_transformation_operator_2d to gp_Trsf2d
uses
CartesianTransformationOperator2d from StepGeom,
Trsf2d from gp
is
Convert ( myclass; SCTO : CartesianTransformationOperator2d from StepGeom;
CT : out Trsf2d from gp)
returns Boolean from Standard;
end MakeTransformation2d;

View File

@@ -0,0 +1,41 @@
// File: StepToGeom_MakeTransformation3d.cxx
// Created: Tue Feb 16 11:18:48 1999
// Author: Andrey BETENEV
// sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is used (StepToGeom_MakeTransformation2d(...) function)
#include <StepToGeom_MakeTransformation2d.ixx>
#include <StepToGeom_MakeCartesianPoint2d.hxx>
#include <StepToGeom_MakeDirection2d.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_Direction.hxx>
#include <Geom2d_CartesianPoint.hxx>
#include <Geom2d_Direction.hxx>
#include <gp_Ax2d.hxx>
//=======================================================================
//function : StepToGeom_MakeTransformation2d
//purpose :
//=======================================================================
Standard_Boolean StepToGeom_MakeTransformation2d::Convert (const Handle(StepGeom_CartesianTransformationOperator2d)& SCTO, gp_Trsf2d& CT)
{
// NB : on ne s interesse ici qu au deplacement rigide
Handle(Geom2d_CartesianPoint) CP;
if (StepToGeom_MakeCartesianPoint2d::Convert(SCTO->LocalOrigin(),CP))
{
gp_Dir2d D1(1.,0.);
// sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is used
const Handle(StepGeom_Direction) A = SCTO->Axis1();
if (!A.IsNull())
{
Handle(Geom2d_Direction) D;
if (StepToGeom_MakeDirection2d::Convert(A,D))
D1 = D->Dir2d();
}
const gp_Ax2d result(CP->Pnt2d(),D1);
CT.SetTransformation(result);
CT = CT.Inverted();
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,20 @@
-- File: StepToGeom_MakeTransformation3d.cdl
-- Created: Tue Feb 16 11:14:36 1999
-- Author: Andrey BETENEV
---Copyright: Matra Datavision 1999
class MakeTransformation3d from StepToGeom
---Purpose: Convert cartesian_transformation_operator_3d to gp_Trsf
uses
CartesianTransformationOperator3d from StepGeom,
Trsf from gp
is
Convert ( myclass; SCTO : CartesianTransformationOperator3d from StepGeom;
CT : out Trsf from gp )
returns Boolean from Standard;
end MakeTransformation3d;

View File

@@ -0,0 +1,63 @@
// File: StepToGeom_MakeTransformation3d.cxx
// Created: Tue Feb 16 11:18:48 1999
// Author: Andrey BETENEV
// sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is used (StepToGeom_MakeTransformation3d(...) function)
#include <StepToGeom_MakeTransformation3d.ixx>
#include <StepToGeom_MakeCartesianPoint.hxx>
#include <StepToGeom_MakeDirection.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_Direction.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Direction.hxx>
#include <gp_Ax3.hxx>
//=======================================================================
//function : StepToGeom_MakeTransformation3d
//purpose :
//=======================================================================
Standard_Boolean StepToGeom_MakeTransformation3d::Convert (const Handle(StepGeom_CartesianTransformationOperator3d)& SCTO, gp_Trsf& CT)
{
Handle(Geom_CartesianPoint) CP;
if (StepToGeom_MakeCartesianPoint::Convert(SCTO->LocalOrigin(),CP))
{
const gp_Pnt Pgp = CP->Pnt();
// sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is used
gp_Dir D1(1.,0.,0.);
const Handle(StepGeom_Direction) A1 = SCTO->Axis1();
if (!A1.IsNull()) {
Handle(Geom_Direction) D;
if (StepToGeom_MakeDirection::Convert(A1,D))
D1 = D->Dir();
}
gp_Dir D2(0.,1.,0.);
const Handle(StepGeom_Direction) A2 = SCTO->Axis2();
if (!A2.IsNull()) {
Handle(Geom_Direction) D;
if (StepToGeom_MakeDirection::Convert(A2,D))
D2 = D->Dir();
}
Standard_Boolean isDefaultDirectionUsed = Standard_True;
gp_Dir D3;
const Handle(StepGeom_Direction) A3 = SCTO->Axis3();
if (!A3.IsNull()) {
Handle(Geom_Direction) D;
if(StepToGeom_MakeDirection::Convert(A3,D)) {
D3 = D->Dir();
isDefaultDirectionUsed = Standard_False;
}
}
if(isDefaultDirectionUsed)
D3 = D1.Crossed(D2);
const gp_Ax3 result(Pgp,D3,D1);
CT.SetTransformation(result);
CT = CT.Inverted(); //:n8 abv 16 Feb 99: tr8_as2_db.stp: reverse for accordance with LV tool
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeTrimmedCurve.cdl
-- Created: Fri Nov 4 10:28:03 1994
-- Author: Frederic MAUPAS
---Copyright: Matra Datavision 1994
class MakeTrimmedCurve from StepToGeom
---Purpose: This class implements the mapping between classes
-- class TrimmedCurve from StepGeom which
-- describes a Trimmed Curve from prostep and TrimmedCurve from
-- Geom.
uses TrimmedCurve from Geom,
TrimmedCurve from StepGeom
is
Convert ( myclass; SC : TrimmedCurve from StepGeom;
CC : out TrimmedCurve from Geom )
returns Boolean from Standard;
end MakeTrimmedCurve;

View File

@@ -0,0 +1,266 @@
// File: StepToGeom_MakeTrimmedCurve.cxx
// Created: Fri Nov 4 10:30:12 1994
// Author: Frederic MAUPAS
//:n9 abv 16.02.99: PRO10107: check parameters on curve with PConfusion()!
//:o6 abv 18.02.99: r0301_db #63077: application of parameter Factor moved
//:p0 abv 19.02.99: management of 'done' flag improved
//:p3 abv 23.02.99: bm4_id_punch_d.stp #1313: shift of parameters on ellipse with R1 < R2
// abv 09.02.99: S4136: eliminate using BRepAPI::Precision()
#include <StepToGeom_MakeTrimmedCurve.ixx>
#include <gp_Pnt.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Curve.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_Line.hxx>
#include <StepGeom_Vector.hxx>
#include <StepGeom_Circle.hxx>
#include <StepGeom_Ellipse.hxx>
#include <StepGeom_Parabola.hxx>
#include <StepGeom_Hyperbola.hxx>
#include <StepGeom_TrimmingSelect.hxx>
#include <StepGeom_HArray1OfTrimmingSelect.hxx>
#include <StepGeom_TrimmedCurve.hxx>
#include <StepToGeom_MakeTrimmedCurve.hxx>
#include <StepToGeom_MakeCartesianPoint.hxx>
#include <StepToGeom_MakeCurve.hxx>
//#include <GeomAPI_ProjectPointOnCurve.hxx>
//#include <BRepAPI.hxx>
#include <ElCLib.hxx>
#include <UnitsMethods.hxx>
#include <Precision.hxx>
#include <ShapeAnalysis_Curve.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
// ----------------------------------------------------------------
// ExtractParameter
// ----------------------------------------------------------------
//:o6 abv 18 Feb 99: parameter Factor added
//:p3 abv 23 Feb 99: parameter Shift added
static Standard_Boolean ExtractParameter
(const Handle(Geom_Curve) & aGeomCurve,
const Handle(StepGeom_HArray1OfTrimmingSelect) & TS,
const Standard_Integer nbSel,
const Standard_Integer MasterRep,
const Standard_Real Factor,
const Standard_Real Shift,
Standard_Real & aParam)
{
Handle(StepGeom_CartesianPoint) aPoint;
Handle(Geom_CartesianPoint) theGeomPnt;
Standard_Integer i;
//:S4136 Standard_Real precBrep = BRepAPI::Precision();
for ( i = 1 ; i <= nbSel ; i++) {
StepGeom_TrimmingSelect theSel = TS->Value(i);
if (MasterRep == 2 && theSel.CaseMember() > 0) {
aParam = Shift + Factor * theSel.ParameterValue();
return Standard_True;
}
else if (MasterRep == 1 && theSel.CaseNumber() > 0) {
aPoint = theSel.CartesianPoint();
StepToGeom_MakeCartesianPoint::Convert(aPoint,theGeomPnt);
gp_Pnt thegpPnt = theGeomPnt->Pnt();
//:S4136: use advanced algorithm
ShapeAnalysis_Curve sac;
gp_Pnt p;
sac.Project ( aGeomCurve, thegpPnt, Precision::Confusion(), p, aParam );
/* //:S4136
//Trim == natural boundary ?
if(aGeomCurve->IsKind(STANDARD_TYPE(Geom_BoundedCurve))) {
Standard_Real frstPar = aGeomCurve->FirstParameter();
Standard_Real lstPar = aGeomCurve->LastParameter();
gp_Pnt frstPnt = aGeomCurve->Value(frstPar);
gp_Pnt lstPnt = aGeomCurve->Value(lstPar);
if(frstPnt.IsEqual(thegpPnt,precBrep)) {
aParam = frstPar;
return Standard_True;
}
if(lstPnt.IsEqual(thegpPnt,precBrep)) {
aParam = lstPar;
return Standard_True;
}
}
// Project Point On Curve
GeomAPI_ProjectPointOnCurve PPOC(thegpPnt, aGeomCurve);
if (PPOC.NbPoints() == 0) {
return Standard_False;
}
aParam = PPOC.LowerDistanceParameter();
*/
return Standard_True;
}
}
// if the MasterRepresentation is unspecified:
// if a ParameterValue exists, it is prefered
for ( i = 1 ; i <= nbSel ; i++) {
StepGeom_TrimmingSelect theSel = TS->Value(i);
if (theSel.CaseMember() > 0) {
aParam = Shift + Factor * theSel.ParameterValue();
return Standard_True;
}
}
// if no ParameterValue exists, it is created from the CartesianPointValue
for ( i = 1 ; i <= nbSel ; i++) {
StepGeom_TrimmingSelect theSel = TS->Value(i);
if (theSel.CaseNumber() > 0) {
aPoint = theSel.CartesianPoint();
StepToGeom_MakeCartesianPoint::Convert(aPoint,theGeomPnt);
gp_Pnt thegpPnt = theGeomPnt->Pnt();
// Project Point On Curve
ShapeAnalysis_Curve sac;
gp_Pnt p;
sac.Project ( aGeomCurve, thegpPnt, Precision::Confusion(), p, aParam );
/*
GeomAPI_ProjectPointOnCurve PPOC(thegpPnt, aGeomCurve);
if (PPOC.NbPoints() == 0) {
return Standard_False;
}
aParam = PPOC.LowerDistanceParameter();
*/
return Standard_True;
}
}
return Standard_False; // I suppose
}
//=============================================================================
// Creation d' une Trimmed Curve de Geom a partir d' une Trimmed Curve de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeTrimmedCurve::Convert (const Handle(StepGeom_TrimmedCurve)& SC, Handle(Geom_TrimmedCurve)& CC)
{
const Handle(StepGeom_Curve) theSTEPCurve = SC->BasisCurve();
Handle(Geom_Curve) theCurve;
if (!StepToGeom_MakeCurve::Convert(theSTEPCurve,theCurve))
return Standard_False;
const Handle(StepGeom_HArray1OfTrimmingSelect)& theTrimSel1 = SC->Trim1();
const Handle(StepGeom_HArray1OfTrimmingSelect)& theTrimSel2 = SC->Trim2();
const Standard_Integer nbSel1 = SC->NbTrim1();
const Standard_Integer nbSel2 = SC->NbTrim2();
Standard_Integer MasterRep;
switch (SC->MasterRepresentation())
{
case StepGeom_tpCartesian: MasterRep = 1; break;
case StepGeom_tpParameter: MasterRep = 2; break;
default: MasterRep = 0;
}
//gka 18.02.04 analysis for case when MasterRep = .Unspecified
//and parameters are specified as CARTESIAN_POINT
Standard_Boolean isPoint = Standard_False;
if(MasterRep == 0 || (MasterRep == 2 && nbSel1 >1 && nbSel2 > 1)) {
Standard_Integer ii;
for(ii = 1; ii <= nbSel1; ii++)
{
if (!(theTrimSel1->Value(ii).CartesianPoint().IsNull()))
{
for(ii = 1; ii <= nbSel2; ii++)
{
if (!(theTrimSel2->Value(ii).CartesianPoint().IsNull()))
{
isPoint = Standard_True;
break;
}
}
break;
}
}
}
//:o6 abv 18 Feb 99: computation of factor moved
Standard_Real fact = 1., shift = 0.;
if (theSTEPCurve->IsKind(STANDARD_TYPE(StepGeom_Line))) {
const Handle(StepGeom_Line) theLine =
Handle(StepGeom_Line)::DownCast(theSTEPCurve);
fact = theLine->Dir()->Magnitude() * UnitsMethods::LengthFactor();
}
else if (theSTEPCurve->IsKind(STANDARD_TYPE(StepGeom_Circle)) ||
theSTEPCurve->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
// if (trim1 > 2.1*PI || trim2 > 2.1*PI) fact = PI / 180.;
fact = UnitsMethods::PlaneAngleFactor();
//:p3 abv 23 Feb 99: shift on pi/2 on ellipse with R1 < R2
const Handle(StepGeom_Ellipse) ellipse = Handle(StepGeom_Ellipse)::DownCast(theSTEPCurve);
if ( !ellipse.IsNull() && ellipse->SemiAxis1() - ellipse->SemiAxis2() < 0. )
shift = 0.5 * PI;
// skl 04.02.2002 for OCC133: we can not make TrimmedCurve if
// there is no X-direction in StepGeom_Axis2Placement3d
const Handle(StepGeom_Conic) conic = Handle(StepGeom_Conic)::DownCast(theSTEPCurve);
// CKY 6-FEB-2004 for Airbus-MedialAxis :
// this restriction does not apply for trimming by POINTS
if(!conic.IsNull() && MasterRep != 1) {
const StepGeom_Axis2Placement a2p = conic->Position();
if(a2p.CaseNum(a2p.Value())==2) {
if( !a2p.Axis2Placement3d()->HasRefDirection() ) {
////gka 18.02.04 analysis for case when MasterRep = .Unspecified
//and parameters are specified as CARTESIAN_POINT
if(isPoint /*&& !MasterRep*/)
MasterRep =1;
else {
if ( SC->SenseAgreement() )
CC = new Geom_TrimmedCurve(theCurve, 0., 2.*PI, Standard_True);
else
CC = new Geom_TrimmedCurve(theCurve, 2.*PI, 0., Standard_False);
return Standard_True;
}
}
}
}
}
Standard_Real trim1 = 0.;
Standard_Real trim2 = 0.;
Handle(StepGeom_CartesianPoint) TrimCP1, TrimCP2;
const Standard_Boolean FoundParam1 = ExtractParameter(theCurve, theTrimSel1, nbSel1, MasterRep, fact, shift, trim1);
const Standard_Boolean FoundParam2 = ExtractParameter(theCurve, theTrimSel2, nbSel2, MasterRep, fact, shift, trim2);
if (FoundParam1 && FoundParam2) {
const Standard_Real cf = theCurve->FirstParameter();
const Standard_Real cl = theCurve->LastParameter();
//: abv 09.04.99: S4136: bm2_ug_t4-B.stp #70610: protect against OutOfRange
if ( !theCurve->IsPeriodic() ) {
if ( trim1 < cf ) trim1 = cf;
else if ( trim1 > cl ) trim1 = cl;
if ( trim2 < cf ) trim2 = cf;
else if ( trim2 > cl ) trim2 = cl;
}
if (Abs(trim1 - trim2) < Precision::PConfusion()) {
if (theCurve->IsPeriodic()) {
ElCLib::AdjustPeriodic(cf,cl,Precision::PConfusion(),trim1,trim2);
}
else if (theCurve->IsClosed()) {
if (Abs(trim1 - cf) < Precision::PConfusion()) {
trim2 += cl;
}
else {
trim1 -= cl;
}
}
else {
//#ifdef DEBUG
// cout << "Trimming Failed" << endl;
//#endif
return Standard_False;
}
}
// CKY 16-DEC-1997 : USA60035 le texte de Part42 parle de degres
// mais des systemes ecrivent en radians. Exploiter UnitsMethods
//:o6 trim1 = trim1 * fact;
//:o6 trim2 = trim2 * fact;
if ( SC->SenseAgreement() )
CC = new Geom_TrimmedCurve(theCurve, trim1, trim2, Standard_True);
else //:abv 29.09.00 PRO20362: reverse parameters in case of reversed curve
CC = new Geom_TrimmedCurve(theCurve, trim2, trim1, Standard_False);
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeTrimmedCurve.cdl
-- Created: Fri Nov 4 10:28:03 1994
-- Author: Frederic MAUPAS
---Copyright: Matra Datavision 1994
class MakeTrimmedCurve2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- class TrimmedCurve from StepGeom which
-- describes a Trimmed Curve from prostep and TrimmedCurve from
-- Geom.
uses BSplineCurve from Geom2d,
TrimmedCurve from StepGeom
is
Convert ( myclass; SC : TrimmedCurve from StepGeom;
CC : out BSplineCurve from Geom2d )
returns Boolean from Standard;
end MakeTrimmedCurve2d;

View File

@@ -0,0 +1,91 @@
// File: StepToGeom_MakeTrimmedCurve2d.cxx
// Created: Fri Nov 4 10:30:12 1994
// Author: Frederic MAUPAS
//:p0 abv 19.02.99: management of 'done' flag improved
//:p3 abv 23.02.99: bm4_id_punch_d.stp #1313: shift of parameters on ellipse with R1 < R2
#include <StepToGeom_MakeTrimmedCurve2d.ixx>
#include <gp_Pnt2d.hxx>
#include <Geom2dConvert.hxx>
#include <Geom2d_CartesianPoint.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_Line.hxx>
#include <StepGeom_Vector.hxx>
#include <StepGeom_Circle.hxx>
#include <StepGeom_Ellipse.hxx>
#include <StepGeom_Parabola.hxx>
#include <StepGeom_Hyperbola.hxx>
#include <StepGeom_TrimmingSelect.hxx>
#include <StepGeom_HArray1OfTrimmingSelect.hxx>
#include <StepGeom_TrimmedCurve.hxx>
#include <StepToGeom_MakeTrimmedCurve2d.hxx>
#include <StepToGeom_MakeCartesianPoint2d.hxx>
#include <StepToGeom_MakeCurve2d.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d'une Trimmed Curve de Geom2d a partir d' une Trimmed Curve de Step
//=============================================================================
// Shall be completed to treat trimming with points
Standard_Boolean StepToGeom_MakeTrimmedCurve2d::Convert (const Handle(StepGeom_TrimmedCurve)& SC, Handle(Geom2d_BSplineCurve)& CC)
{
const Handle(StepGeom_Curve) BasisCurve = SC->BasisCurve();
Handle(Geom2d_Curve) theGeomBasis;
if (!StepToGeom_MakeCurve2d::Convert(BasisCurve,theGeomBasis))
return Standard_False;
if (theGeomBasis->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve))) {
CC = Handle(Geom2d_BSplineCurve)::DownCast(theGeomBasis);
return Standard_True;
}
const Handle(StepGeom_HArray1OfTrimmingSelect)& theTrimSel1 = SC->Trim1();
const Handle(StepGeom_HArray1OfTrimmingSelect)& theTrimSel2 = SC->Trim2();
const Standard_Integer nbSel1 = SC->NbTrim1();
const Standard_Integer nbSel2 = SC->NbTrim2();
if ((nbSel1 == nbSel2 == 1) &&
(theTrimSel1->Value(1).CaseMember() > 0) &&
(theTrimSel2->Value(1).CaseMember() > 0))
{
const Standard_Real u1 = theTrimSel1->Value(1).ParameterValue();
const Standard_Real u2 = theTrimSel2->Value(1).ParameterValue();
Standard_Real fact = 1., shift = 0.;
if (BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Line))) {
const Handle(StepGeom_Line) theLine = Handle(StepGeom_Line)::DownCast(BasisCurve);
fact = theLine->Dir()->Magnitude();
}
else if (BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Circle)) ||
BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
// if (u1 > 2.1*PI || u2 > 2.1*PI) fact = PI / 180.;
fact = UnitsMethods::PlaneAngleFactor();
//:p3 abv 23 Feb 99: shift on pi/2 on ellipse with R1 < R2
const Handle(StepGeom_Ellipse) ellipse = Handle(StepGeom_Ellipse)::DownCast(BasisCurve);
if ( !ellipse.IsNull() && ellipse->SemiAxis1() - ellipse->SemiAxis2() < 0. )
shift = 0.5 * PI;
}
else if (BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Parabola)) ||
BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Hyperbola))) {
// LATER !!!
}
// CKY 16-DEC-1997 : USA60035 le texte de Part42 parle de degres
// mais des systemes ecrivent en radians. Exploiter UnitsMethods
const Standard_Real newU1 = shift + u1 * fact;
const Standard_Real newU2 = shift + u2 * fact;
const Handle(Geom2d_TrimmedCurve) theTrimmed =
new Geom2d_TrimmedCurve(theGeomBasis, newU1, newU2, SC->SenseAgreement());
CC = Geom2dConvert::CurveToBSplineCurve(theTrimmed);
return Standard_True;
}
//#ifdef DEB
// else cout << "Warning: TrimmedCurve2d not translated" << endl;
//#endif
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeVectorWithMagnitude.cdl
-- Created: Mon Jun 14 15:10:06 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeVectorWithMagnitude from StepToGeom
---Purpose: This class implements the mapping between classes
-- Vector from StepGeom which describes a VectorWithMagnitude
-- from Prostep and VectorWithMagnitude from Geom.
uses
VectorWithMagnitude from Geom,
Vector from StepGeom
is
Convert ( myclass; SV : Vector from StepGeom;
CV : out VectorWithMagnitude from Geom )
returns Boolean from Standard;
end MakeVectorWithMagnitude;

View File

@@ -0,0 +1,30 @@
// File: StepToGeom_MakeVectorWithMagnitude.cxx
// Created: Mon Jul 5 11:49:43 1993
// Author: Martine LANGLOIS
// sln 22.10.2001. CTS23496: Vector is not created if direction have not been succesfully created (StepToGeom_MakeVectorWithMagnitude(...) function)
#include <StepToGeom_MakeVectorWithMagnitude.ixx>
#include <StepGeom_Vector.hxx>
#include <StepGeom_Direction.hxx>
#include <StepToGeom_MakeDirection.hxx>
#include <Geom_Direction.hxx>
#include <gp_Dir.hxx>
#include <gp_Vec.hxx>
#include <UnitsMethods.hxx>
//=============================================================================
// Creation d' un VectorWithMagnitude de Geom a partir d' un Vector de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeVectorWithMagnitude::Convert (const Handle(StepGeom_Vector)& SV, Handle(Geom_VectorWithMagnitude)& CV)
{
// sln 22.10.2001. CTS23496: Vector is not created if direction have not been succesfully created
Handle(Geom_Direction) D;
if (StepToGeom_MakeDirection::Convert(SV->Orientation(),D))
{
const gp_Vec V(D->Dir().XYZ() * SV->Magnitude() * UnitsMethods::LengthFactor());
CV = new Geom_VectorWithMagnitude(V);
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,22 @@
-- File: StepToGeom_MakeVectorWithMagnitude2d.cdl
-- Created: Wed Aug 4 11:43:33 1993
-- Author: Martine LANGLOIS
---Copyright: Matra Datavision 1993
class MakeVectorWithMagnitude2d from StepToGeom
---Purpose: This class implements the mapping between classes
-- Vector from StepGeom which describes a VectorWithMagnitude
-- from Prostep and VectorWithMagnitude from Geom2d.
uses
VectorWithMagnitude from Geom2d,
Vector from StepGeom
is
Convert ( myclass; SV : Vector from StepGeom;
CV : out VectorWithMagnitude from Geom2d )
returns Boolean from Standard;
end MakeVectorWithMagnitude2d;

View File

@@ -0,0 +1,29 @@
// File: StepToGeom_MakeVectorWithMagnitude2d.cxx
// Created: Wed Aug 4 11:45:12 1993
// Author: Martine LANGLOIS
// sln 23.10.2001. CTS23496: Vector is not created if direction have not been succesfully created (StepToGeom_MakeVectorWithMagnitude2d(...) function)
#include <StepToGeom_MakeVectorWithMagnitude2d.ixx>
#include <StepGeom_Vector.hxx>
#include <StepGeom_Direction.hxx>
#include <StepToGeom_MakeDirection2d.hxx>
#include <Geom2d_Direction.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Vec2d.hxx>
//=============================================================================
// Creation d' un VectorWithMagnitude de Geom2d a partir d' un Vector de Step
//=============================================================================
Standard_Boolean StepToGeom_MakeVectorWithMagnitude2d::Convert (const Handle(StepGeom_Vector)& SV, Handle(Geom2d_VectorWithMagnitude)& CV)
{
// sln 23.10.2001. CTS23496: Vector is not created if direction have not been succesfully created (StepToGeom_MakeVectorWithMagnitude2d(...) function)
Handle(Geom2d_Direction) D;
if (StepToGeom_MakeDirection2d::Convert(SV->Orientation(),D))
{
const gp_Vec2d V(D->Dir2d().XY() * SV->Magnitude());
CV = new Geom2d_VectorWithMagnitude(V);
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,23 @@
-- File: StepToGeom_Root.cdl
-- Created: Mon Jun 14 11:44:56 1993
-- Author: Martine LANGLOIS
-- <mla@mastox>
---Copyright: Matra Datavision 1993
private deferred class Root from StepToGeom
---Purpose : This class implements the common services for
-- all classes of StepToGeom which report error.
is
IsDone(me) returns Boolean
is static;
fields
done : Boolean is protected;
--Equal True if everything is ok, False otherwise.
end Root;

View File

@@ -0,0 +1,11 @@
// File: StepToGeom_Root.cxx
// Created: Mon Jul 5 14:31:07 1993
// Author: Martine LANGLOIS
// <mla@mastox>
#include <StepToGeom_Root.ixx>
Standard_Boolean StepToGeom_Root::IsDone () const
{
return done;
}

View File

@@ -0,0 +1,6 @@
@set %WOKSteps_UseSourceInclude = "yes";