File indexing completed on 2026-09-13 09:17:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _PrsDim_HeaderFile
0018 #define _PrsDim_HeaderFile
0019
0020 #include <PrsDim_KindOfSurface.hxx>
0021 #include <gp_Elips.hxx>
0022 #include <gp_Pnt.hxx>
0023 #include <Prs3d_Drawer.hxx>
0024 #include <Prs3d_Presentation.hxx>
0025 #include <Standard.hxx>
0026 #include <Standard_DefineAlloc.hxx>
0027 #include <Standard_Handle.hxx>
0028
0029 class Bnd_Box;
0030 class Geom_Curve;
0031 class Geom_Plane;
0032 class Geom_Surface;
0033 class TopoDS_Edge;
0034 class TopoDS_Face;
0035 class TopoDS_Shape;
0036 class TopoDS_Vertex;
0037
0038
0039 class PrsDim
0040 {
0041 public:
0042 DEFINE_STANDARD_ALLOC
0043
0044
0045
0046 Standard_EXPORT static gp_Pnt Nearest(const TopoDS_Shape& aShape, const gp_Pnt& aPoint);
0047
0048
0049 Standard_EXPORT static gp_Pnt Nearest(const gp_Lin& theLine, const gp_Pnt& thePoint);
0050
0051
0052
0053
0054 Standard_EXPORT static bool Nearest(const occ::handle<Geom_Curve>& theCurve,
0055 const gp_Pnt& thePoint,
0056 const gp_Pnt& theFirstPoint,
0057 const gp_Pnt& theLastPoint,
0058 gp_Pnt& theNearestPoint);
0059
0060 Standard_EXPORT static gp_Pnt Farest(const TopoDS_Shape& aShape, const gp_Pnt& aPoint);
0061
0062
0063
0064
0065
0066 Standard_EXPORT static bool ComputeGeometry(const TopoDS_Edge& theEdge,
0067 occ::handle<Geom_Curve>& theCurve,
0068 gp_Pnt& theFirstPnt,
0069 gp_Pnt& theLastPnt);
0070
0071
0072
0073
0074 Standard_EXPORT static bool ComputeGeometry(const TopoDS_Edge& theEdge,
0075 occ::handle<Geom_Curve>& theCurve,
0076 gp_Pnt& theFirstPnt,
0077 gp_Pnt& theLastPnt,
0078 bool& theIsInfinite);
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088 Standard_EXPORT static bool ComputeGeometry(const TopoDS_Edge& theEdge,
0089 occ::handle<Geom_Curve>& theCurve,
0090 gp_Pnt& theFirstPnt,
0091 gp_Pnt& theLastPnt,
0092 occ::handle<Geom_Curve>& theExtCurve,
0093 bool& theIsInfinite,
0094 bool& theIsOnPlane,
0095 const occ::handle<Geom_Plane>& thePlane);
0096
0097
0098
0099
0100
0101 Standard_EXPORT static bool ComputeGeometry(const TopoDS_Edge& theFirstEdge,
0102 const TopoDS_Edge& theSecondEdge,
0103 occ::handle<Geom_Curve>& theFirstCurve,
0104 occ::handle<Geom_Curve>& theSecondCurve,
0105 gp_Pnt& theFirstPnt1,
0106 gp_Pnt& theLastPnt1,
0107 gp_Pnt& theFirstPnt2,
0108 gp_Pnt& theLastPnt2,
0109 const occ::handle<Geom_Plane>& thePlane);
0110
0111
0112
0113 Standard_EXPORT static bool ComputeGeometry(const TopoDS_Edge& theFirstEdge,
0114 const TopoDS_Edge& theSecondEdge,
0115 occ::handle<Geom_Curve>& theFirstCurve,
0116 occ::handle<Geom_Curve>& theSecondCurve,
0117 gp_Pnt& theFirstPnt1,
0118 gp_Pnt& theLastPnt1,
0119 gp_Pnt& theFirstPnt2,
0120 gp_Pnt& theLastPnt2,
0121 bool& theIsinfinite1,
0122 bool& theIsinfinite2);
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133 Standard_EXPORT static bool ComputeGeometry(const TopoDS_Edge& theFirstEdge,
0134 const TopoDS_Edge& theSecondEdge,
0135 int& theExtIndex,
0136 occ::handle<Geom_Curve>& theFirstCurve,
0137 occ::handle<Geom_Curve>& theSecondCurve,
0138 gp_Pnt& theFirstPnt1,
0139 gp_Pnt& theLastPnt1,
0140 gp_Pnt& theFirstPnt2,
0141 gp_Pnt& theLastPnt2,
0142 occ::handle<Geom_Curve>& theExtCurve,
0143 bool& theIsinfinite1,
0144 bool& theIsinfinite2,
0145 const occ::handle<Geom_Plane>& thePlane);
0146
0147
0148
0149
0150 Standard_EXPORT static bool ComputeGeomCurve(occ::handle<Geom_Curve>& aCurve,
0151 const double first1,
0152 const double last1,
0153 gp_Pnt& FirstPnt1,
0154 gp_Pnt& LastPnt1,
0155 const occ::handle<Geom_Plane>& aPlane,
0156 bool& isOnPlane);
0157
0158 Standard_EXPORT static bool ComputeGeometry(const TopoDS_Vertex& aVertex,
0159 gp_Pnt& point,
0160 const occ::handle<Geom_Plane>& aPlane,
0161 bool& isOnPlane);
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171 Standard_EXPORT static bool GetPlaneFromFace(const TopoDS_Face& aFace,
0172 gp_Pln& aPlane,
0173 occ::handle<Geom_Surface>& aSurf,
0174 PrsDim_KindOfSurface& aSurfType,
0175 double& Offset);
0176
0177 Standard_EXPORT static void InitFaceLength(const TopoDS_Face& aFace,
0178 gp_Pln& aPlane,
0179 occ::handle<Geom_Surface>& aSurface,
0180 PrsDim_KindOfSurface& aSurfaceType,
0181 double& anOffset);
0182
0183
0184
0185
0186
0187 Standard_EXPORT static void InitLengthBetweenCurvilinearFaces(
0188 const TopoDS_Face& theFirstFace,
0189 const TopoDS_Face& theSecondFace,
0190 occ::handle<Geom_Surface>& theFirstSurf,
0191 occ::handle<Geom_Surface>& theSecondSurf,
0192 gp_Pnt& theFirstAttach,
0193 gp_Pnt& theSecondAttach,
0194 gp_Dir& theDirOnPlane);
0195
0196
0197
0198 Standard_EXPORT static bool InitAngleBetweenPlanarFaces(const TopoDS_Face& theFirstFace,
0199 const TopoDS_Face& theSecondFace,
0200 gp_Pnt& theCenter,
0201 gp_Pnt& theFirstAttach,
0202 gp_Pnt& theSecondAttach,
0203 const bool theIsFirstPointSet = false);
0204
0205
0206
0207 Standard_EXPORT static bool InitAngleBetweenCurvilinearFaces(
0208 const TopoDS_Face& theFirstFace,
0209 const TopoDS_Face& theSecondFace,
0210 const PrsDim_KindOfSurface theFirstSurfType,
0211 const PrsDim_KindOfSurface theSecondSurfType,
0212 gp_Pnt& theCenter,
0213 gp_Pnt& theFirstAttach,
0214 gp_Pnt& theSecondAttach,
0215 const bool theIsFirstPointSet = false);
0216
0217 Standard_EXPORT static gp_Pnt ProjectPointOnPlane(const gp_Pnt& aPoint, const gp_Pln& aPlane);
0218
0219 Standard_EXPORT static gp_Pnt ProjectPointOnLine(const gp_Pnt& aPoint, const gp_Lin& aLine);
0220
0221 Standard_EXPORT static gp_Pnt TranslatePointToBound(const gp_Pnt& aPoint,
0222 const gp_Dir& aDir,
0223 const Bnd_Box& aBndBox);
0224
0225
0226
0227 Standard_EXPORT static bool InDomain(const double aFirstPar,
0228 const double aLastPar,
0229 const double anAttachPar);
0230
0231
0232 Standard_EXPORT static gp_Pnt NearestApex(const gp_Elips& elips,
0233 const gp_Pnt& pApex,
0234 const gp_Pnt& nApex,
0235 const double fpara,
0236 const double lpara,
0237 bool& IsInDomain);
0238
0239
0240 Standard_EXPORT static double DistanceFromApex(const gp_Elips& elips,
0241 const gp_Pnt& Apex,
0242 const double par);
0243
0244 Standard_EXPORT static void ComputeProjEdgePresentation(
0245 const occ::handle<Prs3d_Presentation>& aPres,
0246 const occ::handle<Prs3d_Drawer>& aDrawer,
0247 const TopoDS_Edge& anEdge,
0248 const occ::handle<Geom_Curve>& ProjCurve,
0249 const gp_Pnt& FirstP,
0250 const gp_Pnt& LastP,
0251 const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE,
0252 const double aWidth = 2,
0253 const Aspect_TypeOfLine aProjTOL = Aspect_TOL_DASH,
0254 const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT);
0255
0256 Standard_EXPORT static void ComputeProjVertexPresentation(
0257 const occ::handle<Prs3d_Presentation>& aPres,
0258 const occ::handle<Prs3d_Drawer>& aDrawer,
0259 const TopoDS_Vertex& aVertex,
0260 const gp_Pnt& ProjPoint,
0261 const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE,
0262 const double aWidth = 2,
0263 const Aspect_TypeOfMarker aProjTOM = Aspect_TOM_PLUS,
0264 const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT);
0265 };
0266
0267 #endif