# include <strings.h>
#endif
-
-#include <Draw_WindowBase.hxx>
-#include <X11/XWDFile.h>
-
#include <stdio.h>
#include <tk.h>
static unsigned long thePixels[MAXCOLOR];
-
-Display* Draw_WindowDisplay = NULL;
Standard_Integer Draw_WindowScreen = 0;
-Colormap Draw_WindowColorMap;
Standard_Boolean Draw_BlackBackGround = Standard_True;
// X11 specific part
#if !defined(__APPLE__) || defined(MACOSX_USE_GLX)
+#include <X11/Xutil.h>
#include <Aspect_DisplayConnection.hxx>
+Display* Draw_WindowDisplay = NULL;
+Colormap Draw_WindowColorMap;
static Handle(Aspect_DisplayConnection) Draw_DisplayConnection;
+// Base_Window struct definition
+//===================================
+struct Base_Window
+{
+ GC gc;
+ XSetWindowAttributes xswa;
+};
+
//=======================================================================
//function : Draw_Window
//purpose :
//=======================================================================
void Draw_Window::Destroy()
{
+ XFreeGC (Draw_WindowDisplay, base.gc);
XDestroyWindow(Draw_WindowDisplay, win);
win = 0;
if (myBuffer != 0)
+++ /dev/null
-// Created on: 1995-03-17
-// Created by: Remi LEQUETTE
-// Copyright (c) 1995-1999 Matra Datavision
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
-//
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
-//
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
-//
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
-
-
-
-#ifndef _Draw_WindowBase_HeaderFile
-#define _Draw_WindowBase_HeaderFile
-
-#ifndef WNT
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#include <X11/Xutil.h>
-#endif
-
-// Definition de la class Base_Window
-//===================================
-struct Base_Window
-{
- GC gc;
- XSetWindowAttributes xswa;
-};
-
-
-#endif
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
-#if defined(WNT)
-#include <windows.h>
-#endif
#include <QADraw.hxx>
#include <QADraw_DataMapOfAsciiStringOfAddress.hxx>
#include <Draw_Interpretor.hxx>
#include <stdio.h>
#include <Aspect_DisplayConnection.hxx>
#include <Graphic3d.hxx>
+#include <Aspect_Window.hxx>
-#if ! defined(WNT)
-#include <Xw_Window.hxx>
-//#include <Xm/Xm.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <Xw_Cextern.hxx>
-#include <unistd.h>
+#if defined(_WIN32) || defined(__WIN32__)
+# include <windows.h>
+# include <io.h>
#else
-#include <WNT.h>
-#include <WNT_Window.hxx>
-#include <io.h>
+# include <unistd.h>
#endif
#include <tcl.h>
return 0;
}
-static Standard_Integer QAAISGetColorCoord (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
-#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
- if ( argc > 1 ) {
- di << "Usage : " << argv[0] << "\n";
- return 1;
- }
- Handle(Xw_Window) QAAISWindow;
-
- Handle (V3d_View) QAAIS_MainView = ViewerTest::CurrentView ();
- if ( QAAIS_MainView.IsNull () ) {
- di << "You must initialize AISViewer before this command." << "\n";
- return 1;
- }
- QAAISWindow = Handle(Xw_Window)::DownCast (QAAIS_MainView->V3d_View::Window());
-
- Standard_Integer QAAIS_WindowSize_X = 0;
- Standard_Integer QAAIS_WindowSize_Y = 0;
- QAAISWindow->Size(QAAIS_WindowSize_X, QAAIS_WindowSize_Y);
- Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection();
- Handle(Graphic3d_GraphicDriver) aGraphicDriver = Graphic3d::InitGraphicDriver (aDisplayConnection);
-
- Draw_Window QAAIS_CoordWindow ("coordinate", 421, 205, 200, 60);
- QAAIS_CoordWindow.DisplayWindow ();
- QAAIS_CoordWindow.SetColor (12);
-
- Handle (Xw_Window) QAAIS_ColorWindow = new Xw_Window (aDisplayConnection, "color", 0.4074, 0.678, 0.1962, 0.06, Quantity_NOC_BLACK);
- Handle (V3d_Viewer) QAAIS_ColorViewer = new V3d_Viewer (aGraphicDriver, Standard_ExtString ("COLOR"));
- Handle (V3d_View) QAAIS_ColorView = QAAIS_ColorViewer -> CreateView ();
- QAAIS_ColorWindow -> Map ();
- QAAIS_ColorView -> SetWindow (QAAIS_ColorWindow);
- QAAIS_ColorView -> SetBackgroundColor (Quantity_NOC_BLACK);
- QAAIS_ColorView -> Redraw ();
-
- Standard_Integer QAAIS_MousePoint_X = 0;
- Standard_Integer QAAIS_MousePoint_Y = 0;
- Standard_Character QAAIS_MousePointX[32];
- Sprintf (QAAIS_MousePointX, "X : %d", QAAIS_MousePoint_X);
- Standard_Character QAAIS_MousePointY[32];
- Sprintf (QAAIS_MousePointY, "Y : %d", QAAIS_MousePoint_Y);
- Standard_ShortReal QAAIS_ColorRED = 0;
- Standard_ShortReal QAAIS_ColorGRN = 0;
- Standard_ShortReal QAAIS_ColorBLU = 0;
- Quantity_Color QAAIS_ShowingColor;
- QAAIS_ShowingColor.SetValues (QAAIS_ColorRED, QAAIS_ColorGRN, QAAIS_ColorBLU, Quantity_TOC_RGB);
- Standard_Integer argccc = 5;
- const char *bufff[] = { "A", "B", "C", "D", "E" };
- const char **argvvv = (const char **) bufff;
- while (ViewerMainLoop (argccc, argvvv)) {
- Handle(TColStd_HSequenceOfReal) aSeq;
- Image_PixMap anImage;
-
- ViewerTest::GetMousePosition (QAAIS_MousePoint_X, QAAIS_MousePoint_Y);
- Handle (V3d_View) QAAIS_MainView = ViewerTest::CurrentView();
- QAAIS_MainView->ToPixMap (anImage, QAAIS_WindowSize_X, QAAIS_WindowSize_Y);
-
- aSeq = GetColorOfPixel (anImage, QAAIS_MousePoint_X, QAAIS_MousePoint_Y, 0);
-
- QAAIS_ColorRED = aSeq->Value(1);
- QAAIS_ColorGRN = aSeq->Value(2);
- QAAIS_ColorBLU = aSeq->Value(3);
- QAAIS_ShowingColor.SetValues (QAAIS_ColorRED, QAAIS_ColorGRN, QAAIS_ColorBLU, Quantity_TOC_RGB);
- QAAIS_ColorView -> SetBackgroundColor (QAAIS_ShowingColor);
- QAAIS_ColorView -> Redraw ();
- QAAIS_CoordWindow.Clear();
- Sprintf (QAAIS_MousePointX, "X : %d", QAAIS_MousePoint_X);
- Sprintf (QAAIS_MousePointY, "Y : %d", QAAIS_MousePoint_Y);
- QAAIS_CoordWindow.DrawString (30, 35, QAAIS_MousePointX);
- QAAIS_CoordWindow.DrawString (125, 35, QAAIS_MousePointY);
- }
- QAAIS_CoordWindow.Destroy ();
-#endif //WNT
- return 0;
-}
-
//==============================================================================
// VIEWER GLOBALs
//==============================================================================
#ifndef WNT
extern Draw_Viewer dout;
-extern Display* Draw_WindowDisplay;
-extern Colormap Draw_WindowColorMap;
#else
Standard_IMPORT Draw_Viewer dout;
#endif
theCommands.Add("QARebuild","QARebuild command_name",__FILE__,QARebuild,group);
theCommands.Add("QAGetPixelColor", "QAGetPixelColor coordinate_X coordinate_Y [color_R color_G color_B]", __FILE__,QAAISGetPixelColor, group);
theCommands.Add("QAGetMousePoint", "QAGetMousePoint", __FILE__,QAAISGetMousePoint, group);
- theCommands.Add("QAGetColorCoord", "QAGetColorCoord", __FILE__,QAAISGetColorCoord, group);
theCommands.Add("vtri_orig",
"vtri_orig : vtri_orig trihedron_name - draws axis origin lines",
__FILE__,VTrihedronOrigins,group);