mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0023885: Inclusion of X11 header should be protected with macro
X11 headers inclusions have been protected with macro Remarks fix
This commit is contained in:
parent
5d05cf31f0
commit
87225ffd03
@ -29,7 +29,7 @@
|
|||||||
#define TEST //GG_140699
|
#define TEST //GG_140699
|
||||||
// Check file extension, must be ".xwd".
|
// Check file extension, must be ".xwd".
|
||||||
|
|
||||||
#ifndef WNT
|
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||||
# include <X11/Xlib.h>
|
# include <X11/Xlib.h>
|
||||||
#endif // WNT
|
#endif // WNT
|
||||||
#include <Aspect_GenericColorMap.hxx>
|
#include <Aspect_GenericColorMap.hxx>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
#ifndef WNT
|
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||||
# include <X11/Xlib.h>
|
# include <X11/Xlib.h>
|
||||||
#endif // WNT
|
#endif // WNT
|
||||||
#include <AlienImage_X11XWDFileHeader.hxx>
|
#include <AlienImage_X11XWDFileHeader.hxx>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#ifndef __Aspect_WNTXWD_HXX
|
#ifndef __Aspect_WNTXWD_HXX
|
||||||
# define __Aspect_WNTXWD_HXX
|
# define __Aspect_WNTXWD_HXX
|
||||||
|
|
||||||
# ifndef WNT
|
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||||
# include <X11/XWDFile.h>
|
# include <X11/XWDFile.h>
|
||||||
# else
|
# else
|
||||||
|
|
||||||
|
@ -134,10 +134,6 @@ defaultPrompt:
|
|||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <Draw_WindowBase.hxx>
|
|
||||||
#include <X11/XWDFile.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <tk.h>
|
#include <tk.h>
|
||||||
|
|
||||||
@ -174,10 +170,7 @@ static Standard_Boolean tty; /* Non-zero means standard input is a
|
|||||||
|
|
||||||
static unsigned long thePixels[MAXCOLOR];
|
static unsigned long thePixels[MAXCOLOR];
|
||||||
|
|
||||||
|
|
||||||
Display* Draw_WindowDisplay = NULL;
|
|
||||||
Standard_Integer Draw_WindowScreen = 0;
|
Standard_Integer Draw_WindowScreen = 0;
|
||||||
Colormap Draw_WindowColorMap;
|
|
||||||
Standard_Boolean Draw_BlackBackGround = Standard_True;
|
Standard_Boolean Draw_BlackBackGround = Standard_True;
|
||||||
|
|
||||||
|
|
||||||
@ -187,10 +180,21 @@ Draw_Window* Draw_Window::firstWindow = NULL;
|
|||||||
|
|
||||||
// X11 specific part
|
// X11 specific part
|
||||||
#if !defined(__APPLE__) || defined(MACOSX_USE_GLX)
|
#if !defined(__APPLE__) || defined(MACOSX_USE_GLX)
|
||||||
|
#include <X11/Xutil.h>
|
||||||
#include <Aspect_DisplayConnection.hxx>
|
#include <Aspect_DisplayConnection.hxx>
|
||||||
|
|
||||||
|
Display* Draw_WindowDisplay = NULL;
|
||||||
|
Colormap Draw_WindowColorMap;
|
||||||
static Handle(Aspect_DisplayConnection) Draw_DisplayConnection;
|
static Handle(Aspect_DisplayConnection) Draw_DisplayConnection;
|
||||||
|
|
||||||
|
// Base_Window struct definition
|
||||||
|
//===================================
|
||||||
|
struct Base_Window
|
||||||
|
{
|
||||||
|
GC gc;
|
||||||
|
XSetWindowAttributes xswa;
|
||||||
|
};
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Draw_Window
|
//function : Draw_Window
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -597,6 +601,7 @@ void Draw_Window::Hide()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void Draw_Window::Destroy()
|
void Draw_Window::Destroy()
|
||||||
{
|
{
|
||||||
|
XFreeGC (Draw_WindowDisplay, base.gc);
|
||||||
XDestroyWindow(Draw_WindowDisplay, win);
|
XDestroyWindow(Draw_WindowDisplay, win);
|
||||||
win = 0;
|
win = 0;
|
||||||
if (myBuffer != 0)
|
if (myBuffer != 0)
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
// 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
|
|
@ -13,7 +13,6 @@ Draw_Viewer.hxx
|
|||||||
Draw_Viewer.hxx
|
Draw_Viewer.hxx
|
||||||
Draw_Window.cxx
|
Draw_Window.cxx
|
||||||
Draw_Window.hxx
|
Draw_Window.hxx
|
||||||
Draw_WindowBase.hxx
|
|
||||||
Draw_PInterp.hxx
|
Draw_PInterp.hxx
|
||||||
Draw_CommandFunction.hxx
|
Draw_CommandFunction.hxx
|
||||||
DrawRessource.h
|
DrawRessource.h
|
||||||
|
@ -17,11 +17,6 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(WNT)
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
#include <QADraw.hxx>
|
#include <QADraw.hxx>
|
||||||
#include <QADraw_DataMapOfAsciiStringOfAddress.hxx>
|
#include <QADraw_DataMapOfAsciiStringOfAddress.hxx>
|
||||||
#include <Draw_Interpretor.hxx>
|
#include <Draw_Interpretor.hxx>
|
||||||
@ -41,18 +36,13 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <Aspect_DisplayConnection.hxx>
|
#include <Aspect_DisplayConnection.hxx>
|
||||||
#include <Graphic3d.hxx>
|
#include <Graphic3d.hxx>
|
||||||
|
#include <Aspect_Window.hxx>
|
||||||
|
|
||||||
#if ! defined(WNT)
|
#if defined(_WIN32) || defined(__WIN32__)
|
||||||
#include <Xw_Window.hxx>
|
# include <windows.h>
|
||||||
//#include <Xm/Xm.h>
|
# include <io.h>
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xutil.h>
|
|
||||||
#include <Xw_Cextern.hxx>
|
|
||||||
#include <unistd.h>
|
|
||||||
#else
|
#else
|
||||||
#include <WNT.h>
|
# include <unistd.h>
|
||||||
#include <WNT_Window.hxx>
|
|
||||||
#include <io.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <tcl.h>
|
#include <tcl.h>
|
||||||
@ -448,88 +438,11 @@ static Standard_Integer QAAISGetMousePoint (Draw_Interpretor& di, Standard_Integ
|
|||||||
return 0;
|
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
|
// VIEWER GLOBALs
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
#ifndef WNT
|
#ifndef WNT
|
||||||
extern Draw_Viewer dout;
|
extern Draw_Viewer dout;
|
||||||
extern Display* Draw_WindowDisplay;
|
|
||||||
extern Colormap Draw_WindowColorMap;
|
|
||||||
#else
|
#else
|
||||||
Standard_IMPORT Draw_Viewer dout;
|
Standard_IMPORT Draw_Viewer dout;
|
||||||
#endif
|
#endif
|
||||||
@ -692,7 +605,6 @@ void QADraw::CommonCommands(Draw_Interpretor& theCommands)
|
|||||||
theCommands.Add("QARebuild","QARebuild command_name",__FILE__,QARebuild,group);
|
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("QAGetPixelColor", "QAGetPixelColor coordinate_X coordinate_Y [color_R color_G color_B]", __FILE__,QAAISGetPixelColor, group);
|
||||||
theCommands.Add("QAGetMousePoint", "QAGetMousePoint", __FILE__,QAAISGetMousePoint, group);
|
theCommands.Add("QAGetMousePoint", "QAGetMousePoint", __FILE__,QAAISGetMousePoint, group);
|
||||||
theCommands.Add("QAGetColorCoord", "QAGetColorCoord", __FILE__,QAAISGetColorCoord, group);
|
|
||||||
theCommands.Add("vtri_orig",
|
theCommands.Add("vtri_orig",
|
||||||
"vtri_orig : vtri_orig trihedron_name - draws axis origin lines",
|
"vtri_orig : vtri_orig trihedron_name - draws axis origin lines",
|
||||||
__FILE__,VTrihedronOrigins,group);
|
__FILE__,VTrihedronOrigins,group);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user