Commit 31c20982 authored by hrchilds's avatar hrchilds

Update from June 6, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@8 18c085ea-50e0-402c-830e-de6fd14e8384
parent 55958a9e
......@@ -605,3 +605,69 @@ avtLineoutActor::SetShowLabels(const bool mode)
}
}
// ****************************************************************************
// Method: avtLineoutActor::Translate
//
// Purpose: Translates the actor by the given vector.
//
// Arguments:
// vec The vector to use in translating the actor.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003
//
// Modifications:
//
// ****************************************************************************
void
avtLineoutActor::Translate(const float vec[3])
{
float *newPos = labelActor1->GetPosition();
newPos[0] *= vec[0];
newPos[1] *= vec[1];
newPos[2] *= vec[2];
newPos = labelActor2->GetPosition();
newPos[0] *= vec[0];
newPos[1] *= vec[1];
newPos[2] *= vec[2];
newPos = lineSource->GetPoint1();
newPos[0] *= vec[0];
newPos[1] *= vec[1];
newPos[2] *= vec[2];
newPos = lineSource->GetPoint2();
newPos[0] *= vec[0];
newPos[1] *= vec[1];
newPos[2] *= vec[2];
lineSource->Modified();
}
// ****************************************************************************
// Method: avtLineoutActor::ResetPosition
//
// Purpose: Resets the actor's position to the original location.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003
//
// Modifications:
//
// ****************************************************************************
void
avtLineoutActor::ResetPosition()
{
labelActor1->SetPosition(attach[0], attach[1], attach[2]);
labelActor2->SetPosition(pt2[0], pt2[1], pt2[2]);
lineSource->SetPoint1(attach[0], attach[1], attach[2]);
lineSource->SetPoint2(pt2[0], pt2[1], pt2[2]);
lineSource->Modified();
}
......@@ -31,6 +31,9 @@ class vtkFollower;
// SetShowLabels. Added two actors for labels to be positioned at the
// endpoints.
//
// Kathleen Bonnell, Fri Jun 6 15:08:45 PDT 2003
// Added Translate and ResetPosition methods.
//
// ****************************************************************************
class PLOTTER_API avtLineoutActor
......@@ -58,6 +61,8 @@ class PLOTTER_API avtLineoutActor
void SetForegroundColor(float fg[3]);
void UpdateView();
void Shift(const float vec[3]);
void Translate(const float vec[3]);
void ResetPosition(void);
void SetLineStyle(const int);
void SetLineWidth(const int);
......
......@@ -168,6 +168,7 @@ avtPickActor::Shift(const float vec[3])
letterActor->SetPosition(newPos[0], newPos[1], newPos[2]);
}
// ****************************************************************************
// Method: avtPickActor::SetMode3D
//
......@@ -294,7 +295,8 @@ void avtPickActor::SetForegroundColor(float fg[3])
//
// ****************************************************************************
void avtPickActor::SetForegroundColor(float r, float g, float b)
void
avtPickActor::SetForegroundColor(float r, float g, float b)
{
letterActor->GetProperty()->SetColor(r, g, b);
lineActor->GetProperty()->SetColor(r, g, b);
......@@ -311,7 +313,8 @@ void avtPickActor::SetForegroundColor(float r, float g, float b)
//
// ****************************************************************************
void avtPickActor::Hide()
void
avtPickActor::Hide()
{
letterActor->VisibilityOff();
lineActor->VisibilityOff();
......@@ -328,7 +331,8 @@ void avtPickActor::Hide()
//
// ****************************************************************************
void avtPickActor::UnHide()
void
avtPickActor::UnHide()
{
letterActor->VisibilityOn();
lineActor->VisibilityOn();
......@@ -349,9 +353,70 @@ void avtPickActor::UnHide()
//
// ****************************************************************************
void avtPickActor::UpdateView()
void
avtPickActor::UpdateView()
{
// nothing for now.
}
// ****************************************************************************
// Method: avtPickActor::Translate
//
// Purpose: Translates the actor by the given vector.
//
// Arguments:
// vec The vector to use in translating the actor.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003
//
// Modifications:
//
// ****************************************************************************
void
avtPickActor::Translate(const float vec[3])
{
float *newPos = letterActor->GetPosition();
newPos[0] *= vec[0];
newPos[1] *= vec[1];
newPos[2] *= vec[2];
newPos = lineSource->GetPoint1();
newPos[0] *= vec[0];
newPos[1] *= vec[1];
newPos[2] *= vec[2];
newPos = lineSource->GetPoint2();
newPos[0] *= vec[0];
newPos[1] *= vec[1];
newPos[2] *= vec[2];
lineSource->Modified();
}
// ****************************************************************************
// Method: avtPickActor::ResetPosition
//
// Purpose: Resets the actor's position to the original location, including
// Shifting towards the camera.
//
// Arguments:
// vec The vector to use in Shifting the actor.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003
//
// Modifications:
//
// ****************************************************************************
void
avtPickActor::ResetPosition(const float vec[3])
{
lineSource->SetPoint1(attach[0], attach[1], attach[2]);
letterActor->SetPosition(attach[0], attach[1], attach[2]);
Shift(vec);
}
......@@ -23,6 +23,9 @@ class vtkRenderer;
// Kathleen Bonnell, Wed May 8 13:50:44 PDT 2002
// Moved ComputeScaleFactor to VisWinRendering.
//
// Kathleen Bonnell, Fri Jun 6 15:08:45 PDT 2003
// Added Translate and ResetPosition methods.
//
// ****************************************************************************
class PLOTTER_API avtPickActor
......@@ -45,6 +48,8 @@ class PLOTTER_API avtPickActor
void SetForegroundColor(float fg[3]);
void UpdateView();
void Shift(const float vec[3]);
void Translate(const float vec[3]);
void ResetPosition(const float vec[3]);
protected:
bool mode3D;
......
......@@ -580,6 +580,10 @@ avtPickQuery::RGridFindCell(vtkRectilinearGrid *rgrid)
// This is done here, rather than PreExecute, because the input used
// for this Query will not have that information.
//
// Kathleen Bonnell, Thu Jun 5 13:37:11 PDT 2003
// pickAtts' NeedTransformMessage wasn't always getting set to false
// when needed.
//
// ****************************************************************************
avtDataObject_p
......@@ -589,7 +593,6 @@ avtPickQuery::ApplyFilters(avtDataObject_p inData)
if (inAtts.HasTransform() && inAtts.GetCanUseTransform())
{
invTransform = inAtts.GetTransform();
pickAtts.SetNeedTransformMessage(false);
}
else
{
......@@ -600,6 +603,10 @@ avtPickQuery::ApplyFilters(avtDataObject_p inData)
{
pickAtts.SetNeedTransformMessage(true);
}
else
{
pickAtts.SetNeedTransformMessage(false);
}
return inData->GetTerminatingSource()->GetOutput();
}
......
......@@ -55,6 +55,9 @@ class VisWindowColleagueProxy;
// Kathleen Bonnell, Wed May 28 15:52:32 PDT 2003
// Added virtual method ReAddToWindow.
//
// Kathleen Bonnell, Fri Jun 6 08:57:33 PDT 2003
// Added virtual methods FullFrameOn, FullFrameOff.
//
// ****************************************************************************
class VISWINDOW_API VisWinColleague
......@@ -98,6 +101,9 @@ class VISWINDOW_API VisWinColleague
virtual void ReAddToWindow(void) {;};
virtual void FullFrameOn(const double, const int) {;};
virtual void FullFrameOff(void) {;};
protected:
VisWindowColleagueProxy &mediator;
};
......
......@@ -193,6 +193,9 @@ VisWinPlots::~VisWinPlots()
// When in antialiasing mode, allow colleagues to re-add themselves to the
// window, so that they can be drawn after plots, and reduce artefacts.
//
// Kathleen Bonnell, Fri Jun 6 15:23:05 PDT 2003
// GetFullFrameMode from mediator before retrieving scale factor and type.
//
// ****************************************************************************
void
......@@ -219,11 +222,11 @@ VisWinPlots::AddPlot(avtActor_p &p)
p->SetTransparencyActor(transparencyActor);
p->SetExternallyRenderedImagesActor(extRenderedImagesActor);
double scale;
int type;
mediator.GetScaleFactorAndType(scale, type);
if (scale > 0.) // Full-frame mode
if (mediator.GetFullFrameMode())
{
double scale;
int type;
mediator.GetScaleFactorAndType(scale, type);
float vec[3] = { 1. , 1., 1.};
if (type == 0) // x-axis
vec[0] = scale;
......@@ -1592,3 +1595,46 @@ VisWinPlots::DisableExternalRenderRequests(void)
{
return extRenderedImagesActor->DisableExternalRenderRequests();
}
// ****************************************************************************
// Method: VisWinPlots::FullFrameOn
//
// Purpose:
// Scales the plots to fit into the full-frame.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003
//
// ****************************************************************************
void
VisWinPlots::FullFrameOn(const double scale, const int type)
{
float vec[3] = {1., 1., 1.};
if (type == 0) // x-axis is being scaled
vec[0] = scale;
else // if (type == 1) // y-axis is being scaled
vec[1] = scale;
ScalePlots(vec);
}
// ****************************************************************************
// Method: VisWinPlots::FullFrameOff
//
// Purpose:
// Undoes the scale that made plots fit into the full-frame.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003
//
// ****************************************************************************
void
VisWinPlots::FullFrameOff()
{
float vec[3] = {1., 1., 1.};
ScalePlots(vec);
}
......@@ -111,6 +111,9 @@ class avtTransparencyActor;
// Added method to forward request to register an external rendering
// callback to the externally rendered images actor
//
// Kathleen Bonnell, Fri Jun 6 15:23:05 PDT 2003
// Added FullFrameOn/Off methods.
//
// ****************************************************************************
class VISWINDOW_API VisWinPlots : public VisWinColleague
......@@ -163,6 +166,9 @@ class VISWINDOW_API VisWinPlots : public VisWinColleague
bool EnableExternalRenderRequests(void);
bool DisableExternalRenderRequests(void);
virtual void FullFrameOn(const double, const int);
virtual void FullFrameOff(void);
protected:
std::vector< avtActor_p > plots;
avtTransparencyActor *transparencyActor;
......
......@@ -372,6 +372,9 @@ VisWinQuery::QueryIsValid(const PickAttributes *pa, const Line *lineAtts)
// Kathleen Bonnell, Fri Apr 11 15:20:47 PDT 2003
// Force z-coord of attachmentPoint in 2D to be zero.
//
// Kathleen Bonnell, Fri Jun 6 15:17:45 PDT 2003
// Added support for FullFrame mode.
//
// ****************************************************************************
void
......@@ -422,6 +425,24 @@ VisWinQuery::Pick(const PickAttributes *pa)
projection[2] = distance*(pos[2] - foc[2]);
pp->Shift(projection);
if (mediator.GetFullFrameMode())
{
double scale;
int type;
mediator.GetScaleFactorAndType(scale, type);
float vec[3] = { 1., 1., 1.};
if (type == 0) // x_axis
{
vec[0] = scale;
}
else // y_axis
{
vec[1] = scale;
}
pp->Translate(vec);
}
//
// Add the pickpoint to the renderer.
//
......@@ -542,6 +563,9 @@ VisWinQuery::ClearPickPoints()
// Set the actor's designator from the lineAtts designator. Set
// attachmentPoint and secondaryPoint from lineAtts.
//
// Kathleen Bonnell, Fri Jun 6 15:17:45 PDT 2003
// Added support for FullFrame mode.
//
// ****************************************************************************
void
......@@ -592,6 +616,24 @@ VisWinQuery::Lineout(const Line *lineAtts)
lo->SetAttachmentPoint(attachmentPoint);
lo->SetPoint2(secondaryPoint);
if (mediator.GetFullFrameMode())
{
double scale;
int type;
mediator.GetScaleFactorAndType(scale, type);
float vec[3] = { 1., 1., 1.};
if (type == 0) // x_axis
{
vec[0] = scale;
}
else // y_axis
{
vec[1] = scale;
}
lo->Translate(vec);
}
lo->Add(mediator.GetCanvas());
//
......@@ -650,6 +692,9 @@ VisWinQuery::ClearLineouts()
// Kathleen Bonnell, Tue Oct 1 16:07:40 PDT 2002
// Add ability for reflines to display labels.
//
// Kathleen Bonnell, Fri Jun 6 15:17:45 PDT 2003
// Added support for FullFrame mode.
//
// ****************************************************************************
void
......@@ -691,6 +736,23 @@ VisWinQuery::UpdateQuery(const Line *lineAtts)
lineAtts->GetColor().GetRgba(c);
(*it)->SetForegroundColor(c[0], c[1], c[2]);
(*it)->SetShowLabels(lineAtts->GetReflineLabels());
if (mediator.GetFullFrameMode())
{
double scale;
int type;
mediator.GetScaleFactorAndType(scale, type);
float vec[3] = { 1., 1., 1.};
if (type == 0) // x_axis
{
vec[0] = scale;
}
else // y_axis
{
vec[1] = scale;
}
(*it)->Translate(vec);
}
}
}
//
......@@ -736,3 +798,80 @@ VisWinQuery::DeleteQuery(const Line *lineAtts)
//
mediator.Render();
}
// ****************************************************************************
// Method: VisWinQuery::FullFrameOn
//
// Purpose:
// Translates the queries so that they appear in the proper spot in
// full-frame mode.
//
// Arguments:
// scale The axis scale factor.
// type The axis scale type.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003
//
// ****************************************************************************
void
VisWinQuery::FullFrameOn(const double scale, const int type)
{
if (scale > 0.)
{
float vec[3] = { 1., 1., 1.};
if (type == 0) // x_axis
vec[0] = scale;
else // y_axis
vec[1] = scale;
std::vector< avtPickActor_p >::iterator it;
for (it = pickPoints.begin() ; it != pickPoints.end() ; it++)
{
(*it)->Translate(vec);
}
std::vector< avtLineoutActor_p >::iterator it2;
for (it2 = lineOuts.begin() ; it2 != lineOuts.end() ; it2++)
{
(*it2)->Translate(vec);
}
}
}
// ****************************************************************************
// Method: VisWinQuery::FullFrameOff
//
// Purpose:
// Resets the positions of pick and lineout actors to their original
// position.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003
//
// ****************************************************************************
void
VisWinQuery::FullFrameOff()
{
float distance = 0.003;
float foc[3], pos[3], projection[3];
mediator.GetCanvas()->GetActiveCamera()->GetPosition(pos);
mediator.GetCanvas()->GetActiveCamera()->GetFocalPoint(foc);
projection[0] = distance*(pos[0] - foc[0]);
projection[1] = distance*(pos[1] - foc[1]);
projection[2] = distance*(pos[2] - foc[2]);
std::vector< avtPickActor_p >::iterator it;
for (it = pickPoints.begin() ; it != pickPoints.end() ; it++)
{
(*it)->ResetPosition(projection);
}
std::vector< avtLineoutActor_p >::iterator it2;
for (it2 = lineOuts.begin() ; it2 != lineOuts.end() ; it2++)
{
(*it2)->ResetPosition();
}
}
......@@ -49,6 +49,9 @@
// Replaced char * argument of QueryIsValid and Pick methods with
// PickAttributes.
//
// Kathleen Bonnell, Fri Jun 6 15:17:45 PDT 2003
// Added FullFrameOn/Off methods.
//
// ****************************************************************************
class VISWINDOW_API VisWinQuery : public VisWinColleague
......@@ -83,6 +86,9 @@ class VISWINDOW_API VisWinQuery : public VisWinColleague
void Pick(const PickAttributes *);
void ClearPickPoints(void);
virtual void FullFrameOn(const double, const int);
virtual void FullFrameOff(void);
protected:
std::vector< avtPickActor_p > pickPoints;
std::vector< avtLineoutActor_p > lineOuts;
......
......@@ -1011,3 +1011,49 @@ vtkHighlightActor2D::RegenerateHighlight()
highlightActor->SetMapper(highlightMapper);
highlightActor->PickableOff();
}
// ****************************************************************************
// Method: VisWinTools::FullFrameOn
//
// Purpose:
// Tells tools that FullFrame mode has been turned on.
//
// Arguments:
// scale : The axis scale factor.
// type : The axis scale type.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003
//
// Modifications:
//
// ****************************************************************************
void
VisWinTools::FullFrameOn(const double scale, const int type)
{
for(int i = 0; i < numTools; ++i)
tools[i]->FullFrameOn(scale, type);
}
// ****************************************************************************
// Method: VisWinTools::FullFrameOff
//
// Purpose:
// Tells tools that FullFrame mode has been turned off.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003
//
// Modifications:
//
// ****************************************************************************
void
VisWinTools::FullFrameOff()
{
for(int i = 0; i < numTools; ++i)
tools[i]->FullFrameOff();
}
......@@ -44,6 +44,9 @@ class vtkHighlightActor2D;
// Kathleen Bonnell, Wed May 28 15:58:15 PDT 2003
// Added method ReAddToWindow.
//
// Kathleen Bonnell, Fri Jun 6 15:23:05 PDT 2003
// Added FullFrameOn/Off methods.
//
// ****************************************************************************
class VISWINDOW_API VisWinTools : public VisWinColleague
......@@ -78,6 +81,9 @@ class VISWINDOW_API VisWinTools : public VisWinColleague
void TurnLightingOn();
void TurnLightingOff();
virtual void FullFrameOn(const double, const int);
virtual void FullFrameOff(void);
protected:
void ClearHighlight();
void RegenerateHighlight();
......
......@@ -56,6 +56,9 @@
// Kathleen Bonnell, Wed May 28 15:58:15 PDT 2003
// Added methods ReAddColleaguesToRenderWindow, GetAntialiasing.
//
// Kathleen Bonnell, Fri Jun 6 15:31:37 PDT 2003
// Added GetFullFrameMode method.
//
// ****************************************************************************
class VISWINDOW_API VisWindowColleagueProxy : public VisWindowProtectionProxy
......@@ -145,6 +148,9 @@ class VISWINDOW_API VisWindowColleagueProxy : public VisWindowProtectionProxy
bool GetAntialiasing()
{ return ProxiedGetAntialiasing(); };
bool GetFullFrameMode()
{ return ProxiedGetFullFrameMode(); };
};
......
......@@ -821,3 +821,22 @@ VisWindowProtectionProxy::ProxiedGetAntialiasing()
{
return viswin->GetAntialiasing();
}
// ****************************************************************************
// Method: VisWindowProtectionProxy::ProxiedGetFullFrameMode
//
// Purpose: Returns the fullframe mode.
//
// Returns: The fullframe mode.
//
// Programmer: Kathleen Bonnell
// Creation: June 6, 2003.
//
// ****************************************************************************
bool
VisWindowProtectionProxy::ProxiedGetFullFrameMode()
{
return viswin->GetFullFrameMode();
}
......@@ -71,6 +71,9 @@ class VisitInteractor;
// Kathleen Bonnell, Wed May 28 16:04:50 PDT 2003
// Added methods ReAddColleaguesToRenderWindow, GetAntialiasing.
//
// Kathleen Bonnell, Wed May 28 16:04:50 PDT 2003
// Added GetFullFrameMode.
//
// ****************************************************************************
class VISWINDOW_API VisWindowProtectionProxy
......@@ -131,6 +134,7 @@ class VISWINDOW_API VisWindowProtectionProxy
void ProxiedGetScaleFactorAndType(double &s, int &t);
void ProxiedReAddColleaguesToRenderWindow();
bool ProxiedGetAntialiasing();
bool ProxiedGetFullFrameMode();
};
......
......@@ -24,6 +24,9 @@
// Hank Childs, Wed Sep 4 08:40:47 PDT 2002
// Added RecalculateRenderOrder.
//
// Kathleen Bonnell, Fri Jun 6 15:31:37 PDT 2003
// Added GetFullFrameMode and GetScaleFactorAndType.
//
// ****************************************************************************
class VISWINDOW_API VisWindowToolProxy : public VisWindowProtectionProxy
......@@ -69,6 +72,12 @@ class VISWINDOW_API VisWindowToolProxy : public VisWindowProtectionProxy
bool UpdatesEnabled()
{ return ProxiedUpdatesEnabled(); };
bool GetFullFrameMode()
{ return ProxiedGetFullFrameMode(); };
void GetScaleFactorAndType(double &scale, int &type)
{ ProxiedGetScaleFactorAndType(scale, type); };
};
......
......@@ -38,6 +38,9 @@ typedef std::vector<HotPoint> HotPointVector;
// Kathleen Bonnell, Wed May 28 16:14:22 PDT 2003
// Added method ReAddToWindow.
//
// Kathleen Bonnell, Fri Jun 6 15:36:24 PDT 2003