| 1 | // File: StdSelect_Shape.cxx |
| 2 | // Created: Fri Mar 27 14:53:29 1998 |
| 3 | // Author: Robert COUBLANC |
| 4 | // <rob@robox.paris1.matra-dtv.fr> |
| 5 | |
| 6 | |
| 7 | |
| 8 | #include <StdSelect_Shape.ixx> |
| 9 | #include <StdPrs_WFShape.hxx> |
| 10 | #include <Prs3d_LineAspect.hxx> |
| 11 | #include <Prs3d_PointAspect.hxx> |
| 12 | #include <Aspect_TypeOfMarker.hxx> |
| 13 | #include <Prs3d_PlaneAspect.hxx> |
| 14 | #include <Prs3d_Drawer.hxx> |
| 15 | #include <StdPrs_ShadedShape.hxx> |
| 16 | #include <TopAbs_ShapeEnum.hxx> |
| 17 | |
| 18 | StdSelect_Shape::StdSelect_Shape(const TopoDS_Shape& sh): |
| 19 | mysh(sh) |
| 20 | {} |
| 21 | |
| 22 | void StdSelect_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& PM, |
| 23 | const Handle(Prs3d_Presentation)& P, |
| 24 | const Standard_Integer aMode) |
| 25 | { |
| 26 | if(mysh.IsNull()) return; |
| 27 | |
| 28 | static Handle(Prs3d_Drawer) DRWR; |
| 29 | if(DRWR.IsNull()){ |
| 30 | DRWR = new Prs3d_Drawer(); |
| 31 | DRWR->WireAspect()->SetWidth(2); |
| 32 | DRWR->LineAspect()->SetWidth(2.); |
| 33 | DRWR->PlaneAspect()->EdgesAspect()->SetWidth(2.); |
| 34 | DRWR->FreeBoundaryAspect()->SetWidth(2.); |
| 35 | DRWR->UnFreeBoundaryAspect()->SetWidth(2.); |
| 36 | Standard_Integer I = 5;//pour tests... |
| 37 | DRWR->PointAspect()->SetTypeOfMarker((Aspect_TypeOfMarker)I); |
| 38 | DRWR->PointAspect()->SetScale(2.); |
| 39 | } |
| 40 | |
| 41 | Standard_Boolean CanShade = (mysh.ShapeType()<5 || mysh.ShapeType()==8); |
| 42 | if(aMode==1){ |
| 43 | if(CanShade) |
| 44 | StdPrs_ShadedShape::Add(P,mysh,DRWR); |
| 45 | else |
| 46 | StdPrs_WFShape::Add(P,mysh,DRWR); |
| 47 | } |
| 48 | else if (aMode==0) |
| 49 | StdPrs_WFShape::Add(P,mysh,DRWR); |
| 50 | } |
| 51 | |
| 52 | void StdSelect_Shape::Compute(const Handle_Prs3d_Projector& aProjector , |
| 53 | const Handle_Geom_Transformation& aGeomTrans, |
| 54 | const Handle_Prs3d_Presentation& aPresentation ) |
| 55 | { |
| 56 | PrsMgr_PresentableObject::Compute(aProjector,aGeomTrans,aPresentation); |
| 57 | } |
| 58 | |
| 59 | void StdSelect_Shape::Compute(const Handle_PrsMgr_PresentationManager2d& aPrsMgr, |
| 60 | const Handle_Graphic2d_GraphicObject& aGO, |
| 61 | const int anInt) |
| 62 | { |
| 63 | PrsMgr_PresentableObject::Compute(aPrsMgr,aGO,anInt); |
| 64 | } |
| 65 | |
| 66 | void StdSelect_Shape::Compute(const Handle_Prs3d_Projector& aProjector, |
| 67 | const Handle_Prs3d_Presentation& aPresentation) |
| 68 | { |
| 69 | PrsMgr_PresentableObject::Compute(aProjector,aPresentation); |
| 70 | } |