POV-Ray : Newsgroups : povray.programming : POV-Ray C++? : Re: POV-Ray C++? Server Time
19 Apr 2024 17:46:28 EDT (-0400)
  Re: POV-Ray C++?  
From: Le Forgeron
Date: 2 Jan 2012 12:39:35
Message: <4f01ebd7$1@news.povray.org>
Le 02/01/2012 15:48, Warp nous fit lire :
> MiB <nomail@nomail> wrote:
>> However, a quick survey reveals POV-Ray itself is not written in a contemporary
>> object-oriented style; a lot of pointers to structs are handed around, functions
>> manipulating data structures are on a global level and not members of classes.
> 
>   Could you give some clarifying examples of this, as well as a suggestion
> of how it should be done better?
> 
>   (This is not an objection to your claim. I'm just being lazy and don't want
> to wade through the code to see examples, so I'm hoping you could provide
> some.)
> 

I would suggest the pattern structure (so far a fat struct+union):
Pattern_Struct in frame.h (source/backend)

In fact, the evaluation of each pattern goes through  a switch statement
(for each ray, i.e. pixels and sub...), which might be faster (well,
it's only a kind of jump, so maybe not) with a virtual member from an
abstract pattern class, whose actual instance could provides directly.

On the opposite direction, making pattern an abstract class would means
the basic footprint of each instance might be a bit larger (due to the
storage of virtual members in situ).


Post a reply to this message

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