Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:11

0001 // Created on: 1995-04-19
0002 // Created by: Yves FRICAUD
0003 // Copyright (c) 1995-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_OffsetWire_HeaderFile
0018 #define _BRepFill_OffsetWire_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopoDS_Face.hxx>
0024 #include <TopoDS_Shape.hxx>
0025 #include <BRepFill_IndexedDataMapOfOrientedShapeListOfShape.hxx>
0026 #include <BRepMAT2d_BisectingLocus.hxx>
0027 #include <BRepMAT2d_LinkTopoBilo.hxx>
0028 #include <TopTools_DataMapOfShapeShape.hxx>
0029 #include <TopTools_ListOfShape.hxx>
0030 #include <BRepFill_DataMapOfOrientedShapeListOfShape.hxx>
0031 #include <TopTools_SequenceOfShape.hxx>
0032 #include <TColgp_SequenceOfPnt.hxx>
0033 class Bisector_Bisec;
0034 class BRepFill_TrimEdgeTool;
0035 
0036 
0037 //! Constructs a Offset Wire to a spine (wire or face).
0038 //! Offset direction will be to outer region in case of
0039 //! positive offset value and to inner region in case of
0040 //! negative offset value.
0041 //! Inner/Outer region for open wire is defined by the
0042 //! following rule: when we go along the wire (taking into
0043 //! account of edges orientation) then outer region will be
0044 //! on the right side, inner region will be on the left side.
0045 //! In case of closed wire, inner region will always be
0046 //! inside the wire (at that, edges orientation is not taken
0047 //! into account).
0048 //! The Wire or the Face must be planar and oriented correctly.
0049 class BRepFill_OffsetWire 
0050 {
0051 public:
0052 
0053   DEFINE_STANDARD_ALLOC
0054 
0055   
0056   Standard_EXPORT BRepFill_OffsetWire();
0057   
0058   Standard_EXPORT BRepFill_OffsetWire(const TopoDS_Face& Spine, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False);
0059   
0060   //! Initialize the evaluation of Offsetting.
0061   Standard_EXPORT void Init (const TopoDS_Face& Spine, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False);
0062   
0063   //! Performs  an OffsetWire at  an altitude <Alt> from
0064   //! the  face ( According  to  the orientation of  the
0065   //! face)
0066   Standard_EXPORT void Perform (const Standard_Real Offset, const Standard_Real Alt = 0.0);
0067   
0068   //! Performs an  OffsetWire
0069   Standard_EXPORT void PerformWithBiLo (const TopoDS_Face& WSP, const Standard_Real Offset, const BRepMAT2d_BisectingLocus& Locus, BRepMAT2d_LinkTopoBilo& Link, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Real Alt = 0.0);
0070   
0071   Standard_EXPORT Standard_Boolean IsDone() const;
0072   
0073   Standard_EXPORT const TopoDS_Face& Spine() const;
0074   
0075   //! returns the generated shape.
0076   Standard_EXPORT const TopoDS_Shape& Shape() const;
0077   
0078   //! Returns   the  shapes  created  from   a  subshape
0079   //! <SpineShape> of the spine.
0080   //! Returns the last computed Offset.
0081   Standard_EXPORT const TopTools_ListOfShape& GeneratedShapes (const TopoDS_Shape& SpineShape);
0082   
0083   Standard_EXPORT GeomAbs_JoinType JoinType() const;
0084 
0085 
0086 
0087 
0088 protected:
0089 
0090 
0091 
0092 
0093 
0094 private:
0095 
0096   
0097   Standard_EXPORT BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Generated();
0098   
0099   //! Prepare the spine as follow
0100   //! - Cut the spine-Edges at the extrema of curvature and
0101   //! at the inflexion points.
0102   Standard_EXPORT void PrepareSpine();
0103   
0104   //! Add the OffsetWire <Other> to <me> and update <myMap>
0105   Standard_EXPORT void Add (const BRepFill_OffsetWire& Other);
0106   
0107   Standard_EXPORT void UpdateDetromp (BRepFill_DataMapOfOrientedShapeListOfShape& Detromp, const TopoDS_Shape& Shape1, const TopoDS_Shape& Shape2, const TopTools_SequenceOfShape& Vertices, const TColgp_SequenceOfPnt& Params, const Bisector_Bisec& Bisec, const Standard_Boolean SOnE, const Standard_Boolean EOnE, const BRepFill_TrimEdgeTool& Trim) const;
0108   
0109   //! Constructs the wires with the trimmed offset edges.
0110   Standard_EXPORT void MakeWires();
0111   
0112   //! Fix holes between open wires where it is possible
0113   Standard_EXPORT void FixHoles();
0114 
0115 
0116   TopoDS_Face mySpine;
0117   TopoDS_Face myWorkSpine;
0118   Standard_Real myOffset;
0119   Standard_Boolean myIsOpenResult;
0120   TopoDS_Shape myShape;
0121   Standard_Boolean myIsDone;
0122   GeomAbs_JoinType myJoinType;
0123   BRepFill_IndexedDataMapOfOrientedShapeListOfShape myMap;
0124   BRepMAT2d_BisectingLocus myBilo;
0125   BRepMAT2d_LinkTopoBilo myLink;
0126   TopTools_DataMapOfShapeShape myMapSpine;
0127   Standard_Boolean myCallGen;
0128 
0129 
0130 };
0131 
0132 
0133 
0134 
0135 
0136 
0137 
0138 #endif // _BRepFill_OffsetWire_HeaderFile