View Issue Details

IDProjectCategoryView StatusLast Update
0021985CommunityOCCT:Visualizationpublic2013-04-29 15:21
ReportersanAssigned Toaba 
Status closedResolutionfixed 
OSWindows NT 
Target Version6.6.0Fixed in Version6.6.0 
Summary0021985: Vista/WIndows 7 compatibility issues reported by the community
DescriptionThere are several compatibility issues reported by the community for OCCT
visualization component.

1. OCC 6.3.1 Windows7 bug

In order to be able to load one of our OCC based DLL’s in Windows 7, we needed
to modify src\Graphic3d\Graphic3d_WNTGraphicDevice.cxx.

Around line 51 we changed:

  Standard_CString TheShr = getenv("CSF_GraphicShr");
  if ( ! TheShr )
    TheShr = "TKOpenGl.dll";


  Standard_CString TheShr = getenv("CSF_GraphicShr");
  if ( ! TheShr || (strcmp(TheShr,"")==0) )
    TheShr = "TKOpenGl.dll";


SAN: I believe strlen(TheShr) == 0 is a more natural way to check for an empty

2. About compatibility with Windows 7


I have now compiled under Windows 7, using OpenCascade 6.3.0
I have noticed the following problem:

The function WNT_Window:: Dump does not work correctly.
This function is used in the MFC standard example 01_Geometry, where it
is called from menu option File>>Export>>Image...
The problem is that instead of the correct image of the drawing window
it produces an empty grey image.

The same problem exists in Windows Vista.
There is no problem for Windows XP.


SAN: In order to approach the problem, it is necessary to revise all OCCT API
methods related to 2D/3D scene dump creation and eliminate duplicated
functionality (if any) in WNT/Xw/OpenGl packages, keeping e.g. only the
following imlementations (to be discussed):
- Reading window pixels directly.
- Redrawing window contents to an off-screen bitmap (suitable for non-OpenGL
scene only!).
- Redrawing OpenGL scene contents to a framebuffer object (FBO) and reading its
TagsNo tags attached.
Test case number

Attached Files

  • psn_OCC21985_v1_1.tar (10,240 bytes)


2010-08-27 10:53


psn_OCC21985_v1_1.tar (10,240 bytes)


2012-02-06 08:24

manager   ~0019400

As of OCCT 6.5.2: point 1 is fixed, point 2 is still there


2012-11-14 15:29

developer   ~0022240

Dear aba,

Could you, please, review OCCT samples and replace all occurrences of WNT_Window::Dump() with V3d_View::ToPixMap() calls?


2012-11-15 11:38

developer   ~0022256

In OCCT samples with 3d visualization all WNT_Window::Dump method calls were replaced with V3dView::Dump method calls.

In 2d visualization OCCT sample Viewer2d in OCC_2dView.cpp WNT_Window::Dump method call wasn't replaced.

The methods WNT_Window::Dump and V3dView::Dump were checked:
OnFileExportImage() message handlers provide possibility to export models in files with .bmp, .gif and .xwd extensions, but during image saving (in Image_AlienPixMap::Save method) FreeImage_GetFIFFromFilename method recognizes .xwd extension as FIF_UNKNOWN and therefore it isn't possible to export in .xwd file.

The Git branch CR21985 is ready to be reviewed.
Dear san. please review.


2012-11-15 19:08

developer   ~0022273

Branch CR21985 reviewed with the following remark.

Modified files:


now contain the same line:


C-style casting to Standard_CString from LPCTSTR that can point to a Unicode string if UNICODE is defined is unsafe.
KGV suggests removing both casts:


In such a case compiler will inform a developer if an attempt to pass a Unicode string to non-Unicode function is being made.
Otherwise, corrupted Unicode data will be passed as a regular C-style string to V3d_View::Dump() method.


2012-11-20 10:53

developer   ~0022303

The Git branch CR21985 was updated.
Casts to LPCTSTR and Standard_CString were removed.

Dear san, please review.


2012-11-20 15:40

developer   ~0022311

Dear aba,

In file OCC_3dView.cpp, 155-182:
> filter = _T("BMP Files (*.BMP)|*.bmp|GIF Files (*.GIF)|*.gif|XWD Files
>(*.XWD)|*.xwd|PS Files (*.PS)|*.ps|EPS Files (*.EPS)|*.eps|TEX Files
>(*.TEX)|*.tex|PDF Files (*.PDF)|*.pdf|SVG Files (*.SVG)|*.svg|PGF Files
> ...
> char* theFile = new char[filename.GetLength()+1];
> //_tcscpy(theFile,filename);
> strcpy_s(theFile,filename.GetLength()+1,filename);
> CString ext = dlg.GetFileExt();
> if (ext == "ps" || ext == "emf")
> {
It seems that this extension detection is incomplete:
- SetCursor() is not called within Export() scenario.
- Export function should be used for extensions PS, EPS, TEX, PDF, SVG, PGF, EMF.
- String comparison should be case-insensitive.
- theFile variable looks redundant here.
- Please rename "filename" variable to "aFileName".

File AnimationView3D.cpp, 241-244 and GeometryView.cpp, 80-83, OCC_3dView.cpp:
>void CAnimationView3D::OnFileExportImage()
> OFN_OVERWRITEPROMPT, _T("BMP Files (*.BMP)|*.bmp |GIF Files (*.GIF)|*.gif
>| XWD Files (*.XWD)|*.xwd||"), NULL );
Please extend list of supported extensions (based on FreeImage).


2012-11-21 10:48

developer   ~0022321

Just a question to everybody: is the list of supported export image file formats documented anywhere?
Or should one check vdump DRAW command of FreeImage headers each time?
Is not it worth adding this information to Image_AlienPixMap.hxx?


2012-11-21 11:33

developer   ~0022325

Dear aba,

please add information about following supported formats to Image_AlienPixMap documentation and use it in the samples (notice that there are no XWD format):
*.bmp - bitmap image, lossless format without compression.
*.ppm - PPM (Portable Pixmap Format), lossless format without compression.
*.png - PNG (Portable Network Graphics) lossless format with compression.
*.jpg, *.jpe, *.jpeg - JPEG/JIFF (Joint Photographic Experts Group) lossy format (compressed with quality losses). YUV color space used (automatically converted from/to RGB).
*.tif, *.tiff - TIFF (Tagged Image File Format).
*.tga - TGA (Truevision Targa Graphic), lossless format.
*.gif - GIF (Graphical Interchange Format), lossy format. Color stored using pallete (up to 256 distinct colors).
*.exr - OpenEXR high dynamic-range format (supports float pixel formats).


2012-11-21 18:53

developer   ~0022336

The Git granch CR21985 was modified.

In files OCC_3dView.cpp, AnimationView3D.cpp and GeometryView.cpp:
  1)in OnFileExportImage() methods lists of supported extensions were extended according to FreeImage supported image formats.
  2)'filename' variable was renamed to 'aFileName'

In OCC_3dView.cpp:
1)In Export() function is used for PS, EPS, TEX, PDF, SVG, PGF and EMF extensions.
2)In condition checking supported for Export() function formats case-insensitive string comparison was added.
3) 'theFile' variable was removed, and the only 'aFileName' variable is used for both Export() and Dump() methods

Please review.


2012-11-21 21:40

developer   ~0022337

Branch CR21985 reviewed without remarks, ready for testing.


2012-12-05 11:09

developer   ~0022561

Dear bugmaster,

Why this issue is suspended?
Note that it has been waiting for testing for two weeks.


2012-12-05 16:36

developer   ~0022571

Dear aba,

Could you please update the supported image file types and file filters for 2D viewer samples, too?


2012-12-05 17:32

developer   ~0022575

The supported image file filter for 2d samples in OCC_2dView::OnFileExportImage() method was extended with formats supported by FreeImage (bmp, gif, png, jpeg, ppm, tiff, tga, exr).

The Git branch CR21985 was updated.
Dear san, please review.


2012-12-06 15:28

developer   ~0022593

Branch CR21985 reviewed without remarks, ready for testing.

Related Changesets

occt: master 3994ec41

2012-12-07 10:21:46


Details Diff
0021985: Vista/WIndows 7 compatibility issues reported by the community

WNT_Window::Dump method calls were replaced with V3dView::Dump calls
Type casts were removed
Added supported image formats in file filters of Export methods, edited documentation for Image_AlienPixMap class
Supported image formats filter for 2dsample was extended
Affected Issues
mod - samples/mfc/standard/01_Geometry/src/GeometryView.cpp Diff File
mod - samples/mfc/standard/09_Animation/src/AnimationView3D.cpp Diff File
mod - samples/mfc/standard/Common/OCC_2dView.cpp Diff File
mod - samples/mfc/standard/Common/OCC_3dView.cpp Diff File
mod - src/Image/Image_AlienPixMap.hxx Diff File

Issue History

Date Modified Username Field Change
2010-08-26 19:06 san CC => psn
2010-08-27 10:58 bugmaster Assigned To bugmaster => psn
2010-08-27 10:58 bugmaster Status new => assigned
2011-08-02 11:24 bugmaster Category OCCT:VIZ => OCCT:Visualization
2012-01-13 15:53 ysn Project Open CASCADE => Community
2012-02-06 08:24 abv Note Added: 0019400
2012-10-23 11:25 abv Assigned To psn =>
2012-10-23 11:25 abv Fixed in Version EMPTY =>
2012-10-23 11:25 abv Target Version => Unscheduled
2012-10-23 11:25 abv Description Updated
2012-11-13 20:19 san Assigned To => abdelrazzak
2012-11-13 20:19 san Assigned To abdelrazzak => aba
2012-11-14 15:29 san Note Added: 0022240
2012-11-15 11:38 aba Note Added: 0022256
2012-11-15 11:38 aba Assigned To aba => san
2012-11-15 11:38 aba Status assigned => resolved
2012-11-15 19:08 san Note Added: 0022273
2012-11-15 19:08 san Assigned To san => aba
2012-11-15 19:08 san Status resolved => assigned
2012-11-20 10:53 aba Note Added: 0022303
2012-11-20 10:54 aba Assigned To aba => san
2012-11-20 10:54 aba Status assigned => resolved
2012-11-20 15:40 kgv Note Added: 0022311
2012-11-20 15:40 kgv Assigned To san => aba
2012-11-20 15:40 kgv Status resolved => assigned
2012-11-21 10:48 san Note Added: 0022321
2012-11-21 11:33 kgv Note Added: 0022325
2012-11-21 18:53 aba Note Added: 0022336
2012-11-21 18:53 aba Assigned To aba => san
2012-11-21 18:53 aba Status assigned => resolved
2012-11-21 21:40 san Note Added: 0022337
2012-11-21 21:40 san Assigned To san => bugmaster
2012-11-21 21:40 san Status resolved => reviewed
2012-12-05 11:09 san Note Added: 0022561
2012-12-05 11:09 san Status reviewed => feedback
2012-12-05 11:15 kgv Target Version Unscheduled => 6.6.0
2012-12-05 16:36 san Note Added: 0022571
2012-12-05 16:36 san Status feedback => assigned
2012-12-05 16:36 san Assigned To bugmaster => aba
2012-12-05 17:32 aba Note Added: 0022575
2012-12-05 17:33 aba Assigned To aba => san
2012-12-05 17:33 aba Status assigned => resolved
2012-12-06 15:28 san Note Added: 0022593
2012-12-06 15:28 san Assigned To san => bugmaster
2012-12-06 15:28 san Status resolved => reviewed
2012-12-07 14:21 bugmaster Status reviewed => tested
2012-12-10 17:16 aba Changeset attached => occt master 3994ec41
2012-12-10 17:16 aba Assigned To bugmaster => aba
2012-12-10 17:16 aba Status tested => verified
2012-12-10 17:16 aba Resolution open => fixed
2013-04-23 13:37 aiv Status verified => closed
2013-04-29 15:21 aiv Fixed in Version => 6.6.0