summaryrefslogtreecommitdiff
path: root/src/Graphic2d/Graphic2d_VectorialMarker.cxx
blob: 2ae46eeab0ff4bd004c4ec9ef1fd3bdd58150b99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <Graphic2d_VectorialMarker.ixx>

Graphic2d_VectorialMarker::Graphic2d_VectorialMarker (const Handle(Graphic2d_GraphicObject)& aGraphicObject, const Quantity_Length aXPosition, const Quantity_Length aYPosition)

	:Graphic2d_Line (aGraphicObject),
	 myXPosition (Standard_ShortReal (aXPosition)),
	 myYPosition (Standard_ShortReal (aYPosition)) {

	SetFamily(Graphic2d_TOP_MARKER);
}

void Graphic2d_VectorialMarker::SetPosition (const Quantity_Length aXPosition, const Quantity_Length aYPosition) { 

	myXPosition	= Standard_ShortReal (aXPosition);
	myYPosition	= Standard_ShortReal (aYPosition);
	ResetIndex ();

}

Quantity_Length Graphic2d_VectorialMarker::XPosition () const {

Standard_Real X = Standard_Real (myXPosition);
Standard_Real Y = Standard_Real (myYPosition);

	if (myGOPtr->IsTransformed ()) {
gp_GTrsf2d aTrsf = myGOPtr->Transform ();
		aTrsf.Transforms (X, Y);
	}

	return Quantity_Length (X);

}

Quantity_Length Graphic2d_VectorialMarker::YPosition () const {

Standard_Real X = Standard_Real (myXPosition);
Standard_Real Y = Standard_Real (myYPosition);

	if (myGOPtr->IsTransformed ()) {
gp_GTrsf2d aTrsf = myGOPtr->Transform ();
		aTrsf.Transforms (X, Y);
	}

	return Quantity_Length (Y);

}