|
23 | 23 | Display3d::Display3d() |
24 | 24 | : myIsOffscreen(false) |
25 | 25 | { |
| 26 | + // Create graphic driver |
| 27 | + Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection(); |
| 28 | + if (GetGraphicDriver().IsNull()) |
| 29 | + { |
| 30 | + GetGraphicDriver() = new OpenGl_GraphicDriver (aDisplayConnection); |
| 31 | + } |
| 32 | + |
| 33 | + // Create V3dViewer and V3d_View |
| 34 | + myV3dViewer = new V3d_Viewer(GetGraphicDriver(), (short* const)"viewer"); |
| 35 | + |
| 36 | + // Create AISInteractiveViewer |
| 37 | + myAISContext = new AIS_InteractiveContext(myV3dViewer); |
| 38 | + |
| 39 | + // Create view |
| 40 | + myV3dView = myV3dViewer->CreateView(); |
26 | 41 | } |
27 | 42 |
|
28 | 43 | Display3d::~Display3d() |
@@ -110,7 +125,6 @@ Standard_Boolean Display3d::SetSize(int size_x, int size_y) |
110 | 125 | myWindow = new Cocoa_Window("Python OCC", |
111 | 126 | 0, 0, |
112 | 127 | size_x, size_y); |
113 | | - printf("Cocoa window created.\n"); |
114 | 128 | myWindow->SetVirtual (true); |
115 | 129 | #else |
116 | 130 | myWindow = new Xw_Window (myAISContext->CurrentViewer()->Driver()->GetDisplayConnection(), |
@@ -153,41 +167,17 @@ Standard_Boolean Display3d::GetImageData(const char* &data, size_t &size, const |
153 | 167 |
|
154 | 168 | void Display3d::Init(long window_handle) |
155 | 169 | { |
156 | | - printf(" ###### 3D rendering pipe initialisation #####\n"); |
157 | | - printf("Display3d class initialization starting ...\n"); |
158 | | - // Create graphic driver |
159 | | - Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection(); |
160 | | - printf("Aspect_DisplayConnection created.\n"); |
161 | | - if (GetGraphicDriver().IsNull()) |
162 | | - { |
163 | | - GetGraphicDriver() = new OpenGl_GraphicDriver (aDisplayConnection); |
164 | | - } |
165 | | - printf("Graphic_Driver created.\n"); |
166 | | - // Create V3dViewer and V3d_View |
167 | | - myV3dViewer = new V3d_Viewer(GetGraphicDriver(), (short* const)"viewer"); |
168 | | - printf("V3d_Viewer created.\n"); |
169 | | - // Create AISInteractiveViewer |
170 | | - myAISContext = new AIS_InteractiveContext(myV3dViewer); |
171 | | - printf("AIS_InteractiveContext created.\n"); |
172 | | - // Create view |
173 | | - myV3dView = myV3dViewer->CreateView(); |
174 | | - printf("V3d_View created\n"); |
175 | 170 | // Create Graphic Window |
176 | 171 | #ifdef WNT |
177 | 172 | myWindow = new WNT_Window((Aspect_Handle) window_handle); |
178 | | - printf("WNT window created.\n"); |
179 | 173 | #elif defined(__APPLE__) && !defined(MACOSX_USE_GLX) |
180 | 174 | myWindow = new Cocoa_Window((NSView *) window_handle); |
181 | | - printf("Cocoa window created.\n"); |
182 | 175 | #else |
183 | 176 | myWindow = new Xw_Window(myAISContext->CurrentViewer()->Driver()->GetDisplayConnection(), |
184 | 177 | (Aspect_Handle) window_handle); |
185 | | - printf("Xw_Window created.\n"); |
186 | 178 | #endif |
187 | 179 | myV3dView->SetWindow(myWindow); |
188 | 180 | if (!myWindow->IsMapped()) myWindow->Map(); |
189 | | - printf("Display3d class successfully initialized.\n"); |
190 | | - printf(" ########################################\n"); |
191 | 181 | } |
192 | 182 |
|
193 | 183 | void Display3d::ChangeRenderingParams(int Method, |
|
0 commit comments