View Issue Details

IDProjectCategoryView StatusLast Update
0007696CommunityOCCT:Visualizationpublic2013-04-11 10:49
ReporterabvAssigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionno change required 
OSAll 
Target Version6.7.0 
Summary0007696: Printing from 2d view
DescriptionThis improvement suggestion by Dmytro Medvedenko comes from OCC Forum thread 6805:
http://www.opencascade.org/org/forum/thread_6805

See also related thread 5898: http://www.opencascade.org/org/forum/thread_5898

---------

First, there is an error in WNT_GraphicDevice.cxx. A line

if ( GetObject ( hBmp, sizeof ( BITMAP ), &bm )) {

should be at least like this

if ( GetObject ( hBmp, sizeof ( BITMAP ), &bm ) && bm.bmWidth>1 && bm.bmHeight>1) {

The second error is in WNT_DDriver.cxx. Lines

Standard_Boolean fSpoolRes1 = DoSpool ( fOrigSize, aPlotMode );
Standard_Boolean fSpoolRes2 = (aPlotMode == Aspect_PM_FILEONLY ?
Standard_True :
DoSpool ( fOrigSize, Aspect_PM_FILEONLY )
);
return (fSpoolRes1 & fSpoolRes2);

should be changed to

return DoSpool ( fOrigSize, aPlotMode );

Then printout is very simple:

Handle(WNT_DDriver) aPrintDriver = new WNT_DDriver("Lexmark Z25-Z35", "c:\\Occ",
WNT_OT_PORTRAIT,1);
myV2dView->PlotScreen(aPrintDriver);
aPrintDriver->Spool(Aspect_PM_DPLOTTER);

Note the path cannot contain an extension.

Executing WNT_DDriver::Spool() has some instability when printing to file. The
matter is backslashes in OpenCascade paths are always converted to slashes /.
The result is path for .prn - file always contain slashes instead of
backslashes. Not all printer drivers can manage this. E.g. my "HP Color LaserJet
PS" driver succeeded to form a *.prn file, and the "Lexmark Z25-Z35" failed. It
seems one has to make the OSD_Path class to use backslashes instead of slashes.

------------

Comment by ABV: the feasibility of this improvement shall be checked by
visualisation experts
Additional information
and documentation updates
Documentation remark, added by apl 2011-04-25 12:12:01:

Changes:
There are following changes in packages:
WNT package:
  1) WNT_GraphicDevice now checks on initialization if the given DeviceContext
     (HDC or Aspect_Handle) is a printer device context, so GraphicDevice could
     initialize itself (its width and height) correctly taking into account the
     printer capabilities.
  2) WNT_DDriver can Spool the viewer's content into the file using the printer
     driver. Now it converts the output path's slashes to windows style, this
     path then used by the printer driver to produce the output file.
TagsNo tags attached.
Test case number

Attached Files

  • apl-OCC7696-v1.tar.gz (37,130 bytes)

Relationships

related to 0023663 closedaba Open CASCADE Removing 2D viewer library 

Activities

2011-04-25 14:14

 

apl-OCC7696-v1.tar.gz (37,130 bytes)

bugmaster

2011-08-09 16:11

administrator   ~0017945

1. Provide fix code/Draw script for creating testing case.
2. Prepare branch from apl-OCC7696-v1.tar.gz
3. Try to ask SAN to revise the fix

san

2012-02-23 19:15

developer   ~0019767

Reminder sent to: apl

Dear APL,

Is it possible to finalize correction of this issue quickly?

apl

2013-04-09 17:26

developer   ~0024057

Dear Bugmaster,

Could you please close this issue?

2D view support has been removed from OCC (ref issue 0023663).

bugmaster

2013-04-11 10:49

administrator   ~0024083

Issue is closed because 2D view support has been removed from OCC

Issue History

Date Modified Username Field Change
2005-01-12 16:11 bugmaster Status closed => assigned
2005-01-12 16:11 bugmaster Resolution suspended => @0@
2005-01-12 16:11 bugmaster Assigned To bugmaster => san
2005-03-21 10:33 san Assigned To san => skt
2008-10-03 12:18 bugmaster Assigned To skt => san
2011-04-07 18:10 bugmaster Assigned To san => apl
2011-04-25 14:45 apl Status assigned => resolved
2011-08-02 11:24 bugmaster Category OCCT:VIZ => OCCT:Visualization
2011-08-09 16:11 bugmaster Note Added: 0017945
2011-08-09 16:11 bugmaster Status resolved => assigned
2011-09-20 17:34 szy Fixed in Version EMPTY =>
2011-09-20 17:34 szy Target Version => 6.5.2
2011-09-20 17:34 szy Description Updated
2011-09-20 17:34 szy Additional Information Updated
2011-09-21 11:13 bugmaster Target Version 6.5.2 => 6.5.3
2011-11-23 16:59 szy Additional Information Updated
2012-02-09 08:52 abv Target Version 6.5.3 => 6.5.4
2012-02-23 19:15 san Note Added: 0019767
2012-10-23 19:33 abv Target Version 6.5.4 => 6.6.0
2013-02-26 16:10 abv Target Version 6.6.0 => 6.7.0
2013-04-09 17:23 apl Relationship added related to 0023663
2013-04-09 17:26 apl Note Added: 0024057
2013-04-09 17:26 apl Assigned To apl => bugmaster
2013-04-09 17:26 apl Status assigned => feedback
2013-04-11 10:49 bugmaster Note Added: 0024083
2013-04-11 10:49 bugmaster Status feedback => closed
2013-04-11 10:49 bugmaster Resolution fixed => no change required