<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:st1 =
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"></o:SmartTagType><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"></o:SmartTagType><!--[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:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@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;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:45.1pt 1.0cm 53.85pt 1.0cm;}
div.Section1
        {page:Section1;}
-->
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue bgColor=white>
<DIV><FONT face=Arial size=2>I see Something...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>loop</FONT></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
pNodalGeometry->SetPoint(i,newcoords) ;</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">end loop</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">now try</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>pNodalGeometry->Modified()</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>that might force the bounds
change to be picked up. But between you and me you ought to be careful, if the
pNodalGeometry data is being output from another filter, then it may get
overwritten later. Maybe a deepcopy or a new dataset is in
order.</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>JB</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT> </P></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=j.robinson@kepler-systems.com
href="mailto:j.robinson@kepler-systems.com">James Robinson</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=jbiddiscombe@skippingmouse.co.uk
href="mailto:jbiddiscombe@skippingmouse.co.uk">'John Biddiscombe'</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=vtkusers@vtk.org
href="mailto:vtkusers@vtk.org">Vtk Users</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, August 11, 2004 12:40
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [vtkusers] Clipping
Planes</DIV>
<DIV><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">John,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Many thanks for
replying. I have tried EVERYTHING. I have even tried reloading all the props
into the renderer. I have checked the altered bounds on everything from the
vtkUnstructuredGrid to the vtkPoints* pNodalGeometry. None of the bounds are
altered after the change (which, I would imagine, is why the resetting of the
clip planes has no effect). My workaround is:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">void
CSampleView::ResetCameraClippingRange(BOOL
ShowDisplacement)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">{
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">//
float bounds[6] ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">//
Renderer->ComputeVisiblePropBounds(bounds) ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">//
Renderer->ResetCameraClippingRange() ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> // TODO: add
construction code here<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
vtkInteractorStyleSwitch* pStyle =
(vtkInteractorStyleSwitch*)Interactor->GetInteractorStyle()
;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> if
(ShowDisplacement)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
{ <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
pStyle->AutoAdjustCameraClippingRangeOff() ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
vtkCamera* pCamera = Renderer->GetActiveCamera()
;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
pCamera->SetClippingRange(0.001, 1000.) ; // Arbitrary – this could be
automated<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
} else<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
{<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
pStyle->AutoAdjustCameraClippingRangeOn() ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
}<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">}<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">which I call every
time the displacement view option is chosen. Note that it was at this level
that I tried to ResetCameraClippingRange (both with bounds computed and not),
but to no avail.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Any other suggestions
welcomed.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Regards,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Jim<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><B><FONT face=Arial color=navy size=3><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: navy; FONT-FAMILY: Arial">James
C Robinson</SPAN></FONT></B><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">, PhD, Chartered
Engineer,</SPAN></FONT><FONT color=navy><SPAN
style="COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Wingdings color=navy size=3><SPAN
style="FONT-SIZE: 12pt; COLOR: navy; FONT-FAMILY: Wingdings">+</SPAN></FONT><FONT
color=navy><SPAN style="COLOR: navy">
</SPAN></FONT><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">42
Rivergrove,</SPAN></FONT><FONT color=navy><SPAN
style="COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
Glanmire,</SPAN></FONT><FONT color=navy><SPAN
style="COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
Co. <st1:place w:st="on"><st1:City
w:st="on">Cork</st1:City></st1:place>,</SPAN></FONT><FONT color=navy><SPAN
style="COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
<st1:place w:st="on">Eire</st1:place></SPAN></FONT><FONT color=navy><SPAN
style="COLOR: navy"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Wingdings 2" color=navy size=3><SPAN
style="FONT-SIZE: 12pt; COLOR: navy; FONT-FAMILY: 'Wingdings 2'">'</SPAN></FONT><FONT
color=navy><SPAN style="COLOR: navy"> +353 21
4822028<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" color=navy size=3><SPAN
style="FONT-SIZE: 12pt; COLOR: navy">
+353 87 2393010<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Wingdings 2" color=navy size=3><SPAN
style="FONT-SIZE: 12pt; COLOR: navy; FONT-FAMILY: 'Wingdings 2'">6</SPAN></FONT><FONT
color=navy><SPAN style="COLOR: navy"> +353 21
4822028<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Wingdings color=navy size=3><SPAN
style="FONT-SIZE: 12pt; COLOR: navy; FONT-FAMILY: Wingdings">-</SPAN></FONT><FONT
color=navy><SPAN style="COLOR: navy"> </SPAN></FONT><FONT
color=blue><SPAN
style="COLOR: blue">j.robinson@kepler-systems.com</SPAN></FONT><FONT
color=navy><SPAN style="COLOR: navy"> </SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> John
Biddiscombe [mailto:jbiddiscombe@skippingmouse.co.uk] <BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> 11 August 2004 12:20<BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B> j.robinson@kepler-systems.com; Vtk
Users<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [vtkusers]
Clipping Planes</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">After calling AddDisplacement(...)
you are calling resetCameralippingRage() yes? If not. try
it.</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">JB</SPAN></FONT><o:p></o:p></P></DIV>
<BLOCKQUOTE
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; MARGIN: 5pt 0cm 5pt 3.75pt; BORDER-LEFT: black 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">----- Original Message -----
<o:p></o:p></SPAN></FONT></P></DIV>
<DIV style="font-color: black">
<P class=MsoNormal style="BACKGROUND: #e4e4e4"><B><FONT face=Arial
size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Arial">From:</SPAN></FONT></B><FONT
face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> <A
title=j.robinson@kepler-systems.com
href="mailto:j.robinson@kepler-systems.com">James Robinson</A>
<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><B><FONT face=Arial size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Arial">To:</SPAN></FONT></B><FONT
face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> <A
title=vtkusers@vtk.org href="mailto:vtkusers@vtk.org">Vtk Users</A>
<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><B><FONT face=Arial size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Arial">Sent:</SPAN></FONT></B><FONT
face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Wednesday, August 11, 2004 11:24 AM<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><B><FONT face=Arial size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Arial">Subject:</SPAN></FONT></B><FONT
face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
[vtkusers] Clipping Planes<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Dear
All,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I am having trouble (again) with
clipping planes. I am trying to create a viewer to view results of an FE
analysis. Part of the results are the displacements at the nodes of the
finite element mesh. I read in the FE mesh into a vtkUnstructuredGrid with
the displacements as a vector field. I then create a displaced geometry by
adding them to the vtkUnstructuredGrid geometry as
follows:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">void
CSampleDoc::AddDisplacement(float factor)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">{ vtkFloatArray
*pDisplacement =
(vtkFloatArray*)this->pUnstructuredGrid->GetPointData()->GetVectors()
;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
vtkPoints* pNodalGeometry = this->pUnstructuredGrid->GetPoints()
;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
if (pDisplacement==NULL)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
{ AfxMessageBox("No displacement set") ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
return ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
}<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
float newcoords[3] ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
float* x ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
float* delta ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
for (int i = 0; i < pNodalGeometry->GetNumberOfPoints();
i++)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
{ <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
x = pNodalGeometry->GetPoint(i)
;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
delta = pDisplacement->GetTuple(i) ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
for (int j = 0; j < 3; j++)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
{ newcoords[j] = x[j] + factor*delta[j] ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
}<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
pNodalGeometry->SetPoint(i,newcoords) ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
}<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
this->pUnstructuredGrid->Update() ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
this->pGeometry->SetInput(pUnstructuredGrid)
;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
this->pMeshMapper->SetInput(pGeometry->GetOutput());<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
this->pMeshMapper->Update() ;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
this->pMeshActor->SetMapper(this->pMeshMapper)
;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">}<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This works (with some other
quirky behaviour which I have circumvented). But a problem that I am having
difficulty with is that the clipping planes remain as if the geometry hadn’t
been altered. Thus, as I rotate the object (in trackball camera mode) the
displaced object disappears. I have checked the bounds of the viewable
objects (using Renderer->ComputeVisiblePropBounds(bounds) ;) and they are
unaltered – thus all the AutoClipping is thrown out of whack. It may very
well be that (a) I am doing things that are not meant to be catered for in
vtk or (b) there is a better (preferably simpler) way of achieving this
effect. <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">All suggestions gratefully
welcomed.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Jim<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><B><FONT face=Arial size=3><SPAN lang=EN-IE
style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; FONT-FAMILY: Arial">James C
Robinson</SPAN></FONT></B><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">, PhD, Chartered
Engineer,</SPAN></FONT><SPAN lang=EN-IE><o:p></o:p></SPAN></P>
<P class=MsoNormal><FONT face=Wingdings size=3><SPAN lang=EN-IE
style="FONT-SIZE: 12pt; FONT-FAMILY: Wingdings">+</SPAN></FONT><SPAN
lang=EN-IE> </SPAN><FONT face=Arial size=2><SPAN
lang=EN-IE style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">42
Rivergrove,</SPAN></FONT><SPAN lang=EN-IE><o:p></o:p></SPAN></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Glanmire,</SPAN></FONT><SPAN lang=EN-IE><o:p></o:p></SPAN></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; 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 face=Arial size=2><SPAN lang=EN-IE
style="FONT-SIZE: 10pt; 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 face="Wingdings 2" size=3><SPAN lang=EN-IE
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Wingdings 2'">'</SPAN></FONT><SPAN
lang=EN-IE> +353 21 4822028<o:p></o:p></SPAN></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-IE
style="FONT-SIZE: 12pt">
+353 87 2393010<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Wingdings 2" size=3><SPAN lang=EN-IE
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Wingdings 2'">6</SPAN></FONT><SPAN
lang=EN-IE> +353 21
4822028<o:p></o:p></SPAN></P>
<P class=MsoNormal><FONT face=Wingdings size=3><SPAN lang=EN-IE
style="FONT-SIZE: 12pt; FONT-FAMILY: Wingdings">-</SPAN></FONT><SPAN
lang=EN-IE> <FONT color=blue><SPAN
style="COLOR: blue">j.robinson@kepler-systems.com</SPAN></FONT> <o:p></o:p></SPAN></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-IE
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt">_______________________________________________<BR>This
is the private VTK discussion list. <BR>Please keep messages on-topic. Check
the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq><BR>Follow this
link to
subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<o:p></o:p></SPAN></FONT></P></BLOCKQUOTE></DIV></BLOCKQUOTE></BODY></HTML>