Commit 6992bab7 authored by Will Schroeder's avatar Will Schroeder
Browse files

*** empty log message ***

parent c9bb40b1
......@@ -38,6 +38,7 @@ public:
// vlScalar interface
vlScalars *MakeObject(int sze, int ext=1000);
char *GetDataType() {return "bit";};
int GetNumberOfScalars() {return (this->S.GetMaxId()+1);};
void Squeeze() {this->S.Squeeze();};
float GetScalar(int i) {return (float)this->S.GetValue(i);};
......
......@@ -37,14 +37,15 @@ public:
// vlScalar interface
vlScalars *MakeObject(int sze, int ext=1000);
char *GetDataType() {return "char";};
int GetNumberOfScalars() {return (this->S.GetMaxId()+1);};
void Squeeze() {this->S.Squeeze();};
float GetScalar(int i) {return (float)this->S[i];};
void SetScalar(int i, char s) {this->S[i] = s;};
void SetScalar(int i, unsigned char s) {this->S[i] = s;};
void SetScalar(int i, float s) {this->S[i] = (char)s;};
void InsertScalar(int i, float s) {S.InsertValue(i,(char)s);};
void InsertScalar(int i, char s) {S.InsertValue(i,s);};
int InsertNextScalar(char s) {return S.InsertNextValue(s);};
void InsertScalar(int i, unsigned char s) {S.InsertValue(i,s);};
int InsertNextScalar(unsigned char s) {return S.InsertNextValue(s);};
int InsertNextScalar(float s) {return S.InsertNextValue((char)s);};
void GetScalars(vlIdList& ptIds, vlFloatScalars& fs);
......
......@@ -44,6 +44,7 @@ public:
char *GetClassName() {return "vlColorScalars";};
// vlScalars interface
char *GetDataType() {return "char";};
float GetScalar(int i);
void SetScalar(int i, float s);
void InsertScalar(int i, float s);
......
......@@ -47,7 +47,8 @@ public:
virtual vlDataSet *MakeObject() = 0;
// Description:
// Return class name of data type.
// Return class name of data type. This is one of vlStructuredGrid,
// vlStructuredPoints, vlUnstructuredGrid, vlPolyData.
virtual char *GetDataType() = 0;
// Description:
......
......@@ -37,6 +37,7 @@ public:
// vlNormal interface
vlNormals *MakeObject(int sze, int ext=1000);
char *GetDataType() {return "float";};
int GetNumberOfNormals() {return (N.GetMaxId()+1)/3;};
void Squeeze() {this->N.Squeeze();};
float *GetNormal(int i) {return this->N.GetPtr(3*i);};
......@@ -46,6 +47,7 @@ public:
int InsertNextNormal(float *n);
// miscellaneous
float *WritePtr(const int id, const int number);
vlFloatNormals &operator=(const vlFloatNormals& fn);
void operator+=(const vlFloatNormals& fn);
void Reset() {this->N.Reset();};
......@@ -54,6 +56,15 @@ protected:
vlFloatArray N;
};
// Description:
// Get pointer to data. Useful for direct writes into object. MaxId is bumped
// by number (and memory allocated if necessary). Id is the location you
// wish to write into; number is the number of normals to write.
inline float *vlFloatNormals::WritePtr(const int id, const int number)
{
return this->N.WritePtr(id,3*number);
}
inline void vlFloatNormals::SetNormal(int i, float n[3])
{
i*=3;
......
......@@ -37,6 +37,7 @@ public:
// vlPoint interface
vlPoints *MakeObject(int sze, int ext=1000);
char *GetDataType() {return "float";};
int GetNumberOfPoints() {return (P.GetMaxId()+1)/3;};
void Squeeze() {this->P.Squeeze();};
float *GetPoint(int id) {return this->P.GetPtr(3*id);};
......@@ -47,6 +48,7 @@ public:
void GetPoints(vlIdList& ptId, vlFloatPoints& fp);
// miscellaneous
float *WritePtr(const int id, const int number);
vlFloatPoints &operator=(const vlFloatPoints& fp);
void operator+=(const vlFloatPoints& fp) {this->P += fp.P;};
void Reset() {this->P.Reset();};
......@@ -55,6 +57,14 @@ protected:
vlFloatArray P;
};
// Description:
// Get pointer to data. Useful for direct writes into object. MaxId is bumped
// by number (and memory allocated if necessary). Id is the location you
// wish to write into; number is the number of points to write.
inline float *vlFloatPoints::WritePtr(const int id, const int number)
{
return this->P.WritePtr(id,3*number);
}
inline void vlFloatPoints::GetPoint(int id, float x[3])
{
......
......@@ -37,6 +37,7 @@ public:
// vlScalar interface
vlScalars *MakeObject(int sze, int ext=1000);
char *GetDataType() {return "float";};
int GetNumberOfScalars() {return (this->S.GetMaxId()+1);};
void Squeeze() {this->S.Squeeze();};
float GetScalar(int i) {return this->S.GetValue(i);};
......
......@@ -37,6 +37,7 @@ public:
// vlTCoords interface
vlTCoords *MakeObject(int sze, int d=2, int ext=1000);
char *GetDataType() {return "float";};
int GetNumberOfTCoords() {return (this->TC.GetMaxId()+1)/this->Dimension;};
void Squeeze() {this->TC.Squeeze();};
float *GetTCoord(int i) {return this->TC.GetPtr(this->Dimension*i);};
......@@ -46,6 +47,7 @@ public:
int InsertNextTCoord(float *tc);
// miscellaneous
float *WritePtr(const int id, const int number);
vlFloatTCoords &operator=(const vlFloatTCoords& ftc);
void operator+=(const vlFloatTCoords& ftc) {this->TC += ftc.TC;};
void Reset() {this->TC.Reset();};
......@@ -55,6 +57,17 @@ protected:
};
// Description:
// Get pointer to data. Useful for direct writes into object. MaxId is bumped
// by number (and memory allocated if necessary). Id is the location you
// wish to write into; number is the number of texture coordinates to write.
// Make sure the dimension of the texture coordinate is set prior to issuing
// this call.
inline float *vlFloatTCoords::WritePtr(const int id, const int number)
{
return this->TC.WritePtr(id,this->Dimension*number);
}
inline void vlFloatTCoords::SetTCoord(int i, float *tc)
{
i*=this->Dimension;
......
......@@ -37,6 +37,7 @@ public:
// vlTensors interface
vlTensors *MakeObject(int sze, int d=3, int ext=1000);
char *GetDataType() {return "float";};
int GetNumberOfTensors();
void Squeeze() {this->T.Squeeze();};
vlTensor &GetTensor(int i);
......@@ -46,6 +47,7 @@ public:
int InsertNextTensor(vlTensor &t);
// miscellaneous
float *WritePtr(const int id, const int number);
vlFloatTensors &operator=(const vlFloatTensors& ft);
void operator+=(const vlFloatTensors& ft) {this->T += ft.T;};
void Reset() {this->T.Reset();};
......@@ -54,6 +56,15 @@ protected:
vlFloatArray T;
};
// Description:
// Get pointer to data. Useful for direct writes into object. MaxId is bumped
// by number (and memory allocated if necessary). Id is the location you
// wish to write into; number is the number of tensors to write.
// Make sure the dimension of the tensor is set prior to issuing this call.
inline float *vlFloatTensors::WritePtr(const int id, const int number)
{
return this->T.WritePtr(id,this->Dimension*number);
}
inline vlFloatTensors::vlFloatTensors(const vlFloatTensors& ft)
{
......
......@@ -37,6 +37,7 @@ public:
// vlVector interface
vlVectors *MakeObject(int sze, int ext=1000);
char *GetDataType() {return "float";};
int GetNumberOfVectors() {return (V.GetMaxId()+1)/3;};
void Squeeze() {this->V.Squeeze();};
float *GetVector(int i) {return this->V.GetPtr(3*i);};
......@@ -46,6 +47,7 @@ public:
int InsertNextVector(float *v);
// miscellaneous
float *WritePtr(const int id, const int number);
vlFloatVectors &operator=(const vlFloatVectors& fv);
void operator+=(const vlFloatVectors& fv){this->V += fv.V;};
void Reset() {this->V.Reset();};
......@@ -54,6 +56,15 @@ protected:
vlFloatArray V;
};
// Description:
// Get pointer to data. Useful for direct writes into object. MaxId is bumped
// by number (and memory allocated if necessary). Id is the location you
// wish to write into; number is the number of vectors to write.
inline float *vlFloatVectors::WritePtr(const int id, const int number)
{
return this->V.WritePtr(id,3*number);
}
inline void vlFloatVectors::SetVector(int i, float v[3])
{
i*=3;
......
......@@ -37,17 +37,21 @@ public:
// vlPoint interface
vlPoints *MakeObject(int sze, int ext=1000);
char *GetDataType() {return "int";};
int GetNumberOfPoints() {return (P.GetMaxId()+1)/3;};
void Squeeze() {this->P.Squeeze();};
float *GetPoint(int i);
void GetPoint(int id, float x[3]);
void SetPoint(int i, int x[3]);
void SetPoint(int i, float x[3]);
void InsertPoint(int i, int *x);
void InsertPoint(int i, float *x);
int InsertNextPoint(int *x);
int InsertNextPoint(float *x);
void GetPoints(vlIdList& ptId, vlFloatPoints& fp);
// miscellaneous
int *WritePtr(const int id, const int number);
vlIntPoints &operator=(const vlIntPoints& fp);
void operator+=(const vlIntPoints& fp) {this->P += fp.P;};
void Reset() {this->P.Reset();};
......@@ -56,6 +60,15 @@ protected:
vlIntArray P;
};
// Description:
// Get pointer to data. Useful for direct writes into object. MaxId is bumped
// by number (and memory allocated if necessary). Id is the location you
// wish to write into; number is the number of points to write.
inline int *vlIntPoints::WritePtr(const int id, const int number)
{
return this->P.WritePtr(id,3*number);
}
inline void vlIntPoints::GetPoint(int id, float x[3])
{
int *p=this->P.GetPtr(3*id);
......@@ -70,11 +83,26 @@ inline void vlIntPoints::SetPoint(int i, float x[3])
this->P[i+2]=(int)x[2];
}
inline void vlIntPoints::SetPoint(int i, int x[3])
{
i *= 3;
this->P[i] = x[0];
this->P[i+1] = x[1];
this->P[i+2] = x[2];
}
inline void vlIntPoints::InsertPoint(int i, int *x)
{
this->P.InsertValue(3*i+2, x[2]);
this->P[3*i] = x[0];
this->P[3*i+1] = x[1];
}
inline void vlIntPoints::InsertPoint(int i, float *x)
{
this->P.InsertValue(3*i+2, (int)x[2]);
this->P[3*i] = (int)x[0];
this->P[3*i+1] = (int)x[1];
this->P[3*i] = (int)x[0];
this->P[3*i+1] = (int)x[1];
}
inline int vlIntPoints::InsertNextPoint(int *x)
......
......@@ -37,6 +37,7 @@ public:
// vlScalar interface
vlScalars *MakeObject(int sze, int ext=1000);
char *GetDataType() {return "int";};
int GetNumberOfScalars() {return (this->S.GetMaxId()+1);};
void Squeeze() {this->S.Squeeze();};
float GetScalar(int i) {return (float)this->S[i];};
......
......@@ -77,6 +77,7 @@ public:
void SetTableValue (int indx, unsigned char r, unsigned char g, unsigned char b, unsigned char a=255);
unsigned char *GetTableValue (int id);
void GetTableValue (int id, unsigned char rgba[4]);
unsigned char *WritePtr(const int id, const int number);
protected:
int NumberOfColors;
......@@ -90,6 +91,15 @@ protected:
vlTimeStamp BuildTime;
};
// Description:
// Get pointer to data. Useful for direct writes into object. MaxId is bumped
// by number (and memory allocated if necessary). Id is the location you
// wish to write into; number is the number of rgba values to write.
inline unsigned char *vlLookupTable::WritePtr(const int id, const int number)
{
return this->Table.WritePtr(id,number);
}
#endif
......@@ -41,6 +41,11 @@ public:
// Create a copy of this object.
virtual vlNormals *MakeObject(int sze, int ext=1000) = 0;
// Description:
// Return data type. One of "bit", "char", "short", "int", "float", or
// "double".
virtual char *GetDataType() = 0;
// Description:
// Return number of normals in array.
virtual int GetNumberOfNormals() = 0;
......
......@@ -40,6 +40,11 @@ public:
// Create a copy of this object.
virtual vlPoints *MakeObject(int sze, int ext=1000) = 0;
// Description:
// Return data type. One of "bit", "char", "short", "int", "float", or
// "double".
virtual char *GetDataType() = 0;
// Description:
// Return number of points in list.
virtual int GetNumberOfPoints() = 0;
......
......@@ -37,6 +37,7 @@ public:
// vlScalar interface
vlScalars *MakeObject(int sze, int ext=1000);
char *GetDataType() {return "short";};
int GetNumberOfScalars() {return (this->S.GetMaxId()+1);};
void Squeeze() {this->S.Squeeze();};
float GetScalar(int i) {return (float)this->S[i];};
......
......@@ -50,6 +50,11 @@ public:
// Create a copy of this object.
virtual vlScalars *MakeObject(int sze, int ext=1000) = 0;
// Description:
// Return data type. One of "bit", "char", "short", "int", "float", or
// "double".
virtual char *GetDataType() = 0;
// Description:
// Return number of points in array.
virtual int GetNumberOfScalars() = 0;
......
......@@ -42,6 +42,11 @@ public:
// Create a copy of this object.
virtual vlTCoords *MakeObject(int sze, int d=2, int ext=1000) = 0;
// Description:
// Return data type. One of "bit", "char", "short", "int", "float", or
// "double".
virtual char *GetDataType() = 0;
// Description:
// Return number of texture coordinates in array.
virtual int GetNumberOfTCoords() = 0;
......
......@@ -41,6 +41,11 @@ public:
// Create a copy of this object.
virtual vlTensors *MakeObject(int sze, int d=3, int ext=1000) = 0;
// Description:
// Return data type. One of "bit", "char", "short", "int", "float", or
// "double".
virtual char *GetDataType() = 0;
// Description:
// Return number of tensors in array.
virtual int GetNumberOfTensors() = 0;
......
......@@ -40,6 +40,11 @@ public:
// Create a copy of this object.
virtual vlVectors *MakeObject(int sze, int ext=1000) = 0;
// Description:
// Return data type. One of "bit", "char", "short", "int", "float", or
// "double".
virtual char *GetDataType() = 0;
// Description:
// Return number of vectors in array.
virtual int GetNumberOfVectors() = 0;
......
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