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 Module: AGraymap.hh
Language: C++ Language: C++
Date: $Date$ Date: $Date$
Version: $Revision$ 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 or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors. without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994 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 // .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 // represents scalars using using one value for intensity (grayscale) and
// one value for alpha (transparency). The intensity and alpha values range // one value for alpha (transparency). The intensity and alpha values range
// between (0,255) (i.e., an unsigned char value). // between (0,255) (i.e., an unsigned char value).
#ifndef __vlAGraymap_h #ifndef __vtkAGraymap_h
#define __vlAGraymap_h #define __vtkAGraymap_h
#include "CoScalar.hh" #include "CoScalar.hh"
#include "CArray.hh" #include "CArray.hh"
class vlAGraymap : public vlColorScalars class vtkAGraymap : public vtkColorScalars
{ {
public: public:
vlAGraymap() {}; vtkAGraymap() {};
~vlAGraymap() {}; ~vtkAGraymap() {};
vlAGraymap(const vlAGraymap& fs) {this->S = fs.S;}; vtkAGraymap(const vtkAGraymap& fs) {this->S = fs.S;};
vlAGraymap(const int sz, const int ext=1000):S(2*sz,2*ext){}; 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);}; int Allocate(const int sz, const int ext=1000) {return this->S.Allocate(2*sz,2*ext);};
void Initialize() {this->S.Initialize();}; void Initialize() {this->S.Initialize();};
char *GetClassName() {return "vlAGraymap";}; char *GetClassName() {return "vtkAGraymap";};
// vlScalar interface // vtkScalar interface
vlScalars *MakeObject(int sze, int ext=1000); vtkScalars *MakeObject(int sze, int ext=1000);
int GetNumberOfScalars() {return (this->S.GetMaxId()+1)/2;}; int GetNumberOfScalars() {return (this->S.GetMaxId()+1)/2;};
void Squeeze() {this->S.Squeeze();}; void Squeeze() {this->S.Squeeze();};
int GetNumberOfValuesPerScalar() {return 2;}; int GetNumberOfValuesPerScalar() {return 2;};
// miscellaneous // miscellaneous
vlAGraymap &operator=(const vlAGraymap& fs); vtkAGraymap &operator=(const vtkAGraymap& fs);
void operator+=(const vlAGraymap& fs) {this->S += fs.S;}; void operator+=(const vtkAGraymap& fs) {this->S += fs.S;};
void Reset() {this->S.Reset();}; void Reset() {this->S.Reset();};
unsigned char *GetPtr(const int id); unsigned char *GetPtr(const int id);
unsigned char *WritePtr(const int id, const int number); unsigned char *WritePtr(const int id, const int number);
void WrotePtr(); void WrotePtr();
// vlColorScalar interface. // vtkColorScalar interface.
unsigned char *GetColor(int id); unsigned char *GetColor(int id);
void GetColor(int id, unsigned char rgba[4]); void GetColor(int id, unsigned char rgba[4]);
void SetColor(int id, unsigned char rgba[4]); void SetColor(int id, unsigned char rgba[4]);
...@@ -60,13 +60,13 @@ public: ...@@ -60,13 +60,13 @@ public:
int InsertNextColor(unsigned char rgba[4]); int InsertNextColor(unsigned char rgba[4]);
protected: protected:
vlCharArray S; vtkCharArray S;
}; };
// Description: // Description:
// Set a rgba color value at a particular array location. Does not do // Set a rgba color value at a particular array location. Does not do
// range checking. // range checking.
inline void vlAGraymap::SetColor(int i, unsigned char rgba[4]) inline void vtkAGraymap::SetColor(int i, unsigned char rgba[4])
{ {
i *= 2; i *= 2;
this->S[i] = (rgba[0] > rgba[1] ? (rgba[0] > rgba[2] ? rgba[0] : rgba[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]) ...@@ -77,7 +77,7 @@ inline void vlAGraymap::SetColor(int i, unsigned char rgba[4])
// Description: // Description:
// Insert a rgba color value at a particular array location. Does range // Insert a rgba color value at a particular array location. Does range
// checking and will allocate additional memory if necessary. // 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.InsertValue(2*i+1, rgba[3]);
this->S[2*i] = (rgba[0] > rgba[1] ? (rgba[0] > rgba[2] ? rgba[0] : rgba[2]) : 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]) ...@@ -87,7 +87,7 @@ inline void vlAGraymap::InsertColor(int i, unsigned char rgba[4])
// Description: // Description:
// Insert a rgba color value at the next available slot in the array. Will // Insert a rgba color value at the next available slot in the array. Will
// allocate memory if necessary. // 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; int id = this->S.GetMaxId() + 1;
this->S.InsertValue(id,rgba[3]); this->S.InsertValue(id,rgba[3]);
...@@ -99,7 +99,7 @@ inline int vlAGraymap::InsertNextColor(unsigned char rgba[4]) ...@@ -99,7 +99,7 @@ inline int vlAGraymap::InsertNextColor(unsigned char rgba[4])
// Description: // Description:
// Get pointer to array of data starting at data position "id". // 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); return this->S.GetPtr(2*id);
} }
...@@ -109,7 +109,7 @@ inline unsigned char *vlAGraymap::GetPtr(const int id) ...@@ -109,7 +109,7 @@ inline unsigned char *vlAGraymap::GetPtr(const int id)
// bumped by number (and memory allocated if necessary). Id is the // bumped by number (and memory allocated if necessary). Id is the
// location you wish to write into; number is the number of scalars to // location you wish to write into; number is the number of scalars to
// write. Use the method WrotePtr() to mark completion of write. // 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); return this->S.WritePtr(2*id,2*number);
} }
...@@ -117,7 +117,7 @@ inline unsigned char *vlAGraymap::WritePtr(const int id, const int number) ...@@ -117,7 +117,7 @@ inline unsigned char *vlAGraymap::WritePtr(const int id, const int number)
// Description: // Description:
// Terminate direct write of data. Although dummy routine now, reserved for // Terminate direct write of data. Although dummy routine now, reserved for
// future use. // future use.
inline void vlAGraymap::WrotePtr() {} inline void vtkAGraymap::WrotePtr() {}
#endif #endif
/*========================================================================= /*=========================================================================
Program: Visualization Library Program: Visualization Toolkit
Module: APixmap.hh Module: APixmap.hh
Language: C++ Language: C++
Date: $Date$ Date: $Date$
Version: $Revision$ 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 or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors. without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994 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 // .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 // 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., // transparency value. Each of r,g,b,a components ranges from (0,255) (i.e.,
// an unsigned char value). // an unsigned char value).
#ifndef __vlAPixmap_h #ifndef __vtkAPixmap_h
#define __vlAPixmap_h #define __vtkAPixmap_h
#include "CoScalar.hh" #include "CoScalar.hh"
#include "CArray.hh" #include "CArray.hh"
class vlAPixmap : public vlColorScalars class vtkAPixmap : public vtkColorScalars
{ {
public: public:
vlAPixmap() {}; vtkAPixmap() {};
~vlAPixmap() {}; ~vtkAPixmap() {};
vlAPixmap(const vlAPixmap& fs) {this->S = fs.S;}; vtkAPixmap(const vtkAPixmap& fs) {this->S = fs.S;};
vlAPixmap(const int sz, const int ext=1000):S(4*sz,4*ext){}; 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);}; int Allocate(const int sz, const int ext=1000) {return this->S.Allocate(4*sz,4*ext);};
void Initialize() {this->S.Initialize();}; void Initialize() {this->S.Initialize();};
char *GetClassName() {return "vlAPixmap";}; char *GetClassName() {return "vtkAPixmap";};
// vlScalar interface // vtkScalar interface
vlScalars *MakeObject(int sze, int ext=1000); vtkScalars *MakeObject(int sze, int ext=1000);
int GetNumberOfScalars() {return (this->S.GetMaxId()+1)/4;}; int GetNumberOfScalars() {return (this->S.GetMaxId()+1)/4;};
void Squeeze() {this->S.Squeeze();}; void Squeeze() {this->S.Squeeze();};
int GetNumberOfValuesPerScalar() {return 4;}; int GetNumberOfValuesPerScalar() {return 4;};
// miscellaneous // miscellaneous
vlAPixmap &operator=(const vlAPixmap& fs); vtkAPixmap &operator=(const vtkAPixmap& fs);
void operator+=(const vlAPixmap& fs) {this->S += fs.S;}; void operator+=(const vtkAPixmap& fs) {this->S += fs.S;};
void Reset() {this->S.Reset();}; void Reset() {this->S.Reset();};
unsigned char *GetPtr(const int id); unsigned char *GetPtr(const int id);
unsigned char *WritePtr(const int id, const int number); unsigned char *WritePtr(const int id, const int number);
void WrotePtr(); void WrotePtr();
// vlColorScalar interface. // vtkColorScalar interface.
unsigned char *GetColor(int id); unsigned char *GetColor(int id);
void GetColor(int id, unsigned char rgba[4]); void GetColor(int id, unsigned char rgba[4]);
void SetColor(int id, unsigned char rgba[4]); void SetColor(int id, unsigned char rgba[4]);
...@@ -59,19 +59,19 @@ public: ...@@ -59,19 +59,19 @@ public:
int InsertNextColor(unsigned char rgba[4]); int InsertNextColor(unsigned char rgba[4]);
protected: protected:
vlCharArray S; vtkCharArray S;
}; };
// Description: // Description:
// Return a rgba color at array location i. // 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); return this->S.GetPtr(4*i);
} }
// Description: // Description:
// Get pointer to array of data starting at data position "id". // 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); return this->S.GetPtr(4*id);
} }
...@@ -81,7 +81,7 @@ inline unsigned char *vlAPixmap::GetPtr(const int id) ...@@ -81,7 +81,7 @@ inline unsigned char *vlAPixmap::GetPtr(const int id)
// bumped by number (and memory allocated if necessary). Id is the // bumped by number (and memory allocated if necessary). Id is the
// location you wish to write into; number is the number of scalars to // location you wish to write into; number is the number of scalars to
// write. Use the method WrotePtr() to mark completion of write. // 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); return this->S.WritePtr(4*id,4*number);
} }
...@@ -89,6 +89,6 @@ inline unsigned char *vlAPixmap::WritePtr(const int id, const int number) ...@@ -89,6 +89,6 @@ inline unsigned char *vlAPixmap::WritePtr(const int id, const int number)
// Description: // Description:
// Terminate direct write of data. Although dummy routine now, reserved for // Terminate direct write of data. Although dummy routine now, reserved for
// future use. // future use.
inline void vlAPixmap::WrotePtr() {} inline void vtkAPixmap::WrotePtr() {}
#endif #endif
/*========================================================================= /*=========================================================================
Program: Visualization Library Program: Visualization Toolkit
Module: Actor.hh Module: Actor.hh
Language: C++ Language: C++
Date: $Date$ Date: $Date$
Version: $Revision$ 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 contents may be copied, reproduced or altered in any way without the express
written consent of the authors. written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994 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 // .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 // functions related to the actors position, orientation and scaling. It
// combines these instance variables into one matrix as follows: [x y z 1] // 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) // = [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 ...@@ -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 // The actor also maintains a reference to the defining geometry (i.e., the
// mapper), and rendering properties. // mapper), and rendering properties.
#ifndef __vlActor_hh #ifndef __vtkActor_hh
#define __vlActor_hh #define __vtkActor_hh
#include "Object.hh" #include "Object.hh"
#include "Property.hh" #include "Property.hh"
...@@ -33,122 +33,122 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994 ...@@ -33,122 +33,122 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#include "Mapper.hh" #include "Mapper.hh"
#include "Trans.hh" #include "Trans.hh"
class vlRenderer; class vtkRenderer;
class vlActor : public vlObject class vtkActor : public vtkObject
{ {
public: public:
vlActor(); vtkActor();
~vlActor(); ~vtkActor();
char *GetClassName() {return "vlActor";}; char *GetClassName() {return "vtkActor";};
void PrintSelf(ostream& os, vlIndent indent); void PrintSelf(ostream& os, vtkIndent indent);
void Render(vlRenderer *ren); void Render(vtkRenderer *ren);
// Description: // Description:
// Specify the property object to control rendering surface properties. // Specify the property object to control rendering surface properties.
void SetProperty(vlProperty *lut); void SetProperty(vtkProperty *lut);
void SetProperty(vlProperty& lut) {this->SetProperty(&lut);}; void SetProperty(vtkProperty& lut) {this->SetProperty(&lut);};
// Description: // Description:
// Get the property object that controls rendering surface properties. // Get the property object that controls rendering surface properties.
vlProperty *GetProperty(); vtkProperty *GetProperty();
// Description: // Description:
// Specify the Texture object to control rendering texture. // Specify the Texture object to control rendering texture.
vlSetObjectMacro(Texture,vlTexture); vtkSetObjectMacro(Texture,vtkTexture);
// Description: // Description:
// Get the Texture object that controls rendering texture. // Get the Texture object that controls rendering texture.
vlGetObjectMacro(Texture,vlTexture); vtkGetObjectMacro(Texture,vtkTexture);
// Description: // Description:
// This is the method that is used to connect an actor to the end of a // This is the method that is used to connect an actor to the end of a
// visualization pipeline, i.e. the Mapper. // visualization pipeline, i.e. the Mapper.
vlSetObjectMacro(Mapper,vlMapper); vtkSetObjectMacro(Mapper,vtkMapper);
// Description: // Description:
// Returns the Mapper that this actor is getting it's data from. // Returns the Mapper that this actor is getting it's data from.
vlGetObjectMacro(Mapper,vlMapper); vtkGetObjectMacro(Mapper,vtkMapper);
// Description: // Description:
// Set a user defined matrix to concatenate with. // Set a user defined matrix to concatenate with.
vlSetObjectMacro(UserMatrix,vlMatrix4x4); vtkSetObjectMacro(UserMatrix,vtkMatrix4x4);
// Description: // Description:
// Returns the user defined transformation matrix. // Returns the user defined transformation matrix.
vlGetObjectMacro(UserMatrix,vlMatrix4x4); vtkGetObjectMacro(UserMatrix,vtkMatrix4x4);
// Description: // Description:
// Get the position of the actor. // Get the position of the actor.
vlGetVectorMacro(Position,float,3); vtkGetVectorMacro(Position,float,3);
// Description: // Description:
// Sets the posiiton of the actor. // Sets the posiiton of the actor.
vlSetVector3Macro(Position,float); vtkSetVector3Macro(Position,float);
void AddPosition(float deltaPosition[3]); void AddPosition(float deltaPosition[3]);
void AddPosition(float deltaX,float deltaY,float deltaZ); void AddPosition(float deltaX,float deltaY,float deltaZ);
// Description: // Description:
// Get the origin of the actor. This is the point about which all // Get the origin of the actor. This is the point about which all
// rotations take place. // rotations take place.
vlGetVectorMacro(Origin,float,3); vtkGetVectorMacro(Origin,float,3);
// Description: // Description:
// Set the origin of the actor. This is the point about which all // Set the origin of the actor. This is the point about which all
// rotations take place. // rotations take place.
vlSetVector3Macro(Origin,float); vtkSetVector3Macro(Origin,float);
// Description: // Description:
// Get the scale of the actor. Scaling in performed independently on the // Get the scale of the actor. Scaling in performed independently on the
// X,Y and Z axis. // X,Y and Z axis.
vlGetVectorMacro(Scale,float,3); vtkGetVectorMacro(Scale,float,3);
// Description: // Description:
// Set the scale of the actor. Scaling in performed independently on the // Set the scale of the actor. Scaling in performed independently on the
// X,Y and Z axis. // X,Y and Z axis.
vlSetVector3Macro(Scale,float); vtkSetVector3Macro(Scale,float);
// Description: // Description:
// Get the visibility of the actor. Visibility is like a light switch // Get the visibility of the actor. Visibility is like a light switch
// for actors. Use it to turn them on or off. // for actors. Use it to turn them on or off.
vlGetMacro(Visibility,int); vtkGetMacro(Visibility,int);
// Description: // Description:
// Set the visibility of the actor. Visibility is like a light switch // Set the visibility of the actor. Visibility is like a light switch
// for actors. Use it to turn them on or off. // for actors. Use it to turn them on or off.
vlSetMacro(Visibility,int); vtkSetMacro(Visibility,int);
// Description: // Description:
// Set the visibility of the actor. Visibility is like a light switch // Set the visibility of the actor. Visibility is like a light switch
// for actors. Use it to turn them on or off. // for actors. Use it to turn them on or off.
vlBooleanMacro(Visibility,int); vtkBooleanMacro(Visibility,int);
// Description: // Description:
// Get the pickable instance variable. This determines if the actor can // Get the pickable instance variable. This determines if the actor can
// be picked (typically using the mouse). Also see dragable. // be picked (typically using the mouse). Also see dragable.
vlGetMacro(Pickable,int); vtkGetMacro(Pickable,int);
// Description: // Description:
// Set the pickable instance variable. This determines if the actor can // Set the pickable instance variable. This determines if the actor can
// be picked (typically using the mouse). Also see dragable. // be picked (typically using the mouse). Also see dragable.
vlSetMacro(Pickable,int); vtkSetMacro(Pickable,int);
// Description: // Description:
// Set the pickable instance variable. This determines if the actor can // Set the pickable instance variable. This determines if the actor can
// be picked (typically using the mouse). Also see dragable. // be picked (typically using the mouse). Also see dragable.
vlBooleanMacro(Pickable,int); vtkBooleanMacro(Pickable,int);
// Description: // Description:
// Get the value of the dragable instance variable. This determines if // Get the value of the dragable instance variable. This determines if
// an actor once picked, can be dragged (translated) through space. // an actor once picked, can be dragged (translated) through space.
// This is typically done through an interactive mouse interface. // This is typically done through an interactive mouse interface.
// This does not affect methods such as SetPosition. // This does not affect methods such as SetPosition.
vlGetMacro(Dragable,int); vtkGetMacro(Dragable,int);
// Description: // Description:
// Set the value of the dragable instance variable. This determines if // Set the value of the dragable instance variable. This determines if
// an actor once picked, can be dragged (translated) through space. // an actor once picked, can be dragged (translated) through space.
// This is typically done through an interactive mouse interface. // This is typically done through an interactive mouse interface.
// This does not affect methods such as SetPosition. // This does not affect methods such as SetPosition.
vlSetMacro(Dragable,int); vtkSetMacro(Dragable,int);
// Description: // Description:
// Turn on/off the dragable instance variable. This determines if // Turn on/off the dragable instance variable. This determines if
// an actor once picked, can be dragged (translated) through space. // an actor once picked, can be dragged (translated) through space.