OpenMesh 1.9.5 ported to D

Jascha Wetzel firstname at mainia.de
Mon Sep 24 06:46:34 PDT 2007


Bill Baxter wrote:
>> i'm curious about where it can be taken with D. circulators should 
>> simplify to delegates. maybe some of the traits business can be 
>> simplified as well.
> 
> Well you can't really get rid of the circulators entirely.  Sometimes 
> you want to go around the edges of a vertex more than once.  But "one 
> time around" is certainly the common case.  A second set of functions 
> that provide an opApply for circulators (and iterators) to handle that 
> common case would be nice.

ah, right, and they need some state like the start vertex.
actually, the way they look right now is pretty good.
foreach ( vh; VertexVertexIterT(mesh, start_vh) ) { ... }

>  Or maybe the easiest is to endow the 
> iterators and circulators with an opApply so that this works:
>    foreach(vhandle; mesh.vertices_begin()) {
>       ...
>    }

yep, for those that don't have a state.

>> one of the things i like about OM is the obvious, yet compact and 
>> powerful design for properties. i wish all the standard properties 
>> wouldn't be special cases, though. adding a normal to a vertex should 
>> just be an ordinary property. algorithms that need a certain set of 
>> properties should then be parameterized with property handles.
> 
> Interesting.  Yeh, that might be good.  I haven't really analyzed why 
> they decided to make normals and such special cases.  Aesthetically 
> maybe it's not so great, but is there any major downside?

There wouldn't be any advantage at runtime, but FinalMeshItems and 
AttribKernel would pretty much collapse, simplfying the whole Traits 
stuff a lot. Unless i'm mistaken, the only benefit from having those two 
is to check for availability of standard properties at compile-time.
In D we can have compile-time checks for any property. Here is a prototype:
http://mainia.de/ctprops.d
That way, having standard properties merely means having a convention 
for their names and types. We could therefore easily add a large number 
of standard properties without bloating the lib and loose a lot of 
Traits complexity at the same time - D rules :)

> Cool.  I wrote a sort of debugger while I was working on my thesis.  And 
> it certainly saved my butt - http://www.billbaxter.com/projects/imdebug. 
>  Debugging GPGPU algos before I had that to use was killing me.

looks interesting. i will try that one next time i do some gpgpu stuff. 
last time i wrote a lot of test code to check the output - tedious...



More information about the Digitalmars-d-announce mailing list