0032743: Coding Rules - remove unused class friends of Package classes
[occt.git] / src / ShapeAnalysis / ShapeAnalysis.hxx
1 // Created on: 1998-06-03
2 // Created by: data exchange team
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _ShapeAnalysis_HeaderFile
18 #define _ShapeAnalysis_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Real.hxx>
25 #include <Standard_Boolean.hxx>
26 class TopoDS_Wire;
27 class TopoDS_Face;
28 class ShapeExtend_WireData;
29 class TopoDS_Shape;
30 class TopoDS_Vertex;
31
32
33 //! This package is intended to analyze geometrical objects
34 //! and topological shapes. Analysis domain includes both
35 //! exploring geometrical and topological properties of
36 //! shapes and checking their conformance to Open CASCADE requirements.
37 //! The directions of analysis provided by tools of this package are:
38 //! computing quantities of subshapes,
39 //! computing parameters of points on curve and surface,
40 //! computing surface singularities,
41 //! checking edge and wire consistency,
42 //! checking edges order in the wire,
43 //! checking face bounds orientation,
44 //! checking small faces,
45 //! analyzing shape tolerances,
46 //! analyzing of free bounds of the shape.
47 class ShapeAnalysis 
48 {
49 public:
50
51   DEFINE_STANDARD_ALLOC
52
53   
54   //! Returns the outer wire on the face <Face>.
55   //! This is replacement of the method BRepTools::OuterWire
56   //! until it works badly.
57   //! Returns the first wire oriented as outer according to
58   //! FClass2d_Classifier. If none, last wire is returned.
59   Standard_EXPORT static TopoDS_Wire OuterWire (const TopoDS_Face& face);
60   
61   //! Returns a total area of 2d wire
62   Standard_EXPORT static Standard_Real TotCross2D (const Handle(ShapeExtend_WireData)& sewd, const TopoDS_Face& aFace);
63   
64   //! Returns a total area of 3d wire
65   Standard_EXPORT static Standard_Real ContourArea (const TopoDS_Wire& theWire);
66   
67   //! Returns True if <F> has outer bound.
68   Standard_EXPORT static Standard_Boolean IsOuterBound (const TopoDS_Face& face);
69   
70   //! Returns a shift required to move point
71   //! <Val> to the range [ToVal-Period/2,ToVal+Period/2].
72   //! This shift will be the divisible by Period.
73   //! Intended for adjusting parameters on periodic surfaces.
74   Standard_EXPORT static Standard_Real AdjustByPeriod (const Standard_Real Val, const Standard_Real ToVal, const Standard_Real Period);
75   
76   //! Returns a shift required to move point
77   //! <Val> to the range [ValMin,ValMax].
78   //! This shift will be the divisible by Period
79   //! with Period = ValMax - ValMin.
80   //! Intended for adjusting parameters on periodic surfaces.
81   Standard_EXPORT static Standard_Real AdjustToPeriod (const Standard_Real Val, const Standard_Real ValMin, const Standard_Real ValMax);
82   
83   //! Finds the start and end vertices of the shape
84   //! Shape can be of the following type:
85   //! vertex: V1 and V2 are the same and equal to <shape>,
86   //! edge  : V1 is start and V2 is end vertex (see ShapeAnalysis_Edge
87   //! methods FirstVertex and LastVertex),
88   //! wire  : V1 is start vertex of the first edge, V2 is end vertex
89   //! of the last edge (also see ShapeAnalysis_Edge).
90   //! If wire contains no edges V1 and V2 are nullified
91   //! If none of the above V1 and V2 are nullified
92   Standard_EXPORT static void FindBounds (const TopoDS_Shape& shape, TopoDS_Vertex& V1, TopoDS_Vertex& V2);
93   
94   //! Computes exact UV bounds of all wires on the face
95   Standard_EXPORT static void GetFaceUVBounds (const TopoDS_Face& F, Standard_Real& Umin, Standard_Real& Umax, Standard_Real& Vmin, Standard_Real& Vmax);
96
97 };
98
99 #endif // _ShapeAnalysis_HeaderFile