Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:18:59

0001 // Created on: 1999-05-14
0002 // Created by: Pavel DURANDIN
0003 // Copyright (c) 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 _ShapeUpgrade_ShapeConvertToBezier_HeaderFile
0018 #define _ShapeUpgrade_ShapeConvertToBezier_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <ShapeUpgrade_ShapeDivide.hxx>
0026 class TopoDS_Shape;
0027 class ShapeUpgrade_FaceDivide;
0028 class Message_Msg;
0029 
0030 //! API class for performing conversion of 3D, 2D curves to bezier curves
0031 //! and surfaces to bezier based surfaces (
0032 //! bezier surface,
0033 //! surface of revolution based on bezier curve,
0034 //! offset surface based on any previous type).
0035 class ShapeUpgrade_ShapeConvertToBezier : public ShapeUpgrade_ShapeDivide
0036 {
0037 public:
0038   DEFINE_STANDARD_ALLOC
0039 
0040   //! Empty constructor.
0041   Standard_EXPORT ShapeUpgrade_ShapeConvertToBezier();
0042 
0043   //! Initialize by a Shape.
0044   Standard_EXPORT ShapeUpgrade_ShapeConvertToBezier(const TopoDS_Shape& S);
0045 
0046   //! Sets mode for conversion 2D curves to bezier.
0047   void Set2dConversion(const bool mode);
0048 
0049   //! Returns the 2D conversion mode.
0050   bool Get2dConversion() const;
0051 
0052   //! Sets mode for conversion 3d curves to bezier.
0053   void Set3dConversion(const bool mode);
0054 
0055   //! Returns the 3D conversion mode.
0056   bool Get3dConversion() const;
0057 
0058   //! Sets mode for conversion surfaces curves to
0059   //! bezier basis.
0060   void SetSurfaceConversion(const bool mode);
0061 
0062   //! Returns the surface conversion mode.
0063   bool GetSurfaceConversion() const;
0064 
0065   //! Sets mode for conversion Geom_Line to bezier.
0066   void Set3dLineConversion(const bool mode);
0067 
0068   //! Returns the Geom_Line conversion mode.
0069   bool Get3dLineConversion() const;
0070 
0071   //! Sets mode for conversion Geom_Circle to bezier.
0072   void Set3dCircleConversion(const bool mode);
0073 
0074   //! Returns the Geom_Circle conversion mode.
0075   bool Get3dCircleConversion() const;
0076 
0077   //! Sets mode for conversion Geom_Conic to bezier.
0078   void Set3dConicConversion(const bool mode);
0079 
0080   //! Returns the Geom_Conic conversion mode.
0081   bool Get3dConicConversion() const;
0082 
0083   //! Sets mode for conversion Geom_Plane to Bezier
0084   void SetPlaneMode(const bool mode);
0085 
0086   //! Returns the Geom_Pline conversion mode.
0087   bool GetPlaneMode() const;
0088 
0089   //! Sets mode for conversion Geom_SurfaceOfRevolution to Bezier
0090   void SetRevolutionMode(const bool mode);
0091 
0092   //! Returns the Geom_SurfaceOfRevolution conversion mode.
0093   bool GetRevolutionMode() const;
0094 
0095   //! Sets mode for conversion Geom_SurfaceOfLinearExtrusion to Bezier
0096   void SetExtrusionMode(const bool mode);
0097 
0098   //! Returns the Geom_SurfaceOfLinearExtrusion conversion mode.
0099   bool GetExtrusionMode() const;
0100 
0101   //! Sets mode for conversion Geom_BSplineSurface to Bezier
0102   void SetBSplineMode(const bool mode);
0103 
0104   //! Returns the Geom_BSplineSurface conversion mode.
0105   bool GetBSplineMode() const;
0106 
0107   //! Performs converting and computes the resulting shape
0108   Standard_EXPORT bool Perform(const bool newContext = true) override;
0109 
0110 protected:
0111   //! Returns the tool for dividing faces.
0112   Standard_EXPORT occ::handle<ShapeUpgrade_FaceDivide> GetSplitFaceTool() const override;
0113 
0114   Standard_EXPORT Message_Msg GetFaceMsg() const override;
0115 
0116   Standard_EXPORT Message_Msg GetWireMsg() const override;
0117 
0118   //! Returns a message describing modification of a shape.
0119   Standard_EXPORT Message_Msg GetEdgeMsg() const override;
0120 
0121 private:
0122   bool my2dMode;
0123   bool my3dMode;
0124   bool mySurfaceMode;
0125   bool my3dLineMode;
0126   bool my3dCircleMode;
0127   bool my3dConicMode;
0128   bool myPlaneMode;
0129   bool myRevolutionMode;
0130   bool myExtrusionMode;
0131   bool myBSplineMode;
0132   int  myLevel;
0133 };
0134 
0135 #include <ShapeUpgrade_ShapeConvertToBezier.lxx>
0136 
0137 #endif // _ShapeUpgrade_ShapeConvertToBezier_HeaderFile