This actually is the best way to do it, because you can use the image
to write it e.g. to file
There is one thing though which I don't understand.
I adjusted my script the way you described and it works fine.
Like:
data2 = Options(data2,"rendering mode","hardware");
data2 = Options(data2,"line width",2);
data2 = Options(data2,"antialias","lines");
and then
where2 = Display(data2,camera);
image2 = ReadImageWindow(where2);
However, I wanted to add a Caption by adding before the Display command
the following
caption = Caption("Fat line");
data2 = Collect(data2,caption);
This give a error message in the ReadImageWindow module:
0: WARNING: 51::/ReadImageWindow:0 internal error: module return value was
not ERROR
0: ERROR: 51::/ReadImageWindow:0: Internal error: X Error: BadValue (integer
parameter out of range for operation)
0: ERROR: 54::/Display:0: Error code not set:
Isn't it allowed to add captions in the hardware rendering mode ?
Finally, another small question
Is it possible to create dashed or dotted lines in DX ?
ThanksB
Eelco
PS: I added the adjusted script that produces the error messege to the mail
The error is produced when the
data2 = Collect(data2,caption2);
line is un-commented.
When I want to add Caption, however, I get the following error
On Thu, 13 Jun 2002, David Thompson wrote:
> It isn't quite this easy. The problem is, Render does not support
> hardware rendering because with hardware rendering your data must be
> sent to the graphics card. Display does support hardware rendering,
> so if you do the following:
>
> data2 = Options(data2, "rendering mode", "hardware");
> where1 = Display(data2, camera);
> image2 = ReadImageWindow(where1);
>
> Then send this into your Collect.
>
> David
>
> >Hi there,
> >
> >Does anybody know if the "Options" module should work if you're working
> >in script mode?
> >
> >I want to change properties of a line (like thickness). The dx sample
> >"FatLines.net" run from the data explorer seems to work.
> >
> >In script mode, however, the line seems insensitive to the Options settings
> >Below an example of a script that I tried
> >I want to create two lines using Grid, of which the second is adjusted
> >with the option modules. I plot them next to each other, but they are
> >exactly the same. Changing the software or hardware rendering option
> >doesn't work.
> >
> >So the question is: should it be possible to change the line thickness
> >in script mode. If so, what do I do wrong in the script below ?
> >
> >Cheers!
> >
> >Eelco
> >
> >
> >//////// START EXAMPLE run with: dx -script bla.net
> >
> >// create line to be rendered
> >data1 = Grid([0 0 0],"line",[ 1 0 0]);
> >data1 = ShowConnections(data1);
> >
> >// copy line and change option of line2
> >data2 = data1;
> >data2 = Options(data2,"line width",4);
> >data2 = Options(data2,"rendering mode","software");
> >
> >// create camera
> >camera = AutoCamera(data1,direction="diagonal",resolution=400);
> >
> >// Render both lines
> >image1 = Render(data1,camera);
> >image2 = Render(data2,camera);
> >
> >// Show them
> >image = Collect(image1,image2);
> >image = Arrange(image);
> >Display(image);
> >KeyIn();
> >
> >///////// END EXAMPLE
>
>
> --
> .............................................................................
> David L. Thompson Visualization and Imagery Solutions, Inc.
> mailto:[EMAIL PROTECTED] 5515 Skyway Drive, Missoula, MT 59804
> Phone : (406)257-8530
>
// Example how to change the properties of a line using the "Option" module
// create line to be rendered
data1 = Grid([0 0 0],"line",[ 1 0 0]);
data1 = ShowConnections(data1);
// set options in data2. Use hardware rendering
data2 = data1;
data2 = Options(data2,"rendering mode","hardware");
data2 = Options(data2,"line width",4);
data2 = Options(data2,"antialias","lines");
// color the lines
data1 = Color(data1,"yellow");
data2 = Color(data2,"red");
// add captions
caption1 = Caption("Normal line");
caption2 = Caption("Fat line");
data1 = Collect(data1,caption1);
////////////////////////////////////////////////////////////////////////////
// Uncommenting this line gives an error at ReadImageWindow
// data2 = Collect(data2,caption2);
////////////////////////////////////////////////////////////////////////////
// create camera
camera = AutoCamera(data1,direction="diagonal",resolution=400);
// render first line ordinary
image1 = Render(data1,camera);
// Render second line with Display, which allows hardware rendering.
// Use ReadImageWindow to retrieve the window image
where2 = Display(data2,camera);
image2 = ReadImageWindow(where2);
// Show them
image = Collect(image1,image2);
image = Arrange(image);
Display(image);
KeyIn();