[PyKDE] Heirarchy of header files !!

satish k.chimakurthi skchim0 at engr.uky.edu
Fri Aug 15 15:17:01 BST 2003


Hello all,

I am pleasantly surprised to see the tremendous amount of response that I 
received for the problem. As a matter of fact, I have been trying to use 
SWIG, Boost.Python, but then, there was no proper example like I have PyQT in 
the case of SIP...somehow, I AM MORE DETERMINED TO USE ONLY SIP NOW.

It's been 15 days since I started working on my problem using other tools, but 
was not successful.  I, therefore, really need real help from all of you now, 
please. 

Please be patient enough to read my mail which is extra-long, and help me. I 
have a purely MECHANICAL ENGG.BACKGROUND..but am constrained to do a lot of 
software stuff in my project ... so am just learning...please don't mind if 
you find my questions * vague / trivial / stupid * .

I wish to explain my problem in elaborate terms 


1. The C++ software that I am using (OVERTURE-www.llnl.gov/casc/Overture) has 
an "/include" directory in which all the headerfiles are present..each 
headerfile in turn contains classes with methods and functions used

2. There is another directory "/Mapping" which contains the function 
definitions 

3. There are few other directories in which "function definitions" used in the 
headerfiles are present

For example:

In "include" directory there is a headerfile named "SquareMapping.h"
In "SquareMapping.h" there are calls to many functions like 
"SquareMapping(const real xa=0, const real xb=1.,);

The corresponding function definition of "SquareMapping" is being provided in 
the software in a seperate directory named "Mapping" under the name 
"SquareMapping.C" ( Please look at the attached file "SquareMapping.C")

In a similar fashion, every header file has many functions ( ofcourse, I need 
very very few of them ) and all these functions are defined in different 
directories similar to "Mapping"


Now, the way I use this software is like :

I write a program of my own using this framework of classes and functions 
( please look at "gridGenExample.C" which I attach herewith )...

In this program i.e "gridGenExample.C" , I use classes (defined in the 
headerfiles of "/include" directory) to declare objects and then use various 
functions and methods relevant to my application.

Like for instance I did the following in "gridGenExample.C"

SquareMapping map1(-1., 1., -1., 1.) ; //Created an instance of class  

map1.setGridDimensions(axis1,21);   //using method "setGridDimensions"


PLEASE LOOK INTO "gridGenExample.C" to get clearer idea. 

After writing a program like this, I use my "Makefile" to dynamically link 
this to the software and compile it and thus my job is done...


Now, my aim is to do the same thing from PYTHON instead of having to do all 
this interactively..I also need to do lot of coding in Python for some 
flexible grid generation needed for my application.  THIS HAS PROMPTED ME TO 
GO FOR WRAPPING THE SOFTWARE CODE TO PYTHON AND USE SIP FOR THE SAME.

I hope I could communicate my problem clearly. This is the background of the 
entire problem.


Now, In order to realise this,  I started looking into SIP documentation and 
example problems. I have downloaded "PyQT" module from the internet and "qt" 
is already installed in my system ( I work with RH 7. 3) 


I took hardcopies of a few ".sip" files from the "/sip" directory of "PyQt" 
and the corresponding ".h" files from the "qt" directory. This is the only 
source of reference for me.


I have understood that the first step while using SIP is to write ".sip" file 
to every ".h" file that I intend to use. With this in mind, I have created a 
seperate directory called "/SIP" in my HOME.  I copied a few header files 
"SquareMapping.h", "AnnulusMapping.h" and some more from the "/include" 
directory.......I, then, wrote '.sip' file corresponding to every '.h' file 
that I have...

KINDLY LOOK AT "SquareMapping.sip" corresponding to "SquareMapping.h" (both 
attached herewith)

For "gridGenExample.C (which is the code that I said I wrote for my 
application ) to run, it seems to be needing information from about 10 
headerfiles. I drew the tree of dependencies on a sheet of paper and as 
suggested by Mr.Jim, I resorted to "HEADER HIDING"...I went to the actual 
installation directory of the software and then,  accessed the "/include" 
directory's header files and commented certain unwanted headers in them 
(albeit, I am not sure as yet which is required and which is not)...

For instance, I have a header file named "Overture.h"...this header is 
included in my code i.e "gridGenExample.C"...I found that "Overture.h" in 
turn included other headers like "GenericGrid.h" and so on so forth...I went 
ahead and as Mr. Jim said, commented them (equals to hiding them, I suppose), 
Since I don't seem to be using the classes defined in them

I have written '.sip' files for all the headerfiles that I included in 
'gridGenExample.C' and a few more one's which are in the heirarchy..

This is it...I now,  don't know how to go ahead and what to do next....I don't 
know how to take care of all these files I afore-mentioned.....I don't know 
if my ".sip" files are correct or not....not clear about the actual procedure 
to solve my problem.....


Can someone advise me as to what I need to do ?? Please be kind enough to 
explain the entire strategy / procedue that I need to adopt, to tackle my 
problem,  in detail...

I am really frustrated with my own helplessness to do my task even after 15 
days....Frankly, There was no proper help from other mailing list's for my 
problem........


SORRY AGAIN AND AGAIN for the lengthy mail and numerous attachments...


Thank you all for your tremendous patience and help and time,

With Best Personal Regards,

Sincerely Yours,
SATISH

PS: I have attached all header files that I include in my code 
"gridGenExample.C".....These header files are modified by commenting in the 
source directory itself


-------------- next part --------------
A non-text attachment was scrubbed...
Name: SquareMapping.C
Type: text/x-c++src
Size: 10956 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030815/6e4a1d10/SquareMapping.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SquareMapping.sip
Type: text/x-c++src
Size: 609 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030815/6e4a1d10/SquareMapping-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SquareMapping.h
Type: text/x-chdr
Size: 2209 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030815/6e4a1d10/SquareMapping-0002.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gridGenExample.C
Type: text/x-c++src
Size: 1549 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030815/6e4a1d10/gridGenExample.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ogen.h
Type: text/x-chdr
Size: 13487 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030815/6e4a1d10/Ogen.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DataFormats.h
Type: text/x-chdr
Size: 3069 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030815/6e4a1d10/DataFormats.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AnnulusMapping.h
Type: text/x-chdr
Size: 2237 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030815/6e4a1d10/AnnulusMapping.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Overture.h
Type: text/x-chdr
Size: 341 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030815/6e4a1d10/Overture.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ogen.sip
Type: text/x-csrc
Size: 422 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030815/6e4a1d10/Ogen-0001.bin


More information about the PyQt mailing list