0023776: Redesign of MFC samples after V2d viewer removing
[occt.git] / samples / mfc / standard / Common / Primitive / Sample2D_Markers.cpp
CommitLineData
7fd59977 1#include "stdafx.h"
2
3#include "Sample2D_Markers.h"
4
5c1f974e 5IMPLEMENT_STANDARD_HANDLE(Sample2D_Markers,AIS_InteractiveObject)
6IMPLEMENT_STANDARD_RTTIEXT(Sample2D_Markers,AIS_InteractiveObject)
7fd59977 7
8// generic marker
5c1f974e 9Sample2D_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(),myListVertex(1,1)
7fd59977 15{
5c1f974e 16 myXPosition = theXPosition;
17 myYPosition = theYPosition;
18 myMarkerType = theMarkerType;
19 myColor = theColor;
20 myIndex = theScaleOrId;
7fd59977 21}
22
5c1f974e 23Sample2D_Markers::Sample2D_Markers (const Quantity_Length theXPosition ,
24 const Quantity_Length theYPosition ,
25 const Graphic3d_Array1OfVertex& theListVertex,
26 const Aspect_TypeOfMarker theMarkerType,
27 const Quantity_Color theColor,
28 const Standard_Real theScaleOrId)
29 :AIS_InteractiveObject(),myListVertex(1,6)
7fd59977 30{
5c1f974e 31 myXPosition = theXPosition;
32 myYPosition = theYPosition;
33 myMarkerType = theMarkerType;
34 myColor = theColor;
35 myIndex = theScaleOrId;
36 myListVertex = theListVertex;
7fd59977 37}
38
7fd59977 39
5c1f974e 40void Sample2D_Markers::Compute ( const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
41 const Handle(Prs3d_Presentation)& aPresentation,
42 const Standard_Integer aMode)
7fd59977 43{
5c1f974e 44 if(myMarkerType == Aspect_TOM_USERDEFINED)
45 {
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)->MarkerSet(myListVertex);
49 }
50 else
51 {
52 Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(myMarkerType,myColor,myIndex);
53 aPresentation->SetPrimitivesAspect(aMarker);
54 Graphic3d_Vertex aV3d(myXPosition, myYPosition, 0.);
55 Prs3d_Root::CurrentGroup(aPresentation)->Marker(aV3d);
56 }
7fd59977 57}