<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi Adriano<div><br></div><div> Thank you so much for your suggestion. </div><div> I think my explanation is not clear enough. I know if I set the y-axis range from 0 to 15, that is no problem. But what I want to know is that why one line which should be drawn disappeared at this condition(y-axis from 0 to 8). Please pay attention to the line e(7.0)f(8,10). Why it disappeared? Just because point f(8,10) is out of range? no, if we change point e(7,0) to e(7,0.1), the line ef will be drawn. Point c(4,15) is out of range too, but line bc is drawn. That is the problem.</div><div> I attached the capture of this little sample and my analysis. Please have a look.</div><div> Thank you again.</div><div><br></div><div> Best wishes!</div><div><br></div><div>Elo<br><hr id="stopSpelling">From: agagliardi@ara.co.uk<br>To: phenome@live.cn; vtkusers@vtk.org<br>Subject: RE: [vtkusers] A Problem About vtkXYPlotActor<br>Date: Fri, 9 Jul 2010 09:44:54 +0100<br><br>
<style>
.ExternalClass .ecxhmmessage P
{padding-right:0px;padding-left:0px;padding-bottom:0px;padding-top:0px;}
.ExternalClass BODY.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</style>
<div><span class="ecx406043608-09072010"><font face="Arial" color="#0000ff">Hi
Elo,</font></span></div>
<div><span class="ecx406043608-09072010"><font face="Arial" color="#0000ff"></font></span> </div>
<div><span class="ecx406043608-09072010"><font face="Arial" color="#0000ff">So, you have
set your y-axis range to be between 0 and 8, you then plot a curve where some of
those y-values are out of this range, so it doesn't plot them (it clips them
out). This appears to be normal behaviour in my opinion. If you want to see all
your curves, then you'll have to rescale your y-axis to fit them in by setting
the y-axis range from 0 to 15. Were you assuming it would automatically fit the
axes to the data, as within ParaView? This option may still be there, but I've
never used it.</font></span></div>
<div><font face="Arial" color="#0000ff"></font> </div>
<div><span class="ecx406043608-09072010"><font face="Arial" color="#0000ff">Cheers,</font></span></div>
<div><span class="ecx406043608-09072010"><font face="Arial" color="#0000ff"></font></span> </div>
<div><span class="ecx406043608-09072010"><font face="Arial" color="#0000ff">Adriano</font></span></div>
<div><span class="ecx406043608-09072010"></span> </div>
===================================<br><br>Adriano Gagliardi MEng
PhD<br>Business Sector Leader<br>Computational Aerodynamics<br>Aircraft Research
Association Ltd.<br>Manton Lane<br>Bedford<br><br>Tel: 01234 32 4644<br>E-mail:
agagliardi@ara.co.uk<br>Url: www.ara.co.uk <BR>
<div> </div><br>
<div class="ecxOutlookMessageHeader" lang="en-us" dir="ltr" align="left">
<hr>
<font face="Tahoma"><b>From:</b> vtkusers-bounces@vtk.org
[mailto:vtkusers-bounces@vtk.org] <b>On Behalf Of
</b>LiuNiansheng<br><b>Sent:</b> 09 July 2010 03:56<br><b>To:</b>
VTK<br><b>Subject:</b> [vtkusers] A Problem About
vtkXYPlotActor<br></font><br></div>
<div></div>Hi everyone:
<div><br></div>
<div>I'm a user of vtk. When I use vtkXYPlotActor to draw some lines at a
XYPlot, I found vtk miss one line.</div>
<div>That's my sample code of vtkXYPlotActor:</div>
<div><span class="ecxecxApple-style-span" style="white-space:pre">=========================================================================
#include "vtkFloatArray.h" #include "vtkFieldData.h" #include "vtkDataObject.h"
#include "vtkXYPlotActor.h" #include "vtkXYPlotWidget.h" #include "vtkMath.h"
#include "vtkRenderWindow.h" #include "vtkRenderer.h" #include
"vtkRenderWindowInteractor.h" int main() { vtkFloatArray* vtkXYValues =
vtkFloatArray::New(); vtkXYValues->SetNumberOfComponents(
static_cast<vtkIdType>(2) ); float xy[2]; xy[0] =
static_cast<float>(0); xy[1] = static_cast<float>(0) ;
vtkXYValues->InsertNextTuple( xy ); xy[0] = static_cast<float>(2);
xy[1] = static_cast<float>(3) ; vtkXYValues->InsertNextTuple( xy );
xy[0] = static_cast<float>(4); xy[1] = static_cast<float>(15) ;
vtkXYValues->InsertNextTuple( xy ); xy[0] = static_cast<float>(6);
xy[1] = static_cast<float>(1) ; vtkXYValues->InsertNextTuple( xy );
xy[0] = static_cast<float>(7); xy[1] = static_cast<float>(0.1) ;
vtkXYValues->InsertNextTuple( xy ); xy[0] = static_cast<float>(8);
xy[1] = static_cast<float>(10) ; vtkXYValues->InsertNextTuple( xy );
xy[0] = static_cast<float>(9); xy[1] = static_cast<float>(9) ;
vtkXYValues->InsertNextTuple( xy ); xy[0] = static_cast<float>(10);
xy[1] = static_cast<float>(0) ; vtkXYValues->InsertNextTuple( xy );
vtkFieldData* vtkGraphFieldData = vtkFieldData::New();
vtkGraphFieldData->AddArray( vtkXYValues ); vtkXYValues->Delete();
vtkDataObject* vtkGraphDataObject = vtkDataObject::New();
vtkGraphDataObject->SetFieldData( vtkGraphFieldData );
vtkGraphFieldData->Delete(); vtkXYPlotActor* vtkGraph =
vtkXYPlotActor::New(); vtkGraph->AddDataObjectInput( vtkGraphDataObject );
vtkGraphDataObject->Delete(); vtkGraph->SetDataObjectPlotModeToColumns();
vtkGraph->SetXValuesToValue(); int curve = 0;
vtkGraph->SetDataObjectXComponent( curve, 0 );
vtkGraph->SetDataObjectYComponent( curve, 1 ); vtkGraph->SetXRange( 0,
10); vtkGraph->SetYRange( 0, 8); vtkGraph->SetPlotColor( curve, 1,0,0 );
vtkRenderer* renderer = vtkRenderer::New(); renderer->AddActor2D( vtkGraph );
vtkRenderWindow* renderWin = vtkRenderWindow::New(); renderWin->AddRenderer(
renderer ); vtkRenderWindowInteractor* interactor
=vtkRenderWindowInteractor::New(); interactor->SetRenderWindow( renderWin );
vtkXYPlotWidget* vtkXYPlotWidget = vtkXYPlotWidget::New();
vtkXYPlotWidget->SetXYPlotActor( vtkGraph );
vtkXYPlotWidget->SetInteractor( interactor ); vtkXYPlotWidget->SetEnabled(
true ); interactor->Initialize(); interactor->Start(); return 0; }
========================================================================= I
define eight points,<span lang="EN-US" style="font-size:10.5pt;font-family:Arial">a(0,0), b(2,3), c(4,15), d(6,1),
e(7,0), f(8,10), g(9,9),h(10,0). And the range of xy axis is defined from point
(0,0) </span></span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre"><span lang="EN-US" style="font-size:10.5pt;font-family:Arial">to (10,8). So there are three
points(cfg) out of range. There should be six lines except the line fg which is
out of range, but only five lines </span></span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre"><span lang="EN-US"></span>have been drawn. when I change these point to test, I found
the line which the value of y axis is from 0(the min value of y
axis) </span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre">to a value bigger
than the max value of y axis will be ignored by vtk. </span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre"><br></span></div> I guess the problem maybe happen when clipping
data. So I debugged vtkXYPlotActor source, and I found the function
<div><span class="ecxecxApple-style-span" style="white-space:pre">named
ClipPlotData() have been called in the function CreatPlotData().</span>
<div><span class="ecxecxApple-style-span" style="white-space:pre"></span><span class="ecxecxApple-style-span" style="white-space:pre">The algorithm of clipping
data is no problem. the number of lines which should be drawn is
six.</span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre"><br></span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre">Cause I don't have
enough time to do further research. If anyone has any information about this
problem, please let me know.</span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre"><br></span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre">th
anks.</span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre"><br></span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre">sincerely
yours:</span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre">Elo</span></div>
<div><span class="ecxecxApple-style-span" style="white-space:pre"><br></span>
<div><br></div></div></div><br>
<hr>
搜索本应是彩色的,快来体验新一代搜索引擎-必应,精美图片每天换哦! <a href="http://cn.bing.com/?form=CRMADS ">立即试用!</a> <br>
<hr>
使用新一代 Windows Live Messenger 轻松交流和共享! <a href="http://www.windowslive.cn/messenger/">立刻下载!</a> **********************************************************************<br>This email contains information that is private and confidential and is intended only for the addressee.<br>If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.<br>Note: All email sent to or from this address may be accessed by someone other than the recipient, for<br>system management and security reasons.<br>Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office:<br>Manton Lane, Bedford MK41 7PF England VAT No GB 196351245<BR>**********************************************************************<BR></div>                                            <br /><hr />搜索本应是彩色的,快来体验新一代搜索引擎-必应,精美图片每天换哦! <a href='http://cn.bing.com/?form=CRMADS ' target='_new'>立即试用!</a></body>
</html>