File indexing completed on 2024-11-15 09:48:32
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _SelectMgr_SelectingVolumeManager_HeaderFile
0017 #define _SelectMgr_SelectingVolumeManager_HeaderFile
0018
0019 #include <SelectBasics_SelectingVolumeManager.hxx>
0020
0021 #include <SelectMgr_BaseIntersector.hxx>
0022 #include <SelectMgr_VectorTypes.hxx>
0023 #include <SelectMgr_ViewClipRange.hxx>
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 class SelectMgr_SelectingVolumeManager : public SelectBasics_SelectingVolumeManager
0036 {
0037 public:
0038
0039
0040 Standard_EXPORT SelectMgr_SelectingVolumeManager();
0041
0042 virtual ~SelectMgr_SelectingVolumeManager() {}
0043
0044
0045 Standard_EXPORT void InitPointSelectingVolume (const gp_Pnt2d& thePoint);
0046
0047
0048 Standard_EXPORT void InitBoxSelectingVolume (const gp_Pnt2d& theMinPt,
0049 const gp_Pnt2d& theMaxPt);
0050
0051
0052 Standard_EXPORT void InitPolylineSelectingVolume (const TColgp_Array1OfPnt2d& thePoints);
0053
0054
0055 Standard_EXPORT void InitAxisSelectingVolume (const gp_Ax1& theAxis);
0056
0057
0058 Standard_EXPORT void InitSelectingVolume (const Handle(SelectMgr_BaseIntersector)& theVolume);
0059
0060
0061 Standard_EXPORT void BuildSelectingVolume();
0062
0063
0064
0065 const Handle(SelectMgr_BaseIntersector)& ActiveVolume() const { return myActiveSelectingVolume; }
0066
0067
0068 Standard_EXPORT virtual Standard_Integer GetActiveSelectionType() const Standard_OVERRIDE;
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080 Standard_EXPORT virtual SelectMgr_SelectingVolumeManager ScaleAndTransform (const Standard_Integer theScaleFactor,
0081 const gp_GTrsf& theTrsf,
0082 const Handle(SelectMgr_FrustumBuilder)& theBuilder) const;
0083
0084 public:
0085
0086
0087 Standard_EXPORT const Handle(Graphic3d_Camera)& Camera() const;
0088
0089
0090
0091
0092 Standard_EXPORT void SetCamera (const Handle(Graphic3d_Camera) theCamera);
0093
0094
0095
0096
0097 Standard_EXPORT void SetViewport (const Standard_Real theX,
0098 const Standard_Real theY,
0099 const Standard_Real theWidth,
0100 const Standard_Real theHeight);
0101
0102
0103
0104
0105 Standard_EXPORT void SetPixelTolerance (const Standard_Integer theTolerance);
0106
0107
0108 Standard_EXPORT void WindowSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const;
0109
0110
0111
0112
0113 Standard_EXPORT void SetWindowSize (const Standard_Integer theWidth, const Standard_Integer theHeight);
0114
0115
0116
0117 Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
0118 const SelectMgr_Vec3& theBoxMax,
0119 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0120
0121
0122
0123 Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
0124 const SelectMgr_Vec3& theBoxMax,
0125 Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
0126
0127
0128 Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
0129 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0130
0131
0132 Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const Standard_OVERRIDE;
0133
0134
0135
0136
0137 Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPts,
0138 Standard_Integer theSensType,
0139 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0140
0141
0142 Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
0143 const gp_Pnt& thePnt2,
0144 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0145
0146
0147
0148
0149 Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
0150 const gp_Pnt& thePnt2,
0151 const gp_Pnt& thePnt3,
0152 Standard_Integer theSensType,
0153 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0154
0155
0156 Standard_EXPORT virtual Standard_Boolean OverlapsSphere (const gp_Pnt& theCenter,
0157 const Standard_Real theRadius,
0158 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0159
0160
0161 Standard_EXPORT virtual Standard_Boolean OverlapsSphere (const gp_Pnt& theCenter,
0162 const Standard_Real theRadius,
0163 Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
0164
0165
0166
0167 Standard_EXPORT virtual Standard_Boolean OverlapsCylinder (const Standard_Real theBottomRad,
0168 const Standard_Real theTopRad,
0169 const Standard_Real theHeight,
0170 const gp_Trsf& theTrsf,
0171 const Standard_Boolean theIsHollow,
0172 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0173
0174
0175
0176 Standard_EXPORT virtual Standard_Boolean OverlapsCylinder (const Standard_Real theBottomRad,
0177 const Standard_Real theTopRad,
0178 const Standard_Real theHeight,
0179 const gp_Trsf& theTrsf,
0180 const Standard_Boolean theIsHollow,
0181 Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
0182
0183
0184
0185
0186
0187 Standard_EXPORT virtual Standard_Boolean OverlapsCircle (const Standard_Real theBottomRad,
0188 const gp_Trsf& theTrsf,
0189 const Standard_Boolean theIsFilled,
0190 SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
0191
0192
0193
0194
0195
0196 Standard_EXPORT virtual Standard_Boolean OverlapsCircle (const Standard_Real theBottomRad,
0197 const gp_Trsf& theTrsf,
0198 const Standard_Boolean theIsFilled,
0199 Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
0200
0201
0202
0203 Standard_EXPORT virtual Standard_Real DistToGeometryCenter (const gp_Pnt& theCOG) const Standard_OVERRIDE;
0204
0205
0206
0207 Standard_EXPORT virtual gp_Pnt DetectedPoint (const Standard_Real theDepth) const Standard_OVERRIDE;
0208
0209
0210
0211 Standard_EXPORT virtual void AllowOverlapDetection (const Standard_Boolean theIsToAllow);
0212
0213 Standard_EXPORT virtual Standard_Boolean IsOverlapAllowed() const Standard_OVERRIDE;
0214
0215
0216 const Handle(Graphic3d_SequenceOfHClipPlane)& ViewClipping() const { return myViewClipPlanes; }
0217
0218
0219 const Handle(Graphic3d_SequenceOfHClipPlane)& ObjectClipping() const { return myObjectClipPlanes; }
0220
0221
0222
0223
0224
0225
0226 Standard_EXPORT void SetViewClipping (const Handle(Graphic3d_SequenceOfHClipPlane)& theViewPlanes,
0227 const Handle(Graphic3d_SequenceOfHClipPlane)& theObjPlanes,
0228 const SelectMgr_SelectingVolumeManager* theWorldSelMgr);
0229
0230
0231 Standard_EXPORT void SetViewClipping (const SelectMgr_SelectingVolumeManager& theOther);
0232
0233
0234 const SelectMgr_ViewClipRange& ViewClipRanges() const { return myViewClipRange; }
0235
0236
0237 void SetViewClipRanges (const SelectMgr_ViewClipRange& theRange) { myViewClipRange = theRange; }
0238
0239
0240 Standard_EXPORT const gp_Pnt* GetVertices() const;
0241
0242
0243
0244
0245
0246 Standard_EXPORT virtual gp_Pnt GetNearPickedPnt() const Standard_OVERRIDE;
0247
0248
0249
0250
0251
0252 Standard_EXPORT virtual gp_Pnt GetFarPickedPnt() const Standard_OVERRIDE;
0253
0254
0255
0256 Standard_EXPORT virtual gp_Dir GetViewRayDirection() const Standard_OVERRIDE;
0257
0258
0259 Standard_EXPORT virtual Standard_Boolean IsScalableActiveVolume() const Standard_OVERRIDE;
0260
0261
0262
0263 Standard_EXPORT virtual gp_Pnt2d GetMousePosition() const Standard_OVERRIDE;
0264
0265
0266
0267 Standard_EXPORT virtual void GetPlanes (NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const Standard_OVERRIDE;
0268
0269
0270 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0271
0272 public:
0273
0274 Standard_DEPRECATED("Deprecated method - InitPointSelectingVolume() and Build() methods should be used instead")
0275 Standard_EXPORT void BuildSelectingVolume (const gp_Pnt2d& thePoint);
0276
0277 Standard_DEPRECATED("Deprecated method - InitBoxSelectingVolume() and Build() should be used instead")
0278 Standard_EXPORT void BuildSelectingVolume (const gp_Pnt2d& theMinPt,
0279 const gp_Pnt2d& theMaxPt);
0280
0281 Standard_DEPRECATED("Deprecated method - InitPolylineSelectingVolume() and Build() should be used instead")
0282 Standard_EXPORT void BuildSelectingVolume (const TColgp_Array1OfPnt2d& thePoints);
0283
0284 private:
0285 Handle(SelectMgr_BaseIntersector) myActiveSelectingVolume;
0286 Handle(Graphic3d_SequenceOfHClipPlane) myViewClipPlanes;
0287 Handle(Graphic3d_SequenceOfHClipPlane) myObjectClipPlanes;
0288 SelectMgr_ViewClipRange myViewClipRange;
0289 Standard_Boolean myToAllowOverlap;
0290 };
0291
0292 #endif