Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-10-13
0002 // Created by: Roman BORISOV
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_NormalProjection_HeaderFile
0018 #define _BRepAlgo_NormalProjection_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopoDS_Shape.hxx>
0024 #include <GeomAbs_Shape.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <TopTools_DataMapOfShapeShape.hxx>
0027 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0028 #include <TopTools_ListOfShape.hxx>
0029 class TopoDS_Edge;
0030 class Adaptor3d_Curve;
0031 
0032 
0033 //! This class makes the projection  of a wire on a
0034 //! shape.
0035 class BRepAlgo_NormalProjection 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   
0042   Standard_EXPORT BRepAlgo_NormalProjection();
0043   
0044   Standard_EXPORT BRepAlgo_NormalProjection(const TopoDS_Shape& S);
0045   
0046   Standard_EXPORT void Init (const TopoDS_Shape& S);
0047   
0048   //! Add an edge or a wire to the list of shape to project
0049   Standard_EXPORT void Add (const TopoDS_Shape& ToProj);
0050   
0051   //! Set the parameters  used  for computation
0052   //! Tol3d is the required  tolerance between the  3d projected
0053   //! curve  and its 2d representation
0054   //! InternalContinuity  is the order of constraints
0055   //! used for  approximation.
0056   //! MaxDeg and MaxSeg are the maximum degree and the maximum
0057   //! number of segment for BSpline resulting of an approximation.
0058   Standard_EXPORT void SetParams (const Standard_Real Tol3D, const Standard_Real Tol2D, const GeomAbs_Shape InternalContinuity, const Standard_Integer MaxDegree, const Standard_Integer MaxSeg);
0059   
0060   //! Set the parameters  used  for computation
0061   //! in their default values
0062   Standard_EXPORT void SetDefaultParams();
0063   
0064   //! Sets the maximum distance between target shape and
0065   //! shape to project. If this condition is not satisfied then
0066   //! corresponding part of solution is discarded.
0067   //! if MaxDist < 0 then this method does not affect the algorithm
0068   Standard_EXPORT void SetMaxDistance (const Standard_Real MaxDist);
0069   
0070   //! if  With3d = Standard_False the 3dcurve is not computed
0071   //! the  initial 3dcurve is kept  to  build the  resulting edges.
0072   Standard_EXPORT void Compute3d (const Standard_Boolean With3d = Standard_True);
0073   
0074   //! Manage  limitation  of  projected  edges.
0075   Standard_EXPORT void SetLimit (const Standard_Boolean FaceBoundaries = Standard_True);
0076   
0077   //! Builds the result as a  compound.
0078   Standard_EXPORT void Build();
0079   
0080   Standard_EXPORT Standard_Boolean IsDone() const;
0081   
0082   //! returns the result
0083   Standard_EXPORT const TopoDS_Shape& Projection() const;
0084   
0085   //! For a resulting edge, returns the corresponding initial edge.
0086   Standard_EXPORT const TopoDS_Shape& Ancestor (const TopoDS_Edge& E) const;
0087   
0088   //! For a projected edge, returns the corresponding initial face.
0089   Standard_EXPORT const TopoDS_Shape& Couple (const TopoDS_Edge& E) const;
0090   
0091   //! Returns the  list   of shapes generated   from the
0092   //! shape <S>.
0093   Standard_EXPORT const TopTools_ListOfShape& Generated (const TopoDS_Shape& S);
0094   
0095   Standard_EXPORT Standard_Boolean IsElementary (const Adaptor3d_Curve& C) const;
0096   
0097   //! build the result as a list of wire if possible in --
0098   //! a first returns a wire only if there is only a wire.
0099   Standard_EXPORT Standard_Boolean BuildWire (TopTools_ListOfShape& Liste) const;
0100 
0101 
0102 
0103 
0104 protected:
0105 
0106 
0107 
0108 
0109 
0110 private:
0111 
0112 
0113 
0114   TopoDS_Shape myShape;
0115   Standard_Boolean myIsDone;
0116   Standard_Real myTol3d;
0117   Standard_Real myTol2d;
0118   Standard_Real myMaxDist;
0119   Standard_Boolean myWith3d;
0120   GeomAbs_Shape myContinuity;
0121   Standard_Integer myMaxDegree;
0122   Standard_Integer myMaxSeg;
0123   Standard_Boolean myFaceBounds;
0124   TopoDS_Shape myToProj;
0125   TopTools_DataMapOfShapeShape myAncestorMap;
0126   TopTools_DataMapOfShapeShape myCorresp;
0127   TopTools_DataMapOfShapeListOfShape myDescendants;
0128   TopoDS_Shape myRes;
0129 
0130 
0131 };
0132 
0133 
0134 
0135 
0136 
0137 
0138 
0139 #endif // _BRepAlgo_NormalProjection_HeaderFile