Commit e2c85f42 authored by bonnell's avatar bonnell

merge from RC, fix reader crashes on windows, picked up other changes

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@8086 18c085ea-50e0-402c-830e-de6fd14e8384
parent 93ea43d9
......@@ -629,8 +629,10 @@ avtStreamlineFilter::SetTermination(int type, double term)
terminationType = avtIVPSolver::DISTANCE;
else if (type == STREAMLINE_TERMINATE_TIME)
terminationType = avtIVPSolver::TIME;
else if (type == STREAMLINE_TERMINATE_STEP)
terminationType = avtIVPSolver::STEP;
else if (type == STREAMLINE_TERMINATE_STEPS)
terminationType = avtIVPSolver::STEPS;
else if (type == STREAMLINE_TERMINATE_INTERSECTIONS)
terminationType = avtIVPSolver::INTERSECTIONS;
termination = term;
}
......@@ -2250,21 +2252,44 @@ avtStreamlineFilter::GetSeedPoints(std::vector<avtStreamlineWrapper *> &pts)
else if(sourceType == STREAMLINE_SOURCE_LINE)
{
vtkLineSource* line = vtkLineSource::New();
double z0 = (dataSpatialDimension > 2) ? lineStart[2] : 0.;
double z1 = (dataSpatialDimension > 2) ? lineEnd[2] : 0.;
line->SetPoint1(lineStart[0], lineStart[1], z0);
line->SetPoint2(lineEnd[0], lineEnd[1], z1);
line->SetResolution(pointDensity1);
line->Update();
for (int i = 0; i< line->GetOutput()->GetNumberOfPoints(); i++)
{
double *pt = line->GetOutput()->GetPoint(i);
if( pointDensity1 == 1 )
{
avtVector p((lineStart[0] + lineEnd[0]) / 2,
(lineStart[1] + lineEnd[1]) / 2,
(z0 + z1) / 2 );
candidatePts.push_back(p);
}
else if( pointDensity1 == 2 )
{
avtVector p0(lineStart[0], lineStart[1], z0 );
candidatePts.push_back(p0);
avtVector p1(lineEnd[0], lineEnd[1], z1);
candidatePts.push_back(p1);
}
else
{
vtkLineSource* line = vtkLineSource::New();
line->SetPoint1(lineStart[0], lineStart[1], z0);
line->SetPoint2(lineEnd[0], lineEnd[1], z1);
line->SetResolution(pointDensity1-1); // Resolution is segments
line->Update();
for (int i = 0; i< line->GetOutput()->GetNumberOfPoints(); i++)
{
double *pt = line->GetOutput()->GetPoint(i);
avtVector p(pt[0], pt[1], pt[2]);
candidatePts.push_back(p);
}
line->Delete();
}
line->Delete();
}
}
else if(sourceType == STREAMLINE_SOURCE_PLANE)
{
......@@ -2288,7 +2313,7 @@ avtStreamlineFilter::GetSeedPoints(std::vector<avtStreamlineWrapper *> &pts)
plane->SetPoint1(P2.x, P2.y, P2.z);
plane->SetNormal(N.x, N.y, N.z);
plane->SetCenter(O.x, O.y, O.z);
plane->SetResolution(pointDensity1,pointDensity2);
plane->SetResolution(pointDensity1-1,pointDensity2-1);
plane->Update();
for (int i = 0; i< plane->GetOutput()->GetNumberOfPoints(); i++)
......
......@@ -86,7 +86,8 @@ class DomainType;
#define STREAMLINE_TERMINATE_DISTANCE 0
#define STREAMLINE_TERMINATE_TIME 1
#define STREAMLINE_TERMINATE_STEP 2
#define STREAMLINE_TERMINATE_STEPS 2
#define STREAMLINE_TERMINATE_INTERSECTIONS 3
#define STREAMLINE_INTEGRATE_DORMAND_PRINCE 0
#define STREAMLINE_INTEGRATE_ADAMS_BASHFORTH 1
......
......@@ -53,7 +53,7 @@ static const double epsilon = std::numeric_limits<double>::epsilon();
static const double bashforth[] = { 1901.0, -2774.0, 2616.0, -1274.0, 251.0 };
static const double divisor = 1.0 / 720.0;
#define STEPS sizeof(bashforth)/sizeof(bashforth[0])
#define NSTEPS sizeof(bashforth)/sizeof(bashforth[0])
// helper function
// returns a with the same sign as b
......@@ -400,7 +400,7 @@ avtIVPAdamsBashforth::ABStep(const avtIVPField* field,
// Calculate the predictor using the Adams-Bashforth formula
yNew = yCur;
for (size_t i = 0; i < STEPS; i++)
for (size_t i = 0; i < NSTEPS; i++)
yNew += h*divisor*bashforth[i] * history[i];
return avtIVPSolver::OK;
......@@ -449,7 +449,7 @@ avtIVPAdamsBashforth::Step(const avtIVPField* field,
if (termType == TIME)
t_max = end;
else if (termType == DISTANCE || termType == STEP)
else if (termType == DISTANCE || termType == STEPS)
{
t_max = std::numeric_limits<double>::max();
if (end < 0)
......@@ -475,7 +475,7 @@ avtIVPAdamsBashforth::Step(const avtIVPField* field,
avtIVPSolver::Result res;
avtVec yNew(yCur.dim());
// Use a forth order Runga Kutta integration to seed the Adams-Bashforth.
if ( initialized < STEPS )
if ( initialized < NSTEPS )
{
// Save the first vector values in the history.
if( initialized == 0 )
......@@ -532,7 +532,7 @@ avtIVPAdamsBashforth::Step(const avtIVPField* field,
d = d+len;
}
else if (termType == STEP &&
else if (termType == STEPS &&
numStep >= (int)fabs(end))
return TERMINATE;
......
......@@ -479,7 +479,7 @@ avtIVPDopri5::Step(const avtIVPField* field,
{
if (termType == TIME)
t_max = end;
else if (termType == DISTANCE || termType == STEP)
else if (termType == DISTANCE || termType == STEPS)
{
t_max = std::numeric_limits<double>::max();
if (end < 0)
......@@ -683,7 +683,7 @@ avtIVPDopri5::Step(const avtIVPField* field,
throw avtIVPField::Undefined();
d = d + len;
}
else if (termType == STEP &&
else if (termType == STEPS &&
numStep >= (int)fabs(end))
return TERMINATE;
......
......@@ -274,7 +274,8 @@ class avtIVPSolver
{
TIME,
DISTANCE,
STEP
STEPS,
INTERSECTIONS
};
virtual void Reset(const double& t_start, const avtVecRef& y_start) = 0;
......
......@@ -1931,6 +1931,12 @@ avtBoxlibFileFormat::GetAuxiliaryData(const char *var, int dom,
// Hank Childs, Tue Feb 5 16:37:58 PST 2008
// Fix memory leaks.
//
// Kathleen Bonnell, Wed Aug 5 12:01 PDT 2009
// Fix crash on windows -- cast std::vectors to pointers before passing
// as args to avtMaterial, so can catch the case where the vector is empty
// and therefore pass NULL, because attempting to dereference an empty
// vector's 0'th item crashes on windows.
//
// ****************************************************************************
void *
......@@ -2033,10 +2039,26 @@ avtBoxlibFileFormat::GetMaterial(const char *var, int patch,
}
int mixed_size = mix_zone.size();
avtMaterial * mat = new avtMaterial(nMaterials, mnames, nCells,
&(material_list[0]), mixed_size,
&(mix_mat[0]), &(mix_next[0]),
&(mix_zone[0]), &(mix_vf[0]));
// get pointers to pass to avtMaterial
int *ml = NULL, *mixm = NULL, *mixn = NULL, *mixz = NULL;
float *mixv = NULL;
if (material_list.size() > 0)
ml = &(material_list[0]);
if (mix_mat.size() > 0)
mixm = &(mix_mat[0]);
if (mix_mat.size() > 0)
mixm = &(mix_mat[0]);
if (mix_next.size() > 0)
mixn = &(mix_next[0]);
if (mix_zone.size() > 0)
mixz = &(mix_zone[0]);
if (mix_vf.size() > 0)
mixv = &(mix_vf[0]);
avtMaterial * mat = new avtMaterial(nMaterials, mnames, nCells, ml,
mixed_size, mixm, mixn, mixz, mixv);
df = avtMaterial::Destruct;
return (void*) mat;
......
......@@ -180,7 +180,9 @@ avtFITSFileFormat::GetKeywordValue(const char *keyword, char *value)
// Creation: Wed Jul 19 10:49:46 PDT 2006
//
// Modifications:
//
// Kathleen Bonnell, Wed Aug 05 18:04:02 PDT 2009
// Test cs not empty before accesing cs[cs.size()-1].
//
// ****************************************************************************
void
......@@ -267,7 +269,7 @@ avtFITSFileFormat::Initialize(avtDatabaseMetaData *md)
PrintError(status);
std::string cs(card);
fileComment += cs;
if(cs[cs.size()-1] != '\n')
if(cs.size() > 0 && cs[cs.size()-1] != '\n')
fileComment += "\n";
}
fileComment += "\n\n";
......@@ -446,7 +448,7 @@ avtFITSFileFormat::Initialize(avtDatabaseMetaData *md)
if(fits_read_record(fits, jj, card, &status))
PrintError(status);
std::string cs(card);
if(cs[cs.size()-1] != '\n')
if(cs.size() > 0 && cs[cs.size()-1] != '\n')
cs += "\n";
debug4 << "\t" << cs.c_str();
}
......
......@@ -175,6 +175,7 @@ H5NimrodGeneralPluginInfo::GetDfltExtsFromGen() const
{
std::vector<std::string> defaultExtensions;
defaultExtensions.push_back(".h5nimrod");
defaultExtensions.push_back(".h5");
return defaultExtensions;
}
......@@ -174,7 +174,8 @@ std::vector<std::string>
M3DGeneralPluginInfo::GetDfltExtsFromGen() const
{
std::vector<std::string> defaultExtensions;
defaultExtensions.push_back("m3d");
defaultExtensions.push_back(".m3d");
defaultExtensions.push_back(".h5");
return defaultExtensions;
}
......@@ -147,6 +147,10 @@ avtMiliFileFormat::IssueWarning(const char *msg, int key)
//
// Mark C. Miller, Mon Jul 18 13:41:13 PDT 2005
// Added initialization of structures having to do with free nodes mesh
//
// Kathleen Bonnell, Wed Aug 5 17:44:22 PDT 2009
// Test for windows-style slashes when scanning filename.
//
// ****************************************************************************
avtMiliFileFormat::avtMiliFileFormat(const char *fname)
......@@ -249,13 +253,13 @@ avtMiliFileFormat::avtMiliFileFormat(const char *fname)
for ( p_c = fname ; *p_c != '\0'; p_c++ );
/* Scan backward to last non-slash character. */
for ( p_c--; *p_c == '/' && p_c != fname; p_c-- );
for ( p_c--; (*p_c == '/' || *p_c == '\\') && p_c != fname; p_c-- );
p_root_end = p_c;
/* Scan backward to last slash character preceding last non-slash char. */
for ( ; *p_c != '/' && p_c != fname; p_c-- );
for ( ; (*p_c != '/' && *p_c != '\\') && p_c != fname; p_c-- );
p_root_start = ( *p_c == '/' ) ? p_c + 1 : p_c;
p_root_start = ( *p_c == '/' || *p_c == '\\' ) ? p_c + 1 : p_c;
/* Generate the path argument to mc_open(). */
if ( p_root_start == fname )
......
......@@ -775,7 +775,7 @@ vtkUnstructuredGrid * avtOpenFOAMFileFormat::MakeInternalMesh()
for(k = 0; k < (int)FacePoints[
FacesOfCell[i][j].faceIndex].size(); k++)
{
for(l = 0; l < (int)cellPoints.size(); l++);
for(l = 0; l < (int)cellPoints.size(); l++)
{
if(cellPoints[l] == FacePoints[
FacesOfCell[i][j].faceIndex][k])
......@@ -2870,7 +2870,7 @@ vtkUnstructuredGrid * avtOpenFOAMFileFormat::GetCellZoneMesh(int timeState, int
for(k = 0; k < (int)FacePoints[
FacesOfCell[i][j].faceIndex].size(); k++)
{
for(l = 0; l < (int)cellPoints.size(); l++);
for(l = 0; l < (int)cellPoints.size(); l++)
{
if(cellPoints[l] == FacePoints[FacesOfCell[
cellZone[i]][j].faceIndex][k])
......
......@@ -184,7 +184,12 @@ QvisIsosurfaceWindow::CreateWindowContents()
this, SLOT(processMinLimitText()));
limitsLayout->addWidget(minLineEdit, 2, 2);
limitsLayout->addWidget(new QLabel(tr("Variable"), central),3,0);
//
// Create the variable stuff
//
QLabel *variableLabel = new QLabel(tr("Variable"), central, "variableLabel");
limitsLayout->addWidget(variableLabel,3,0);
variable = new QvisVariableButton(true, true, true,
QvisVariableButton::Scalars, central);
connect(variable, SIGNAL(activated(const QString &)),
......@@ -217,7 +222,34 @@ QvisIsosurfaceWindow::CreateWindowContents()
// Each time a radio button is clicked, call the scaleClicked slot.
connect(scalingButtons, SIGNAL(buttonClicked(int)),
this, SLOT(scaleClicked(int)));
}
//
// Create the scale radio buttons
//
QHBoxLayout *scaleLayout = new QHBoxLayout(topLayout);
// Create a group of radio buttons
scalingButtons = new QButtonGroup( central, "scaleRadioGroup" );
scalingButtons->setFrameStyle(QFrame::NoFrame);
QLabel *scaleLabel = new QLabel(scalingButtons, tr("Scale"), central,
"scaleLabel");
scaleLayout->addWidget(scaleLabel);
QHBoxLayout *scaleButtonsLayout = new QHBoxLayout(scalingButtons);
scaleButtonsLayout->setSpacing(10);
QRadioButton *rb = new QRadioButton(tr("Linear"), scalingButtons );
rb->setChecked( TRUE );
scaleButtonsLayout->addWidget(rb);
rb = new QRadioButton( scalingButtons );
rb->setText( tr("Log") );
scaleButtonsLayout->addWidget(rb);
scaleLayout->addWidget( scalingButtons );
scaleLayout->addStretch(0);
// Each time a radio button is clicked, call the scaleClicked slot.
connect(scalingButtons, SIGNAL(clicked(int)),
this, SLOT(scaleClicked(int)));
}
// ****************************************************************************
......
......@@ -266,6 +266,26 @@ avtPersistentParticlesFilter::Execute(void)
SetStartFrame(myStart);
SetEndFrame(myStop);
}
// Check if the times are valid and correct if needed
if (myStart < 0)
myStart = 0;
if( myStart >= numStates )
myStart = numStates-1;
if( myStop < 0 )
myStop = 0;
if (myStop >= numStates)
myStop = numStates-1;
// if( myStart == myStop )
// {
// std::string msg(GetType());
// msg = msg + ": Start and stop indexes are the same. The start time " +
// "must be smaller than the stop time.";
// avtCallback::IssueWarning(msg.c_str());
// }
//Iterate over the time series
avtExecuteThenTimeLoopFilter::Execute();
......
......@@ -211,6 +211,7 @@ PoincareAttributes::PoincareAttsRequireRecalculation(const PoincareAttributes &o
numberPlanes != obj.numberPlanes ||
overrideToroidalWinding != obj.overrideToroidalWinding ||
colorBy != obj.colorBy ||
showCurves != obj.showCurves;
showCurves != obj.showCurves ||
verbose != obj.verbose;
}
......@@ -15,7 +15,8 @@
<Enum name="TerminationType">
Distance
Time
Step
Steps
Puctures
</Enum>
<Enum name="ColorBy">
OriginalValue
......@@ -100,6 +101,9 @@
0
255
</Field>
<Field name="verboseFlag" label="verbose" type="bool">
true
</Field>
<Field name="legendFlag" label="Legend" type="bool">
true
</Field>
......@@ -113,7 +117,7 @@
0.000010
</Field>
<Field name="terminationType" label="Termination Type" type="enum" subtype="TerminationType">
Step
Steps
</Field>
<Field name="integrationType" label="Integrator" type="enum" subtype="IntegrationType">
AdamsBashforth
......
......@@ -85,21 +85,21 @@ PoincareAttributes::SourceType_FromString(const std::string &s, PoincareAttribut
//
static const char *TerminationType_strings[] = {
"Distance", "Time", "Step"
};
"Distance", "Time", "Steps",
"Puctures"};
std::string
PoincareAttributes::TerminationType_ToString(PoincareAttributes::TerminationType t)
{
int index = int(t);
if(index < 0 || index >= 3) index = 0;
if(index < 0 || index >= 4) index = 0;
return TerminationType_strings[index];
}
std::string
PoincareAttributes::TerminationType_ToString(int t)
{
int index = (t < 0 || t >= 3) ? 0 : t;
int index = (t < 0 || t >= 4) ? 0 : t;
return TerminationType_strings[index];
}
......@@ -107,7 +107,7 @@ bool
PoincareAttributes::TerminationType_FromString(const std::string &s, PoincareAttributes::TerminationType &val)
{
val = PoincareAttributes::Distance;
for(int i = 0; i < 3; ++i)
for(int i = 0; i < 4; ++i)
{
if(s == TerminationType_strings[i])
{
......@@ -308,7 +308,7 @@ PoincareAttributes::ColoringMethod_FromString(const std::string &s, PoincareAttr
}
// Type map format string
const char *PoincareAttributes::TypeMapFormatString = "iddDDDDDDdisabbddiibbiiiidiibiddbbi";
const char *PoincareAttributes::TypeMapFormatString = "iddDDDDDDdisabbbddiibbiiiidiibiddbbi";
// ****************************************************************************
// Method: PoincareAttributes::PoincareAttributes
......@@ -352,11 +352,12 @@ PoincareAttributes::PoincareAttributes() :
planeUpAxis[2] = 0;
planeRadius = 1;
pointDensity = 1;
verboseFlag = true;
legendFlag = true;
lightingFlag = true;
relTol = 0.0001;
absTol = 1e-05;
terminationType = Step;
terminationType = Steps;
integrationType = AdamsBashforth;
showStreamlines = false;
showPoints = false;
......@@ -425,6 +426,7 @@ PoincareAttributes::PoincareAttributes(const PoincareAttributes &obj) :
pointDensity = obj.pointDensity;
colorTableName = obj.colorTableName;
singleColor = obj.singleColor;
verboseFlag = obj.verboseFlag;
legendFlag = obj.legendFlag;
lightingFlag = obj.lightingFlag;
relTol = obj.relTol;
......@@ -521,6 +523,7 @@ PoincareAttributes::operator = (const PoincareAttributes &obj)
pointDensity = obj.pointDensity;
colorTableName = obj.colorTableName;
singleColor = obj.singleColor;
verboseFlag = obj.verboseFlag;
legendFlag = obj.legendFlag;
lightingFlag = obj.lightingFlag;
relTol = obj.relTol;
......@@ -610,6 +613,7 @@ PoincareAttributes::operator == (const PoincareAttributes &obj) const
(pointDensity == obj.pointDensity) &&
(colorTableName == obj.colorTableName) &&
(singleColor == obj.singleColor) &&
(verboseFlag == obj.verboseFlag) &&
(legendFlag == obj.legendFlag) &&
(lightingFlag == obj.lightingFlag) &&
(relTol == obj.relTol) &&
......@@ -829,6 +833,7 @@ PoincareAttributes::SelectAll()
Select(ID_pointDensity, (void *)&pointDensity);
Select(ID_colorTableName, (void *)&colorTableName);
Select(ID_singleColor, (void *)&singleColor);
Select(ID_verboseFlag, (void *)&verboseFlag);
Select(ID_legendFlag, (void *)&legendFlag);
Select(ID_lightingFlag, (void *)&lightingFlag);
Select(ID_relTol, (void *)&relTol);
......@@ -963,6 +968,12 @@ PoincareAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool for
}
else
delete singleColorNode;
if(completeSave || !FieldsEqual(ID_verboseFlag, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("verboseFlag", verboseFlag));
}
if(completeSave || !FieldsEqual(ID_legendFlag, &defaultObject))
{
addToParent = true;
......@@ -1171,6 +1182,8 @@ PoincareAttributes::SetFromNode(DataNode *parentNode)
SetColorTableName(node->AsString());
if((node = searchNode->GetNode("singleColor")) != 0)
singleColor.SetFromNode(node);
if((node = searchNode->GetNode("verboseFlag")) != 0)
SetVerboseFlag(node->AsBool());
if((node = searchNode->GetNode("legendFlag")) != 0)
SetLegendFlag(node->AsBool());
if((node = searchNode->GetNode("lightingFlag")) != 0)
......@@ -1185,7 +1198,7 @@ PoincareAttributes::SetFromNode(DataNode *parentNode)
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 3)
if(ival >= 0 && ival < 4)
SetTerminationType(TerminationType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
......@@ -1408,6 +1421,13 @@ PoincareAttributes::SetSingleColor(const ColorAttribute &singleColor_)
Select(ID_singleColor, (void *)&singleColor);
}
void
PoincareAttributes::SetVerboseFlag(bool verboseFlag_)
{
verboseFlag = verboseFlag_;
Select(ID_verboseFlag, (void *)&verboseFlag);
}
void
PoincareAttributes::SetLegendFlag(bool legendFlag_)
{
......@@ -1692,6 +1712,12 @@ PoincareAttributes::GetSingleColor()
return singleColor;
}
bool
PoincareAttributes::GetVerboseFlag() const
{
return verboseFlag;
}
bool
PoincareAttributes::GetLegendFlag() const
{
......@@ -1913,6 +1939,7 @@ PoincareAttributes::GetFieldName(int index) const
case ID_pointDensity: return "pointDensity";
case ID_colorTableName: return "colorTableName";
case ID_singleColor: return "singleColor";
case ID_verboseFlag: return "verboseFlag";
case ID_legendFlag: return "legendFlag";
case ID_lightingFlag: return "lightingFlag";
case ID_relTol: return "relTol";
......@@ -1972,6 +1999,7 @@ PoincareAttributes::GetFieldType(int index) const
case ID_pointDensity: return FieldType_int;
case ID_colorTableName: return FieldType_colortable;
case ID_singleColor: return FieldType_color;
case ID_verboseFlag: return FieldType_bool;
case ID_legendFlag: return FieldType_bool;
case ID_lightingFlag: return FieldType_bool;
case ID_relTol: return FieldType_double;
......@@ -2031,6 +2059,7 @@ PoincareAttributes::GetFieldTypeName(int index) const
case ID_pointDensity: return "int";
case ID_colorTableName: return "colortable";
case ID_singleColor: return "color";
case ID_verboseFlag: return "bool";
case ID_legendFlag: return "bool";
case ID_lightingFlag: return "bool";
case ID_relTol: return "double";
......@@ -2174,6 +2203,11 @@ PoincareAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (singleColor == obj.singleColor);
}
break;
case ID_verboseFlag:
{ // new scope
retval = (verboseFlag == obj.verboseFlag);
}
break;
case ID_legendFlag:
{ // new scope
retval = (legendFlag == obj.legendFlag);
......@@ -2397,6 +2431,9 @@ PoincareAttributes::PoincareAttsRequireRecalculation(const PoincareAttributes &o
numberPlanes != obj.numberPlanes ||
overrideToroidalWinding != obj.overrideToroidalWinding ||
colorBy != obj.colorBy ||
showCurves != obj.showCurves;
showIslands != obj.showIslands ||
showCurves != obj.showCurves ||
showPoints != obj.showPoints ||
verboseFlag != obj.verboseFlag;
}
......@@ -70,7 +70,8 @@ public:
{
Distance,
Time,
Step
Steps,
Puctures
};
enum ColorBy
{
......@@ -145,6 +146,7 @@ public:
void SetPointDensity(int pointDensity_);
void SetColorTableName(const std::string &colorTableName_);
void SetSingleColor(const ColorAttribute &singleColor_);
void SetVerboseFlag(bool verboseFlag_);
void SetLegendFlag(bool legendFlag_);
void SetLightingFlag(bool lightingFlag_);
void SetRelTol(double relTol_);
......@@ -190,6 +192,7 @@ public:
std::string &GetColorTableName();
const ColorAttribute &GetSingleColor() const;
ColorAttribute &GetSingleColor();
bool GetVerboseFlag() const;
bool GetLegendFlag() const;
bool GetLightingFlag() const;
double GetRelTol() const;
......@@ -280,6 +283,7 @@ public:
ID_pointDensity,
ID_colorTableName,
ID_singleColor,
ID_verboseFlag,
ID_legendFlag,
ID_lightingFlag,
ID_relTol,
......@@ -318,6 +322,7 @@ private:
int pointDensity;
std::string colorTableName;
ColorAttribute singleColor;
bool verboseFlag;
bool legendFlag;
bool lightingFlag;
double relTol;
......
This diff is collapsed.
......@@ -51,7 +51,7 @@
// Note: Autogenerated by xml2python. Do not modify by hand!
//
// Programmer: xml2python
// Creation: Mon Apr 27 10:52:27 PDT 2009
// Creation: Wed Aug 5 15:40:14 PST 2009
//
// ****************************************************************************
......@@ -205,6 +205,11 @@ PyPoincareAttributes_ToString(const PoincareAttributes *atts, const char *prefix
const unsigned char *singleColor = atts->GetSingleColor().GetColor();
SNPRINTF(tmpStr, 1000, "%ssingleColor = (%d, %d, %d, %d)\n", prefix, int(singleColor[0]), int(singleColor[1]), int(singleColor[2]), int(singleColor[3]));
str += tmpStr;
if(atts->GetVerboseFlag())
SNPRINTF(tmpStr, 1000, "%sverboseFlag = 1\n", prefix);
else
SNPRINTF(tmpStr, 1000, "%sverboseFlag = 0\n", prefix);
str += tmpStr;
if(atts->GetLegendFlag())
SNPRINTF(tmpStr, 1000, "%slegendFlag = 1\n", prefix);
else
......@@ -219,7 +224,7 @@ PyPoincareAttributes_ToString(const PoincareAttributes *atts, const char *prefix
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%sabsTol = %g\n", prefix, atts->GetAbsTol());
str += tmpStr;
const char *terminationType_names = "Distance, Time, Step";
const char *terminationType_names = "Distance, Time, Steps, Puctures";
switch (atts->GetTerminationType())
{
case PoincareAttributes::Distance:
......@@ -230,8 +235,12 @@ PyPoincareAttributes_ToString(const PoincareAttributes *atts, const char *prefix
SNPRINTF(tmpStr, 1000, "%sterminationType = %sTime # %s\n", prefix, prefix, terminationType_names);
str += tmpStr;
break;
case PoincareAttributes::Step:
SNPRINTF(tmpStr, 1000, "%sterminationType = %sStep # %s\n", prefix, prefix, terminationType_names);
case PoincareAttributes::Steps:
SNPRINTF(tmpStr, 1000, "%sterminationType = %sSteps # %s\n", prefix, prefix, terminationType_names);
str += tmpStr;
break;
case PoincareAttributes::Puctures:
SNPRINTF(tmpStr, 1000, "%sterminationType = %sPuctures # %s\n", prefix, prefix, terminationType_names);
str += tmpStr;
break;
default:
......@@ -955,6 +964,30 @@ PoincareAttributes_GetSingleColor(PyObject *self, PyObject *args)
return retval;
}
/*static*/ PyObject *
PoincareAttributes_SetVerboseFlag(PyObject *self, PyObject *args)
{
PoincareAttributesObject *obj = (PoincareAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the verboseFlag in the object.
obj->data->SetVerboseFlag(ival != 0);
Py_INCREF(Py_None);
return Py_None;
}
/*static*/ PyObject *
PoincareAttributes_GetVerboseFlag(PyObject *self, PyObject *args)
{
PoincareAttributesObject *obj = (PoincareAttributesObject *)self;
PyObject *retval = PyInt_FromLong(obj->data->GetVerboseFlag()?1L:0L);