Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:51

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 <HLRAlgo_BiPoint.hxx>
0021 #include <Standard.hxx>
0022 #include <Standard_Type.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <TColgp_HArray1OfXYZ.hxx>
0026 #include <HLRAlgo_HArray1OfTData.hxx>
0027 #include <HLRAlgo_HArray1OfPHDat.hxx>
0028 #include <Standard_Transient.hxx>
0029 #include <Standard_Boolean.hxx>
0030 
0031 class HLRAlgo_EdgeStatus;
0032 
0033 class HLRAlgo_PolyData;
0034 DEFINE_STANDARD_HANDLE(HLRAlgo_PolyData, Standard_Transient)
0035 
0036 //! Data structure of a set of Triangles.
0037 class HLRAlgo_PolyData : public Standard_Transient
0038 {
0039 
0040 public:
0041   struct FaceIndices
0042   {
0043     //! The default constructor.
0044     FaceIndices()
0045     : Index(0),
0046       Min(0),
0047       Max(0)
0048     {
0049     }
0050 
0051     Standard_Integer Index, Min, Max;
0052   };
0053 
0054   struct Triangle
0055   {
0056     gp_XY V1, V2, V3;
0057     Standard_Real Param, TolParam, TolAng, Tolerance;
0058   };
0059 
0060   struct Box
0061   {
0062     Standard_Real XMin, YMin, ZMin, XMax, YMax, ZMax;
0063 
0064     //! The default constructor.
0065     Box()
0066     : XMin(0.0),
0067       YMin(0.0),
0068       ZMin(0.0),
0069       XMax(0.0),
0070       YMax(0.0),
0071       ZMax(0.0)
0072     {
0073     }
0074 
0075     //! The initializing constructor.
0076     Box(
0077         const Standard_Real& theXMin,
0078         const Standard_Real& theYMin,
0079         const Standard_Real& theZMin,
0080         const Standard_Real& theXMax,
0081         const Standard_Real& theYMax,
0082         const Standard_Real& theZMax) :
0083       XMin(theXMin),
0084       YMin(theYMin),
0085       ZMin(theZMin),
0086       XMax(theXMax),
0087       YMax(theYMax),
0088       ZMax(theZMax)
0089     {
0090     }
0091   };
0092 
0093   Standard_EXPORT HLRAlgo_PolyData();
0094   
0095   Standard_EXPORT void HNodes (const Handle(TColgp_HArray1OfXYZ)& HNodes);
0096   
0097   Standard_EXPORT void HTData (const Handle(HLRAlgo_HArray1OfTData)& HTData);
0098   
0099   Standard_EXPORT void HPHDat (const Handle(HLRAlgo_HArray1OfPHDat)& HPHDat);
0100   
0101     void FaceIndex (const Standard_Integer I);
0102   
0103     Standard_Integer FaceIndex() const;
0104   
0105     TColgp_Array1OfXYZ& Nodes() const;
0106   
0107     HLRAlgo_Array1OfTData& TData() const;
0108   
0109     HLRAlgo_Array1OfPHDat& PHDat() const;
0110   
0111   Standard_EXPORT void UpdateGlobalMinMax (Box& theBox);
0112   
0113     Standard_Boolean Hiding() const;
0114   
0115   //! process hiding between <Pt1> and <Pt2>.
0116   Standard_EXPORT void HideByPolyData (const HLRAlgo_BiPoint::PointsT& thePoints, Triangle& theTriangle, HLRAlgo_BiPoint::IndicesT& theIndices, const Standard_Boolean HidingShell, HLRAlgo_EdgeStatus& status);
0117   
0118   FaceIndices& Indices()
0119   {
0120     return myFaceIndices;
0121   }
0122 
0123   DEFINE_STANDARD_RTTIEXT(HLRAlgo_PolyData,Standard_Transient)
0124 
0125 private:
0126 
0127   //! evident.
0128   void hideByOneTriangle (const HLRAlgo_BiPoint::PointsT& thePoints,
0129                           Triangle& theTriangle,
0130                           const Standard_Boolean Crossing,
0131                           const Standard_Boolean HideBefore,
0132                           const Standard_Integer TrFlags,
0133                           HLRAlgo_EdgeStatus& status);
0134 
0135   FaceIndices myFaceIndices;
0136   Handle(TColgp_HArray1OfXYZ) myHNodes;
0137   Handle(HLRAlgo_HArray1OfTData) myHTData;
0138   Handle(HLRAlgo_HArray1OfPHDat) myHPHDat;
0139 
0140 };
0141 
0142 #include <HLRAlgo_PolyData.lxx>
0143 
0144 #endif // _HLRAlgo_PolyData_HeaderFile