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:
9
src/GeomToStep/FILES
Executable file
9
src/GeomToStep/FILES
Executable file
@@ -0,0 +1,9 @@
|
||||
GeomToStep_MakeAxis1Placement_gen.pxx
|
||||
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve_gen.pxx
|
||||
GeomToStep_MakeBSplineCurveWithKnots_gen.pxx
|
||||
GeomToStep_MakeCircle_gen.pxx
|
||||
GeomToStep_MakeEllipse_gen.pxx
|
||||
GeomToStep_MakeLine_gen.pxx
|
||||
GeomToStep_MakePolyline_gen.pxx
|
||||
GeomToStep_MakeVector_gen.pxx
|
||||
GeomToStep_WOKSteps.edl
|
50
src/GeomToStep/GeomToStep.cdl
Executable file
50
src/GeomToStep/GeomToStep.cdl
Executable file
@@ -0,0 +1,50 @@
|
||||
-- File: GeomToStep.cdl
|
||||
-- Created: Fri Jun 11 18:17:21 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
package GeomToStep
|
||||
|
||||
--- Purpose: Creation des entites geometriques du schema PmsAp2Demo3d a
|
||||
-- partir des entites de Geom ou de gp.
|
||||
-- Update : mise a jour pour traiter le schema StepGeom, pour demo de 94
|
||||
|
||||
uses gp, Geom, Geom2d, StepGeom, StdFail, TColgp
|
||||
|
||||
is
|
||||
|
||||
private deferred class Root;
|
||||
class MakeCartesianPoint;
|
||||
class MakeAxis1Placement;
|
||||
class MakeAxis2Placement2d;
|
||||
class MakeAxis2Placement3d;
|
||||
class MakeDirection;
|
||||
class MakeVector;
|
||||
class MakeCurve;
|
||||
class MakeConic;
|
||||
class MakeBoundedCurve;
|
||||
class MakeCircle;
|
||||
class MakeEllipse;
|
||||
class MakeHyperbola;
|
||||
class MakeParabola;
|
||||
class MakeBSplineCurveWithKnots;
|
||||
class MakeBSplineCurveWithKnotsAndRationalBSplineCurve;
|
||||
class MakeLine;
|
||||
class MakePolyline;
|
||||
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 MakeBSplineSurfaceWithKnots;
|
||||
class MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface;
|
||||
|
||||
end GeomToStep;
|
45
src/GeomToStep/GeomToStep_MakeAxis1Placement.cdl
Executable file
45
src/GeomToStep/GeomToStep_MakeAxis1Placement.cdl
Executable file
@@ -0,0 +1,45 @@
|
||||
-- File: GeomToStep_MakeAxis1Placement.cdl
|
||||
-- Created: Mon Jun 14 11:05:20 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeAxis1Placement from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Axis1Placement from Geom and Ax1 from gp, and the class
|
||||
-- Axis1Placement from StepGeom which describes an
|
||||
-- Axis1Placement from Prostep.
|
||||
--
|
||||
|
||||
uses Ax1 from gp,
|
||||
Ax2d from gp,
|
||||
Axis1Placement from Geom,
|
||||
AxisPlacement from Geom2d,
|
||||
Axis1Placement from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( A : Ax1 from gp ) returns MakeAxis1Placement;
|
||||
|
||||
Create ( A : Ax2d from gp ) returns MakeAxis1Placement;
|
||||
|
||||
Create ( A : Axis1Placement from Geom ) returns MakeAxis1Placement;
|
||||
|
||||
Create ( A : AxisPlacement from Geom2d ) returns MakeAxis1Placement;
|
||||
|
||||
Value (me) returns Axis1Placement from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theAxis1Placement : Axis1Placement from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeAxis1Placement;
|
||||
|
||||
|
72
src/GeomToStep/GeomToStep_MakeAxis1Placement.cxx
Executable file
72
src/GeomToStep/GeomToStep_MakeAxis1Placement.cxx
Executable file
@@ -0,0 +1,72 @@
|
||||
// File: GeomToStep_MakeAxis1Placement.cxx
|
||||
// Created: Tue Jun 15 18:35:17 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeAxis1Placement.ixx>
|
||||
#include <GeomToStep_MakeDirection.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Ax2d.hxx>
|
||||
#include <Geom_Axis1Placement.hxx>
|
||||
#include <Geom2d_AxisPlacement.hxx>
|
||||
#include <StepGeom_Axis1Placement.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <StepGeom_Direction.hxx>
|
||||
#include <GeomToStep_MakeDirection.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis1_placement de prostep a partir d' un Ax1 de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax1& A)
|
||||
{
|
||||
#include <GeomToStep_MakeAxis1Placement_gen.pxx>
|
||||
}
|
||||
//=============================================================================
|
||||
// Creation d' un axis1_placement de prostep a partir d' un Ax2d de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax2d& A)
|
||||
{
|
||||
#include <GeomToStep_MakeAxis1Placement_gen.pxx>
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis1_placement de prostep a partir d' un Ax1Placement de
|
||||
// Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
|
||||
( const Handle(Geom_Axis1Placement)& Axis1)
|
||||
{
|
||||
gp_Ax1 A;
|
||||
A = Axis1->Ax1();
|
||||
#include<GeomToStep_MakeAxis1Placement_gen.pxx>
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis1_placement de prostep a partir d' un AxPlacement de
|
||||
// Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
|
||||
( const Handle(Geom2d_AxisPlacement)& Axis1)
|
||||
{
|
||||
gp_Ax2d A;
|
||||
A = Axis1->Ax2d();
|
||||
#include<GeomToStep_MakeAxis1Placement_gen.pxx>
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Axis1Placement) &
|
||||
GeomToStep_MakeAxis1Placement::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theAxis1Placement;
|
||||
}
|
21
src/GeomToStep/GeomToStep_MakeAxis1Placement_gen.pxx
Executable file
21
src/GeomToStep/GeomToStep_MakeAxis1Placement_gen.pxx
Executable file
@@ -0,0 +1,21 @@
|
||||
// File: GeomToStep_MakeAxis1Placement.gxx
|
||||
// Created: Wed Jun 23 10:33:06 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
|
||||
Handle(StepGeom_Axis1Placement) Axe = new StepGeom_Axis1Placement;
|
||||
Handle(StepGeom_CartesianPoint) P;
|
||||
Handle(StepGeom_Direction) D;
|
||||
|
||||
GeomToStep_MakeCartesianPoint MkPoint(A.Location());
|
||||
GeomToStep_MakeDirection MkDir(A.Direction());
|
||||
|
||||
P = MkPoint.Value();
|
||||
D = MkDir.Value();
|
||||
Axe->SetLocation(P);
|
||||
Axe->SetAxis(D);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Axe->SetName(name);
|
||||
theAxis1Placement = Axe;
|
||||
done = Standard_True;
|
42
src/GeomToStep/GeomToStep_MakeAxis2Placement2d.cdl
Executable file
42
src/GeomToStep/GeomToStep_MakeAxis2Placement2d.cdl
Executable file
@@ -0,0 +1,42 @@
|
||||
-- File: GeomToStep_MakeAxis2Placement2d.cdl
|
||||
-- Created: Fri Aug 26 09:43:44 1994
|
||||
-- Author: Frederic MAUPAS
|
||||
-- <fma@minox>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
class MakeAxis2Placement2d from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Axis2Placement from Geom and Ax2, Ax22d from gp, and the class
|
||||
-- Axis2Placement2d from StepGeom which describes an
|
||||
-- axis2_placement_2d from Prostep.
|
||||
|
||||
uses Ax2 from gp,
|
||||
Ax22d from gp,
|
||||
Axis2Placement from Geom,
|
||||
Axis2Placement2d from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( A : Ax2 from gp ) returns MakeAxis2Placement2d;
|
||||
|
||||
Create ( A : Ax22d from gp ) returns MakeAxis2Placement2d;
|
||||
|
||||
--Create ( A : Axis2Placement from Geom ) returns MakeAxis2Placement2d;
|
||||
|
||||
Value (me) returns Axis2Placement2d from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theAxis2Placement2d : Axis2Placement2d from StepGeom;
|
||||
-- TheOP solution from StepGeom
|
||||
|
||||
end MakeAxis2Placement2d;
|
||||
|
||||
|
105
src/GeomToStep/GeomToStep_MakeAxis2Placement2d.cxx
Executable file
105
src/GeomToStep/GeomToStep_MakeAxis2Placement2d.cxx
Executable file
@@ -0,0 +1,105 @@
|
||||
// File: GeomToStep_MakeAxis2Placement2d.cxx
|
||||
// Created: Fri Aug 26 09:46:42 1994
|
||||
// Author: Frederic MAUPAS
|
||||
// <fma@minox>
|
||||
|
||||
|
||||
#include <GeomToStep_MakeAxis2Placement2d.ixx>
|
||||
#include <StepGeom_Direction.hxx>
|
||||
#include <GeomToStep_MakeDirection.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Ax22d.hxx>
|
||||
|
||||
#include <StepGeom_Axis2Placement2d.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis2_placement_2d de prostep a partir d' un Ax2 de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
|
||||
( const gp_Ax2& A)
|
||||
{
|
||||
Handle(StepGeom_Axis2Placement2d) Axe;
|
||||
Handle(StepGeom_CartesianPoint) P;
|
||||
Handle(StepGeom_Direction) D;
|
||||
|
||||
GeomToStep_MakeCartesianPoint MkPoint(A.Location());
|
||||
GeomToStep_MakeDirection MkDir(A.Direction());
|
||||
|
||||
P = MkPoint.Value();
|
||||
D = MkDir.Value();
|
||||
|
||||
Axe = new StepGeom_Axis2Placement2d;
|
||||
Axe->SetLocation(P);
|
||||
Axe->SetRefDirection(D);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Axe->SetName(name);
|
||||
theAxis2Placement2d = Axe;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis2_placement_2d de prostep a partir d' un Ax22d de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
|
||||
( const gp_Ax22d& A)
|
||||
{
|
||||
Handle(StepGeom_Axis2Placement2d) Axe;
|
||||
Handle(StepGeom_CartesianPoint) P;
|
||||
Handle(StepGeom_Direction) D1;
|
||||
|
||||
GeomToStep_MakeCartesianPoint MkPoint(A.Location());
|
||||
GeomToStep_MakeDirection MkDir(A.XDirection());
|
||||
|
||||
P = MkPoint.Value();
|
||||
D1 = MkDir.Value();
|
||||
|
||||
Axe = new StepGeom_Axis2Placement2d;
|
||||
Axe->SetLocation(P);
|
||||
Axe->SetRefDirection(D1);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Axe->SetName(name);
|
||||
theAxis2Placement2d = Axe;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis2_placement_2d de prostep a partir d' un Axis2Placement
|
||||
// de Geom
|
||||
//=============================================================================
|
||||
|
||||
//GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
|
||||
// ( const Handle(Geom_Axis2Placement)& Axis2)
|
||||
//{
|
||||
// Handle(StepGeom_Axis2Placement2d) Axe;
|
||||
// Handle(StepGeom_CartesianPoint) P;
|
||||
// Handle(StepGeom_Direction) D1, D2;
|
||||
// gp_Ax2 A;
|
||||
|
||||
// A = Axis2->Ax2();
|
||||
// P = GeomToStep_MakeCartesianPoint(A.Location());
|
||||
// D1 = GeomToStep_MakeDirection(A.Direction());
|
||||
// D2 = GeomToStep_MakeDirection(A.XDirection());
|
||||
// Axe = new StepGeom_Axis2Placement2d;
|
||||
// Axe->SetLocation(P);
|
||||
// Axe->SetAxis(D1);
|
||||
// Axe->SetRefDirection(D2);
|
||||
// theAxis2Placement2d = Axe;
|
||||
// done = Standard_True;
|
||||
//}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Axis2Placement2d) &
|
||||
GeomToStep_MakeAxis2Placement2d::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theAxis2Placement2d;
|
||||
}
|
47
src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cdl
Executable file
47
src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cdl
Executable file
@@ -0,0 +1,47 @@
|
||||
-- File: GeomToStep_MakeAxis2Placementd.cdl
|
||||
-- Created: Mon Jun 14 11:17:16 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeAxis2Placement3d from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Axis2Placement from Geom and Ax2, Ax3 from gp, and the class
|
||||
-- Axis2Placement3d from StepGeom which describes an
|
||||
-- axis2_placement_3d from Prostep.
|
||||
|
||||
uses Ax2 from gp,
|
||||
Ax3 from gp,
|
||||
Trsf from gp,
|
||||
Axis2Placement from Geom,
|
||||
Axis2Placement3d from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create returns MakeAxis2Placement3d;
|
||||
-- creates an identity (original axis)
|
||||
|
||||
Create ( A : Ax2 from gp ) returns MakeAxis2Placement3d;
|
||||
|
||||
Create ( A : Ax3 from gp ) returns MakeAxis2Placement3d;
|
||||
|
||||
Create ( T : Trsf from gp) returns MakeAxis2Placement3d;
|
||||
|
||||
Create ( A : Axis2Placement from Geom ) returns MakeAxis2Placement3d;
|
||||
|
||||
Value (me) returns Axis2Placement3d from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theAxis2Placement3d : Axis2Placement3d from StepGeom;
|
||||
-- TheOP solution from StepGeom
|
||||
|
||||
end MakeAxis2Placement3d;
|
||||
|
||||
|
126
src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx
Executable file
126
src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx
Executable file
@@ -0,0 +1,126 @@
|
||||
// File: GeomToStep_MakeAxis2Placement3d.cxx
|
||||
// Created: Wed Jun 16 11:05:22 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeAxis2Placement3d.ixx>
|
||||
#include <StepGeom_Direction.hxx>
|
||||
#include <GeomToStep_MakeDirection.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <Geom_Axis2Placement.hxx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
static Handle(StepGeom_Axis2Placement3d) MakeAxis2Placement3d
|
||||
(const gp_Pnt& O, const gp_Dir& D, const gp_Dir& X, const Standard_CString nom)
|
||||
{
|
||||
Handle(StepGeom_Axis2Placement3d) Axe;
|
||||
Handle(StepGeom_CartesianPoint) P;
|
||||
Handle(StepGeom_Direction) D1, D2;
|
||||
|
||||
GeomToStep_MakeCartesianPoint MkPoint(O);
|
||||
GeomToStep_MakeDirection MkDir1(D);
|
||||
GeomToStep_MakeDirection MkDir2(X);
|
||||
|
||||
P = MkPoint.Value();
|
||||
D1 = MkDir1.Value();
|
||||
D2 = MkDir2.Value();
|
||||
|
||||
Axe = new StepGeom_Axis2Placement3d;
|
||||
Axe->SetLocation(P);
|
||||
Axe->SetAxis(D1);
|
||||
Axe->SetRefDirection(D2);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString(nom);
|
||||
Axe->SetName(name);
|
||||
return Axe;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis2_placement_3d a l origine
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d ( )
|
||||
{
|
||||
gp_Ax2 A (gp_Pnt(0.,0.,0.), gp_Dir (0.,0.,1.), gp_Dir (1.,0.,0.));
|
||||
// le reste inchange
|
||||
|
||||
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
|
||||
(A.Location(), A.Direction(), A.XDirection(), "");
|
||||
theAxis2Placement3d = Axe;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis2_placement_3d de prostep a partir d' un Ax2 de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d( const gp_Ax2&
|
||||
A)
|
||||
{
|
||||
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
|
||||
(A.Location(), A.Direction(), A.XDirection(), "");
|
||||
theAxis2Placement3d = Axe;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis2_placement_3d de prostep a partir d' un Ax3 de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
|
||||
( const gp_Ax3& A)
|
||||
{
|
||||
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
|
||||
(A.Location(), A.Direction(), A.XDirection(), "");
|
||||
theAxis2Placement3d = Axe;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis2_placement_3d de prostep a partir d' un Trsf de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
|
||||
( const gp_Trsf& T)
|
||||
{
|
||||
gp_Ax2 A (gp_Pnt(0.,0.,0.), gp_Dir (0.,0.,1.), gp_Dir (1.,0.,0.));
|
||||
A.Transform (T);
|
||||
// le reste inchange
|
||||
|
||||
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
|
||||
(A.Location(), A.Direction(), A.XDirection(), "");
|
||||
theAxis2Placement3d = Axe;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un axis2_placement_3d de prostep a partir d' un Axis2Placement
|
||||
// de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
|
||||
( const Handle(Geom_Axis2Placement)& Axis2)
|
||||
{
|
||||
gp_Ax2 A;
|
||||
A = Axis2->Ax2();
|
||||
|
||||
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
|
||||
(A.Location(), A.Direction(), A.XDirection(), "");
|
||||
theAxis2Placement3d = Axe;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Axis2Placement3d) &
|
||||
GeomToStep_MakeAxis2Placement3d::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theAxis2Placement3d;
|
||||
}
|
45
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots.cdl
Executable file
45
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots.cdl
Executable file
@@ -0,0 +1,45 @@
|
||||
-- File: GeomToStep_MakeBSplineCurveWithKnots.cdl
|
||||
-- Created: Thu Aug 5 16:05:05 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeBSplineCurveWithKnots from GeomToStep inherits
|
||||
Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- BSplineCurve from Geom, Geom2d and the class
|
||||
-- BSplineCurveWithKnots from StepGeom
|
||||
-- which describes a bspline_curve_with_knots from
|
||||
-- Prostep
|
||||
|
||||
uses
|
||||
|
||||
BSplineCurve from Geom,
|
||||
BSplineCurve from Geom2d,
|
||||
BSplineCurveWithKnots from StepGeom
|
||||
|
||||
raises
|
||||
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( Bsplin : BSplineCurve from Geom ) returns
|
||||
MakeBSplineCurveWithKnots;
|
||||
|
||||
Create ( Bsplin : BSplineCurve from Geom2d ) returns
|
||||
MakeBSplineCurveWithKnots;
|
||||
Value (me) returns
|
||||
BSplineCurveWithKnots from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theBSplineCurveWithKnots :
|
||||
BSplineCurveWithKnots from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeBSplineCurveWithKnots;
|
59
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots.cxx
Executable file
59
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots.cxx
Executable file
@@ -0,0 +1,59 @@
|
||||
// File: GeomToStep_MakeBSplineCurveWithKnots.cxx
|
||||
// Created: Thu Aug 5 16:08:11 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeBSplineCurveWithKnots.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <StepGeom_BSplineCurveWithKnots.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <StepGeom_HArray1OfCartesianPoint.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <GeomAbs_BSplKnotDistribution.hxx>
|
||||
#include <StepGeom_KnotType.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une bspline_curve_with_knots de
|
||||
// prostep a partir d' une BSplineCurve de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeBSplineCurveWithKnots::
|
||||
GeomToStep_MakeBSplineCurveWithKnots( const
|
||||
Handle(Geom_BSplineCurve)& BS )
|
||||
|
||||
{
|
||||
#define Array1OfPnt_gen TColgp_Array1OfPnt
|
||||
#include <GeomToStep_MakeBSplineCurveWithKnots_gen.pxx>
|
||||
#undef Array1OfPnt_gen
|
||||
}
|
||||
//=============================================================================
|
||||
// Creation d' une bspline_curve_with_knots de
|
||||
// prostep a partir d' une BSplineCurve de Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeBSplineCurveWithKnots::
|
||||
GeomToStep_MakeBSplineCurveWithKnots( const
|
||||
Handle(Geom2d_BSplineCurve)& BS )
|
||||
|
||||
{
|
||||
#define Array1OfPnt_gen TColgp_Array1OfPnt2d
|
||||
#include <GeomToStep_MakeBSplineCurveWithKnots_gen.pxx>
|
||||
#undef Array1OfPnt_gen
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_BSplineCurveWithKnots) &
|
||||
GeomToStep_MakeBSplineCurveWithKnots::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theBSplineCurveWithKnots;
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
-- File: GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.cdl
|
||||
-- Created: Mon Jun 14 15:22:02 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeBSplineCurveWithKnotsAndRationalBSplineCurve from GeomToStep inherits
|
||||
Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- BSplineCurve from Geom, Geom2d and the class
|
||||
-- BSplineCurveWithKnotsAndRationalBSplineCurve from StepGeom
|
||||
-- which describes a rational_bspline_curve_with_knots from
|
||||
-- Prostep
|
||||
|
||||
uses
|
||||
|
||||
BSplineCurve from Geom,
|
||||
BSplineCurve from Geom2d,
|
||||
BSplineCurveWithKnotsAndRationalBSplineCurve from StepGeom
|
||||
|
||||
raises
|
||||
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( Bsplin : BSplineCurve from Geom ) returns
|
||||
MakeBSplineCurveWithKnotsAndRationalBSplineCurve;
|
||||
|
||||
Create ( Bsplin : BSplineCurve from Geom2d ) returns
|
||||
MakeBSplineCurveWithKnotsAndRationalBSplineCurve;
|
||||
Value (me) returns
|
||||
BSplineCurveWithKnotsAndRationalBSplineCurve from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theBSplineCurveWithKnotsAndRationalBSplineCurve :
|
||||
BSplineCurveWithKnotsAndRationalBSplineCurve from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeBSplineCurveWithKnotsAndRationalBSplineCurve;
|
@@ -0,0 +1,59 @@
|
||||
// File: GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.cxx
|
||||
// Created: Wed Jun 16 11:45:37 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <StepGeom_HArray1OfCartesianPoint.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <GeomAbs_BSplKnotDistribution.hxx>
|
||||
#include <StepGeom_KnotType.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une bspline_curve_with_knots_and_rational_bspline_curve de
|
||||
// prostep a partir d' une BSplineCurve de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve::
|
||||
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve( const
|
||||
Handle(Geom_BSplineCurve)& BS )
|
||||
|
||||
{
|
||||
#define Array1OfPnt_gen TColgp_Array1OfPnt
|
||||
#include <GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve_gen.pxx>
|
||||
#undef Array1OfPnt_gen
|
||||
}
|
||||
//=============================================================================
|
||||
// Creation d' une bspline_curve_with_knots_and_rational_bspline_curve de
|
||||
// prostep a partir d' une BSplineCurve de Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve::
|
||||
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve( const
|
||||
Handle(Geom2d_BSplineCurve)& BS )
|
||||
|
||||
{
|
||||
#define Array1OfPnt_gen TColgp_Array1OfPnt2d
|
||||
#include <GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve_gen.pxx>
|
||||
#undef Array1OfPnt_gen
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) &
|
||||
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theBSplineCurveWithKnotsAndRationalBSplineCurve;
|
||||
}
|
@@ -0,0 +1,81 @@
|
||||
// File: GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.gxx
|
||||
// Created: Wed Jun 23 14:53:10 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
|
||||
Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) BSWK;
|
||||
Standard_Integer Deg, N, i, Nknots, itampon;
|
||||
Standard_Real rtampon;
|
||||
Handle(StepGeom_CartesianPoint) Pt = new StepGeom_CartesianPoint;
|
||||
Handle(StepGeom_HArray1OfCartesianPoint) Listpoints;
|
||||
StepGeom_BSplineCurveForm Form;
|
||||
StepData_Logical Fermeture, Selfinter;
|
||||
Handle(TColStd_HArray1OfInteger) Mult;
|
||||
Handle(TColStd_HArray1OfReal) ListKnots, ListWeights;
|
||||
GeomAbs_BSplKnotDistribution Distribution;
|
||||
StepGeom_KnotType KnotSpec;
|
||||
|
||||
Deg = BS->Degree();
|
||||
|
||||
N = BS->NbPoles();
|
||||
Array1OfPnt_gen P(1,N);
|
||||
BS->Poles(P);
|
||||
Listpoints = new StepGeom_HArray1OfCartesianPoint(1,N);
|
||||
for ( i=P.Lower(); i<=P.Upper(); i++) {
|
||||
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i));
|
||||
Pt = MkPoint.Value();
|
||||
Listpoints->SetValue(i, Pt);
|
||||
}
|
||||
|
||||
Form = StepGeom_bscfUnspecified;
|
||||
|
||||
if (BS->IsClosed())
|
||||
Fermeture = StepData_LTrue;
|
||||
else
|
||||
Fermeture = StepData_LFalse;
|
||||
|
||||
Selfinter = StepData_LFalse;
|
||||
|
||||
Nknots = BS->NbKnots();
|
||||
TColStd_Array1OfInteger M(1,Nknots);
|
||||
BS->Multiplicities(M);
|
||||
Mult = new TColStd_HArray1OfInteger(1,Nknots);
|
||||
for ( i=M.Lower(); i<=M.Upper(); i++) {
|
||||
itampon = M.Value(i);
|
||||
Mult->SetValue(i, itampon);
|
||||
}
|
||||
|
||||
TColStd_Array1OfReal K(1,Nknots);
|
||||
BS->Knots(K);
|
||||
ListKnots = new TColStd_HArray1OfReal(1,Nknots);
|
||||
for ( i=K.Lower(); i<=K.Upper(); i++) {
|
||||
rtampon = K.Value(i);
|
||||
ListKnots->SetValue(i, rtampon);
|
||||
}
|
||||
|
||||
Distribution = BS->KnotDistribution();
|
||||
if ( Distribution == GeomAbs_NonUniform )
|
||||
KnotSpec = StepGeom_ktUnspecified;
|
||||
else if ( Distribution == GeomAbs_Uniform )
|
||||
KnotSpec = StepGeom_ktUniformKnots;
|
||||
else if ( Distribution == GeomAbs_QuasiUniform )
|
||||
KnotSpec = StepGeom_ktQuasiUniformKnots;
|
||||
else
|
||||
KnotSpec = StepGeom_ktPiecewiseBezierKnots;
|
||||
|
||||
TColStd_Array1OfReal W(1,N);
|
||||
BS->Weights(W);
|
||||
ListWeights = new TColStd_HArray1OfReal(1,N);
|
||||
for ( i=W.Lower(); i<=W.Upper(); i++) {
|
||||
rtampon = W.Value(i);
|
||||
ListWeights->SetValue(i, rtampon);
|
||||
}
|
||||
|
||||
BSWK = new StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
BSWK->Init(name, Deg, Listpoints, Form, Fermeture, Selfinter, Mult,
|
||||
ListKnots, KnotSpec, ListWeights );
|
||||
|
||||
theBSplineCurveWithKnotsAndRationalBSplineCurve = BSWK;
|
||||
done = Standard_True;
|
73
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots_gen.pxx
Executable file
73
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots_gen.pxx
Executable file
@@ -0,0 +1,73 @@
|
||||
// File: GeomToStep_MakeBSplineCurveWithKnots_gen.gxx
|
||||
// Created: Thu Aug 5 16:13:17 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
|
||||
Handle(StepGeom_BSplineCurveWithKnots) BSWK;
|
||||
Standard_Integer Deg, N, i, Nknots, itampon;
|
||||
Standard_Real rtampon;
|
||||
Handle(StepGeom_CartesianPoint) Pt = new StepGeom_CartesianPoint;
|
||||
Handle(StepGeom_HArray1OfCartesianPoint) Listpoints;
|
||||
StepGeom_BSplineCurveForm Form;
|
||||
StepData_Logical Fermeture, Selfinter;
|
||||
Handle(TColStd_HArray1OfInteger) Mult;
|
||||
Handle(TColStd_HArray1OfReal) ListKnots, ListWeights;
|
||||
GeomAbs_BSplKnotDistribution Distribution;
|
||||
StepGeom_KnotType KnotSpec;
|
||||
|
||||
Deg = BS->Degree();
|
||||
|
||||
N = BS->NbPoles();
|
||||
Array1OfPnt_gen P(1,N);
|
||||
BS->Poles(P);
|
||||
Listpoints = new StepGeom_HArray1OfCartesianPoint(1,N);
|
||||
for ( i=P.Lower(); i<=P.Upper(); i++) {
|
||||
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i));
|
||||
Pt = MkPoint.Value();
|
||||
Listpoints->SetValue(i, Pt);
|
||||
}
|
||||
|
||||
Form = StepGeom_bscfUnspecified;
|
||||
|
||||
if (BS->IsClosed())
|
||||
Fermeture = StepData_LTrue;
|
||||
else
|
||||
Fermeture = StepData_LFalse;
|
||||
|
||||
Selfinter = StepData_LFalse;
|
||||
|
||||
Nknots = BS->NbKnots();
|
||||
TColStd_Array1OfInteger M(1,Nknots);
|
||||
BS->Multiplicities(M);
|
||||
Mult = new TColStd_HArray1OfInteger(1,Nknots);
|
||||
for ( i=M.Lower(); i<=M.Upper(); i++) {
|
||||
itampon = M.Value(i);
|
||||
Mult->SetValue(i, itampon);
|
||||
}
|
||||
|
||||
TColStd_Array1OfReal K(1,Nknots);
|
||||
BS->Knots(K);
|
||||
ListKnots = new TColStd_HArray1OfReal(1,Nknots);
|
||||
for ( i=K.Lower(); i<=K.Upper(); i++) {
|
||||
rtampon = K.Value(i);
|
||||
ListKnots->SetValue(i, rtampon);
|
||||
}
|
||||
|
||||
Distribution = BS->KnotDistribution();
|
||||
if ( Distribution == GeomAbs_NonUniform )
|
||||
KnotSpec = StepGeom_ktUnspecified;
|
||||
else if ( Distribution == GeomAbs_Uniform )
|
||||
KnotSpec = StepGeom_ktUniformKnots;
|
||||
else if ( Distribution == GeomAbs_QuasiUniform )
|
||||
KnotSpec = StepGeom_ktQuasiUniformKnots;
|
||||
else
|
||||
KnotSpec = StepGeom_ktPiecewiseBezierKnots;
|
||||
|
||||
BSWK = new StepGeom_BSplineCurveWithKnots;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
BSWK->Init(name, Deg, Listpoints, Form, Fermeture, Selfinter, Mult,
|
||||
ListKnots, KnotSpec );
|
||||
|
||||
theBSplineCurveWithKnots = BSWK;
|
||||
done = Standard_True;
|
40
src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnots.cdl
Executable file
40
src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnots.cdl
Executable file
@@ -0,0 +1,40 @@
|
||||
-- File: GeomToStep_MakeBSplineSurfaceWithKnots.cdl
|
||||
-- Created: Thu Aug 5 16:48:07 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeBSplineSurfaceWithKnots from GeomToStep
|
||||
inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between class
|
||||
-- BSplineSurface from Geom and the class
|
||||
-- BSplineSurfaceWithKnots from
|
||||
-- StepGeom which describes a
|
||||
-- bspline_Surface_with_knots from Prostep
|
||||
|
||||
uses BSplineSurface from Geom,
|
||||
BSplineSurfaceWithKnots from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( Bsplin : BSplineSurface from Geom ) returns
|
||||
MakeBSplineSurfaceWithKnots;
|
||||
|
||||
Value (me) returns
|
||||
BSplineSurfaceWithKnots from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theBSplineSurfaceWithKnots :
|
||||
BSplineSurfaceWithKnots from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeBSplineSurfaceWithKnots;
|
||||
|
||||
|
142
src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnots.cxx
Executable file
142
src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnots.cxx
Executable file
@@ -0,0 +1,142 @@
|
||||
// File: GeomToStep_MakeBSplineSurfaceWithKnots.cxx
|
||||
// Created: Thu Aug 5 16:54:42 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeBSplineSurfaceWithKnots.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <StepGeom_BSplineSurfaceWithKnots.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <StepGeom_HArray2OfCartesianPoint.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_HArray2OfReal.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <GeomAbs_BSplKnotDistribution.hxx>
|
||||
#include <StepGeom_KnotType.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une bspline_Surface_with_knots_and_rational_bspline_Surface de
|
||||
// prostep a partir d' une BSplineSurface de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeBSplineSurfaceWithKnots::
|
||||
GeomToStep_MakeBSplineSurfaceWithKnots( const
|
||||
Handle(Geom_BSplineSurface)& BS )
|
||||
|
||||
{
|
||||
Handle(StepGeom_BSplineSurfaceWithKnots) BSWK;
|
||||
Standard_Integer aUDegree, aVDegree, NU, NV, i, j, NUknots, NVknots, itampon;
|
||||
Standard_Real rtampon;
|
||||
Handle(StepGeom_CartesianPoint) Pt = new StepGeom_CartesianPoint;
|
||||
Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList;
|
||||
StepGeom_BSplineSurfaceForm aSurfaceForm;
|
||||
StepData_Logical aUClosed, aVClosed, aSelfIntersect;
|
||||
Handle(TColStd_HArray1OfInteger) aUMultiplicities, aVMultiplicities;
|
||||
Handle(TColStd_HArray1OfReal) aUKnots, aVKnots;
|
||||
Handle(TColStd_HArray2OfReal) aWeightsData;
|
||||
GeomAbs_BSplKnotDistribution UDistribution, VDistribution;
|
||||
StepGeom_KnotType KnotSpec;
|
||||
|
||||
aUDegree = BS->UDegree();
|
||||
aVDegree = BS->VDegree();
|
||||
|
||||
NU = BS->NbUPoles();
|
||||
NV = BS->NbVPoles();
|
||||
TColgp_Array2OfPnt P(1,NU,1,NV);
|
||||
BS->Poles(P);
|
||||
aControlPointsList = new StepGeom_HArray2OfCartesianPoint(1,NU,1,NV);
|
||||
for ( i=P.LowerRow(); i<=P.UpperRow(); i++) {
|
||||
for ( j=P.LowerCol(); j<=P.UpperCol(); j++) {
|
||||
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i,j));
|
||||
Pt = MkPoint.Value();
|
||||
aControlPointsList->SetValue(i, j, Pt);
|
||||
}
|
||||
}
|
||||
|
||||
aSurfaceForm = StepGeom_bssfUnspecified;
|
||||
|
||||
if (BS->IsUClosed())
|
||||
aUClosed = StepData_LTrue;
|
||||
else
|
||||
aUClosed = StepData_LFalse;
|
||||
|
||||
if (BS->IsVClosed())
|
||||
aVClosed = StepData_LTrue;
|
||||
else
|
||||
aVClosed = StepData_LFalse;
|
||||
|
||||
aSelfIntersect = StepData_LFalse;
|
||||
|
||||
NUknots = BS->NbUKnots();
|
||||
NVknots = BS->NbVKnots();
|
||||
TColStd_Array1OfInteger MU(1,NUknots);
|
||||
BS->UMultiplicities(MU);
|
||||
aUMultiplicities = new TColStd_HArray1OfInteger(1,NUknots);
|
||||
for ( i=MU.Lower(); i<=MU.Upper(); i++) {
|
||||
itampon = MU.Value(i);
|
||||
aUMultiplicities->SetValue(i, itampon);
|
||||
}
|
||||
TColStd_Array1OfInteger MV(1,NVknots);
|
||||
BS->VMultiplicities(MV);
|
||||
aVMultiplicities = new TColStd_HArray1OfInteger(1,NVknots);
|
||||
for ( i=MV.Lower(); i<=MV.Upper(); i++) {
|
||||
itampon = MV.Value(i);
|
||||
aVMultiplicities->SetValue(i, itampon);
|
||||
}
|
||||
|
||||
TColStd_Array1OfReal KU(1,NUknots);
|
||||
TColStd_Array1OfReal KV(1,NVknots);
|
||||
BS->UKnots(KU);
|
||||
BS->VKnots(KV);
|
||||
aUKnots = new TColStd_HArray1OfReal(1,NUknots);
|
||||
aVKnots = new TColStd_HArray1OfReal(1,NVknots);
|
||||
for ( i=KU.Lower(); i<=KU.Upper(); i++) {
|
||||
rtampon = KU.Value(i);
|
||||
aUKnots->SetValue(i, rtampon);
|
||||
}
|
||||
for ( i=KV.Lower(); i<=KV.Upper(); i++) {
|
||||
rtampon = KV.Value(i);
|
||||
aVKnots->SetValue(i, rtampon);
|
||||
}
|
||||
|
||||
UDistribution = BS->UKnotDistribution();
|
||||
VDistribution = BS->VKnotDistribution();
|
||||
if ( UDistribution == GeomAbs_NonUniform &&
|
||||
VDistribution == GeomAbs_NonUniform )
|
||||
KnotSpec = StepGeom_ktUnspecified;
|
||||
else if ( UDistribution == GeomAbs_Uniform &&
|
||||
VDistribution == GeomAbs_Uniform )
|
||||
KnotSpec = StepGeom_ktUniformKnots;
|
||||
else if ( UDistribution == GeomAbs_QuasiUniform &&
|
||||
VDistribution == GeomAbs_QuasiUniform )
|
||||
KnotSpec = StepGeom_ktQuasiUniformKnots;
|
||||
else if ( UDistribution == GeomAbs_PiecewiseBezier &&
|
||||
VDistribution == GeomAbs_PiecewiseBezier )
|
||||
KnotSpec = StepGeom_ktPiecewiseBezierKnots;
|
||||
else
|
||||
KnotSpec = StepGeom_ktUnspecified;
|
||||
|
||||
BSWK = new StepGeom_BSplineSurfaceWithKnots;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
BSWK->Init(name, aUDegree, aVDegree, aControlPointsList, aSurfaceForm,
|
||||
aUClosed, aVClosed, aSelfIntersect, aUMultiplicities,
|
||||
aVMultiplicities, aUKnots, aVKnots, KnotSpec );
|
||||
|
||||
theBSplineSurfaceWithKnots = BSWK;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_BSplineSurfaceWithKnots) &
|
||||
GeomToStep_MakeBSplineSurfaceWithKnots::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theBSplineSurfaceWithKnots;
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
-- File: GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface
|
||||
-- .cdl
|
||||
-- Created: Tue Jun 22 10:33:07 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface from GeomToStep
|
||||
inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between class
|
||||
-- BSplineSurface from Geom and the class
|
||||
-- BSplineSurfaceWithKnotsAndRationalBSplineSurface from
|
||||
-- StepGeom which describes a
|
||||
-- rational_bspline_Surface_with_knots from Prostep
|
||||
|
||||
uses BSplineSurface from Geom,
|
||||
BSplineSurfaceWithKnotsAndRationalBSplineSurface from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( Bsplin : BSplineSurface from Geom ) returns
|
||||
MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface;
|
||||
|
||||
Value (me) returns
|
||||
BSplineSurfaceWithKnotsAndRationalBSplineSurface from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theBSplineSurfaceWithKnotsAndRationalBSplineSurface :
|
||||
BSplineSurfaceWithKnotsAndRationalBSplineSurface from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface;
|
||||
|
||||
|
@@ -0,0 +1,153 @@
|
||||
// File: GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface
|
||||
// .cxx
|
||||
// Created: Tue Jun 22 10:36:28 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <StepGeom_HArray2OfCartesianPoint.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_HArray2OfReal.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <GeomAbs_BSplKnotDistribution.hxx>
|
||||
#include <StepGeom_KnotType.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une bspline_Surface_with_knots_and_rational_bspline_Surface de
|
||||
// prostep a partir d' une BSplineSurface de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface::
|
||||
GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface( const
|
||||
Handle(Geom_BSplineSurface)& BS )
|
||||
|
||||
{
|
||||
Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BSWK;
|
||||
Standard_Integer aUDegree, aVDegree, NU, NV, i, j, NUknots, NVknots, itampon;
|
||||
Standard_Real rtampon;
|
||||
Handle(StepGeom_CartesianPoint) Pt = new StepGeom_CartesianPoint;
|
||||
Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList;
|
||||
StepGeom_BSplineSurfaceForm aSurfaceForm;
|
||||
StepData_Logical aUClosed, aVClosed, aSelfIntersect;
|
||||
Handle(TColStd_HArray1OfInteger) aUMultiplicities, aVMultiplicities;
|
||||
Handle(TColStd_HArray1OfReal) aUKnots, aVKnots;
|
||||
Handle(TColStd_HArray2OfReal) aWeightsData;
|
||||
GeomAbs_BSplKnotDistribution UDistribution, VDistribution;
|
||||
StepGeom_KnotType KnotSpec;
|
||||
|
||||
aUDegree = BS->UDegree();
|
||||
aVDegree = BS->VDegree();
|
||||
|
||||
NU = BS->NbUPoles();
|
||||
NV = BS->NbVPoles();
|
||||
TColgp_Array2OfPnt P(1,NU,1,NV);
|
||||
BS->Poles(P);
|
||||
aControlPointsList = new StepGeom_HArray2OfCartesianPoint(1,NU,1,NV);
|
||||
for ( i=P.LowerRow(); i<=P.UpperRow(); i++) {
|
||||
for ( j=P.LowerCol(); j<=P.UpperCol(); j++) {
|
||||
GeomToStep_MakeCartesianPoint MkPoint(P.Value(i,j));
|
||||
Pt = MkPoint.Value();
|
||||
aControlPointsList->SetValue(i, j, Pt);
|
||||
}
|
||||
}
|
||||
|
||||
aSurfaceForm = StepGeom_bssfUnspecified;
|
||||
|
||||
if (BS->IsUClosed())
|
||||
aUClosed = StepData_LTrue;
|
||||
else
|
||||
aUClosed = StepData_LFalse;
|
||||
|
||||
if (BS->IsVClosed())
|
||||
aVClosed = StepData_LTrue;
|
||||
else
|
||||
aVClosed = StepData_LFalse;
|
||||
|
||||
aSelfIntersect = StepData_LFalse;
|
||||
|
||||
NUknots = BS->NbUKnots();
|
||||
NVknots = BS->NbVKnots();
|
||||
TColStd_Array1OfInteger MU(1,NUknots);
|
||||
BS->UMultiplicities(MU);
|
||||
aUMultiplicities = new TColStd_HArray1OfInteger(1,NUknots);
|
||||
for ( i=MU.Lower(); i<=MU.Upper(); i++) {
|
||||
itampon = MU.Value(i);
|
||||
aUMultiplicities->SetValue(i, itampon);
|
||||
}
|
||||
TColStd_Array1OfInteger MV(1,NVknots);
|
||||
BS->VMultiplicities(MV);
|
||||
aVMultiplicities = new TColStd_HArray1OfInteger(1,NVknots);
|
||||
for ( i=MV.Lower(); i<=MV.Upper(); i++) {
|
||||
itampon = MV.Value(i);
|
||||
aVMultiplicities->SetValue(i, itampon);
|
||||
}
|
||||
|
||||
TColStd_Array1OfReal KU(1,NUknots);
|
||||
TColStd_Array1OfReal KV(1,NVknots);
|
||||
BS->UKnots(KU);
|
||||
BS->VKnots(KV);
|
||||
aUKnots = new TColStd_HArray1OfReal(1,NUknots);
|
||||
aVKnots = new TColStd_HArray1OfReal(1,NVknots);
|
||||
for ( i=KU.Lower(); i<=KU.Upper(); i++) {
|
||||
rtampon = KU.Value(i);
|
||||
aUKnots->SetValue(i, rtampon);
|
||||
}
|
||||
for ( i=KV.Lower(); i<=KV.Upper(); i++) {
|
||||
rtampon = KV.Value(i);
|
||||
aVKnots->SetValue(i, rtampon);
|
||||
}
|
||||
|
||||
UDistribution = BS->UKnotDistribution();
|
||||
VDistribution = BS->VKnotDistribution();
|
||||
if ( UDistribution == GeomAbs_NonUniform &&
|
||||
VDistribution == GeomAbs_NonUniform )
|
||||
KnotSpec = StepGeom_ktUnspecified;
|
||||
else if ( UDistribution == GeomAbs_Uniform &&
|
||||
VDistribution == GeomAbs_Uniform )
|
||||
KnotSpec = StepGeom_ktUniformKnots;
|
||||
else if ( UDistribution == GeomAbs_QuasiUniform &&
|
||||
VDistribution == GeomAbs_QuasiUniform )
|
||||
KnotSpec = StepGeom_ktQuasiUniformKnots;
|
||||
else if ( UDistribution == GeomAbs_PiecewiseBezier &&
|
||||
VDistribution == GeomAbs_PiecewiseBezier )
|
||||
KnotSpec = StepGeom_ktPiecewiseBezierKnots;
|
||||
else
|
||||
KnotSpec = StepGeom_ktUnspecified;
|
||||
|
||||
TColStd_Array2OfReal W(1,NU,1,NV);
|
||||
BS->Weights(W);
|
||||
aWeightsData = new TColStd_HArray2OfReal(1,NU,1,NV);
|
||||
for ( i=W.LowerRow(); i<=W.UpperRow(); i++) {
|
||||
for (j=W.LowerCol(); j<=W.UpperCol(); j++) {
|
||||
rtampon = W.Value(i,j);
|
||||
aWeightsData->SetValue(i, j, rtampon);
|
||||
}
|
||||
}
|
||||
|
||||
BSWK = new StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
BSWK->Init(name,aUDegree, aVDegree, aControlPointsList, aSurfaceForm,
|
||||
aUClosed, aVClosed, aSelfIntersect, aUMultiplicities,
|
||||
aVMultiplicities, aUKnots, aVKnots, KnotSpec, aWeightsData );
|
||||
|
||||
theBSplineSurfaceWithKnotsAndRationalBSplineSurface = BSWK;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) &
|
||||
GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theBSplineSurfaceWithKnotsAndRationalBSplineSurface;
|
||||
}
|
40
src/GeomToStep/GeomToStep_MakeBoundedCurve.cdl
Executable file
40
src/GeomToStep/GeomToStep_MakeBoundedCurve.cdl
Executable file
@@ -0,0 +1,40 @@
|
||||
-- File: GeomToStep_MakeBoundedCurve.cdl
|
||||
-- Created: Mon Jun 21 11:31:39 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeBoundedCurve from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- BoundedCurve from Geom, Geom2d and the class BoundedCurve from
|
||||
-- StepGeom which describes a BoundedCurve from prostep.
|
||||
-- As BoundedCurve is an abstract BoundedCurve this class
|
||||
-- is an access to the sub-class required.
|
||||
|
||||
uses BoundedCurve from Geom,
|
||||
BoundedCurve from Geom2d,
|
||||
BoundedCurve from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( C : BoundedCurve from Geom ) returns MakeBoundedCurve;
|
||||
|
||||
Create ( C : BoundedCurve from Geom2d ) returns MakeBoundedCurve;
|
||||
|
||||
Value (me) returns BoundedCurve from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theBoundedCurve : BoundedCurve from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeBoundedCurve;
|
||||
|
||||
|
||||
|
115
src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx
Executable file
115
src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx
Executable file
@@ -0,0 +1,115 @@
|
||||
// File: GeomToStep_MakeBoundedCurve.cxx
|
||||
// Created: Mon Jun 21 11:35:12 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeBoundedCurve.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <StepGeom_BoundedCurve.hxx>
|
||||
#include <GeomToStep_MakeBoundedCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <GeomConvert.hxx>
|
||||
#include <Geom2dConvert.hxx>
|
||||
#include <GeomToStep_MakeBSplineCurveWithKnots.hxx>
|
||||
#include <GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une BoundedCurve de prostep a partir d' une BoundedCurve de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_BoundedCurve)& C)
|
||||
{
|
||||
done = Standard_True;
|
||||
|
||||
if (C->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) {
|
||||
Handle(Geom_BSplineCurve) Bspli = Handle(Geom_BSplineCurve)::DownCast(C);
|
||||
// UPDATE FMA 1-04-96
|
||||
if (C->IsPeriodic()) {
|
||||
Handle(Geom_BSplineCurve) newBspli =
|
||||
Handle(Geom_BSplineCurve)::DownCast(Bspli->Copy());
|
||||
newBspli->SetNotPeriodic();
|
||||
Bspli = newBspli;
|
||||
}
|
||||
if ( Bspli->IsRational() ) {
|
||||
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli);
|
||||
theBoundedCurve = MkRatBSplineC.Value();
|
||||
}
|
||||
else {
|
||||
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
|
||||
theBoundedCurve = MkBSplineC.Value();
|
||||
}
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom_BezierCurve))) {
|
||||
Handle(Geom_BezierCurve) Cur = Handle(Geom_BezierCurve)::DownCast(C);
|
||||
Handle(Geom_BSplineCurve) Bspli = GeomConvert::CurveToBSplineCurve(Cur);
|
||||
if ( Bspli->IsRational() ) {
|
||||
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli);
|
||||
theBoundedCurve = MkRatBSplineC.Value();
|
||||
}
|
||||
else {
|
||||
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
|
||||
theBoundedCurve = MkBSplineC.Value();
|
||||
}
|
||||
}
|
||||
else {
|
||||
#ifdef DEB
|
||||
cout<<"MakeBoundedCurve, type : "<<C->DynamicType()->Name()<<" not processed"<<endl;
|
||||
#endif
|
||||
done = Standard_False;
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une BoundedCurve de prostep a partir d' une BoundedCurve de
|
||||
// Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_BoundedCurve)& C)
|
||||
{
|
||||
done = Standard_True;
|
||||
if (C->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve)))
|
||||
{
|
||||
Handle(Geom2d_BSplineCurve) Bspli =
|
||||
Handle(Geom2d_BSplineCurve)::DownCast(C);
|
||||
// UPDATE FMA 1-04-96
|
||||
if (C->IsPeriodic()) {
|
||||
Handle(Geom2d_BSplineCurve) newBspli =
|
||||
Handle(Geom2d_BSplineCurve)::DownCast(Bspli->Copy());
|
||||
newBspli->SetNotPeriodic();
|
||||
Bspli = newBspli;
|
||||
}
|
||||
if ( Bspli->IsRational() ) {
|
||||
GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli);
|
||||
theBoundedCurve = MkRatBSplineC.Value();
|
||||
}
|
||||
else {
|
||||
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
|
||||
theBoundedCurve = MkBSplineC.Value();
|
||||
}
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom2d_BezierCurve))) {
|
||||
Handle(Geom2d_BezierCurve) Cur = Handle(Geom2d_BezierCurve)::DownCast(C);
|
||||
Handle(Geom2d_BSplineCurve) Bspli =
|
||||
Geom2dConvert::CurveToBSplineCurve(Cur);
|
||||
GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
|
||||
theBoundedCurve = MkBSplineC.Value();
|
||||
}
|
||||
else
|
||||
done = Standard_False;
|
||||
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_BoundedCurve) &
|
||||
GeomToStep_MakeBoundedCurve::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theBoundedCurve;
|
||||
}
|
37
src/GeomToStep/GeomToStep_MakeBoundedSurface.cdl
Executable file
37
src/GeomToStep/GeomToStep_MakeBoundedSurface.cdl
Executable file
@@ -0,0 +1,37 @@
|
||||
-- File: GeomToStep_MakeBoundedSurface.cdl
|
||||
-- Created: Tue Jun 22 12:37:10 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeBoundedSurface from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- BoundedSurface from Geom and the class BoundedSurface from
|
||||
-- StepGeom which describes a BoundedSurface from prostep.
|
||||
-- As BoundedSurface is an abstract BoundedSurface this class
|
||||
-- is an access to the sub-class required.
|
||||
|
||||
uses BoundedSurface from Geom,
|
||||
BoundedSurface from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( C : BoundedSurface from Geom ) returns MakeBoundedSurface;
|
||||
|
||||
Value (me) returns BoundedSurface from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theBoundedSurface : BoundedSurface from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeBoundedSurface;
|
||||
|
||||
|
||||
|
81
src/GeomToStep/GeomToStep_MakeBoundedSurface.cxx
Executable file
81
src/GeomToStep/GeomToStep_MakeBoundedSurface.cxx
Executable file
@@ -0,0 +1,81 @@
|
||||
// File: GeomToStep_MakeBoundedSurface.cxx
|
||||
// Created: Tue Jun 22 12:38:59 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeBoundedSurface.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <StepGeom_BoundedSurface.hxx>
|
||||
#include <GeomToStep_MakeBoundedSurface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <GeomConvert.hxx>
|
||||
#include <GeomToStep_MakeBSplineSurfaceWithKnots.hxx>
|
||||
#include <GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
|
||||
#include <GeomToStep_MakeRectangularTrimmedSurface.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une BoundedSurface de prostep a partir d' une BoundedSurface
|
||||
// de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeBoundedSurface::GeomToStep_MakeBoundedSurface
|
||||
( const Handle(Geom_BoundedSurface)& S)
|
||||
{
|
||||
done = Standard_True;
|
||||
if (S->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) {
|
||||
Handle(Geom_BSplineSurface) BS= Handle(Geom_BSplineSurface)::DownCast(S);
|
||||
// UPDATE FMA 1-04-96
|
||||
if (S->IsUPeriodic() || S->IsVPeriodic()) {
|
||||
Handle(Geom_BSplineSurface) newBS =
|
||||
Handle(Geom_BSplineSurface)::DownCast(BS->Copy());
|
||||
newBS->SetUNotPeriodic();
|
||||
newBS->SetVNotPeriodic();
|
||||
BS = newBS;
|
||||
}
|
||||
if ( BS->IsURational() || BS->IsVRational() ) {
|
||||
GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface
|
||||
MkRatBSplineS(BS);
|
||||
theBoundedSurface = MkRatBSplineS.Value();
|
||||
}
|
||||
else {
|
||||
GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS);
|
||||
theBoundedSurface = MkBSplineS.Value();
|
||||
}
|
||||
}
|
||||
else if (S->IsKind(STANDARD_TYPE(Geom_BezierSurface))) {
|
||||
Handle(Geom_BezierSurface) Sur = Handle(Geom_BezierSurface)::DownCast(S);
|
||||
Handle (Geom_BSplineSurface) BS =
|
||||
GeomConvert::SurfaceToBSplineSurface(Sur);
|
||||
if ( BS->IsURational() || BS->IsVRational() ) {
|
||||
GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface
|
||||
MkRatBSplineS(BS);
|
||||
theBoundedSurface = MkRatBSplineS.Value();
|
||||
}
|
||||
else {
|
||||
GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS);
|
||||
theBoundedSurface = MkBSplineS.Value();
|
||||
}
|
||||
}
|
||||
else if (S->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
|
||||
Handle(Geom_RectangularTrimmedSurface) Sur =
|
||||
Handle(Geom_RectangularTrimmedSurface)::DownCast(S);
|
||||
GeomToStep_MakeRectangularTrimmedSurface MkRTSurf(Sur);
|
||||
theBoundedSurface = MkRTSurf.Value();
|
||||
}
|
||||
else
|
||||
done = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_BoundedSurface) &
|
||||
GeomToStep_MakeBoundedSurface::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theBoundedSurface;
|
||||
}
|
44
src/GeomToStep/GeomToStep_MakeCartesianPoint.cdl
Executable file
44
src/GeomToStep/GeomToStep_MakeCartesianPoint.cdl
Executable file
@@ -0,0 +1,44 @@
|
||||
-- File: GeomToStep_MakeCartesianPoint.cdl
|
||||
-- Created: Fri Jun 11 18:43:50 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeCartesianPoint from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- CartesianPoint from Geom and Pnt from gp, and the class
|
||||
-- CartesianPoint from StepGeom which describes a point from
|
||||
-- Prostep.
|
||||
|
||||
uses Pnt from gp,
|
||||
Pnt2d from gp,
|
||||
CartesianPoint from Geom,
|
||||
CartesianPoint from Geom2d,
|
||||
CartesianPoint from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( P : Pnt from gp ) returns MakeCartesianPoint;
|
||||
|
||||
Create ( P : Pnt2d from gp ) returns MakeCartesianPoint;
|
||||
|
||||
Create ( P : CartesianPoint from Geom ) returns MakeCartesianPoint;
|
||||
|
||||
Create ( P : CartesianPoint from Geom2d ) returns MakeCartesianPoint;
|
||||
|
||||
Value (me) returns CartesianPoint from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theCartesianPoint : CartesianPoint from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeCartesianPoint;
|
||||
|
||||
|
117
src/GeomToStep/GeomToStep_MakeCartesianPoint.cxx
Executable file
117
src/GeomToStep/GeomToStep_MakeCartesianPoint.cxx
Executable file
@@ -0,0 +1,117 @@
|
||||
// File: GeomToStep_MakeCartesianPoint.cxx
|
||||
// Created: Tue Jun 15 11:41:21 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeCartesianPoint.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
#include <Geom2d_CartesianPoint.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un cartesian_point de prostep a partir d' un point3d de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P)
|
||||
{
|
||||
Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint;
|
||||
// Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,3);
|
||||
Standard_Real X, Y, Z;
|
||||
|
||||
P.Coord(X, Y, Z);
|
||||
// Acoord->SetValue(1,X);
|
||||
// Acoord->SetValue(2,Y);
|
||||
// Acoord->SetValue(3,Z);
|
||||
// Pstep->SetCoordinates(Acoord);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
// Pstep->SetName(name);
|
||||
Standard_Real fact = UnitsMethods::LengthFactor();
|
||||
Pstep->Init3D (name,X/fact,Y/fact,Z/fact);
|
||||
theCartesianPoint = Pstep;
|
||||
done = Standard_True;
|
||||
}
|
||||
//=============================================================================
|
||||
// Creation d' un cartesian_point de prostep a partir d' un point 2d de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt2d& P)
|
||||
{
|
||||
Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint;
|
||||
// Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,2);
|
||||
Standard_Real X, Y;
|
||||
|
||||
P.Coord(X, Y);
|
||||
// Acoord->SetValue(1,X);
|
||||
// Acoord->SetValue(2,Y);
|
||||
// Pstep->SetCoordinates(Acoord);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
// Pstep->SetName(name);
|
||||
Pstep->Init2D (name,X,Y);
|
||||
theCartesianPoint = Pstep;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un cartesian_point de prostep a partir d' un point 3d de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeCartesianPoint::
|
||||
GeomToStep_MakeCartesianPoint( const Handle(Geom_CartesianPoint)& P)
|
||||
|
||||
{
|
||||
Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint;
|
||||
// Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,3);
|
||||
Standard_Real X, Y, Z;
|
||||
|
||||
P->Coord(X, Y, Z);
|
||||
// Acoord->SetValue(1,X);
|
||||
// Acoord->SetValue(2,Y);
|
||||
// Acoord->SetValue(3,Z);
|
||||
// Pstep->SetCoordinates(Acoord);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
// Pstep->SetName(name);
|
||||
Standard_Real fact = UnitsMethods::LengthFactor();
|
||||
Pstep->Init3D (name,X/fact,Y/fact,Z/fact);
|
||||
theCartesianPoint = Pstep;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un cartesian_point de prostep a partir d' un point 2d de Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeCartesianPoint::
|
||||
GeomToStep_MakeCartesianPoint( const Handle(Geom2d_CartesianPoint)& P)
|
||||
|
||||
{
|
||||
Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint;
|
||||
// Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,2);
|
||||
Standard_Real X, Y;
|
||||
|
||||
P->Coord(X, Y);
|
||||
// Acoord->SetValue(1,X);
|
||||
// Acoord->SetValue(2,Y);
|
||||
// Pstep->SetCoordinates(Acoord);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
// Pstep->SetName(name);
|
||||
Pstep->Init2D (name,X,Y);
|
||||
theCartesianPoint = Pstep;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_CartesianPoint) &
|
||||
GeomToStep_MakeCartesianPoint::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theCartesianPoint;
|
||||
}
|
42
src/GeomToStep/GeomToStep_MakeCircle.cdl
Executable file
42
src/GeomToStep/GeomToStep_MakeCircle.cdl
Executable file
@@ -0,0 +1,42 @@
|
||||
-- File: GeomToStep_MakeCircle.cdl
|
||||
-- Created: Mon Jun 14 15:18:28 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeCircle from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Circle from Geom, and Circ from gp, and the class
|
||||
-- Circle from StepGeom which describes a circle from
|
||||
-- Prostep.
|
||||
|
||||
uses Circ from gp,
|
||||
Circ2d from gp,
|
||||
Circle from Geom,
|
||||
Circle from Geom2d,
|
||||
Circle from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( C : Circ from gp ) returns MakeCircle;
|
||||
|
||||
Create ( C : Circle from Geom ) returns MakeCircle;
|
||||
|
||||
Create ( C : Circle from Geom2d ) returns MakeCircle;
|
||||
|
||||
Value (me) returns Circle from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theCircle : Circle from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeCircle;
|
||||
|
||||
|
75
src/GeomToStep/GeomToStep_MakeCircle.cxx
Executable file
75
src/GeomToStep/GeomToStep_MakeCircle.cxx
Executable file
@@ -0,0 +1,75 @@
|
||||
// File: GeomToStep_MakeCircle.cxx
|
||||
// Created: Wed Jun 16 18:05:06 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeCircle.ixx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <StepGeom_Circle.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un cercle de prostep a partir d' un cercle 3d de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeCircle::GeomToStep_MakeCircle( const gp_Circ& C)
|
||||
{
|
||||
#include <GeomToStep_MakeCircle_gen.pxx>
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un cercle de prostep a partir d' un cercle de
|
||||
// Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom_Circle)& Cer)
|
||||
{
|
||||
gp_Circ C;
|
||||
C = Cer->Circ();
|
||||
#include <GeomToStep_MakeCircle_gen.pxx>
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un cercle 2d de prostep a partir d' un cercle de
|
||||
// Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom2d_Circle)& Cer)
|
||||
{
|
||||
gp_Circ2d C2d;
|
||||
C2d = Cer->Circ2d();
|
||||
|
||||
Handle(StepGeom_Circle) CStep = new StepGeom_Circle;
|
||||
StepGeom_Axis2Placement Ax2;
|
||||
Handle(StepGeom_Axis2Placement2d) Ax2Step;
|
||||
Standard_Real Rayon;
|
||||
|
||||
GeomToStep_MakeAxis2Placement2d MkAxis2(C2d.Position());
|
||||
Ax2Step = MkAxis2.Value();
|
||||
Rayon = C2d.Radius();
|
||||
Ax2.SetValue(Ax2Step);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
CStep->Init(name, Ax2, Rayon);
|
||||
theCircle = CStep;
|
||||
done = Standard_True;
|
||||
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Circle) &
|
||||
GeomToStep_MakeCircle::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theCircle;
|
||||
}
|
20
src/GeomToStep/GeomToStep_MakeCircle_gen.pxx
Executable file
20
src/GeomToStep/GeomToStep_MakeCircle_gen.pxx
Executable file
@@ -0,0 +1,20 @@
|
||||
// File: GeomToStep_MakeCircle.gxx
|
||||
// Created: Wed Jun 23 12:27:20 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
|
||||
Handle(StepGeom_Circle) CStep = new StepGeom_Circle;
|
||||
StepGeom_Axis2Placement Ax2;
|
||||
Handle(StepGeom_Axis2Placement3d) Ax2Step;
|
||||
Standard_Real Rayon;
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d MkAxis2(C.Position());
|
||||
Ax2Step = MkAxis2.Value();
|
||||
Rayon = C.Radius();
|
||||
Ax2.SetValue(Ax2Step);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
CStep->Init(name, Ax2, Rayon / UnitsMethods::LengthFactor());
|
||||
theCircle = CStep;
|
||||
done = Standard_True;
|
||||
|
39
src/GeomToStep/GeomToStep_MakeConic.cdl
Executable file
39
src/GeomToStep/GeomToStep_MakeConic.cdl
Executable file
@@ -0,0 +1,39 @@
|
||||
-- File: GeomToStep_MakeConic.cdl
|
||||
-- Created: Mon Jun 21 11:18:38 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeConic from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Conic from Geom and the class Conic from StepGeom
|
||||
-- which describes a Conic from prostep. As Conic is an abstract
|
||||
-- Conic this class is an access to the sub-class required.
|
||||
|
||||
uses Conic from Geom,
|
||||
Conic from Geom2d,
|
||||
Conic from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( C : Conic from Geom ) returns MakeConic;
|
||||
|
||||
Create ( C : Conic from Geom2d ) returns MakeConic;
|
||||
|
||||
Value (me) returns Conic from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theConic : Conic from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeConic;
|
||||
|
||||
|
||||
|
104
src/GeomToStep/GeomToStep_MakeConic.cxx
Executable file
104
src/GeomToStep/GeomToStep_MakeConic.cxx
Executable file
@@ -0,0 +1,104 @@
|
||||
// File: GeomToStep_MakeConic.cxx
|
||||
// Created: Mon Jun 21 11:20:10 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeConic.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <StepGeom_Conic.hxx>
|
||||
#include <GeomToStep_MakeConic.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_Hyperbola.hxx>
|
||||
#include <Geom_Parabola.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom2d_Ellipse.hxx>
|
||||
#include <Geom2d_Hyperbola.hxx>
|
||||
#include <Geom2d_Parabola.hxx>
|
||||
#include <GeomToStep_MakeCircle.hxx>
|
||||
#include <GeomToStep_MakeEllipse.hxx>
|
||||
#include <GeomToStep_MakeHyperbola.hxx>
|
||||
#include <GeomToStep_MakeParabola.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une Conic de prostep a partir d' une Conic de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C)
|
||||
{
|
||||
done = Standard_True;
|
||||
if (C->IsKind(STANDARD_TYPE(Geom_Circle))) {
|
||||
Handle(Geom_Circle) Cer = Handle(Geom_Circle)::DownCast(C);
|
||||
GeomToStep_MakeCircle MkCircle(Cer);
|
||||
theConic = MkCircle.Value();
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom_Ellipse))) {
|
||||
Handle(Geom_Ellipse) Ell = Handle(Geom_Ellipse)::DownCast(C);
|
||||
GeomToStep_MakeEllipse MkEllipse(Ell);
|
||||
theConic = MkEllipse.Value();
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom_Hyperbola))) {
|
||||
Handle(Geom_Hyperbola) Hyp = Handle(Geom_Hyperbola)::DownCast(C);
|
||||
GeomToStep_MakeHyperbola MkHyperbola(Hyp);
|
||||
theConic = MkHyperbola.Value();
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom_Parabola))) {
|
||||
Handle(Geom_Parabola) Par = Handle(Geom_Parabola)::DownCast(C);
|
||||
GeomToStep_MakeParabola MkParabola(Par);
|
||||
theConic = MkParabola.Value();
|
||||
}
|
||||
else {
|
||||
#ifdef DEBUG
|
||||
cout << "3D Curve Type : " << C->DynamicType() << endl;
|
||||
#endif
|
||||
done = Standard_False;
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une Conic2d de prostep a partir d' une Conic de Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom2d_Conic)& C)
|
||||
{
|
||||
done = Standard_True;
|
||||
if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
|
||||
Handle(Geom2d_Circle) Cer = Handle(Geom2d_Circle)::DownCast(C);
|
||||
GeomToStep_MakeCircle MkCircle(Cer);
|
||||
theConic = MkCircle.Value();
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) {
|
||||
Handle(Geom2d_Ellipse) Ell = Handle(Geom2d_Ellipse)::DownCast(C);
|
||||
GeomToStep_MakeEllipse MkEllipse(Ell);
|
||||
theConic = MkEllipse.Value();
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom2d_Hyperbola))) {
|
||||
Handle(Geom2d_Hyperbola) Hyp = Handle(Geom2d_Hyperbola)::DownCast(C);
|
||||
GeomToStep_MakeHyperbola MkHyperbola(Hyp);
|
||||
theConic = MkHyperbola.Value();
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
|
||||
Handle(Geom2d_Parabola) Par = Handle(Geom2d_Parabola)::DownCast(C);
|
||||
GeomToStep_MakeParabola MkParabola(Par);
|
||||
theConic = MkParabola.Value();
|
||||
}
|
||||
else {
|
||||
// Attention : Other 2d conics shall be implemented ...
|
||||
// To be performed later !
|
||||
#ifdef DEBUG
|
||||
cout << "2D conic not yet implemented" << endl;
|
||||
#endif
|
||||
done = Standard_False;
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Conic) &
|
||||
GeomToStep_MakeConic::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theConic;
|
||||
}
|
37
src/GeomToStep/GeomToStep_MakeConicalSurface.cdl
Executable file
37
src/GeomToStep/GeomToStep_MakeConicalSurface.cdl
Executable file
@@ -0,0 +1,37 @@
|
||||
-- File: GeomToStep_MakeConicalSurface.cdl
|
||||
-- Created: Mon Jun 14 16:05:32 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeConicalSurface from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between class
|
||||
-- ConicalSurface from Geom and the class
|
||||
-- ConicalSurface from StepGeom which describes a
|
||||
-- conical_surface from Prostep
|
||||
|
||||
uses ConicalSurface from Geom,
|
||||
ConicalSurface from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
|
||||
|
||||
Create ( CSurf : ConicalSurface from Geom ) returns MakeConicalSurface;
|
||||
|
||||
Value (me) returns ConicalSurface from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theConicalSurface : ConicalSurface from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeConicalSurface;
|
||||
|
||||
|
53
src/GeomToStep/GeomToStep_MakeConicalSurface.cxx
Executable file
53
src/GeomToStep/GeomToStep_MakeConicalSurface.cxx
Executable file
@@ -0,0 +1,53 @@
|
||||
// File: GeomToStep_MakeConicalSurface.cxx
|
||||
// Created: Wed Jun 16 18:38:56 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeConicalSurface.ixx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <StepGeom_ConicalSurface.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une conical_surface de prostep a partir d' une ConicalSurface
|
||||
// de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeConicalSurface::GeomToStep_MakeConicalSurface
|
||||
( const Handle(Geom_ConicalSurface)& CS )
|
||||
|
||||
{
|
||||
Handle(StepGeom_ConicalSurface) CSstep = new StepGeom_ConicalSurface;
|
||||
Handle(StepGeom_Axis2Placement3d) aPosition;
|
||||
Standard_Real aRadius, aSemiAngle;
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d MkAxis(CS->Position());
|
||||
aPosition = MkAxis.Value();
|
||||
aRadius = CS->RefRadius();
|
||||
aSemiAngle = CS->SemiAngle();
|
||||
if (aSemiAngle < 0. || aSemiAngle > PI/2.) {
|
||||
Standard_DomainError::Raise("Conicalsurface not STEP conformant");
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
CSstep->Init(name, aPosition, aRadius / UnitsMethods::LengthFactor(), aSemiAngle);
|
||||
theConicalSurface = CSstep;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_ConicalSurface) &
|
||||
GeomToStep_MakeConicalSurface::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theConicalSurface;
|
||||
}
|
39
src/GeomToStep/GeomToStep_MakeCurve.cdl
Executable file
39
src/GeomToStep/GeomToStep_MakeCurve.cdl
Executable file
@@ -0,0 +1,39 @@
|
||||
-- File: GeomToStep_MakeCurve.cdl
|
||||
-- Created: Mon Jun 21 10:14:42 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeCurve from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Curve from Geom and the class Curve from StepGeom which
|
||||
-- describes a Curve from prostep. As Curve is an
|
||||
-- abstract curve this class an access to the sub-class required.
|
||||
|
||||
uses Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
Curve from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( C : Curve from Geom ) returns MakeCurve;
|
||||
|
||||
Create ( C : Curve from Geom2d ) returns MakeCurve;
|
||||
|
||||
Value (me) returns Curve from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theCurve : Curve from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeCurve;
|
||||
|
||||
|
||||
|
163
src/GeomToStep/GeomToStep_MakeCurve.cxx
Executable file
163
src/GeomToStep/GeomToStep_MakeCurve.cxx
Executable file
@@ -0,0 +1,163 @@
|
||||
// File: GeomToStep_MakeCurve.cxx
|
||||
// Created: Mon Jun 21 10:20:35 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeCurve.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <StepGeom_Curve.hxx>
|
||||
#include <GeomToStep_MakeCurve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <GeomToStep_MakeLine.hxx>
|
||||
#include <Geom_Conic.hxx>
|
||||
#include <Geom2d_Conic.hxx>
|
||||
#include <GeomToStep_MakeConic.hxx>
|
||||
#include <Geom_BoundedCurve.hxx>
|
||||
#include <Geom2d_BoundedCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <GeomToStep_MakeBoundedCurve.hxx>
|
||||
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
|
||||
#include <Geom2dConvert.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <Geom2d_Ellipse.hxx>
|
||||
#include <gp_Elips2d.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une Curve de prostep a partir d' une Curve de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C)
|
||||
{
|
||||
done = Standard_True;
|
||||
if (C->IsKind(STANDARD_TYPE(Geom_Line))) {
|
||||
Handle(Geom_Line) L = Handle(Geom_Line)::DownCast(C);
|
||||
GeomToStep_MakeLine MkLine(L);
|
||||
theCurve = MkLine.Value();
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom_Conic))) {
|
||||
Handle(Geom_Conic) L = Handle(Geom_Conic)::DownCast(C);
|
||||
GeomToStep_MakeConic MkConic(L);
|
||||
theCurve = MkConic.Value();
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
|
||||
Handle(Geom_TrimmedCurve) T = Handle(Geom_TrimmedCurve)::DownCast(C);
|
||||
Handle(Geom_Curve) B = T->BasisCurve();
|
||||
// TANT PIS, on passe la courbe de base ...
|
||||
if (B->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) {
|
||||
Handle(Geom_BSplineCurve) BS = Handle(Geom_BSplineCurve)::DownCast
|
||||
(B->Copy());
|
||||
BS->Segment (T->FirstParameter(),T->LastParameter());
|
||||
B = BS;
|
||||
}
|
||||
else if (B->IsKind(STANDARD_TYPE(Geom_BezierCurve))) {
|
||||
Handle(Geom_BezierCurve) BZ = Handle(Geom_BezierCurve)::DownCast
|
||||
(B->Copy());
|
||||
BZ->Segment (T->FirstParameter(),T->LastParameter());
|
||||
B = BZ;
|
||||
}
|
||||
else {
|
||||
#ifdef DEB
|
||||
cout<<"GeomToStep_MakeCurve, TrimmedCurve, BasisCurve is transferred not trimmed"<<endl;
|
||||
cout<<"BasisCurve Type : "<<B->DynamicType()->Name()<<endl;
|
||||
#endif
|
||||
}
|
||||
GeomToStep_MakeCurve MkBasisC(B);
|
||||
theCurve = MkBasisC.Value();
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom_BoundedCurve))) {
|
||||
Handle(Geom_BoundedCurve) L = Handle(Geom_BoundedCurve)::DownCast(C);
|
||||
GeomToStep_MakeBoundedCurve MkBoundedC(L);
|
||||
theCurve = MkBoundedC.Value();
|
||||
}
|
||||
else
|
||||
done = Standard_False;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d'une Curve de prostep a partir d' une Curve de Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C)
|
||||
{
|
||||
done = Standard_True;
|
||||
if (C->IsKind(STANDARD_TYPE(Geom2d_Line))) {
|
||||
Handle(Geom2d_Line) L = Handle(Geom2d_Line)::DownCast(C);
|
||||
GeomToStep_MakeLine MkLine(L);
|
||||
theCurve = MkLine.Value();
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom2d_Conic))) {
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// A Circle of an Ellipse can be indirect. An indirect Axis in not
|
||||
// mappable onto STEP. Then to avoid changing the topology, the Circle
|
||||
// or the Ellipse are converted into BSpline Curves
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
|
||||
Handle(Geom2d_Circle) theC2d = Handle(Geom2d_Circle)::DownCast(C);
|
||||
gp_Circ2d C2d = theC2d->Circ2d();
|
||||
if (!C2d.IsDirect()) {
|
||||
#ifdef DEB
|
||||
cout << "Warning : Circle converted to BSpline." << endl;
|
||||
#endif
|
||||
Handle(Geom2d_BSplineCurve) aBSplineCurve2d =
|
||||
Geom2dConvert::CurveToBSplineCurve(theC2d);
|
||||
GeomToStep_MakeBoundedCurve MkBoundedC(aBSplineCurve2d);
|
||||
theCurve = MkBoundedC.Value();
|
||||
}
|
||||
else {
|
||||
Handle(Geom2d_Conic) L = Handle(Geom2d_Conic)::DownCast(C);
|
||||
GeomToStep_MakeConic MkConic(L);
|
||||
theCurve = MkConic.Value();
|
||||
}
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) {
|
||||
Handle(Geom2d_Ellipse) theE2d = Handle(Geom2d_Ellipse)::DownCast(C);
|
||||
gp_Elips2d E2d = theE2d->Elips2d();
|
||||
if (!E2d.IsDirect()) {
|
||||
#ifdef DEB
|
||||
cout << "Warning : Ellipse converted to BSpline." << endl;
|
||||
#endif
|
||||
Handle(Geom2d_BSplineCurve) aBSplineCurve2d =
|
||||
Geom2dConvert::CurveToBSplineCurve(theE2d);
|
||||
GeomToStep_MakeBoundedCurve MkBoundedC(aBSplineCurve2d);
|
||||
theCurve = MkBoundedC.Value();
|
||||
}
|
||||
else {
|
||||
Handle(Geom2d_Conic) L = Handle(Geom2d_Conic)::DownCast(C);
|
||||
GeomToStep_MakeConic MkConic(L);
|
||||
theCurve = MkConic.Value();
|
||||
}
|
||||
}
|
||||
else {
|
||||
Handle(Geom2d_Conic) L = Handle(Geom2d_Conic)::DownCast(C);
|
||||
GeomToStep_MakeConic MkConic(L);
|
||||
theCurve = MkConic.Value();
|
||||
}
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(Geom2d_BoundedCurve))) {
|
||||
Handle(Geom2d_BoundedCurve) L = Handle(Geom2d_BoundedCurve)::DownCast(C);
|
||||
GeomToStep_MakeBoundedCurve MkBoundedC(L);
|
||||
theCurve = MkBoundedC.Value();
|
||||
}
|
||||
else
|
||||
done = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Curve) &
|
||||
GeomToStep_MakeCurve::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theCurve;
|
||||
}
|
35
src/GeomToStep/GeomToStep_MakeCylindricalSurface.cdl
Executable file
35
src/GeomToStep/GeomToStep_MakeCylindricalSurface.cdl
Executable file
@@ -0,0 +1,35 @@
|
||||
-- File: GeomToStep_MakeCylindricalSurface.cdl
|
||||
-- Created: Mon Jun 14 16:09:17 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeCylindricalSurface from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between class
|
||||
-- CylindricalSurface from Geom and the class
|
||||
-- CylindricalSurface from StepGeom which describes a
|
||||
-- cylindrical_surface from Prostep
|
||||
|
||||
uses CylindricalSurface from Geom,
|
||||
CylindricalSurface from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( CSurf : CylindricalSurface from Geom ) returns MakeCylindricalSurface;
|
||||
|
||||
Value (me) returns CylindricalSurface from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theCylindricalSurface : CylindricalSurface from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeCylindricalSurface;
|
||||
|
||||
|
47
src/GeomToStep/GeomToStep_MakeCylindricalSurface.cxx
Executable file
47
src/GeomToStep/GeomToStep_MakeCylindricalSurface.cxx
Executable file
@@ -0,0 +1,47 @@
|
||||
// File: GeomToStep_MakeCylindricalSurface.cxx
|
||||
// Created: Thu Jun 17 10:33:15 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeCylindricalSurface.ixx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <StepGeom_CylindricalSurface.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une conical_surface de prostep a partir d' une
|
||||
// CylindricalSurface de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeCylindricalSurface::GeomToStep_MakeCylindricalSurface
|
||||
( const Handle(Geom_CylindricalSurface)& CS )
|
||||
|
||||
{
|
||||
Handle(StepGeom_CylindricalSurface) CSstep;
|
||||
Handle(StepGeom_Axis2Placement3d) aPosition;
|
||||
Standard_Real aRadius;
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d MkAxis2(CS->Position());
|
||||
aPosition = MkAxis2.Value();
|
||||
aRadius = CS->Radius();
|
||||
CSstep = new StepGeom_CylindricalSurface;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
CSstep->Init(name, aPosition, aRadius / UnitsMethods::LengthFactor());
|
||||
theCylindricalSurface = CSstep;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_CylindricalSurface) &
|
||||
GeomToStep_MakeCylindricalSurface::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theCylindricalSurface;
|
||||
}
|
44
src/GeomToStep/GeomToStep_MakeDirection.cdl
Executable file
44
src/GeomToStep/GeomToStep_MakeDirection.cdl
Executable file
@@ -0,0 +1,44 @@
|
||||
-- File: GeomToStep_MakeDirection.cdl
|
||||
-- Created: Mon Jun 14 14:53:21 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeDirection from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Direction from Geom, Geom2d and Dir, Dir2d from gp, and the
|
||||
-- class Direction from StepGeom which describes a direction
|
||||
-- from Prostep.
|
||||
|
||||
uses Dir from gp,
|
||||
Dir2d from gp,
|
||||
Direction from Geom,
|
||||
Direction from Geom2d,
|
||||
Direction from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( D : Dir from gp ) returns MakeDirection;
|
||||
|
||||
Create ( D : Dir2d from gp ) returns MakeDirection;
|
||||
|
||||
Create ( D : Direction from Geom ) returns MakeDirection;
|
||||
|
||||
Create ( D : Direction from Geom2d ) returns MakeDirection;
|
||||
|
||||
Value (me) returns Direction from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theDirection : Direction from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeDirection;
|
||||
|
||||
|
109
src/GeomToStep/GeomToStep_MakeDirection.cxx
Executable file
109
src/GeomToStep/GeomToStep_MakeDirection.cxx
Executable file
@@ -0,0 +1,109 @@
|
||||
// File: GeomToStep_MakeDirection.cxx
|
||||
// Created: Thu Jun 17 10:41:50 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeDirection.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <Geom_Direction.hxx>
|
||||
#include <Geom2d_Direction.hxx>
|
||||
#include <StepGeom_Direction.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une direction de prostep a partir d' une Dir de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeDirection::GeomToStep_MakeDirection( const gp_Dir& D)
|
||||
{
|
||||
Handle(StepGeom_Direction) Dir = new StepGeom_Direction;
|
||||
Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,3);
|
||||
Standard_Real X, Y, Z;
|
||||
|
||||
D.Coord(X, Y, Z);
|
||||
aDirRatios->SetValue(1,X);
|
||||
aDirRatios->SetValue(2,Y);
|
||||
aDirRatios->SetValue(3,Z);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Dir->Init(name, aDirRatios);
|
||||
theDirection = Dir;
|
||||
done = Standard_True;
|
||||
}
|
||||
//=============================================================================
|
||||
// Creation d' une direction de prostep a partir d' une Dir2d de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeDirection::GeomToStep_MakeDirection( const gp_Dir2d& D)
|
||||
{
|
||||
Handle(StepGeom_Direction) Dir = new StepGeom_Direction;
|
||||
Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,2);
|
||||
Standard_Real X, Y;
|
||||
|
||||
D.Coord(X, Y);
|
||||
aDirRatios->SetValue(1,X);
|
||||
aDirRatios->SetValue(2,Y);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Dir->Init(name, aDirRatios);
|
||||
theDirection = Dir;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une direction de prostep a partir d' une Direction de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeDirection::GeomToStep_MakeDirection
|
||||
( const Handle(Geom_Direction)& Direc)
|
||||
{
|
||||
gp_Dir D;
|
||||
Handle(StepGeom_Direction) Dir = new StepGeom_Direction;
|
||||
Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,3);
|
||||
Standard_Real X, Y, Z;
|
||||
|
||||
D=Direc->Dir();
|
||||
D.Coord(X, Y, Z);
|
||||
aDirRatios->SetValue(1,X);
|
||||
aDirRatios->SetValue(2,Y);
|
||||
aDirRatios->SetValue(3,Z);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Dir->Init(name, aDirRatios);
|
||||
theDirection = Dir;
|
||||
done = Standard_True;
|
||||
|
||||
}
|
||||
//=============================================================================
|
||||
// Creation d' une direction de prostep a partir d' une Direction de Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeDirection::GeomToStep_MakeDirection
|
||||
( const Handle(Geom2d_Direction)& Direc)
|
||||
{
|
||||
gp_Dir2d D;
|
||||
Handle(StepGeom_Direction) Dir = new StepGeom_Direction;
|
||||
Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,2);
|
||||
Standard_Real X, Y;
|
||||
|
||||
D=Direc->Dir2d();
|
||||
D.Coord(X, Y);
|
||||
aDirRatios->SetValue(1,X);
|
||||
aDirRatios->SetValue(2,Y);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Dir->Init(name, aDirRatios);
|
||||
theDirection = Dir;
|
||||
done = Standard_True;
|
||||
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Direction) &
|
||||
GeomToStep_MakeDirection::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theDirection;
|
||||
}
|
37
src/GeomToStep/GeomToStep_MakeElementarySurface.cdl
Executable file
37
src/GeomToStep/GeomToStep_MakeElementarySurface.cdl
Executable file
@@ -0,0 +1,37 @@
|
||||
-- File: GeomToStep_MakeElementarySurface.cdl
|
||||
-- Created: Tue Jun 22 14:24:10 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeElementarySurface from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- ElementarySurface from Geom and the class ElementarySurface
|
||||
-- from StepGeom which describes a ElementarySurface from
|
||||
-- prostep. As ElementarySurface is an abstract Surface this
|
||||
-- class is an access to the sub-class required.
|
||||
|
||||
uses ElementarySurface from Geom,
|
||||
ElementarySurface from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( S : ElementarySurface from Geom ) returns MakeElementarySurface;
|
||||
|
||||
Value (me) returns ElementarySurface from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theElementarySurface : ElementarySurface from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeElementarySurface;
|
||||
|
||||
|
||||
|
73
src/GeomToStep/GeomToStep_MakeElementarySurface.cxx
Executable file
73
src/GeomToStep/GeomToStep_MakeElementarySurface.cxx
Executable file
@@ -0,0 +1,73 @@
|
||||
// File: GeomToStep_MakeElementarySurface.cxx
|
||||
// Created: Tue Jun 22 14:28:02 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeElementarySurface.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <StepGeom_ElementarySurface.hxx>
|
||||
#include <GeomToStep_MakeElementarySurface.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <GeomToStep_MakeCylindricalSurface.hxx>
|
||||
#include <GeomToStep_MakeConicalSurface.hxx>
|
||||
#include <GeomToStep_MakeSphericalSurface.hxx>
|
||||
#include <GeomToStep_MakeToroidalSurface.hxx>
|
||||
#include <GeomToStep_MakePlane.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une ElementarySurface de prostep a partir d' une
|
||||
// ElementarySurface de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeElementarySurface::GeomToStep_MakeElementarySurface
|
||||
( const Handle(Geom_ElementarySurface)& S)
|
||||
{
|
||||
done = Standard_True;
|
||||
if (S->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
|
||||
Handle(Geom_CylindricalSurface) Sur =
|
||||
Handle(Geom_CylindricalSurface)::DownCast(S);
|
||||
GeomToStep_MakeCylindricalSurface MkCylindrical(Sur);
|
||||
theElementarySurface = MkCylindrical.Value();
|
||||
}
|
||||
else if (S->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) {
|
||||
Handle(Geom_ConicalSurface) Sur =
|
||||
Handle(Geom_ConicalSurface)::DownCast(S);
|
||||
GeomToStep_MakeConicalSurface MkConical(Sur);
|
||||
theElementarySurface = MkConical.Value();
|
||||
}
|
||||
else if (S->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) {
|
||||
Handle(Geom_SphericalSurface) Sur =
|
||||
Handle(Geom_SphericalSurface)::DownCast(S);
|
||||
GeomToStep_MakeSphericalSurface MkSpherical(Sur);
|
||||
theElementarySurface = MkSpherical.Value();
|
||||
}
|
||||
else if (S->IsKind(STANDARD_TYPE(Geom_ToroidalSurface))) {
|
||||
Handle(Geom_ToroidalSurface) Sur =
|
||||
Handle(Geom_ToroidalSurface)::DownCast(S);
|
||||
GeomToStep_MakeToroidalSurface MkToroidal(Sur);
|
||||
theElementarySurface = MkToroidal.Value();
|
||||
}
|
||||
else if (S->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
||||
Handle(Geom_Plane) Sur = Handle(Geom_Plane)::DownCast(S);
|
||||
GeomToStep_MakePlane MkPlane(Sur);
|
||||
theElementarySurface = MkPlane.Value();
|
||||
}
|
||||
else
|
||||
done = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_ElementarySurface) &
|
||||
GeomToStep_MakeElementarySurface::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theElementarySurface;
|
||||
}
|
43
src/GeomToStep/GeomToStep_MakeEllipse.cdl
Executable file
43
src/GeomToStep/GeomToStep_MakeEllipse.cdl
Executable file
@@ -0,0 +1,43 @@
|
||||
-- File: GeomToStep_MakeEllipse.cdl
|
||||
-- Created: Fri Sep 2 08:22:18 1994
|
||||
-- Author: Frederic MAUPAS
|
||||
-- <fma@minox>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
class MakeEllipse from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Ellipse from Geom, and Circ from gp, and the class
|
||||
-- Ellipse from StepGeom which describes a Ellipse from
|
||||
-- Prostep.
|
||||
|
||||
uses Elips from gp,
|
||||
Elips2d from gp,
|
||||
Ellipse from Geom,
|
||||
Ellipse from Geom2d,
|
||||
Ellipse from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( C : Elips from gp ) returns MakeEllipse;
|
||||
|
||||
Create ( C : Ellipse from Geom ) returns MakeEllipse;
|
||||
|
||||
Create ( C : Ellipse from Geom2d ) returns MakeEllipse;
|
||||
|
||||
Value (me) returns Ellipse from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theEllipse : Ellipse from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeEllipse;
|
||||
|
||||
|
76
src/GeomToStep/GeomToStep_MakeEllipse.cxx
Executable file
76
src/GeomToStep/GeomToStep_MakeEllipse.cxx
Executable file
@@ -0,0 +1,76 @@
|
||||
// File: GeomToStep_MakeEllipse.cxx
|
||||
// Created: Fri Sep 2 08:25:27 1994
|
||||
// Author: Frederic MAUPAS
|
||||
// <fma@minox>
|
||||
|
||||
|
||||
#include <GeomToStep_MakeEllipse.ixx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <gp_Elips2d.hxx>
|
||||
#include <StepGeom_Ellipse.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d'une ellipse de prostep a partir d'une ellipse 3d de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const gp_Elips& E)
|
||||
{
|
||||
#include <GeomToStep_MakeEllipse_gen.pxx>
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Creation d'une ellipse de prostep a partir d'une ellipse de
|
||||
// Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom_Ellipse)& Cer)
|
||||
{
|
||||
gp_Elips E;
|
||||
E = Cer->Elips();
|
||||
#include <GeomToStep_MakeEllipse_gen.pxx>
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Creation d'une ellipse 2d de prostep a partir d'une ellipse de
|
||||
// Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom2d_Ellipse)& Cer)
|
||||
{
|
||||
gp_Elips2d E2d;
|
||||
E2d = Cer->Elips2d();
|
||||
|
||||
Handle(StepGeom_Ellipse) EStep = new StepGeom_Ellipse;
|
||||
StepGeom_Axis2Placement Ax2;
|
||||
Handle(StepGeom_Axis2Placement2d) Ax2Step;
|
||||
Standard_Real majorR, minorR;
|
||||
|
||||
GeomToStep_MakeAxis2Placement2d MkAxis2(E2d.Axis());
|
||||
Ax2Step = MkAxis2.Value();
|
||||
majorR = E2d.MajorRadius();
|
||||
minorR = E2d.MinorRadius();
|
||||
Ax2.SetValue(Ax2Step);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
EStep->Init(name, Ax2, majorR, minorR);
|
||||
theEllipse = EStep;
|
||||
done = Standard_True;
|
||||
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Ellipse) &
|
||||
GeomToStep_MakeEllipse::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theEllipse;
|
||||
}
|
22
src/GeomToStep/GeomToStep_MakeEllipse_gen.pxx
Executable file
22
src/GeomToStep/GeomToStep_MakeEllipse_gen.pxx
Executable file
@@ -0,0 +1,22 @@
|
||||
// File: GeomToStep_MakeEllipse_gen.pxx
|
||||
// Created: Fri Sep 2 08:36:48 1994
|
||||
// Author: Frederic MAUPAS
|
||||
// <fma@minox>
|
||||
|
||||
|
||||
Handle(StepGeom_Ellipse) EStep = new StepGeom_Ellipse;
|
||||
StepGeom_Axis2Placement Ax2;
|
||||
Handle(StepGeom_Axis2Placement3d) Ax2Step;
|
||||
Standard_Real majorR, minorR;
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d MkAxis2(E.Position());
|
||||
Ax2Step = MkAxis2.Value();
|
||||
majorR = E.MajorRadius();
|
||||
minorR = E.MinorRadius();
|
||||
Ax2.SetValue(Ax2Step);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Standard_Real fact = UnitsMethods::LengthFactor();
|
||||
EStep->Init(name, Ax2,majorR/fact,minorR/fact);
|
||||
theEllipse = EStep;
|
||||
done = Standard_True;
|
||||
|
39
src/GeomToStep/GeomToStep_MakeHyperbola.cdl
Executable file
39
src/GeomToStep/GeomToStep_MakeHyperbola.cdl
Executable file
@@ -0,0 +1,39 @@
|
||||
-- File: GeomToStep_MakeHyperbola.cdl
|
||||
-- Created: Thu May 4 17:39:49 1995
|
||||
-- Author: Dieter THIEMANN
|
||||
-- <dth@bibox>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
|
||||
class MakeHyperbola from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between the class
|
||||
-- Hyperbola from Geom and the class Hyperbola from
|
||||
-- StepGeom which describes a Hyperbola from ProSTEP
|
||||
|
||||
|
||||
uses Hyperbola from Geom,
|
||||
Hyperbola from Geom2d,
|
||||
Hyperbola from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( C : Hyperbola from Geom2d) returns MakeHyperbola;
|
||||
|
||||
Create ( C : Hyperbola from Geom) returns MakeHyperbola;
|
||||
|
||||
|
||||
Value (me) returns Hyperbola from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
|
||||
fields
|
||||
|
||||
theHyperbola : Hyperbola from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeHyperbola;
|
76
src/GeomToStep/GeomToStep_MakeHyperbola.cxx
Executable file
76
src/GeomToStep/GeomToStep_MakeHyperbola.cxx
Executable file
@@ -0,0 +1,76 @@
|
||||
#include <GeomToStep_MakeHyperbola.ixx>
|
||||
|
||||
#include <StepGeom_Hyperbola.hxx>
|
||||
#include <gp_Hypr.hxx>
|
||||
#include <gp_Hypr2d.hxx>
|
||||
#include <Geom_Hyperbola.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement2d.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Creation d'une hyperbola de prostep a partir d'une hyperbola de
|
||||
// Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C)
|
||||
{
|
||||
gp_Hypr2d gpHyp;
|
||||
gpHyp = C->Hypr2d();
|
||||
|
||||
Handle(StepGeom_Hyperbola) HStep = new StepGeom_Hyperbola;
|
||||
StepGeom_Axis2Placement Ax2;
|
||||
Handle(StepGeom_Axis2Placement2d) Ax2Step;
|
||||
Standard_Real majorR, minorR;
|
||||
|
||||
GeomToStep_MakeAxis2Placement2d MkAxis2(gpHyp.Axis());
|
||||
Ax2Step = MkAxis2.Value();
|
||||
majorR = gpHyp.MajorRadius();
|
||||
minorR = gpHyp.MinorRadius();
|
||||
Ax2.SetValue(Ax2Step);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
HStep->Init(name, Ax2,majorR,minorR);
|
||||
theHyperbola = HStep;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d'une hyperbola de prostep a partir d'une hyperbola de
|
||||
// Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C)
|
||||
{
|
||||
gp_Hypr gpHyp;
|
||||
gpHyp = C->Hypr();
|
||||
|
||||
Handle(StepGeom_Hyperbola) HStep = new StepGeom_Hyperbola;
|
||||
StepGeom_Axis2Placement Ax2;
|
||||
Handle(StepGeom_Axis2Placement3d) Ax2Step;
|
||||
Standard_Real majorR, minorR;
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d MkAxis2(gpHyp.Position());
|
||||
Ax2Step = MkAxis2.Value();
|
||||
majorR = gpHyp.MajorRadius();
|
||||
minorR = gpHyp.MinorRadius();
|
||||
Ax2.SetValue(Ax2Step);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Standard_Real fact = UnitsMethods::LengthFactor();
|
||||
HStep->Init(name, Ax2,majorR/fact,minorR/fact);
|
||||
theHyperbola = HStep;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// return the result
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Hyperbola)& GeomToStep_MakeHyperbola::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theHyperbola;
|
||||
}
|
||||
|
44
src/GeomToStep/GeomToStep_MakeLine.cdl
Executable file
44
src/GeomToStep/GeomToStep_MakeLine.cdl
Executable file
@@ -0,0 +1,44 @@
|
||||
-- File: GeomToStep_MakeLine.cdl
|
||||
-- Created: Mon Jun 14 15:51:51 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeLine from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Line from Geom and Lin from gp, and the class
|
||||
-- Line from StepGeom which describes a line from
|
||||
-- Prostep.
|
||||
|
||||
uses Lin from gp,
|
||||
Lin2d from gp,
|
||||
Line from Geom,
|
||||
Line from Geom2d,
|
||||
Line from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( L : Lin from gp ) returns MakeLine;
|
||||
|
||||
Create ( L : Lin2d from gp ) returns MakeLine;
|
||||
|
||||
Create ( C : Line from Geom ) returns MakeLine;
|
||||
|
||||
Create ( C : Line from Geom2d ) returns MakeLine;
|
||||
|
||||
Value (me) returns Line from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theLine : Line from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeLine;
|
||||
|
||||
|
77
src/GeomToStep/GeomToStep_MakeLine.cxx
Executable file
77
src/GeomToStep/GeomToStep_MakeLine.cxx
Executable file
@@ -0,0 +1,77 @@
|
||||
// File: GeomToStep_MakeLine.cxx
|
||||
// Created: Thu Jun 17 11:11:28 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeLine.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <StepGeom_Line.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <StepGeom_Vector.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <GeomToStep_MakeLine.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <GeomToStep_MakeVector.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une line de prostep a partir d' une Lin de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin& L)
|
||||
{
|
||||
#define Vec_gen gp_Vec
|
||||
#include <GeomToStep_MakeLine_gen.pxx>
|
||||
#undef Vec_gen
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une line de prostep a partir d' une Lin2d de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin2d& L)
|
||||
{
|
||||
#define Vec_gen gp_Vec2d
|
||||
#include <GeomToStep_MakeLine_gen.pxx>
|
||||
#undef Vec_gen
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une line de prostep a partir d' une Line de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom_Line)& Gline)
|
||||
{
|
||||
gp_Lin L;
|
||||
L = Gline->Lin();
|
||||
#define Vec_gen gp_Vec
|
||||
#include <GeomToStep_MakeLine_gen.pxx>
|
||||
#undef Vec_gen
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une line de prostep a partir d' une Line de Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom2d_Line)& Gline)
|
||||
{
|
||||
gp_Lin2d L;
|
||||
L = Gline->Lin2d();
|
||||
#define Vec_gen gp_Vec2d
|
||||
#include <GeomToStep_MakeLine_gen.pxx>
|
||||
#undef Vec_gen
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Line) &
|
||||
GeomToStep_MakeLine::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theLine;
|
||||
}
|
||||
|
19
src/GeomToStep/GeomToStep_MakeLine_gen.pxx
Executable file
19
src/GeomToStep/GeomToStep_MakeLine_gen.pxx
Executable file
@@ -0,0 +1,19 @@
|
||||
// File: GeomToStep_MakeLine.gxx
|
||||
// Created: Wed Jun 23 12:09:00 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
|
||||
Handle(StepGeom_Line) Lin = new StepGeom_Line;
|
||||
Handle(StepGeom_CartesianPoint) aPnt;
|
||||
Handle(StepGeom_Vector) aDir;
|
||||
|
||||
GeomToStep_MakeCartesianPoint MkPoint(L.Location());
|
||||
GeomToStep_MakeVector MkVector(Vec_gen(L.Direction()));
|
||||
aPnt = MkPoint.Value();
|
||||
aDir = MkVector.Value();
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Lin->Init(name, aPnt, aDir);
|
||||
theLine = Lin;
|
||||
done = Standard_True;
|
||||
|
39
src/GeomToStep/GeomToStep_MakeParabola.cdl
Executable file
39
src/GeomToStep/GeomToStep_MakeParabola.cdl
Executable file
@@ -0,0 +1,39 @@
|
||||
-- File: GeomToStep_MakeParabola.cdl
|
||||
-- Created: Thu May 4 17:39:49 1995
|
||||
-- Author: Dieter THIEMANN
|
||||
-- <dth@bibox>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
|
||||
class MakeParabola from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between the class
|
||||
-- Parabola from Geom and the class Parabola from
|
||||
-- StepGeom which describes a Parabola from ProSTEP
|
||||
|
||||
|
||||
uses Parabola from Geom,
|
||||
Parabola from Geom2d,
|
||||
Parabola from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( C : Parabola from Geom2d) returns MakeParabola;
|
||||
|
||||
Create ( C : Parabola from Geom) returns MakeParabola;
|
||||
|
||||
|
||||
Value (me) returns Parabola from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
|
||||
fields
|
||||
|
||||
theParabola : Parabola from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeParabola;
|
73
src/GeomToStep/GeomToStep_MakeParabola.cxx
Executable file
73
src/GeomToStep/GeomToStep_MakeParabola.cxx
Executable file
@@ -0,0 +1,73 @@
|
||||
#include <GeomToStep_MakeParabola.ixx>
|
||||
|
||||
#include <StepGeom_Parabola.hxx>
|
||||
#include <gp_Parab.hxx>
|
||||
#include <gp_Parab2d.hxx>
|
||||
#include <Geom_Parabola.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement2d.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Creation d'une Parabola de prostep a partir d'une Parabola de
|
||||
// Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C)
|
||||
{
|
||||
gp_Parab2d gpPar;
|
||||
gpPar = C->Parab2d();
|
||||
|
||||
Handle(StepGeom_Parabola) PStep = new StepGeom_Parabola;
|
||||
StepGeom_Axis2Placement Ax2;
|
||||
Handle(StepGeom_Axis2Placement2d) Ax2Step;
|
||||
Standard_Real focal;
|
||||
|
||||
GeomToStep_MakeAxis2Placement2d MkAxis2(gpPar.Axis());
|
||||
Ax2Step = MkAxis2.Value();
|
||||
focal = gpPar.Focal();
|
||||
Ax2.SetValue(Ax2Step);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
PStep->Init(name, Ax2, focal);
|
||||
theParabola = PStep;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d'une Parabola de prostep a partir d'une Parabola de
|
||||
// Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C)
|
||||
{
|
||||
gp_Parab gpPar;
|
||||
gpPar = C->Parab();
|
||||
|
||||
Handle(StepGeom_Parabola) PStep = new StepGeom_Parabola;
|
||||
StepGeom_Axis2Placement Ax2;
|
||||
Handle(StepGeom_Axis2Placement3d) Ax2Step;
|
||||
Standard_Real focal;
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d MkAxis2(gpPar.Position());
|
||||
Ax2Step = MkAxis2.Value();
|
||||
focal = gpPar.Focal();
|
||||
Ax2.SetValue(Ax2Step);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
PStep->Init(name, Ax2, focal / UnitsMethods::LengthFactor());
|
||||
theParabola = PStep;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// return the result
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Parabola)& GeomToStep_MakeParabola::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theParabola;
|
||||
}
|
||||
|
38
src/GeomToStep/GeomToStep_MakePlane.cdl
Executable file
38
src/GeomToStep/GeomToStep_MakePlane.cdl
Executable file
@@ -0,0 +1,38 @@
|
||||
-- File: GeomToStep_MakePlane.cdl
|
||||
-- Created: Mon Jun 14 15:54:27 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakePlane from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Plane from Geom and Pln from gp, and the class
|
||||
-- Plane from StepGeom which describes a plane from
|
||||
-- Prostep.
|
||||
|
||||
uses Pln from gp,
|
||||
Plane from Geom,
|
||||
Plane from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( P : Pln from gp ) returns MakePlane;
|
||||
|
||||
Create ( P : Plane from Geom ) returns MakePlane;
|
||||
|
||||
Value (me) returns Plane from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
thePlane : Plane from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakePlane;
|
||||
|
||||
|
65
src/GeomToStep/GeomToStep_MakePlane.cxx
Executable file
65
src/GeomToStep/GeomToStep_MakePlane.cxx
Executable file
@@ -0,0 +1,65 @@
|
||||
// File: GeomToStep_MakePlane.cxx
|
||||
// Created: Thu Jun 17 11:49:59 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakePlane.ixx>
|
||||
#include <GeomToStep_MakePlane.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <StepGeom_Plane.hxx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un plane de prostep a partir d' un Pln de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakePlane::GeomToStep_MakePlane( const gp_Pln& P)
|
||||
{
|
||||
Handle(StepGeom_Plane) Plan = new StepGeom_Plane;
|
||||
Handle(StepGeom_Axis2Placement3d) aPosition;
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d MkAxis2(P.Position());
|
||||
aPosition = MkAxis2.Value();
|
||||
Plan->SetPosition(aPosition);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Plan->SetName(name);
|
||||
thePlane = Plan;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un plane de prostep a partir d' un Plane de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakePlane::GeomToStep_MakePlane( const Handle(Geom_Plane)& Gpln)
|
||||
{
|
||||
gp_Pln P;
|
||||
Handle(StepGeom_Plane) Plan = new StepGeom_Plane;
|
||||
Handle(StepGeom_Axis2Placement3d) aPosition;
|
||||
|
||||
P = Gpln->Pln();
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d MkAxis2(P.Position());
|
||||
aPosition = MkAxis2.Value();
|
||||
Plan->SetPosition(aPosition);
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Plan->SetName(name);
|
||||
thePlane = Plan;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Plane) &
|
||||
GeomToStep_MakePlane::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return thePlane;
|
||||
}
|
||||
|
36
src/GeomToStep/GeomToStep_MakePolyline.cdl
Executable file
36
src/GeomToStep/GeomToStep_MakePolyline.cdl
Executable file
@@ -0,0 +1,36 @@
|
||||
-- File: GeomToStep_MakePolyline.cdl
|
||||
-- Created: Mon Jul 12 16:32:27 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakePolyline from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between an Array1 of points
|
||||
-- from gp and a Polyline from StepGeom.
|
||||
|
||||
uses Array1OfPnt from TColgp,
|
||||
Array1OfPnt2d from TColgp,
|
||||
Polyline from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( P : Array1OfPnt from TColgp ) returns MakePolyline;
|
||||
|
||||
Create ( P : Array1OfPnt2d from TColgp ) returns MakePolyline;
|
||||
|
||||
Value (me) returns Polyline from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
thePolyline : Polyline from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakePolyline;
|
||||
|
||||
|
45
src/GeomToStep/GeomToStep_MakePolyline.cxx
Executable file
45
src/GeomToStep/GeomToStep_MakePolyline.cxx
Executable file
@@ -0,0 +1,45 @@
|
||||
// File: GeomToStep_MakePolyline.cxx
|
||||
// Created: Mon Jul 12 16:40:28 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakePolyline.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <StepGeom_Polyline.hxx>
|
||||
#include <StepGeom_HArray1OfCartesianPoint.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une polyline Step a partir d' une Array1OfPnt
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt& P)
|
||||
{
|
||||
gp_Pnt P1;
|
||||
#include <GeomToStep_MakePolyline_gen.pxx>
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une polyline Step a partir d' une Array1OfPnt2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt2d& P)
|
||||
{
|
||||
gp_Pnt2d P1;
|
||||
#include <GeomToStep_MakePolyline_gen.pxx>
|
||||
}
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Polyline) &
|
||||
GeomToStep_MakePolyline::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return thePolyline;
|
||||
}
|
21
src/GeomToStep/GeomToStep_MakePolyline_gen.pxx
Executable file
21
src/GeomToStep/GeomToStep_MakePolyline_gen.pxx
Executable file
@@ -0,0 +1,21 @@
|
||||
// File: GeomToStep_MakePolyline_gen.gxx
|
||||
// Created: Mon Jul 12 17:37:27 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
Standard_Integer N, i;
|
||||
Handle(StepGeom_HArray1OfCartesianPoint) aPoints;
|
||||
Handle(StepGeom_CartesianPoint) P2;
|
||||
|
||||
N = P.Length();
|
||||
aPoints = new StepGeom_HArray1OfCartesianPoint(1,N);
|
||||
for (i=P.Lower(); i<=P.Upper(); i++) {
|
||||
P1 = P.Value(i);
|
||||
GeomToStep_MakeCartesianPoint MkPoint(P1);
|
||||
P2 = MkPoint.Value();
|
||||
aPoints->SetValue(i,P2);
|
||||
}
|
||||
thePolyline = new StepGeom_Polyline;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
thePolyline->Init(name, aPoints);
|
||||
done = Standard_True;
|
40
src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cdl
Executable file
40
src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cdl
Executable file
@@ -0,0 +1,40 @@
|
||||
-- File: GeomToStep_MakeRectangularTrimmedSurface.cdl
|
||||
-- Created: Thu Jan 25 11:07:02 1996
|
||||
-- Author: Frederic MAUPAS
|
||||
-- <fma@pronox>
|
||||
---Copyright: Matra Datavision 1996
|
||||
|
||||
class MakeRectangularTrimmedSurface from GeomToStep
|
||||
inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between class
|
||||
-- RectangularTrimmedSurface from Geom and the class
|
||||
-- RectangularTrimmedSurface from
|
||||
-- StepGeom which describes a
|
||||
-- rectangular_trimmed_surface from ISO-IS 10303-42
|
||||
|
||||
uses RectangularTrimmedSurface from Geom,
|
||||
RectangularTrimmedSurface from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( RTSurf : RectangularTrimmedSurface from Geom ) returns
|
||||
MakeRectangularTrimmedSurface;
|
||||
|
||||
Value (me) returns
|
||||
RectangularTrimmedSurface from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theRectangularTrimmedSurface :
|
||||
RectangularTrimmedSurface from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeRectangularTrimmedSurface;
|
||||
|
||||
|
97
src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx
Executable file
97
src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx
Executable file
@@ -0,0 +1,97 @@
|
||||
// File: GeomToStep_MakeRectangularTrimmedSurface.cxx
|
||||
// Created: Thu Jan 25 11:16:17 1996
|
||||
// Author: Frederic MAUPAS
|
||||
// <fma@pronox>
|
||||
|
||||
#include <GeomToStep_MakeRectangularTrimmedSurface.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
#include <GeomToStep_MakeSurface.hxx>
|
||||
#include <StepGeom_Surface.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une rectangular_trimmed_surface de STEP
|
||||
// a partir d' une RectangularTrimmedSurface de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeRectangularTrimmedSurface::
|
||||
GeomToStep_MakeRectangularTrimmedSurface( const
|
||||
Handle(Geom_RectangularTrimmedSurface)& RTSurf )
|
||||
|
||||
{
|
||||
|
||||
Handle(StepGeom_RectangularTrimmedSurface) StepRTS = new StepGeom_RectangularTrimmedSurface;
|
||||
|
||||
Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString("");
|
||||
|
||||
GeomToStep_MakeSurface mkSurf(RTSurf->BasisSurface());
|
||||
if (!mkSurf.IsDone()) {
|
||||
done = Standard_False;
|
||||
return;
|
||||
}
|
||||
Handle(StepGeom_Surface) StepSurf = mkSurf.Value();
|
||||
|
||||
Standard_Real U1,U2,V1,V2;
|
||||
RTSurf->Bounds(U1, U2, V1, V2);
|
||||
|
||||
// -----------------------------------------
|
||||
// Modification of the Trimming Parameters ?
|
||||
// -----------------------------------------
|
||||
|
||||
Standard_Real AngleFact = 180./PI;
|
||||
Standard_Real uFact = 1.;
|
||||
Standard_Real vFact = 1.;
|
||||
Standard_Real LengthFact = UnitsMethods::LengthFactor();
|
||||
Handle(Geom_Surface) theSurf = RTSurf->BasisSurface();
|
||||
if (theSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
|
||||
uFact = AngleFact;
|
||||
vFact = 1. / LengthFact;
|
||||
}
|
||||
else if (theSurf->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) {
|
||||
uFact = AngleFact;
|
||||
}
|
||||
else if (theSurf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)) ||
|
||||
theSurf->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) {
|
||||
uFact = AngleFact;
|
||||
vFact = AngleFact;
|
||||
}
|
||||
else if (theSurf->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) {
|
||||
Handle(Geom_ConicalSurface) conicS =
|
||||
Handle(Geom_ConicalSurface)::DownCast(theSurf);
|
||||
Standard_Real semAng = conicS->SemiAngle();
|
||||
uFact = AngleFact;
|
||||
vFact = Cos(semAng) / LengthFact;
|
||||
}
|
||||
else if (theSurf->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
||||
uFact = vFact = 1. / LengthFact;
|
||||
}
|
||||
|
||||
U1 = U1 * uFact;
|
||||
U2 = U2 * uFact;
|
||||
V1 = V1 * vFact;
|
||||
V2 = V2 * vFact;
|
||||
|
||||
StepRTS->Init(aName, StepSurf, U1, U2, V1, V2, Standard_True, Standard_True);
|
||||
theRectangularTrimmedSurface = StepRTS;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_RectangularTrimmedSurface) &
|
||||
GeomToStep_MakeRectangularTrimmedSurface::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theRectangularTrimmedSurface;
|
||||
}
|
37
src/GeomToStep/GeomToStep_MakeSphericalSurface.cdl
Executable file
37
src/GeomToStep/GeomToStep_MakeSphericalSurface.cdl
Executable file
@@ -0,0 +1,37 @@
|
||||
-- File: GeomToStep_MakeSphericalSurface.cdl
|
||||
-- Created: Mon Jun 14 16:15:22 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeSphericalSurface from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between class
|
||||
-- SphericalSurface from Geom and the class
|
||||
-- SphericalSurface from StepGeom which describes a
|
||||
-- spherical_surface from Prostep
|
||||
|
||||
uses SphericalSurface from Geom,
|
||||
SphericalSurface from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
|
||||
|
||||
Create ( CSurf : SphericalSurface from Geom ) returns MakeSphericalSurface;
|
||||
|
||||
Value (me) returns SphericalSurface from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theSphericalSurface : SphericalSurface from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeSphericalSurface;
|
||||
|
||||
|
47
src/GeomToStep/GeomToStep_MakeSphericalSurface.cxx
Executable file
47
src/GeomToStep/GeomToStep_MakeSphericalSurface.cxx
Executable file
@@ -0,0 +1,47 @@
|
||||
// File: GeomToStep_MakeSphericalSurface.cxx
|
||||
// Created: Thu Jun 17 12:10:20 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeSphericalSurface.ixx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <StepGeom_SphericalSurface.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une conical_surface de prostep a partir d' une SphericalSurface
|
||||
// de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeSphericalSurface::GeomToStep_MakeSphericalSurface
|
||||
( const Handle(Geom_SphericalSurface)& S )
|
||||
|
||||
{
|
||||
Handle(StepGeom_SphericalSurface) Surf;
|
||||
Handle(StepGeom_Axis2Placement3d) aPosition;
|
||||
Standard_Real aRadius;
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position());
|
||||
aPosition = MkAxis2.Value();
|
||||
aRadius = S->Radius();
|
||||
Surf = new StepGeom_SphericalSurface;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Surf->Init(name, aPosition, aRadius/UnitsMethods::LengthFactor());
|
||||
theSphericalSurface = Surf;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_SphericalSurface) &
|
||||
GeomToStep_MakeSphericalSurface::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theSphericalSurface;
|
||||
}
|
36
src/GeomToStep/GeomToStep_MakeSurface.cdl
Executable file
36
src/GeomToStep/GeomToStep_MakeSurface.cdl
Executable file
@@ -0,0 +1,36 @@
|
||||
-- File: GeomToStep_MakeSurface.cdl
|
||||
-- Created: Tue Jun 22 12:19:43 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeSurface from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Surface from Geom and the class Surface from StepGeom which
|
||||
-- describes a Surface from prostep. As Surface is an abstract
|
||||
-- Surface this class is an access to the sub-class required.
|
||||
|
||||
uses Surface from Geom,
|
||||
Surface from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( C : Surface from Geom ) returns MakeSurface;
|
||||
|
||||
Value (me) returns Surface from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theSurface : Surface from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeSurface;
|
||||
|
||||
|
||||
|
76
src/GeomToStep/GeomToStep_MakeSurface.cxx
Executable file
76
src/GeomToStep/GeomToStep_MakeSurface.cxx
Executable file
@@ -0,0 +1,76 @@
|
||||
// File: GeomToStep_MakeSurface.cxx
|
||||
// Created: Tue Jun 22 12:22:04 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeSurface.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <StepGeom_Surface.hxx>
|
||||
#include <GeomToStep_MakeSurface.hxx>
|
||||
#include <Geom_BoundedSurface.hxx>
|
||||
#include <GeomToStep_MakeBoundedSurface.hxx>
|
||||
#include <Geom_ElementarySurface.hxx>
|
||||
#include <GeomToStep_MakeElementarySurface.hxx>
|
||||
#include <Geom_SweptSurface.hxx>
|
||||
#include <GeomToStep_MakeSweptSurface.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <StepGeom_OffsetSurface.hxx>
|
||||
#include <StepData_Logical.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une Surface de prostep a partir d' une Surface de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeSurface::GeomToStep_MakeSurface ( const Handle(Geom_Surface)& S)
|
||||
{
|
||||
done = Standard_True;
|
||||
if (S->IsKind(STANDARD_TYPE(Geom_BoundedSurface))) {
|
||||
Handle(Geom_BoundedSurface) S1 =
|
||||
Handle(Geom_BoundedSurface)::DownCast(S);
|
||||
GeomToStep_MakeBoundedSurface MkBoundedS(S1);
|
||||
theSurface = MkBoundedS.Value();
|
||||
}
|
||||
else if (S->IsKind(STANDARD_TYPE(Geom_ElementarySurface))) {
|
||||
Handle(Geom_ElementarySurface) S1 =
|
||||
Handle(Geom_ElementarySurface)::DownCast(S);
|
||||
GeomToStep_MakeElementarySurface MkElementaryS(S1);
|
||||
theSurface = MkElementaryS.Value();
|
||||
}
|
||||
else if (S->IsKind(STANDARD_TYPE(Geom_SweptSurface))) {
|
||||
Handle(Geom_SweptSurface) S1 =
|
||||
Handle(Geom_SweptSurface)::DownCast(S);
|
||||
GeomToStep_MakeSweptSurface MkSwept(S1);
|
||||
theSurface = MkSwept.Value();
|
||||
}
|
||||
else if (S->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) {
|
||||
Handle(Geom_OffsetSurface) S1 =
|
||||
Handle(Geom_OffsetSurface)::DownCast(S);
|
||||
GeomToStep_MakeSurface MkBasis(S1->BasisSurface());
|
||||
done = MkBasis.IsDone();
|
||||
if (!done) return;
|
||||
Handle(StepGeom_OffsetSurface) Surf = new StepGeom_OffsetSurface;
|
||||
Surf->Init (new TCollection_HAsciiString(""),
|
||||
MkBasis.Value(),S1->Offset()/UnitsMethods::LengthFactor(),StepData_LFalse);
|
||||
theSurface = Surf;
|
||||
}
|
||||
else {
|
||||
done = Standard_False;
|
||||
#ifdef DEB
|
||||
cout << " unknown type " << S->DynamicType()->Name() << endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Surface) &
|
||||
GeomToStep_MakeSurface::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theSurface;
|
||||
}
|
36
src/GeomToStep/GeomToStep_MakeSurfaceOfLinearExtrusion.cdl
Executable file
36
src/GeomToStep/GeomToStep_MakeSurfaceOfLinearExtrusion.cdl
Executable file
@@ -0,0 +1,36 @@
|
||||
-- File: GeomToStep_MakeSurfaceOfLinearExtrusion.cdl
|
||||
-- Created: Mon Jun 14 16:16:49 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeSurfaceOfLinearExtrusion from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between class
|
||||
-- SurfaceOfLinearExtrusion from Geom and the class
|
||||
-- SurfaceOfLinearExtrusion from StepGeom which describes a
|
||||
-- surface_of_linear_extrusion from Prostep
|
||||
|
||||
uses SurfaceOfLinearExtrusion from Geom,
|
||||
SurfaceOfLinearExtrusion from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( CSurf : SurfaceOfLinearExtrusion from Geom ) returns
|
||||
MakeSurfaceOfLinearExtrusion;
|
||||
|
||||
Value (me) returns SurfaceOfLinearExtrusion from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theSurfaceOfLinearExtrusion : SurfaceOfLinearExtrusion from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeSurfaceOfLinearExtrusion;
|
||||
|
||||
|
52
src/GeomToStep/GeomToStep_MakeSurfaceOfLinearExtrusion.cxx
Executable file
52
src/GeomToStep/GeomToStep_MakeSurfaceOfLinearExtrusion.cxx
Executable file
@@ -0,0 +1,52 @@
|
||||
// File: GeomToStep_MakeSurfaceOfLinearExtrusion.cxx
|
||||
// Created: Thu Jun 17 12:28:45 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeSurfaceOfLinearExtrusion.ixx>
|
||||
#include <GeomToStep_MakeVector.hxx>
|
||||
#include <GeomToStep_MakeCurve.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <StepGeom_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <StepGeom_Curve.hxx>
|
||||
#include <StepGeom_Vector.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une surface_of_linear_extrusion de prostep a partir d' une
|
||||
// SurfaceOfLinearExtrusion de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeSurfaceOfLinearExtrusion::GeomToStep_MakeSurfaceOfLinearExtrusion
|
||||
( const Handle(Geom_SurfaceOfLinearExtrusion)& S )
|
||||
|
||||
{
|
||||
Handle(StepGeom_SurfaceOfLinearExtrusion) Surf;
|
||||
Handle(StepGeom_Curve) aSweptCurve;
|
||||
Handle(StepGeom_Vector) aExtrusionAxis;
|
||||
|
||||
GeomToStep_MakeCurve MkCurve(S->BasisCurve());
|
||||
GeomToStep_MakeVector MkVector(gp_Vec(S->Direction()));
|
||||
|
||||
aSweptCurve = MkCurve.Value();
|
||||
aExtrusionAxis = MkVector.Value();
|
||||
|
||||
Surf = new StepGeom_SurfaceOfLinearExtrusion;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Surf->Init(name, aSweptCurve, aExtrusionAxis);
|
||||
theSurfaceOfLinearExtrusion = Surf;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_SurfaceOfLinearExtrusion) &
|
||||
GeomToStep_MakeSurfaceOfLinearExtrusion::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theSurfaceOfLinearExtrusion;
|
||||
}
|
36
src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.cdl
Executable file
36
src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.cdl
Executable file
@@ -0,0 +1,36 @@
|
||||
-- File: GeomToStep_MakeSurfaceOfRevolution.cdl
|
||||
-- Created: Mon Jun 14 16:20:58 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeSurfaceOfRevolution from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between class
|
||||
-- SurfaceOfRevolution from Geom and the class
|
||||
-- SurfaceOfRevolution from StepGeom which describes a
|
||||
-- surface_of_revolution from Prostep
|
||||
|
||||
uses SurfaceOfRevolution from Geom,
|
||||
SurfaceOfRevolution from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( RevSurf : SurfaceOfRevolution from Geom ) returns
|
||||
MakeSurfaceOfRevolution;
|
||||
|
||||
Value (me) returns SurfaceOfRevolution from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theSurfaceOfRevolution : SurfaceOfRevolution from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeSurfaceOfRevolution;
|
||||
|
||||
|
50
src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.cxx
Executable file
50
src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.cxx
Executable file
@@ -0,0 +1,50 @@
|
||||
// File: GeomToStep_MakeSurfaceOfRevolution.cxx
|
||||
// Created: Thu Jun 17 12:45:12 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeSurfaceOfRevolution.ixx>
|
||||
#include <GeomToStep_MakeAxis1Placement.hxx>
|
||||
#include <GeomToStep_MakeCurve.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <StepGeom_Curve.hxx>
|
||||
#include <StepGeom_Axis1Placement.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <StepGeom_SurfaceOfRevolution.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une surface_of_revolution de prostep a partir d' une
|
||||
// SurfaceOfRevolution de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeSurfaceOfRevolution::GeomToStep_MakeSurfaceOfRevolution
|
||||
( const Handle(Geom_SurfaceOfRevolution)& S )
|
||||
|
||||
{
|
||||
Handle(StepGeom_SurfaceOfRevolution) Surf;
|
||||
Handle(StepGeom_Curve) aSweptCurve;
|
||||
Handle(StepGeom_Axis1Placement) aAxisPosition;
|
||||
|
||||
GeomToStep_MakeCurve MkSwept(S->BasisCurve());
|
||||
GeomToStep_MakeAxis1Placement MkAxis1(S->Axis());
|
||||
aSweptCurve = MkSwept.Value();
|
||||
aAxisPosition = MkAxis1.Value();
|
||||
Surf = new StepGeom_SurfaceOfRevolution;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Surf->Init(name, aSweptCurve, aAxisPosition);
|
||||
theSurfaceOfRevolution = Surf;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_SurfaceOfRevolution) &
|
||||
GeomToStep_MakeSurfaceOfRevolution::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theSurfaceOfRevolution;
|
||||
}
|
37
src/GeomToStep/GeomToStep_MakeSweptSurface.cdl
Executable file
37
src/GeomToStep/GeomToStep_MakeSweptSurface.cdl
Executable file
@@ -0,0 +1,37 @@
|
||||
-- File: GeomToStep_MakeSweptSurface.cdl
|
||||
-- Created: Tue Jun 22 14:40:20 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeSweptSurface from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- SweptSurface from Geom and the class SweptSurface from
|
||||
-- StepGeom which describes a SweptSurface from prostep.
|
||||
-- As SweptSurface is an abstract SweptSurface this class
|
||||
-- is an access to the sub-class required.
|
||||
|
||||
uses SweptSurface from Geom,
|
||||
SweptSurface from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( S : SweptSurface from Geom ) returns MakeSweptSurface;
|
||||
|
||||
Value (me) returns SweptSurface from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theSweptSurface : SweptSurface from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeSweptSurface;
|
||||
|
||||
|
||||
|
51
src/GeomToStep/GeomToStep_MakeSweptSurface.cxx
Executable file
51
src/GeomToStep/GeomToStep_MakeSweptSurface.cxx
Executable file
@@ -0,0 +1,51 @@
|
||||
// File: GeomToStep_MakeSweptSurface.cxx
|
||||
// Created: Tue Jun 22 14:42:00 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeSweptSurface.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <StepGeom_SweptSurface.hxx>
|
||||
#include <GeomToStep_MakeSweptSurface.hxx>
|
||||
#include <Geom_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <GeomToStep_MakeSurfaceOfLinearExtrusion.hxx>
|
||||
#include <GeomToStep_MakeSurfaceOfRevolution.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une SweptSurface de prostep a partir d' une
|
||||
// SweptSurface de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeSweptSurface::GeomToStep_MakeSweptSurface
|
||||
( const Handle(Geom_SweptSurface)& S)
|
||||
{
|
||||
done = Standard_True;
|
||||
if (S->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))) {
|
||||
Handle(Geom_SurfaceOfLinearExtrusion) Sur =
|
||||
Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(S);
|
||||
GeomToStep_MakeSurfaceOfLinearExtrusion MkLinear(Sur);
|
||||
theSweptSurface = MkLinear.Value();
|
||||
}
|
||||
else if (S->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) {
|
||||
Handle(Geom_SurfaceOfRevolution) Sur =
|
||||
Handle(Geom_SurfaceOfRevolution)::DownCast(S);
|
||||
GeomToStep_MakeSurfaceOfRevolution MkRevol(Sur);
|
||||
theSweptSurface = MkRevol.Value();
|
||||
}
|
||||
else
|
||||
done = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_SweptSurface) &
|
||||
GeomToStep_MakeSweptSurface::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theSweptSurface;
|
||||
}
|
36
src/GeomToStep/GeomToStep_MakeToroidalSurface.cdl
Executable file
36
src/GeomToStep/GeomToStep_MakeToroidalSurface.cdl
Executable file
@@ -0,0 +1,36 @@
|
||||
-- File: GeomToStep_MakeToroidalSurface.cdl
|
||||
-- Created: Mon Jun 14 16:23:51 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeToroidalSurface from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between class
|
||||
-- ToroidalSurface from Geom and the class
|
||||
-- ToroidalSurface from StepGeom which describes a
|
||||
-- toroidal_surface from Prostep
|
||||
|
||||
uses ToroidalSurface from Geom,
|
||||
ToroidalSurface from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( TorSurf : ToroidalSurface from Geom ) returns MakeToroidalSurface;
|
||||
|
||||
Value (me) returns ToroidalSurface from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theToroidalSurface : ToroidalSurface from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeToroidalSurface;
|
||||
|
||||
|
||||
|
48
src/GeomToStep/GeomToStep_MakeToroidalSurface.cxx
Executable file
48
src/GeomToStep/GeomToStep_MakeToroidalSurface.cxx
Executable file
@@ -0,0 +1,48 @@
|
||||
// File: GeomToStep_MakeToroidalSurface.cxx
|
||||
// Created: Thu Jun 17 14:47:08 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeToroidalSurface.ixx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <StepGeom_ToroidalSurface.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une toroidal_surface de prostep a partir d' une ToroidalSurface
|
||||
// de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeToroidalSurface::GeomToStep_MakeToroidalSurface
|
||||
( const Handle(Geom_ToroidalSurface)& S )
|
||||
|
||||
{
|
||||
Handle(StepGeom_ToroidalSurface) Surf;
|
||||
Handle(StepGeom_Axis2Placement3d) aPosition;
|
||||
Standard_Real aMajorRadius, aMinorRadius;
|
||||
|
||||
GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position());
|
||||
aPosition = MkAxis2.Value();
|
||||
aMajorRadius = S->MajorRadius();
|
||||
aMinorRadius = S->MinorRadius();
|
||||
Surf = new StepGeom_ToroidalSurface;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Standard_Real fact = UnitsMethods::LengthFactor();
|
||||
Surf->Init(name, aPosition, aMajorRadius/fact, aMinorRadius/fact);
|
||||
theToroidalSurface = Surf;
|
||||
done = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_ToroidalSurface) &
|
||||
GeomToStep_MakeToroidalSurface::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theToroidalSurface;
|
||||
}
|
44
src/GeomToStep/GeomToStep_MakeVector.cdl
Executable file
44
src/GeomToStep/GeomToStep_MakeVector.cdl
Executable file
@@ -0,0 +1,44 @@
|
||||
-- File: GeomToStep_MakeVector.cdl
|
||||
-- Created: Mon Jun 14 15:10:06 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
class MakeVector from GeomToStep inherits Root from GeomToStep
|
||||
|
||||
---Purpose: This class implements the mapping between classes
|
||||
-- Vector from Geom, Geom2d and Vec, Vec2d from gp, and the class
|
||||
-- Vector from StepGeom which describes a Vector from
|
||||
-- Prostep.
|
||||
|
||||
uses Vec from gp,
|
||||
Vec2d from gp,
|
||||
Vector from Geom,
|
||||
Vector from Geom2d,
|
||||
Vector from StepGeom
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create ( V : Vec from gp ) returns MakeVector;
|
||||
|
||||
Create ( V : Vec2d from gp ) returns MakeVector;
|
||||
|
||||
Create ( V : Vector from Geom ) returns MakeVector;
|
||||
|
||||
Create ( V : Vector from Geom2d ) returns MakeVector;
|
||||
|
||||
Value (me) returns Vector from StepGeom
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
fields
|
||||
|
||||
theVector : Vector from StepGeom;
|
||||
-- The solution from StepGeom
|
||||
|
||||
end MakeVector;
|
||||
|
||||
|
75
src/GeomToStep/GeomToStep_MakeVector.cxx
Executable file
75
src/GeomToStep/GeomToStep_MakeVector.cxx
Executable file
@@ -0,0 +1,75 @@
|
||||
// File: GeomToStep_MakeVector.cxx
|
||||
// Created: Thu Jun 17 14:56:55 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
#include <GeomToStep_MakeVector.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Geom_Vector.hxx>
|
||||
#include <StepGeom_Vector.hxx>
|
||||
#include <GeomToStep_MakeDirection.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un vector de prostep a partir d' un Vec de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec& V)
|
||||
{
|
||||
gp_Dir D = gp_Dir(V);
|
||||
Standard_Real lFactor = UnitsMethods::LengthFactor();
|
||||
#include <GeomToStep_MakeVector_gen.pxx>
|
||||
}
|
||||
//=============================================================================
|
||||
// Creation d' un vector de prostep a partir d' un Vec2d de gp
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec2d& V)
|
||||
{
|
||||
gp_Dir2d D = gp_Dir2d(V);
|
||||
Standard_Real lFactor = 1.;
|
||||
#include <GeomToStep_MakeVector_gen.pxx>
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un vector de prostep a partir d' un Vector de Geom
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom_Vector)&
|
||||
GVector)
|
||||
{
|
||||
gp_Vec V;
|
||||
V = GVector->Vec();
|
||||
gp_Dir D = gp_Dir(V);
|
||||
Standard_Real lFactor = UnitsMethods::LengthFactor();
|
||||
#include <GeomToStep_MakeVector_gen.pxx>
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' un vector de prostep a partir d' un Vector de Geom2d
|
||||
//=============================================================================
|
||||
|
||||
GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom2d_Vector)&
|
||||
GVector)
|
||||
{
|
||||
gp_Vec2d V;
|
||||
V = GVector->Vec2d();
|
||||
gp_Dir2d D = gp_Dir2d(V);
|
||||
Standard_Real lFactor = 1.;
|
||||
#include <GeomToStep_MakeVector_gen.pxx>
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// renvoi des valeurs
|
||||
//=============================================================================
|
||||
|
||||
const Handle(StepGeom_Vector) &
|
||||
GeomToStep_MakeVector::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!done == Standard_True,"");
|
||||
return theVector;
|
||||
}
|
17
src/GeomToStep/GeomToStep_MakeVector_gen.pxx
Executable file
17
src/GeomToStep/GeomToStep_MakeVector_gen.pxx
Executable file
@@ -0,0 +1,17 @@
|
||||
// File: GeomToStep_MakeVector.gxx
|
||||
// Created: Tue Jun 22 18:37:37 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
|
||||
Handle(StepGeom_Vector) Vect = new StepGeom_Vector;
|
||||
Handle(StepGeom_Direction) aDirection;
|
||||
Standard_Real aMagnitude;
|
||||
|
||||
GeomToStep_MakeDirection MkDir(D);
|
||||
aDirection = MkDir.Value();
|
||||
aMagnitude = V.Magnitude();
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
|
||||
Vect->Init(name, aDirection, aMagnitude / lFactor);
|
||||
theVector = Vect;
|
||||
done = Standard_True;
|
23
src/GeomToStep/GeomToStep_Root.cdl
Executable file
23
src/GeomToStep/GeomToStep_Root.cdl
Executable file
@@ -0,0 +1,23 @@
|
||||
-- File: GeomToStep_Root.cdl
|
||||
-- Created: Mon Jun 14 11:44:56 1993
|
||||
-- Author: Martine LANGLOIS
|
||||
-- <mla@mastox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
private deferred class Root from GeomToStep
|
||||
|
||||
---Purpose : This class implements the common services for
|
||||
-- all classes of GeomToStep 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;
|
||||
|
24
src/GeomToStep/GeomToStep_Root.cxx
Executable file
24
src/GeomToStep/GeomToStep_Root.cxx
Executable file
@@ -0,0 +1,24 @@
|
||||
// File: GeomToStep_Root.cxx
|
||||
// Created: Fri Jun 25 15:23:36 1993
|
||||
// Author: Martine LANGLOIS
|
||||
// <mla@mastox>
|
||||
|
||||
|
||||
#include <GeomToStep_Root.ixx>
|
||||
|
||||
Standard_Boolean GeomToStep_Root::IsDone () const
|
||||
{
|
||||
return done;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
6
src/GeomToStep/GeomToStep_WOKSteps.edl
Executable file
6
src/GeomToStep/GeomToStep_WOKSteps.edl
Executable file
@@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
|
||||
@set %WOKSteps_UseSourceInclude = "yes";
|
||||
|
||||
|
Reference in New Issue
Block a user