Commit 0c04b1ec authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Print methods.

parent ef026194
......@@ -30,6 +30,7 @@ class vlConeSource : public vlPolySource
public:
vlConeSource(int res=6);
char *GetClassName() {return "vlConeSource";};
void PrintSelf(ostream& os, vlIndent indent);
vlSetClampMacro(Height,float,0.0,LARGE_FLOAT)
vlGetMacro(Height,float);
......
......@@ -19,10 +19,9 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#ifndef __vlContourFilter_h
#define __vlContourFilter_h
#include "DataSetF.hh"
#include "PolyData.hh"
#include "DS2PolyF.hh"
class vlContourFilter : public vlDataSetFilter, public vlPolyData
class vlContourFilter : public vlDataSetToPolyFilter
{
public:
vlContourFilter(float value=0.0) {this->Value = value;};
......
......@@ -26,6 +26,7 @@ class vlCubeSource : public vlPolySource
public:
vlCubeSource(float xL=1.0, float yL=1.0, float zL=1.0);
char *GetClassName() {return "vlCubeSource";};
void PrintSelf(ostream& os, vlIndent indent);
vlSetClampMacro(XLength,float,0.0,LARGE_FLOAT);
vlGetMacro(XLength,float);
......
......@@ -28,7 +28,7 @@ class vlCylinderSource : public vlPolySource
public:
vlCylinderSource(int res=6);
char *GetClassName() {return "vlCylinderSource";};
void Execute();
void PrintSelf(ostream& os, vlIndent indent);
vlSetClampMacro(Height,float,0.0,LARGE_FLOAT)
vlGetMacro(Height,float);
......@@ -44,6 +44,7 @@ public:
vlBooleanMacro(Capping,int);
protected:
void Execute();
float Height;
float Radius;
int Resolution;
......
......@@ -29,6 +29,7 @@ public:
vlDataSetToDataSetFilter();
~vlDataSetToDataSetFilter();
char *GetClassName() {return "vlDataSetToDataSetFilter";};
void PrintSelf(ostream& os, vlIndent indent);
vlDataSet *MakeObject() {return this->DataSet->MakeObject();};
int NumCells() {return this->DataSet->NumCells();}
int NumPoints() {return this->DataSet->NumPoints();}
......
......@@ -27,6 +27,7 @@ class vlDataSetToPolyFilter : public vlDataSetFilter, public vlPolyData
public:
void Update();
char *GetClassName() {return "vlDataSetToPolyFilter";};
void PrintSelf(ostream& os, vlIndent indent);
};
#endif
......
......@@ -29,6 +29,7 @@ public:
vlDataSetMapper();
~vlDataSetMapper();
char *GetClassName() {return "vlDataSetMapper";};
void PrintSelf(ostream& os, vlIndent indent);
void Render(vlRenderer *ren);
virtual void SetInput(vlDataSet *in);
virtual vlDataSet* GetInput();
......
......@@ -28,6 +28,7 @@ public:
vlDataSetFilter();
~vlDataSetFilter();
char *GetClassName() {return "vlDataSetFilter";};
void PrintSelf(ostream& os, vlIndent indent);
void Update();
vlSetObjectMacro(Input,vlDataSet);
......
......@@ -26,6 +26,7 @@ class vlElevationFilter : public vlDataSetToDataSetFilter
public:
vlElevationFilter();
char *GetClassName() {return "vlElevationFilter";};
void PrintSelf(ostream& os, vlIndent indent);
vlSetVector3Macro(LowPoint,float);
vlGetVectorMacro(LowPoint,float);
......
......@@ -28,6 +28,7 @@ public:
vlFilter() : StartMethod(0), EndMethod(0), Updating(0) {};
~vlFilter() {};
char *GetClassName() {return "vlFilter";};
void PrintSelf(ostream& os, vlIndent indent);
virtual void Update() = 0;
void SetStartMethod(void (*f)());
void SetEndMethod(void (*f)());
......
......@@ -28,6 +28,7 @@ class vlLineSource : public vlPolySource
public:
vlLineSource(int res=1);
char *GetClassName() {return "vlLineSource";};
void PrintSelf(ostream& os, vlIndent indent);
vlSetVector3Macro(Pt1,float);
vlGetVectorMacro(Pt1,float);
......
......@@ -27,6 +27,7 @@ class vlPolyToPolyFilter : public vlPolyFilter, public vlPolyData
public:
void Update();
char *GetClassName() {return "vlPolyToPolyFilter";};
void PrintSelf(ostream& os, vlIndent indent);
};
#endif
......
......@@ -26,6 +26,7 @@ class vlPointSource : public vlPolySource
public:
vlPointSource(int numPts=10);
char *GetClassName() {return "vlPointSource";};
void PrintSelf(ostream& os, vlIndent indent);
vlSetClampMacro(NumPoints,int,1,LARGE_INTEGER);
vlGetMacro(NumPoints,int);
......
......@@ -27,6 +27,7 @@ public:
vlPolyFilter() : Input(0) {};
~vlPolyFilter();
char *GetClassName() {return "vlPolyFilter";};
void PrintSelf(ostream& os, vlIndent indent);
void Update();
vlSetObjectMacro(Input,vlPolyData);
......
......@@ -29,6 +29,8 @@ public:
vlPolyMapper();
~vlPolyMapper();
char *GetClassName() {return "vlPolyMapper";};
void PrintSelf(ostream& os, vlIndent indent);
void Render(vlRenderer *ren);
virtual void SetInput(vlPolyData *in);
virtual vlPolyData* GetInput();
......
......@@ -27,6 +27,7 @@ class vlSTLReader : public vlPolySource
public:
vlSTLReader(char *fname=0);
char *GetClassName() {return "vlSTLReader";};
void PrintSelf(ostream& os, vlIndent indent);
vlSetStringMacro(Filename);
vlGetStringMacro(Filename);
......
......@@ -22,12 +22,14 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#include "DataSetF.hh"
#include "PolyData.hh"
class vlShrinkFilter : public vlDataSetFilter, public vlPolyData
class vlShrinkFilter : public vlDataSetFilter
{
public:
vlShrinkFilter(const float sf=0.5) {this->ShrinkFactor = sf;};
~vlShrinkFilter() {};
char *GetClassName() {return "vlShrinkFilter";};
void PrintSelf(ostream& os, vlIndent indent);
protected:
void Execute();
float ShrinkFactor;
......
......@@ -27,6 +27,7 @@ public:
vlShrinkPolyData() {this->ShrinkFactor = 0.5;};
~vlShrinkPolyData() {};
char *GetClassName() {return "vlShrinkPolyData";};
void PrintSelf(ostream& os, vlIndent indent);
vlSetMacro(ShrinkFactor,float);
vlGetMacro(ShrinkFactor,float);
......
......@@ -29,6 +29,7 @@ class vlSphereSource : public vlPolySource
public:
vlSphereSource(int res=2);
char *GetClassName() {return "vlSphereSource";};
void PrintSelf(ostream& os, vlIndent indent);
vlSetClampMacro(Radius,float,0.0,LARGE_FLOAT)
vlGetMacro(Radius,float);
......
......@@ -147,3 +147,23 @@ void vlConeSource::Execute()
this->SetLines(newLines);
}
}
void vlConeSource::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlConeSource::GetClassName()))
{
vlPolySource::PrintSelf(os,indent);
os << indent << "Resolution: " << this->Resolution << "\n";
os << indent << "Height: " << this->Height << "\n";
os << indent << "Radius: " << this->Radius << "\n";
if ( this->Capping )
{
os << indent << "Capping is on.\n";
}
else
{
os << indent << "Capping is off.\n";
}
}
}
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