Commit a5adc668 authored by Ken Martin's avatar Ken Martin
Browse files

changed vl to vtk

parent bf4064de
/*=========================================================================
Program: Visualization Library
Program: Visualization Toolkit
Module: AGraymap.hh
Language: C++
Date: $Date$
Version: $Revision$
This file is part of the Visualization Library. No part of this file
This file is part of the Visualization Toolkit. 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.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlAGraymap - scalar data in intensity + alpha (grayscale + texture) form
// .NAME vtkAGraymap - scalar data in intensity + alpha (grayscale + texture) form
// .SECTION Description
// vlAGraymap is a concrete implementation of vlScalars. vlAGraymap
// vtkAGraymap is a concrete implementation of vtkScalars. vtkAGraymap
// represents scalars using using one value for intensity (grayscale) and
// one value for alpha (transparency). The intensity and alpha values range
// between (0,255) (i.e., an unsigned char value).
#ifndef __vlAGraymap_h
#define __vlAGraymap_h
#ifndef __vtkAGraymap_h
#define __vtkAGraymap_h
#include "CoScalar.hh"
#include "CArray.hh"
class vlAGraymap : public vlColorScalars
class vtkAGraymap : public vtkColorScalars
{
public:
vlAGraymap() {};
~vlAGraymap() {};
vlAGraymap(const vlAGraymap& fs) {this->S = fs.S;};
vlAGraymap(const int sz, const int ext=1000):S(2*sz,2*ext){};
vtkAGraymap() {};
~vtkAGraymap() {};
vtkAGraymap(const vtkAGraymap& fs) {this->S = fs.S;};
vtkAGraymap(const int sz, const int ext=1000):S(2*sz,2*ext){};
int Allocate(const int sz, const int ext=1000) {return this->S.Allocate(2*sz,2*ext);};
void Initialize() {this->S.Initialize();};
char *GetClassName() {return "vlAGraymap";};
char *GetClassName() {return "vtkAGraymap";};
// vlScalar interface
vlScalars *MakeObject(int sze, int ext=1000);
// vtkScalar interface
vtkScalars *MakeObject(int sze, int ext=1000);
int GetNumberOfScalars() {return (this->S.GetMaxId()+1)/2;};
void Squeeze() {this->S.Squeeze();};
int GetNumberOfValuesPerScalar() {return 2;};
// miscellaneous
vlAGraymap &operator=(const vlAGraymap& fs);
void operator+=(const vlAGraymap& fs) {this->S += fs.S;};
vtkAGraymap &operator=(const vtkAGraymap& fs);
void operator+=(const vtkAGraymap& fs) {this->S += fs.S;};
void Reset() {this->S.Reset();};
unsigned char *GetPtr(const int id);
unsigned char *WritePtr(const int id, const int number);
void WrotePtr();
// vlColorScalar interface.
// vtkColorScalar interface.
unsigned char *GetColor(int id);
void GetColor(int id, unsigned char rgba[4]);
void SetColor(int id, unsigned char rgba[4]);
......@@ -60,13 +60,13 @@ public:
int InsertNextColor(unsigned char rgba[4]);
protected:
vlCharArray S;
vtkCharArray S;
};
// Description:
// Set a rgba color value at a particular array location. Does not do
// range checking.
inline void vlAGraymap::SetColor(int i, unsigned char rgba[4])
inline void vtkAGraymap::SetColor(int i, unsigned char rgba[4])
{
i *= 2;
this->S[i] = (rgba[0] > rgba[1] ? (rgba[0] > rgba[2] ? rgba[0] : rgba[2]) :
......@@ -77,7 +77,7 @@ inline void vlAGraymap::SetColor(int i, unsigned char rgba[4])
// Description:
// Insert a rgba color value at a particular array location. Does range
// checking and will allocate additional memory if necessary.
inline void vlAGraymap::InsertColor(int i, unsigned char rgba[4])
inline void vtkAGraymap::InsertColor(int i, unsigned char rgba[4])
{
this->S.InsertValue(2*i+1, rgba[3]);
this->S[2*i] = (rgba[0] > rgba[1] ? (rgba[0] > rgba[2] ? rgba[0] : rgba[2]) :
......@@ -87,7 +87,7 @@ inline void vlAGraymap::InsertColor(int i, unsigned char rgba[4])
// Description:
// Insert a rgba color value at the next available slot in the array. Will
// allocate memory if necessary.
inline int vlAGraymap::InsertNextColor(unsigned char rgba[4])
inline int vtkAGraymap::InsertNextColor(unsigned char rgba[4])
{
int id = this->S.GetMaxId() + 1;
this->S.InsertValue(id,rgba[3]);
......@@ -99,7 +99,7 @@ inline int vlAGraymap::InsertNextColor(unsigned char rgba[4])
// Description:
// Get pointer to array of data starting at data position "id".
inline unsigned char *vlAGraymap::GetPtr(const int id)
inline unsigned char *vtkAGraymap::GetPtr(const int id)
{
return this->S.GetPtr(2*id);
}
......@@ -109,7 +109,7 @@ inline unsigned char *vlAGraymap::GetPtr(const int id)
// bumped by number (and memory allocated if necessary). Id is the
// location you wish to write into; number is the number of scalars to
// write. Use the method WrotePtr() to mark completion of write.
inline unsigned char *vlAGraymap::WritePtr(const int id, const int number)
inline unsigned char *vtkAGraymap::WritePtr(const int id, const int number)
{
return this->S.WritePtr(2*id,2*number);
}
......@@ -117,7 +117,7 @@ inline unsigned char *vlAGraymap::WritePtr(const int id, const int number)
// Description:
// Terminate direct write of data. Although dummy routine now, reserved for
// future use.
inline void vlAGraymap::WrotePtr() {}
inline void vtkAGraymap::WrotePtr() {}
#endif
/*=========================================================================
Program: Visualization Library
Program: Visualization Toolkit
Module: APixmap.hh
Language: C++
Date: $Date$
Version: $Revision$
This file is part of the Visualization Library. No part of this file
This file is part of the Visualization Toolkit. 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.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlAPixmap - scalar data in rgba (color + transparency) form
// .NAME vtkAPixmap - scalar data in rgba (color + transparency) form
// .SECTION Description
// vlAPixmap is a concrete implementation of vlScalars. Scalars are
// vtkAPixmap is a concrete implementation of vtkScalars. Scalars are
// represented using three values for color (red, green, blue) plus alpha
// transparency value. Each of r,g,b,a components ranges from (0,255) (i.e.,
// an unsigned char value).
#ifndef __vlAPixmap_h
#define __vlAPixmap_h
#ifndef __vtkAPixmap_h
#define __vtkAPixmap_h
#include "CoScalar.hh"
#include "CArray.hh"
class vlAPixmap : public vlColorScalars
class vtkAPixmap : public vtkColorScalars
{
public:
vlAPixmap() {};
~vlAPixmap() {};
vlAPixmap(const vlAPixmap& fs) {this->S = fs.S;};
vlAPixmap(const int sz, const int ext=1000):S(4*sz,4*ext){};
vtkAPixmap() {};
~vtkAPixmap() {};
vtkAPixmap(const vtkAPixmap& fs) {this->S = fs.S;};
vtkAPixmap(const int sz, const int ext=1000):S(4*sz,4*ext){};
int Allocate(const int sz, const int ext=1000) {return this->S.Allocate(4*sz,4*ext);};
void Initialize() {this->S.Initialize();};
char *GetClassName() {return "vlAPixmap";};
char *GetClassName() {return "vtkAPixmap";};
// vlScalar interface
vlScalars *MakeObject(int sze, int ext=1000);
// vtkScalar interface
vtkScalars *MakeObject(int sze, int ext=1000);
int GetNumberOfScalars() {return (this->S.GetMaxId()+1)/4;};
void Squeeze() {this->S.Squeeze();};
int GetNumberOfValuesPerScalar() {return 4;};
// miscellaneous
vlAPixmap &operator=(const vlAPixmap& fs);
void operator+=(const vlAPixmap& fs) {this->S += fs.S;};
vtkAPixmap &operator=(const vtkAPixmap& fs);
void operator+=(const vtkAPixmap& fs) {this->S += fs.S;};
void Reset() {this->S.Reset();};
unsigned char *GetPtr(const int id);
unsigned char *WritePtr(const int id, const int number);
void WrotePtr();
// vlColorScalar interface.
// vtkColorScalar interface.
unsigned char *GetColor(int id);
void GetColor(int id, unsigned char rgba[4]);
void SetColor(int id, unsigned char rgba[4]);
......@@ -59,19 +59,19 @@ public:
int InsertNextColor(unsigned char rgba[4]);
protected:
vlCharArray S;
vtkCharArray S;
};
// Description:
// Return a rgba color at array location i.
inline unsigned char *vlAPixmap::GetColor(int i)
inline unsigned char *vtkAPixmap::GetColor(int i)
{
return this->S.GetPtr(4*i);
}
// Description:
// Get pointer to array of data starting at data position "id".
inline unsigned char *vlAPixmap::GetPtr(const int id)
inline unsigned char *vtkAPixmap::GetPtr(const int id)
{
return this->S.GetPtr(4*id);
}
......@@ -81,7 +81,7 @@ inline unsigned char *vlAPixmap::GetPtr(const int id)
// bumped by number (and memory allocated if necessary). Id is the
// location you wish to write into; number is the number of scalars to
// write. Use the method WrotePtr() to mark completion of write.
inline unsigned char *vlAPixmap::WritePtr(const int id, const int number)
inline unsigned char *vtkAPixmap::WritePtr(const int id, const int number)
{
return this->S.WritePtr(4*id,4*number);
}
......@@ -89,6 +89,6 @@ inline unsigned char *vlAPixmap::WritePtr(const int id, const int number)
// Description:
// Terminate direct write of data. Although dummy routine now, reserved for
// future use.
inline void vlAPixmap::WrotePtr() {}
inline void vtkAPixmap::WrotePtr() {}
#endif
/*=========================================================================
Program: Visualization Library
Program: Visualization Toolkit
Module: Actor.hh
Language: C++
Date: $Date$
Version: $Revision$
This file is part of the Visualization Library. No part of this file or its
This file is part of the Visualization Toolkit. 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.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlActor - an entity in a rendered image
// .NAME vtkActor - an entity in a rendered image
// .SECTION Description
// vlActor is used to represent an entity in a rendering scene. It handles
// vtkActor is used to represent an entity in a rendering scene. It handles
// functions related to the actors position, orientation and scaling. It
// combines these instance variables into one matrix as follows: [x y z 1]
// = [x y z 1] Translate(-origin) Scale(scale) Rot(y) Rot(x) Rot (z)
......@@ -24,8 +24,8 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
// The actor also maintains a reference to the defining geometry (i.e., the
// mapper), and rendering properties.
#ifndef __vlActor_hh
#define __vlActor_hh
#ifndef __vtkActor_hh
#define __vtkActor_hh
#include "Object.hh"
#include "Property.hh"
......@@ -33,122 +33,122 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#include "Mapper.hh"
#include "Trans.hh"
class vlRenderer;
class vtkRenderer;
class vlActor : public vlObject
class vtkActor : public vtkObject
{
public:
vlActor();
~vlActor();
char *GetClassName() {return "vlActor";};
void PrintSelf(ostream& os, vlIndent indent);
vtkActor();
~vtkActor();
char *GetClassName() {return "vtkActor";};
void PrintSelf(ostream& os, vtkIndent indent);
void Render(vlRenderer *ren);
void Render(vtkRenderer *ren);
// Description:
// Specify the property object to control rendering surface properties.
void SetProperty(vlProperty *lut);
void SetProperty(vlProperty& lut) {this->SetProperty(&lut);};
void SetProperty(vtkProperty *lut);
void SetProperty(vtkProperty& lut) {this->SetProperty(&lut);};
// Description:
// Get the property object that controls rendering surface properties.
vlProperty *GetProperty();
vtkProperty *GetProperty();
// Description:
// Specify the Texture object to control rendering texture.
vlSetObjectMacro(Texture,vlTexture);
vtkSetObjectMacro(Texture,vtkTexture);
// Description:
// Get the Texture object that controls rendering texture.
vlGetObjectMacro(Texture,vlTexture);
vtkGetObjectMacro(Texture,vtkTexture);
// Description:
// This is the method that is used to connect an actor to the end of a
// visualization pipeline, i.e. the Mapper.
vlSetObjectMacro(Mapper,vlMapper);
vtkSetObjectMacro(Mapper,vtkMapper);
// Description:
// Returns the Mapper that this actor is getting it's data from.
vlGetObjectMacro(Mapper,vlMapper);
vtkGetObjectMacro(Mapper,vtkMapper);
// Description:
// Set a user defined matrix to concatenate with.
vlSetObjectMacro(UserMatrix,vlMatrix4x4);
vtkSetObjectMacro(UserMatrix,vtkMatrix4x4);
// Description:
// Returns the user defined transformation matrix.
vlGetObjectMacro(UserMatrix,vlMatrix4x4);
vtkGetObjectMacro(UserMatrix,vtkMatrix4x4);
// Description:
// Get the position of the actor.
vlGetVectorMacro(Position,float,3);
vtkGetVectorMacro(Position,float,3);
// Description:
// Sets the posiiton of the actor.
vlSetVector3Macro(Position,float);
vtkSetVector3Macro(Position,float);
void AddPosition(float deltaPosition[3]);
void AddPosition(float deltaX,float deltaY,float deltaZ);
// Description:
// Get the origin of the actor. This is the point about which all
// rotations take place.
vlGetVectorMacro(Origin,float,3);
vtkGetVectorMacro(Origin,float,3);
// Description:
// Set the origin of the actor. This is the point about which all
// rotations take place.
vlSetVector3Macro(Origin,float);
vtkSetVector3Macro(Origin,float);
// Description:
// Get the scale of the actor. Scaling in performed independently on the
// X,Y and Z axis.
vlGetVectorMacro(Scale,float,3);
vtkGetVectorMacro(Scale,float,3);
// Description:
// Set the scale of the actor. Scaling in performed independently on the
// X,Y and Z axis.
vlSetVector3Macro(Scale,float);
vtkSetVector3Macro(Scale,float);
// Description:
// Get the visibility of the actor. Visibility is like a light switch
// for actors. Use it to turn them on or off.
vlGetMacro(Visibility,int);
vtkGetMacro(Visibility,int);
// Description:
// Set the visibility of the actor. Visibility is like a light switch
// for actors. Use it to turn them on or off.
vlSetMacro(Visibility,int);
vtkSetMacro(Visibility,int);
// Description:
// Set the visibility of the actor. Visibility is like a light switch
// for actors. Use it to turn them on or off.
vlBooleanMacro(Visibility,int);
vtkBooleanMacro(Visibility,int);
// Description:
// Get the pickable instance variable. This determines if the actor can
// be picked (typically using the mouse). Also see dragable.
vlGetMacro(Pickable,int);
vtkGetMacro(Pickable,int);
// Description:
// Set the pickable instance variable. This determines if the actor can
// be picked (typically using the mouse). Also see dragable.
vlSetMacro(Pickable,int);
vtkSetMacro(Pickable,int);
// Description:
// Set the pickable instance variable. This determines if the actor can
// be picked (typically using the mouse). Also see dragable.
vlBooleanMacro(Pickable,int);
vtkBooleanMacro(Pickable,int);
// Description:
// Get the value of the dragable instance variable. This determines if
// an actor once picked, can be dragged (translated) through space.
// This is typically done through an interactive mouse interface.
// This does not affect methods such as SetPosition.
vlGetMacro(Dragable,int);
vtkGetMacro(Dragable,int);
// Description:
// Set the value of the dragable instance variable. This determines if
// an actor once picked, can be dragged (translated) through space.
// This is typically done through an interactive mouse interface.
// This does not affect methods such as SetPosition.
vlSetMacro(Dragable,int);
vtkSetMacro(Dragable,int);
// Description:
// Turn on/off the dragable instance variable. This determines if
// an actor once picked, can be dragged (translated) through space.
// This is typically done through an interactive mouse interface.
// This does not affect methods such as SetPosition.
vlBooleanMacro(Dragable,int);
vtkBooleanMacro(Dragable,int);
vlMatrix4x4& GetMatrix();
virtual void GetMatrix(vlMatrix4x4& m);
vtkMatrix4x4& GetMatrix();
virtual void GetMatrix(vtkMatrix4x4& m);
float *GetBounds();
float *GetXRange();
......@@ -167,10 +167,10 @@ class vlActor : public vlObject
void AddOrientation(float a[3]);
protected:
vlMatrix4x4 *UserMatrix;
vlProperty *Property;
vlTexture *Texture;
vlMapper *Mapper;
vtkMatrix4x4 *UserMatrix;
vtkProperty *Property;
vtkTexture *Texture;
vtkMapper *Mapper;
float Origin[3];
float Position[3];
float Orientation[3];
......@@ -178,7 +178,7 @@ protected:
int Visibility;
int Pickable;
int Dragable;
vlTransform Transform;
vtkTransform Transform;
float Bounds[6];
int SelfCreatedProperty;
};
......
/*=========================================================================
Program: Visualization Library
Program: Visualization Toolkit
Module: ActorC.hh
Language: C++
Date: $Date$
Version: $Revision$
This file is part of the Visualization Library. No part of this file or its
This file is part of the Visualization Toolkit. 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.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlActorCollection - a list of actors
// .NAME vtkActorCollection - a list of actors
// .SECTION Description
// vlActorCollection represents and provides methods to manipulate list of
// actors (i.e., vlActor and subclasses). The list is unsorted and duplicate
// vtkActorCollection represents and provides methods to manipulate list of
// actors (i.e., vtkActor and subclasses). The list is unsorted and duplicate
// entries are not prevented.
#ifndef __vlActorC_hh
#define __vlActorC_hh
#ifndef __vtkActorC_hh
#define __vtkActorC_hh
#include "Collect.hh"
#include "Actor.hh"
class vlActorCollection : public vlCollection
class vtkActorCollection : public vtkCollection
{
public:
char *GetClassName() {return "vlActorCollection";};
char *GetClassName() {return "vtkActorCollection";};
void AddItem(vlActor *a);
void RemoveItem(vlActor *a);
int IsItemPresent(vlActor *a);
vlActor *GetNextItem();
void AddItem(vtkActor *a);
void RemoveItem(vtkActor *a);
int IsItemPresent(vtkActor *a);
vtkActor *GetNextItem();
};
// Description:
// Add an actor to the list.
inline void vlActorCollection::AddItem(vlActor *a)
inline void vtkActorCollection::AddItem(vtkActor *a)
{
this->vlCollection::AddItem((vlObject *)a);
this->vtkCollection::AddItem((vtkObject *)a);
}
// Description:
// Remove an actor from the list.
inline void vlActorCollection::RemoveItem(vlActor *a)
inline void vtkActorCollection::RemoveItem(vtkActor *a)
{
this->vlCollection::RemoveItem((vlObject *)a);
this->vtkCollection::RemoveItem((vtkObject *)a);
}
// Description:
// Determine whether a particular actor is present. Returns its position
// in the list.
inline int vlActorCollection::IsItemPresent(vlActor *a)
inline int vtkActorCollection::IsItemPresent(vtkActor *a)
{
return this->vlCollection::IsItemPresent((vlObject *)a);
return this->vtkCollection::IsItemPresent((vtkObject *)a);
}
// Description:
// Get the next actor in the list.
inline vlActor *vlActorCollection::GetNextItem()
inline vtkActor *vtkActorCollection::GetNextItem()
{
return (vlActor *)(this->vlCollection::GetNextItem());
return (vtkActor *)(this->vtkCollection::GetNextItem());
}
#endif
......
/*=========================================================================
Program: Visualization Library
Program: Visualization Toolkit
Module: AppendF.hh
Language: C++
Date: $Date$
Version: $Revision$
This file is part of the Visualization Library. No part of this file
This file is part of the Visualization Toolkit. 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.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlAppendFilter - appends one or more datasets together into a single unstructured grid
// .NAME vtkAppendFilter - appends one or more datasets together into a single unstructured grid
// .SECTION Description
// vlAppendFilter is a filter that appends one of more datasets into a single
// vtkAppendFilter is a filter that appends one of more datasets into a single
// unstructured grid. All geometry is extracted and appended, but point
// attributes (i.e., scalars, vectors, normals) are extracted and appended
// only if all datasets have the point attributes available. (For example,
// if one dataset has scalars but another does not, scalars will not be
// appended.)
#ifndef __vlAppendFilter_h
#define __vlAppendFilter_h
#ifndef __vtkAppendFilter_h
#define __vtkAppendFilter_h
#include "UGrid.hh"
#include "Filter.hh"
#include "DataSetC.hh"
class vlAppendFilter : public vlUnstructuredGrid, public vlFilter
class vtkAppendFilter : public vtkUnstructuredGrid, public vtkFilter
{
public:
vlAppendFilter();
~vlAppendFilter();
char *GetClassName() {return "vlAppendFilter";};
void PrintSelf(ostream& os, vlIndent indent);
vtkAppendFilter();
~vtkAppendFilter();
char *GetClassName() {return "vtkAppendFilter";};
void PrintSelf(ostream& os, vtkIndent indent);
void AddInput(vlDataSet *in);
void AddInput(vlDataSet& in) {this->AddInput(&in);};
void RemoveInput(vlDataSet *in);
void RemoveInput(vlDataSet& in) {this->RemoveInput(&in);};
vlDataSetCollection *GetInput() {return &(this->InputList);};
void AddInput(vtkDataSet *in);
void AddInput(vtkDataSet& in) {this->AddInput(&in);};
void RemoveInput(vtkDataSet *in);
void RemoveInput(vtkDataSet& in) {this->RemoveInput(&in);};
vtkDataSetCollection *GetInput() {return &(this->InputList);};
// filter interface
void Update();
......@@ -50,7 +50,7 @@ protected:
// Usual data generation method
void Execute();
// list of data sets to append together