1 // Created on: 1998-01-14
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepFill_LocationLaw_HeaderFile
18 #define _BRepFill_LocationLaw_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TopoDS_Wire.hxx>
24 #include <Standard_Real.hxx>
25 #include <GeomFill_HArray1OfLocationLaw.hxx>
26 #include <TColStd_HArray1OfReal.hxx>
27 #include <TopTools_HArray1OfShape.hxx>
28 #include <TColStd_HArray1OfInteger.hxx>
29 #include <Standard_Integer.hxx>
30 #include <Standard_Transient.hxx>
31 #include <GeomFill_PipeError.hxx>
32 #include <TColStd_Array1OfInteger.hxx>
33 #include <Standard_Boolean.hxx>
34 class Standard_OutOfRange;
36 class GeomFill_LocationLaw;
42 class BRepFill_LocationLaw;
43 DEFINE_STANDARD_HANDLE(BRepFill_LocationLaw, Standard_Transient)
45 //! Location Law on a Wire.
46 class BRepFill_LocationLaw : public Standard_Transient
52 //! Return a error status, if the status is not PipeOk then
53 //! it exist a parameter tlike the law is not valuable for t.
54 Standard_EXPORT GeomFill_PipeError GetStatus() const;
56 //! Apply a linear transformation on each law, to have
57 //! continuity of the global law between the edges.
58 Standard_EXPORT virtual void TransformInG0Law();
60 //! Apply a linear transformation on each law, to reduce
61 //! the dicontinuities of law at one rotation.
62 Standard_EXPORT virtual void TransformInCompatibleLaw (const Standard_Real AngularTolerance);
64 Standard_EXPORT void DeleteTransform();
66 Standard_EXPORT Standard_Integer NbHoles (const Standard_Real Tol = 1.0e-7);
68 Standard_EXPORT void Holes (TColStd_Array1OfInteger& Interval) const;
70 //! Return the number of elementary Law
71 Standard_EXPORT Standard_Integer NbLaw() const;
73 //! Return the elementary Law of rank <Index>
74 //! <Index> have to be in [1, NbLaw()]
75 Standard_EXPORT const Handle(GeomFill_LocationLaw)& Law (const Standard_Integer Index) const;
78 Standard_EXPORT const TopoDS_Wire& Wire() const;
80 //! Return the Edge of rank <Index> in the path
81 //! <Index> have to be in [1, NbLaw()]
82 Standard_EXPORT const TopoDS_Edge& Edge (const Standard_Integer Index) const;
84 //! Return the vertex of rank <Index> in the path
85 //! <Index> have to be in [0, NbLaw()]
86 Standard_EXPORT TopoDS_Vertex Vertex (const Standard_Integer Index) const;
88 //! Compute <OutputVertex> like a transformation of
89 //! <InputVertex> the transformation is given by
90 //! evaluation of the location law in the vertex of
92 //! <Location> is used to manage discontinuities :
93 //! - -1 : The law before the vertex is used.
94 //! - 1 : The law after the vertex is used.
95 //! - 0 : Average of the both laws is used.
96 Standard_EXPORT void PerformVertex (const Standard_Integer Index, const TopoDS_Vertex& InputVertex, const Standard_Real TolMin, TopoDS_Vertex& OutputVertex, const Standard_Integer Location = 0) const;
98 //! Return the Curvilinear Bounds of the <Index> Law
99 Standard_EXPORT void CurvilinearBounds (const Standard_Integer Index, Standard_Real& First, Standard_Real& Last) const;
101 Standard_EXPORT Standard_Boolean IsClosed() const;
103 //! Compute the Law's continuity between 2 edges of the path
104 //! The result can be :
105 //! -1 : Case Not connex
106 //! 0 : It is connex (G0)
107 //! 1 : It is tangent (G1)
108 Standard_EXPORT Standard_Integer IsG1 (const Standard_Integer Index, const Standard_Real SpatialTolerance = 1.0e-7, const Standard_Real AngularTolerance = 1.0e-4) const;
110 //! Apply the Law to a shape, for a given Curnilinear abscissa
111 Standard_EXPORT void D0 (const Standard_Real Abscissa, TopoDS_Shape& Section);
113 //! Find the index Law and the parmaeter, for a given
114 //! Curnilinear abscissa
115 Standard_EXPORT void Parameter (const Standard_Real Abscissa, Standard_Integer& Index, Standard_Real& Param);
117 //! Return the curvilinear abscissa corresponding to a point
118 //! of the path, defined by <Index> of Edge and a
119 //! parameter on the edge.
120 Standard_EXPORT Standard_Real Abscissa (const Standard_Integer Index, const Standard_Real Param);
125 DEFINE_STANDARD_RTTIEXT(BRepFill_LocationLaw,Standard_Transient)
130 //! Initialize all the fields, this methode have to
131 //! be called by the constructors of Inherited class.
132 Standard_EXPORT void Init (const TopoDS_Wire& Path);
134 //! To preseve if possible the Tangent in transformations
135 //! It is the default mode.
136 Standard_EXPORT void TangentIsMain();
138 //! To preseve if possible the Normal in transformations
139 Standard_EXPORT void NormalIsMain();
141 //! To preseve if possible the BiNormal in transformations
142 Standard_EXPORT void BiNormalIsMain();
146 Handle(GeomFill_HArray1OfLocationLaw) myLaws;
147 Handle(TColStd_HArray1OfReal) myLength;
148 Handle(TopTools_HArray1OfShape) myEdges;
149 Handle(TColStd_HArray1OfInteger) myDisc;
155 Standard_Integer myType;
166 #endif // _BRepFill_LocationLaw_HeaderFile