POV-Ray : Newsgroups : povray.general : POV-Ray Includes - Standards : Re: POV-Ray Includes - Standards Server Time
1 Aug 2024 00:21:13 EDT (-0400)
  Re: POV-Ray Includes - Standards  
From: Randall Sawyer
Date: 4 Dec 2006 11:10:00
Message: <web.4574478647def5cacc8a61450@news.povray.org>
Solution to Challenge:  Is it generally extensible?

You can download my solution to my own challenge at aforementioned site.

Here is what I came up with:

In "povver1.inc":
    On the first line:
        // Use #declare whose = "povver1"
    On the two lines immediate preceeding any #macros or #declares:
        #ifdef ( whose )
            #if ( !strcmp(whose, "povver1") )

        *** macros and declares go here ***

    On the two lines immediately following any #macros or #declares:
            #end//(whose = "povver1")
        #end//ifdef(whose)

In "povver2.inc":
    The same as in "povver1.inc", replacing "povver1" by "povver2"

In any scene file:
    #declare whose = "povver1"
    #include "povver1.inc"

    stuff from "povver1.inc" you want to have in scene - modified or not

    #declare whose = "povver2"
    #include "povver2.inc"

    stuff from "povver2.inc" you want to have in scene - modified or not
    [ Nothing unique to "povver1.inc" file is lost, making it possible to
combine items from two-or-more include files. ]

Additional added value to this approach:  Author recognition!
By requiring that every include file make use of '#declare whose', a
scene-writer will be making an acknowledgement of the original author from
whom
they are borrowing.  It will be written into the text of their scene file.

Will this work?  Is there something I'm missing?

-Randall


Post a reply to this message

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