Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-31 08:30:26

0001 // Created on: 1995-06-22
0002 // Created by: Christophe MARION
0003 // Copyright (c) 1995-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_BiPoint_HeaderFile
0018 #define _HLRAlgo_BiPoint_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 #include <gp_XYZ.hxx>
0027 #include <gp_XY.hxx>
0028 
0029 class HLRAlgo_BiPoint
0030 {
0031 public:
0032   struct IndicesT
0033   {
0034     IndicesT()
0035         : ShapeIndex(-1),
0036           FaceConex1(0),
0037           Face1Pt1(0),
0038           Face1Pt2(0),
0039           FaceConex2(0),
0040           Face2Pt1(0),
0041           Face2Pt2(0),
0042           MinSeg(0),
0043           MaxSeg(0),
0044           SegFlags(0)
0045     {
0046     }
0047 
0048     Standard_Integer ShapeIndex;
0049     Standard_Integer FaceConex1;
0050     Standard_Integer Face1Pt1;
0051     Standard_Integer Face1Pt2;
0052     Standard_Integer FaceConex2;
0053     Standard_Integer Face2Pt1;
0054     Standard_Integer Face2Pt2;
0055     Standard_Integer MinSeg;
0056     Standard_Integer MaxSeg;
0057     Standard_Integer SegFlags;
0058   };
0059 
0060   struct PointsT
0061   {
0062     gp_XYZ Pnt1;
0063     gp_XYZ Pnt2;
0064     gp_XYZ PntP1;
0065     gp_XYZ PntP2;
0066 
0067     gp_XY PntP12D() const { return gp_XY(PntP1.X(), PntP1.Y()); }
0068 
0069     gp_XY PntP22D() const { return gp_XY(PntP2.X(), PntP2.Y()); }
0070   };
0071 
0072   DEFINE_STANDARD_ALLOC
0073 
0074   HLRAlgo_BiPoint() {}
0075 
0076   Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real    X1,
0077                                   const Standard_Real    Y1,
0078                                   const Standard_Real    Z1,
0079                                   const Standard_Real    X2,
0080                                   const Standard_Real    Y2,
0081                                   const Standard_Real    Z2,
0082                                   const Standard_Real    XT1,
0083                                   const Standard_Real    YT1,
0084                                   const Standard_Real    ZT1,
0085                                   const Standard_Real    XT2,
0086                                   const Standard_Real    YT2,
0087                                   const Standard_Real    ZT2,
0088                                   const Standard_Integer Index,
0089                                   const Standard_Boolean reg1,
0090                                   const Standard_Boolean regn,
0091                                   const Standard_Boolean outl,
0092                                   const Standard_Boolean intl);
0093 
0094   Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real    X1,
0095                                   const Standard_Real    Y1,
0096                                   const Standard_Real    Z1,
0097                                   const Standard_Real    X2,
0098                                   const Standard_Real    Y2,
0099                                   const Standard_Real    Z2,
0100                                   const Standard_Real    XT1,
0101                                   const Standard_Real    YT1,
0102                                   const Standard_Real    ZT1,
0103                                   const Standard_Real    XT2,
0104                                   const Standard_Real    YT2,
0105                                   const Standard_Real    ZT2,
0106                                   const Standard_Integer Index,
0107                                   const Standard_Integer flag);
0108 
0109   Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real    X1,
0110                                   const Standard_Real    Y1,
0111                                   const Standard_Real    Z1,
0112                                   const Standard_Real    X2,
0113                                   const Standard_Real    Y2,
0114                                   const Standard_Real    Z2,
0115                                   const Standard_Real    XT1,
0116                                   const Standard_Real    YT1,
0117                                   const Standard_Real    ZT1,
0118                                   const Standard_Real    XT2,
0119                                   const Standard_Real    YT2,
0120                                   const Standard_Real    ZT2,
0121                                   const Standard_Integer Index,
0122                                   const Standard_Integer i1,
0123                                   const Standard_Integer i1p1,
0124                                   const Standard_Integer i1p2,
0125                                   const Standard_Boolean reg1,
0126                                   const Standard_Boolean regn,
0127                                   const Standard_Boolean outl,
0128                                   const Standard_Boolean intl);
0129 
0130   Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real    X1,
0131                                   const Standard_Real    Y1,
0132                                   const Standard_Real    Z1,
0133                                   const Standard_Real    X2,
0134                                   const Standard_Real    Y2,
0135                                   const Standard_Real    Z2,
0136                                   const Standard_Real    XT1,
0137                                   const Standard_Real    YT1,
0138                                   const Standard_Real    ZT1,
0139                                   const Standard_Real    XT2,
0140                                   const Standard_Real    YT2,
0141                                   const Standard_Real    ZT2,
0142                                   const Standard_Integer Index,
0143                                   const Standard_Integer i1,
0144                                   const Standard_Integer i1p1,
0145                                   const Standard_Integer i1p2,
0146                                   const Standard_Integer flag);
0147 
0148   Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real    X1,
0149                                   const Standard_Real    Y1,
0150                                   const Standard_Real    Z1,
0151                                   const Standard_Real    X2,
0152                                   const Standard_Real    Y2,
0153                                   const Standard_Real    Z2,
0154                                   const Standard_Real    XT1,
0155                                   const Standard_Real    YT1,
0156                                   const Standard_Real    ZT1,
0157                                   const Standard_Real    XT2,
0158                                   const Standard_Real    YT2,
0159                                   const Standard_Real    ZT2,
0160                                   const Standard_Integer Index,
0161                                   const Standard_Integer i1,
0162                                   const Standard_Integer i1p1,
0163                                   const Standard_Integer i1p2,
0164                                   const Standard_Integer i2,
0165                                   const Standard_Integer i2p1,
0166                                   const Standard_Integer i2p2,
0167                                   const Standard_Boolean reg1,
0168                                   const Standard_Boolean regn,
0169                                   const Standard_Boolean outl,
0170                                   const Standard_Boolean intl);
0171 
0172   Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real    X1,
0173                                   const Standard_Real    Y1,
0174                                   const Standard_Real    Z1,
0175                                   const Standard_Real    X2,
0176                                   const Standard_Real    Y2,
0177                                   const Standard_Real    Z2,
0178                                   const Standard_Real    XT1,
0179                                   const Standard_Real    YT1,
0180                                   const Standard_Real    ZT1,
0181                                   const Standard_Real    XT2,
0182                                   const Standard_Real    YT2,
0183                                   const Standard_Real    ZT2,
0184                                   const Standard_Integer Index,
0185                                   const Standard_Integer i1,
0186                                   const Standard_Integer i1p1,
0187                                   const Standard_Integer i1p2,
0188                                   const Standard_Integer i2,
0189                                   const Standard_Integer i2p1,
0190                                   const Standard_Integer i2p2,
0191                                   const Standard_Integer flag);
0192 
0193   Standard_Boolean Rg1Line() const { return (myIndices.SegFlags & EMskRg1Line) != 0; }
0194 
0195   void Rg1Line(const Standard_Boolean B)
0196   {
0197     if (B)
0198       myIndices.SegFlags |= EMskRg1Line;
0199     else
0200       myIndices.SegFlags &= ~EMskRg1Line;
0201   }
0202 
0203   Standard_Boolean RgNLine() const { return (myIndices.SegFlags & EMskRgNLine) != 0; }
0204 
0205   void RgNLine(const Standard_Boolean B)
0206   {
0207     if (B)
0208       myIndices.SegFlags |= EMskRgNLine;
0209     else
0210       myIndices.SegFlags &= ~EMskRgNLine;
0211   }
0212 
0213   Standard_Boolean OutLine() const { return (myIndices.SegFlags & EMskOutLine) != 0; }
0214 
0215   void OutLine(const Standard_Boolean B)
0216   {
0217     if (B)
0218       myIndices.SegFlags |= EMskOutLine;
0219     else
0220       myIndices.SegFlags &= ~EMskOutLine;
0221   }
0222 
0223   Standard_Boolean IntLine() const { return (myIndices.SegFlags & EMskIntLine) != 0; }
0224 
0225   void IntLine(const Standard_Boolean B)
0226   {
0227     if (B)
0228       myIndices.SegFlags |= EMskIntLine;
0229     else
0230       myIndices.SegFlags &= ~EMskIntLine;
0231   }
0232 
0233   Standard_Boolean Hidden() const { return (myIndices.SegFlags & EMskHidden) != 0; }
0234 
0235   void Hidden(const Standard_Boolean B)
0236   {
0237     if (B)
0238       myIndices.SegFlags |= EMskHidden;
0239     else
0240       myIndices.SegFlags &= ~EMskHidden;
0241   }
0242 
0243   IndicesT& Indices() { return myIndices; }
0244 
0245   PointsT& Points() { return myPoints; }
0246 
0247 protected:
0248   enum EMskFlags
0249   {
0250     EMskRg1Line = 1,
0251     EMskRgNLine = 2,
0252     EMskOutLine = 4,
0253     EMskIntLine = 8,
0254     EMskHidden  = 16
0255   };
0256 
0257 private:
0258   IndicesT myIndices;
0259   PointsT  myPoints;
0260 };
0261 
0262 #endif // _HLRAlgo_BiPoint_HeaderFile