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) ...@@ -639,7 +639,11 @@ void vtkContext2D::ApplyPen(vtkPen *pen)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
vtkPen* vtkContext2D::GetPen() vtkPen* vtkContext2D::GetPen()
{ {
if (this->Device)
{
return this->Device->GetPen(); return this->Device->GetPen();
}
return NULL;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -651,7 +655,11 @@ void vtkContext2D::ApplyBrush(vtkBrush *brush) ...@@ -651,7 +655,11 @@ void vtkContext2D::ApplyBrush(vtkBrush *brush)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
vtkBrush* vtkContext2D::GetBrush() vtkBrush* vtkContext2D::GetBrush()
{ {
if (this->Device)
{
return this->Device->GetBrush(); return this->Device->GetBrush();
}
return NULL;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -663,7 +671,11 @@ void vtkContext2D::ApplyTextProp(vtkTextProperty *prop) ...@@ -663,7 +671,11 @@ void vtkContext2D::ApplyTextProp(vtkTextProperty *prop)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
vtkTextProperty* vtkContext2D::GetTextProp() vtkTextProperty* vtkContext2D::GetTextProp()
{ {
if (this->Device)
{
return this->Device->GetTextProp(); return this->Device->GetTextProp();
}
return NULL;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -678,8 +690,12 @@ void vtkContext2D::SetTransform(vtkTransform2D *transform) ...@@ -678,8 +690,12 @@ void vtkContext2D::SetTransform(vtkTransform2D *transform)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
vtkTransform2D* vtkContext2D::GetTransform() vtkTransform2D* vtkContext2D::GetTransform()
{ {
if (this->Device && this->Transform)
{
this->Device->GetMatrix(this->Transform->GetMatrix()); this->Device->GetMatrix(this->Transform->GetMatrix());
return this->Transform; return this->Transform;
}
return NULL;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -98,6 +98,11 @@ void vtkProgrammableElectronicData::SetNumberOfMOs(vtkIdType size) ...@@ -98,6 +98,11 @@ void vtkProgrammableElectronicData::SetNumberOfMOs(vtkIdType size)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
vtkImageData * vtkProgrammableElectronicData::GetMO(vtkIdType orbitalNumber) 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())) if (orbitalNumber > static_cast<vtkIdType>(this->MOs->size()))
{ {
vtkWarningMacro(<< "Request for orbital number " << orbitalNumber vtkWarningMacro(<< "Request for orbital number " << orbitalNumber
...@@ -117,6 +122,11 @@ vtkImageData * vtkProgrammableElectronicData::GetMO(vtkIdType orbitalNumber) ...@@ -117,6 +122,11 @@ vtkImageData * vtkProgrammableElectronicData::GetMO(vtkIdType orbitalNumber)
void vtkProgrammableElectronicData::SetMO(vtkIdType orbitalNumber, void vtkProgrammableElectronicData::SetMO(vtkIdType orbitalNumber,
vtkImageData *data) vtkImageData *data)
{ {
if (orbitalNumber <= 0)
{
vtkErrorMacro("Cannot set invalid orbital number "<<orbitalNumber);
return;
}
if (orbitalNumber > static_cast<vtkIdType>(this->MOs->size())) if (orbitalNumber > static_cast<vtkIdType>(this->MOs->size()))
{ {
this->SetNumberOfMOs(orbitalNumber); 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