0031425: Visualization - free Edge has selection sensitivity inconsistent to presentation
[occt.git] / src / StdPrs / StdPrs_BndBox.cxx
CommitLineData
5ad8c033 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 <StdPrs_BndBox.hxx>
17
5ad8c033 18#include <Prs3d_LineAspect.hxx>
5ad8c033 19
20//=======================================================================
21//function : Add
22//purpose :
23//=======================================================================
24void StdPrs_BndBox::Add (const Handle(Prs3d_Presentation)& thePresentation,
25 const Bnd_Box& theBndBox,
26 const Handle(Prs3d_Drawer)& theDrawer)
27{
c3749171 28 if (!theBndBox.IsVoid())
5ad8c033 29 {
c3749171 30 Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePresentation);
31 aGroup->SetGroupPrimitivesAspect (new Graphic3d_AspectLine3d (theDrawer->LineAspect()->Aspect()->Color(),
32 Aspect_TOL_DOTDASH,
33 theDrawer->LineAspect()->Aspect()->Width()));
34 aGroup->AddPrimitiveArray (FillSegments (theBndBox));
5ad8c033 35 }
c3749171 36}
5ad8c033 37
c3749171 38//=======================================================================
39//function : Add
40//purpose :
41//=======================================================================
42void StdPrs_BndBox::Add (const Handle(Prs3d_Presentation)& thePresentation,
43 const Bnd_OBB& theBndBox,
44 const Handle(Prs3d_Drawer)& theDrawer)
45{
46 if (!theBndBox.IsVoid())
5ad8c033 47 {
c3749171 48 Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePresentation);
49 aGroup->SetGroupPrimitivesAspect (new Graphic3d_AspectLine3d (theDrawer->LineAspect()->Aspect()->Color(),
50 Aspect_TOL_DOTDASH,
51 theDrawer->LineAspect()->Aspect()->Width()));
52 aGroup->AddPrimitiveArray (FillSegments (theBndBox));
5ad8c033 53 }
5ad8c033 54}