|
|
Greetings all,
I am glad to see many of my favorite artists still reside here. :)
Truly, it is hard to stay active with real life in the way; I have married
and fathered a son since my last post, lol!
The other day I was mentioning the pov NGs to my wife, and I noticed that
I seem to only be active during the winter months where I live (east
coast, USA), and while I am sure there is some interesting psychological
reason for this (especially given that most of my images subject matter
revolves around randomness, cold, fog, dark and Christmas light like glows
etc..), that is beside the point.
I was wondering..
There are a number of programs I have written in C#.NET (Paul Bourke and
Paul Nylander have been wonderful resources, so thanks if you happen to
read this) which use extensively constructs such as the following:
1) Dictionary<T,T>
Recently I was using a Dictionary<string, Dictionary<string, Vector>> for
diffusion limited aggregation based data modeling and insurgent movement
scenario simulation
(where Vector is something like <[0,0],[0,0],[0,0]>; I have created types
to handle various levels of multidimensionality..but whatever)
2) List<T>
I use this much of the time
3) Tree<T>
See:
http://dvanderboom.wordpress.com/2008/03/15/treet-implementing-a-non-binary-tree-in-c/
4) Enum stuff
DLAValues.DLASeedShapes seedShape =
(DLAValues.DLASeedShapes)Enum.Parse(typeof(DLAValues.DLASeedShapes),
seedShapecomboBox.SelectedValue.ToString(), true);
I was wondering the best way (is it possible without patching?) to
implement (any/all of) them in SDL, as it would make much of what I would
like to do in pov *very* easy.
I am pretty familiar with the SDL construct:
#declare foo = array [n];
The SDL array is at its base pretty similar to the array in C#, though I
am not so sure of any implementation of things like the .NET IComparable,
IEnumerable, IEqualityComparer and misc System.Collections features (they
are just icing; work already done for you, anyway). I guess I would need
to make macros for those, though strong typing, abstract methods and
generics could be issues..so I don't really care about full/robust
implementations just yet; only something of a facsimile reproduction of
the .NET fluff.
At any rate, most of this seems possible and perhaps even not too hard.
I love being able to do things like this:
foreach (KeyValuePair<string, Dictionary<string, Vector>>
pair0 in masterVectorList)
{
// identify vector to which the following vectors are
deemed adjacent
foreach (KeyValuePair<string, Vector> pair1 in
pair0.Value)
{
// do some stuff with the data
}
}
While I am pretty sure pov doesn't care *what* goes into a particular
index of an array (providing the type remains consistent), hence the
possibility of making this happen somewhat easily, I am also sure the SDL
array constructs aren't quite so usable as they could be for many cases..
To be sure, I am not the only one who has had need of these sorts of
things..or even had these ideas...so I would love to see some discussion
on how these things could be, or have been done.
*What* I want to do specifically is irrelevant, my only focus here is pov
SDL programming theory...and maybe the chance of making some cool macros.
:P
Ian McDonald
--
Using Opera's revolutionary email client: http://www.opera.com/mail/
Post a reply to this message
|
|