Commit 48319bb3 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Added AddPosition() method.

parent e8c97423
......@@ -65,6 +65,8 @@ class vlActor : public vlObject
// Description:
// Sets the posiiton of the actor.
vlSetVector3Macro(Position,float);
void AddPosition(float deltaPosition[3]);
void AddPosition(float delatX, float deltaY, float deltaZ);
// Description:
// Get the origin of the actor. This is the point about which all
......
......@@ -25,7 +25,7 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
// position(0,0,0) scale(1,1,1) visibility=1 pickable=1 dragable=1
// orientation= (0,0,0). IMPORTANT NOTE: Usually the vlRenderWindow
// method MakeActor() is used to create a device specific actor. This
// has the added benefit that a default device-specific proprty is
// has the added benefit that a default device-specific property is
// automatically created.
vlActor::vlActor()
{
......@@ -71,48 +71,22 @@ void vlActor::Render(vlRenderer *ren)
}
void vlActor::PrintSelf(ostream& os, vlIndent indent)
// Description:
// Change position by increments specified.
void vlActor::AddPosition (float deltaX,float deltaY,float deltaZ)
{
if (this->ShouldIPrint(vlActor::GetClassName()))
{
vlObject::PrintSelf(os,indent);
float position[3];
// 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");
}
position[0] = this->Position[0] + deltaX;
position[1] = this->Position[1] + deltaY;
position[2] = this->Position[2] + deltaZ;
this->SetPosition(position);
}
void vlActor::AddPosition (float deltaPosition[3])
{
this->AddPosition (deltaPosition[0], deltaPosition[1], deltaPosition[2]);
}
// Description:
......@@ -338,3 +312,47 @@ float *vlActor::GetZRange()
return &(this->Bounds[4]);
}
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 )
{
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");
}
}
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