Porting PHIGS application from OSF/1 and VMS to AIX

ITEM: RTA000065363



We are converting a 2D application using PHIGS to RS/6000 AIX 3.2.5.            
The program runs on DEC VMS and OSF/1.  The program opens a workstation         
using a PIXMAP id and DISPLAY id.  All display functions are done in            
immediate mode, and the pixmap is then copied to the window that the            
user sees.  Auxiliary pixmaps contain hard-to-reproduce graphic data            
(backgrounds of maps).  They are used to "clear" areas of the picture.          
                                                                                
We encountered a number of problems in porting to AIX graPHIGS.                 
The main problem is that a PIXMAP cannot be opened as a workstation.            
A WINDOW may be opened, but not a PIXMAP.  If there is some way to do           
it in graPHIGS, please let us know.                                             
                                                                                
We decided that the way to overcome this limitation is to go to PEX,            
which does support PIXMAP as a workstation.  We also realized that              
we should work on the level of renderers, and not a workstation, since         
we do not have any structures.                                                  
                                                                                
We took the examples cube.c and fillAreaSet2D.c as templates.                   
As mentioned earlier, our application is 2D.  PEX gives us the ability          
to write a pixmap.                                                              
                                                                                
We are first attempting to convert a utility that creates symbols,              
rather than the much larger application, although we must keep in mind          
the requirements of the larger application.  Our symbol utility uses            
a rectangular pixmap, but we expose only a square portion of it.                
When we try to draw a grid, the grid has the same aspect ratio as               
the entire pixmap, and not the aspect ratio of 1:1, as we expect.               
                                                                                
We tried to adjust the viewport using PEXRAViewport mask and the                
viewport field of the renderer characteristics record.  We also tried          
using the NPCSubVolume field and mask.  Neither has any effect on the           
picture.                                                                        
                                                                                
We observed a problem in trying to manipulate the contents of the               
pixmap which we gave to PEX as a drawable.  We performed the following          
steps:                                                                          
                                                                                
 1. Draw a symbol on the pixmap using fill areas in PEX.                        
 2. Clear the pixmap after the user decides to draw a new symbol.               
    This was done by a simple XClearArea on the pixmap that we created.         
 3. Draw a new symbol using PEX.                                                
                                                                                
The result is that the pixmap which we recognize has both the old               
symbol and the new symbol.  Apparently, PEX has an auxiliary pixmap             
for drawing, and it was not cleared.                                           
                                                                                
This is unacceptable in the larger application, since we will be                
copying parts of a map onto the working pixmap area, and then using             
PEX to recreate foreground graphics.                                            
                                                                                
Your help will be greatly appreciated.                                          
                                                                                
                                                                                
ANSWER                                                                          
1) Q: Must we use PEX to open a PIXMAP as a workstation?                        
   A: Yes.  graPHIGS does not support this.                                     
                                                                                
2) Q: When we expose only a small square portion of a rectangular               
      pixmap and try to draw a grid, the grid's aspect ratio is                 
      the same as that of the pixmap, not 1:1 as we expect.                    
   A: We will require a small test case to solve this.  Please                  
      provide us with code and compiling instructions which can                 
      recreate the problem.  The test case should be no longer                  
      than 2 pages.  Test cases longer than 2 pages will be                     
      classified as debugging cases which are not appropriate for               
      this support facility.                                                    
                                                                                
      If you have access to a VM account, you can send the test                 
      case to me at AUSVMR(GPFEFFER).  If you do send the test                  
      case this way, please reopen the item so that if anything                 
      goes wrong and I fail to receive the file, I will know to                 
      ask you to resend it.                                                     
                                                                                
3) Q: Apparently, PEX has an auxiliary pixmap for drawing.  How do              
      we clear the pixmap so that we erase previous symbols?                   
   A: We are still researching this.  We will append our response               
      as soon as possible.                                                      
                                                                                
                                                                                
ANSWER                                                                          
Answer to number 3:                                                             
                                                                                
We have had some difficulty in determining exactly what you are                 
doing, so we may need a testcase.  We do, however, have the                     
following suggestion: Please verify that your edit mode has been                
set to replace.  When a PHIGS function creates a new element, the               
current edit mode determines whether the new element is inserted                
after or replaces the element pointed to by the current pointer.  By            
default, the edit mode will be set to insert.  XClearArea will not              
delete an element in a PEX structure.  You will need to either use             
PEXDeleteElements or use PEXSetEditingMode and set the edit mode to             
replace.                                                                        
                                                                                
If your edit mode is set to replace, and you are still having a                 
problem, then please send in a testcase.                                        
                                                                                
Thank you.                                                                      
                                                                                
S e a r c h - k e y w o r d s:                                                  
PEX                                                                             
                                                                                
                                                                                
                                                                                
                                                                                
                                                                               


WWQA: ITEM: RTA000065363 ITEM: RTA000065363
Dated: 02/1996 Category: ITSAI6000GR
This HTML file was generated 99/06/24~12:43:24
Comments or suggestions? Contact us