1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00

0023769: Eliminate the dependence on X11 libs on Mac OS X

Removed ImageUtility package as it is no longer used.
Disabled Xw package building on Mac OS X when Cocoa used.
This commit is contained in:
dbv 2013-03-15 11:47:42 +04:00
parent 8c720dc1fe
commit 872f4e44da
29 changed files with 42 additions and 1660 deletions

View File

@ -210,7 +210,6 @@ p Aspect
p DsgPrs p DsgPrs
p Graphic3d p Graphic3d
p Image p Image
p ImageUtility
p MeshVS p MeshVS
p NIS p NIS
p OpenGl p OpenGl

View File

@ -1 +0,0 @@
CSF_XwLibs

View File

@ -1,11 +0,0 @@
EXTERNLIB
ImageUtility_WOKSteps.edl
ImageUtility_WOKUMake.edl
ImageUtility_X11Display.hxx
ImageUtility_X11Display.cxx
ImageUtility_X11Window.hxx
ImageUtility_X11Window.cxx
ImageUtility_X11XImage.hxx
ImageUtility_X11XImage.cxx
ImageUtility_X11GC.hxx
ImageUtility_X11GC.cxx

View File

@ -1,100 +0,0 @@
-- Created on: 1993-07-27
-- Created by: Jean Louis FRENKEL
-- Copyright (c) 1993-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.
package ImageUtility
uses
TCollection,
Image,
AlienImage,
OSD,
Aspect
is
class XPR ;
--- Purpose : perform a "xpr " with a XAlienImage build
-- from any Image , any AlienImage .
class XWUD ;
--- Purpose : perform a "xwud " with a XAlienImage build
-- from any Image , any AlienImage .
class XWD ;
--- Purpose : perform a "xwd " and create Image and XAlienImage.
class X11Dump ;
--- Purpose : Create a X11 Window and perform a XPutImage on it,
-- from any Image , any AlienImage .
imported X11Window ;
--- Xlib.h : Window type
imported X11Display ;
--- Xlib.h : Display type
imported X11XImage ;
--- Xlib.h : XImage type
imported X11GC ;
--- Xlib.h : XImage type
PixelDiff( aImage : immutable Image from Image ;
anotherImage : immutable Image from Image )
returns mutable PseudoColorImage from Image
--- Purpose : Create a Black & White Image from two Image.
-- Resulting Image Pixel is set to 0 if Pixel from
-- both Image are the same else set to 1 .
raises TypeMismatch from Standard;
PixelColorDiff( aImage : immutable Image from Image ;
anotherImage : immutable Image from Image )
returns mutable PseudoColorImage from Image
--- Purpose : Create a Black & White Image from two Image.
-- Resulting Image Pixel is set to 0 if PixelColor
-- from both Image are the same else set to 1 .
raises TypeMismatch from Standard;
PixelColorDiff( aImage : immutable Image from Image ;
anotherImage : immutable Image from Image ;
aCRColorMap : immutable ColorRampColorMap from Aspect )
returns mutable PseudoColorImage from Image
--- Purpose : Create a ColorRamp Image from two Image.
-- Resulting Image Pixel Index is proportional
-- to the (Red+Green_Blue)Image Differences scaling
-- to the ColorRamp range.
raises TypeMismatch from Standard;
PixelColorDiff( aImage : immutable Image from Image ;
anotherImage : immutable Image from Image ;
aCRColorMap : immutable ColorRampColorMap from Aspect ;
RedDiff : out mutable PseudoColorImage from Image ;
GreenDiff : out mutable PseudoColorImage from Image ;
BlueDiff : out mutable PseudoColorImage from Image )
--- Purpose : Create a ColorRamp Images from two Image.
-- Resulting Image Pixel Index is proportional
-- to the Image Differences scaling to the
-- ColorRamp range.
raises TypeMismatch from Standard;
end ;

View File

@ -1,244 +0,0 @@
// 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.
// Modified 27/12/98 : FMN ; PERF: OPTIMISATION LOADER (LOPTIM)
#include <Aspect_ColorRampColorMap.hxx>
#include <Standard_TypeMismatch.hxx>
#include <ImageUtility.ixx>
#define LOPTIM
#ifndef LOPTIM
static Handle(Aspect_ColorRampColorMap) TheBWColorMap =
new Aspect_ColorRampColorMap(0,2,Quantity_Color(1.,1.,1.,Quantity_TOC_RGB));
#else
static Handle(Aspect_ColorRampColorMap)& _TheBWColorMap() {
static Handle(Aspect_ColorRampColorMap) TheBWColorMap =
new Aspect_ColorRampColorMap(0,2,Quantity_Color(1.,1.,1.,Quantity_TOC_RGB));
return TheBWColorMap;
}
#define TheBWColorMap _TheBWColorMap()
#endif // LOPTIM
static void Rescale( const Handle(Image_PseudoColorImage) aPImage )
{ Aspect_IndexPixel PMin, PMax ;
Standard_Integer dim, base ;
Quantity_Color aColor ;
Standard_Real scale, offset ; ;
Handle(Aspect_ColorRampColorMap)::
DownCast(aPImage->ColorMap())->ColorRampDefinition( base, dim, aColor );
aPImage->Extrema( PMin, PMax ) ;
if ( PMax.Value() == PMin.Value() ) return ;
scale = Standard_Real( dim-1 ) / Standard_Real( PMax.Value() - PMin.Value()) ;
offset = Standard_Real( base ) - Standard_Real( PMin.Value() ) * scale ;
aPImage->Rescale( scale, offset ) ;
}
Handle(Image_PseudoColorImage) ImageUtility::PixelColorDiff(
const Handle(Image_Image)& Image1,
const Handle(Image_Image)& Image2 )
{
return PixelColorDiff( Image1, Image2, TheBWColorMap ) ;
}
Handle(Image_PseudoColorImage) ImageUtility::PixelColorDiff(
const Handle(Image_Image)& Image1,
const Handle(Image_Image)& Image2,
const Handle(Aspect_ColorRampColorMap)& TheColorMap )
{ Handle(Image_PseudoColorImage) RetImage = NULL ;
Standard_Integer x,y, Error, BasePixel, RampLength ;
Standard_Integer LX, LY, UX, UY ;
Standard_Integer LX1, LY1, UX1, UY1 ;
Standard_Integer LX2, LY2, UX2, UY2 ;
Aspect_IndexPixel aPixel;
Standard_Real r1,g1,b1, r2,g2,b2 ;
Quantity_Color aColor ;
TheColorMap->ColorRampDefinition( BasePixel, RampLength, aColor ) ;
Aspect_IndexPixel Pixel0(BasePixel);
Aspect_IndexPixel Pixel1(BasePixel+RampLength-1);
LX1 = Image1->LowerX() ;
LY1 = Image1->LowerY() ;
UX1 = Image1->UpperX() ;
UY1 = Image1->UpperY() ;
LX2 = Image2->LowerX() ;
LY2 = Image2->LowerY() ;
UX2 = Image2->UpperX() ;
UY2 = Image2->UpperY() ;
LX = Image1->LowerX() ; LX = Min( LX, Image2->LowerX() ) ;
LY = Image1->LowerY() ; LY = Min( LY, Image2->LowerY() ) ;
UX = Image1->UpperX() ; UX = Max( UX, Image2->UpperX() ) ;
UY = Image1->UpperY() ; UY = Max( UY, Image2->UpperY() ) ;
RetImage = new Image_PseudoColorImage( LX, LY,
(UX-LX)+1, (UY-LY)+1,
TheColorMap,
Pixel1 ) ;
if ( RampLength == 2 ) { //B&W ColorMap
for ( y = LY ; y <= UY ; y++ ) {
for ( x = LX ; x <= UX ; x++ ) {
if ( ( x >= LX1 && x >= LX2 ) && ( x <= UX1 && x <= UX2 ) &&
( y >= LY1 && y >= LY2 ) && ( y <= UY1 && y <= UY2 ) ) {
if ( Image1->PixelColor(x,y) == Image2->PixelColor(x,y) ) {
RetImage->SetPixel( x,y, Pixel0 ) ;
}
}
}
}
}
else {
for ( y = LY ; y <= UY ; y++ ) {
for ( x = LX ; x <= UX ; x++ ) {
if ( ( x >= LX1 && x >= LX2 ) && ( x <= UX1 && x <= UX2 ) &&
( y >= LY1 && y >= LY2 ) && ( y <= UY1 && y <= UY2 ) ) {
Image1->PixelColor(x,y).Values( r1,g1,b1, Quantity_TOC_RGB ) ;
Image2->PixelColor(x,y).Values( r2,g2,b2, Quantity_TOC_RGB ) ;
Error = BasePixel ;
Error +=
Standard_Integer( (Abs(r1-r2)+Abs(g1-g2)+Abs(b1-b2))/3.
*(RampLength-1)
);
aPixel.SetValue( Error ) ;
RetImage->SetPixel( x,y, aPixel ) ;
}
}
}
Rescale( RetImage ) ;
}
return RetImage ;
}
void ImageUtility::PixelColorDiff(
const Handle(Image_Image)& Image1,
const Handle(Image_Image)& Image2,
const Handle(Aspect_ColorRampColorMap)& TheColorMap,
Handle(Image_PseudoColorImage)& RedDiff,
Handle(Image_PseudoColorImage)& GreenDiff,
Handle(Image_PseudoColorImage)& BlueDiff )
{ Standard_Integer x,y, Error, BasePixel, RampLength ;
Standard_Integer LX, LY, UX, UY ;
Standard_Integer LX1, LY1, UX1, UY1 ;
Standard_Integer LX2, LY2, UX2, UY2 ;
Aspect_IndexPixel aPixel;
Standard_Real r1,g1,b1, r2,g2,b2 ;
Quantity_Color aColor ;
TheColorMap->ColorRampDefinition( BasePixel, RampLength, aColor ) ;
Aspect_IndexPixel Pixel0(BasePixel);
Aspect_IndexPixel Pixel1(BasePixel+RampLength-1);
LX1 = Image1->LowerX() ;
LY1 = Image1->LowerY() ;
UX1 = Image1->UpperX() ;
UY1 = Image1->UpperY() ;
LX2 = Image2->LowerX() ;
LY2 = Image2->LowerY() ;
UX2 = Image2->UpperX() ;
UY2 = Image2->UpperY() ;
LX = Image1->LowerX() ; LX = Min( LX, Image2->LowerX() ) ;
LY = Image1->LowerY() ; LY = Min( LY, Image2->LowerY() ) ;
UX = Image1->UpperX() ; UX = Max( UX, Image2->UpperX() ) ;
UY = Image1->UpperY() ; UY = Max( UY, Image2->UpperY() ) ;
RedDiff = new Image_PseudoColorImage( LX, LY,
(UX-LX)+1, (UY-LY)+1,
TheColorMap,
Pixel1 ) ;
GreenDiff = new Image_PseudoColorImage( LX, LY,
(UX-LX)+1, (UY-LY)+1,
TheColorMap,
Pixel1 ) ;
BlueDiff = new Image_PseudoColorImage( LX, LY,
(UX-LX)+1, (UY-LY)+1,
TheColorMap,
Pixel1 ) ;
if ( RampLength == 2 ) { //B&W ColorMap
for ( y = LY ; y <= UY ; y++ ) {
for ( x = LX ; x <= UX ; x++ ) {
if ( ( x >= LX1 && x >= LX2 ) && ( x <= UX1 && x <= UX2 ) &&
( y >= LY1 && y >= LY2 ) && ( y <= UY1 && y <= UY2 ) ) {
Image1->PixelColor(x,y).Values( r1,g1,b1, Quantity_TOC_RGB ) ;
Image2->PixelColor(x,y).Values( r2,g2,b2, Quantity_TOC_RGB ) ;
if ( r1 == r2 ) RedDiff->SetPixel ( x,y, Pixel0 ) ;
if ( g1 == g2 ) GreenDiff->SetPixel( x,y, Pixel0 ) ;
if ( b1 == b2 ) BlueDiff->SetPixel ( x,y, Pixel0 ) ;
}
}
}
}
else {
for ( y = LY ; y <= UY ; y++ ) {
for ( x = LX ; x <= UX ; x++ ) {
if ( ( x >= LX1 && x >= LX2 ) && ( x <= UX1 && x <= UX2 ) &&
( y >= LY1 && y >= LY2 ) && ( y <= UY1 && y <= UY2 ) ) {
Image1->PixelColor(x,y).Values( r1,g1,b1, Quantity_TOC_RGB ) ;
Image2->PixelColor(x,y).Values( r2,g2,b2, Quantity_TOC_RGB ) ;
Error = BasePixel + Standard_Integer( Abs(r1-r2)*(RampLength-1) );
aPixel.SetValue( Error ) ; RedDiff->SetPixel( x,y, aPixel ) ;
Error = BasePixel + Standard_Integer( Abs(g1-g2)*(RampLength-1) );
aPixel.SetValue( Error ) ; GreenDiff->SetPixel( x,y, aPixel ) ;
Error = BasePixel + Standard_Integer( Abs(b1-b2)*(RampLength-1) );
aPixel.SetValue( Error ) ; BlueDiff->SetPixel( x,y, aPixel ) ;
}
}
}
Rescale( RedDiff ) ;
Rescale( GreenDiff ) ;
Rescale( BlueDiff ) ;
}
}

View File

@ -1,35 +0,0 @@
-- Created by: Stephane Callegari
-- Copyright (c) 1998-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.
@ifnotdefined ( %ImageUtility_WOKSteps_EDL) then
@set %ImageUtility_WOKSteps_EDL = "";
@if ( %Station == "wnt" ) then
-- Pas d'ImageUtility sur WNT
@set %WOKSteps_ObjGroup = "";
@set %WOKSteps_DepGroup = "";
@set %WOKSteps_LibGroup = "";
@set %WOKSteps_ExecGroup = "";
@endif;
@endif;

View File

@ -1,32 +0,0 @@
-- Created by: Stephane Callegari
-- Copyright (c) 1996-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.
@ifnotdefined ( %ImageUtility_WOKUMake_EDL) then
@set %ImageUtility_WOKUMake_EDL = "";
@if ( %Station == "wnt" ) then
-- Pas d'ImageUtility sur WNT
@set %WOKUMake_Steps = "*src xcpp.fill(src) xcpp.src(xcpp.fill) xcpp.header(xcpp.fill) .xcpp.template(xcpp.fill) obj.inc";
@endif;
@endif;

View File

@ -1,26 +0,0 @@
// 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.
#include <ImageUtility_X11Display.hxx>
const Handle(Standard_Type)& STANDARD_TYPE(ImageUtility_X11Display)
{
static Handle(Standard_Type) _atype =
new Standard_Type ("ImageUtility_X11Display", sizeof (ImageUtility_X11Display));
return _atype;
}

View File

@ -1,43 +0,0 @@
// 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.
//============================================================================
//==== Titre: ImageUtility_X11Display.hxx
//==== Role : The header file of primitve type "X11Display" from package
//==== "AlienImage"
//====
//==== Implementation: This is a primitive type implemented with typedef
//==== typedef Display ImageUtility_X11Display;
//============================================================================
#ifndef _ImageUtility_X11Display_HeaderFile
#define _ImageUtility_X11Display_HeaderFile
/*
* Data structure used by color operations from <X11/Xlib.h>
*/
//==== Definition de Type ====================================================
#include <Standard_Type.hxx>
const Handle(Standard_Type)& STANDARD_TYPE(ImageUtility_X11Display);
//============================================================================
#include <X11/Xlib.h>
typedef Display *ImageUtility_X11Display ;
#endif

View File

@ -1,76 +0,0 @@
-- Created on: 1993-03-23
-- Created by: BBL,JLF
-- Copyright (c) 1993-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.
class X11Dump from ImageUtility
uses
X11Display from ImageUtility,
X11Window from ImageUtility,
X11XImage from ImageUtility,
X11GC from ImageUtility,
Image from Image,
AsciiString from TCollection
raises
TypeMismatch from Standard
is
Create( DisplayName : AsciiString from TCollection ;
aImage : Image from Image )
returns X11Dump from ImageUtility ;
---Level: Internal
---Purpose : Create a new X11 Display,Window,Colormap,GC,XImage suitable
-- for aImage .
Create( aX11Dump : X11Dump from ImageUtility ;
aImage : Image from Image )
returns X11Dump from ImageUtility ;
---Level: Internal
---Purpose : Create a new X11 XImage and share Display,Window,Colormap,
-- GC with a previous aX11Dump ;
X11GC ( me )
returns X11GC from ImageUtility
is static;
X11Window ( me )
returns X11Window from ImageUtility
is static;
X11Display ( me )
returns X11Display from ImageUtility
is static;
X11XImage ( me )
returns X11XImage from ImageUtility
is static;
UpdateX11Colormap ( me )
is static;
UpdateX11XImage ( me : in out )
is static;
DisplayX11XImage ( me )
is static;
fields
myDisplay : X11Display from ImageUtility ;
myWindow : X11Window from ImageUtility ;
myXImage : X11XImage from ImageUtility ;
myGC : X11GC from ImageUtility ;
myImage : Image from Image ;
end ;

View File

@ -1,311 +0,0 @@
// 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.
// Modified 27/12/98 : FMN ; PERF: OPTIMISATION LOADER (LOPTIM)
#include <ImageUtility_X11Dump.ixx>
#include <Standard.hxx>
#include <Image_PseudoColorImage.hxx>
#include <Image_ColorImage.hxx>
#include <Aspect_ColorMap.hxx>
#include <X11/Xutil.h>
#include <Aspect_ColorMapEntry.hxx>
#include <Image_PixelRowOfDIndexedImage.hxx>
#include <Image_PixelRowOfDColorImage.hxx>
ImageUtility_X11Dump::ImageUtility_X11Dump(
const TCollection_AsciiString& DisplayName ,
const Handle(Image_Image)& aImage )
{ myImage = aImage ;
myDisplay = XOpenDisplay( DisplayName.ToCString() ) ;
XVisualInfo VInfo, *PVinfo ;
int Nitems ;
XSetWindowAttributes WinAttr ;
Visual *theVisual = DefaultVisual( myDisplay, DefaultScreen( myDisplay ) );
VInfo.visualid = theVisual->visualid ;
PVinfo = XGetVisualInfo( myDisplay, VisualIDMask, &VInfo, &Nitems ) ;
if ( aImage->Type() == Image_TOI_PseudoColorImage ) {
if ( PVinfo->depth != 8 || PVinfo->c_class != PseudoColor ) {
VInfo.depth = 8 ;
VInfo.c_class = PseudoColor ;
PVinfo = XGetVisualInfo( myDisplay,
VisualDepthMask|VisualClassMask,
&VInfo, &Nitems ) ;
}
}
else {
if ( PVinfo->depth != 24 || PVinfo->c_class != TrueColor ) {
VInfo.depth = 24 ;
VInfo.c_class = TrueColor ;
PVinfo = XGetVisualInfo( myDisplay,
VisualDepthMask|VisualClassMask,
&VInfo, &Nitems ) ;
}
}
WinAttr.background_pixel = 0 ;
WinAttr.border_pixel = 0 ;
WinAttr.colormap = XCreateColormap( myDisplay,
RootWindow( myDisplay,
DefaultScreen( myDisplay ) ),
PVinfo->visual,
(PVinfo->c_class==TrueColor)?
AllocNone:AllocAll ) ;
myWindow = XCreateWindow( myDisplay,
RootWindow( myDisplay, DefaultScreen( myDisplay ) ),
0, 0,
( unsigned int ) aImage->Width(),
( unsigned int ) aImage->Height(),
0,
PVinfo->depth,
InputOutput,
PVinfo->visual,
CWBackPixel | CWBorderPixel | CWColormap, &WinAttr ) ;
myXImage = XCreateImage( myDisplay,
PVinfo->visual,
PVinfo->depth,
ZPixmap,
0,
NULL,
( unsigned int ) aImage->Width(),
( unsigned int ) aImage->Height(),
BitmapPad( myDisplay ),
0 ) ;
myGC = XCreateGC( myDisplay, myWindow, 0, NULL ) ;
XSetPlaneMask( myDisplay, myGC, AllPlanes ) ;
XSetFunction( myDisplay, myGC, GXcopy ) ;
UpdateX11Colormap() ;
UpdateX11XImage() ;
XMapWindow( myDisplay, myWindow ) ;
XFlush( myDisplay ) ;
}
ImageUtility_X11Dump::ImageUtility_X11Dump(
const ImageUtility_X11Dump& anOtherX11Dump ,
const Handle(Image_Image)& aImage )
{ myImage = aImage ;
myDisplay = anOtherX11Dump.X11Display() ;
myWindow = anOtherX11Dump.X11Window() ;
XWindowAttributes WinAttr ;
XGetWindowAttributes( myDisplay, myWindow, &WinAttr ) ;
myXImage = XCreateImage( myDisplay,
WinAttr.visual,
WinAttr.depth,
ZPixmap,
0,
NULL,
( unsigned int ) aImage->Width(),
( unsigned int ) aImage->Height(),
BitmapPad( myDisplay ),
0 ) ;
myGC = anOtherX11Dump.X11GC() ;
UpdateX11XImage() ;
XFlush( myDisplay ) ;
}
ImageUtility_X11GC ImageUtility_X11Dump::X11GC() const
{ return myGC ; }
ImageUtility_X11Window ImageUtility_X11Dump::X11Window() const
{ return myWindow ; }
ImageUtility_X11Display ImageUtility_X11Dump::X11Display() const
{ return myDisplay ; }
ImageUtility_X11XImage ImageUtility_X11Dump::X11XImage() const
{ return myXImage ; }
void ImageUtility_X11Dump::UpdateX11Colormap() const
{
if ( myImage->Type() != Image_TOI_PseudoColorImage ) return ;
Handle(Image_PseudoColorImage) aPImage =
Handle(Image_PseudoColorImage)::DownCast( myImage ) ;
Handle(Aspect_ColorMap) TheColorMap = aPImage->ColorMap() ;
Aspect_ColorMapEntry aEntry ;
XColor aColor ;
Standard_Integer i ;
XWindowAttributes WinAttr ;
XGetWindowAttributes( myDisplay, myWindow, &WinAttr ) ;
for ( i = 0 ; i < TheColorMap->Size() ; i++ ) {
aEntry = TheColorMap->Entry( i+1 ) ;
aColor.pixel = aEntry.Index() % WinAttr.visual->map_entries ;
aColor.red = (unsigned short)(aEntry.Color().Red() * 0xffff + 0.5 );
aColor.green = (unsigned short)(aEntry.Color().Green() * 0xffff + 0.5 );
aColor.blue = (unsigned short)(aEntry.Color().Blue() * 0xffff + 0.5 );
aColor.flags = DoRed | DoGreen | DoBlue ;
XStoreColor( myDisplay, WinAttr.colormap, &aColor ) ;
}
}
static unsigned int get_range( unsigned long col_mask )
{
while ( !(col_mask & 1) ) col_mask >>= 1 ;
return( col_mask ) ;
}
static unsigned int get_shift( unsigned long col_mask , unsigned long rgb_bit )
{ long shift ;
if ( ( col_mask >> rgb_bit ) == 0 ) {
shift = 0 ;
}
else if ( ( col_mask >> ( 2 * rgb_bit ) ) == 0 ) {
shift = rgb_bit ;
}
else {
shift = 2 * rgb_bit ;
}
return( shift ) ;
}
void ImageUtility_X11Dump::UpdateX11XImage()
{ Standard_Integer x,y, width, height, X, Y, bits_per_line;
width = myImage->Width() ;
height = myImage->Height() ;
X = myImage->LowerX() ;
Y = myImage->LowerY() ;
if ( myXImage->data == NULL ||
myXImage->width != width ||
myXImage->height != height ) {
if ( myXImage->data != NULL ) {
Standard_Address ToBeFree = ( Standard_Address ) myXImage->data ;
Standard::Free( ToBeFree);
myXImage->data = NULL ;
}
myXImage->width = width ;
myXImage->height = height ;
bits_per_line = width * myXImage->bits_per_pixel ;
if ( bits_per_line % myXImage->bitmap_pad ) {
bits_per_line += myXImage->bitmap_pad ;
}
myXImage->bytes_per_line = bits_per_line / 8 ;
myXImage->data = ( char * )
Standard::Allocate(myXImage->bytes_per_line*myXImage->height);
}
if ( myImage->Type() == Image_TOI_PseudoColorImage ) {
char *pl, *p ;
Handle(Image_PseudoColorImage) aPImage =
Handle(Image_PseudoColorImage)::DownCast( myImage ) ;
Image_PixelRowOfDIndexedImage aRow( 0, myImage->Width()-1 ) ;
for ( y = 0 , pl = myXImage->data ;
y < height ;
y++, pl += myXImage->bytes_per_line ) {
aPImage->Row( X, Y+y, aRow ) ;
for ( x = 0 , p = pl ; x < width ; x++, p++ ) {
*p = ( char ) ( aRow(x).Value() & 0xff ) ;
}
}
}
else {
unsigned int *pl, *p ;
Handle(Image_ColorImage) aCImage =
Handle(Image_ColorImage)::DownCast( myImage ) ;
Image_PixelRowOfDColorImage aRow( 0, myImage->Width()-1 ) ;
XWindowAttributes WinAttr ;
Standard_Real r,g,b ;
unsigned int lr,lg,lb, rgb_range, r_shift, g_shift, b_shift ;
XGetWindowAttributes( myDisplay, myWindow, &WinAttr ) ;
rgb_range = get_range( WinAttr.visual->red_mask ) ;
r_shift = get_shift( WinAttr.visual->red_mask,
WinAttr.visual->bits_per_rgb ) ;
g_shift = get_shift( WinAttr.visual->green_mask,
WinAttr.visual->bits_per_rgb ) ;
b_shift = get_shift( WinAttr.visual->blue_mask,
WinAttr.visual->bits_per_rgb ) ;
for ( y = 0 , pl = ( unsigned int *) myXImage->data ;
y < height ;
y++, pl += ( myXImage->bytes_per_line/sizeof( unsigned int ) ) ) {
aCImage->Row( X, Y+y, aRow ) ;
for ( x = 0 , p = pl ; x < width ; x++, p++ ) {
aRow(x).Value().Values( r,g,b , Quantity_TOC_RGB ) ;
lr = ( unsigned int ) ( r * ( rgb_range ) +0.5) ;
lg = ( unsigned int ) ( g * ( rgb_range ) +0.5) ;
lb = ( unsigned int ) ( b * ( rgb_range ) +0.5) ;
*p = (lr<<r_shift) | (lg<<g_shift) | (lb<<b_shift) ;
}
}
}
}
void ImageUtility_X11Dump::DisplayX11XImage() const
{ XPutImage( myDisplay,
myWindow,
myGC,
myXImage,
0,0,
0,0,
myXImage->width,myXImage->height ) ;
}

View File

@ -1,26 +0,0 @@
// 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.
#include <ImageUtility_X11GC.hxx>
const Handle(Standard_Type)& STANDARD_TYPE(ImageUtility_X11GC)
{
static Handle(Standard_Type) _atype =
new Standard_Type ("ImageUtility_X11GC", sizeof (ImageUtility_X11GC));
return _atype;
}

View File

@ -1,43 +0,0 @@
// 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.
//============================================================================
//==== Titre: ImageUtility_X11GC.hxx
//==== Role : The header file of primitve type "X11GC" from package
//==== "ImageUtility"
//====
//==== Implementation: This is a primitive type implemented with typedef
//==== typedef GC ImageUtility_X11GC;
//============================================================================
#ifndef _ImageUtility_X11GC_HeaderFile
#define _ImageUtility_X11GC_HeaderFile
/*
* Data structure used by color operations from <X11/Xlib.h>
*/
//==== Definition de Type ====================================================
#include <Standard_Type.hxx>
const Handle(Standard_Type)& STANDARD_TYPE(ImageUtility_X11GC);
//============================================================================
#include <X11/Xlib.h>
typedef GC ImageUtility_X11GC ;
#endif

View File

@ -1,26 +0,0 @@
// 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.
#include <ImageUtility_X11Window.hxx>
const Handle(Standard_Type)& STANDARD_TYPE(ImageUtility_X11Window)
{
static Handle(Standard_Type) _atype =
new Standard_Type ("ImageUtility_X11Window", sizeof (ImageUtility_X11Window));
return _atype;
}

View File

@ -1,43 +0,0 @@
// 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.
//============================================================================
//==== Titre: ImageUtility_X11Window.hxx
//==== Role : The header file of primitve type "X11Window" from package
//==== "ImageUtility"
//====
//==== Implementation: This is a primitive type implemented with typedef
//==== typedef Window ImageUtility_X11Window;
//============================================================================
#ifndef _ImageUtility_X11Window_HeaderFile
#define _ImageUtility_X11Window_HeaderFile
/*
* Data structure used by color operations from <X11/Xlib.h>
*/
//==== Definition de Type ====================================================
#include <Standard_Type.hxx>
const Handle(Standard_Type)& STANDARD_TYPE(ImageUtility_X11Window);
//============================================================================
#include <X11/Xlib.h>
typedef Window ImageUtility_X11Window ;
#endif

View File

@ -1,26 +0,0 @@
// 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.
#include <ImageUtility_X11XImage.hxx>
const Handle(Standard_Type)& STANDARD_TYPE(ImageUtility_X11XImage)
{
static Handle(Standard_Type) _atype =
new Standard_Type ("ImageUtility_X11XImage", sizeof (ImageUtility_X11XImage));
return _atype;
}

View File

@ -1,43 +0,0 @@
// 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.
//============================================================================
//==== Titre: ImageUtility_X11XImage.hxx
//==== Role : The header file of primitve type "X11XImage" from package
//==== "ImageUtility"
//====
//==== Implementation: This is a primitive type implemented with typedef
//==== typedef XImage ImageUtility_X11XImage;
//============================================================================
#ifndef _ImageUtility_X11XImage_HeaderFile
#define _ImageUtility_X11XImage_HeaderFile
/*
* Data structure used by color operations from <X11/Xlib.h>
*/
//==== Definition de Type ====================================================
#include <Standard_Type.hxx>
const Handle(Standard_Type)& STANDARD_TYPE(ImageUtility_X11XImage);
//============================================================================
#include <X11/Xlib.h>
typedef XImage *ImageUtility_X11XImage ;
#endif

View File

@ -1,81 +0,0 @@
-- Created on: 1993-03-23
-- Created by: BBL,JLF
-- Copyright (c) 1993-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.
class XPR from ImageUtility
---Version: 0.0
---Purpose: Performs a "xpr" with a XAlienImage build
-- from any Image , any AlienImage .
---Keywords:
---Warning:
---References:
uses
AlienUserImage from AlienImage,
XAlienImage from AlienImage,
File from OSD,
Image from Image
raises
TypeMismatch from Standard
is
XPR ( myclass ; aImage : in Image from Image;
aName : CString from Standard;
xprOptions : CString from Standard
= "" ) ;
---Level: Internal
---Purpose: Write content of a Image object to aTmpFile and
-- execute a Spawn "xpr xprOptions aTmpFile | lpr &" .
XPR ( myclass ; aAlienUserImage : in AlienUserImage from AlienImage;
aName : CString from Standard ;
xprOptions : CString from Standard
= "" ) ;
---Level: Internal
---Purpose: Write content of a AlienImage object to aTmpFile and
-- execute a Spawn "xpr xprOptions aTmpFile| lpr &" .
XPR ( myclass ; aXAlienImage : in XAlienImage from AlienImage ;
xprOptions : CString from Standard
= "" ) ;
---Level: Internal
---Purpose: Write content of a XAlienImage object to aTmpFile and
-- execute a Spawn "xpr xprOptions aTmpFile| lpr &" .
XPR ( myclass ; aFile : in File from OSD ;
xprOptions : CString from Standard
= "" ) ;
---Level: Internal
---Purpose: execute a Spawn
-- "xpr xprOptions /aFile.SystemName()/ | lpr &" .
XPR ( myclass ; aFileName : CString from Standard ;
xprOptions : CString from Standard
= "" ) ;
---Level: Internal
---Purpose: execute a Spawn "xpr xprOptions aFileName | lpr &" .
end ;

View File

@ -1,124 +0,0 @@
// 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.
// Modified 27/12/98 : FMN ; PERF: OPTIMISATION LOADER (LOPTIM)
#include <Image_Image.hxx>
#include <AlienImage_XAlienImage.hxx>
#include <OSD_Process.hxx>
#include <OSD_File.hxx>
#include <ImageUtility_XPR.ixx>
#define LOPTIM
#ifndef LOPTIM
static Handle(AlienImage_XAlienImage) XAlienImage = new AlienImage_XAlienImage();
#else
static Handle(AlienImage_XAlienImage)& _XAlienImage() {
static Handle(AlienImage_XAlienImage) XAlienImage = new AlienImage_XAlienImage();
return XAlienImage;
}
#define XAlienImage _XAlienImage()
#endif // LOPTIM
void ImageUtility_XPR::XPR(
const Handle(AlienImage_AlienUserImage)& aAlienImage,
const Standard_CString aName,
const Standard_CString xprOptions )
{ if ( aAlienImage->IsKind(STANDARD_TYPE(AlienImage_XAlienImage) ) ) {
Handle(AlienImage_XAlienImage) aXImage =
Handle(AlienImage_XAlienImage)::DownCast(aAlienImage) ;
aXImage->SetName( TCollection_AsciiString( aName ) ) ;
XPR( aXImage, xprOptions ) ;
}
else {
XPR( aAlienImage->ToImage(), aName, xprOptions ) ;
}
}
void ImageUtility_XPR::XPR( const Handle(Image_Image)& aImage,
const Standard_CString aName,
const Standard_CString xprOptions )
{ XAlienImage->Clear() ;
XAlienImage->FromImage( aImage ) ;
XAlienImage->SetName( TCollection_AsciiString( aName ) ) ;
XPR( XAlienImage, xprOptions ) ;
}
void ImageUtility_XPR::XPR(
const Handle(AlienImage_XAlienImage)& aXImage,
const Standard_CString xprOptions )
{
OSD_File File = OSD_File::BuildTemporary() ;
#ifdef TRACE
OSD_Path Path ;
TCollection_AsciiString Name ;
File.Path(Path) ;
Path.SystemName( Name ) ;
cout << "BuildTemporaryFile :" << Name << endl << flush ;
#endif
aXImage->Write( File ) ;
File.Close() ;
XPR( File, xprOptions ) ;
}
void ImageUtility_XPR::XPR( const OSD_File& File,
const Standard_CString xprOptions )
{
TCollection_AsciiString s, Name ;
OSD_Path Path ;
OSD_Process Process ;
File.Path( Path ) ;
Path.SystemName( Name, OSD_Default ) ;
XPR( Name.ToCString(), xprOptions ) ;
}
void ImageUtility_XPR::XPR( const Standard_CString aName,
const Standard_CString xprOptions )
{
TCollection_AsciiString s;
OSD_Process Process ;
s = TCollection_AsciiString("xpr ")
+ TCollection_AsciiString(xprOptions)
+ TCollection_AsciiString(" ")
+ aName
+ TCollection_AsciiString( " | lpr &" );
Process.Spawn( s ) ;
}

View File

@ -1,66 +0,0 @@
-- Created on: 1993-03-23
-- Created by: BBL,JLF
-- Copyright (c) 1993-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.
class XWD from ImageUtility
---Version: 0.0
---Purpose: Performs a "xwd" and creates a XAlienImage and an Image
---Keywords:
---Warning:
---References:
uses
XAlienImage from AlienImage,
File from OSD,
Image from Image
raises
TypeMismatch from Standard
is
Create returns XWD from ImageUtility ;
---Level: Internal
---Purpose: Create a XWD object .
XWD( me : in out ; xwdOptions : CString from Standard = "" )
returns Boolean from Standard
is static;
---Level: Internal
---Purpose: execute a Spawn "xwd xwudOptions -out aTmpFile" .
XAlienImage( me )
returns XAlienImage from AlienImage
is static;
---Level: Internal
---Purpose: returns the XAlienImage created from "xwd".
Image( me )
returns Image from Image
is static;
---Level: Internal
---Purpose: returns the Image created from "xwd".
fields
myXAlienImage : XAlienImage from AlienImage;
myImage : Image from Image;
end ;

View File

@ -1,74 +0,0 @@
// 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.
#include <Image_Image.hxx>
#include <AlienImage_XAlienImage.hxx>
#include <OSD_Process.hxx>
#include <OSD_File.hxx>
#include <ImageUtility_XWD.ixx>
ImageUtility_XWD::ImageUtility_XWD()
{ myXAlienImage = NULL ;
myImage = NULL ;
}
Handle(Image_Image) ImageUtility_XWD::Image() const
{ return myImage ; }
Handle(AlienImage_XAlienImage) ImageUtility_XWD::XAlienImage() const
{ return myXAlienImage; }
Standard_Boolean ImageUtility_XWD::XWD( const Standard_CString xwdOptions )
{ Standard_Boolean RetStatus ;
OSD_File File = OSD_File::BuildTemporary() ;
TCollection_AsciiString s, Name ;
OSD_Path Path ;
OSD_Process Process ;
File.Path( Path ) ;
Path.SystemName( Name, OSD_Default ) ;
#ifdef TRACE
cout << "BuildTemporaryFile :" << Name << endl << flush ;
#endif
s = TCollection_AsciiString("xwd ")
+ TCollection_AsciiString(xwdOptions)
+ TCollection_AsciiString(" -out ")
+ Name ;
Process.Spawn( s ) ;
myXAlienImage = new AlienImage_XAlienImage() ;
if (( RetStatus = myXAlienImage->Read( File ) )) {
myImage = myXAlienImage->ToImage() ;
}
else {
myImage = NULL ;
myXAlienImage = NULL ;
}
return RetStatus ;
}

View File

@ -1,81 +0,0 @@
-- Created on: 1993-03-23
-- Created by: BBL,JLF
-- Copyright (c) 1993-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.
class XWUD from ImageUtility
---Version: 0.0
---Purpose: Performs a "xwud -noclick" with a XAlienImage build
-- from any Image , any AlienImage .
---Keywords:
---Warning:
---References:
uses
AlienUserImage from AlienImage,
XAlienImage from AlienImage,
File from OSD,
Image from Image
raises
TypeMismatch from Standard
is
XWUD( myclass ; aImage : in Image from Image;
aName : CString from Standard;
xwudOptions : CString from Standard
= "-new -noclick" ) ;
---Level: Internal
---Purpose: Write content of a Image object to aTmpFile and
-- execute a Spawn "xwud xwudOptions -in aTmpFile &" .
XWUD( myclass ; aAlienUserImage : in AlienUserImage from AlienImage;
aName : CString from Standard ;
xwudOptions : CString from Standard
= "-new -noclick" ) ;
---Level: Internal
---Purpose: Write content of a AlienImage object to aTmpFile and
-- execute a Spawn "xwud xwudOptions -in aTmpFile &" .
XWUD( myclass ; aXAlienImage : in XAlienImage from AlienImage ;
xwudOptions : CString from Standard
= "-new -noclick" ) ;
---Level: Internal
---Purpose: Write content of a XAlienImage object to aTmpFile and
-- execute a Spawn "xwud xwudOptions -in aTmpFile &" .
XWUD( myclass ; aFile : in File from OSD ;
xwudOptions : CString from Standard
= "-new -noclick" ) ;
---Level: Internal
---Purpose: execute a Spawn
-- "xwud -new -noclick -in /aFile.SystemName()/ &" .
XWUD( myclass ; aFileName : CString from Standard ;
xwudOptions : CString from Standard
= "-new -noclick" ) ;
---Level: Internal
---Purpose: execute a Spawn "xwud xwudOptions -in aFileName &" .
end ;

View File

@ -1,126 +0,0 @@
// 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.
// Modified 27/12/98 : FMN ; PERF: OPTIMISATION LOADER (LOPTIM)
#include <Image_Image.hxx>
#include <AlienImage_XAlienImage.hxx>
#include <OSD_Process.hxx>
#include <OSD_File.hxx>
#include <ImageUtility_XWUD.ixx>
#define LOPTIM
#ifndef LOPTIM
static Handle(AlienImage_XAlienImage) XAlienImage = new AlienImage_XAlienImage();
#else
static Handle(AlienImage_XAlienImage)& _XAlienImage() {
static Handle(AlienImage_XAlienImage) XAlienImage = new AlienImage_XAlienImage();
return XAlienImage;
}
#define XAlienImage _XAlienImage()
#endif // LOPTIM
void ImageUtility_XWUD::XWUD(
const Handle(AlienImage_AlienUserImage)& aAlienImage,
const Standard_CString aName,
const Standard_CString xwudOptions )
{
if ( aAlienImage->IsKind(STANDARD_TYPE(AlienImage_XAlienImage) ) ) {
Handle(AlienImage_XAlienImage) aXImage =
Handle(AlienImage_XAlienImage)::DownCast(aAlienImage) ;
aXImage->SetName( TCollection_AsciiString( aName ) ) ;
XWUD( aXImage, xwudOptions ) ;
}
else {
XWUD( aAlienImage->ToImage(), aName, xwudOptions ) ;
}
}
void ImageUtility_XWUD::XWUD( const Handle(Image_Image)& aImage,
const Standard_CString aName,
const Standard_CString xwudOptions )
{ XAlienImage->Clear() ;
XAlienImage->FromImage( aImage ) ;
XAlienImage->SetName( TCollection_AsciiString( aName ) ) ;
XWUD( XAlienImage, xwudOptions ) ;
}
void ImageUtility_XWUD::XWUD(
const Handle(AlienImage_XAlienImage)& aXImage,
const Standard_CString xwudOptions )
{
OSD_File File = OSD_File::BuildTemporary() ;
#ifdef TRACE
OSD_Path Path ;
TCollection_AsciiString Name ;
File.Path(Path) ;
Path.SystemName( Name ) ;
cout << "BuildTemporaryFile :" << Name << endl << flush ;
#endif
aXImage->Write( File ) ;
File.Close() ;
XWUD( File, xwudOptions ) ;
}
void ImageUtility_XWUD::XWUD( const OSD_File& File,
const Standard_CString xwudOptions )
{
TCollection_AsciiString s, Name ;
OSD_Path Path ;
OSD_Process Process ;
File.Path( Path ) ;
Path.SystemName( Name, OSD_Default ) ;
XWUD( Name.ToCString(), xwudOptions ) ;
}
void ImageUtility_XWUD::XWUD( const Standard_CString aName,
const Standard_CString xwudOptions )
{
TCollection_AsciiString s;
OSD_Process Process ;
s = TCollection_AsciiString("xwud ")
+ TCollection_AsciiString(xwudOptions)
+ TCollection_AsciiString(" -in ")
+ aName
+ TCollection_AsciiString( "&" );
Process.Spawn( s ) ;
}

View File

@ -450,7 +450,7 @@ static Standard_Integer QAAISGetMousePoint (Draw_Interpretor& di, Standard_Integ
static Standard_Integer QAAISGetColorCoord (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer QAAISGetColorCoord (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
#if ! defined(WNT) #if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
if ( argc > 1 ) { if ( argc > 1 ) {
di << "Usage : " << argv[0] << "\n"; di << "Usage : " << argv[0] << "\n";
return 1; return 1;

View File

@ -4,7 +4,6 @@ SelectBasics
Xw Xw
AlienImage AlienImage
Image Image
ImageUtility
WNT WNT
Cocoa Cocoa
TColQuantity TColQuantity

View File

@ -75,11 +75,13 @@
#include <Visual3d_PickPath.hxx> #include <Visual3d_PickPath.hxx>
#include <Visual3d_SetIteratorOfSetOfView.hxx> #include <Visual3d_SetIteratorOfSetOfView.hxx>
#ifndef WNT #if defined (_WIN32) || defined(__WIN32__)
# include <Xw_Window.hxx>
#else
# include <WNT_Window.hxx> # include <WNT_Window.hxx>
#endif // WNT #elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
# include <Cocoa_Window.hxx>
#else
# include <Xw_Window.hxx>
#endif
//-Aliases //-Aliases
@ -954,15 +956,17 @@ Standard_Boolean Exist = Standard_False;
// Parse the list of views to find // Parse the list of views to find
// a view with the specified window // a view with the specified window
Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView); Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
int TheWindowIdOfView;
#ifndef WNT #if defined(_WIN32) || defined(__WIN32__)
const Handle(Xw_Window) THEWindow = *(Handle(Xw_Window) *) &AWindow; const Handle(WNT_Window) THEWindow = Handle(WNT_Window)::DownCast (AWindow);
int TheSpecifiedWindowId = int (THEWindow->XWindow ()); int TheSpecifiedWindowId = int (THEWindow->HWindow ());
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
const Handle(Cocoa_Window) THEWindow = Handle(Cocoa_Window)::DownCast (AWindow);
NSView* TheSpecifiedWindowId = THEWindow->HView();
#else #else
const Handle(WNT_Window) THEWindow = *(Handle(WNT_Window) *) &AWindow; const Handle(Xw_Window) THEWindow = Handle(Xw_Window)::DownCast (AWindow);
int TheSpecifiedWindowId = int (THEWindow->HWindow ()); int TheSpecifiedWindowId = int (THEWindow->XWindow ());
#endif // WNT #endif
while ((! Exist) && (MyIterator.More ())) { while ((! Exist) && (MyIterator.More ())) {
@ -970,12 +974,15 @@ const Handle(WNT_Window) THEWindow = *(Handle(WNT_Window) *) &AWindow;
((MyIterator.Value ())->IsActive ()) ) { ((MyIterator.Value ())->IsActive ()) ) {
const Handle(Aspect_Window) AspectWindow = (MyIterator.Value ())->Window (); const Handle(Aspect_Window) AspectWindow = (MyIterator.Value ())->Window ();
#ifndef WNT #if defined(_WIN32) || defined(__WIN32__)
const Handle(Xw_Window) theWindow = *(Handle(Xw_Window) *) &AspectWindow; const Handle(WNT_Window) theWindow = Handle(WNT_Window)::DownCast (AspectWindow);
TheWindowIdOfView = int (theWindow->XWindow ()); int TheWindowIdOfView = int (theWindow->HWindow ());
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
const Handle(Cocoa_Window) theWindow = Handle(Cocoa_Window)::DownCast (AspectWindow);
NSView* TheWindowIdOfView = theWindow->HView();
#else #else
const Handle(WNT_Window) theWindow = *(Handle(WNT_Window) *) &AspectWindow; const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow);
TheWindowIdOfView = int (theWindow->HWindow ()); int TheWindowIdOfView = int (theWindow->XWindow ());
#endif // WNT #endif // WNT
// Comparaison on window IDs // Comparaison on window IDs
if (TheWindowIdOfView == TheSpecifiedWindowId) { if (TheWindowIdOfView == TheSpecifiedWindowId) {

View File

@ -21,7 +21,12 @@
@uses "CSF.edl"; @uses "CSF.edl";
@if ( %Station == "wnt" ) then -- Use GLX or Cocoa
@ifnotdefined ( %MACOSX_USE_GLX ) then
@set %MACOSX_USE_GLX = "${MACOSX_USE_GLX}";
@endif;
@if ( %Station == "wnt" || (%Station == "mac" && %MACOSX_USE_GLX != "true")) then
-- Pas de compile sur WNT -- Pas de compile sur WNT
@set %WOKUMake_Steps = "src"; @set %WOKUMake_Steps = "src";
@endif; @endif;

View File

@ -23,8 +23,13 @@
@ifnotdefined ( %Xw_WOKSteps_EDL ) then @ifnotdefined ( %Xw_WOKSteps_EDL ) then
---@set %Xw_WOKSteps_EDL = ""; ---@set %Xw_WOKSteps_EDL = "";
-- Use GLX or Cocoa
@ifnotdefined ( %MACOSX_USE_GLX ) then
@set %MACOSX_USE_GLX = "${MACOSX_USE_GLX}";
@endif;
--- Insert your stuff Here --- Insert your stuff Here
@if ( %Station == "wnt" ) then @if ( %Station == "wnt" || (%Station == "mac" && %MACOSX_USE_GLX != "true")) then
-- Pas d'Xw sur Windows NT -- Pas d'Xw sur Windows NT
@set %WOKSteps_ObjGroup = ""; @set %WOKSteps_ObjGroup = "";
@set %WOKSteps_DepGroup = ""; @set %WOKSteps_DepGroup = "";

View File

@ -22,9 +22,14 @@ sss
@ifnotdefined ( %Xw_WOKUMake_EDL ) then @ifnotdefined ( %Xw_WOKUMake_EDL ) then
@set %Xw_WOKUMake_EDL = ""; @set %Xw_WOKUMake_EDL = "";
-- Use GLX or Cocoa
@ifnotdefined ( %MACOSX_USE_GLX ) then
@set %MACOSX_USE_GLX = "${MACOSX_USE_GLX}";
@endif;
--- Insert your stuff Here --- Insert your stuff Here
@if ( %Station == "wnt" ) then @if ( %Station == "wnt" || (%Station == "mac" && %MACOSX_USE_GLX != "true")) then
@set %WOKUMake_Steps = "*src xcpp.fill(src) xcpp.src(xcpp.fill) xcpp.header(xcpp.fill) .xcpp.template(xcpp.fill) obj.inc"; @set %WOKUMake_Steps = "*src xcpp.fill(src) xcpp.src(xcpp.fill) xcpp.header(xcpp.fill) .xcpp.template(xcpp.fill) obj.inc";
@endif; @endif;
@endif; @endif;