Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:15:04

0001 // Created on: 1998-07-02
0002 // Created by: Joelle CHAUVET
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 _BRepFill_CompatibleWires_HeaderFile
0018 #define _BRepFill_CompatibleWires_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <BRepFill_ThruSectionErrorStatus.hxx>
0024 #include <TopoDS_Shape.hxx>
0025 #include <NCollection_Sequence.hxx>
0026 #include <NCollection_List.hxx>
0027 #include <TopTools_ShapeMapHasher.hxx>
0028 #include <NCollection_DataMap.hxx>
0029 class TopoDS_Edge;
0030 
0031 //! Constructs a sequence of Wires (with good orientation
0032 //! and origin) agreed each other so that the surface passing
0033 //! through these sections is not twisted
0034 class BRepFill_CompatibleWires
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   Standard_EXPORT BRepFill_CompatibleWires();
0040 
0041   Standard_EXPORT BRepFill_CompatibleWires(const NCollection_Sequence<TopoDS_Shape>& Sections);
0042 
0043   Standard_EXPORT void Init(const NCollection_Sequence<TopoDS_Shape>& Sections);
0044 
0045   Standard_EXPORT void SetPercent(const double percent = 0.01);
0046 
0047   //! Performs CompatibleWires According to the orientation
0048   //! and the origin of each other
0049   Standard_EXPORT void Perform(const bool WithRotation = true);
0050 
0051   Standard_EXPORT bool IsDone() const;
0052 
0053   BRepFill_ThruSectionErrorStatus GetStatus() const { return myStatus; }
0054 
0055   //! returns the generated sequence.
0056   Standard_EXPORT const NCollection_Sequence<TopoDS_Shape>& Shape() const;
0057 
0058   //! Returns the shapes created from a subshape
0059   //! <SubSection> of a section.
0060   Standard_EXPORT const NCollection_List<TopoDS_Shape>& GeneratedShapes(
0061     const TopoDS_Edge& SubSection) const;
0062 
0063   Standard_EXPORT const NCollection_DataMap<TopoDS_Shape,
0064                                             NCollection_List<TopoDS_Shape>,
0065                                             TopTools_ShapeMapHasher>&
0066                         Generated() const;
0067 
0068   Standard_EXPORT bool IsDegeneratedFirstSection() const;
0069 
0070   Standard_EXPORT bool IsDegeneratedLastSection() const;
0071 
0072 private:
0073   //! Insert cutting points on closed wires to have same
0074   //! number of edges. The sequence of shapes must
0075   //! be a sequence of wires.
0076   Standard_EXPORT void SameNumberByPolarMethod(const bool WithRotation = true);
0077 
0078   //! Insert cutting points on open wires to have same
0079   //! number of edges. The sequence of shapes must
0080   //! be a sequence of wires.
0081   Standard_EXPORT void SameNumberByACR(const bool report);
0082 
0083   //! Computes origins and orientation on closed wires to
0084   //! avoid twisted results. The sequence of shapes must
0085   //! be a sequence of wires. <polar> must be true
0086   //! if SameNumberByPolarMethod was used before.
0087   Standard_EXPORT void ComputeOrigin(const bool polar);
0088 
0089   //! Computes origins and orientation on open wires to
0090   //! avoid twisted results. The sequence of shapes must
0091   //! be a sequence of wires.
0092   Standard_EXPORT void SearchOrigin();
0093 
0094   NCollection_Sequence<TopoDS_Shape> myInit;
0095   NCollection_Sequence<TopoDS_Shape> myWork;
0096   double                             myPercent;
0097   bool                               myDegen1;
0098   bool                               myDegen2;
0099   BRepFill_ThruSectionErrorStatus    myStatus;
0100   NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher> myMap;
0101 };
0102 
0103 #endif // _BRepFill_CompatibleWires_HeaderFile