POV-Ray : Newsgroups : povray.tools.general : Undefining #declares Server Time
2 May 2024 23:05:59 EDT (-0400)
  Undefining #declares (Message 1 to 10 of 10)  
From: =Bob=
Subject: Undefining #declares
Date: 25 Nov 2004 18:32:16
Message: <41a66b80@news.povray.org>
I wanted to #undef everything that was #delared
in a file. But I didn't want to go through and make
the list by hand so I created a utility that reads
a file and generates the list to a text box. Then
just copy to the clipboard and paste in where you
want it. I'll enhance it if anyone finds it useful.

If anyone wants to test it out:

http://sdg.ag.uidaho.edu/BobWeb/Undef.exe

Should work for Win98-XP. Suggestions welcome!
=Bob=


Post a reply to this message

From: Warp
Subject: Re: Undefining #declares
Date: 25 Nov 2004 19:55:35
Message: <41a67f07@news.povray.org>
How about making it a portable command-line utility and releasing the
source?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: =Bob=
Subject: Re: Undefining #declares
Date: 25 Nov 2004 20:00:07
Message: <41a68017@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:41a67f07@news.povray.org...
:   How about making it a portable command-line utility and releasing the
: source?

I could do that if there is enough need.
=Bob=


Post a reply to this message

From: Warp
Subject: Re: Undefining #declares
Date: 26 Nov 2004 05:19:40
Message: <41a7033c@news.povray.org>
=Bob= <robertUNDERSCOREdobbinsATmailDOTtdsDOTnet> wrote:
> I could do that if there is enough need.

  It's more probable that the evailability and ease of use will promote
the need than the other way around.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: =Bob=
Subject: Re: Undefining #declares
Date: 26 Nov 2004 07:06:04
Message: <41a71c2c@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:41a7033c@news.povray.org...
: =Bob= <robertUNDERSCOREdobbinsATmailDOTtdsDOTnet> wrote:
: > I could do that if there is enough need.
:
:   It's more probable that the evailability and ease of use will promote
: the need than the other way around.

If Windows users find it useful, then other OS users
might be interested too. Until then...
=Bob=


Post a reply to this message

From: François Dispot
Subject: Re: Undefining #declares
Date: 26 Nov 2004 10:46:29
Message: <41a74fd5$1@news.povray.org>
Warp wrote:
>   How about making it a portable command-line utility and releasing the
> source?

How about making it as a macro?

Something like:
#macro undefall(file_in, tmp_file)
/* some magic code reading file_in, searching for #declares,
outputting the corresponding #undefs in tmp_file while
handling multiple declaration cases, arrays..., then
#including tmp_file (thus everything gets undeclared)*/
#end

The only missing step would be the tmp_file deletion.

-- 


Post a reply to this message

From: Warp
Subject: Re: Undefining #declares
Date: 27 Nov 2004 09:00:35
Message: <41a88883@news.povray.org>

> /* some magic code reading file_in, searching for #declares,

  Such magic code is not possible with the current SDL.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: =Bob=
Subject: Re: Undefining #declares
Date: 27 Nov 2004 10:47:32
Message: <41a8a194$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:41a88883@news.povray.org...

: > /* some magic code reading file_in, searching for #declares,
:   Such magic code is not possible with the current SDL.

It might be a nice feature in Pov to #undef an #include,
which would #undef everything in the file.
=Bob=


Post a reply to this message

From: François Dispot
Subject: Re: Undefining #declares
Date: 28 Nov 2004 15:42:02
Message: <41aa381a@news.povray.org>
Warp wrote:

> 
>>/* some magic code reading file_in, searching for #declares,
> 
> 
>   Such magic code is not possible with the current SDL.

Unfortunately you're right. Not only POV-Ray cannot detect EOFs, but it 
is not even able to read text as strings, which I hope it could.

-- 


Post a reply to this message

From: Warp
Subject: Re: Undefining #declares
Date: 28 Nov 2004 18:22:11
Message: <41aa5da3@news.povray.org>

> Unfortunately you're right. Not only POV-Ray cannot detect EOFs, but it 
> is not even able to read text as strings, which I hope it could.

  As I have always said, one of the strongest features of POV-Ray (its SDL)
is one of the weakest features of POV-Ray.

  This is yet another reason for pov4. The current SDL just doesn't do it.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

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