Commit f319095c authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Added vlErrorMacro().

parent 499f6b84
......@@ -48,6 +48,7 @@ public:
void Squeeze() {this->Ia.Squeeze();};
int EstimateSize(int numCells, int maxPtsPerCell)
{return numCells*(1+maxPtsPerCell);};
int GetSize() {return Ia.GetSize();};
protected:
int NumberOfCells;
......
......@@ -19,12 +19,14 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#ifndef __vlCellList_h
#define __vlCellList_h
#include "Object.hh"
struct vlCell {
short type;
int loc;
};
class vlCellList {
class vlCellList : public vlObject {
public:
vlCellList() : Array(0),Size(0),MaxId(-1),Extend(1000) {};
vlCellList(const int sz, const int ext);
......
......@@ -19,12 +19,14 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#ifndef __vlLinkList_h
#define __vlLinkList_h
#include "Object.hh"
struct vlLink {
unsigned short ncells;
int *cells;
};
class vlLinkList {
class vlLinkList : public vlObject {
public:
vlLinkList():Array(0),Size(0),MaxId(-1),Extend(1000) {};
vlLinkList(const int sz, const int ext);
......
......@@ -76,7 +76,7 @@ vlCell *vlCellList::Resize(const int sz)
if ( (newArray = new vlCell[newSize]) == 0 )
{
cerr << "Cannot allocate memory\n";
vlErrorMacro(<< "Cannot allocate memory\n");
return 0;
}
......
......@@ -62,7 +62,7 @@ void vlDataSetMapper::Render(vlRenderer *ren)
//
if ( !this->Input )
{
cerr << this->GetClassName() << ": No input!\n";
vlErrorMacro(<< ": No input!\n");
return;
}
//
......@@ -70,8 +70,7 @@ void vlDataSetMapper::Render(vlRenderer *ren)
//
if ( !(mapper = this->Input->MakeMapper()) )
{
cerr << this->GetClassName() << ": Cannot map type: "
<< this->Input->GetClassName() <<"\n";
vlErrorMacro(<< ": Cannot map type: " << this->Input->GetClassName() <<"\n");
return;
}
if ( mapper != this->Mapper )
......
......@@ -36,7 +36,7 @@ void vlDataSetFilter::Update()
// make sure input is available
if ( !this->Input )
{
cerr << "No input available for DataSetFilter\n";
vlErrorMacro(<< "No input!\n");
return;
}
......
......@@ -51,7 +51,7 @@ void vlElevationFilter::Execute()
this->Initialize();
if ( ((numPts=this->Input->NumberOfPoints()) < 1) )
{
cerr << "No input available for Elevation Filter\n";
vlErrorMacro(<< "No input!\n");
return;
}
//
......@@ -66,7 +66,7 @@ void vlElevationFilter::Execute()
for (i=0; i<3; i++) diffVector[i] = this->HighPoint[i] - this->LowPoint[i];
if ( (l = math.Dot(diffVector,diffVector)) == 0.0)
{
cerr << this << ": Bad vector, using (0,0,1)\n";
vlErrorMacro(<< this << ": Bad vector, using (0,0,1)\n");
diffVector[0] = diffVector[1] = 0.0; diffVector[2] = 1.0;
l = 1.0;
}
......
......@@ -76,7 +76,7 @@ vlLink *vlLinkList::Resize(const int sz)
if ( (newArray = new vlLink[newSize]) == 0 )
{
cerr << "Cannot allocate memory\n";
vlErrorMacro("Cannot allocate memory\n");
return 0;
}
......
......@@ -13,7 +13,7 @@ void vlPolyFilter::Update()
// make sure input is available
if ( !this->Input )
{
cerr << "No input available for PolyFilter\n";
vlErrorMacro(<< "No input!\n");
return;
}
......
......@@ -38,7 +38,7 @@ vlRenderWindow *vlRenderMaster::MakeRenderWindow(char *type)
}
#endif
cerr <<"RenderMaster Error: unable to return render window.\n";
vlErrorMacro(<<"RenderMaster Error: unable to return render window.\n");
return (vlRenderWindow *)NULL;
}
......
......@@ -57,7 +57,7 @@ void vlRibbonFilter::Execute()
if ( !(inLines = this->Input->GetLines()) ||
inLines->GetNumberOfCells() < 1 )
{
cerr << this->GetClassName() << ": No input data!\n";
vlErrorMacro(<< ": No input data!\n");
return;
}
......@@ -68,7 +68,7 @@ void vlRibbonFilter::Execute()
inNormals = new vlFloatNormals(inPts->NumberOfPoints());
if ( !lineNormalGenerator.GenerateNormals(inPts,inLines,(vlFloatNormals*)inNormals) )
{
cerr << this->GetClassName() << ": No normals for line!\n";
vlErrorMacro(<< ": No normals for line!\n");
delete inNormals;
return;
}
......
......@@ -20,7 +20,7 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
void vlSource::Execute()
{
cerr << "Executing Source\n";
vlDebugMacro(<< "Executing Source\n");
}
void vlSource::Update()
......
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