3 #include "Sample2D_Markers.h"
5 IMPLEMENT_STANDARD_HANDLE(Sample2D_Markers,AIS_InteractiveObject)
6 IMPLEMENT_STANDARD_RTTIEXT(Sample2D_Markers,AIS_InteractiveObject)
9 Sample2D_Markers::Sample2D_Markers (const Quantity_Length theXPosition ,
10 const Quantity_Length theYPosition ,
11 const Aspect_TypeOfMarker theMarkerType,
12 const Quantity_Color theColor,
13 const Standard_Real theScaleOrId)
14 :AIS_InteractiveObject(),myArrayOfPoints (new Graphic3d_ArrayOfPoints (1))
16 myXPosition = theXPosition;
17 myYPosition = theYPosition;
18 myMarkerType = theMarkerType;
20 myIndex = theScaleOrId;
23 Sample2D_Markers::Sample2D_Markers (const Quantity_Length theXPosition ,
24 const Quantity_Length theYPosition ,
25 const Handle(Graphic3d_ArrayOfPoints)& theArrayOfPoints,
26 const Aspect_TypeOfMarker theMarkerType,
27 const Quantity_Color theColor,
28 const Standard_Real theScaleOrId)
29 :AIS_InteractiveObject(),myArrayOfPoints (new Graphic3d_ArrayOfPoints (6))
31 myXPosition = theXPosition;
32 myYPosition = theYPosition;
33 myMarkerType = theMarkerType;
35 myIndex = theScaleOrId;
36 myArrayOfPoints = theArrayOfPoints;
40 void Sample2D_Markers::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
41 const Handle(Prs3d_Presentation)& aPresentation,
42 const Standard_Integer /*aMode*/)
44 if(myMarkerType == Aspect_TOM_USERDEFINED)
46 Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(Aspect_TOM_POINT,myColor,myIndex);
47 Prs3d_Root::CurrentGroup(aPresentation)->SetGroupPrimitivesAspect(aMarker);
48 Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (myArrayOfPoints);
52 Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(myMarkerType,myColor,myIndex);
53 Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect(aMarker);
54 Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
55 anArrayOfPoints->AddVertex (myXPosition, myYPosition, 0);
56 Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);