Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 09:17:20

0001 // Created on: 1993-10-29
0002 // Created by: Christophe MARION
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 _HLRAlgo_PolyData_HeaderFile
0018 #define _HLRAlgo_PolyData_HeaderFile
0019 
0020 #include <Bnd_Box.hxx>
0021 #include <HLRAlgo_BiPoint.hxx>
0022 #include <HLRAlgo_PolyHidingData.hxx>
0023 #include <NCollection_Array1.hxx>
0024 #include <NCollection_HArray1.hxx>
0025 #include <HLRAlgo_TriangleData.hxx>
0026 #include <Standard.hxx>
0027 #include <Standard_Boolean.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <Standard_Transient.hxx>
0030 #include <Standard_Type.hxx>
0031 #include <gp_XYZ.hxx>
0032 
0033 class HLRAlgo_EdgeStatus;
0034 
0035 //! Data structure of a set of Triangles.
0036 class HLRAlgo_PolyData : public Standard_Transient
0037 {
0038 
0039 public:
0040   struct FaceIndices
0041   {
0042     //! The default constructor.
0043     FaceIndices()
0044         : Index(0),
0045           Min(0),
0046           Max(0)
0047     {
0048     }
0049 
0050     int Index, Min, Max;
0051   };
0052 
0053   struct Triangle
0054   {
0055     gp_XY  V1, V2, V3;
0056     double Param, TolParam, TolAng, Tolerance;
0057   };
0058 
0059   Standard_EXPORT HLRAlgo_PolyData();
0060 
0061   Standard_EXPORT void HNodes(const occ::handle<NCollection_HArray1<gp_XYZ>>& HNodes);
0062 
0063   Standard_EXPORT void HTData(const occ::handle<NCollection_HArray1<HLRAlgo_TriangleData>>& HTData);
0064 
0065   Standard_EXPORT void HPHDat(
0066     const occ::handle<NCollection_HArray1<HLRAlgo_PolyHidingData>>& HPHDat);
0067 
0068   void FaceIndex(const int I);
0069 
0070   int FaceIndex() const;
0071 
0072   NCollection_Array1<gp_XYZ>& Nodes() const;
0073 
0074   NCollection_Array1<HLRAlgo_TriangleData>& TData() const;
0075 
0076   NCollection_Array1<HLRAlgo_PolyHidingData>& PHDat() const;
0077 
0078   Standard_EXPORT void UpdateGlobalMinMax(Bnd_Box& theBox);
0079 
0080   bool Hiding() const;
0081 
0082   //! process hiding between <Pt1> and <Pt2>.
0083   Standard_EXPORT void HideByPolyData(const HLRAlgo_BiPoint::PointsT& thePoints,
0084                                       Triangle&                       theTriangle,
0085                                       HLRAlgo_BiPoint::IndicesT&      theIndices,
0086                                       const bool                      HidingShell,
0087                                       HLRAlgo_EdgeStatus&             status);
0088 
0089   FaceIndices& Indices() { return myFaceIndices; }
0090 
0091   DEFINE_STANDARD_RTTIEXT(HLRAlgo_PolyData, Standard_Transient)
0092 
0093 private:
0094   //! evident.
0095   void hideByOneTriangle(const HLRAlgo_BiPoint::PointsT& thePoints,
0096                          Triangle&                       theTriangle,
0097                          const bool                      Crossing,
0098                          const bool                      HideBefore,
0099                          const int                       TrFlags,
0100                          HLRAlgo_EdgeStatus&             status);
0101 
0102   FaceIndices                                              myFaceIndices;
0103   occ::handle<NCollection_HArray1<gp_XYZ>>                 myHNodes;
0104   occ::handle<NCollection_HArray1<HLRAlgo_TriangleData>>   myHTData;
0105   occ::handle<NCollection_HArray1<HLRAlgo_PolyHidingData>> myHPHDat;
0106 };
0107 
0108 #include <HLRAlgo_PolyData.lxx>
0109 
0110 #endif // _HLRAlgo_PolyData_HeaderFile