1 // Created on: 2008-04-17
2 // Created by: Customer Support
3 // Copyright (c) 2008-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #include <Aspect_Window.hxx>
18 #include <Font_NameOfFont.hxx>
19 #include <Standard_Type.hxx>
20 #include <V3d_LayerMgr.hxx>
21 #include <V3d_View.hxx>
22 #include <Visual3d_Layer.hxx>
23 #include <Visual3d_View.hxx>
25 V3d_LayerMgr::V3d_LayerMgr( const Handle(V3d_View)& AView )
26 : myView(AView.operator->())
28 Handle(Visual3d_View) theView = View()->View();
29 if ( !theView.IsNull() ) {
30 Handle(Visual3d_ViewManager) theViewMgr = theView->ViewManager();
31 if ( !theViewMgr.IsNull() ) {
32 V3d_LayerMgr* that = (V3d_LayerMgr*)this;
33 that->myOverlay = new Visual3d_Layer( theViewMgr, Aspect_TOL_OVERLAY, Standard_False );
38 void V3d_LayerMgr::Compute()
47 void V3d_LayerMgr::Resized()
52 Standard_Boolean V3d_LayerMgr::Begin()
54 if ( myOverlay.IsNull() )
55 return Standard_False;
57 const Handle(Aspect_Window) &theWin = View()->Window();
58 if ( theWin.IsNull() )
59 return Standard_False;
61 Standard_Integer aW( 0 ), aH( 0 );
62 theWin->Size( aW, aH );
65 myOverlay->SetViewport( aW, aH ); //szv:!!!
67 myOverlay->SetTextAttributes( Font_NOF_ASCII_MONO, Aspect_TODT_NORMAL, Quantity_Color() );
68 myOverlay->SetOrtho( 0, Max( aW, aH ), Max( aW, aH ), 0, Aspect_TOC_TOP_LEFT );
73 void V3d_LayerMgr::Redraw()
78 void V3d_LayerMgr::End()
80 if ( !myOverlay.IsNull() )