Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-30 08:46:59

0001 // Created on: 1998-06-03
0002 // Created by: data exchange team
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 _ShapeAnalysis_HeaderFile
0018 #define _ShapeAnalysis_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Real.hxx>
0025 #include <Standard_Boolean.hxx>
0026 class TopoDS_Wire;
0027 class TopoDS_Face;
0028 class ShapeExtend_WireData;
0029 class TopoDS_Shape;
0030 class TopoDS_Vertex;
0031 
0032 //! This package is intended to analyze geometrical objects
0033 //! and topological shapes. Analysis domain includes both
0034 //! exploring geometrical and topological properties of
0035 //! shapes and checking their conformance to Open CASCADE requirements.
0036 //! The directions of analysis provided by tools of this package are:
0037 //! computing quantities of subshapes,
0038 //! computing parameters of points on curve and surface,
0039 //! computing surface singularities,
0040 //! checking edge and wire consistency,
0041 //! checking edges order in the wire,
0042 //! checking face bounds orientation,
0043 //! checking small faces,
0044 //! analyzing shape tolerances,
0045 //! analyzing of free bounds of the shape.
0046 class ShapeAnalysis
0047 {
0048 public:
0049   DEFINE_STANDARD_ALLOC
0050 
0051   //! Returns positively oriented wire in the face.
0052   //! If there is no such wire - returns the last wire of the face.
0053   Standard_EXPORT static TopoDS_Wire OuterWire(const TopoDS_Face& theFace);
0054 
0055   //! Returns a total area of 2d wire
0056   Standard_EXPORT static Standard_Real TotCross2D(const Handle(ShapeExtend_WireData)& sewd,
0057                                                   const TopoDS_Face&                  aFace);
0058 
0059   //! Returns a total area of 3d wire
0060   Standard_EXPORT static Standard_Real ContourArea(const TopoDS_Wire& theWire);
0061 
0062   //! Returns True if <F> has outer bound.
0063   Standard_EXPORT static Standard_Boolean IsOuterBound(const TopoDS_Face& face);
0064 
0065   //! Returns a shift required to move point
0066   //! <Val> to the range [ToVal-Period/2,ToVal+Period/2].
0067   //! This shift will be the divisible by Period.
0068   //! Intended for adjusting parameters on periodic surfaces.
0069   Standard_EXPORT static Standard_Real AdjustByPeriod(const Standard_Real Val,
0070                                                       const Standard_Real ToVal,
0071                                                       const Standard_Real Period);
0072 
0073   //! Returns a shift required to move point
0074   //! <Val> to the range [ValMin,ValMax].
0075   //! This shift will be the divisible by Period
0076   //! with Period = ValMax - ValMin.
0077   //! Intended for adjusting parameters on periodic surfaces.
0078   Standard_EXPORT static Standard_Real AdjustToPeriod(const Standard_Real Val,
0079                                                       const Standard_Real ValMin,
0080                                                       const Standard_Real ValMax);
0081 
0082   //! Finds the start and end vertices of the shape
0083   //! Shape can be of the following type:
0084   //! vertex: V1 and V2 are the same and equal to <shape>,
0085   //! edge  : V1 is start and V2 is end vertex (see ShapeAnalysis_Edge
0086   //! methods FirstVertex and LastVertex),
0087   //! wire  : V1 is start vertex of the first edge, V2 is end vertex
0088   //! of the last edge (also see ShapeAnalysis_Edge).
0089   //! If wire contains no edges V1 and V2 are nullified
0090   //! If none of the above V1 and V2 are nullified
0091   Standard_EXPORT static void FindBounds(const TopoDS_Shape& shape,
0092                                          TopoDS_Vertex&      V1,
0093                                          TopoDS_Vertex&      V2);
0094 
0095   //! Computes exact UV bounds of all wires on the face
0096   Standard_EXPORT static void GetFaceUVBounds(const TopoDS_Face& F,
0097                                               Standard_Real&     Umin,
0098                                               Standard_Real&     Umax,
0099                                               Standard_Real&     Vmin,
0100                                               Standard_Real&     Vmax);
0101 };
0102 
0103 #endif // _ShapeAnalysis_HeaderFile