File indexing completed on 2025-01-18 10:04:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _SelectMgr_TriangularFrustumSet_HeaderFile
0017 #define _SelectMgr_TriangularFrustumSet_HeaderFile
0018
0019 #include <SelectMgr_TriangularFrustum.hxx>
0020 #include <TColgp_HArray1OfPnt2d.hxx>
0021
0022 typedef NCollection_List<Handle(SelectMgr_TriangularFrustum)> SelectMgr_TriangFrustums;
0023
0024
0025
0026
0027
0028
0029
0030
0031 class SelectMgr_TriangularFrustumSet : public SelectMgr_BaseFrustum
0032 {
0033 public:
0034
0035
0036 struct SelectionPolyline
0037 {
0038 Handle(TColgp_HArray1OfPnt2d) Points;
0039 };
0040
0041 public:
0042
0043
0044 SelectMgr_TriangularFrustumSet();
0045
0046
0047 Standard_EXPORT virtual ~SelectMgr_TriangularFrustumSet();
0048
0049
0050 Standard_EXPORT void Init (const TColgp_Array1OfPnt2d& thePoints);
0051
0052
0053
0054
0055 Standard_EXPORT virtual void Build() Standard_OVERRIDE;
0056
0057
0058 virtual Standard_Boolean IsScalable() const Standard_OVERRIDE { return false; }
0059
0060
0061 Standard_EXPORT virtual Handle(SelectMgr_BaseIntersector) ScaleAndTransform (const Standard_Integer theScale,
0062 const gp_GTrsf& theTrsf,
0063 const Handle(SelectMgr_FrustumBuilder)& theBuilder) const Standard_OVERRIDE;
0064
0065 public:
0066
0067 Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theMinPnt,
0068 const SelectMgr_Vec3& theMaxPnt,
0069 const SelectMgr_ViewClipRange& theClipRange,
0070 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0071
0072 Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theMinPnt,
0073 const SelectMgr_Vec3& theMaxPnt,
0074 Standard_Boolean* theInside) const Standard_OVERRIDE;
0075
0076 Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
0077 const SelectMgr_ViewClipRange& theClipRange,
0078 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0079
0080
0081 virtual Standard_Boolean OverlapsPoint (const gp_Pnt& ) const Standard_OVERRIDE
0082 {
0083 return Standard_False;
0084 }
0085
0086 Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
0087 Select3D_TypeOfSensitivity theSensType,
0088 const SelectMgr_ViewClipRange& theClipRange,
0089 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0090
0091 Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
0092 const gp_Pnt& thePnt2,
0093 const SelectMgr_ViewClipRange& theClipRange,
0094 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0095
0096 Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
0097 const gp_Pnt& thePnt2,
0098 const gp_Pnt& thePnt3,
0099 Select3D_TypeOfSensitivity theSensType,
0100 const SelectMgr_ViewClipRange& theClipRange,
0101 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0102
0103 public:
0104
0105
0106 Standard_EXPORT virtual gp_Pnt DetectedPoint (const Standard_Real theDepth) const Standard_OVERRIDE;
0107
0108
0109
0110 Standard_EXPORT virtual Standard_Boolean OverlapsSphere (const gp_Pnt& theCenter,
0111 const Standard_Real theRadius,
0112 Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
0113
0114
0115
0116 Standard_EXPORT virtual Standard_Boolean OverlapsSphere (const gp_Pnt& theCenter,
0117 const Standard_Real theRadius,
0118 const SelectMgr_ViewClipRange& theClipRange,
0119 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0120
0121
0122
0123 Standard_EXPORT virtual Standard_Boolean OverlapsCylinder (const Standard_Real theBottomRad,
0124 const Standard_Real theTopRad,
0125 const Standard_Real theHeight,
0126 const gp_Trsf& theTrsf,
0127 const Standard_Boolean theIsHollow,
0128 const SelectMgr_ViewClipRange& theClipRange,
0129 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0130
0131
0132
0133 Standard_EXPORT virtual Standard_Boolean OverlapsCylinder (const Standard_Real theBottomRad,
0134 const Standard_Real theTopRad,
0135 const Standard_Real theHeight,
0136 const gp_Trsf& theTrsf,
0137 const Standard_Boolean theIsHollow,
0138 Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
0139
0140
0141
0142 Standard_EXPORT virtual Standard_Boolean OverlapsCircle (const Standard_Real theBottomRad,
0143 const gp_Trsf& theTrsf,
0144 const Standard_Boolean theIsFilled,
0145 const SelectMgr_ViewClipRange& theClipRange,
0146 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0147
0148
0149
0150 Standard_EXPORT virtual Standard_Boolean OverlapsCircle (const Standard_Real theBottomRad,
0151 const gp_Trsf& theTrsf,
0152 const Standard_Boolean theIsFilled,
0153 Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
0154
0155
0156
0157 Standard_EXPORT virtual void GetPlanes (NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const Standard_OVERRIDE;
0158
0159
0160
0161 Standard_EXPORT virtual void SetAllowOverlapDetection (const Standard_Boolean theIsToAllow);
0162
0163
0164 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0165
0166 private:
0167
0168
0169 Standard_EXPORT Standard_Boolean isIntersectBoundary (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2) const;
0170
0171
0172 Standard_EXPORT Standard_Boolean isIntersectBoundary (const Standard_Real theRadius,
0173 const gp_Trsf& theTrsf,
0174 const Standard_Boolean theIsFilled) const;
0175
0176
0177 Standard_EXPORT static Standard_Boolean segmentTriangleIntersection (const gp_Pnt &theOrig, const gp_Vec& theDir,
0178 const gp_Pnt& theV1, const gp_Pnt& theV2, const gp_Pnt& theV3);
0179
0180 Standard_EXPORT static Standard_Boolean segmentSegmentIntersection (const gp_Pnt& theStartPnt1,
0181 const gp_Pnt& theEndPnt1,
0182 const gp_Pnt& theStartPnt2,
0183 const gp_Pnt& theEndPnt2);
0184
0185 Standard_EXPORT static Standard_Boolean pointInTriangle (const gp_Pnt& thePnt,
0186 const gp_Pnt& theV1, const gp_Pnt& theV2, const gp_Pnt& theV3);
0187
0188 private:
0189
0190 SelectMgr_TriangFrustums myFrustums;
0191 SelectionPolyline mySelPolyline;
0192 TColgp_Array1OfPnt myBoundaryPoints;
0193
0194
0195
0196
0197
0198
0199 Standard_Boolean myToAllowOverlap;
0200 };
0201
0202 #endif