Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:16:40

0001 // Created on: 1994-12-09
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1994-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 _BRepBuilderAPI_NurbsConvert_HeaderFile
0018 #define _BRepBuilderAPI_NurbsConvert_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <BRepBuilderAPI_ModifyShape.hxx>
0024 #include <TopoDS_Shape.hxx>
0025 #include <TopTools_ShapeMapHasher.hxx>
0026 #include <NCollection_DataMap.hxx>
0027 #include <BRepTools_ReShape.hxx>
0028 
0029 class TopoDS_Shape;
0030 
0031 //! Conversion of the complete geometry of a shape
0032 //! (all 3D analytical representation of surfaces and curves)
0033 //! into NURBS geometry (except for Planes). For example,
0034 //! all curves supporting edges of the basis shape are converted
0035 //! into BSpline curves, and all surfaces supporting its faces are
0036 //! converted into BSpline surfaces.
0037 class BRepBuilderAPI_NurbsConvert : public BRepBuilderAPI_ModifyShape
0038 {
0039 public:
0040   DEFINE_STANDARD_ALLOC
0041 
0042   //! Constructs a framework for converting the geometry of a
0043   //! shape into NURBS geometry. Use the function Perform
0044   //! to define the shape to convert.
0045   Standard_EXPORT BRepBuilderAPI_NurbsConvert();
0046 
0047   //! Builds a new shape by converting the geometry of the
0048   //! shape S into NURBS geometry. Specifically, all curves
0049   //! supporting edges of S are converted into BSpline
0050   //! curves, and all surfaces supporting its faces are
0051   //! converted into BSpline surfaces.
0052   //! Use the function Shape to access the new shape.
0053   //! Note: the constructed framework can be reused to
0054   //! convert other shapes. You specify these with the
0055   //! function Perform.
0056   Standard_EXPORT BRepBuilderAPI_NurbsConvert(const TopoDS_Shape& S, const bool Copy = false);
0057 
0058   //! Builds a new shape by converting the geometry of the
0059   //! shape S into NURBS geometry.
0060   //! Specifically, all curves supporting edges of S are
0061   //! converted into BSpline curves, and all surfaces
0062   //! supporting its faces are converted into BSpline surfaces.
0063   //! Use the function Shape to access the new shape.
0064   //! Note: this framework can be reused to convert other
0065   //! shapes: you specify them by calling the function Perform again.
0066   Standard_EXPORT void Perform(const TopoDS_Shape& S, const bool Copy = false);
0067 
0068   //! Returns the list of shapes modified from the shape
0069   //! <S>.
0070   Standard_EXPORT const NCollection_List<TopoDS_Shape>& Modified(const TopoDS_Shape& S) override;
0071 
0072   //! Returns the modified shape corresponding to <S>.
0073   //! S can correspond to the entire initial shape or to its subshape.
0074   //! Exceptions
0075   //! Standard_NoSuchObject if S is not the initial shape or
0076   //! a subshape of the initial shape to which the
0077   //! transformation has been applied.
0078   Standard_EXPORT TopoDS_Shape ModifiedShape(const TopoDS_Shape& S) const override;
0079 
0080 private:
0081   Standard_EXPORT void CorrectVertexTol();
0082 
0083   NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> myVtxToReplace;
0084   BRepTools_ReShape                                                        mySubs;
0085 };
0086 
0087 #endif // _BRepBuilderAPI_NurbsConvert_HeaderFile