Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-02-03
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1993-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 _IntPatch_Polyhedron_HeaderFile
0018 #define _IntPatch_Polyhedron_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <Bnd_HArray1OfBox.hxx>
0022 
0023 //! This class provides a linear approximation of the PSurface.
0024 //! preview a constructor on a zone of  a surface
0025 class IntPatch_Polyhedron 
0026 {
0027 public:
0028 
0029   DEFINE_STANDARD_ALLOC
0030 
0031   
0032   //! MaTriangle constructor with an double array of pnt for the
0033   //! representation of a double array of triangles.
0034   Standard_EXPORT IntPatch_Polyhedron(const Handle(Adaptor3d_Surface)& Surface, const Standard_Integer nbdU, const Standard_Integer nbdV);
0035   
0036   Standard_EXPORT IntPatch_Polyhedron(const Handle(Adaptor3d_Surface)& Surface);
0037   
0038   Standard_EXPORT void Destroy();
0039 ~IntPatch_Polyhedron()
0040 {
0041   Destroy();
0042 }
0043   
0044   Standard_EXPORT void Perform (const Handle(Adaptor3d_Surface)& Surface, const Standard_Integer nbdU, const Standard_Integer nbdV);
0045   
0046   Standard_EXPORT void DeflectionOverEstimation (const Standard_Real flec);
0047   
0048   Standard_EXPORT Standard_Real DeflectionOnTriangle (const Handle(Adaptor3d_Surface)& Surface, const Standard_Integer Index) const;
0049   
0050   Standard_EXPORT void UMinSingularity (const Standard_Boolean Sing);
0051   
0052   Standard_EXPORT void UMaxSingularity (const Standard_Boolean Sing);
0053   
0054   Standard_EXPORT void VMinSingularity (const Standard_Boolean Sing);
0055   
0056   Standard_EXPORT void VMaxSingularity (const Standard_Boolean Sing);
0057   
0058   //! Get the size of the MaTriangle.
0059   Standard_EXPORT void Size (Standard_Integer& nbdu, Standard_Integer& nbdv) const;
0060   
0061   //! Give the number of triangles in this double array of
0062   //! triangles (nbdu*nbdv*2).
0063   Standard_EXPORT Standard_Integer NbTriangles() const;
0064   
0065   //! Give the 3 points of the triangle of address Index in
0066   //! the double array of triangles.
0067   Standard_EXPORT void Triangle (const Standard_Integer Index, Standard_Integer& P1, Standard_Integer& P2, Standard_Integer& P3) const;
0068   
0069   //! Give the address Tricon of the triangle connexe to the
0070   //! triangle of address Triang by the edge Pivot Pedge and
0071   //! the third point of this connexe triangle. When we are
0072   //! on a free edge TriCon==0 but the function return the
0073   //! value of the triangle in the other side of Pivot on
0074   //! the free edge. Used to turn around a vertex.
0075   Standard_EXPORT Standard_Integer TriConnex (const Standard_Integer Triang, const Standard_Integer Pivot, const Standard_Integer Pedge, Standard_Integer& TriCon, Standard_Integer& OtherP) const;
0076   
0077   //! Give the number of point in the double array of
0078   //! triangles ((nbdu+1)*(nbdv+1)).
0079   Standard_EXPORT Standard_Integer NbPoints() const;
0080   
0081   //! Set the value of a field of the double array of
0082   //! points.
0083   Standard_EXPORT void Point (const gp_Pnt& thePnt, const Standard_Integer lig, const Standard_Integer col, const Standard_Real U, const Standard_Real V);
0084   
0085   //! Give the point of index i in the MaTriangle.
0086   Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index, Standard_Real& U, Standard_Real& V) const;
0087   
0088   //! Give the point of index i in the MaTriangle.
0089   Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index) const;
0090   
0091   //! Give the point of index i in the MaTriangle.
0092   Standard_EXPORT void Point (const Standard_Integer Index, gp_Pnt& P) const;
0093   
0094   //! Give the bounding box of the MaTriangle.
0095   Standard_EXPORT const Bnd_Box& Bounding() const;
0096   
0097   //! Compute the array of boxes. The box <n> corresponding
0098   //! to the triangle <n>.
0099   Standard_EXPORT void FillBounding();
0100   
0101   //! Give the array of boxes. The box <n> corresponding
0102   //! to the triangle <n>.
0103   Standard_EXPORT const Handle(Bnd_HArray1OfBox)& ComponentsBounding() const;
0104   
0105   Standard_EXPORT Standard_Real DeflectionOverEstimation() const;
0106   
0107   Standard_EXPORT Standard_Boolean HasUMinSingularity() const;
0108   
0109   Standard_EXPORT Standard_Boolean HasUMaxSingularity() const;
0110   
0111   Standard_EXPORT Standard_Boolean HasVMinSingularity() const;
0112   
0113   Standard_EXPORT Standard_Boolean HasVMaxSingularity() const;
0114   
0115   //! Give the plane equation of the triangle of address Triang.
0116   Standard_EXPORT void PlaneEquation (const Standard_Integer Triang, gp_XYZ& NormalVector, Standard_Real& PolarDistance) const;
0117   
0118   //! Give the plane equation of the triangle of address Triang.
0119   Standard_EXPORT Standard_Boolean Contain (const Standard_Integer Triang, const gp_Pnt& ThePnt) const;
0120   
0121   Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& U, Standard_Real& V) const;
0122   
0123   Standard_EXPORT void Dump() const;
0124 
0125 
0126 
0127 
0128 protected:
0129 
0130 
0131 
0132 
0133 
0134 private:
0135 
0136 
0137 
0138   Bnd_Box TheBnd;
0139   Handle(Bnd_HArray1OfBox) TheComponentsBnd;
0140   Standard_Real TheDeflection;
0141   Standard_Integer nbdeltaU;
0142   Standard_Integer nbdeltaV;
0143   Standard_Address C_MyPnts;
0144   Standard_Address C_MyU;
0145   Standard_Address C_MyV;
0146   Standard_Boolean UMinSingular;
0147   Standard_Boolean UMaxSingular;
0148   Standard_Boolean VMinSingular;
0149   Standard_Boolean VMaxSingular;
0150 
0151 
0152 };
0153 
0154 
0155 
0156 
0157 
0158 
0159 
0160 #endif // _IntPatch_Polyhedron_HeaderFile