Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1996-12-16
0002 // Created by: Bruno DUMORTIER
0003 // Copyright (c) 1996-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 _BiTgte_Blend_HeaderFile
0018 #define _BiTgte_Blend_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepFill_DataMapOfShapeDataMapOfShapeListOfShape.hxx>
0025 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0026 #include <TopTools_IndexedMapOfShape.hxx>
0027 #include <BRepOffset_Analyse.hxx>
0028 #include <BRepOffset_DataMapOfShapeOffset.hxx>
0029 #include <BRepAlgo_Image.hxx>
0030 #include <Standard_Integer.hxx>
0031 #include <TColStd_HArray1OfInteger.hxx>
0032 #include <TopTools_ListOfShape.hxx>
0033 #include <BiTgte_ContactType.hxx>
0034 #include <TopTools_DataMapOfShapeBox.hxx>
0035 class BRepAlgo_AsDes;
0036 class TopoDS_Face;
0037 class TopoDS_Edge;
0038 class Geom_Surface;
0039 class Geom_Curve;
0040 class Geom2d_Curve;
0041 class BRepOffset_Offset;
0042 class BRepOffset_Inter3d;
0043 
0044 
0045 //! Root class
0046 class BiTgte_Blend 
0047 {
0048 public:
0049 
0050   DEFINE_STANDARD_ALLOC
0051 
0052   
0053   Standard_EXPORT BiTgte_Blend();
0054   
0055   //! <S>: Shape to be rounded
0056   //! <Radius>: radius of the fillet
0057   //! <Tol>: Tol3d used in approximations
0058   //! <NUBS>: if true,  generate only NUBS surfaces,
0059   //! if false, generate analytical surfaces if possible
0060   Standard_EXPORT BiTgte_Blend(const TopoDS_Shape& S, const Standard_Real Radius, const Standard_Real Tol, const Standard_Boolean NUBS);
0061   
0062   Standard_EXPORT void Init (const TopoDS_Shape& S, const Standard_Real Radius, const Standard_Real Tol, const Standard_Boolean NUBS);
0063   
0064   //! Clear all the Fields.
0065   Standard_EXPORT void Clear();
0066   
0067   //! Set two faces   of <myShape> on which the  Sphere
0068   //! must roll.
0069   Standard_EXPORT void SetFaces (const TopoDS_Face& F1, const TopoDS_Face& F2);
0070   
0071   //! Set an edge of <myShape> to be rounded.
0072   Standard_EXPORT void SetEdge (const TopoDS_Edge& Edge);
0073   
0074   //! Set a face on which the fillet must stop.
0075   Standard_EXPORT void SetStoppingFace (const TopoDS_Face& Face);
0076   
0077   //! Compute the generated surfaces.
0078   //! If <BuildShape> is true, compute the resulting Shape.
0079   //! If false, only the blending surfaces are computed.
0080   Standard_EXPORT void Perform (const Standard_Boolean BuildShape = Standard_True);
0081   
0082   Standard_EXPORT Standard_Boolean IsDone() const;
0083   
0084   //! returns the result
0085   Standard_EXPORT const TopoDS_Shape& Shape() const;
0086   
0087   //! returns the Number of generated surfaces.
0088   Standard_EXPORT Standard_Integer NbSurfaces() const;
0089   
0090   //! returns the surface of range Index
0091   Standard_EXPORT Handle(Geom_Surface) Surface (const Standard_Integer Index) const;
0092   
0093   //! returns the surface of range Index
0094   Standard_EXPORT const TopoDS_Face& Face (const Standard_Integer Index) const;
0095   
0096   //! set in <LC> all the center lines
0097   Standard_EXPORT void CenterLines (TopTools_ListOfShape& LC) const;
0098   
0099   //! returns  the surface generated  by the centerline.
0100   //! <CenterLine> may be
0101   //! - an edge  : generate a pipe.
0102   //! - a vertex : generate a sphere.
0103   //! Warning: returns a Null Handle if <CenterLine> generates
0104   //! no surface.
0105   Standard_EXPORT Handle(Geom_Surface) Surface (const TopoDS_Shape& CenterLine) const;
0106   
0107   //! returns  the face generated  by the centerline.
0108   //! <CenterLine> may be
0109   //! - an edge  : generate a pipe.
0110   //! - a vertex : generate a sphere.
0111   //! Warning: returns a Null Shape if <CenterLine> generates
0112   //! no surface.
0113   Standard_EXPORT const TopoDS_Face& Face (const TopoDS_Shape& CenterLine) const;
0114   
0115   //! returns the type of contact
0116   Standard_EXPORT BiTgte_ContactType ContactType (const Standard_Integer Index) const;
0117   
0118   //! gives the first support shape relative to
0119   //! SurfaceFillet(Index);
0120   Standard_EXPORT const TopoDS_Shape& SupportShape1 (const Standard_Integer Index) const;
0121   
0122   //! gives the second support shape relative to
0123   //! SurfaceFillet(Index);
0124   Standard_EXPORT const TopoDS_Shape& SupportShape2 (const Standard_Integer Index) const;
0125   
0126   //! gives the 3d curve of SurfaceFillet(Index)
0127   //! on SupportShape1(Index)
0128   Standard_EXPORT Handle(Geom_Curve) CurveOnShape1 (const Standard_Integer Index) const;
0129   
0130   //! gives the 3d curve of SurfaceFillet(Index)
0131   //! on SupportShape2(Index)
0132   Standard_EXPORT Handle(Geom_Curve) CurveOnShape2 (const Standard_Integer Index) const;
0133   
0134   //! gives the PCurve associated to CurvOnShape1(Index)
0135   //! on the support face
0136   //! Warning: returns a Null Handle if SupportShape1 is not a Face
0137   Standard_EXPORT Handle(Geom2d_Curve) PCurveOnFace1 (const Standard_Integer Index) const;
0138   
0139   //! gives the PCurve associated to CurveOnShape1(Index)
0140   //! on the Fillet
0141   Standard_EXPORT Handle(Geom2d_Curve) PCurve1OnFillet (const Standard_Integer Index) const;
0142   
0143   //! gives the PCurve  associated to CurveOnShape2(Index)
0144   //! on the  support face
0145   //! Warning: returns a Null Handle if SupportShape2 is not a Face
0146   Standard_EXPORT Handle(Geom2d_Curve) PCurveOnFace2 (const Standard_Integer Index) const;
0147   
0148   //! gives the PCurve associated to CurveOnShape2(Index)
0149   //! on the fillet
0150   Standard_EXPORT Handle(Geom2d_Curve) PCurve2OnFillet (const Standard_Integer Index) const;
0151   
0152   Standard_EXPORT Standard_Integer NbBranches();
0153   
0154   //! Set in <From>,<To>   the indices of the faces  of
0155   //! the branche <Index>.
0156   //!
0157   //! i.e: Branche<Index> = Face(From) + Face(From+1) + ..+ Face(To)
0158   Standard_EXPORT void IndicesOfBranche (const Standard_Integer Index, Standard_Integer& From, Standard_Integer& To) const;
0159   
0160   //! Computes the center lines
0161   Standard_EXPORT void ComputeCenters();
0162 
0163 
0164 
0165 
0166 protected:
0167 
0168 
0169 
0170 
0171 
0172 private:
0173 
0174   
0175   //! Perform the generated surfaces.
0176   Standard_EXPORT void ComputeSurfaces();
0177   
0178   //! Build the resulting shape
0179   //! All the faces must be computed
0180   Standard_EXPORT void ComputeShape();
0181   
0182   //! Computes the intersections with <Face> and all the
0183   //! OffsetFaces stored  in <myMapSF>.  Returns <True>
0184   //! if an intersections ends on a boundary of a Face.
0185   Standard_EXPORT Standard_Boolean Intersect (const TopoDS_Shape& Init, const TopoDS_Face& Face, const TopTools_DataMapOfShapeBox& MapSBox, const BRepOffset_Offset& OF1, BRepOffset_Inter3d& Inter);
0186 
0187 
0188   Standard_Real myRadius;
0189   Standard_Real myTol;
0190   Standard_Boolean myNubs;
0191   TopoDS_Shape myShape;
0192   TopoDS_Shape myResult;
0193   Standard_Boolean myBuildShape;
0194   TopTools_IndexedDataMapOfShapeListOfShape myAncestors;
0195   BRepFill_DataMapOfShapeDataMapOfShapeListOfShape myCreated;
0196   TopTools_DataMapOfShapeListOfShape myCutEdges;
0197   TopTools_IndexedMapOfShape myFaces;
0198   TopTools_IndexedMapOfShape myEdges;
0199   TopTools_MapOfShape myStopFaces;
0200   BRepOffset_Analyse myAnalyse;
0201   TopTools_IndexedMapOfShape myCenters;
0202   BRepOffset_DataMapOfShapeOffset myMapSF;
0203   BRepAlgo_Image myInitOffsetFace;
0204   BRepAlgo_Image myImage;
0205   BRepAlgo_Image myImageOffset;
0206   Handle(BRepAlgo_AsDes) myAsDes;
0207   Standard_Integer myNbBranches;
0208   Handle(TColStd_HArray1OfInteger) myIndices;
0209   Standard_Boolean myDone;
0210 
0211 
0212 };
0213 
0214 
0215 
0216 
0217 
0218 
0219 
0220 #endif // _BiTgte_Blend_HeaderFile