[vtk-developers] Crash with vtkCompassWidget

Ken Martin ken.martin at kitware.com
Fri Jun 20 10:12:49 EDT 2008


The methods in the widget are intentional. Maybe I just don't get the widget
rep separation code but the way I viewed it was that the representation is
just a representation (think of a view in the data/view or model/view design
pattern) Basically my take is that once you set the properties of the
representation (size, color, whatever) then you are done with it and the
program interacts with the widget. The model that I have seen in some other
places is that both the widget and the representation contain data and the
program continues to query and set both. I think there are some downsides to
that but it gets long winded. 

 

FWIW values such as Tilt do not necessarily have anything to do with the
appearance of the representation. For example with a centered slider the
slider may be centered when the value is 1.0 or 2.0. It is always centered
when at rest regardless of value. So the value is not clearly a property of
the representation but to me more clearly a property of the widget which
handles how the interactions of the representation modify the properties
(such as tilt) that the widget provides.

 

Ken 

 

Ken Martin PhD

Kitware Inc.

28 Corporate Drive

Clifton Park NY 12065

ken.martin at kitware.com

518 371 3971 (w/f)

 

From: vtk-developers-bounces at vtk.org [mailto:vtk-developers-bounces at vtk.org]
On Behalf Of Will Schroeder
Sent: Friday, June 20, 2008 9:25 AM
To: David Cole
Cc: VTK Developers; Prabhu Ramachandran
Subject: Re: [vtk-developers] Crash with vtkCompassWidget

 

This is the first time I've looked at the implementation of this class, so I
may be missing something.

Generally methods that retrieve "geometric" or representational information
(heading, tilt, distance) belong in the representation. Event stuff belongs
in the widget. However, the boundary between the widget and representation
can be confusing, hence the boundary is blurry. At a minimum the code should
be written so that a default representation is created if not present, and
we can consider these "convenience" methods and leave them in the widget. A
more drastic measure would be to remove the methods and make people go to
the representation for the information.

W

2008/6/20 David Cole <david.cole at kitware.com>:

A widget requires an attached widget representation to work properly for all
of its methods...

Is this a bug? Or an intended "it's not gonna work unless there's a
representation connected to it..."?

Any Widgets folks want to chime in on whether this should be expected to
work?


Thx,
David





On Thu, Jun 19, 2008 at 4:39 PM, Prabhu Ramachandran
<prabhu at aero.iitb.ac.in> wrote:

Hi,

There is a bug with vtkCompassWidget.  It is trivial to reproduce.  Here is
a Python example:

 import vtk
 w = vtk.vtkCompassWidget()
 print w.GetDistance()

I get a bus error on my mac and others seem to get segmentation violations.

Thanks.

cheers,
-- 
Prabhu Ramachandran                 http://www.aero.iitb.ac.in/~prabhu
<http://www.aero.iitb.ac.in/%7Eprabhu> 
_______________________________________________
vtk-developers mailing list
vtk-developers at vtk.org
http://www.vtk.org/mailman/listinfo/vtk-developers

 


_______________________________________________
vtk-developers mailing list
vtk-developers at vtk.org
http://www.vtk.org/mailman/listinfo/vtk-developers




-- 
William J. Schroeder, PhD
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
http://www.kitware.com
518-371-3971 (phone and fax) 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20080620/90e4cde0/attachment.html>


More information about the vtk-developers mailing list