POV-Ray : Newsgroups : povray.programming : Modify source code of program POVRAY + MPI (please Help) : Re: Modify source code of program POVRAY + MPI (please Help) Server Time
24 Jun 2021 08:12:57 EDT (-0400)
  Re: Modify source code of program POVRAY + MPI (please Help)  
From: clipka
Date: 4 Jun 2014 00:49:26
Message: <538ea556$1@news.povray.org>
Am 04.06.2014 02:03, schrieb gaprie:

> I tried to define a variable which have value Start_Row. I define variable
> 'kPOVAttrib_Top =50' and 'kPOVAttrib_Bottom=200' (in file source / backend /
> view.cpp) but after I build the POVRay, it be error. In the file source / base /
> processoptions.cpp,  I could not find where the variable that contains the value
> (as Start_Row) which I can modif.

Heh - now that would be too easy, wound't it? :-P

Unfortunately I'm not too deep into the whole POVMS stuff myself, so I 
have to learn myself while I guide you through this.

The processoptions stuff is ultimately called by the vfeSession, so we 
need to reproduce what that does; let's look at vfeSession::SetOptions() 
in vfe/vfecontrol.cpp:

- First, it creates a new POVMSObject using the POVMSObject_New 
function; this will be a message sent to the render engine. The 
kPOVObjectClass_RenderOptions enum value is a kind of message type 
identifier.

- Next, it attaches a parameters to this message, using 
POVMSUtil_SetInt(); the parameter is identified by the enum value 
kPOVAttrib_MaxRenderThreads as the maximum number of threads to use. 
(This is a machine-specific default, and may later be overridden by INI 
or command-line options.)

- Next, it loops over all INI files, and calls 
vfeProcessRenderOptions::ParseFile() for each of them. This is an 
inherited method, and is actually ProcessOptions::ParseFile(). If we dig 
through that method and its call hierarchy, we'll find out that it also 
ultmately calls POVMSUtil_SetInt(), or one of its siblings: 
POVMSUtil_SetFloat(), POVMSUtil_SetBool(), POVMSUtil_SetString(), or 
POVMSUtil_SetUTF8String().

- What vfeSession::SetOptions() then does is mainly calling 
POVMSUtil_GetXXX() functions; this way, it retrieves the parameters just 
attached by ProcessOptions::ParseFile() from the yet-unsent message.

- Another step performed by vfeSession::SetOptions() might be easily 
overlooked:

     POVMS_Object ropts (obj) ;

Note that while obj is of type POVMSObject, ropts is of type 
POVMS_Object. Fun, huh? :-P What that class does is... well, I actually 
have no clear idea :) But browsing through povmscpp.h, in which that 
type is defined, we find that its parent class POVMS_Container has some 
friend functions called POVMS_SendMessage(), so it is apparently tied to 
the actual sending of the message.


And this is where I quit the hunt for now, and leave it up to you to 
e.g. dig up where POVMS_SendMessage() is actually called and how it is 
employed :)


Post a reply to this message

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