POV-Ray : Newsgroups : povray.text.tutorials : include files with references : include files with references Server Time
25 Apr 2024 06:53:51 EDT (-0400)
  include files with references  
From:
Date: 8 Jul 2002 05:09:10
Message: <kiliiusutk70agk0cbvdldfb2ovtsq6dt4@4ax.com>
Very simple and ready for other improvements addition. If you distribute your
scripts over world (ie for IRTC) and use include files from other authors you
can be interested in unioned inclusion control system. Take a look at below
macro:

example usage:

Include(
  "iso_csg.inc" ,
  "http://www-public.tu-bs.de:8080/~y0013390/pov/ic/" ,
  defined( iso_CSG_Inc_Temp )
)

macro itself:

#version 3.5;
// Include subsystem by ABX (abx### [at] abxartpl) '2002
// Feel free to copy, save and use
// Parameters:
//   IncludeFile - string with name of the file to be included
//   URL         - string link to the page (or directly to zip/pov/inc)
//                 where included file were originally published,
//                 empty string when no place to obtain
//   Included    - boolean result of test whether include file was already
//                 included before, if you can't test it put 'no' there,
//                 usually you can use defined() function to test any of
//                 identifiers from this include file
#macro Include( IncludeFile , URL , Included )
  #if(Included)
    #ifdef(View_POV_Include_Stack)
      #debug concat(IncludeFile," already included\n")
    #end
  #else
    #if(file_exists(IncludeFile))
      #include IncludeFile
    #else
      #debug concat("Warning: ",IncludeFile," is not included. Scripts may not work as
expected becouse\n")
      #debug concat("         identifiers, variables, macros from ",IncludeFile," are
not declared.\n")
      #if(strlen(URL))
        #debug concat("         ",IncludeFile," can be downloaded from ",URL,"\n")
      #end
      #ifdef(View_POV_Include_Stack)
        #debug "         Check that the file is in a directory specifed with a +L
switch\n"
        #debug "         or 'Library_Path=' .INI item. Standard include files are in
the\n"
        #debug "         include directory or folder. Please read your documentation
carefully.\n"
      #end
    #end
  #end
#end

ABX


Post a reply to this message

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