Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:21:09

0001 // Created on: 1998-07-14
0002 // Created by: data exchange team
0003 // Copyright (c) 1998-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _ShapeConstruct_HeaderFile
0018 #define _ShapeConstruct_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GeomAbs_Shape.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <TopoDS_Shape.hxx>
0027 #include <NCollection_Sequence.hxx>
0028 #include <NCollection_HSequence.hxx>
0029 #include <TopAbs_Orientation.hxx>
0030 class Geom_BSplineCurve;
0031 class Geom_Curve;
0032 class Geom2d_BSplineCurve;
0033 class Geom2d_Curve;
0034 class Geom_BSplineSurface;
0035 class Geom_Surface;
0036 class TopoDS_Face;
0037 class TopoDS_Edge;
0038 
0039 //! This package provides new algorithms for constructing
0040 //! new geometrical objects and topological shapes. It
0041 //! complements and extends algorithms available in Open
0042 //! CASCADE topological and geometrical toolkist.
0043 //! The functionality provided by this package are the
0044 //! following:
0045 //! projecting curves on surface,
0046 //! adjusting curve to have given start and end points. P
0047 class ShapeConstruct
0048 {
0049 public:
0050   DEFINE_STANDARD_ALLOC
0051 
0052   //! Tool for wire triangulation
0053   Standard_EXPORT static occ::handle<Geom_BSplineCurve> ConvertCurveToBSpline(
0054     const occ::handle<Geom_Curve>& C3D,
0055     const double                   First,
0056     const double                   Last,
0057     const double                   Tol3d,
0058     const GeomAbs_Shape            Continuity,
0059     const int                      MaxSegments,
0060     const int                      MaxDegree);
0061 
0062   Standard_EXPORT static occ::handle<Geom2d_BSplineCurve> ConvertCurveToBSpline(
0063     const occ::handle<Geom2d_Curve>& C2D,
0064     const double                     First,
0065     const double                     Last,
0066     const double                     Tol2d,
0067     const GeomAbs_Shape              Continuity,
0068     const int                        MaxSegments,
0069     const int                        MaxDegree);
0070 
0071   Standard_EXPORT static occ::handle<Geom_BSplineSurface> ConvertSurfaceToBSpline(
0072     const occ::handle<Geom_Surface>& surf,
0073     const double                     UF,
0074     const double                     UL,
0075     const double                     VF,
0076     const double                     VL,
0077     const double                     Tol3d,
0078     const GeomAbs_Shape              Continuity,
0079     const int                        MaxSegments,
0080     const int                        MaxDegree);
0081 
0082   //! join pcurves of the <theEdge> on the <theFace>
0083   //! try to use pcurves from originas edges <theEdges>
0084   //! Returns false if cannot join pcurves
0085   Standard_EXPORT static bool JoinPCurves(
0086     const occ::handle<NCollection_HSequence<TopoDS_Shape>>& theEdges,
0087     const TopoDS_Face&                                      theFace,
0088     TopoDS_Edge&                                            theEdge);
0089 
0090   //! Method for joininig curves 3D.
0091   //! Parameters : c3d1,ac3d2 - initial curves
0092   //! Orient1, Orient2 - initial edges orientations.
0093   //! first1,last1,first2,last2 - parameters for trimming curves
0094   //! (re-calculate with account of orientation edges)
0095   //! c3dOut - result curve
0096   //! isRev1,isRev2 - out parameters indicative on possible errors.
0097   //! Return value : True - if curves were joined successfully,
0098   //! else - False.
0099   Standard_EXPORT static bool JoinCurves(const occ::handle<Geom_Curve>& c3d1,
0100                                          const occ::handle<Geom_Curve>& ac3d2,
0101                                          const TopAbs_Orientation       Orient1,
0102                                          const TopAbs_Orientation       Orient2,
0103                                          double&                        first1,
0104                                          double&                        last1,
0105                                          double&                        first2,
0106                                          double&                        last2,
0107                                          occ::handle<Geom_Curve>&       c3dOut,
0108                                          bool&                          isRev1,
0109                                          bool&                          isRev2);
0110 
0111   //! Method for joininig curves 3D.
0112   //! Parameters : c3d1,ac3d2 - initial curves
0113   //! Orient1, Orient2 - initial edges orientations.
0114   //! first1,last1,first2,last2 - parameters for trimming curves
0115   //! (re-calculate with account of orientation edges)
0116   //! c3dOut - result curve
0117   //! isRev1,isRev2 - out parameters indicative on possible errors.
0118   //! isError - input parameter indicative possible errors due to that one from edges have one
0119   //! vertex Return value : True - if curves were joined successfully, else - False.
0120   Standard_EXPORT static bool JoinCurves(const occ::handle<Geom2d_Curve>& c2d1,
0121                                          const occ::handle<Geom2d_Curve>& ac2d2,
0122                                          const TopAbs_Orientation         Orient1,
0123                                          const TopAbs_Orientation         Orient2,
0124                                          double&                          first1,
0125                                          double&                          last1,
0126                                          double&                          first2,
0127                                          double&                          last2,
0128                                          occ::handle<Geom2d_Curve>&       c2dOut,
0129                                          bool&                            isRev1,
0130                                          bool&                            isRev2,
0131                                          const bool                       isError = false);
0132 };
0133 
0134 #endif // _ShapeConstruct_HeaderFile