0028990: Coding Rules - deprecate redundant class Prs3d_Root
[occt.git] / src / Prs3d / Prs3d_BndBox.cxx
1 // Created on: 2014-10-14
2 // Created by: Anton POLETAEV
3 // Copyright (c) 2013-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #include <Prs3d_BndBox.hxx>
17
18 #include <Prs3d_LineAspect.hxx>
19
20 //=======================================================================
21 //function : Add
22 //purpose  :
23 //=======================================================================
24 void Prs3d_BndBox::Add (const Handle(Prs3d_Presentation)& thePresentation,
25                         const Bnd_Box&                    theBndBox,
26                         const Handle(Prs3d_Drawer)&       theDrawer)
27 {
28   if (!theBndBox.IsVoid())
29   {
30     Handle(Graphic3d_Group) aGroup = thePresentation->CurrentGroup();
31     aGroup->SetGroupPrimitivesAspect (new Graphic3d_AspectLine3d (theDrawer->LineAspect()->Aspect()->Color(),
32                                                                   Aspect_TOL_DOTDASH,
33                                                                   theDrawer->LineAspect()->Aspect()->Width()));
34     aGroup->AddPrimitiveArray (FillSegments (theBndBox));
35   }
36 }
37
38 //=======================================================================
39 //function : Add
40 //purpose  :
41 //=======================================================================
42 void Prs3d_BndBox::Add (const Handle(Prs3d_Presentation)& thePresentation,
43                         const Bnd_OBB&                    theBndBox,
44                         const Handle(Prs3d_Drawer)&       theDrawer)
45 {
46   if (!theBndBox.IsVoid())
47   {
48     Handle(Graphic3d_Group) aGroup = thePresentation->CurrentGroup();
49     aGroup->SetGroupPrimitivesAspect (new Graphic3d_AspectLine3d (theDrawer->LineAspect()->Aspect()->Color(),
50                                                                   Aspect_TOL_DOTDASH,
51                                                                   theDrawer->LineAspect()->Aspect()->Width()));
52     aGroup->AddPrimitiveArray (FillSegments (theBndBox));
53   }
54 }