[Verse-dev] Using tags and C++ issues

Samuel Siltanen saasilta at cc.hut.fi
Mon Apr 25 10:56:41 CEST 2005


Hi,

I am working in the Uni-Verse-project at Helsinki University of Technology
and currently my task is to implement a geometry reducer which will be
utilized in acoustics simulation. This reducer should be able to read
geometry and material data from a Verse server, then reduce it, and
finally write it back to a Verse server. There have been a few issues with
which I need some advice.

1) I use C++ and Verse is written in C. In theory, this should not be a
problem, because standard C should be a subset of C++. But in practice,
there are some difficulties. There are several implicit type casts in
Verse code, such as casting -1 to "unsigned int" or casting a function
with arbitrary parameters and return values to "void *". The compiler
which I use (g++ version 3.3.5) does not accept this. It is very
frustrating to go through every source code file to make these casts
explicit. Would it be possible to fix these casts in the code in CVS?

2) I need special parameters for materials such as absorbtion
and diffuse coefficients in addition to the ordinary color values. This is
not supported by Verse protocol at the moment. That is why I decided to
save the materials in tags as strings and then create a special material
layer in the geometry node. This layer includes the tag IDs which can be
referred to find out the material of each polygon face.

The problem which I encountered while testing this approach was that I got
back only a fraction of the materials when reading them back from a
server. I used Connector to make sure that the tags where written
correctly to the server. But when I subscribed the tag group which
included the material tags, I got back only 10-20 % of the tags through
the callback function. I called verse_callback_update(100000) "infinitely"
many times and the result was the same. I was wondering if anyone has
actually tested the tags properly before? (It would be nice to know if the
problem is in my code or in the Verse code.)


Samuel Siltanen


More information about the Verse-dev mailing list