Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:19:26

0001 // Created on: 2013-05-20
0002 // Created by: Mikhail PONIKAROV
0003 // Copyright (c) 2003-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef ChFi2d_ChamferAPI_HeaderFile
0017 #define ChFi2d_ChamferAPI_HeaderFile
0018 
0019 #include <TopoDS_Edge.hxx>
0020 #include <TopoDS_Wire.hxx>
0021 #include <Geom_Curve.hxx>
0022 
0023 //! A class making a chamfer between two linear edges.
0024 class ChFi2d_ChamferAPI
0025 {
0026 public:
0027   //! An empty constructor.
0028   Standard_EXPORT ChFi2d_ChamferAPI();
0029 
0030   //! A constructor accepting a wire consisting of two linear edges.
0031   Standard_EXPORT ChFi2d_ChamferAPI(const TopoDS_Wire& theWire);
0032 
0033   //! A constructor accepting two linear edges.
0034   Standard_EXPORT ChFi2d_ChamferAPI(const TopoDS_Edge& theEdge1, const TopoDS_Edge& theEdge2);
0035 
0036   //! Initializes the class by a wire consisting of two libear edges.
0037   Standard_EXPORT void Init(const TopoDS_Wire& theWire);
0038 
0039   //! Initializes the class by two linear edges.
0040   Standard_EXPORT void Init(const TopoDS_Edge& theEdge1, const TopoDS_Edge& theEdge2);
0041 
0042   //! Constructs a chamfer edge.
0043   //! Returns true if the edge is constructed.
0044   Standard_EXPORT bool Perform();
0045 
0046   // Returns the result (chamfer edge, modified edge1, modified edge2).
0047   Standard_EXPORT TopoDS_Edge Result(TopoDS_Edge& theEdge1,
0048                                      TopoDS_Edge& theEdge2,
0049                                      const double theLength1,
0050                                      const double theLength2);
0051 
0052 private:
0053   TopoDS_Edge             myEdge1, myEdge2;
0054   occ::handle<Geom_Curve> myCurve1, myCurve2;
0055   double                  myStart1, myEnd1, myStart2, myEnd2;
0056   bool                    myCommonStart1, myCommonStart2;
0057 };
0058 
0059 #endif // _CHAMFERAPI_H_