1 #include <Prs2d_LineProfile.ixx>
3 Prs2d_LineProfile::Prs2d_LineProfile( const Handle(Graphic2d_GraphicObject)& aGO,
4 const Standard_Real aX,
5 const Standard_Real aY,
6 const Standard_Real aLength,
7 const Standard_Real anAngle )
9 : Prs2d_Tolerance( aGO,aX, aY, aLength, anAngle )
13 void Prs2d_LineProfile::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) {
15 Standard_Boolean IsIn = Standard_False;
17 if ( !myGOPtr->IsTransformed() )
18 IsIn = aDrawer->IsIn( myMinX, myMaxX, myMinY, myMaxY );
20 Standard_ShortReal minx, miny, maxx, maxy;
21 MinMax( minx, maxx, miny, maxy );
22 IsIn = aDrawer->IsIn( minx, maxx, miny, maxy );
26 DrawLineAttrib( aDrawer );
27 Standard_ShortReal X1 = myX,
28 Y1 = myY - myLength/4;
30 gp_Pnt2d P1( X1, Y1 ),
32 P1.Rotate( PR, myAngle );
34 X1 = Standard_ShortReal( P1.X() );
35 Y1 = Standard_ShortReal( P1.Y() );
37 if ( myGOPtr->IsTransformed () ) {
38 gp_GTrsf2d aTrsf = myGOPtr->Transform ();
42 aTrsf.Transforms( a1, b1 );
43 X1 = Standard_ShortReal( a1 );
44 Y1 = Standard_ShortReal( b1 );
47 aDrawer->MapArcFromTo( X1, Y1, myLength/2, myAngle, Standard_ShortReal( M_PI + myAngle ) );
51 void Prs2d_LineProfile::Save(Aspect_FStream& aFStream) const