Salome HOME
Update from BR_V5_DEV 13Feb2009
[modules/gui.git] / src / OCCViewer / OCCViewer_VService.h
1 //  Copyright (C) 2007-2008  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 #ifndef OCCVIEWER_VSERVICE_H
23 #define OCCVIEWER_VSERVICE_H
24
25 #ifndef _Handle_V3d_View_HeaderFile
26 #include <Handle_V3d_View.hxx>
27 #endif
28 #ifndef _Standard_Integer_HeaderFile
29 #include <Standard_Integer.hxx>
30 #endif
31 #ifndef _Xw_WindowQuality_HeaderFile
32 #include <Xw_WindowQuality.hxx>
33 #endif
34 #ifndef _Handle_V3d_Viewer_HeaderFile
35 #include <Handle_V3d_Viewer.hxx>
36 #endif
37 #ifndef _Standard_CString_HeaderFile
38 #include <Standard_CString.hxx>
39 #endif
40 #ifndef _Standard_ExtString_HeaderFile
41 #include <Standard_ExtString.hxx>
42 #endif
43 #ifndef _Quantity_Length_HeaderFile
44 #include <Quantity_Length.hxx>
45 #endif
46 #ifndef _Quantity_NameOfColor_HeaderFile
47 #include <Quantity_NameOfColor.hxx>
48 #endif
49 #ifndef _V3d_TypeOfOrientation_HeaderFile
50 #include <V3d_TypeOfOrientation.hxx>
51 #endif
52 #ifndef _Standard_Boolean_HeaderFile
53 #include <Standard_Boolean.hxx>
54 #endif
55 #ifndef _Handle_Graphic2d_View_HeaderFile
56 #include <Handle_Graphic2d_View.hxx>
57 #endif
58 #ifndef _Handle_Aspect_WindowDriver_HeaderFile
59 #include <Handle_Aspect_WindowDriver.hxx>
60 #endif
61
62 class V3d_View;
63 class V2d_View;
64 class V3d_Viewer;
65 class V2d_Viewer;
66 class Graphic2d_View;
67 class Aspect_WindowDriver;
68
69 #ifndef _Standard_HeaderFile
70 #include <Standard.hxx>
71 #endif
72 #ifndef _Standard_Macro_HeaderFile
73 #include <Standard_Macro.hxx>
74 #endif
75
76 class Standard_EXPORT OCCViewer_VService
77 {
78 public:
79     inline void* operator new(size_t,void* anAddress)
80     {
81         return anAddress;
82     }
83     inline void* operator new(size_t size)
84     {
85         return Standard::Allocate(size);
86     }
87     inline void  operator delete(void *anAddress)
88     {
89         if ( anAddress ) Standard::Free((Standard_Address&)anAddress);
90     }
91
92     // STATIC METHODS
93     static void     SetWindow( const Handle(  V3d_View )& view,
94                                const Standard_Integer hiwin,
95                                const Standard_Integer lowin,
96                                const Xw_WindowQuality quality = Xw_WQ_3DQUALITY );
97
98     static void     SetMagnify( const Handle( V3d_View)& view,
99                                 const Standard_Integer hiwin,
100                                 const Standard_Integer lowin,
101                                 const Handle( V3d_View)& aPreviousView,
102                                 const Standard_Integer x1,
103                                 const Standard_Integer y1,
104                                 const Standard_Integer x2,
105                                 const Standard_Integer y2,
106                                 const Xw_WindowQuality quality = Xw_WQ_3DQUALITY );
107     static Handle_V3d_Viewer
108                     Viewer3d( const Standard_CString display,
109                               const Standard_ExtString name,
110                               const Standard_CString domain = "",
111                               const Quantity_Length ViewSize = 1000.0,
112                               const V3d_TypeOfOrientation ViewProj = V3d_XposYnegZpos,
113                               const Standard_Boolean ComputedMode = Standard_True,
114                               const Standard_Boolean DefaultComputedMode = Standard_True );
115
116     static Handle_Aspect_WindowDriver
117                     WindowDriver( const Standard_CString display,
118                                   const Standard_Integer hiwin,
119                                   const Standard_Integer lowin,
120                                   const Quantity_NameOfColor color = Quantity_NOC_GRAY69 );
121     /*static Handle_Aspect_WindowDriver
122                     XdpsDriver( const Standard_CString display,
123                                 const Standard_Integer hiwin,
124                                 const Standard_Integer lowin,
125                                 const Quantity_NameOfColor color = Quantity_NOC_GRAY69 );
126     */
127     static Handle_Aspect_WindowDriver
128                     ImageDriver( const Standard_CString display,
129                                  const Standard_Integer hiwin,
130                                  const Standard_Integer lowin,
131                                  const Quantity_NameOfColor color = Quantity_NOC_GRAY69 );
132
133 };
134
135 #endif