<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" 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><o:SmartTagType
name="place"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><o:SmartTagType
name="City"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></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:"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 vLink=purple link=blue bgColor=#ffffff>
<DIV><FONT face=Arial size=2>After calling AddDisplacement(...) you are calling
resetCameralippingRage() yes? If not. try it.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>JB</FONT></DIV>
<BLOCKQUOTE
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=vtkusers@vtk.org
href="mailto:vtkusers@vtk.org">Vtk Users</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, August 11, 2004 11:24
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [vtkusers] Clipping Planes</DIV>
<DIV><FONT face=Arial size=2></FONT><BR></DIV>
<DIV class=Section1>
<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> </SPAN><SPAN
lang=EN-IE><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>
<P>
<HR>
<P></P>_______________________________________________<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<BR></BLOCKQUOTE></BODY></HTML>