Integration of OCCT 6.5.0 from SVN
[occt.git] / src / Prs3d / Prs3d_Point.gxx
CommitLineData
7fd59977 1#include <Graphic3d_Array1OfVertex.hxx>
2#include <Graphic3d_Vertex.hxx>
3#include <Graphic3d_Group.hxx>
4#include <Prs3d_PointAspect.hxx>
5
6static void DrawPoint (const anyPoint& aPoint,
7 const Handle(Graphic3d_Group) aGroup) {
8
9 Quantity_Length x,y,z;
10 PointTool::Coord(aPoint,x,y,z);
11 Graphic3d_Vertex Vertex(x,y,z);
12 aGroup->Marker(Vertex);
13}
14
15void Prs3d_Point::Add (const Handle (Prs3d_Presentation)& aPresentation,
16 const anyPoint& aPoint,
17 const Handle (Prs3d_Drawer)& aDrawer){
18
19 Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
20 TheGroup->SetPrimitivesAspect(aDrawer->PointAspect()->Aspect());
21 DrawPoint(aPoint,TheGroup);
22}
23
24void Prs3d_Point::Add (const Handle (Prs3d_Presentation)& aPresentation,
25 const anyPoint& aPoint){
26
27 DrawPoint(aPoint,Prs3d_Root::CurrentGroup(aPresentation));
28}
29
30
31Standard_Boolean Prs3d_Point::Match (const anyPoint& aPoint,
32 const Quantity_Length X,
33 const Quantity_Length Y,
34 const Quantity_Length Z,
35 const Quantity_Length aDistance) {
36
37 Quantity_Length x,y,z;
38 PointTool::Coord(aPoint,x,y,z);
39 return Sqrt( (X-x)*(X-x) + (Y-y)*(Y-y) + (Z-z)*(Z-z) ) <= aDistance;
40}