Commit c48fbda2 authored by whitlocb's avatar whitlocb
Browse files

Massive XML tool improvements.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@3464 18c085ea-50e0-402c-830e-de6fd14e8384
parent e5d087d4
......@@ -647,6 +647,7 @@ $fullusage = "$usage
-gdb-viewer Run the viewer under gdb.
-gdb-engine Run the engine under gdb.
-gdb-mdserver Run the mdserver under gdb.
-gdb-xmledit Run xmledit under gdb.
-break <funcname> Add the specified breakpoint in gdb.
-xterm Run gdb in an xterm window.
-newconsole Run any VisIt component in a new console window.
......@@ -817,6 +818,7 @@ while (scalar(@ARGV) > 0) {
elsif ($arg eq "-gdb-viewer") { if($exe_name eq "viewer") {$debug_gdb = 1;} else {push @visitargs, $arg;}}
elsif ($arg eq "-gdb-engine") { if($exe_name eq "engine") {$debug_gdb = 1;} else {push @visitargs, $arg;}}
elsif ($arg eq "-gdb-mdserver") { if($exe_name eq "mdserver") {$debug_gdb = 1;} else {push @visitargs, $arg;}}
elsif ($arg eq "-gdb-xmledit") { if($exe_name eq "xmledit") {$debug_gdb = 1;} else {push @visitargs, $arg;}}
elsif ($arg eq "-gdb-vcl") { if($exe_name eq "vcl") {$debug_gdb = 1;} else {push @visitargs, $arg;}}
elsif ($arg eq "-xterm") { if($debug_gdb) {$gdb_xterm = 1;} else {push @visitargs, $arg;}}
elsif ($arg eq "-newconsole") { $use_new_console = 1; }
......@@ -2095,6 +2097,11 @@ else
{
print GDBFILE "directory $ENV{VISITHOME}/visitpy\n";
}
if ($exe_name eq "xmledit")
{
print GDBFILE "directory $ENV{VISITHOME}/tools/xml\n";
print GDBFILE "directory $ENV{VISITHOME}/tools/xmledit\n";
}
print GDBFILE "directory $ENV{VISITHOME}/visit_vtk/full\n";
print GDBFILE "directory $ENV{VISITHOME}/visit_vtk/lightweight\n";
print GDBFILE "directory $ENV{VISITHOME}/vtkqt\n";
......
Target: xml2java
Initialization: databaseInfoFont
databaseInfoFont = new FontAttributes();
databaseInfoFont.SetHeight(0.07);
Initialization: userInfoFont
userInfoFont = new FontAttributes();
userInfoFont.SetHeight(0.05);
Target: xml2atts
Initialization: databaseInfoFont
databaseInfoFont.SetHeight(0.07);
......
......@@ -85,3 +85,249 @@ AnnotationObjectList::IndexForName(const std::string &name) const
return -1;
}
Target: xml2java
Function: GetAnnotation2
Declaration: GetAnnotation2
Definition:
/**
* Returned the annotation object with the specified name
*
* @param name Name of the annotation object we want to return.
* @return The named annotationn object or null.
*/
public AnnotationObject GetAnnotation(String name)
{
for(int i = 0; i < annotation.size(); ++i)
{
AnnotationObject a = (AnnotationObject)annotation.elementAt(i);
if(a.GetObjectName().equals(name))
return a;
}
return null;
}
Function: SetTimeSliderOptions
Declaration: SetTimeSliderOptions
Definition:
/**
* Sets the options for the named time slider annotation object.
*
* @param annotName Name of the time slider annotation that we want to modify.
* @param x X location of the lower left corner in the visualization window [0.,1.]
* @param y Y location of the lower left corner in the visualization window [0.,1.]
* @param width Width of the annotation [0.,1.]
* @param height Height of the annotation [0.,1.]
* @param label Label to be used in the time slider
* @param timeFormat C-style format string for the time number, such as "%1.3f"
* @param startColor Color used for the left progress part of the time slider.
* @param endColor Color used for the right part of the time slider progress.
* @param textColor Color used for the text if we're not using the fg color.
* @param useForegroundColor True to use the foreground color as the text color
* @param timeDisplay 0=All frames, 1=Frames for plot, 2=States for plot
* @param visible Whether the annotation is visible.
* @param rounded Whether the ends of the progress bar are rounded
* @param shaded Whether the progress bar is shaded
*/
public void SetTimeSliderOptions(String annotName,
double x, double y, double width, double height,
String label, String timeFormat,
ColorAttribute startColor, ColorAttribute endColor,
ColorAttribute textColor, boolean useForegroundColor,
int timeDisplay,
boolean visible, boolean rounded, boolean shaded)
{
AnnotationObject annot = GetAnnotation(annotName);
if(annot != null)
{
annot.SetPosition(x, y, 0.);
annot.SetPosition2(width, height, 0.);
Vector sArgs = new Vector();
sArgs.addElement(new String(label));
sArgs.addElement(new String(timeFormat));
annot.SetText(sArgs);
annot.SetColor1(startColor);
annot.SetColor2(endColor);
annot.SetTextColor(textColor);
annot.SetUseForegroundForTextColor(useForegroundColor);
annot.SetVisible(visible);
int flags = (timeDisplay << 2) | (shaded ? 2 : 0) | (rounded ? 1 : 0);
annot.SetIntAttribute1(flags);
}
}
Function: SetText2DOptions
Declaration: SetText2DOptions
Definition:
/**
* Sets the options for the named 2D text annotation object.
*
* @param annotName Name of the text annotation that we want to modify.
* @param x X location of the lower left corner in the visualization window [0.,1.]
* @param y Y location of the lower left corner in the visualization window [0.,1.]
* @param width Width of the annotation [0.,1.]
* @param text Text to be displayed
* @param textColor Color used for the text if we're not using the fg color.
* @param useForegroundColor True to use the foreground color as the text color
* @param fontFamily 0=Arial, 1=Courier, 2=Times
* @param bold Whether the font is bold
* @param italic Whether the font is italic
* @param shadow Whether the font has a shadow.
* @param visible Whether the annotation is visible.
*/
public void SetText2DOptions(String annotName,
double x, double y, double width,
String text,
ColorAttribute textColor, boolean useForegroundColor,
int fontFamily, boolean bold, boolean italic, boolean shadow,
boolean visible)
{
AnnotationObject annot = GetAnnotation(annotName);
if(annot != null)
{
annot.SetPosition(x, y, 0.);
annot.SetPosition2(width, annot.GetPosition2()[1], annot.GetPosition2()[2]);
Vector sArgs = new Vector();
sArgs.addElement(new String(text));
annot.SetText(sArgs);
annot.SetTextColor(textColor);
annot.SetUseForegroundForTextColor(useForegroundColor);
annot.SetFontFamily(fontFamily);
annot.SetFontBold(bold);
annot.SetFontItalic(italic);
annot.SetFontShadow(shadow);
annot.SetVisible(visible);
}
}
Function: SetText3DOptions
Declaration: SetText3DOptions
Definition:
/**
* Sets the options for the named 3D text annotation object.
*
* @param annotName Name of the text annotation that we want to modify.
* @param x X location of the text
* @param y Y location of the text
* @param z Z location of the text
* @param text Text to be displayed
* @param heightMode 0=relative, 1=fixed
* @param fixedHeight Height to use when heightMode==0
* @param relativeHeight Height to use when heightMode==1. Percent of original height [1,100]
* @param facesCamera Whether the text should face the camera.
* @param rotX X rotation in degrees.
* @param rotY Y rotation in degrees.
* @param rotZ Z rotation in degrees.
* @param textColor Color used for the text if we're not using the fg color.
* @param useForegroundColor True to use the foreground color as the text color
* @param visible Whether the annotation is visible.
*/
public void SetText3DOptions(String annotName,
double x, double y, double z,
String text,
boolean heightMode, double fixedHeight, int relativeHeight,
boolean facesCamera,
double rotX, double rotY, double rotZ,
ColorAttribute textColor, boolean useForegroundColor,
boolean visible)
{
AnnotationObject annot = GetAnnotation(annotName);
if(annot != null)
{
annot.SetPosition(x, y, z);
annot.SetPosition2(rotX, rotY, rotZ);
Vector sArgs = new Vector();
sArgs.addElement(new String(text));
annot.SetText(sArgs);
annot.SetTextColor(textColor);
annot.SetUseForegroundForTextColor(useForegroundColor);
annot.SetIntAttribute1(relativeHeight);
annot.SetDoubleAttribute1(fixedHeight);
annot.SetFontItalic(heightMode);
annot.SetFontBold(facesCamera);
annot.SetVisible(visible);
}
}
Function: SetLine2DOptions
Declaration: SetLine2DOptions
Definition:
/**
* Sets the options for the named 2D line annotation object.
*
* @param annotName Name of the text annotation that we want to modify.
* @param x0 X location of the start point in the visualization window [0.,1.]
* @param y0 Y location of the start point in the visualization window [0.,1.]
* @param x1 X location of the end point in the visualization window [0.,1.]
* @param y1 Y location of the end point in the visualization window [0.,1.]
* @param lineWidth Width of the line.
* @param startArrow 0=None, 1=Line, 2=Solid
* @param endArrow 0=None, 1=Line, 2=Solid
* @param color Color used for the line if we're not using the fg color.
* @param useForegroundColor True to use the foreground color as the text color
* @param visible Whether the annotation is visible.
*/
public void SetLine2DOptions(String annotName,
double x0, double y0, double x1, double y1,
int lineWidth,
int startArrow, int endArrow,
ColorAttribute color, boolean useForegroundColor,
boolean visible)
{
AnnotationObject annot = GetAnnotation(annotName);
if(annot != null)
{
annot.SetPosition(x0, y0, 0.);
annot.SetPosition2(x1, y1, 0.);
annot.SetColor1(color);
annot.SetColor2(new ColorAttribute(lineWidth, startArrow, endArrow, 255));
annot.SetUseForegroundForTextColor(useForegroundColor);
annot.SetVisible(visible);
}
}
Function: SetImageOptions
Declaration: SetImageOptions
Definition:
/**
* Sets the options for the named image annotation object.
*
* @param annotName Name of the text annotation that we want to modify.
* @param filename Filename that contains the image.
* @param x X location of the start point in the visualization window [0.,1.]
* @param y Y location of the start point in the visualization window [0.,1.]
* @param xScale X scale.
* @param yScale Y scale.
* @param scalesLinked Keeps the scales linked.
* @param transColor The color to remove from the image so it becomes clear.
* @param removeTransColor Tells VisIt to remove the transparent color.
* @param opacity Overal opacity of the image.
* @param visible Whether the annotation is visible.
*/
public void SetImageOptions(String annotName,
String filename,
double x, double y,
double xScale, double yScale, boolean scalesLinked,
ColorAttribute transColor, boolean removeTransColor,
double opacity,
boolean visible)
{
AnnotationObject annot = GetAnnotation(annotName);
if(annot != null)
{
Vector sArgs = new Vector();
sArgs.addElement(new String(filename));
annot.SetText(sArgs);
annot.SetPosition(x, y, 0.);
annot.SetPosition2(xScale * 100., yScale * 100., 0.);
ColorAttribute c = new ColorAttribute(
transColor.Red(),
transColor.Green(),
transColor.Blue(),
(int)(opacity * 255.));
annot.SetColor1(c);
annot.SetFontShadow(scalesLinked);
annot.SetIntAttribute1(removeTransColor?1:0);
annot.SetVisible(visible);
}
}
......@@ -8,6 +8,18 @@
</Function>
<Function name="IndexForName" user="true" member="true">
</Function>
<Function name="GetAnnotation2" user="true" member="true">
</Function>
<Function name="SetTimeSliderOptions" user="true" member="true">
</Function>
<Function name="SetText2DOptions" user="true" member="true">
</Function>
<Function name="SetText3DOptions" user="true" member="true">
</Function>
<Function name="SetLine2DOptions" user="true" member="true">
</Function>
<Function name="SetImageOptions" user="true" member="true">
</Function>
<Include file="source" quoted="false">
snprintf.h
</Include>
......
......@@ -1272,3 +1272,66 @@ ColorAttribute::RgbToRgbStr(unsigned char rgb[3], char *s)
}
}
Target: xml2java
Function: Red
Declaration: Red
Definition:
public int Red()
{
int mask = 0xff;
return mask & color[0];
}
Function: Green
Declaration: Green
Definition:
public int Green()
{
int mask = 0xff;
return mask & color[1];
}
Function: Blue
Declaration: Blue
Definition:
public int Blue()
{
int mask = 0xff;
return mask & color[2];
}
Function: Alpha
Declaration: Alpha
Definition:
public int Alpha()
{
int mask = 0xff;
return mask & color[3];
}
Function: ColorAttribute2
Declaration: ColorAttribute2
Definition:
public ColorAttribute(int r, int g, int b)
{
super(1);
color = new byte[4];
color[0] = (byte)(0xff & r);
color[1] = (byte)(0xff & g);
color[2] = (byte)(0xff & b);
color[3] = (byte)(0xff & 255);
}
Function: ColorAttribute3
Declaration: ColorAttribute3
Definition:
public ColorAttribute(int r, int g, int b, int a)
{
super(1);
color = new byte[4];
color[0] = (byte)(0xff & r);
color[1] = (byte)(0xff & g);
color[2] = (byte)(0xff & b);
color[3] = (byte)(0xff & a);
}
......@@ -8,6 +8,10 @@
</Field>
<Function name="ColorAttribute" user="true" member="true">
</Function>
<Function name="ColorAttribute2" user="true" member="true">
</Function>
<Function name="ColorAttribute3" user="true" member="true">
</Function>
<Function name="SetRgb" user="true" member="true">
</Function>
<Function name="SetRgba" user="true" member="true">
......
......@@ -477,3 +477,120 @@ ColorTableAttributes::SetFromNode(DataNode *parentNode)
if((node = searchNode->GetNode("activeColorTable")) != 0)
SetActiveContinuous(node->AsString());
}
Target: xml2java
Function: GetColorTableIndex
Declaration: GetColorTableIndex
Definition:
public int GetColorTableIndex(String name)
{
int retval = -1;
for(int i = 0; i < names.size(); ++i)
{
String n = (String)names.elementAt(i);
if(n.equals(name))
{
retval = i;
break;
}
}
return retval;
}
Function: GetColorControlPoints1
Declaration: GetColorControlPoints1
Definition:
public ColorControlPointList GetColorControlPoints(int index)
{
if(index >= 0 && index < colorTables.size())
return (ColorControlPointList)colorTables.elementAt(index);
else
return null;
}
Function: GetColorControlPoints2
Declaration: GetColorControlPoints2
Definition:
public ColorControlPointList GetColorControlPoints(String name)
{
int index = GetColorTableIndex(name);
if(index >= 0 && index < colorTables.size())
return (ColorControlPointList)colorTables.elementAt(index);
else
return null;
}
Function: GetActiveColorControlPoints
Declaration: GetActiveColorControlPoints
Definition:
public ColorControlPointList GetActiveColorControlPoints()
{
int index = GetColorTableIndex(activeContinuous);
if(index >= 0 && index < colorTables.size())
return (ColorControlPointList)colorTables.elementAt(index);
else
return null;
}
Function: AddColorTable
Declaration: AddColorTable
Definition:
public void AddColorTable(String name, ColorControlPointList cpts)
{
names.addElement(new String(name));
Select(0);
AddColorTables(cpts);
}
Function: RemoveColorTable1
Declaration: RemoveColorTable1
Definition:
public void RemoveColorTable(String name)
{
int index = GetColorTableIndex(name);
RemoveColorTable(index);
}
Function: RemoveColorTable2
Declaration: RemoveColorTable2
Definition:
public void RemoveColorTable(int index)
{
if(index >= 0 && index < names.size())
{
String nameAt = (String)names.elementAt(index);
boolean isActiveContinuous = nameAt.equals(activeContinuous);
boolean isActiveDiscrete = nameAt.equals(activeDiscrete);
// Remove the name from the vector.
names.remove(index);
Select(0);
// Remove the color table from the vector.
RemoveColorTables(index);
// If it is the active color table that was removed, reset the
// active color table to the first element.
if(isActiveContinuous)
{
if(names.size() > 0)
{
nameAt = (String)names.elementAt(0);
SetActiveContinuous(nameAt);
}
else
SetActiveContinuous("");
}
if(isActiveDiscrete)
{
if(names.size() > 0)
{
nameAt = (String)names.elementAt(0);
SetActiveDiscrete(nameAt);
}
else
SetActiveDiscrete("");
}
}
}
......@@ -7,6 +7,7 @@
<Function name="GetColorTableIndex" user="true"></Function>
<Function name="GetColorControlPoints1" user="true"></Function>
<Function name="GetColorControlPoints2" user="true"></Function>
<Function name="GetActiveColorControlPoints" user="true"></Function>
<Function name="AddColorTable" user="true"></Function>
<Function name="RemoveColorTable1" user="true"></Function>
<Function name="RemoveColorTable2" user="true"></Function>
......
Initialization: light0
Initialization: light7
SetDefaultEnabledStates();
Target: xml2java
Initialization: light7
light7 = new LightAttributes();
SetDefaultEnabledStates();
Target: xml2atts
Function: GetLight
Declaration: const LightAttributes &GetLight(int i) const;
Definition:
......@@ -123,3 +129,34 @@ LightList::SetDefaultEnabledStates()
light7.SetEnabledFlag(false);
}
Target: xml2java
Function: SetAllEnabled
Declaration: SetAllEnabled
Definition:
public void SetAllEnabled(boolean val)
{
light0.SetEnabledFlag(val);
light1.SetEnabledFlag(val);
light2.SetEnabledFlag(val);
light3.SetEnabledFlag(val);
light4.SetEnabledFlag(val);
light5.SetEnabledFlag(val);
light6.SetEnabledFlag(val);
light7.SetEnabledFlag(val);
SelectAll();
}
Function: SetDefaultEnabledStates
Declaration: SetDefaultEnabledStates
Definition:
public void SetDefaultEnabledStates()
{
light0.SetEnabledFlag(true);
light1.SetEnabledFlag(false);
light2.SetEnabledFlag(false);
light3.SetEnabledFlag(false);
light4.SetEnabledFlag(false);
light5.SetEnabledFlag(false);
light6.SetEnabledFlag(false);
light7.SetEnabledFlag(false);
}
<?xml version="1.0"?>
<Attribute name="LightList" purpose="This class contains a list of LightAttributes." persistent="true" exportAPI="STATE_API" exportInclude="state_exports.h" codefile="LightList.code">
<Field name="light0" label="light0" type="att" subtype="LightAttributes" init="true">
<Field name="light0" label="light0" type="att" subtype="LightAttributes">
</Field>
<Field name="light1" label="light1" type="att" subtype="LightAttributes">
</Field>
......@@ -14,7 +14,7 @@
</Field>
<Field name="light6" label="light6" type="att" subtype="LightAttributes">
</Field>
<Field name="light7" label="light7" type="att" subtype="LightAttributes">
<Field name="light7" label="light7" type="att" subtype="LightAttributes" init="true">
</Field>
<Function name="GetLight" user="true" member="true">
</Function>
......@@ -28,4 +28,6 @@
</Function>
<Function name="SetDefaultEnabledStates" user="true" member="true">
</Function>
<Function name="SetAllEnabled" user="true" member="true">
</Function>
</Attribute>
......@@ -3,11 +3,24 @@ Declaration: static const int DEFAULT_SCALABLE_AUTO_THRESHOLD;
Definition: const int RenderingAttributes::DEFAULT_SCALABLE_AUTO_THRESHOLD = 2000000;
Target: xml2java
Constant: DEFAULT_SCALABLE_AUTO_THRESHOLD
Declaration: DEFAULT_SCALABLE_AUTO_THRESHOLD
Definition: public final static int DEFAULT_SCALABLE_AUTO_THRESHOLD = 2000000;
Target: xml2atts
Constant: DEFAULT_SCALABLE_ACTIVATION_MODE
Declaration: static const int DEFAULT_SCALABLE_ACTIVATION_MODE;
Definition: const int RenderingAttributes::DEFAULT_SCALABLE_ACTIVATION_MODE = Auto;
Target: xml2java
Constant: DEFAULT_SCALABLE_ACTIVATION_MODE
Declaration: DEFAULT_SCALABLE_ACTIVATION_MODE
Definition: public final static int DEFAULT_SCALABLE_ACTIVATION_MODE = TRISTATEMODE_AUTO;
Target: xml2atts
Function: GetEffectiveScalableThreshold
Declaration: static int GetEffectiveScalableThreshold(TriStateMode mode, int autoThreshold);
Definition:
......
<?xml version="1.0"?>
<Attribute name="RenderingAttributes" purpose="This class contains special rendering attributes like antialiasing and stero settings." persistent="true" exportAPI="STATE_API" exportInclude="state_exports.h" codefile="RenderingAttributes.code">
<Attribute name="RenderingAttributes" purpose="This class contains special rendering attributes like antialiasing and stero settings." persistent="true" keyframe="true" exportAPI="STATE_API" exportInclude="state_exports.h" codefile="RenderingAttributes.code">
<Enum name="GeometryRepresentation">
Surfaces
Wireframe
......@@ -49,7 +49,7 @@
<Field name="specularPower" label="specularPower" type="float">