1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
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.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
16 #include <Graphic3d_AspectLine3d.hxx>
17 #include <Prs3d_ArrowAspect.hxx>
18 #include <Prs3d_InvalidAngle.hxx>
19 #include <Quantity_Color.hxx>
20 #include <Standard_Type.hxx>
22 Prs3d_ArrowAspect::Prs3d_ArrowAspect ()
23 : myAngle(M_PI/180.*10), myLength(1.) {
25 new Graphic3d_AspectLine3d (
26 Quantity_Color(Quantity_NOC_WHITE), Aspect_TOL_SOLID, 1.0);
30 Prs3d_ArrowAspect::Prs3d_ArrowAspect (const Quantity_PlaneAngle anAngle,
31 const Quantity_Length aLength)
32 : myAngle(anAngle), myLength(aLength) {
34 new Graphic3d_AspectLine3d (
35 Quantity_Color(Quantity_NOC_WHITE), Aspect_TOL_SOLID, 1.0);
38 Prs3d_ArrowAspect::Prs3d_ArrowAspect( const Handle( Graphic3d_AspectLine3d )& theAspect )
39 : myAngle(M_PI/180.*10), myLength(1.)
41 myArrowAspect = theAspect;
44 void Prs3d_ArrowAspect::SetAngle ( const Quantity_PlaneAngle anAngle) {
45 Prs3d_InvalidAngle_Raise_if ( anAngle <= 0. ||
46 anAngle >= M_PI /2. , "");
49 Quantity_PlaneAngle Prs3d_ArrowAspect::Angle () const
54 void Prs3d_ArrowAspect::SetLength ( const Quantity_Length aLength)
58 Quantity_Length Prs3d_ArrowAspect::Length () const
64 void Prs3d_ArrowAspect::SetColor(const Quantity_Color &aColor) {
65 myArrowAspect->SetColor(aColor);
68 void Prs3d_ArrowAspect::SetColor(const Quantity_NameOfColor aColor) {
69 SetColor(Quantity_Color(aColor));
72 Handle(Graphic3d_AspectLine3d) Prs3d_ArrowAspect::Aspect() const {
77 void Prs3d_ArrowAspect::SetAspect( const Handle( Graphic3d_AspectLine3d )& theAspect )
79 myArrowAspect = theAspect;