Commit cd4b584a authored by Dave DeMarle's avatar Dave DeMarle
Browse files

Merge branch 'fix-setget-tests' into release

Change-Id: I45d5e1e49aa9154edd826f02687ffc6bd3eff464
parents 49c3e919 8e17ee09
......@@ -639,7 +639,11 @@ void vtkContext2D::ApplyPen(vtkPen *pen)
//-----------------------------------------------------------------------------
vtkPen* vtkContext2D::GetPen()
{
return this->Device->GetPen();
if (this->Device)
{
return this->Device->GetPen();
}
return NULL;
}
//-----------------------------------------------------------------------------
......@@ -651,7 +655,11 @@ void vtkContext2D::ApplyBrush(vtkBrush *brush)
//-----------------------------------------------------------------------------
vtkBrush* vtkContext2D::GetBrush()
{
return this->Device->GetBrush();
if (this->Device)
{
return this->Device->GetBrush();
}
return NULL;
}
//-----------------------------------------------------------------------------
......@@ -663,7 +671,11 @@ void vtkContext2D::ApplyTextProp(vtkTextProperty *prop)
//-----------------------------------------------------------------------------
vtkTextProperty* vtkContext2D::GetTextProp()
{
return this->Device->GetTextProp();
if (this->Device)
{
return this->Device->GetTextProp();
}
return NULL;
}
//-----------------------------------------------------------------------------
......@@ -678,8 +690,12 @@ void vtkContext2D::SetTransform(vtkTransform2D *transform)
//-----------------------------------------------------------------------------
vtkTransform2D* vtkContext2D::GetTransform()
{
this->Device->GetMatrix(this->Transform->GetMatrix());
return this->Transform;
if (this->Device && this->Transform)
{
this->Device->GetMatrix(this->Transform->GetMatrix());
return this->Transform;
}
return NULL;
}
//-----------------------------------------------------------------------------
......
......@@ -98,6 +98,11 @@ void vtkProgrammableElectronicData::SetNumberOfMOs(vtkIdType size)
//----------------------------------------------------------------------------
vtkImageData * vtkProgrammableElectronicData::GetMO(vtkIdType orbitalNumber)
{
if (orbitalNumber <= 0)
{
vtkWarningMacro(<< "Request for invalid orbital number "<<orbitalNumber);
return NULL;
}
if (orbitalNumber > static_cast<vtkIdType>(this->MOs->size()))
{
vtkWarningMacro(<< "Request for orbital number " << orbitalNumber
......@@ -117,6 +122,11 @@ vtkImageData * vtkProgrammableElectronicData::GetMO(vtkIdType orbitalNumber)
void vtkProgrammableElectronicData::SetMO(vtkIdType orbitalNumber,
vtkImageData *data)
{
if (orbitalNumber <= 0)
{
vtkErrorMacro("Cannot set invalid orbital number "<<orbitalNumber);
return;
}
if (orbitalNumber > static_cast<vtkIdType>(this->MOs->size()))
{
this->SetNumberOfMOs(orbitalNumber);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment