Commit 7bc9fc3b authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Added documentation.

parent 56f0e259
......@@ -6,8 +6,6 @@
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. 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.
......@@ -39,26 +37,40 @@ public:
char *GetClassName() {return "vlBYUWriter";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Specify the name of the geometry file to write.
vlSetStringMacro(GeometryFilename);
vlGetStringMacro(GeometryFilename);
// Description:
// Specify the name of the displacement file to write.
vlSetStringMacro(DisplacementFilename);
vlGetStringMacro(DisplacementFilename);
// Description:
// Specify the name of the scalar file to write.
vlSetStringMacro(ScalarFilename);
vlGetStringMacro(ScalarFilename);
// Description:
// Specify the name of the texture file to write.
vlSetStringMacro(TextureFilename);
vlGetStringMacro(TextureFilename);
// Description:
// Turn on/off writing the displacement file.
vlSetMacro(WriteDisplacement,int);
vlGetMacro(WriteDisplacement,int);
vlBooleanMacro(WriteDisplacement,int);
// Description:
// Turn on/off writing the scalar file.
vlSetMacro(WriteScalar,int);
vlGetMacro(WriteScalar,int);
vlBooleanMacro(WriteScalar,int);
// Description:
// Turn on/off writing the texture file.
vlSetMacro(WriteTexture,int);
vlGetMacro(WriteTexture,int);
vlBooleanMacro(WriteTexture,int);
......
......@@ -6,8 +6,6 @@
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. 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.
......@@ -41,9 +39,13 @@ public:
char *GetClassName() {return "vlSTLWriter";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Specify the name of the file to write.
vlSetStringMacro(Filename);
vlGetStringMacro(Filename);
// Description:
// Specify type of file to write (ascii or binary).
vlSetClampMacro(WriteMode,int,STL_ASCII,STL_BINARY);
vlGetMacro(WriteMode,int);
......
......@@ -13,6 +13,11 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
// .NAME vlVoxelWriter - write out 0/1 voxel data from vlVoxelModeller
// .SECTION Description
// vlVoxelWriter writes a binary 0/1 voxel file. vlVoxelWriter writes only
// structured points data.
#ifndef __vlVoxelWriter_h
#define __vlVoxelWriter_h
......@@ -28,6 +33,8 @@ public:
char *GetClassName() {return "vlVoxelWriter";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Specify name of file to write.
vlSetStringMacro(Filename);
vlGetStringMacro(Filename);
......
......@@ -6,8 +6,6 @@
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. 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.
......@@ -15,9 +13,10 @@ without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Abstract class to write data to file(s)
//
// .NAME vlWriter - abstract class to write data to file(s)
// .SECTION Description
// vlWriter is an abstract class for mapper objects that write their data
// to disk (or into a communications port).
#ifndef __vlWriter_hh
#define __vlWriter_hh
......@@ -30,14 +29,18 @@ public:
char *GetClassName() {return "vlWriter";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Write data to disk (or port).
virtual void Write() = 0;
void SetStartWrite(void (*f)());
void SetEndWrite(void (*f)());
void SetStartWrite(void (*f)(void *), void *arg);
void SetEndWrite(void (*f)(void *), void *arg);
protected:
void (*StartWrite)();
void (*EndWrite)();
void (*StartWrite)(void *);
void *StartWriteArg;
void (*EndWrite)(void *);
void *EndWriteArg;
};
......
......@@ -6,8 +6,6 @@
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. 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.
......@@ -17,6 +15,9 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
#include "BYUWrite.hh"
// Description:
// Create object so that it writes displacement, scalar, and texture files
// (if data is available).
vlBYUWriter::vlBYUWriter()
{
this->GeometryFilename = NULL;
......@@ -37,27 +38,8 @@ vlBYUWriter::~vlBYUWriter()
if ( this->TextureFilename ) delete [] this->TextureFilename;
}
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
}
}
// Description:
// Write out data in MOVIE.BYU format.
void vlBYUWriter::Write()
{
FILE *geomFp;
......@@ -217,3 +199,25 @@ void vlBYUWriter::WriteTextureFile(int numPts)
vlDebugMacro(<<"Wrote " << numPts << " texture coordinates");
}
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
}
}
......@@ -34,6 +34,8 @@ vlRenderMaster::vlRenderMaster()
{
}
// Description:
// Create named renderer type.
vlRenderWindow *vlRenderMaster::MakeRenderWindow(char *type)
{
......@@ -68,6 +70,9 @@ vlRenderWindow *vlRenderMaster::MakeRenderWindow(char *type)
return (vlRenderWindow *)NULL;
}
// Description:
// Create renderer based on environment variable VL_RENDERER. If VL_RENDERER
// not defined, then use default renderer kglr.
vlRenderWindow *vlRenderMaster::MakeRenderWindow(void)
{
char *temp;
......@@ -78,3 +83,11 @@ vlRenderWindow *vlRenderMaster::MakeRenderWindow(void)
return (this->MakeRenderWindow(temp));
}
void vlRenderMaster::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlRenderMaster::GetClassName()))
{
vlObject::PrintSelf(os,indent);
}
}
......@@ -6,8 +6,6 @@
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. 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.
......@@ -30,20 +28,6 @@ vlSTLWriter::~vlSTLWriter()
if ( this->Filename ) delete [] this->Filename;
}
void vlSTLWriter::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlSTLWriter::GetClassName()))
{
this->PrintWatchOn(); // watch for multiple inheritance
vlPolyFilter::PrintSelf(os,indent);
vlWriter::PrintSelf(os,indent);
os << indent << "Filename: " << this->Filename << "\n";
this->PrintWatchOff(); // stop worrying about it now
}
}
void vlSTLWriter::Write()
{
vlPoints *pts;
......@@ -64,8 +48,10 @@ void vlSTLWriter::Write()
return;
}
this->StartWrite(this->StartWriteArg);
if ( this->WriteMode == STL_BINARY ) this->WriteBinarySTL(pts,polys);
else this->WriteAsciiSTL(pts,polys);
this->EndWrite(this->EndWriteArg);
}
static char header[]="Visualization Library generated SLA File ";
......@@ -165,3 +151,17 @@ void vlSTLWriter::WriteBinarySTL(vlPoints *pts, vlCellArray *polys)
}
}
void vlSTLWriter::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlSTLWriter::GetClassName()))
{
this->PrintWatchOn(); // watch for multiple inheritance
vlPolyFilter::PrintSelf(os,indent);
vlWriter::PrintSelf(os,indent);
os << indent << "Filename: " << this->Filename << "\n";
this->PrintWatchOff(); // stop worrying about it now
}
}
......@@ -26,21 +26,8 @@ vlVoxelWriter::~vlVoxelWriter()
if ( this->Filename ) delete [] this->Filename;
}
void vlVoxelWriter::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlVoxelWriter::GetClassName()))
{
this->PrintWatchOn(); // watch for multiple inheritance
vlStructuredPointsFilter::PrintSelf(os,indent);
vlWriter::PrintSelf(os,indent);
os << indent << "Filename: " << this->Filename << "\n";
this->PrintWatchOff(); // stop worrying about it now
}
}
// Description:
// Write voxel data out.
void vlVoxelWriter::Write()
{
FILE *fp;
......@@ -115,3 +102,18 @@ void vlVoxelWriter::Write()
fclose(fp);
}
void vlVoxelWriter::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlVoxelWriter::GetClassName()))
{
this->PrintWatchOn(); // watch for multiple inheritance
vlStructuredPointsFilter::PrintSelf(os,indent);
vlWriter::PrintSelf(os,indent);
os << indent << "Filename: " << this->Filename << "\n";
this->PrintWatchOff(); // stop worrying about it now
}
}
......@@ -6,8 +6,6 @@
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. 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.
......@@ -17,20 +15,28 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
#include "Writer.hh"
void vlWriter::SetStartWrite(void (*f)())
// Description:
// Specify a function to be called before data is written.
// Function will be called with argument provided.
void vlWriter::SetStartWrite(void (*f)(void *), void *arg)
{
if ( f != this->StartWrite )
{
this->StartWrite = f;
this->StartWriteArg = arg;
this->Modified();
}
}
void vlWriter::SetEndWrite(void (*f)())
// Description:
// Specify a function to be called after data is written.
// Function will be called with argument provided.
void vlWriter::SetEndWrite(void (*f)(void *), void *arg)
{
if ( f != this->EndWrite )
{
this->EndWrite = f;
this->EndWriteArg = arg;
this->Modified();
}
}
......
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