Commit 95f6c89a authored by Will Schroeder's avatar Will Schroeder
Browse files

*** empty log message ***

parent bf9f211b
......@@ -24,8 +24,9 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlBitArray : public vlObject
{
public:
vlBitArray():Array(0),Size(0),MaxId(-1),Extend(1000) {};
int Initialize(const int sz, const int ext);
vlBitArray():Array(NULL),Size(0),MaxId(-1),Extend(1000) {};
void Initialize();
int Allocate(const int sz, const int ext);
vlBitArray(const int sz, const int ext);
vlBitArray(const vlBitArray& ia);
~vlBitArray();
......
......@@ -29,8 +29,9 @@ class vlBitScalars : public vlScalars
public:
vlBitScalars() {};
vlScalars *MakeObject(int sze, int ext=1000);
int Initialize(const int sz, const int ext=1000)
{return S.Initialize(sz,ext);};
int Allocate(const int sz, const int ext=1000)
{return this->S.Allocate(sz,ext);};
void Initialize() {return this->S.Initialize();};
vlBitScalars(const vlBitScalars& cs) {this->S = cs.S;};
vlBitScalars(const int sz, const int ext=1000):S(sz,ext){};
~vlBitScalars() {};
......
......@@ -26,8 +26,9 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlCharArray : public vlObject
{
public:
vlCharArray():Array(0),Size(0),MaxId(-1),Extend(1000) {};
int Initialize(const int sz, const int ext);
vlCharArray():Array(NULL),Size(0),MaxId(-1),Extend(1000) {};
void Initialize();
int Allocate(const int sz, const int ext);
vlCharArray(const int sz, const int ext);
vlCharArray(const vlCharArray& ia);
~vlCharArray();
......
......@@ -31,8 +31,9 @@ class vlCharScalars : public vlScalars
public:
vlCharScalars() {};
vlScalars *MakeObject(int sze, int ext=1000);
int Initialize(const int sz, const int ext=1000)
{return S.Initialize(sz,ext);};
int Allocate(const int sz, const int ext=1000)
{return this->S.Allocate(sz,ext);};
void Initialize() {return this->S.Initialize();};
vlCharScalars(const vlCharScalars& cs) {this->S = cs.S;};
vlCharScalars(const int sz, const int ext=1000):S(sz,ext){};
~vlCharScalars() {};
......
......@@ -67,7 +67,8 @@ public:
// parametric coordinates, sub-cell id (!=0 only if cell is composite),
// distance squared of point x[3] to cell (in particular, the sub-cell
// indicated), and interpolation weights in cell.
virtual int EvaluatePosition(float x[3], int& subId, float pcoords[3],
virtual int EvaluatePosition(float x[3], float closestPoint[3],
int& subId, float pcoords[3],
float& dist2, float weights[MAX_CELL_SIZE]) = 0;
// Determine global coordinate from subId and parametric coordinates
......
......@@ -28,8 +28,9 @@ class vlCellArray : public vlObject
{
public:
vlCellArray() : NumberOfCells(0), Location(0) {};
int Initialize(const int sz, const int ext=1000)
{return this->Ia.Initialize(sz,ext);};
int Allocate(const int sz, const int ext=1000)
{return this->Ia.Allocate(sz,ext);};
void Initialize() {return this->Ia.Initialize();};
vlCellArray (const int sz, const int ext=1000):NumberOfCells(0),Location(0),Ia(sz,ext){};
vlCellArray(const vlCellArray& ca);
~vlCellArray() {};
......
......@@ -28,7 +28,7 @@ struct vlCell_s {
class vlCellList : public vlObject {
public:
vlCellList() : Array(0),Size(0),MaxId(-1),Extend(1000) {};
vlCellList() : Array(NULL),Size(0),MaxId(-1),Extend(1000) {};
vlCellList(const int sz, const int ext);
~vlCellList();
char *GetClassName() {return "vlCellList";};
......
......@@ -40,8 +40,8 @@ public:
void Initialize();
void GetPointCells(int ptId, vlIdList *cellIds)
{this->DataSet->GetPointCells(ptId, cellIds);};
int FindCell(float x[3], float dist2)
{return this->DataSet->FindCell(x,dist2);};
int FindCell(float x[3], vlCell *cell, float tol2)
{return this->DataSet->FindCell(x,cell,tol2);};
void ComputeBounds() {this->DataSet->ComputeBounds();};
vlMapper *MakeMapper();
......
......@@ -23,7 +23,7 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#define __vlDataSetToStructuredPointsFilter_h
#include "DataSetF.hh"
#include "SPoints.hh"
#include "StrPts.hh"
class vlDataSetToStructuredPointsFilter : public vlStructuredPoints, public vlDataSetFilter
{
......
......@@ -58,9 +58,10 @@ public:
virtual void GetCellNeighbors(int cellId, vlIdList *ptIds,
vlIdList *cellIds);
// Locate cell based on global coordinate and tolerance.
// Returns cellId >= 0 if inside, < 0 otherwise.
virtual int FindCell(float x[3], float dist2) = 0;
// Locate cell based on global coordinate x and tolerance squared. If cell
// is non-Null, then search starts from this cell and looks at
// immediate neighbors. Returns cellId >= 0 if inside, < 0 otherwise.
virtual int FindCell(float x[3], vlCell *cell, float tol2) = 0;
// some data sets are composite objects and need to check each part for MTime
unsigned long int GetMTime();
......
......@@ -24,8 +24,9 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlFloatArray : public vlObject
{
public:
vlFloatArray():Array(0),Size(0),MaxId(-1),Extend(1000) {};
int Initialize(const int sz, const int ext=1000);
vlFloatArray():Array(NULL),Size(0),MaxId(-1),Extend(1000) {};
int Allocate(const int sz, const int ext=1000);
void Initialize();
vlFloatArray(const int sz, const int ext=1000);
vlFloatArray(const vlFloatArray& fa);
~vlFloatArray();
......
......@@ -29,8 +29,9 @@ class vlFloatNormals : public vlNormals
public:
vlFloatNormals() {};
vlNormals *MakeObject(int sze, int ext=1000);
int Initialize(const int sz, const int ext=1000)
{return this->N.Initialize(3*sz,3*ext);};
int Allocate(const int sz, const int ext=1000)
{return this->N.Allocate(3*sz,3*ext);};
void Initialize() {return this->N.Initialize();};
vlFloatNormals(const vlFloatNormals& fn) {this->N = fn.N;};
vlFloatNormals(const int sz, const int ext=1000):N(3*sz,3*ext){};
~vlFloatNormals() {};
......
......@@ -29,8 +29,9 @@ class vlFloatPoints : public vlPoints
public:
vlFloatPoints() {};
vlPoints *MakeObject(int sze, int ext=1000);
int Initialize(const int sz, const int ext=1000)
{return this->P.Initialize(3*sz,3*ext);};
int Allocate(const int sz, const int ext=1000)
{return this->P.Allocate(3*sz,3*ext);};
void Initialize() {return this->P.Initialize();};
vlFloatPoints(const vlFloatPoints& fp) {this->P = fp.P;};
vlFloatPoints(const int sz, const int ext=1000):P(3*sz,3*ext){};
~vlFloatPoints() {};
......
......@@ -29,8 +29,9 @@ class vlFloatScalars : public vlScalars
public:
vlFloatScalars() {};
vlScalars *MakeObject(int sze, int ext=1000);
int Initialize(const int sz, const int ext=1000)
{return S.Initialize(sz,ext);};
int Allocate(const int sz, const int ext=1000)
{return this->S.Allocate(sz,ext);};
void Initialize() {return this->S.Initialize();};
vlFloatScalars(const vlFloatScalars& fs) {this->S = fs.S;};
vlFloatScalars(const int sz, const int ext=1000):S(sz,ext){};
~vlFloatScalars() {};
......
......@@ -24,8 +24,9 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlIntArray : public vlObject
{
public:
vlIntArray():Array(0),Size(0),MaxId(-1),Extend(1000) {};
int Initialize(const int sz, const int ext);
vlIntArray():Array(NULL),Size(0),MaxId(-1),Extend(1000) {};
void Initialize();
int Allocate(const int sz, const int ext);
vlIntArray(const int sz, const int ext);
vlIntArray(const vlIntArray& ia);
~vlIntArray();
......
......@@ -26,7 +26,7 @@ class vlLookupTable : public vlObject
{
public:
vlLookupTable(int sze=256, int ext=256);
int Initialize(int sz=256, int ext=256);
int Allocate(int sz=256, int ext=256);
void Build();
char *GetClassName() {return "vlLookupTable";};
void PrintSelf(ostream& os, vlIndent indent);
......
......@@ -26,8 +26,9 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlShortArray : public vlObject
{
public:
vlShortArray():Array(0),Size(0),MaxId(-1),Extend(1000) {};
int Initialize(const int sz, const int ext=1000);
vlShortArray():Array(NULL),Size(0),MaxId(-1),Extend(1000) {};
void Initialize();
int Allocate(const int sz, const int ext=1000);
vlShortArray(const int sz, const int ext=1000);
vlShortArray(const vlShortArray& sa);
~vlShortArray();
......
......@@ -39,7 +39,8 @@ public:
void Contour(float value, vlFloatScalars *cellScalars,
vlFloatPoints *points, vlCellArray *verts,
vlCellArray *lines, vlCellArray *polys, vlFloatScalars *s);
int EvaluatePosition(float x[3], int& subId, float pcoords[3],
int EvaluatePosition(float x[3], float closestPoint[3],
int& subId, float pcoords[3],
float& dist2, float weights[MAX_CELL_SIZE]);
void EvaluateLocation(int& subId, float pcoords[3], float x[3],
float weights[MAX_CELL_SIZE]);
......
......@@ -19,18 +19,29 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
//
#include "BArray.hh"
vlBitArray::Initialize(const int sz, const int ext)
vlBitArray::Allocate(const int sz, const int ext)
{
if ( this->Array != 0 ) delete [] this->Array;
if ( this->Array != NULL ) delete [] this->Array;
this->Size = ( sz > 0 ? sz : 1);
if ( (this->Array = new char[(sz+7)/8]) == 0 ) return 0;
if ( (this->Array = new char[(sz+7)/8]) == NULL ) return 0;
this->Extend = ( ext > 0 ? ext : 1);
this->MaxId = -1;
return 1;
}
void vlBitArray::Initialize()
{
if ( this->Array != NULL )
{
delete [] this->Array;
this->Array = NULL;
}
this->Size = 0;
this->MaxId = -1;
}
vlBitArray::vlBitArray(const int sz, const int ext)
{
this->Size = ( sz > 0 ? sz : 1);
......@@ -120,7 +131,7 @@ char *vlBitArray::Resize(const int sz)
this->Extend*(((sz-this->Size)/this->Extend)+1);
else newSize = sz;
if ( (newArray = new char[(newSize+7)/8]) == 0 )
if ( (newArray = new char[(newSize+7)/8]) == NULL )
{
vlErrorMacro(<< "Cannot allocate memory\n");
return 0;
......
......@@ -23,10 +23,10 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
vlBYUReader::vlBYUReader()
{
this->GeometryFilename = 0;
this->DisplacementFilename = 0;
this->ScalarFilename = 0;
this->TextureFilename = 0;
this->GeometryFilename = NULL;
this->DisplacementFilename = NULL;
this->ScalarFilename = NULL;
this->TextureFilename = NULL;
this->ReadDisplacement = 1;
this->ReadScalar = 1;
......
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