File indexing completed on 2025-01-18 10:03:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BRepMesh_CircleTool_HeaderFile
0015 #define _BRepMesh_CircleTool_HeaderFile
0016
0017 #include <Standard.hxx>
0018 #include <Standard_DefineAlloc.hxx>
0019 #include <Standard_Macro.hxx>
0020
0021 #include <Standard_Real.hxx>
0022 #include <BRepMesh_CircleInspector.hxx>
0023 #include <gp_XY.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <IMeshData_Types.hxx>
0027 #include <NCollection_Array1.hxx>
0028
0029 class gp_Circ2d;
0030
0031
0032 class BRepMesh_CircleTool
0033 {
0034 public:
0035
0036 DEFINE_STANDARD_ALLOC
0037
0038
0039
0040 Standard_EXPORT BRepMesh_CircleTool(
0041 const Handle(NCollection_IncAllocator)& theAllocator);
0042
0043
0044
0045
0046 Standard_EXPORT BRepMesh_CircleTool(
0047 const Standard_Integer theReservedSize,
0048 const Handle(NCollection_IncAllocator)& theAllocator);
0049
0050
0051
0052 void Init(const Standard_Integer )
0053 {
0054 myTolerance = Precision::PConfusion();
0055 }
0056
0057
0058
0059 void SetCellSize(const Standard_Real theSize)
0060 {
0061 myCellFilter.Reset(theSize, myAllocator);
0062 }
0063
0064
0065
0066
0067 void SetCellSize(const Standard_Real theSizeX,
0068 const Standard_Real theSizeY)
0069 {
0070 Standard_Real aCellSizeC[2] = { theSizeX, theSizeY };
0071 NCollection_Array1<Standard_Real> aCellSize(aCellSizeC[0], 1, 2);
0072 myCellFilter.Reset(aCellSize, myAllocator);
0073 }
0074
0075
0076
0077
0078 void SetMinMaxSize(const gp_XY& theMin,
0079 const gp_XY& theMax)
0080 {
0081 myFaceMin = theMin;
0082 myFaceMax = theMax;
0083 }
0084
0085
0086 Standard_Boolean IsEmpty () const
0087 {
0088 return mySelector.Circles ().IsEmpty ();
0089 }
0090
0091
0092
0093
0094 Standard_EXPORT void Bind(const Standard_Integer theIndex,
0095 const gp_Circ2d& theCircle);
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105 Standard_EXPORT static Standard_Boolean MakeCircle(const gp_XY& thePoint1,
0106 const gp_XY& thePoint2,
0107 const gp_XY& thePoint3,
0108 gp_XY& theLocation,
0109 Standard_Real& theRadius);
0110
0111
0112
0113
0114
0115
0116
0117
0118 Standard_EXPORT Standard_Boolean Bind(const Standard_Integer theIndex,
0119 const gp_XY& thePoint1,
0120 const gp_XY& thePoint2,
0121 const gp_XY& thePoint3);
0122
0123
0124
0125 Standard_EXPORT void MocBind(const Standard_Integer theIndex);
0126
0127
0128
0129 Standard_EXPORT void Delete(const Standard_Integer theIndex);
0130
0131
0132
0133 Standard_EXPORT IMeshData::ListOfInteger& Select(const gp_XY& thePoint);
0134
0135 private:
0136
0137
0138
0139
0140
0141 void bind(const Standard_Integer theIndex,
0142 const gp_XY& theLocation,
0143 const Standard_Real theRadius);
0144
0145 private:
0146
0147 Standard_Real myTolerance;
0148 Handle(NCollection_IncAllocator) myAllocator;
0149 IMeshData::CircleCellFilter myCellFilter;
0150 BRepMesh_CircleInspector mySelector;
0151 gp_XY myFaceMax;
0152 gp_XY myFaceMin;
0153 };
0154
0155 #endif