0023510: Integration of test grid "vis" into the new testing system
[occt.git] / src / Prs2d / Prs2d_Dimension.cxx
CommitLineData
b311480e 1// Copyright (c) 1999-2012 OPEN CASCADE SAS
2//
3// The content of this file is subject to the Open CASCADE Technology Public
4// License Version 6.5 (the "License"). You may not use the content of this file
5// except in compliance with the License. Please obtain a copy of the License
6// at http://www.opencascade.org and read it completely before using this file.
7//
8// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10//
11// The Original Code and all software distributed under the License is
12// distributed on an "AS IS" basis, without warranty of any kind, and the
13// Initial Developer hereby disclaims all such warranties, including without
14// limitation, any warranties of merchantability, fitness for a particular
15// purpose or non-infringement. Please see the License for the specific terms
16// and conditions governing the rights and limitations under the License.
17
7fd59977 18#include <Prs2d_Dimension.ixx>
19
20Prs2d_Dimension::Prs2d_Dimension( const Handle(Graphic2d_GraphicObject)& aGO,
21 const TCollection_ExtendedString& aText,
22 const Standard_Real aTxtScale,
23 const Standard_Real anArrAngle,
24 const Standard_Real anArrLength,
25 const Prs2d_TypeOfArrow anArrType,
26 const Prs2d_ArrowSide anArrow,
27 const Standard_Boolean IsRevArrow )
28 : Graphic2d_Line( aGO ),
29 myText( aText ),
30 myTextScale( aTxtScale ),
31 myTextFont( 0 ),
32 myTextPosH( 0 ),
33 myTextPosV( 0 ),
34 myTextAngle( 0 ),
35 myAbsX( 0 ),
36 myAbsY( 0 ),
37 myAbsAngle( 0 ),
38 mySymbFont( 0 ),
39 myXVert1( 1, 3 ),
40 myYVert1( 1, 3 ),
41 myXVert2( 1, 3 ),
42 myYVert2( 1, 3 ),
43 myArrType( anArrType ),
44 myArrow( anArrow ),
45 myArrowAng( anArrAngle ),
46 myArrowLen( anArrLength ),
47 myIsRevArr( IsRevArrow ),
48 myIsSymbol( Standard_False ),
49 mySymbCode( 248 )
50
51{
52}
53
54const Handle(TColgp_HArray1OfPnt2d) Prs2d_Dimension::ArrayOfFirstArrowPnt( ) const
55{
56 Handle(TColgp_HArray1OfPnt2d) points = new TColgp_HArray1OfPnt2d( 1, 3 );
57
58 for ( Standard_Integer i = 1; i <= 3; i++ )
59 {
60 points->SetValue( i, gp_Pnt2d( myXVert1(i), myYVert1(i) ) );
61 }
62 return points;
63}
64
65const Handle(TColgp_HArray1OfPnt2d) Prs2d_Dimension::ArrayOfSecondArrowPnt( ) const
66{
67 Handle(TColgp_HArray1OfPnt2d) points = new TColgp_HArray1OfPnt2d( 1, 3 );
68
69 for ( Standard_Integer i = 1; i <= 3; i++ )
70 {
71 points->SetValue( i, gp_Pnt2d( myXVert2(i), myYVert2(i) ) );
72 }
73 return points;
74}
75
76