Commit e739bcd1 authored by Amy Squillacote's avatar Amy Squillacote
Browse files

removing unused class

parent ff6cd551
/*=========================================================================
Program: ParaView
Module: vtkPVLabel.cxx
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkPVLabel.h"
#include "vtkArrayMap.txx"
#include "vtkKWLabel.h"
#include "vtkObjectFactory.h"
#include "vtkPVXMLElement.h"
//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkPVLabel);
vtkCxxRevisionMacro(vtkPVLabel, "1.10");
//----------------------------------------------------------------------------
vtkPVLabel::vtkPVLabel()
{
this->Label = vtkKWLabel::New();
this->Label->SetParent(this);
}
//----------------------------------------------------------------------------
vtkPVLabel::~vtkPVLabel()
{
this->Label->Delete();
this->Label = NULL;
}
//----------------------------------------------------------------------------
void vtkPVLabel::SetBalloonHelpString(const char *str)
{
// A little overkill.
if (this->BalloonHelpString == NULL && str == NULL)
{
return;
}
// This check is needed to prevent errors when using
// this->SetBalloonHelpString(this->BalloonHelpString)
if (str != this->BalloonHelpString)
{
// Normal string stuff.
if (this->BalloonHelpString)
{
delete [] this->BalloonHelpString;
this->BalloonHelpString = NULL;
}
if (str != NULL)
{
this->BalloonHelpString = new char[strlen(str)+1];
strcpy(this->BalloonHelpString, str);
}
}
if ( this->GetApplication() && !this->BalloonHelpInitialized )
{
this->Label->SetBalloonHelpString(this->BalloonHelpString);
this->BalloonHelpInitialized = 1;
}
}
//----------------------------------------------------------------------------
void vtkPVLabel::Create(vtkKWApplication *pvApp)
{
// Call the superclass to create the widget and set the appropriate flags
if (!this->vtkKWWidget::Create(pvApp, "frame", "-bd 0 -relief flat"))
{
vtkErrorMacro("Failed creating widget " << this->GetClassName());
return;
}
// Now a label
this->Label->Create(pvApp, "-width 18 -justify right");
if (this->BalloonHelpString)
{
this->SetBalloonHelpString(this->BalloonHelpString);
}
this->Script("pack %s -side left", this->Label->GetWidgetName());
}
//----------------------------------------------------------------------------
vtkPVLabel* vtkPVLabel::ClonePrototype(vtkPVSource* pvSource,
vtkArrayMap<vtkPVWidget*, vtkPVWidget*>* map)
{
vtkPVWidget* clone = this->ClonePrototypeInternal(pvSource, map);
return vtkPVLabel::SafeDownCast(clone);
}
//----------------------------------------------------------------------------
void vtkPVLabel::CopyProperties(vtkPVWidget* clone, vtkPVSource* pvSource,
vtkArrayMap<vtkPVWidget*, vtkPVWidget*>* map)
{
this->Superclass::CopyProperties(clone, pvSource, map);
vtkPVLabel* pvl = vtkPVLabel::SafeDownCast(clone);
if (pvl)
{
pvl->Label->SetLabel(this->Label->GetLabel());
}
else
{
vtkErrorMacro("Internal error. Could not downcast clone to PVLabel.");
}
}
//----------------------------------------------------------------------------
int vtkPVLabel::ReadXMLAttributes(vtkPVXMLElement* element,
vtkPVXMLPackageParser* parser)
{
if(!this->Superclass::ReadXMLAttributes(element, parser)) { return 0; }
// Setup the Label.
const char* label = element->GetAttribute("label");
if(label)
{
this->Label->SetLabel(label);
}
else
{
this->Label->SetLabel(this->VariableName);
}
return 1;
}
//----------------------------------------------------------------------------
void vtkPVLabel::SetLabel(const char *str)
{
this->Label->SetLabel(str);
if (str && str[0] &&
(this->TraceNameState == vtkPVWidget::Uninitialized ||
this->TraceNameState == vtkPVWidget::Default) )
{
this->SetTraceName(str);
this->SetTraceNameState(vtkPVWidget::SelfInitialized);
}
}
//----------------------------------------------------------------------------
const char* vtkPVLabel::GetLabel()
{
return this->Label->GetLabel();
}
//----------------------------------------------------------------------------
void vtkPVLabel::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
/*=========================================================================
Program: ParaView
Module: vtkPVLabel.h
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkPVLabel -
// .SECTION Description
#ifndef __vtkPVLabel_h
#define __vtkPVLabel_h
#include "vtkPVObjectWidget.h"
class vtkKWApplication;
class vtkKWLabel;
class VTK_EXPORT vtkPVLabel : public vtkPVObjectWidget
{
public:
static vtkPVLabel* New();
vtkTypeRevisionMacro(vtkPVLabel, vtkPVObjectWidget);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Setting the label also sets the name.
void SetLabel(const char *str);
const char* GetLabel();
virtual void Create(vtkKWApplication *pvApp);
// Description:
// This class redefines SetBalloonHelpString since it
// has to forward the call to a widget it contains.
virtual void SetBalloonHelpString(const char *str);
//BTX
// Description:
// Creates and returns a copy of this widget. It will create
// a new instance of the same type as the current object
// using NewInstance() and then copy some necessary state
// parameters.
vtkPVLabel* ClonePrototype(vtkPVSource* pvSource,
vtkArrayMap<vtkPVWidget*, vtkPVWidget*>* map);
//ETX
// Description:
// Empty method to keep superclass from complaining.
virtual void Trace(ofstream *) {};
// Description:
// Save this widget to a file.
virtual void SaveInBatchScript(ofstream *) {};
protected:
vtkPVLabel();
~vtkPVLabel();
vtkKWLabel *Label;
vtkPVLabel(const vtkPVLabel&); // Not implemented
void operator=(const vtkPVLabel&); // Not implemented
//BTX
virtual void CopyProperties(vtkPVWidget* clone, vtkPVSource* pvSource,
vtkArrayMap<vtkPVWidget*, vtkPVWidget*>* map);
//ETX
int ReadXMLAttributes(vtkPVXMLElement* element,
vtkPVXMLPackageParser* parser);
};
#endif
Supports Markdown
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