Hi Bob,

I would like to come back to the issue of internalizing an isosurface:

load =1crn;
isosurface ID "isosurface1" select {*} molecular;
isosurface ID "isosurface1"
tmp = script("show isosurface");
isosurface ID "isosurface1" INLINE @tmp;

to which you answered:

> use
> 
> write xxx.jvxl
> 
> then immediately replace the isosurface with that using
> 
> isosurface delete
> isosurface "xxx.jvxl"
> 
> then write the file as a PNGJ or JMOL. This should be very compact and
> very fast to load.

yes that's ok but I did not mention that I want to use this in the applet and 
make it as automatic as possible, without the detour to the file system, which 
requires user interaction.

The problem seems to be in jmol.shapesurface.Isosurface.java::getMeshCommand() 
// comments by me

String cmd = imesh.scriptCommand;
...
cmd = TextFormat.simpleReplace(cmd, "; isosurface map", " map"); 
cmd = cmd.replace('\t', ' ');
cmd = TextFormat.simpleReplace(cmd, ";#", "; #");
int pt = cmd.indexOf("; #");
if (pt >= 0)
  cmd = cmd.substring(0, pt);

We do not want all this special handling of the script command for the inlined 
data with such a command. We could look for " inline " in cmd? Ahh, thats not 
enough, as you can do "isosurface ID inline inline @tmp". A regex perhaps:

if( cmd.toLowerCase().indexOf("inline") >= 0 && 
!cmd.matches("(?i)id\s*['\"]?\s*inline\s*['\"]?") ){ // not tested
  cmd = TextFormat.simpleReplace(cmd, "; isosurface map", " map"); 
  cmd = cmd.replace('\t', ' ');
  cmd = TextFormat.simpleReplace(cmd, ";#", "; #");
  int pt = cmd.indexOf("; #");
  if (pt >= 0)
    cmd = cmd.substring(0, pt);
}

Well, not perfect, then we would not the special processing for commands with 
inlined data.

If you do not like the "parsing the script command for for hints to inlined 
data", it is a hack, we could do it different. In general we need a way to have 
the info that something is an "inline" isosurface and handling the script 
command needs special care because it holds all the data - and the data should 
not be changed.

I took some time to understand how the jvxl string is load via isosurface 
inline within Jmol. As far as I understand it there is no info passed to the 
IsosurfaceMesh holding the loaded jvxl string that it came from inlined data. 
The way to this as far as I currently comprehend is via addShapeProperty in the 
ScriptEvaluator.java and then add it to Parameters object in the 
SurfaceGenerator.java and... well, I'm lost what happens after the "finalize" 
property is send to the SurfaceGenerator?

Anway that's it for today, I hope it makes some sense.


Best
Alexander

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to