POV-Ray : Newsgroups : povray.advanced-users : A thought and a question Server Time
21 Jun 2024 16:34:51 EDT (-0400)
  A thought and a question (Message 1 to 6 of 6)  
From: [GDS|Entropy]
Subject: A thought and a question
Date: 3 Dec 2010 06:05:18
Message: <op.vm4w2qc80819q0@gdsentropy.nc.rr.com>
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

From: [GDS|Entropy]
Subject: Re: A thought and a question
Date: 10 Dec 2010 21:12:57
Message: <op.vni1rvn80819q0@gdsentropy.nc.rr.com>
No ideas? :(

Ian

On Fri, 03 Dec 2010 06:05:04 -0500, [GDS|Entropy]  
<gdsHYentropyAThotmailDTcom> wrote:

> 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

From: Christian Froeschlin
Subject: Re: A thought and a question
Date: 11 Dec 2010 16:40:49
Message: <4d03efe1$1@news.povray.org>
[GDS|Entropy] wrote:

> only something of a facsimile reproduction of the .NET fluff.

I think the main two problems for implementing some
of these data structures in SDL are

1. No memory allocation from heap for things like list elements
2. No good way of grouping two values of different type (struct)
    such as key-value pairs in a dictionary.

That said, you probably *could* implement your own memory
allocation in one big array, reference every item of data as
an integer (basically a "pointer") and use this for allocation.
This also gives you untyped "structs" as arrays of integers.

In case the main memory array runs out of free blocks, replace
it with an array of twice the original size, copying the original
contents in the first half.

It's completely insane but you might have a lot of fun with it ;)


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: A thought and a question
Date: 13 Dec 2010 21:53:34
Message: <op.vnonnixi0819q0@gdsentropy.nc.rr.com>
Ah..so it sounds like this would be essentially a boondoggle without a  
patch to povray.. :(

I don't like boondoggles. My typical contract already resembles a Dilbert  
comic (today I was in a meeting to determine who would be in the meeting  
to define a process for deciding if we should pass a 1 or a 100 to a  
particular webservice...*cries*)

Ian

On Sat, 11 Dec 2010 16:40:46 -0500, Christian Froeschlin <chr### [at] chrfrde>  
wrote:

> [GDS|Entropy] wrote:
>
>> only something of a facsimile reproduction of the .NET fluff.
>
> I think the main two problems for implementing some
> of these data structures in SDL are
>
> 1. No memory allocation from heap for things like list elements
> 2. No good way of grouping two values of different type (struct)
>     such as key-value pairs in a dictionary.
>
> That said, you probably *could* implement your own memory
> allocation in one big array, reference every item of data as
> an integer (basically a "pointer") and use this for allocation.
> This also gives you untyped "structs" as arrays of integers.
>
> In case the main memory array runs out of free blocks, replace
> it with an array of twice the original size, copying the original
> contents in the first half.
>
> It's completely insane but you might have a lot of fun with it ;)


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


Post a reply to this message

From: Alain
Subject: Re: A thought and a question
Date: 14 Dec 2010 20:35:03
Message: <4d081b47$1@news.povray.org>

>
> I don't like boondoggles. My typical contract already resembles a
> Dilbert comic (today I was in a meeting to determine who would be in the
> meeting to define a process for deciding if we should pass a 1 or a 100
> to a particular webservice...*cries*)
>
> Ian
>

Are you absolutely sure that Dilbert is'nt in the cubicle next to your's?
By the way, say Hello to Wally and stay well away from Alice ;)



Alain


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: A thought and a question
Date: 17 Dec 2010 19:09:28
Message: <op.vnvupyo50819q0@gdsentropy.nc.rr.com>
Well, honestly...I think Catbert may have transferred to ITSec, as  

Codeplex, Sourceforge, any tech blog, all forums, all newsgroups, MSDN  

library, MSDN social and pretty much anything else of potential use to a
  

developer is blocked. :(

I am flabbergasted that anything but intra-net is allowed at all, given 
 

the totalitarian content filters we have..

Ian

On Tue, 14 Dec 2010 20:35:03 -0500, Alain <aze### [at] qwertyorg> wrote:


>>
>> I don't like boondoggles. My typical contract already resembles a
>> Dilbert comic (today I was in a meeting to determine who would be in 
the
>> meeting to define a process for deciding if we should pass a 1 or a 1
00
>> to a particular webservice...*cries*)
>>
>> Ian
>>
>
> Are you absolutely sure that Dilbert is'nt in the cubicle next to your
's?
> By the way, say Hello to Wally and stay well away from Alice ;)
>
>
>
> Alain


-- 

Using Opera's revolutionary email client: http://www.opera.com/mail/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.