0028162: Draw Harness - eliminate usage of deprecated Local Context
[occt.git] / src / StdSelect / StdSelect_Shape.cxx
CommitLineData
b311480e 1// Created on: 1998-03-27
2// Created by: Robert COUBLANC
3// Copyright (c) 1998-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
7f917335 17
42cf5bc1 18#include <Geom_Transformation.hxx>
7fd59977 19#include <Prs3d_Drawer.hxx>
42cf5bc1 20#include <Prs3d_Presentation.hxx>
21#include <Prs3d_Projector.hxx>
22#include <Standard_Type.hxx>
5ad8c033 23#include <StdPrs_WFShape.hxx>
7fd59977 24#include <StdPrs_ShadedShape.hxx>
42cf5bc1 25#include <StdSelect_Shape.hxx>
7fd59977 26#include <TopAbs_ShapeEnum.hxx>
42cf5bc1 27#include <TopoDS_Shape.hxx>
7fd59977 28
92efcf78 29IMPLEMENT_STANDARD_RTTIEXT(StdSelect_Shape,PrsMgr_PresentableObject)
30
7f917335 31StdSelect_Shape::StdSelect_Shape (const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer):
32 mysh (theShape),
33 myDrawer (theDrawer)
7fd59977 34{}
7f917335 35
35e08fe8 36void StdSelect_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*PM*/,
7fd59977 37 const Handle(Prs3d_Presentation)& P,
38 const Standard_Integer aMode)
39{
7f917335 40 if(mysh.IsNull())
41 {
42 return;
7fd59977 43 }
7f917335 44
7fd59977 45 Standard_Boolean CanShade = (mysh.ShapeType()<5 || mysh.ShapeType()==8);
46 if(aMode==1){
47 if(CanShade)
7f917335 48 StdPrs_ShadedShape::Add (P, mysh, myDrawer);
7fd59977 49 else
5ad8c033 50 StdPrs_WFShape::Add (P, mysh, myDrawer);
7fd59977 51 }
52 else if (aMode==0)
5ad8c033 53 StdPrs_WFShape::Add (P, mysh, myDrawer);
7fd59977 54}
55
857ffd5e 56void StdSelect_Shape::Compute(const Handle(Prs3d_Projector)& aProjector ,
57 const Handle(Geom_Transformation)& aGeomTrans,
58 const Handle(Prs3d_Presentation)& aPresentation )
7fd59977 59{
60 PrsMgr_PresentableObject::Compute(aProjector,aGeomTrans,aPresentation);
61}
62
7fd59977 63
857ffd5e 64void StdSelect_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
65 const Handle(Prs3d_Presentation)& aPresentation)
7fd59977 66{
67 PrsMgr_PresentableObject::Compute(aProjector,aPresentation);
68}