Integration of OCCT 6.5.0 from SVN
[occt.git] / samples / java / src / ISession / ISession_Surface.cxx
1 #include <ISession_Surface.ixx>
2 #include <AIS_InteractiveObject.hxx>
3 #include <GeomAdaptor_Surface.hxx>
4 #include <GeomAdaptor_HSurface.hxx>
5 #include <AIS_Drawer.hxx>
6 #include <Prs3d_LineAspect.hxx>
7 #include <StdPrs_ShadedSurface.hxx>
8 #include <StdPrs_WFPoleSurface.hxx>
9 #include <StdPrs_WFSurface.hxx>
10
11
12 ISession_Surface::ISession_Surface()
13 {
14 }
15
16 ISession_Surface::ISession_Surface(const Handle(Geom_Surface)& aSurface)
17      :AIS_InteractiveObject(),mySurface(aSurface)
18 {
19 }
20
21  void ISession_Surface::Compute(const Handle(PrsMgr_PresentationManager3d)& ,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode) 
22 {
23   GeomAdaptor_Surface anAdaptorSurface(mySurface);
24   Handle(GeomAdaptor_HSurface) anAdaptorHSurface = new GeomAdaptor_HSurface(mySurface);
25   
26   Handle(AIS_Drawer) aDrawer = new AIS_Drawer();
27   aDrawer->LineAspect()->SetColor(Quantity_NOC_YELLOW3);
28   
29   switch (aMode)
30   {
31     case 2:
32       StdPrs_ShadedSurface::Add(aPresentation,anAdaptorSurface,myDrawer);
33       break;
34     case 1 :
35       StdPrs_WFPoleSurface::Add(aPresentation,anAdaptorSurface,aDrawer);
36     case 0 :
37       StdPrs_WFSurface::Add(aPresentation,anAdaptorHSurface,myDrawer);
38       break;
39   }
40 }
41
42  void ISession_Surface::Compute(const Handle(Prs3d_Projector)& ,const Handle(Prs3d_Presentation)& ) 
43 {
44 }
45
46  void ISession_Surface::ComputeSelection(const Handle(SelectMgr_Selection)& ,const Standard_Integer ) 
47 {
48 }
49