OpenMesh 1.9.5 ported to D

Bill Baxter dnewsgroup at billbaxter.com
Tue Sep 25 14:19:45 PDT 2007


Jascha Wetzel wrote:
> 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.

Good point.

> 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;
> }

Hmm.  Yeh, I guess if you're talking about letting users add extra stuff 
that the mesh internals don't use and aren't aware of, then there's not 
much reason to inject it into the low level.  The above could just as 
well be a user derived class.  No need for the mixin, and certainly no 
need for it to be provided by the library.

>  > http://www.dsource.org/forums/viewtopic.php?p=16708#16708
> 
> the rest of my answer is over there.

Unfortunately "over there" seems to be down right now, so I'll check out 
your reply later.  Ah, the joys of forums...

--bb



More information about the Digitalmars-d-announce mailing list