b311480e |
1 | // Created on: 1992-04-07 |
2 | // Created by: Remi LEQUETTE |
3 | // Copyright (c) 1992-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | // JR 21 Oct 1999 : Change for Draw_Init_Appli which is in main and is |
18 | // called from Draw ===> undefined symbol on UNIX |
19 | // ===> duplication of code on NT : |
20 | // One argument added to DrawAppli : Draw_Init_Appli ===> |
21 | // Draw_Appli of Draw/TKDraw may call Draw_Init_Appli |
22 | |
23 | #ifndef Draw_Appli_HeaderFile |
24 | #define Draw_Appli_HeaderFile |
25 | |
26 | |
27 | #include <Draw_Viewer.hxx> |
28 | #include <Draw.hxx> |
29 | |
30 | typedef void (*FDraw_InitAppli)(Draw_Interpretor&); |
31 | |
57c28b61 |
32 | #ifdef _WIN32 |
7fd59977 |
33 | #include <windows.h> |
34 | //extern void Draw_Appli(HINSTANCE,HINSTANCE,LPSTR,int); |
35 | Standard_EXPORT void Draw_Appli(HINSTANCE,HINSTANCE,LPSTR,int, |
36 | const FDraw_InitAppli Draw_InitAppli); |
37 | #else |
38 | extern void Draw_Appli(Standard_Integer argc, char** argv, |
39 | const FDraw_InitAppli Draw_InitAppli); |
40 | #endif |
41 | |
42 | |
43 | |
57c28b61 |
44 | #if defined(_WIN32) && !defined(HAVE_NO_DLL) |
7fd59977 |
45 | #ifndef __Draw_API |
46 | # ifdef __Draw_DLL |
47 | # define __Draw_API __declspec ( dllexport ) |
48 | # else |
49 | # define __Draw_API __declspec ( dllimport ) |
50 | # endif |
51 | #endif |
52 | #else |
53 | # define __Draw_API |
54 | #endif |
55 | |
56 | |
57c28b61 |
57 | #ifndef _WIN32 |
7fd59977 |
58 | extern Draw_Viewer dout; |
59 | extern Standard_Boolean Draw_Batch; |
60 | #endif |
61 | |
7fd59977 |
62 | class Draw_SaveAndRestore { |
63 | |
64 | public : |
65 | |
66 | // __Draw_API Draw_SaveAndRestore |
67 | Standard_EXPORT Draw_SaveAndRestore |
68 | (const char* name, |
69 | Standard_Boolean (*test)(const Handle(Draw_Drawable3D)&), |
70 | void (*save)(const Handle(Draw_Drawable3D)&, ostream&), |
71 | Handle(Draw_Drawable3D) (*restore) (istream&), |
72 | Standard_Boolean display = Standard_True); |
73 | |
74 | |
75 | const char* Name() const {return myName;} |
76 | Standard_Boolean Test(const Handle(Draw_Drawable3D)&d); |
77 | void Save(const Handle(Draw_Drawable3D)& d, ostream& os) const; |
78 | Handle(Draw_Drawable3D) Restore(istream&) const; |
79 | Standard_Boolean Disp() const {return myDisplay;} |
80 | Draw_SaveAndRestore* Next() {return myNext;} |
81 | |
82 | private : |
83 | |
84 | const char* myName; |
85 | Standard_Boolean (*myTest)(const Handle(Draw_Drawable3D)&); |
86 | void (*mySave)(const Handle(Draw_Drawable3D)&, ostream&); |
87 | Handle(Draw_Drawable3D) (*myRestore) (istream&); |
88 | Standard_Boolean myDisplay; |
89 | Draw_SaveAndRestore* myNext; |
90 | |
91 | }; |
92 | |
93 | #endif |
94 | |
95 | |
96 | |