Commit 000b0291 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Added documentation.

parent 7bc9fc3b
......@@ -13,6 +13,11 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlSbrCamera - HP starbase camera
// .SECTION Description
// vlSbrCamera is a concrete implementation of the abstract class vlCamera.
// vlSbrCamera interfaces to the Hewlett-Packard starbase rendering library.
#ifndef __vlSbrCamera_hh
#define __vlSbrCamera_hh
......@@ -24,9 +29,10 @@ class vlSbrRenderer;
class vlSbrCamera : public vlCamera
{
public:
virtual char *GetClassName() {return "vlSbrCamera";};
void Render(vlRenderer *ren); // overides base
void Render(vlSbrRenderer *ren); // real function
char *GetClassName() {return "vlSbrCamera";};
void Render(vlRenderer *ren);
void Render(vlSbrRenderer *ren);
};
......
......@@ -13,6 +13,11 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlSbrLight - HP starbase light
// .SECTION Description
// vlSbrLight is a concrete implementation of the abstract class vlLight.
// vlSbrLight interfaces to the Hewlett-Packard starbase rendering library.
#ifndef __vlSbrLight_hh
#define __vlSbrLight_hh
......@@ -26,8 +31,9 @@ protected:
public:
char *GetClassName() {return "vlSbrLight";};
void Render(vlRenderer *ren,int light_index); // overides base
void Render(vlSbrRenderer *ren,int light_index); // real function
void Render(vlRenderer *ren,int light_index);
void Render(vlSbrRenderer *ren,int light_index);
};
......
......@@ -13,6 +13,11 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlSbrProperty - HP starbase property
// .SECTION Description
// vlSbrProperty is a concrete implementation of the abstract class vlProperty.
// vlSbrProperty interfaces to the Hewlett-Packard starbase rendering library.
#ifndef __vlSbrProperty_hh
#define __vlSbrProperty_hh
......@@ -24,7 +29,8 @@ class vlSbrProperty : public vlProperty
{
public:
char *GetClassName() {return "vlSbrProperty";};
void Render(vlRenderer *ren); // overides base
void Render(vlRenderer *ren);
void Render(vlSbrRenderer *ren);
};
......
......@@ -13,6 +13,12 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlSbrRenderer - HP starbase renderer
// .SECTION Description
// vlSbrRenderer is a concrete implementation of the abstract class
// vlRenderer. vlSbrRenderer interfaces to the Hewlett-Packard starbase
// graphics library.
#ifndef __vlSbrRenderer_hh
#define __vlSbrRenderer_hh
......@@ -24,17 +30,12 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlSbrRenderer : public vlRenderer
{
protected:
int NumberOfLightsBound;
int LightSwitch;
int Fd;
public:
public:
vlSbrRenderer();
void Render(void); // overides base
char *GetClassName() {return "vlSbrRenderer";};
void PrintSelf(ostream& os, vlIndent indent);
void Render(void);
vlGeometryPrimitive *GetPrimitive(char *);
void ClearLights(void);
int UpdateActors(void);
......@@ -42,6 +43,12 @@ class vlSbrRenderer : public vlRenderer
int UpdateLights(void);
vlGetMacro(Fd,int);
vlGetMacro(LightSwitch,int);
protected:
int NumberOfLightsBound;
int LightSwitch;
int Fd;
};
#endif
......@@ -13,6 +13,12 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlSbrRenderWindow - HP starbase rendering window
// .SECTION Description
// vlSbrRenderWindow is a concrete implementation of the abstract class
// vlRenderWindow. vlSbrRenderer interfaces to the Hewlett-Packard starbase
// graphics library.
#ifndef __vlSbrRenderWindow_hh
#define __vlSbrRenderWindow_hh
......@@ -24,16 +30,6 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlSbrRenderWindow : public vlRenderWindow
{
protected:
Window WindowId;
Window NextWindowId;
Display *DisplayId;
Colormap ColorMap;
int Fd;
int Buffer;
int ScreenSize[2];
int OwnWindow;
public:
vlSbrRenderWindow();
char *GetClassName() {return "vlSbrRenderWindow";};
......@@ -68,6 +64,17 @@ public:
Visual *GetDesiredVisual();
int CreateXWindow(Display *,int x,int y,int w,int h,int depth,
char name[80]);
protected:
Window WindowId;
Window NextWindowId;
Display *DisplayId;
Colormap ColorMap;
int Fd;
int Buffer;
int ScreenSize[2];
int OwnWindow;
};
#endif
......@@ -20,14 +20,15 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
static float xform[4][4] = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1};
// typecast if neccessary
// Description:
// Implement base class method.
void vlSbrCamera::Render(vlRenderer *ren)
{
this->Render((vlSbrRenderer *)ren);
}
// set the appropriate attributes in Sbr for this camera
//
// Description:
// Actual camera render method.
void vlSbrCamera::Render(vlSbrRenderer *ren)
{
float aspect[3];
......
......@@ -17,13 +17,15 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#include "SbrRen.hh"
#include "SbrLgt.hh"
// typecast if neccessary
// Description:
// Implement base class method.
void vlSbrLight::Render(vlRenderer *ren,int light_index)
{
this->Render((vlSbrRenderer *)ren,light_index);
}
// set the appropriate attributes in Sbr for this light
// Description:
// Actual light render method.
void vlSbrLight::Render(vlSbrRenderer *ren,int light_index)
{
float dx, dy, dz;
......
......@@ -19,13 +19,15 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#include "SbrPrim.hh"
#include "starbase.c.h"
// typecast if neccessary
// Description:
// Implement base class method.
void vlSbrProperty::Render(vlRenderer *ren)
{
this->Render((vlSbrRenderer *)ren);
}
// set the appropriate attributes in Sbr for this property
// Description:
// Actual property render method.
void vlSbrProperty::Render(vlSbrRenderer *ren)
{
int fd;
......
......@@ -43,6 +43,8 @@ vlSbrRenderer::vlSbrRenderer()
{
}
// Description:
// Ask actors to build and draw themselves.
int vlSbrRenderer::UpdateActors()
{
vlActor *anActor;
......@@ -80,6 +82,8 @@ int vlSbrRenderer::UpdateActors()
return count;
}
// Description:
// Ask active camera to load its view matrix.
int vlSbrRenderer::UpdateCameras ()
{
// update the viewing transformation
......@@ -89,6 +93,9 @@ int vlSbrRenderer::UpdateCameras ()
return 1;
}
// Description:
// Internal method temporarily removes lights before reloading them
// into graphics pipeline.
void vlSbrRenderer::ClearLights (void)
{
light_ambient(this->Fd, this->Ambient[0],
......@@ -105,6 +112,8 @@ void vlSbrRenderer::ClearLights (void)
this->NumberOfLightsBound = 1;
}
// Description:
// Ask lights to load themselves into graphics pipeline.
int vlSbrRenderer::UpdateLights ()
{
vlLight *light;
......@@ -145,6 +154,8 @@ int vlSbrRenderer::UpdateLights ()
return count;
}
// Description:
// Concrete starbase render method.
void vlSbrRenderer::Render(void)
{
vlSbrRenderWindow *temp;
......@@ -160,6 +171,8 @@ void vlSbrRenderer::Render(void)
this->DoActors();
}
// Description:
// Create particular type of starbase geometry primitive.
vlGeometryPrimitive *vlSbrRenderer::GetPrimitive(char *type)
{
vlGeometryPrimitive *prim;
......
......@@ -27,6 +27,19 @@ static char *lights[MAX_LIGHTS] =
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
vlSbrRenderWindow::vlSbrRenderWindow()
{
this->Fd = -1;
this->DisplayId = (Display *)NULL;
this->WindowId = (Window)NULL;
this->NextWindowId = (Window)NULL;
this->ColorMap = (Colormap)NULL;
strcpy(this->Name,"Visualization Library - Starbase");
}
// Description:
// Create a starbase-specific actor.
vlActor *vlSbrRenderWindow::MakeActor()
{
vlActor *actor;
......@@ -39,6 +52,8 @@ vlActor *vlSbrRenderWindow::MakeActor()
return (vlActor *)actor;
}
// Description:
// Create a starbase specific light.
vlLight *vlSbrRenderWindow::MakeLight()
{
vlSbrLight *light;
......@@ -47,6 +62,8 @@ vlLight *vlSbrRenderWindow::MakeLight()
return (vlLight *)light;
}
// Description:
// Create a starbase specific renderer.
vlRenderer *vlSbrRenderWindow::MakeRenderer()
{
vlSbrRenderer *ren;
......@@ -59,6 +76,8 @@ vlRenderer *vlSbrRenderWindow::MakeRenderer()
return (vlRenderer *)ren;
}
// Description:
// Create a starbase specific camera.
vlCamera *vlSbrRenderWindow::MakeCamera()
{
vlSbrCamera *camera;
......@@ -67,17 +86,8 @@ vlCamera *vlSbrRenderWindow::MakeCamera()
return (vlCamera *)camera;
}
vlSbrRenderWindow::vlSbrRenderWindow()
{
this->Fd = -1;
this->DisplayId = (Display *)NULL;
this->WindowId = (Window)NULL;
this->NextWindowId = (Window)NULL;
this->ColorMap = (Colormap)0;
strcpy(this->Name,"Visualization Library - Starbase");
}
// Description:
// Begin the rendering process.
void vlSbrRenderWindow::Start(void)
{
// if the renderer has not been initialized, do so now
......@@ -87,6 +97,8 @@ void vlSbrRenderWindow::Start(void)
flush_matrices(this->Fd);
}
// Description:
// End the rendering process and display the image.
void vlSbrRenderWindow::Frame(void)
{
// flush and display the buffer
......@@ -301,6 +313,8 @@ int vlSbrRenderWindow::GetDesiredDepth ()
return depth;
}
// Description:
// Obtain a colormap from windowing system.
Colormap vlSbrRenderWindow::GetDesiredColormap ()
{
XVisualInfo *pVisInfo, visInfo;
......@@ -389,6 +403,8 @@ Colormap vlSbrRenderWindow::GetDesiredColormap ()
}
// Description:
// Get a visual from the windowing system.
Visual *vlSbrRenderWindow::GetDesiredVisual ()
{
Visual *vis;
......@@ -410,7 +426,8 @@ Visual *vlSbrRenderWindow::GetDesiredVisual ()
}
// create a window for starbase output
// Description:
// Create a window for starbase output.
int vlSbrRenderWindow::CreateXWindow(Display *dpy,int xpos,int ypos,
int width,int height,int depth,
char name[80])
......@@ -556,6 +573,8 @@ int vlSbrRenderWindow::CreateXWindow(Display *dpy,int xpos,int ypos,
return 1;
}
// Description:
// Initialize the rendering window.
void vlSbrRenderWindow::WindowInitialize (void)
{
char *device, *driver, *getenv(), *str;
......@@ -743,9 +762,11 @@ void vlSbrRenderWindow::WindowInitialize (void)
this->Mapped = 1;
}
// Description:
// Initialize the rendering window.
void vlSbrRenderWindow::Initialize (void)
{
// make sure we haven't already been initialiozed
// make sure we haven't already been initialized
if (this->Fd != -1) return;
// now initialize the window
......@@ -753,6 +774,8 @@ void vlSbrRenderWindow::Initialize (void)
}
// Description:
// Change the window to fill the entire screen.
void vlSbrRenderWindow::SetFullScreen(int arg)
{
int *temp;
......@@ -810,6 +833,8 @@ void vlSbrRenderWindow::SetFullScreen(int arg)
this->Modified();
}
// Description:
// Get the size of the window in screen coordinates.
int *vlSbrRenderWindow::GetScreenSize()
{
this->ScreenSize[0] =
......@@ -820,6 +845,8 @@ int *vlSbrRenderWindow::GetScreenSize()
return this->ScreenSize;
}
// Description:
// Set the preferred window size to full screen.
void vlSbrRenderWindow::PrefFullScreen()
{
int *size;
......@@ -837,6 +864,8 @@ void vlSbrRenderWindow::PrefFullScreen()
}
// Description:
// Resize the window.
void vlSbrRenderWindow::WindowRemap()
{
// close the starbase window
......@@ -860,6 +889,8 @@ void vlSbrRenderWindow::WindowRemap()
}
// Description:
// Get the current size of the window.
int *vlSbrRenderWindow::GetSize(void)
{
XWindowAttributes attribs;
......@@ -880,6 +911,8 @@ int *vlSbrRenderWindow::GetSize(void)
return this->Size;
}
// Description:
// Get the position in screen coordinates of the window.
int *vlSbrRenderWindow::GetPosition(void)
{
XWindowAttributes attribs;
......@@ -904,6 +937,8 @@ int *vlSbrRenderWindow::GetPosition(void)
return this->Position;
}
// Description:
// Specify the size of the rendering window.
void vlSbrRenderWindow::SetSize(int x,int y)
{
// if we arent mappen then just set the ivars
......@@ -930,6 +965,8 @@ void vlSbrRenderWindow::SetSize(int x,int y)
}
// Description:
// Get the window display id.
Display *vlSbrRenderWindow::GetDisplayId()
{
vlDebugMacro(<< "Returning DisplayId of " << (void *)this->DisplayId << "\n");
......@@ -937,6 +974,8 @@ Display *vlSbrRenderWindow::GetDisplayId()
return this->DisplayId;
}
// Description:
// Get the window id.
Window vlSbrRenderWindow::GetWindowId()
{
vlDebugMacro(<< "Returning WindowId of " << (void *)this->WindowId << "\n");
......@@ -944,6 +983,8 @@ Window vlSbrRenderWindow::GetWindowId()
return this->WindowId;
}
// Description:
// Set the window id to a pre-existing window.
void vlSbrRenderWindow::SetWindowId(Window arg)
{
vlDebugMacro(<< "Setting WindowId to " << (void *)arg << "\n");
......@@ -951,6 +992,8 @@ void vlSbrRenderWindow::SetWindowId(Window arg)
this->WindowId = arg;
}
// Description:
// Set the display id of the window to a pre-exisiting display id.
void vlSbrRenderWindow::SetDisplayId(Display *arg)
{
vlDebugMacro(<< "Setting DisplayId to " << (void *)arg << "\n");
......
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