Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 09:16:29

0001 // Created on: 1997-01-17
0002 // Created by: Didier PIFFAULT
0003 // Copyright (c) 1997-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 _BRepAlgo_HeaderFile
0018 #define _BRepAlgo_HeaderFile
0019 
0020 #include <GeomAbs_Shape.hxx>
0021 #include <TopoDS_Shape.hxx>
0022 #include <NCollection_List.hxx>
0023 class TopoDS_Wire;
0024 class TopoDS_Edge;
0025 class TopoDS_Face;
0026 class TopoDS_Shape;
0027 
0028 //! The BRepAlgo class provides the following tools for:
0029 //! - Checking validity of the shape;
0030 //! - Concatenation of the edges of the wire.
0031 class BRepAlgo
0032 {
0033 public:
0034   //! this method makes a wire whose edges are C1 from
0035   //! a Wire whose edges could be G1. It removes a vertex
0036   //! between G1 edges.
0037   //! Option can be G1 or C1.
0038   Standard_EXPORT static TopoDS_Wire ConcatenateWire(const TopoDS_Wire&  Wire,
0039                                                      const GeomAbs_Shape Option,
0040                                                      const double        AngularTolerance = 1.0e-4);
0041 
0042   //! this method makes an edge from a wire.
0043   //! Junction points between edges of wire may be sharp,
0044   //! resulting curve of the resulting edge may be C0.
0045   Standard_EXPORT static TopoDS_Edge ConcatenateWireC0(const TopoDS_Wire& Wire);
0046 
0047   //! Method of wire conversion, calls BRepAlgo_Approx internally.
0048   //! @param theWire
0049   //!   Input Wire object.
0050   //! @param theAngleTolerance
0051   //!   Angle (in radians) defining the continuity of the wire: if two vectors
0052   //!   differ by less than this angle, the result will be smooth (zero angle of
0053   //!   tangent lines between curve elements).
0054   //! @return
0055   //!   The new TopoDS_Wire object consisting of edges each representing an arc
0056   //!   of circle or a linear segment. The accuracy of conversion is defined
0057   //!   as the maximal tolerance of edges in theWire.
0058   static Standard_EXPORT TopoDS_Wire ConvertWire(const TopoDS_Wire& theWire,
0059                                                  const double       theAngleTolerance,
0060                                                  const TopoDS_Face& theFace);
0061 
0062   //! Method of face conversion. The API corresponds to the method ConvertWire.
0063   //! This is a shortcut for calling ConvertWire() for each wire in theFace.
0064   static Standard_EXPORT TopoDS_Face ConvertFace(const TopoDS_Face& theFace,
0065                                                  const double       theAngleTolerance);
0066 
0067   //! Checks if the shape is "correct". If not, returns
0068   //! <false>, else returns <true>.
0069   Standard_EXPORT static bool IsValid(const TopoDS_Shape& S);
0070 
0071   //! Checks if the Generated and Modified Faces from
0072   //! the shapes <arguments> in the shape <result> are
0073   //! "correct". The args may be empty, then all faces
0074   //! will be checked.
0075   //! If <Closed> is True, only closed shape are valid.
0076   //! If <GeomCtrl> is False the geometry of new
0077   //! vertices and edges are not verified and the
0078   //! auto-intersection of new wires are not searched.
0079   Standard_EXPORT static bool IsValid(const NCollection_List<TopoDS_Shape>& theArgs,
0080                                       const TopoDS_Shape&                   theResult,
0081                                       const bool                            closedSolid = false,
0082                                       const bool                            GeomCtrl    = true);
0083 
0084   //! Checks if the shape is "correct".
0085   //! If not, returns FALSE, else returns TRUE.
0086   //! This method differs from the previous one in the fact that no geometric controls
0087   //! (intersection of wires, pcurve validity) are performed.
0088   Standard_EXPORT static bool IsTopologicallyValid(const TopoDS_Shape& S);
0089 };
0090 
0091 #endif // _BRepAlgo_HeaderFile