<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Wingdings 2";
        panose-1:5 2 1 2 1 5 7 7 7 7;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:45.1pt 1.0cm 53.85pt 1.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>Dear all,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>I am trying to use the vtkPlaneWidget object to try control
a vtkCutter object (see earlier query). The essential part of the code is:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>void vtkMyCallback::Execute(vtkObject *caller,
unsigned long, void*)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> CMainFrame* pMainFrame =
(CMainFrame*)AfxGetMainWnd() ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> if (pMainFrame==NULL) return ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> CSampleView* pVTKView =
(CSampleView*)(pMainFrame->MDIGetActive()->GetActiveView()) ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> if (pVTKView == NULL)
AfxMessageBox("NULL") ; ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> if (pVTKView == NULL) return ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> pVTKView->GetDocument()->UpdateXSection()
; // Part of what this does is update pPlane<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>In document class definition:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>
vtkPlaneWidget
*pPlaneWidget ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>
vtkMyCallback
*pCallback ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>IN document constructor:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> this->pPlaneWidget = vtkPlaneWidget::New()
;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> this->pCallback =
vtkMyCallback::New();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>In Open Document<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> pPlaneWidget->SetInteractor(GetView()->Interactor);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> vtkFloatingPointType
bounds[6] ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> vtkFloatingPointType
center[3] ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> GetView()->Renderer->ComputeVisiblePropBounds(bounds)
; <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> center[0]
= (bounds[0] + bounds[1])/2.0;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> center[1]
= (bounds[2] + bounds[3])/2.0;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> center[2]
= (bounds[4] + bounds[5])/2.0;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>// Note pPlane is the pointer to the implicit
function that is used by the vtkCutter<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> pPlaneWidget->GetPlane(pPlane)
;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> pPlaneWidget->SetResolution(10)
;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> pPlaneWidget->PlaceWidget();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> pPlaneWidget->NormalToYAxisOn()
;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> pPlaneWidget->AddObserver(vtkCommand::InteractionEvent,
pCallback);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>The code doesn’t crash, but the movement of the
vtkPlaneWidget has no effect on the vtkPlane (pPlane). Any ideas??<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>Regards,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'>Jim<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><b><font size=3 face=Arial><span lang=EN-IE
style='font-size:12.0pt;font-family:Arial;font-weight:bold'>James C Robinson</span></font></b><font
size=2 face=Arial><span lang=EN-IE style='font-size:10.0pt;font-family:Arial'>,
PhD, Chartered Engineer,</span></font><span lang=EN-IE><o:p></o:p></span></p>
<p class=MsoNormal><font size=3 face=Wingdings><span lang=EN-IE
style='font-size:12.0pt;font-family:Wingdings'>+</span></font><span lang=EN-IE> </span><font
size=2 face=Arial><span lang=EN-IE style='font-size:10.0pt;font-family:Arial'>42
Rivergrove,</span></font><span lang=EN-IE><o:p></o:p></span></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> Glanmire,</span></font><span
lang=EN-IE><o:p></o:p></span></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> Co. <st1:place
w:st="on"><st1:City w:st="on">Cork</st1:City></st1:place>,</span></font><span
lang=EN-IE><o:p></o:p></span></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-IE style='font-size:
10.0pt;font-family:Arial'> <st1:place
w:st="on">Eire</st1:place></span></font><span lang=EN-IE><o:p></o:p></span></p>
<p class=MsoNormal><font size=3 face="Wingdings 2"><span lang=EN-IE
style='font-size:12.0pt;font-family:"Wingdings 2"'>'</span></font><span
lang=EN-IE> +353 21 4822028<o:p></o:p></span></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-IE
style='font-size:12.0pt'> +353
87 2393010<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Wingdings 2"><span lang=EN-IE
style='font-size:12.0pt;font-family:"Wingdings 2"'>6</span></font><span
lang=EN-IE> +353 21 4822028<o:p></o:p></span></p>
<p class=MsoNormal><font size=3 face=Wingdings><span lang=EN-IE
style='font-size:12.0pt;font-family:Wingdings'>-</span></font><span lang=EN-IE> <font
color=blue><span style='color:blue'>j.robinson@kepler-systems.com</span></font> </span><span
lang=EN-IE><o:p></o:p></span></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-IE
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>