POV-Ray : Newsgroups : povray.binaries.programming : My idea: Developers need tips! Help me, please! : Re: My idea: Developers need tips! Help me, please! Server Time
19 May 2024 16:11:58 EDT (-0400)
  Re: My idea: Developers need tips! Help me, please!  
From: clipka
Date: 2 Oct 2016 10:33:27
Message: <57f11ab7$1@news.povray.org>
Am 01.10.2016 um 20:31 schrieb LanuHum:

> No, I will not understand your code. Very confusing.
> What would be said Gerbert Shildt, if you saw your code?

(BTW, I suspect you mean Herbert Schildt. It seems that "Gerbert Shildt"
is a back-transcription of the name's transcription to Cyrillic script.)

> Macros - evil. It is neither for you.
> 
> Where similar to this?
> 
> //Scene.h
> #include <vector>
> #include "Camera.h"
> #include "Light.h"
> #include "Object.h"
> #include "Pigment.h"
> #include "Normal.h"
> #include "Finish.h"
> #include "Texture.h"
> 
> using namespace std;
> 
> class Scene {
> public:
>     Camera              camera;
>     vector<Light*>      lights;
>     vector<Object*>     static_objects;
>     vector<Object*>     animate_objects;
>     vector<Pigment*>    pigments;
>     vector<Normal*>     normals;
>     vector<Finish*>     finishes;
>     vector<Texture*>    textures;
> 
>                         Scene();
>                         ~Scene();
> };
> 
> In vain I try to.  :((((((((((((((

Didn't I tell you so?

POV-Ray originated 30 (!) years ago as a C project, and still contains
plenty of C-isms to this day.

As I've mentioned numerous times, efforts to clean up the code are in
progress but still far from completed.


That said, the thing you are looking for is the class `SceneData`
declared in `source/core/scene/scenedata.h`, and at that level it's not
/too/ far from what you're looking for -- with the notable exception
that POV-Ray does not manage textures, pigments etc. as indices into a
"library", but rather as direct references (i.e. pointers) to texture
objects. Also, `SceneData` contains a bit more stuff.


Post a reply to this message

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