File indexing completed on 2026-09-10 09:17:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef Prs3d_Point_HeaderFile
0015 #define Prs3d_Point_HeaderFile
0016
0017 #include <Graphic3d_ArrayOfPoints.hxx>
0018 #include <Graphic3d_Group.hxx>
0019 #include <Prs3d_Drawer.hxx>
0020 #include <Prs3d_PointAspect.hxx>
0021
0022 template <class AnyPoint, class PointTool>
0023 class Prs3d_Point
0024 {
0025 public:
0026 DEFINE_STANDARD_ALLOC
0027
0028 private:
0029 Standard_EXPORT static void DrawPoint(const AnyPoint& thePoint,
0030 const Handle(Graphic3d_Group) theGroup)
0031 {
0032 Standard_Real aX, aY, aZ;
0033 PointTool::Coord(thePoint, aX, aY, aZ);
0034 Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints(1);
0035 anArrayOfPoints->AddVertex(aX, aY, aZ);
0036 theGroup->AddPrimitiveArray(anArrayOfPoints);
0037 }
0038
0039 public:
0040 Standard_EXPORT static void Add(const Handle(Prs3d_Presentation)& thePrs,
0041 const AnyPoint& thePoint,
0042 const Handle(Prs3d_Drawer)& theDrawer)
0043 {
0044 Handle(Graphic3d_Group) aGroup = thePrs->CurrentGroup();
0045 aGroup->SetPrimitivesAspect(theDrawer->PointAspect()->Aspect());
0046 DrawPoint(thePoint, aGroup);
0047 }
0048
0049 Standard_EXPORT static Standard_Boolean Match(const AnyPoint& thePoint,
0050 const Standard_Real theX,
0051 const Standard_Real theY,
0052 const Standard_Real theZ,
0053 const Standard_Real theDistance)
0054 {
0055 Standard_Real aX, aY, aZ;
0056 PointTool::Coord(thePoint, aX, aY, aZ);
0057 return Sqrt((theX - aX) * (theX - aX) + (theY - aY) * (theY - aY) + (theZ - aZ) * (theZ - aZ))
0058 <= theDistance;
0059 }
0060 };
0061
0062 #endif