Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-06 08:32:29

0001 // Created on: 1992-10-14
0002 // Created by: Christophe MARION
0003 // Copyright (c) 1992-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 _HLRBRep_ThePolyhedronOfInterCSurf_HeaderFile
0018 #define _HLRBRep_ThePolyhedronOfInterCSurf_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <Bnd_Box.hxx>
0026 #include <Bnd_HArray1OfBox.hxx>
0027 #include <TColStd_Array1OfReal.hxx>
0028 class Standard_OutOfRange;
0029 class HLRBRep_SurfaceTool;
0030 class gp_Pnt;
0031 class Bnd_Box;
0032 class gp_XYZ;
0033 
0034 class HLRBRep_ThePolyhedronOfInterCSurf
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   Standard_EXPORT HLRBRep_ThePolyhedronOfInterCSurf(const Standard_Address& Surface,
0040                                                     const Standard_Integer  nbdU,
0041                                                     const Standard_Integer  nbdV,
0042                                                     const Standard_Real     U1,
0043                                                     const Standard_Real     V1,
0044                                                     const Standard_Real     U2,
0045                                                     const Standard_Real     V2);
0046 
0047   Standard_EXPORT HLRBRep_ThePolyhedronOfInterCSurf(const Standard_Address&     Surface,
0048                                                     const TColStd_Array1OfReal& Upars,
0049                                                     const TColStd_Array1OfReal& Vpars);
0050 
0051   Standard_EXPORT void Destroy();
0052 
0053   ~HLRBRep_ThePolyhedronOfInterCSurf() { Destroy(); }
0054 
0055   Standard_EXPORT void DeflectionOverEstimation(const Standard_Real flec);
0056 
0057   Standard_EXPORT Standard_Real DeflectionOnTriangle(const Standard_Address& Surface,
0058                                                      const Standard_Integer  Index) const;
0059 
0060   Standard_EXPORT void UMinSingularity(const Standard_Boolean Sing);
0061 
0062   Standard_EXPORT void UMaxSingularity(const Standard_Boolean Sing);
0063 
0064   Standard_EXPORT void VMinSingularity(const Standard_Boolean Sing);
0065 
0066   Standard_EXPORT void VMaxSingularity(const Standard_Boolean Sing);
0067 
0068   //! get the size of the discretization.
0069   Standard_EXPORT void Size(Standard_Integer& nbdu, Standard_Integer& nbdv) const;
0070 
0071   //! Give the number of triangles in this double array of
0072   Standard_EXPORT Standard_Integer NbTriangles() const;
0073 
0074   //! Give the 3 points of the triangle of address Index in
0075   //! the double array of triangles.
0076   Standard_EXPORT void Triangle(const Standard_Integer Index,
0077                                 Standard_Integer&      P1,
0078                                 Standard_Integer&      P2,
0079                                 Standard_Integer&      P3) const;
0080 
0081   //! Give the address Tricon of the triangle connexe to the
0082   //! triangle of address Triang by the edge Pivot Pedge and
0083   //! the third point of this connexe triangle. When we are
0084   //! on a free edge TriCon==0 but the function return the
0085   //! value of the triangle in the other side of Pivot on
0086   //! the free edge. Used to turn around a vertex.
0087   Standard_EXPORT Standard_Integer TriConnex(const Standard_Integer Triang,
0088                                              const Standard_Integer Pivot,
0089                                              const Standard_Integer Pedge,
0090                                              Standard_Integer&      TriCon,
0091                                              Standard_Integer&      OtherP) const;
0092 
0093   //! Give the number of point in the double array of
0094   //! triangles ((nbdu+1)*(nbdv+1)).
0095   Standard_EXPORT Standard_Integer NbPoints() const;
0096 
0097   //! Set the value of a field of the double array of
0098   //! points.
0099   Standard_EXPORT void Point(const gp_Pnt&          thePnt,
0100                              const Standard_Integer lig,
0101                              const Standard_Integer col,
0102                              const Standard_Real    U,
0103                              const Standard_Real    V);
0104 
0105   //! Give the point of index i in the MaTriangle.
0106   Standard_EXPORT const gp_Pnt& Point(const Standard_Integer Index,
0107                                       Standard_Real&         U,
0108                                       Standard_Real&         V) const;
0109 
0110   //! Give the point of index i in the MaTriangle.
0111   Standard_EXPORT const gp_Pnt& Point(const Standard_Integer Index) const;
0112 
0113   //! Give the point of index i in the MaTriangle.
0114   Standard_EXPORT void Point(const Standard_Integer Index, gp_Pnt& P) const;
0115 
0116   //! Give the bounding box of the MaTriangle.
0117   Standard_EXPORT const Bnd_Box& Bounding() const;
0118 
0119   //! Compute the array of boxes. The box <n> corresponding
0120   //! to the triangle <n>.
0121   Standard_EXPORT void FillBounding();
0122 
0123   //! Give the array of boxes. The box <n> corresponding
0124   //! to the triangle <n>.
0125   Standard_EXPORT const Handle(Bnd_HArray1OfBox)& ComponentsBounding() const;
0126 
0127   Standard_EXPORT Standard_Real DeflectionOverEstimation() const;
0128 
0129   Standard_EXPORT Standard_Boolean HasUMinSingularity() const;
0130 
0131   Standard_EXPORT Standard_Boolean HasUMaxSingularity() const;
0132 
0133   Standard_EXPORT Standard_Boolean HasVMinSingularity() const;
0134 
0135   Standard_EXPORT Standard_Boolean HasVMaxSingularity() const;
0136 
0137   //! Give the plane equation of the triangle of address Triang.
0138   Standard_EXPORT void PlaneEquation(const Standard_Integer Triang,
0139                                      gp_XYZ&                NormalVector,
0140                                      Standard_Real&         PolarDistance) const;
0141 
0142   //! Give the plane equation of the triangle of address Triang.
0143   Standard_EXPORT Standard_Boolean Contain(const Standard_Integer Triang,
0144                                            const gp_Pnt&          ThePnt) const;
0145 
0146   Standard_EXPORT void Parameters(const Standard_Integer Index,
0147                                   Standard_Real&         U,
0148                                   Standard_Real&         V) const;
0149 
0150   //! This method returns true if the edge based on points with
0151   //! indices Index1 and Index2 represents a boundary edge. It is
0152   //! necessary to take into account the boundary deflection for
0153   //! this edge.
0154   Standard_EXPORT Standard_Boolean IsOnBound(const Standard_Integer Index1,
0155                                              const Standard_Integer Index2) const;
0156 
0157   //! This method returns a border deflection.
0158   Standard_Real GetBorderDeflection() const;
0159 
0160   Standard_EXPORT void Dump() const;
0161 
0162 protected:
0163   Standard_EXPORT void Init(const Standard_Address& Surface,
0164                             const Standard_Real     U1,
0165                             const Standard_Real     V1,
0166                             const Standard_Real     U2,
0167                             const Standard_Real     V2);
0168 
0169   Standard_EXPORT void Init(const Standard_Address&     Surface,
0170                             const TColStd_Array1OfReal& Upars,
0171                             const TColStd_Array1OfReal& Vpars);
0172 
0173 private:
0174   //! This method computes and returns a deflection of isoline
0175   //! of given parameter on Surface.
0176   Standard_EXPORT Standard_Real ComputeBorderDeflection(const Standard_Address& Surface,
0177                                                         const Standard_Real     Parameter,
0178                                                         const Standard_Real     PMin,
0179                                                         const Standard_Real     PMax,
0180                                                         const Standard_Boolean  isUIso) const;
0181 
0182 private:
0183   Standard_Integer         nbdeltaU;
0184   Standard_Integer         nbdeltaV;
0185   Bnd_Box                  TheBnd;
0186   Handle(Bnd_HArray1OfBox) TheComponentsBnd;
0187   Standard_Real            TheDeflection;
0188   Standard_Address         C_MyPnts;
0189   Standard_Address         C_MyU;
0190   Standard_Address         C_MyV;
0191   Standard_Boolean         UMinSingular;
0192   Standard_Boolean         UMaxSingular;
0193   Standard_Boolean         VMinSingular;
0194   Standard_Boolean         VMaxSingular;
0195   Standard_Real            TheBorderDeflection;
0196   Standard_Address         C_MyIsOnBounds;
0197 };
0198 
0199 #define ThePSurface Standard_Address
0200 #define ThePSurface_hxx <Standard_Address.hxx>
0201 #define ThePSurfaceTool HLRBRep_SurfaceTool
0202 #define ThePSurfaceTool_hxx <HLRBRep_SurfaceTool.hxx>
0203 #define IntCurveSurface_Polyhedron HLRBRep_ThePolyhedronOfInterCSurf
0204 #define IntCurveSurface_Polyhedron_hxx <HLRBRep_ThePolyhedronOfInterCSurf.hxx>
0205 
0206 #include <IntCurveSurface_Polyhedron.lxx>
0207 
0208 #undef ThePSurface
0209 #undef ThePSurface_hxx
0210 #undef ThePSurfaceTool
0211 #undef ThePSurfaceTool_hxx
0212 #undef IntCurveSurface_Polyhedron
0213 #undef IntCurveSurface_Polyhedron_hxx
0214 
0215 #endif // _HLRBRep_ThePolyhedronOfInterCSurf_HeaderFile