Commit 862e6ce7 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Added documentation.

parent e49d7756
......@@ -19,10 +19,10 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
// resolution of this object, different representations are created.
// If resolution=0 a line is created; if resolution=1, a single
// triangle is created; if resolution=2, two crossed triangles are
// created. For resolution > 2, a 3D cone (with resolution sides) is
// created. It is also possible to control whether the bottom of the
// cone is capped with a (resolution-sided) polygon, and to specify
// the height and radius of the cone.
// created. For resolution > 2, a 3D cone (with resolution number of
// sides) is created. It is also possible to control whether the bottom
// of the cone is capped with a (resolution-sided) polygon, and to
// specify the height and radius of the cone.
#ifndef __vlConeSource_h
#define __vlConeSource_h
......@@ -38,15 +38,23 @@ public:
char *GetClassName() {return "vlConeSource";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Set the height of the cone.
vlSetClampMacro(Height,float,0.0,LARGE_FLOAT)
vlGetMacro(Height,float);
// Description:
// Set the radius of the cone.
vlSetClampMacro(Radius,float,0.0,LARGE_FLOAT)
vlGetMacro(Radius,float);
// Description:
// Set the number of facets used to represent cone.
vlSetClampMacro(Resolution,int,0,MAX_RESOLUTION)
vlGetMacro(Resolution,int);
// Description:
// Turn on/off whether to cap cone with polygon.
vlSetMacro(Capping,int);
vlGetMacro(Capping,int);
vlBooleanMacro(Capping,int);
......
......@@ -31,12 +31,18 @@ public:
char *GetClassName() {return "vlCubeSource";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Set the length of the cube in the x-direction.
vlSetClampMacro(XLength,float,0.0,LARGE_FLOAT);
vlGetMacro(XLength,float);
// Description:
// Set the length of the cube in the y-direction.
vlSetClampMacro(YLength,float,0.0,LARGE_FLOAT);
vlGetMacro(YLength,float);
// Description:
// Set the length of the cube in the z-direction.
vlSetClampMacro(ZLength,float,0.0,LARGE_FLOAT);
vlGetMacro(ZLength,float);
......
......@@ -34,15 +34,23 @@ public:
char *GetClassName() {return "vlCylinderSource";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Set the height of the cylinder.
vlSetClampMacro(Height,float,0.0,LARGE_FLOAT)
vlGetMacro(Height,float);
// Description:
// Set the radius of the cylinder.
vlSetClampMacro(Radius,float,0.0,LARGE_FLOAT)
vlGetMacro(Radius,float);
// Description:
// Set the number of facets used to define cylinder.
vlSetClampMacro(Resolution,int,0,MAX_RESOLUTION)
vlGetMacro(Resolution,int);
// Description:
// Turn on/off whether to cap cylinder with polygons.
vlSetMacro(Capping,int);
vlGetMacro(Capping,int);
vlBooleanMacro(Capping,int);
......
......@@ -36,15 +36,23 @@ public:
char *GetClassName() {return "vlDiskSource";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Specify radius of hole in disc.
vlSetClampMacro(InnerRadius,float,0.0,LARGE_FLOAT)
vlGetMacro(InnerRadius,float);
// Description:
// Specify radius of disc.
vlSetClampMacro(OuterRadius,float,0.0,LARGE_FLOAT)
vlGetMacro(OuterRadius,float);
// Description:
// Set the number of points in radius direction.
vlSetClampMacro(RadialResolution,int,1,LARGE_INTEGER)
vlGetMacro(RadialResolution,int);
// Description:
// Set the number of points in circumferential direction.
vlSetClampMacro(CircumferentialResolution,int,3,LARGE_INTEGER)
vlGetMacro(CircumferentialResolution,int);
......
......@@ -33,12 +33,18 @@ public:
char *GetClassName() {return "vlLineSource";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Set position of first end point.
vlSetVector3Macro(Pt1,float);
vlGetVectorMacro(Pt1,float);
// Description:
// Set position of other end point.
vlSetVector3Macro(Pt2,float);
vlGetVectorMacro(Pt2,float);
// Description:
// Divide line into resolution number of pieces.
vlSetClampMacro(Resolution,int,1,LARGE_INTEGER);
vlGetMacro(Resolution,int);
......
......@@ -29,10 +29,11 @@ class vlPlaneSource : public vlPolySource
public:
vlPlaneSource() : XRes(1), YRes(1) {};
vlPlaneSource(const int xR, const int yR) {XRes=xR; YRes=yR;};
void PrintSelf(ostream& os, vlIndent indent);
char *GetClassName() {return "vlPlaneSource";};
void SetResolution(const int xR, const int yR);
void GetResolution(int& xR,int& yR) {xR=this->XRes; yR=this->YRes;};
char *GetClassName() {return "vlPlaneSource";};
void PrintSelf(ostream& os, vlIndent indent);
protected:
void Execute();
......
......@@ -18,7 +18,7 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
// vlPointSource is a source object that creates a user-specified number
// of points within a specified radius about a specified center point.
// The location of the points is random within the sphere.
//
#ifndef __vlPointSource_h
#define __vlPointSource_h
......@@ -31,12 +31,18 @@ public:
char *GetClassName() {return "vlPointSource";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Set the number of points to generate.
vlSetClampMacro(NumberOfPoints,int,1,LARGE_INTEGER);
vlGetMacro(NumberOfPoints,int);
// Description:
// Set the center of the point cloud.
vlSetVector3Macro(Center,float);
vlGetVectorMacro(Center,float);
// Description:
// Set the radius of the point cloud.
vlSetClampMacro(Radius,float,0.0,LARGE_FLOAT);
vlGetMacro(Radius,float);
......
......@@ -13,9 +13,10 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Abstract class for specifying behavior of data sources
//
// .NAME vlPolySource - abstract class whose subclasses generate polygonal data
// .SECTION Description
// vlPolySource is an abstract class whose subclasses generate polygonal data.
#ifndef __vlPolySource_h
#define __vlPolySource_h
......
......@@ -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 for specifying behavior of structured grid sources
//
// .NAME vlStructuredGridSource - Abstract class whose subclasses generates structured grid data
// .SECTION Description
// vlStructuredGridSource is an abstract class whose subclasses generate structured grid data.
#ifndef __vlStructuredGridSource_h
#define __vlStructuredGridSource_h
......
......@@ -13,9 +13,13 @@ written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Abstract class for specifying behavior of data sources
//
// .NAME vlSource - abstract class specifies interface of data sources
// .SECTION Description
// vlSource is an abstract object that specifies behavior and interface
// of source objects. Source objects are objects that begin visualization
// pipeline. Sources include readers (read data from file or communications
// port) and procedural sources (generate data programatically).
#ifndef __vlSource_h
#define __vlSource_h
......@@ -28,14 +32,21 @@ public:
~vlSource() {};
char *GetClassName() {return "vlSource";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Bring object up-to-date before execution. Update() checks modified
// time against last execution time, and re-executes object if necessary.
virtual void Update();
void SetStartMethod(void (*f)());
void SetEndMethod(void (*f)());
void SetStartMethod(void (*f)(void *), void *arg);
void SetEndMethod(void (*f)(void *), void *arg);
protected:
virtual void Execute();
void (*StartMethod)();
void (*EndMethod)();
void (*StartMethod)(void *arg);
void *StartMethodArg;
void (*EndMethod)(void *arg);
void *EndMethodArg;
vlTimeStamp ExecuteTime;
};
......
......@@ -35,18 +35,28 @@ public:
char *GetClassName() {return "vlSphereSource";};
void PrintSelf(ostream& os, vlIndent indent);
// Description:
// Set radius of sphere.
vlSetClampMacro(Radius,float,0.0,LARGE_FLOAT);
vlGetMacro(Radius,float);
// Description:
// Set the number of points in the longitude direction.
vlSetClampMacro(ThetaResolution,int,4,MAX_RESOLUTION);
vlGetMacro(ThetaResolution,int);
// Description:
// Set the number of points in the latitude direction.
vlSetClampMacro(PhiResolution,int,4,MAX_RESOLUTION);
vlGetMacro(PhiResolution,int);
// Description:
// Set the maximum longitude angle.
vlSetClampMacro(Theta,float,0.0,360.0);
vlGetMacro(Theta,float);
// Description:
// Set the maximum latitude angle (0 is at north pole).
vlSetClampMacro(Phi,float,0.0,180.0);
vlGetMacro(Phi,float);
......
......@@ -4,7 +4,6 @@
Program: Visualization Library
Module: Source.cc
Language: C++
Date: $Date$
Version: $Revision$
......@@ -28,27 +27,33 @@ void vlSource::Update()
// Make sure virtual getMTime method is called since subclasses will overload
if ( this->GetMTime() > this->ExecuteTime )
{
if ( this->StartMethod ) (*this->StartMethod)();
if ( this->StartMethod ) (*this->StartMethod)(this->StartMethodArg);
this->Execute();
this->ExecuteTime.Modified();
if ( this->EndMethod ) (*this->EndMethod)();
if ( this->EndMethod ) (*this->EndMethod)(this->EndMethodArg);
}
}
void vlSource::SetStartMethod(void (*f)())
// Description:
// Specify function to be called before source executes.
void vlSource::SetStartMethod(void (*f)(void *), void *arg)
{
if ( f != this->StartMethod )
if ( f != this->StartMethod || arg != this->StartMethodArg )
{
this->StartMethod = f;
this->StartMethodArg = arg;
this->Modified();
}
}
void vlSource::SetEndMethod(void (*f)())
// Description:
// Specify function to be called after source executes.
void vlSource::SetEndMethod(void (*f)(void *), void *arg)
{
if ( f != this->EndMethod )
if ( f != this->EndMethod || arg != this->EndMethodArg )
{
this->EndMethod = f;
this->EndMethodArg = 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