Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/BRepOffsetAPI_MakeFilling.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 1998-08-26
0002 // Created by: Julia GERASIMOVA
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 _BRepOffsetAPI_MakeFilling_HeaderFile
0018 #define _BRepOffsetAPI_MakeFilling_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepFill_Filling.hxx>
0025 #include <BRepBuilderAPI_MakeShape.hxx>
0026 #include <Standard_Boolean.hxx>
0027 #include <Standard_Real.hxx>
0028 #include <GeomAbs_Shape.hxx>
0029 #include <TopTools_ListOfShape.hxx>
0030 class TopoDS_Face;
0031 class TopoDS_Edge;
0032 class gp_Pnt;
0033 class TopoDS_Shape;
0034 
0035 //! N-Side Filling
0036 //! This algorithm avoids to build a face from:
0037 //! * a set of edges defining the bounds of the face and some
0038 //! constraints the surface of the face has to satisfy
0039 //! * a set of edges and points defining some constraints
0040 //! the support surface has to satisfy
0041 //! * an initial surface to deform for satisfying the constraints
0042 //! * a set of parameters to control the constraints.
0043 //!
0044 //! The support surface of the face is computed by deformation
0045 //! of the initial surface in order to satisfy the given constraints.
0046 //! The set of bounding edges defines the wire of the face.
0047 //!
0048 //! If no initial surface is given, the algorithm computes it
0049 //! automatically.
0050 //! If the set of edges is not connected (Free constraint)
0051 //! missing edges are automatically computed.
0052 //!
0053 //! Limitations:
0054 //! * If some constraints are not compatible
0055 //! The algorithm does not take them into account.
0056 //! So the constraints will not be satisfyed in an area containing
0057 //! the incompatibilitries.
0058 //! * The constraints defining the bound of the face have to be
0059 //! entered in order to have a continuous wire.
0060 //!
0061 //! Other Applications:
0062 //! * Deformation of a face to satisfy internal constraints
0063 //! * Deformation of a face to improve Gi continuity with
0064 //! connected faces
0065 class BRepOffsetAPI_MakeFilling : public BRepBuilderAPI_MakeShape
0066 {
0067 public:
0068   DEFINE_STANDARD_ALLOC
0069 
0070   //! Constructs a wire filling object defined by
0071   //! - the energy minimizing criterion Degree
0072   //! - the number of points on the curve NbPntsOnCur
0073   //! - the number of iterations NbIter
0074   //! - the Boolean Anisotropie
0075   //! - the 2D tolerance Tol2d
0076   //! - the 3D tolerance Tol3d
0077   //! - the angular tolerance TolAng
0078   //! - the tolerance for curvature TolCur
0079   //! - the highest polynomial degree MaxDeg
0080   //! - the greatest number of segments MaxSeg.
0081   //! If the Boolean Anistropie is true, the algorithm's
0082   //! performance is better in cases where the ratio of the
0083   //! length U and the length V indicate a great difference
0084   //! between the two. In other words, when the surface is, for
0085   //! example, extremely long.
0086   Standard_EXPORT BRepOffsetAPI_MakeFilling(const Standard_Integer Degree      = 3,
0087                                             const Standard_Integer NbPtsOnCur  = 15,
0088                                             const Standard_Integer NbIter      = 2,
0089                                             const Standard_Boolean Anisotropie = Standard_False,
0090                                             const Standard_Real    Tol2d       = 0.00001,
0091                                             const Standard_Real    Tol3d       = 0.0001,
0092                                             const Standard_Real    TolAng      = 0.01,
0093                                             const Standard_Real    TolCurv     = 0.1,
0094                                             const Standard_Integer MaxDeg      = 8,
0095                                             const Standard_Integer MaxSegments = 9);
0096 
0097   //! Sets the values of Tolerances used to control the constraint.
0098   //! Tol2d:
0099   //! Tol3d:   it is the maximum distance allowed between the support surface
0100   //! and the constraints
0101   //! TolAng:  it is the maximum angle allowed between the normal of the surface
0102   //! and the constraints
0103   //! TolCurv: it is the maximum difference of curvature allowed between
0104   //! the surface and the constraint
0105   Standard_EXPORT void SetConstrParam(const Standard_Real Tol2d   = 0.00001,
0106                                       const Standard_Real Tol3d   = 0.0001,
0107                                       const Standard_Real TolAng  = 0.01,
0108                                       const Standard_Real TolCurv = 0.1);
0109 
0110   //! Sets the parameters used for resolution.
0111   //! The default values of these parameters have been chosen for a good
0112   //! ratio quality/performance.
0113   //! Degree:      it is the order of energy criterion to minimize for computing
0114   //! the deformation of the surface.
0115   //! The default value is 3
0116   //! The recommended value is i+2 where i is the maximum order of the
0117   //! constraints.
0118   //! NbPtsOnCur:  it is the average number of points for discretisation
0119   //! of the edges.
0120   //! NbIter:      it is the maximum number of iterations of the process.
0121   //! For each iteration the number of discretisation points is
0122   //! increased.
0123   //! Anisotropie:
0124   Standard_EXPORT void SetResolParam(const Standard_Integer Degree      = 3,
0125                                      const Standard_Integer NbPtsOnCur  = 15,
0126                                      const Standard_Integer NbIter      = 2,
0127                                      const Standard_Boolean Anisotropie = Standard_False);
0128 
0129   //! Sets the parameters used to approximate the filling
0130   //! surface. These include:
0131   //! - MaxDeg - the highest degree which the polynomial
0132   //! defining the filling surface can have
0133   //! - MaxSegments - the greatest number of segments
0134   //! which the filling surface can have.
0135   Standard_EXPORT void SetApproxParam(const Standard_Integer MaxDeg      = 8,
0136                                       const Standard_Integer MaxSegments = 9);
0137 
0138   //! Loads the initial surface Surf to
0139   //! begin the construction of the surface.
0140   //! This optional function is useful if the surface resulting from
0141   //! construction for the algorithm is likely to be complex.
0142   //! The support surface of the face under construction is computed by a
0143   //! deformation of Surf which satisfies the given constraints.
0144   //! The set of bounding edges defines the wire of the face.
0145   //! If no initial surface is given, the algorithm computes it
0146   //! automatically. If the set of edges is not connected (Free constraint),
0147   //! missing edges are automatically computed.
0148   //! Important: the initial surface must have orthogonal local coordinates,
0149   //! i.e. partial derivatives dS/du and dS/dv must be orthogonal
0150   //! at each point of surface.
0151   //! If this condition breaks, distortions of resulting surface
0152   //! are possible.
0153   Standard_EXPORT void LoadInitSurface(const TopoDS_Face& Surf);
0154 
0155   //! Adds a new constraint which also defines an edge of the wire
0156   //! of the face
0157   //! Order: Order of the constraint:
0158   //! GeomAbs_C0 : the surface has to pass by 3D representation
0159   //! of the edge
0160   //! GeomAbs_G1 : the surface has to pass by 3D representation
0161   //! of the edge and to respect tangency with the first
0162   //! face of the edge
0163   //! GeomAbs_G2 : the surface has to pass by 3D representation
0164   //! of the edge and to respect tangency and curvature
0165   //! with the first face of the edge.
0166   //! Raises ConstructionError if the edge has no representation on a face and Order is
0167   //! GeomAbs_G1 or GeomAbs_G2.
0168   Standard_EXPORT Standard_Integer Add(const TopoDS_Edge&     Constr,
0169                                        const GeomAbs_Shape    Order,
0170                                        const Standard_Boolean IsBound = Standard_True);
0171 
0172   //! Adds a new constraint which also defines an edge of the wire
0173   //! of the face
0174   //! Order: Order of the constraint:
0175   //! GeomAbs_C0 : the surface has to pass by 3D representation
0176   //! of the edge
0177   //! GeomAbs_G1 : the surface has to pass by 3D representation
0178   //! of the edge and to respect tangency with the
0179   //! given face
0180   //! GeomAbs_G2 : the surface has to pass by 3D representation
0181   //! of the edge and to respect tangency and curvature
0182   //! with the given face.
0183   //! Raises ConstructionError if the edge has no 2d representation on the given face
0184   Standard_EXPORT Standard_Integer Add(const TopoDS_Edge&     Constr,
0185                                        const TopoDS_Face&     Support,
0186                                        const GeomAbs_Shape    Order,
0187                                        const Standard_Boolean IsBound = Standard_True);
0188 
0189   //! Adds a free constraint on a face. The corresponding edge has to
0190   //! be automatically recomputed. It is always a bound.
0191   Standard_EXPORT Standard_Integer Add(const TopoDS_Face& Support, const GeomAbs_Shape Order);
0192 
0193   //! Adds a punctual constraint.
0194   Standard_EXPORT Standard_Integer Add(const gp_Pnt& Point);
0195 
0196   //! Adds a punctual constraint.
0197   Standard_EXPORT Standard_Integer Add(const Standard_Real U,
0198                                        const Standard_Real V,
0199                                        const TopoDS_Face&  Support,
0200                                        const GeomAbs_Shape Order);
0201 
0202   //! Builds the resulting faces
0203   Standard_EXPORT virtual void Build(
0204     const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0205 
0206   //! Tests whether computation of the filling plate has been completed.
0207   Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
0208 
0209   //! Returns the list of shapes generated from the
0210   //! shape <S>.
0211   Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& S)
0212     Standard_OVERRIDE;
0213 
0214   //! Returns the maximum distance between the result and
0215   //! the constraints. This is set at construction time.
0216   Standard_EXPORT Standard_Real G0Error() const;
0217 
0218   //! Returns the maximum angle between the result and the
0219   //! constraints. This is set at construction time.
0220   Standard_EXPORT Standard_Real G1Error() const;
0221 
0222   //! Returns the maximum angle between the result and the
0223   //! constraints. This is set at construction time.
0224   Standard_EXPORT Standard_Real G2Error() const;
0225 
0226   //! Returns the maximum distance attained between the
0227   //! result and the constraint Index. This is set at construction time.
0228   Standard_EXPORT Standard_Real G0Error(const Standard_Integer Index);
0229 
0230   //! Returns the maximum angle between the result and the
0231   //! constraints. This is set at construction time.
0232   Standard_EXPORT Standard_Real G1Error(const Standard_Integer Index);
0233 
0234   //! Returns the greatest difference in curvature found
0235   //! between the result and the constraint Index.
0236   Standard_EXPORT Standard_Real G2Error(const Standard_Integer Index);
0237 
0238 protected:
0239 private:
0240   BRepFill_Filling myFilling;
0241 };
0242 
0243 #endif // _BRepOffsetAPI_MakeFilling_HeaderFile