Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:54

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