Commit 8ff37987 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Added documentation.

parent 8cd8377a
......@@ -13,11 +13,12 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Char representation of scalars
//
// use internal char array to represent data
//
// .NAME vlBitScalars - packed bit (0/1) representation of scalar data
// .SECTION Description
// vlBitScalars is a concrete implementation of vlScalars. Scalars are
// represented using a packed bit array. Only possible scalar values are
// (0/1).
#ifndef __vlBitScalars_h
#define __vlBitScalars_h
......@@ -28,21 +29,17 @@ class vlBitScalars : public vlScalars
{
public:
vlBitScalars() {};
vlScalars *MakeObject(int sze, int ext=1000);
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() {};
int Allocate(const int sz, const int ext=1000) {return this->S.Allocate(sz,ext);};
void Initialize() {return this->S.Initialize();};
char *GetClassName() {return "vlBitScalars";};
// vlScalar interface
vlScalars *MakeObject(int sze, int ext=1000);
int GetNumberOfScalars() {return (this->S.GetMaxId()+1);};
void Reset() {this->S.Reset();};
void Squeeze() {this->S.Squeeze();};
vlBitScalars &operator=(const vlBitScalars& cs);
void operator+=(const vlBitScalars& cs) {this->S += cs.S;};
// float conversion for abstract computation
float GetScalar(int i) {return (float)this->S.GetValue(i);};
void SetScalar(int i, int s) {this->S.SetValue(i,s);};
void SetScalar(int i, float s) {this->S.SetValue(i,(int)s);};
......@@ -51,7 +48,12 @@ public:
int InsertNextScalar(int s) {return S.InsertNextValue(s);};
int InsertNextScalar(float s) {return S.InsertNextValue((int)s);};
private:
// miscellaneous
vlBitScalars &operator=(const vlBitScalars& cs);
void operator+=(const vlBitScalars& cs) {this->S += cs.S;};
void Reset() {this->S.Reset();};
protected:
vlBitArray S;
};
......
......@@ -6,8 +6,6 @@
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.
......@@ -15,11 +13,11 @@ without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Char representation of scalars
//
// use internal char array to represent data
//
// .NAME vlCharScalars - char representation of scalar data
// .SECTION Description
// vlCharScalars is a concrete implementation of vlScalars. Scalars are
// represented using char values.
#ifndef __vlCharScalars_h
#define __vlCharScalars_h
......@@ -30,21 +28,17 @@ class vlCharScalars : public vlScalars
{
public:
vlCharScalars() {};
vlScalars *MakeObject(int sze, int ext=1000);
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() {};
int Allocate(const int sz, const int ext=1000) {return this->S.Allocate(sz,ext);};
void Initialize() {return this->S.Initialize();};
char *GetClassName() {return "vlCharScalars";};
// vlScalar interface
vlScalars *MakeObject(int sze, int ext=1000);
int GetNumberOfScalars() {return (this->S.GetMaxId()+1);};
void Reset() {this->S.Reset();};
void Squeeze() {this->S.Squeeze();};
vlCharScalars &operator=(const vlCharScalars& cs);
void operator+=(const vlCharScalars& cs) {this->S += cs.S;};
// float conversion for abstract computation
float GetScalar(int i) {return (float)this->S[i];};
void SetScalar(int i, char s) {this->S[i] = s;};
void SetScalar(int i, float s) {this->S[i] = (char)s;};
......@@ -53,7 +47,12 @@ public:
int InsertNextScalar(char s) {return S.InsertNextValue(s);};
int InsertNextScalar(float s) {return S.InsertNextValue((char)s);};
private:
// miscellaneous
vlCharScalars &operator=(const vlCharScalars& cs);
void operator+=(const vlCharScalars& cs) {this->S += cs.S;};
void Reset() {this->S.Reset();};
protected:
vlCharArray S;
};
......
......@@ -6,8 +6,6 @@
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.
......@@ -17,8 +15,8 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlCutter - Cut vlDataSets with user-specified implicit function
// .SECTION Description
// vlCutter is a filter to cut any subclass of vlImplicitFunction to
// cut arbitrary vlDataSets. That is, a polygonal surface is created
// vlCutter is a filter to cut through data using any subclass of
// vlImplicitFunction. That is, a polygonal surface is created
// corresponding to the implicit function F(x,y,z) = 0.
#ifndef __vlCutter_h
......@@ -36,6 +34,8 @@ public:
unsigned long int GetMTime();
// Description
// Specify the implicit function to perform the cutting.
vlSetObjectMacro(CutFunction,vlImplicitFunction);
vlGetObjectMacro(CutFunction,vlImplicitFunction);
......
......@@ -33,6 +33,8 @@ class vlDataSet : virtual public vlObject
{
public:
vlDataSet();
vlDataSet(const vlDataSet& ds);
~vlDataSet() {};
char *GetClassName() {return "vlDataSet";};
void PrintSelf(ostream& os, vlIndent indent);
......
......@@ -13,11 +13,11 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Floating point representation of 3D normals.
//
// use internal floating point array to represent data
//
// .NAME vlFloatNormals - floating point representation of 3D normals
// .SECTION Description
// vlFloatNormals is a concrete implementation of vlNormals. Normals are
// represented using float values.
#ifndef __vlFloatNormals_h
#define __vlFloatNormals_h
......@@ -28,38 +28,53 @@ class vlFloatNormals : public vlNormals
{
public:
vlFloatNormals() {};
vlNormals *MakeObject(int sze, int ext=1000);
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() {};
int Allocate(const int sz, const int ext=1000) {return this->N.Allocate(3*sz,3*ext);};
void Initialize() {return this->N.Initialize();};
char *GetClassName() {return "vlFloatNormals";};
// vlNormal interface
vlNormals *MakeObject(int sze, int ext=1000);
int GetNumberOfNormals() {return (N.GetMaxId()+1)/3;};
void Reset() {this->N.Reset();};
void Squeeze() {this->N.Squeeze();};
float *GetNormal(int i) {return this->N.GetPtr(3*i);};
void SetNormal(int i, float n[3]);
void InsertNormal(int i, float *n);
int InsertNextNormal(float *n);
// miscellaneous
vlFloatNormals &operator=(const vlFloatNormals& fn);
void operator+=(const vlFloatNormals& fn);
void Reset() {this->N.Reset();};
float *GetNormal(int i) {return this->N.GetPtr(3*i);};
void SetNormal(int i, float x[3])
{i*=3; this->N[i]=x[0]; this->N[i+1]=x[1]; this->N[i+2]=x[2];};
void InsertNormal(int i, float *x) {
this->N.InsertValue(3*i+2, x[2]);
this->N[3*i] = x[0];
this->N[3*i+1] = x[1];
}
int InsertNextNormal(float *x) {
int id = this->N.GetMaxId() + 3;
this->N.InsertValue(id,x[2]);
this->N[id-2] = x[0];
this->N[id-1] = x[1];
return id/3;
}
private:
protected:
vlFloatArray N;
};
inline void vlFloatNormals::SetNormal(int i, float n[3])
{
i*=3;
this->N[i]=n[0];
this->N[i+1]=n[1];
this->N[i+2]=n[2];
}
inline void vlFloatNormals::InsertNormal(int i, float *n)
{
this->N.InsertValue(3*i+2, n[2]);
this->N[3*i] = n[0];
this->N[3*i+1] = n[1];
}
inline int vlFloatNormals::InsertNextNormal(float *n)
{
int id = this->N.GetMaxId() + 3;
this->N.InsertValue(id,n[2]);
this->N[id-2] = n[0];
this->N[id-1] = n[1];
return id/3;
}
#endif
......@@ -13,11 +13,11 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Floating point representation of 3D points.
//
// use internal floating point array to represent data
//
// .NAME vlFloatPoints - floating point representation of 3D points
// .SECTION Description
// vlFloatPoints is a concrete implementation of vlPoints. Points are
// represented using float values.
#ifndef __vlFloatPoints_h
#define __vlFloatPoints_h
......@@ -28,38 +28,54 @@ class vlFloatPoints : public vlPoints
{
public:
vlFloatPoints() {};
vlPoints *MakeObject(int sze, int ext=1000);
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() {};
int Allocate(const int sz, const int ext=1000) {return this->P.Allocate(3*sz,3*ext);};
void Initialize() {return this->P.Initialize();};
char *GetClassName() {return "vlFloatPoints";};
// vlPoint interface
vlPoints *MakeObject(int sze, int ext=1000);
int GetNumberOfPoints() {return (P.GetMaxId()+1)/3;};
void Reset() {this->P.Reset();};
void Squeeze() {this->P.Squeeze();};
float *GetPoint(int i) {return this->P.GetPtr(3*i);};
void SetPoint(int i, float x[3]);
void InsertPoint(int i, float *x);
int InsertNextPoint(float *x);
// miscellaneous
vlFloatPoints &operator=(const vlFloatPoints& fp);
void operator+=(const vlFloatPoints& fp) {this->P += fp.P;};
void Reset() {this->P.Reset();};
float *GetPoint(int i) {return this->P.GetPtr(3*i);};
void SetPoint(int i, float x[3])
{i*=3; this->P[i]=x[0]; this->P[i+1]=x[1]; this->P[i+2]=x[2];};
void InsertPoint(int i, float *x) {
this->P.InsertValue(3*i+2, x[2]);
this->P[3*i] = x[0];
this->P[3*i+1] = x[1];
}
int InsertNextPoint(float *x) {
int id = this->P.GetMaxId() + 3;
this->P.InsertValue(id,x[2]);
this->P[id-2] = x[0];
this->P[id-1] = x[1];
return id/3;
}
private:
protected:
vlFloatArray P;
};
inline void vlFloatPoints::SetPoint(int i, float x[3])
{
i*=3;
this->P[i]=x[0];
this->P[i+1]=x[1];
this->P[i+2]=x[2];
}
inline void vlFloatPoints::InsertPoint(int i, float *x)
{
this->P.InsertValue(3*i+2, x[2]); // only do range checking once
this->P[3*i] = x[0];
this->P[3*i+1] = x[1];
}
inline int vlFloatPoints::InsertNextPoint(float *x)
{
int id = this->P.GetMaxId() + 3;
this->P.InsertValue(id,x[2]); // only do range checking once
this->P[id-2] = x[0];
this->P[id-1] = x[1];
return id/3;
}
#endif
......@@ -13,11 +13,11 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Floating point representation of scalars
//
// use internal floating point array to represent data
//
// .NAME vlFloatScalars - floating point representation of scalar data
// .SECTION Description
// vlFloatScalars is a concrete implementation of vlScalars. Scalars are
// represented using float values.
#ifndef __vlFloatScalars_h
#define __vlFloatScalars_h
......@@ -28,26 +28,28 @@ class vlFloatScalars : public vlScalars
{
public:
vlFloatScalars() {};
vlScalars *MakeObject(int sze, int ext=1000);
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() {};
int Allocate(const int sz, const int ext=1000) {return this->S.Allocate(sz,ext);};
void Initialize() {return this->S.Initialize();};
char *GetClassName() {return "vlFloatScalars";};
// vlScalar interface
vlScalars *MakeObject(int sze, int ext=1000);
int GetNumberOfScalars() {return (this->S.GetMaxId()+1);};
void Reset() {this->S.Reset();};
void Squeeze() {this->S.Squeeze();};
vlFloatScalars &operator=(const vlFloatScalars& fs);
void operator+=(const vlFloatScalars& fs) {this->S += fs.S;};
float GetScalar(int i) {return this->S[i];};
void SetScalar(int i, float s) {this->S[i] = s;};
void InsertScalar(int i, float s) {S.InsertValue(i,s);};
int InsertNextScalar(float s) {return S.InsertNextValue(s);};
private:
// miscellaneous
vlFloatScalars &operator=(const vlFloatScalars& fs);
void operator+=(const vlFloatScalars& fs) {this->S += fs.S;};
void Reset() {this->S.Reset();};
protected:
vlFloatArray S;
};
......
......@@ -13,11 +13,11 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Floating point representation of 1,2,3D texture coordinates
//
// use internal floating point array to represent data
//
// .NAME vlFloatTCoords - floating point representation of 3D texture coordinates
// .SECTION Description
// vlFloatTCoords is a concrete implementation of vlTCoords. Texture
// coordinates are represented using float values.
#ifndef __vlFloatTCoords_h
#define __vlFloatTCoords_h
......@@ -28,38 +28,49 @@ class vlFloatTCoords : public vlTCoords
{
public:
vlFloatTCoords() {};
vlTCoords *MakeObject(int sze, int d=2, int ext=1000);
int Allocate(const int sz, const int dim=2, const int ext=1000)
{return this->TC.Allocate(dim*sz,dim*ext);};
void Initialize() {return this->TC.Initialize();};
vlFloatTCoords(const vlFloatTCoords& ftc)
{this->TC = ftc.TC;this->Dimension = ftc.Dimension;};
vlFloatTCoords(int sz, int d=2, int ext=1000):TC(d*sz,d*ext)
{this->Dimension=d;};
vlFloatTCoords(const vlFloatTCoords& ftc) {this->TC = ftc.TC;this->Dimension = ftc.Dimension;};
vlFloatTCoords(int sz, int d=2, int ext=1000):TC(d*sz,d*ext) {this->Dimension=d;};
~vlFloatTCoords() {};
vlFloatTCoords &operator=(const vlFloatTCoords& ftc);
int Allocate(const int sz, const int dim=2, const int ext=1000) {return this->TC.Allocate(dim*sz,dim*ext);};
void Initialize() {return this->TC.Initialize();};
char *GetClassName() {return "vlFloatTCoords";};
void operator+=(const vlFloatTCoords& ftc) {this->TC += ftc.TC;};
// vlTCoords interface
vlTCoords *MakeObject(int sze, int d=2, int ext=1000);
int GetNumberOfTCoords() {return (this->TC.GetMaxId()+1)/this->Dimension;};
void Reset() {this->TC.Reset();};
void Squeeze() {this->TC.Squeeze();};
float *GetTCoord(int i) {return this->TC.GetPtr(this->Dimension*i);};
void SetTCoord(int i, float *x)
{i*=this->Dimension; for(int j=0;j<this->Dimension;j++) this->TC[i+j]=x[j];};
void InsertTCoord(int i, float *x) {
i*=this->Dimension;
for(int j=0; j<this->Dimension; j++) this->TC.InsertValue(i+j, x[j]);
}
int InsertNextTCoord(float *x) {
int id = this->TC.InsertNextValue(x[0]);
for(int j=1; j<this->Dimension; j++) this->TC.InsertNextValue(x[j]);
return id/this->Dimension;
}
void SetTCoord(int i, float *tc);
void InsertTCoord(int i, float *tc);
int InsertNextTCoord(float *tc);
// miscellaneous
vlFloatTCoords &operator=(const vlFloatTCoords& ftc);
void operator+=(const vlFloatTCoords& ftc) {this->TC += ftc.TC;};
void Reset() {this->TC.Reset();};
private:
protected:
vlFloatArray TC;
};
inline void vlFloatTCoords::SetTCoord(int i, float *tc)
{
i*=this->Dimension;
for(int j=0;j<this->Dimension;j++) this->TC[i+j]=tc[j];
}
inline void vlFloatTCoords::InsertTCoord(int i, float *tc)
{
i*=this->Dimension;
for(int j=0; j<this->Dimension; j++) this->TC.InsertValue(i+j, tc[j]);
}
inline int vlFloatTCoords::InsertNextTCoord(float *tc)
{
int id = this->TC.InsertNextValue(tc[0]);
for(int j=1; j<this->Dimension; j++) this->TC.InsertNextValue(tc[j]);
return id/this->Dimension;
}
#endif
......@@ -13,11 +13,11 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Floating point representation of 3D vectors.
//
// use internal floating point array to represent data
//
// .NAME vlFloatVectors - floating point representation of 3D vectors
// .SECTION Description
// vlFloatVectors is a concrete implementation of vlVectors. Vectors are
// represented using float values.
#ifndef __vlFloatVectors_h
#define __vlFloatVectors_h
......@@ -28,38 +28,53 @@ class vlFloatVectors : public vlVectors
{
public:
vlFloatVectors() {};
vlVectors *MakeObject(int sze, int ext=1000);
int Allocate(const int sz, const int ext=1000)
{return this->V.Allocate(3*sz,3*ext);};
void Initialize() {return this->V.Initialize();};
vlFloatVectors(const vlFloatVectors& fv) {this->V = fv.V;};
vlFloatVectors(const int sz, const int ext=1000):V(3*sz,3*ext){};
~vlFloatVectors() {};
int Allocate(const int sz, const int ext=1000) {return this->V.Allocate(3*sz,3*ext);};
void Initialize() {return this->V.Initialize();};
char *GetClassName() {return "vlFloatVectors";};
// vlVector interface
vlVectors *MakeObject(int sze, int ext=1000);
int GetNumberOfVectors() {return (V.GetMaxId()+1)/3;};
void Reset() {this->V.Reset();};
void Squeeze() {this->V.Squeeze();};
float *GetVector(int i) {return this->V.GetPtr(3*i);};
void SetVector(int i, float v[3]);
void InsertVector(int i, float *v);
int InsertNextVector(float *v);
// miscellaneous
vlFloatVectors &operator=(const vlFloatVectors& fv);
void operator+=(const vlFloatVectors& fv){this->V += fv.V;};
void Reset() {this->V.Reset();};
float *GetVector(int i) {return this->V.GetPtr(3*i);};
void SetVector(int i, float x[3])
{i*=3; this->V[i]=x[0]; this->V[i+1]=x[1]; this->V[i+2]=x[2];};
void InsertVector(int i, float *x) {
this->V.InsertValue(3*i+2, x[2]);
this->V[3*i] = x[0];
this->V[3*i+1] = x[1];
}
int InsertNextVector(float *x) {
int id = this->V.GetMaxId() + 3;
this->V.InsertValue(id,x[2]);
this->V[id-2] = x[0];
this->V[id-1] = x[1];
return id/3;
}
private:
protected:
vlFloatArray V;
};
inline void vlFloatVectors::SetVector(int i, float v[3])
{
i*=3;
this->V[i]=v[0];
this->V[i+1]=v[1];
this->V[i+2]=v[2];
}
inline void vlFloatVectors::InsertVector(int i, float *v)
{
this->V.InsertValue(3*i+2, v[2]);
this->V[3*i] = v[0];
this->V[3*i+1] = v[1];
}
inline int vlFloatVectors::InsertNextVector(float *v)
{
int id = this->V.GetMaxId() + 3;
this->V.InsertValue(id,v[2]);
this->V[id-2] = v[0];
this->V[id-1] = v[1];
return id/3;
}
#endif
<
......@@ -15,10 +15,11 @@ without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Integer representation of 3D points.
//
//
// .NAME vlIntPoints - integer representation of 3D points
// .SECTION Description
// vlIntPoints is a concrete implementation of vlPoints. Points are
// represented using integer values.
#ifndef __vlIntPoints_h
#define __vlIntPoints_h