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