Commit 8e9309fd authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: New GetVectorMacro().

parent 1ecec210
......@@ -61,7 +61,7 @@ class vlActor : public vlObject
// Description:
// Get the position of the actor.
vlGetVectorMacro(Position,float);
vlGetVectorMacro(Position,float,3);
// Description:
// Sets the posiiton of the actor.
vlSetVector3Macro(Position,float);
......@@ -71,7 +71,7 @@ class vlActor : public vlObject
// Description:
// Get the origin of the actor. This is the point about which all
// rotations take place.
vlGetVectorMacro(Origin,float);
vlGetVectorMacro(Origin,float,3);
// Description:
// Set the origin of the actor. This is the point about which all
// rotations take place.
......@@ -80,7 +80,7 @@ class vlActor : public vlObject
// Description:
// Get the scale of the actor. Scaling in performed independently on the
// X,Y and Z axis.
vlGetVectorMacro(Scale,float);
vlGetVectorMacro(Scale,float,3);
// Description:
// Set the scale of the actor. Scaling in performed independently on the
// X,Y and Z axis.
......
......@@ -39,19 +39,19 @@ class vlCamera : public vlObject
void SetPosition(float x, float y, float z);
void SetPosition(float a[3]);
vlGetVectorMacro(Position,float);
vlGetVectorMacro(Position,float,3);
void SetFocalPoint(float x, float y, float z);
void SetFocalPoint(float a[3]);
vlGetVectorMacro(FocalPoint,float);
vlGetVectorMacro(FocalPoint,float,3);
void SetViewUp(float vx, float vy, float vz);
void SetViewUp(float a[3]);
vlGetVectorMacro(ViewUp,float);
vlGetVectorMacro(ViewUp,float,3);
void SetClippingRange(float front, float back);
void SetClippingRange(float a[2]);
vlGetVectorMacro(ClippingRange,float);
vlGetVectorMacro(ClippingRange,float,2);
// Description:
// Abstract interface to renderer. Each concrete subclass of vlCamera
......@@ -100,7 +100,7 @@ class vlCamera : public vlObject
void CalcDistance();
void CalcPerspectiveTransform();
vlMatrix4x4 &GetPerspectiveTransform();
vlGetVectorMacro(ViewPlaneNormal,float);
vlGetVectorMacro(ViewPlaneNormal,float,3);
void SetRoll(float);
void Roll(float);
......
......@@ -42,17 +42,17 @@ public:
// Description:
// Set the color of the light.
vlSetVector3Macro(Color,float);
vlGetVectorMacro(Color,float);
vlGetVectorMacro(Color,float,3);
// Description:
// Set the position of the light.
vlSetVector3Macro(Position,float);
vlGetVectorMacro(Position,float);
vlGetVectorMacro(Position,float,3);
// Description:
// Set the point at which the light is shining.
vlSetVector3Macro(FocalPoint,float);
vlGetVectorMacro(FocalPoint,float);
vlGetVectorMacro(FocalPoint,float,3);
// Description:
// Set the brightness of the light.
......
......@@ -42,22 +42,22 @@ public:
void SetTableRange(float r[2]); // can't use macro 'cause don't want modified
void SetTableRange(float min, float max);
vlGetVectorMacro(TableRange,float);
vlGetVectorMacro(TableRange,float,2);
// Description:
// Set the range in hue (using automatic generation).
vlSetVector2Macro(HueRange,float);
vlGetVectorMacro(HueRange,float);
vlGetVectorMacro(HueRange,float,2);
// Description:
// Set the range in saturation (using automatic generation).
vlSetVector2Macro(SaturationRange,float);
vlGetVectorMacro(SaturationRange,float);
vlGetVectorMacro(SaturationRange,float,2);
// Description:
// Set the range in value (using automatic generation).
vlSetVector2Macro(ValueRange,float);
vlGetVectorMacro(ValueRange,float);
vlGetVectorMacro(ValueRange,float,2);
float *MapValue(float v);
void SetTableValue (int indx, float rgb[3]);
......
......@@ -68,8 +68,8 @@ public:
// Description:
// Specify range in terms of (smin,smax) through which to map scalars
// into lookup table.
vlSetVector2Macro(ScalarRange,float)
vlGetVectorMacro(ScalarRange,float)
vlSetVector2Macro(ScalarRange,float);
vlGetVectorMacro(ScalarRange,float,2);
// Description:
// Return bounding box of data in terms of (xmin,xmax, ymin,ymax, zmin,zmax).
......
......@@ -62,7 +62,7 @@ public:
void SetColor(float r,float g,float b);
void SetColor(float a[3]) { this->SetColor(a[0], a[1], a[2]); };
vlGetVectorMacro(Color,float);
vlGetVectorMacro(Color,float,3);
// Description:
// Set ambient coefficient.
......@@ -107,22 +107,22 @@ public:
// Description:
// Set the ambient light color.
vlSetVector3Macro(AmbientColor,float);
vlGetVectorMacro(AmbientColor,float);
vlGetVectorMacro(AmbientColor,float,3);
// Description:
// Set the diffuse light color.
vlSetVector3Macro(DiffuseColor,float);
vlGetVectorMacro(DiffuseColor,float);
vlGetVectorMacro(DiffuseColor,float,3);
// Description:
// Set the specular color.
vlSetVector3Macro(SpecularColor,float);
vlGetVectorMacro(SpecularColor,float);
vlGetVectorMacro(SpecularColor,float,3);
// Description:
// Set the color of edges (if edge visibility enabled).
vlSetVector3Macro(EdgeColor,float);
vlGetVectorMacro(EdgeColor,float);
vlGetVectorMacro(EdgeColor,float,3);
protected:
float Color[3];
......
......@@ -55,17 +55,17 @@ public:
// Set the background color of the rendering screen using an rgb color
// specification.
vlSetVector3Macro(Background,float);
vlGetVectorMacro(Background,float);
vlGetVectorMacro(Background,float,3);
// Description:
// Set the aspect ratio of the rendered image.
vlSetVector2Macro(Aspect,float);
vlGetVectorMacro(Aspect,float);
vlGetVectorMacro(Aspect,float,2);
// Description:
// Set the level of ambient lighting.
vlSetVector3Macro(Ambient,float);
vlGetVectorMacro(Ambient,float);
vlGetVectorMacro(Ambient,float,3);
// Description:
// Turn on/off whether objects are light from behind with another light.
......@@ -114,24 +114,24 @@ public:
// Description:
// Specify a point location in display (or screen) coordinates.
vlSetVector3Macro(DisplayPoint,float);
vlGetVectorMacro(DisplayPoint,float);
vlGetVectorMacro(DisplayPoint,float,3);
// Description:
// Specify a point location in view coordinates.
vlSetVector3Macro(ViewPoint,float);
vlGetVectorMacro(ViewPoint,float);
vlGetVectorMacro(ViewPoint,float,3);
// Description:
// Specify a point location in world coordinates.
vlSetVector4Macro(WorldPoint,float);
vlGetVectorMacro(WorldPoint,float);
vlGetVectorMacro(WorldPoint,float,4);
// Description:
// Specify the area for the renderer to draw in the rendering window.
// Coordinates are expressed as (xmin,ymin,xmax,ymax) where each
// coordinate is 0 <= coordinate <= 1.0.
vlSetVector4Macro(Viewport,float);
vlGetVectorMacro(Viewport,float);
vlGetVectorMacro(Viewport,float,4);
void DisplayToView();
void ViewToDisplay();
......
......@@ -105,7 +105,7 @@ void vlRenderer::DoLights()
if (!this->UpdateLights())
{
vlErrorMacro(<<"No lights are on, creating one.");
vlWarningMacro(<<"No lights are on, creating one.");
light1 = this->RenderWindow->MakeLight();
this->AddLights(light1);
light1->SetPosition(this->ActiveCamera->GetPosition());
......@@ -122,7 +122,7 @@ void vlRenderer::DoCameras()
if (!this->UpdateCameras())
{
vlErrorMacro(<< "No cameras are on, creating one.");
vlWarningMacro(<< "No cameras are on, creating one.");
cam1 = this->RenderWindow->MakeCamera();
this->SetActiveCamera(cam1);
this->ResetCamera();
......@@ -137,7 +137,7 @@ void vlRenderer::DoActors()
if (!this->UpdateActors())
{
vlErrorMacro(<< "No actors are on.");
vlWarningMacro(<< "No actors are on.");
}
}
......@@ -198,12 +198,11 @@ void vlRenderer::ResetCamera(float bounds[6])
float distance;
float width;
vlMath math;
float *vpn, vn[3];
float vn[3];
if ( this->ActiveCamera != NULL )
{
vpn = this->ActiveCamera->GetViewPlaneNormal();
for (int i=0; i<3; i++ ) vn[i] = vpn[i];
this->ActiveCamera->GetViewPlaneNormal(vn);
}
else
{
......
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