Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
third-party
visit
Commits
c018389a
Commit
c018389a
authored
Mar 31, 2007
by
hrchilds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update from October 6, 2003
git-svn-id:
http://visit.ilight.com/svn/visit/trunk/src@92
18c085ea-50e0-402c-830e-de6fd14e8384
parent
0469af87
Changes
58
Hide whitespace changes
Inline
Side-by-side
Showing
58 changed files
with
2856 additions
and
491 deletions
+2856
-491
bin/makemovie.py
bin/makemovie.py
+146
-23
bin/visit
bin/visit
+8
-2
common/state/ColorAttribute.C
common/state/ColorAttribute.C
+23
-34
common/state/ColorAttribute.code
common/state/ColorAttribute.code
+33
-0
common/state/ColorAttribute.h
common/state/ColorAttribute.h
+1
-1
common/state/ColorAttribute.xml
common/state/ColorAttribute.xml
+1
-0
common/state/ConfigManager.C
common/state/ConfigManager.C
+118
-8
common/state/ConfigManager.h
common/state/ConfigManager.h
+5
-0
common/state/QueryList.C
common/state/QueryList.C
+99
-22
common/state/QueryList.code
common/state/QueryList.code
+38
-4
common/state/QueryList.h
common/state/QueryList.h
+8
-2
common/state/QueryList.xml
common/state/QueryList.xml
+15
-7
components/Pipeline/Makefile.in
components/Pipeline/Makefile.in
+4
-0
components/Pipeline/PublicFilters/avtCurveConstructorFilter.C
...onents/Pipeline/PublicFilters/avtCurveConstructorFilter.C
+299
-0
components/Pipeline/PublicFilters/avtCurveConstructorFilter.h
...onents/Pipeline/PublicFilters/avtCurveConstructorFilter.h
+58
-0
components/Pipeline/Sinks/avtDatasetSink.h
components/Pipeline/Sinks/avtDatasetSink.h
+3
-1
components/Pipeline/Sinks/avtMultipleInputSink.C
components/Pipeline/Sinks/avtMultipleInputSink.C
+29
-0
components/Pipeline/Sinks/avtMultipleInputSink.h
components/Pipeline/Sinks/avtMultipleInputSink.h
+6
-1
components/Queries/Abstract/avtCurveComparisonQuery.C
components/Queries/Abstract/avtCurveComparisonQuery.C
+352
-0
components/Queries/Abstract/avtCurveComparisonQuery.h
components/Queries/Abstract/avtCurveComparisonQuery.h
+53
-0
components/Queries/Abstract/avtCurveQuery.C
components/Queries/Abstract/avtCurveQuery.C
+130
-0
components/Queries/Abstract/avtCurveQuery.h
components/Queries/Abstract/avtCurveQuery.h
+45
-0
components/Queries/Abstract/avtGeneralQuery.h
components/Queries/Abstract/avtGeneralQuery.h
+42
-0
components/Queries/Abstract/avtMultipleInputQuery.C
components/Queries/Abstract/avtMultipleInputQuery.C
+50
-0
components/Queries/Abstract/avtMultipleInputQuery.h
components/Queries/Abstract/avtMultipleInputQuery.h
+55
-0
components/Queries/Makefile.in
components/Queries/Makefile.in
+12
-0
components/Queries/Queries/avtAreaBetweenCurvesQuery.C
components/Queries/Queries/avtAreaBetweenCurvesQuery.C
+96
-0
components/Queries/Queries/avtAreaBetweenCurvesQuery.h
components/Queries/Queries/avtAreaBetweenCurvesQuery.h
+48
-0
components/Queries/Queries/avtCycleQuery.C
components/Queries/Queries/avtCycleQuery.C
+52
-0
components/Queries/Queries/avtCycleQuery.h
components/Queries/Queries/avtCycleQuery.h
+41
-0
components/Queries/Queries/avtIntegrateQuery.C
components/Queries/Queries/avtIntegrateQuery.C
+61
-0
components/Queries/Queries/avtIntegrateQuery.h
components/Queries/Queries/avtIntegrateQuery.h
+42
-0
components/Queries/Queries/avtL2NormBetweenCurvesQuery.C
components/Queries/Queries/avtL2NormBetweenCurvesQuery.C
+134
-0
components/Queries/Queries/avtL2NormBetweenCurvesQuery.h
components/Queries/Queries/avtL2NormBetweenCurvesQuery.h
+47
-0
components/Queries/Queries/avtL2NormQuery.C
components/Queries/Queries/avtL2NormQuery.C
+105
-0
components/Queries/Queries/avtL2NormQuery.h
components/Queries/Queries/avtL2NormQuery.h
+42
-0
components/Queries/Queries/avtTimeQuery.C
components/Queries/Queries/avtTimeQuery.C
+52
-0
components/Queries/Queries/avtTimeQuery.h
components/Queries/Queries/avtTimeQuery.h
+41
-0
engine/main/Executors.h
engine/main/Executors.h
+4
-1
engine/main/NetworkManager.C
engine/main/NetworkManager.C
+67
-20
engine/main/NetworkManager.h
engine/main/NetworkManager.h
+4
-1
engine/proxy/EngineProxy.C
engine/proxy/EngineProxy.C
+6
-1
engine/proxy/EngineProxy.h
engine/proxy/EngineProxy.h
+5
-1
engine/rpc/QueryRPC.C
engine/rpc/QueryRPC.C
+15
-4
engine/rpc/QueryRPC.h
engine/rpc/QueryRPC.h
+12
-6
gui/QvisAppearanceWindow.C
gui/QvisAppearanceWindow.C
+72
-11
gui/QvisAppearanceWindow.h
gui/QvisAppearanceWindow.h
+4
-0
gui/QvisQueryWindow.C
gui/QvisQueryWindow.C
+9
-0
plots/Curve/avtCurveFilter.C
plots/Curve/avtCurveFilter.C
+16
-252
plots/Curve/avtCurveFilter.h
plots/Curve/avtCurveFilter.h
+13
-21
plots/Curve/avtCurvePlot.C
plots/Curve/avtCurvePlot.C
+5
-1
viewer/main/ViewerEngineManager.C
viewer/main/ViewerEngineManager.C
+4
-1
viewer/main/ViewerEngineManager.h
viewer/main/ViewerEngineManager.h
+7
-3
viewer/main/ViewerPlotList.C
viewer/main/ViewerPlotList.C
+12
-8
viewer/main/ViewerPlotList.h
viewer/main/ViewerPlotList.h
+4
-1
viewer/main/ViewerQuery.C
viewer/main/ViewerQuery.C
+16
-4
viewer/main/ViewerQueryManager.C
viewer/main/ViewerQueryManager.C
+134
-26
viewer/main/ViewerSubject.C
viewer/main/ViewerSubject.C
+53
-24
No files found.
bin/makemovie.py
View file @
c018389a
...
...
@@ -109,15 +109,14 @@ def applyFunctionToFrames(func, nframes, conversionargs):
# Programmer: Brad Whitlock
# Date: Wed Dec 18 11:33:22 PDT 2002
#
# Modifications:
# Brad Whitlock, Fri Oct 3 13:12:54 PST 2003
# Changed so it uses unlink to remove files.
#
###############################################################################
def
RemoveFile
(
fileName
):
command
=
"rm "
if
(
sys
.
platform
==
"win32"
):
command
=
"del "
command
=
command
+
" "
+
fileName
# Remove the files.
os
.
system
(
command
)
os
.
unlink
(
fileName
)
def
removeFilesHelper
(
threadID
,
start
,
end
,
conversionargs
):
# Get the arguments out of the tuple.
...
...
@@ -183,6 +182,20 @@ def EncodeQuickTimeMovieHelper(threadID, start, end, conversionargs):
subMovieName
=
"%s.%d"
%
(
moviename
,
threadID
)
createQuickTimeFile
(
subMovieName
,
baseFormat
,
start
,
end
,
xres
,
yres
)
###############################################################################
# Function: MovieClassSaveWindow
#
# Purpose: This function is called from the mangled Python script when it
# wants to save an image.
#
# Programmer: Brad Whitlock
# Date: Fri Oct 3 12:47:32 PDT 2003
#
###############################################################################
classSaveWindowObj
=
0
def
MovieClassSaveWindow
():
return
classSaveWindowObj
.
SaveImage2
()
###############################################################################
# Class: MakeMovie
#
...
...
@@ -192,6 +205,8 @@ def EncodeQuickTimeMovieHelper(threadID, start, end, conversionargs):
# Date: Mon Jul 28 12:45:45 PDT 2003
#
# Modifications:
# Brad Whitlock, Fri Oct 3 11:14:59 PDT 2003
# Added support for processing Python files.
#
###############################################################################
...
...
@@ -204,6 +219,10 @@ class MakeMovie:
# Programmer: Brad Whitlock
# Date: Mon Jul 28 13:58:06 PST 2003
#
# Modifications:
# Brad Whitlock, Fri Oct 3 11:14:50 PDT 2003
# Added support for processing Python files.
#
###########################################################################
def
__init__
(
self
):
...
...
@@ -222,6 +241,8 @@ class MakeMovie:
# Movie properties.
self
.
stateFile
=
""
self
.
scriptFile
=
""
self
.
usingStateFile
=
1
self
.
frameBase
=
"frame"
self
.
movieBase
=
"movie"
self
.
movieFormat
=
self
.
MPEG_MOVIE
...
...
@@ -250,10 +271,14 @@ class MakeMovie:
# Brad Whitlock, Tue Aug 12 09:57:05 PDT 2003
# Added a note about Windows.
#
# Brad Whitlock, Fri Oct 3 11:16:12 PDT 2003
# Added -scriptfile.
#
###########################################################################
def
PrintUsage
(
self
):
print
"Usage: visit -movie [-format fmt] [-geometry size] -sessionfile name"
print
" -sessionfile name | -scriptfile name "
print
" [-output moviename] [-framestep step]"
print
""
print
"OPTIONS"
...
...
@@ -297,6 +322,10 @@ class MakeMovie:
print
" when you save your session from within VisIt's "
print
" GUI after you set up your plots how you want them."
print
""
print
" -scriptfile name The scriptfile option lets you pick the name"
print
" of a VisIt Python script to use as input for your"
print
" movie."
print
""
print
" -framestep step The number of frames to advance when going to "
print
" the next frame."
print
""
...
...
@@ -330,6 +359,9 @@ class MakeMovie:
# Brad Whitlock, Tue Aug 12 09:57:31 PDT 2003
# Prevented use of mpeg, qt, and sm on Windows.
#
# Brad Whitlock, Fri Oct 3 11:25:33 PDT 2003
# Added support for -scriptfile.
#
###########################################################################
def
ProcessArguments
(
self
):
...
...
@@ -384,6 +416,15 @@ class MakeMovie:
elif
(
sys
.
argv
[
i
]
==
"-sessionfile"
):
if
((
i
+
1
)
<
len
(
sys
.
argv
)):
self
.
stateFile
=
sys
.
argv
[
i
+
1
]
self
.
usesStateFile
=
1
i
=
i
+
1
else
:
self
.
PrintUsage
()
sys
.
exit
(
-
1
)
elif
(
sys
.
argv
[
i
]
==
"-scriptfile"
):
if
((
i
+
1
)
<
len
(
sys
.
argv
)):
self
.
scriptFile
=
sys
.
argv
[
i
+
1
]
self
.
usesStateFile
=
0
i
=
i
+
1
else
:
self
.
PrintUsage
()
...
...
@@ -424,9 +465,9 @@ class MakeMovie:
# Make sure that the user provided the -sessionfile option or we can't
# make a movie!
if
(
self
.
stateFile
==
""
):
if
(
self
.
stateFile
==
""
and
self
.
scriptFile
==
""
):
self
.
PrintUsage
()
print
"You must provide the -sessionfile option!"
print
"You must provide the -sessionfile
or the -scriptfile
option!"
sys
.
exit
(
-
1
)
# If the movie is just a set of frames, make sure that we use the
...
...
@@ -491,6 +532,26 @@ class MakeMovie:
SetSaveWindowAttributes
(
s
)
return
SaveWindow
()
###########################################################################
# Method: SaveImage2
#
# Purpose: This method tells VisIt to save an image.
#
# Notes: This method is called when we save an image from a Python
# script.
#
# Programmer: Brad Whitlock
# Date: Fri Oct 3 12:45:30 PDT 2003
#
###########################################################################
def
SaveImage2
(
self
):
# Figure out the extension for the output files.
ext
=
self
.
LookupImageExtension
(
self
.
outputFormat
)
retval
=
self
.
SaveImage
(
self
.
numFrames
,
ext
)
self
.
numFrames
=
self
.
numFrames
+
1
return
retval
###########################################################################
# Method: LookupImageExtension
#
...
...
@@ -514,6 +575,47 @@ class MakeMovie:
retval
=
"rgb"
return
retval
###########################################################################
# Method: CreateMangledSource
#
# Purpose: This method reads in the Python file that we want to execute
# and creates an alternate version in which all of the
# SaveWindow method calls have been replaced with
# MovieClassSaveWindow.
#
# Programmer: Brad Whitlock
# Date: Mon Jul 28 13:58:06 PST 2003
#
###########################################################################
def
CreateMangledSource
(
self
,
name
):
import
string
# Read in the Python file that we want to source.
f
=
open
(
name
,
"r"
)
lines
=
f
.
readlines
()
f
.
close
()
#
# Create a new Python file and save modified source where every call
# to VisIt's SaveWindow() method gets replaced by MovieClassSaveWindow()
# which causes the script to save the image using the name and format
# prescribed by this movie framework.
#
newname
=
"%s.mangled"
%
name
f
=
open
(
newname
,
"w"
)
for
line
in
lines
:
index
=
string
.
find
(
line
,
"SaveWindow()"
)
if
index
==
-
1
:
f
.
write
(
line
)
else
:
before
=
line
[:
index
]
after
=
line
[
index
+
len
(
"SaveWindow()"
)]
f
.
write
(
before
+
"MovieClassSaveWindow()"
+
after
)
f
.
close
()
return
newname
###########################################################################
# Method: GenerateFrames
#
...
...
@@ -522,6 +624,12 @@ class MakeMovie:
# Programmer: Brad Whitlock
# Date: Mon Jul 28 13:58:06 PST 2003
#
# Modifications:
# Brad Whitlock, Fri Oct 3 11:27:50 PDT 2003
# Changed to allow scripts to save images. I also forced camera view
# mode to be enabled so keyframe animations that change the view actually
# save images that have a keyframed view.
#
###########################################################################
def
GenerateFrames
(
self
):
...
...
@@ -533,21 +641,36 @@ class MakeMovie:
# Figure out the extension for the output files.
ext
=
self
.
LookupImageExtension
(
self
.
outputFormat
)
# Make the viewer try and restore its session using the file that
# was passed in.
RestoreSession
(
self
.
stateFile
,
0
)
# Make sure that plots are all drawn.
DrawPlots
()
# Save an image for each frame in the animation.
self
.
numFrames
=
0
i
=
0
while
(
i
<
AnimationGetNFrames
()):
AnimationSetFrame
(
i
)
self
.
SaveImage
(
self
.
numFrames
,
ext
)
self
.
numFrames
=
self
.
numFrames
+
1
i
=
i
+
self
.
frameStep
if
(
self
.
usesStateFile
):
# Make the viewer try and restore its session using the file that
# was passed in.
RestoreSession
(
self
.
stateFile
,
0
)
# Make sure that plots are all drawn.
DrawPlots
()
# Make sure that camera view mode is on so that if we have a
# saved keyframe animation, we really get the keyframed view.
if
(
GetWindowInformation
().
cameraViewMode
==
0
):
ToggleCameraViewMode
()
# Save an image for each frame in the animation.
self
.
numFrames
=
0
i
=
0
while
(
i
<
AnimationGetNFrames
()):
AnimationSetFrame
(
i
)
self
.
SaveImage
(
self
.
numFrames
,
ext
)
self
.
numFrames
=
self
.
numFrames
+
1
i
=
i
+
self
.
frameStep
else
:
# Save the callback data so we can call methods on this object.
globals
()[
'classSaveWindowObj'
]
=
self
# Create a modified version of the user's script.
name
=
self
.
CreateMangledSource
(
self
.
scriptFile
)
# Try executing the modified version of the user's script.
Source
(
name
)
# Remove the modified script.
RemoveFile
(
name
);
###########################################################################
# Method: EncodeMPEGMovie
...
...
bin/visit
View file @
c018389a
...
...
@@ -261,6 +261,9 @@ $0 = shift @ARGV;
# Jeremy Meredith, Mon Sep 29 11:26:47 PDT 2003
# Added help for the "-o" and "-launchengine" flags.
#
# Brad Whitlock, Fri Oct 3 12:59:49 PDT 2003
# I made the -s argument become -scriptfile when -movie is specified.
#
###############################################################################
...
...
@@ -370,7 +373,7 @@ USAGE: visit [arguments]
Scripting arguments:
-s <scriptname> Runs the specified VisIt script. Note that
this argument only takes effect with -cli.
this argument only takes effect with -cli
or -movie
.
-verbose Prints status information during pipeline
execution.
...
...
@@ -459,6 +462,7 @@ while (scalar(@ARGV) > 0) {
elsif
(
$arg
eq
"-time_annotation"
)
{
$exe_name
=
"time_annotation"
;
}
elsif
(
$arg
eq
"-mpeg_encode"
)
{
$exe_name
=
"mpeg_encode"
;
}
elsif
(
$arg
eq
"-movie"
)
{
$exe_name
=
"cli"
;
$add_movie_args
=
1
;
}
elsif
(
$arg
eq
"-s"
)
{
if
(
$add_movie_args
)
{
$sfile
=
shift
;
push @visitargs,
"-scriptfile"
,
$sfile
;
}
else
{
push @visitargs,
$arg
;
}}
elsif
(
$arg
eq
"-publicpluginsonly"
){
$publiconly
=
1
;
push @visitargs,
$arg
;
}
elsif
(
$arg
eq
"-version"
)
{
$want_version
=
1
;
}
elsif
(
$arg
eq
"-help"
)
{
print STDERR
"
$usage
\n
"
;
exit
(
0
)
;
}
...
...
@@ -1113,7 +1117,6 @@ else
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Database/Database
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Database/Formats
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Database/Ghost
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Database/MIR
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Exceptions/Database
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Exceptions/Pipeline
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Exceptions/VisWindow
\n
"
;
...
...
@@ -1123,6 +1126,9 @@ else
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Expressions/Math
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Expressions/MeshQuality
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Math
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/MIR/Base
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/MIR/Tet
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/MIR/Zoo
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Pipeline/Data
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Pipeline/Pipeline
\n
"
;
print GDBFILE
"directory
$ENV
{VISITHOME}/components/Pipeline/PrivateFilters
\n
"
;
...
...
common/state/ColorAttribute.C
View file @
c018389a
...
...
@@ -10,7 +10,7 @@
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -33,7 +33,7 @@ ColorAttribute::ColorAttribute() : AttributeSubject("U")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -59,7 +59,7 @@ ColorAttribute::ColorAttribute(const ColorAttribute &obj) : AttributeSubject("U"
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -79,7 +79,7 @@ ColorAttribute::~ColorAttribute()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -106,7 +106,7 @@ ColorAttribute::operator = (const ColorAttribute &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -135,7 +135,7 @@ ColorAttribute::operator == (const ColorAttribute &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -156,7 +156,7 @@ ColorAttribute::operator != (const ColorAttribute &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -177,7 +177,7 @@ ColorAttribute::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -205,7 +205,7 @@ ColorAttribute::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -231,7 +231,7 @@ ColorAttribute::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -258,7 +258,7 @@ ColorAttribute::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -286,7 +286,9 @@ ColorAttribute::SelectAll()
// Creation: Wed Jul 23 11:29:38 PDT 2003
//
// Modifications:
//
// Brad Whitlock, Fri Oct 3 10:13:43 PDT 2003
// I made it always save to the parentNode.
//
// ****************************************************************************
bool
...
...
@@ -295,27 +297,13 @@ ColorAttribute::CreateNode(DataNode *parentNode, bool forceAdd)
if
(
parentNode
==
0
)
return
false
;
ColorAttribute
defaultObject
;
bool
addToParent
=
false
;
// Create a node for ColorAttribute.
DataNode
*
node
=
new
DataNode
(
"ColorAttribute"
);
node
->
AddNode
(
new
DataNode
(
"color"
,
color
,
4
));
parentNode
->
AddNode
(
node
);
if
(
!
FieldsEqual
(
0
,
&
defaultObject
))
{
addToParent
=
true
;
node
->
AddNode
(
new
DataNode
(
"color"
,
color
,
4
));
}
// Add the node to the parent node.
if
(
addToParent
||
forceAdd
)
parentNode
->
AddNode
(
node
);
else
delete
node
;
return
(
addToParent
||
forceAdd
);
return
true
;
}
// ****************************************************************************
// Method: ColorAttribute::SetFromNode
//
...
...
@@ -325,7 +313,7 @@ ColorAttribute::CreateNode(DataNode *parentNode, bool forceAdd)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -334,6 +322,7 @@ ColorAttribute::CreateNode(DataNode *parentNode, bool forceAdd)
void
ColorAttribute
::
SetFromNode
(
DataNode
*
parentNode
)
{
int
i
;
if
(
parentNode
==
0
)
return
;
...
...
@@ -389,7 +378,7 @@ ColorAttribute::GetColor()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -414,7 +403,7 @@ ColorAttribute::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -439,7 +428,7 @@ ColorAttribute::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
@@ -464,7 +453,7 @@ ColorAttribute::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
common/state/ColorAttribute.code
View file @
c018389a
...
...
@@ -133,3 +133,36 @@ ColorAttribute::Alpha() const
return (int)color[3];
}
Function: CreateNode
Declaration: bool CreateNode(DataNode *, bool);
Definition:
// ****************************************************************************
// Method: ColorAttribute::CreateNode
//
// Purpose:
// This method creates a DataNode representation of the object so it can be saved to a config file.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:29:38 PDT 2003
//
// Modifications:
// Brad Whitlock, Fri Oct 3 10:13:43 PDT 2003
// I made it always save to the parentNode.
//
// ****************************************************************************
bool
ColorAttribute::CreateNode(DataNode *parentNode, bool forceAdd)
{
if(parentNode == 0)
return false;
// Create a node for ColorAttribute.
DataNode *node = new DataNode("ColorAttribute");
node->AddNode(new DataNode("color", color, 4));
parentNode->AddNode(node);
return true;
}
common/state/ColorAttribute.h
View file @
c018389a
...
...
@@ -12,7 +12,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:
Wed Jul 23 11:29:3
8 PDT 2003
// Creation:
Fri Oct 3 10:16:0
8 PDT 2003
//
// Modifications:
//
...
...
common/state/ColorAttribute.xml
View file @
c018389a
...
...
@@ -13,4 +13,5 @@
<Function
name=
"Green"
user=
"true"
></Function>
<Function
name=
"Blue"
user=
"true"
></Function>
<Function
name=
"Alpha"
user=
"true"
></Function>
<Function
name=
"CreateNode"
user=
"false"
></Function>
</Attribute>
common/state/ConfigManager.C
View file @
c018389a
...
...
@@ -105,6 +105,43 @@ ConfigManager::WriteIndent(int indentLevel)
fprintf
(
fp
,
" "
);
}
// ****************************************************************************
// Method: ConfigManager::WriteQuotedStringData
//
// Purpose:
// Writes the string to the file surrounded by quotes and and quotes that
// the string had in it are escaped.
//
// Arguments:
// str : The string to write to the file.
//
// Programmer: Brad Whitlock
// Creation: Fri Oct 3 16:18:10 PST 2003
//
// Modifications:
//
// ****************************************************************************
void
ConfigManager
::
WriteQuotedStringData
(
const
std
::
string
&
str
)
{
fputc
(
'"'
,
fp
);
if
(
str
.
size
()
>
0
)
{
const
char
*
cptr
=
str
.
c_str
();
for
(
int
i
=
0
;
i
<
str
.
size
();
++
i
)
{
// Add escape characters.
if
(
cptr
[
i
]
==
'"'
||
cptr
[
i
]
==
'\\'
)
fputc
(
'\\'
,
fp
);
fputc
(
cptr
[
i
],
fp
);
}
}
fputc
(
'"'
,
fp
);
fputc
(
' '
,
fp
);
}
// ****************************************************************************
// Method: ConfigManager::WriteData
//
...
...
@@ -122,6 +159,10 @@ ConfigManager::WriteIndent(int indentLevel)
// Brad Whitlock, Fri Mar 30 14:37:21 PST 2001
// Added unsigned char cases.
//
// Brad Whitlock, Fri Oct 3 16:00:21 PST 2003
// I made string vectors and arrays quote their strings so they read in
// correctly if the strings contain spaces.
//
// ****************************************************************************
void
...
...
@@ -203,8 +244,8 @@ ConfigManager::WriteData(DataNode *node)
case
STRING_ARRAY_NODE
:
{
// new scope
const
std
::
string
*
sptr
=
node
->
AsStringArray
();
for
(
i
=
0
;
i
<
node
->
GetLength
();
++
i
,
++
sptr
)
fprintf
(
fp
,
"%s "
,
sptr
->
c_str
()
);
for
(
i
=
0
;
i
<
node
->
GetLength
();
++
i
)
WriteQuotedStringData
(
*
sptr
++
);
}
break
;
case
BOOL_ARRAY_NODE
:
...
...
@@ -265,7 +306,7 @@ ConfigManager::WriteData(DataNode *node)
{
// new scope
const
stringVector
&
svec
=
node
->
AsStringVector
();
for
(
i
=
0
;
i
<
svec
.
size
();
++
i
)
fprintf
(
fp
,
"%s "
,
svec
[
i
].
c_str
()
);
WriteQuotedStringData
(
svec
[
i
]
);