Commit 2703a995 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Removed print stuff; rearranged renderWindow protocol.

parent bf985a53
......@@ -26,6 +26,7 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "XRenWin.hh"
#include "XInter.hh"
class vlGlrRenderWindow : public vlXRenderWindow
{
......@@ -43,6 +44,7 @@ public:
vlLight *MakeLight();
vlCamera *MakeCamera();
vlProperty *MakeProperty();
vlRenderWindowInteractor *MakeRenderWindowInteractor();
void Start(void);
void Frame(void);
......
......@@ -13,9 +13,9 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlInteractiveRenderer - provide event driven interface to renderer
// .NAME vlRenderWindowInteractor - provide event driven interface to rendering window
// .SECTION Description
// vlInteractiveRenderer is a convenience object that provides event
// vlRenderWindowInteractor is a convenience object that provides event
// bindings to common graphics functions. For example, camera
// zoom-in/zoom-out, azimuth, and roll.
......@@ -30,36 +30,39 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
// w - turn all actors wireframe
// s - turn all actors surface
#ifndef __vlInteractiveRenderer_h
#define __vlInteractiveRenderer_h
#ifndef __vlRenderWindowInteractor_h
#define __vlRenderWindowInteractor_h
#include "RenderW.hh"
#include "Camera.hh"
#include "Light.hh"
class vlInteractiveRenderer : public vlObject
class vlRenderWindowInteractor : public vlObject
{
public:
vlInteractiveRenderer();
~vlInteractiveRenderer();
char *GetClassName() {return "vlInteractiveRenderer";};
vlRenderWindowInteractor();
~vlRenderWindowInteractor();
char *GetClassName() {return "vlRenderWindowInteractor";};
void PrintSelf(ostream& os, vlIndent indent);
virtual void Initialize() = 0;
virtual void Start() = 0;
// Description:
// Set the rendering window being controlled by this object.
// Get the rendering window being controlled by this object.
vlSetObjectMacro(RenderWindow,vlRenderWindow);
vlGetObjectMacro(RenderWindow,vlRenderWindow);
// Description:
// Turn on/off the automatic repositioning of lights as the camera moves.
vlSetMacro(LightFollowCamera,int);
vlGetMacro(LightFollowCamera,int);
vlBooleanMacro(LightFollowCamera,int);
// Description:
// See whether interactor has been initialized yet.
vlGetMacro(Initialized,int);
void FindPokedCamera(int,int);
void FindPokedRenderer(int,int);
......@@ -75,6 +78,7 @@ protected:
int Size[2];
int State;
float FocalDepth;
int Initialized;
};
#endif
......@@ -37,7 +37,6 @@ class vlRenderMaster : public vlObject
vlRenderWindow *MakeRenderWindow(char *ren);
vlRenderWindow *MakeRenderWindow(void);
vlInteractiveRenderer *MakeInteractiveRenderer(void);
};
#endif
......@@ -29,24 +29,13 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#include "Object.hh"
#include "RenderC.hh"
class vlRenderWindowInteractor;
// lets define the diferent types of stereo
#define VL_STEREO_CRYSTAL_EYES 1
class vlRenderWindow : public vlObject
{
public:
vlRendererCollection Renderers;
char Name[80];
int Size[2];
int Position[2];
int Borders;
int FullScreen;
int OldScreen[5];
int Mapped;
int DoubleBuffer;
int StereoRender;
int StereoType;
public:
vlRenderWindow();
char *GetClassName() {return "vlRenderWindow";};
......@@ -86,6 +75,10 @@ public:
// Create a device specific property.
virtual vlProperty *MakeProperty() = 0;
// Description:
// Create an interactor to control renderers in this window.
virtual vlRenderWindowInteractor *MakeRenderWindowInteractor() = 0;
// Description:
// Get the position in screen coordinates of the rendering window.
virtual int *GetPosition() = 0;
......@@ -124,6 +117,25 @@ public:
vlBooleanMacro(DoubleBuffer,int);
vlGetMacro(StereoRender,int);
// Description:
// Get name of rendering window
vlGetStringMacro(Name);
protected:
vlRendererCollection Renderers;
char Name[80];
int Size[2];
int Position[2];
int Borders;
int FullScreen;
int OldScreen[5];
int Mapped;
int DoubleBuffer;
int StereoRender;
int StereoType;
vlRenderWindowInteractor *Interactor;
};
#endif
......@@ -13,7 +13,7 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlRenderer - abstract specification for renderers
// .NAME vlRenderer - abstract specification for renderers
// .SECTION Description
// vlRenderer provides an abstract specification for renderers. A renderer
// is an object that controls the rendering process for objects. Rendering
......
......@@ -27,6 +27,7 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "XRenWin.hh"
#include "XInter.hh"
class vlSbrRenderWindow : public vlXRenderWindow
{
......@@ -40,6 +41,7 @@ public:
vlLight *MakeLight();
vlCamera *MakeCamera();
vlProperty *MakeProperty();
vlRenderWindowInteractor *MakeRenderWindowInteractor();
void Start(void);
void Frame(void);
......
......@@ -13,9 +13,9 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlXInteractiveRenderer - provide Xevent driven interface to renderer
// .NAME vlXRenderWindowInteractor - provide Xevent driven interface to renderer
// .SECTION Description
// vlXInteractiveRenderer is a convenience object that provides event
// vlXRenderWindowInteractor is a convenience object that provides event
// bindings to common graphics functions. For example, camera
// zoom-in/zoom-out, azimuth, and roll.
......@@ -31,8 +31,8 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
// s - turn all actors surface
#ifndef __vlXInteractiveRenderer_h
#define __vlXInteractiveRenderer_h
#ifndef __vlXRenderWindowInteractor_h
#define __vlXRenderWindowInteractor_h
//===========================================================
// now we define the C++ class
......@@ -41,12 +41,12 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#include <X11/StringDefs.h>
#include <X11/Intrinsic.h>
class vlXInteractiveRenderer : public vlInteractiveRenderer
class vlXRenderWindowInteractor : public vlRenderWindowInteractor
{
public:
vlXInteractiveRenderer();
~vlXInteractiveRenderer();
char *GetClassName() {return "vlXInteractiveRenderer";};
vlXRenderWindowInteractor();
~vlXRenderWindowInteractor();
char *GetClassName() {return "vlXRenderWindowInteractor";};
void PrintSelf(ostream& os, vlIndent indent);
virtual void Initialize();
......@@ -60,9 +60,9 @@ public:
void StartPan();
void EndPan();
friend void vlXInteractiveRendererCallback(Widget,XtPointer,
friend void vlXRenderWindowInteractorCallback(Widget,XtPointer,
XEvent *,Boolean *);
friend void vlXInteractiveRendererTimer(XtPointer,XtIntervalId *);
friend void vlXRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
protected:
Widget top;
......
......@@ -318,45 +318,42 @@ float *vlActor::GetZRange()
void vlActor::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlActor::GetClassName()))
vlObject::PrintSelf(os,indent);
// make sure our bounds are up to date
this->GetBounds();
os << indent << "Bounds: (" << this->Bounds[0] << ", "
<< this->Bounds[1] << ") (" << this->Bounds[2] << ") ("
<< this->Bounds[3] << ") (" << this->Bounds[4] << ") ("
<< this->Bounds[5] << ")\n";
os << indent << "Dragable: " << (this->Dragable ? "On\n" : "Off\n");
if ( this->Mapper )
{
vlObject::PrintSelf(os,indent);
// make sure our bounds are up to date
this->GetBounds();
os << indent << "Bounds: (" << this->Bounds[0] << ", "
<< this->Bounds[1] << ") (" << this->Bounds[2] << ") ("
<< this->Bounds[3] << ") (" << this->Bounds[4] << ") ("
<< this->Bounds[5] << ")\n";
os << indent << "Dragable: " << (this->Dragable ? "On\n" : "Off\n");
if ( this->Mapper )
{
os << indent << "Mapper:\n";
this->Mapper->PrintSelf(os,indent.GetNextIndent());
}
else
{
os << indent << "Mapper: (none)\n";
}
os << indent << "Orientation: (" << this->Orientation[0] << ", "
<< this->Orientation[1] << ", " << this->Orientation[2] << ")\n";
os << indent << "Origin: (" << this->Origin[0] << ", "
<< this->Origin[1] << ", " << this->Origin[2] << ")\n";
os << indent << "Pickable: " << (this->Pickable ? "On\n" : "Off\n");
os << indent << "Position: (" << this->Position[0] << ", "
<< this->Position[1] << ", " << this->Position[2] << ")\n";
if ( this->Property )
{
os << indent << "Property:\n";
this->Property->PrintSelf(os,indent.GetNextIndent());
}
else
{
os << indent << "Property: (none)\n";
}
os << indent << "Scale: (" << this->Scale[0] << ", "
<< this->Scale[1] << ", " << this->Scale[2] << ")\n";
os << indent << "Visibility: " << (this->Visibility ? "On\n" : "Off\n");
os << indent << "Mapper:\n";
this->Mapper->PrintSelf(os,indent.GetNextIndent());
}
else
{
os << indent << "Mapper: (none)\n";
}
os << indent << "Orientation: (" << this->Orientation[0] << ", "
<< this->Orientation[1] << ", " << this->Orientation[2] << ")\n";
os << indent << "Origin: (" << this->Origin[0] << ", "
<< this->Origin[1] << ", " << this->Origin[2] << ")\n";
os << indent << "Pickable: " << (this->Pickable ? "On\n" : "Off\n");
os << indent << "Position: (" << this->Position[0] << ", "
<< this->Position[1] << ", " << this->Position[2] << ")\n";
if ( this->Property )
{
os << indent << "Property:\n";
this->Property->PrintSelf(os,indent.GetNextIndent());
}
else
{
os << indent << "Property: (none)\n";
}
os << indent << "Scale: (" << this->Scale[0] << ", "
<< this->Scale[1] << ", " << this->Scale[2] << ")\n";
os << indent << "Visibility: " << (this->Visibility ? "On\n" : "Off\n");
}
......@@ -100,14 +100,11 @@ void vlAxes::Execute()
void vlAxes::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlAxes::GetClassName()))
{
vlPolySource::PrintSelf(os,indent);
vlPolySource::PrintSelf(os,indent);
os << indent << "Origin: (" << this->Origin[0] << ", "
<< this->Origin[1] << ", "
<< this->Origin[2] << ")\n";
os << indent << "Origin: (" << this->Origin[0] << ", "
<< this->Origin[1] << ", "
<< this->Origin[2] << ")\n";
os << indent << "Scale Factor: " << this->ScaleFactor << "\n";
}
os << indent << "Scale Factor: " << this->ScaleFactor << "\n";
}
......@@ -216,22 +216,15 @@ void vlBYUWriter::WriteTextureFile(int numPts)
void vlBYUWriter::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlBYUWriter::GetClassName()))
{
this->PrintWatchOn(); // watch for multiple inheritance
vlPolyFilter::_PrintSelf(os,indent);
vlWriter::PrintSelf(os,indent);
os << indent << "Geometry Filename: " << this->GeometryFilename << "\n";
os << indent << "Write Displacement: " << (this->WriteDisplacement ? "On\n" : "Off\n");
os << indent << "Displacement Filename: " << this->DisplacementFilename << "\n";
os << indent << "Write Scalar: " << (this->WriteScalar ? "On\n" : "Off\n");
os << indent << "Scalar Filename: " << this->ScalarFilename << "\n";
os << indent << "Write Texture: " << (this->WriteTexture ? "On\n" : "Off\n");
os << indent << "Texture Filename: " << this->TextureFilename << "\n";
this->PrintWatchOff(); // stop worrying about it now
}
vlPolyFilter::_PrintSelf(os,indent);
vlWriter::PrintSelf(os,indent);
os << indent << "Geometry Filename: " << this->GeometryFilename << "\n";
os << indent << "Write Displacement: " << (this->WriteDisplacement ? "On\n" : "Off\n");
os << indent << "Displacement Filename: " << this->DisplacementFilename << "\n";
os << indent << "Write Scalar: " << (this->WriteScalar ? "On\n" : "Off\n");
os << indent << "Scalar Filename: " << this->ScalarFilename << "\n";
os << indent << "Write Texture: " << (this->WriteTexture ? "On\n" : "Off\n");
os << indent << "Texture Filename: " << this->TextureFilename << "\n";
}
......@@ -21,11 +21,8 @@ vlBooleanTexture::vlBooleanTexture()
void vlBooleanTexture::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlBooleanTexture::GetClassName()))
{
vlObject::PrintSelf(os,indent);
vlObject::PrintSelf(os,indent);
os << indent << "Thickness: " << this->Thickness << "\n";
}
os << indent << "Thickness: " << this->Thickness << "\n";
}
......@@ -78,11 +78,8 @@ void vlBrownianPoints::Execute()
void vlBrownianPoints::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlBrownianPoints::GetClassName()))
{
vlDataSetToDataSetFilter::PrintSelf(os,indent);
vlDataSetToDataSetFilter::PrintSelf(os,indent);
os << indent << "Minimum Speed: " << this->MinimumSpeed << "\n";
os << indent << "Maximum Speed: " << this->MaximumSpeed << "\n";
}
os << indent << "Minimum Speed: " << this->MinimumSpeed << "\n";
os << indent << "Maximum Speed: " << this->MaximumSpeed << "\n";
}
......@@ -853,31 +853,28 @@ void vlCamera::SetViewPlaneNormal(float a[3])
void vlCamera::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlCamera::GetClassName()))
{
vlObject::PrintSelf(os,indent);
// update orientation
this->GetOrientation();
os << indent << "Clipping Range: (" << this->ClippingRange[0] << ", "
<< this->ClippingRange[2] << ")\n";
os << indent << "Distance: " << this->Distance << "\n";
os << indent << "Eye Angle: " << this->EyeAngle << "\n";
os << indent << "Focal Point: (" << this->FocalPoint[0] << ", "
<< this->FocalPoint[1] << ", " << this->FocalPoint[2] << ")\n";
os << indent << "Left Eye: " << this->LeftEye << "\n";
os << indent << "Orientation: (" << this->Orientation[0] << ", "
<< this->Orientation[1] << ", " << this->Orientation[2] << ")\n";
os << indent << "Position: (" << this->Position[0] << ", "
<< this->Position[1] << ", " << this->Position[2] << ")\n";
os << indent << "Switch: " << (this->Switch ? "On\n" : "Off\n");
os << indent << "Thickness: " << this->Thickness << "\n";
os << indent << "Twist: " << this->GetTwist() << "\n";
os << indent << "View Angle: " << this->ViewAngle << "\n";
os << indent << "View Plane Normal: (" << this->ViewPlaneNormal[0] << ", "
<< this->ViewPlaneNormal[1] << ", " << this->ViewPlaneNormal[2] << ")\n";
os << indent << "View Up: (" << this->ViewUp[0] << ", "
<< this->ViewUp[1] << ", " << this->ViewUp[2] << ")\n";
}
vlObject::PrintSelf(os,indent);
// update orientation
this->GetOrientation();
os << indent << "Clipping Range: (" << this->ClippingRange[0] << ", "
<< this->ClippingRange[2] << ")\n";
os << indent << "Distance: " << this->Distance << "\n";
os << indent << "Eye Angle: " << this->EyeAngle << "\n";
os << indent << "Focal Point: (" << this->FocalPoint[0] << ", "
<< this->FocalPoint[1] << ", " << this->FocalPoint[2] << ")\n";
os << indent << "Left Eye: " << this->LeftEye << "\n";
os << indent << "Orientation: (" << this->Orientation[0] << ", "
<< this->Orientation[1] << ", " << this->Orientation[2] << ")\n";
os << indent << "Position: (" << this->Position[0] << ", "
<< this->Position[1] << ", " << this->Position[2] << ")\n";
os << indent << "Switch: " << (this->Switch ? "On\n" : "Off\n");
os << indent << "Thickness: " << this->Thickness << "\n";
os << indent << "Twist: " << this->GetTwist() << "\n";
os << indent << "View Angle: " << this->ViewAngle << "\n";
os << indent << "View Plane Normal: (" << this->ViewPlaneNormal[0] << ", "
<< this->ViewPlaneNormal[1] << ", " << this->ViewPlaneNormal[2] << ")\n";
os << indent << "View Up: (" << this->ViewUp[0] << ", "
<< this->ViewUp[1] << ", " << this->ViewUp[2] << ")\n";
}
......@@ -220,12 +220,9 @@ void vlCleanPolyData::CreateDefaultLocator()
void vlCleanPolyData::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlCleanPolyData::GetClassName()))
{
vlPolyToPolyFilter::PrintSelf(os,indent);
vlPolyToPolyFilter::PrintSelf(os,indent);
os << indent << "Tolerance: " << this->Tolerance << "\n";
}
os << indent << "Tolerance: " << this->Tolerance << "\n";
}
......@@ -150,13 +150,10 @@ void vlConeSource::Execute()
void vlConeSource::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlConeSource::GetClassName()))
{
vlPolySource::PrintSelf(os,indent);
vlPolySource::PrintSelf(os,indent);
os << indent << "Resolution: " << this->Resolution << "\n";
os << indent << "Height: " << this->Height << "\n";
os << indent << "Radius: " << this->Radius << "\n";
os << indent << "Capping: " << (this->Capping ? "On\n" : "Off\n");
}
os << indent << "Resolution: " << this->Resolution << "\n";
os << indent << "Height: " << this->Height << "\n";
os << indent << "Radius: " << this->Radius << "\n";
os << indent << "Capping: " << (this->Capping ? "On\n" : "Off\n");
}
......@@ -331,26 +331,23 @@ void vlConnectivityFilter::DeleteSpecifiedRegion(int id)
void vlConnectivityFilter::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlConnectivityFilter::GetClassName()))
{
vlDataSetToUnstructuredGridFilter::PrintSelf(os,indent);
vlDataSetToUnstructuredGridFilter::PrintSelf(os,indent);
os << indent << "Extraction Mode: ";
switch (this->ExtractionMode)
{
case EXTRACT_POINT_SEEDED_REGIONS:
os << "(Extract point seeded regions)\n";
break;
case EXTRACT_CELL_SEEDED_REGIONS:
os << "(Extract cell seeded regions)\n";
break;
case EXTRACT_SPECIFIED_REGIONS:
os << "(Extract specified regions)\n";
break;
case EXTRACT_LARGEST_REGIONS:
os << "(Extract " << this->NumberOfRegionsToExtract << " largest regions)\n";
break;
}
os << indent << "Extraction Mode: ";
switch (this->ExtractionMode)
{
case EXTRACT_POINT_SEEDED_REGIONS:
os << "(Extract point seeded regions)\n";
break;
case EXTRACT_CELL_SEEDED_REGIONS:
os << "(Extract cell seeded regions)\n";
break;
case EXTRACT_SPECIFIED_REGIONS:
os << "(Extract specified regions)\n";
break;
case EXTRACT_LARGEST_REGIONS:
os << "(Extract " << this->NumberOfRegionsToExtract << " largest regions)\n";
break;
os << indent << "Color Regions: " << (this->ColorRegions ? "On\n" : "Off\n");
os << indent << "Maximum Recursion Depth: " << this->MaxRecursionDepth << "\n";
......
......@@ -156,16 +156,13 @@ void vlContourFilter::PrintSelf(ostream& os, vlIndent indent)
{
int i;
if (this->ShouldIPrint(vlContourFilter::GetClassName()))
{
vlDataSetToPolyFilter::PrintSelf(os,indent);
vlDataSetToPolyFilter::PrintSelf(os,indent);
os << indent << "Number Of Contours : " << this->NumberOfContours << "\n";
os << indent << "Contour Values: \n";
for ( i=0; i<this->NumberOfContours; i++)
{
os << indent << " Value " << i << ": " << this->Values[i] << "\n";
}
os << indent << "Number Of Contours : " << this->NumberOfContours << "\n";
os << indent << "Contour Values: \n";
for ( i=0; i<this->NumberOfContours; i++)
{
os << indent << " Value " << i << ": " << this->Values[i] << "\n";
}
}
......@@ -114,13 +114,10 @@ void vlCubeSource::Execute()
void vlCubeSource::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlCubeSource::GetClassName()))
{
vlPolySource::PrintSelf(os,indent);
vlPolySource::PrintSelf(os,indent);
os << indent << "X Length: " << this->XLength << "\n";
os << indent << "Y Length: " << this->YLength << "\n";
os << indent << "Z Length: " << this->ZLength << "\n";
}
os << indent << "X Length: " << this->XLength << "\n";
os << indent << "Y Length: " << this->YLength << "\n";
os << indent << "Z Length: " << this->ZLength << "\n";
}
......@@ -303,24 +303,21 @@ void vlCursor3D::Execute()
void vlCursor3D::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlCursor3D::GetClassName()))
{
vlPolySource::PrintSelf(os,indent);
os << indent << "ModelBounds: \n";
os << indent << " Xmin,Xmax: (" << this->ModelBounds[0] << ", " << this->ModelBounds[1] << ")\n";
os << indent << " Ymin,Ymax: (" << this->ModelBounds[2] << ", " << this->ModelBounds[3] << ")\n";
os << indent << " Zmin,Zmax: (" << this->ModelBounds[4] << ", " << this->ModelBounds[5] << ")\n";
os << indent << "Focal Point: (" << this->FocalPoint[0] << ", "
<< this->FocalPoint[1] << ", "
<< this->FocalPoint[2] << ")\n";
os << indent << "Outline: " << (this->Outline ? "On\n" : "Off\n");
os << indent << "Axes: " << (this->Axes ? "On\n" : "Off\n");
os << indent << "XShadows: " << (this->XShadows ? "On\n" : "Off\n");
os << indent << "YShadows: " << (this->YShadows ? "On\n" : "Off\n");
os << indent << "ZShadows: " << (this->ZShadows ? "On\n" : "Off\n");
os << indent << "Wrap: " << (this->Wrap ? "On\n" : "Off\n");
}
vlPolySource::PrintSelf(os,indent);
os << indent << "ModelBounds: \n";