1f63561914da6f70a810f8e427b55f38208932df
[occt.git] / src / Prs3d / Prs3d_ArrowAspect.cxx
1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 #include <Prs3d_ArrowAspect.ixx>
16
17 Prs3d_ArrowAspect::Prs3d_ArrowAspect () 
18      : myAngle(M_PI/180.*10), myLength(1.) {
19   myArrowAspect = 
20         new Graphic3d_AspectLine3d (
21                 Quantity_Color(Quantity_NOC_WHITE), Aspect_TOL_SOLID, 1.0);
22 }
23
24
25 Prs3d_ArrowAspect::Prs3d_ArrowAspect (const Quantity_PlaneAngle anAngle,
26                                       const Quantity_Length aLength) 
27      : myAngle(anAngle), myLength(aLength) {
28   myArrowAspect = 
29         new Graphic3d_AspectLine3d (
30                 Quantity_Color(Quantity_NOC_WHITE), Aspect_TOL_SOLID, 1.0);
31 }
32
33 void Prs3d_ArrowAspect::SetAngle ( const Quantity_PlaneAngle anAngle) {
34   Prs3d_InvalidAngle_Raise_if ( anAngle <= 0.  ||
35                               anAngle >= M_PI /2. , "");
36   myAngle = anAngle;
37 }
38 Quantity_PlaneAngle Prs3d_ArrowAspect::Angle () const
39 {
40 return myAngle;
41 }
42
43 void Prs3d_ArrowAspect::SetLength ( const Quantity_Length aLength)
44 {
45   myLength = aLength;
46 }
47 Quantity_Length Prs3d_ArrowAspect::Length () const
48 {
49 return myLength;
50 }
51
52 void Prs3d_ArrowAspect::SetColor(const Quantity_Color &aColor) {
53   myArrowAspect->SetColor(aColor);
54 }
55
56 void Prs3d_ArrowAspect::SetColor(const Quantity_NameOfColor aColor) {
57   SetColor(Quantity_Color(aColor));
58 }
59
60 Handle(Graphic3d_AspectLine3d) Prs3d_ArrowAspect::Aspect() const {
61   return myArrowAspect;
62 }