OpenMesh 1.9.5 ported to D
Jascha Wetzel
firstname at mainia.de
Tue Sep 25 05:36:32 PDT 2007
Bill Baxter wrote:
> I went ahead and added those opApplys to the iterators after your
> suggestion.
ah, ic. i was already wondering there :)
>>> 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.
>
> They all have a state. You mean for those that don't need a particular
> starting state?
no, i mistakenly assumed there might be circulators without state. then
we could have had methods for the mesh class, that return delegates that
can be used in foreach loops.
> Apart from the properties I think it might be nice if you could supply a
> template mixin to the Mesh, and it would mix that for you. In that way
> you can inject whatever you want into your MyMesh type. In C++ I'd make
> it a base class alongside the PropertyContainer thing. But no MI in
> D... Maybe PropertyContainer could be a member of the mesh instead of a
> base.
actually, since the prototype does not distinguish between vertex-,
halfedge- and face-properties, making the PropertyContainers members is
mandatory anyway.
besides that, i think the easiest way to add mixins is to have a wrapper
template:
class MixinMesh(alias MT, P=DEF_PROPS!(), T...) : Mesh!(P,T)
{
mixin MT;
}
> http://www.dsource.org/forums/viewtopic.php?p=16708#16708
the rest of my answer is over there.
More information about the Digitalmars-d-announce
mailing list