Salome HOME
Merge from V6_main 11/02/2013
[modules/gui.git] / src / OCCViewer / OCCViewer_VService.h
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef OCCVIEWER_VSERVICE_H
24 #define OCCVIEWER_VSERVICE_H
25
26 #include <Handle_Aspect_Window.hxx>
27 #include <Handle_V3d_View.hxx>
28 #include <Handle_V3d_Viewer.hxx>
29 #include <Standard_Boolean.hxx>
30 #include <Standard_CString.hxx>
31 #include <Standard_ExtString.hxx>
32 #include <Standard_Integer.hxx>
33 #include <Quantity_Length.hxx>
34 #include <Xw_WindowQuality.hxx>
35 #include <V3d_TypeOfOrientation.hxx>
36
37 class Standard_EXPORT OCCViewer_VService
38 {
39 public:
40     inline void* operator new(size_t,void* anAddress)
41     {
42         return anAddress;
43     }
44     inline void* operator new(size_t size)
45     {
46         return Standard::Allocate(size);
47     }
48     inline void  operator delete(void *anAddress)
49     {
50         if ( anAddress ) Standard::Free((Standard_Address&)anAddress);
51     }
52
53     // STATIC METHODS
54     static Handle(Aspect_Window) 
55                     CreateWindow( const Handle(V3d_View)& view,
56                                   const Standard_Integer hiwin,
57                                   const Standard_Integer lowin,
58                                   const Xw_WindowQuality quality );
59
60     static void     SetWindow( const Handle(  V3d_View )& view,
61                                const Standard_Integer hiwin,
62                                const Standard_Integer lowin,
63                                const Xw_WindowQuality quality = Xw_WQ_3DQUALITY );
64
65     static void     SetMagnify( const Handle( V3d_View)& view,
66                                 const Standard_Integer hiwin,
67                                 const Standard_Integer lowin,
68                                 const Handle( V3d_View)& aPreviousView,
69                                 const Standard_Integer x1,
70                                 const Standard_Integer y1,
71                                 const Standard_Integer x2,
72                                 const Standard_Integer y2,
73                                 const Xw_WindowQuality quality = Xw_WQ_3DQUALITY );
74     static Handle_V3d_Viewer
75                     Viewer3d( const Standard_CString display,
76                               const Standard_ExtString name,
77                               const Standard_CString domain = "",
78                               const Quantity_Length ViewSize = 1000.0,
79                               const V3d_TypeOfOrientation ViewProj = V3d_XposYnegZpos,
80                               const Standard_Boolean ComputedMode = Standard_True,
81                               const Standard_Boolean DefaultComputedMode = Standard_True );
82 };
83
84 #endif