[vtkusers] vtkBoxWidget::Points values change between Debug and Release mode

Cory Quammen cory.quammen at kitware.com
Thu Jan 7 11:09:48 EST 2016


Sorry, I don't see anything obvious. vtkBox must be initializing the points?

Please include the vtkusers list when replying in case anyone else can help.

Thanks,
Cory

On Thu, Jan 7, 2016 at 11:02 AM, Amélie Thery <theryame at gmail.com> wrote:
> This is the function where I use it :
> void PositionHandles(){
>     vtkPoints* pts=vtkPoints::New();
>     pts=GetPoints();
>       //verifie que le widget n'est pas retourne
>      double p[3],o[3],u[3],t[3],g[3],r[3],v[3],h[3];
>      pts->GetPoint(0,p);
>      pts->GetPoint(1,r);
>      pts->GetPoint(2,o);
>      pts->GetPoint(3,t);
>      pts->GetPoint(4,v);
>      pts->GetPoint(5,u);
>      pts->GetPoint(6,g);
>      pts->GetPoint(7,h);
>
>       if (p[0]+limiteprofondeur>=o[0]) {
>           pts->SetPoint(1,o[0]+limiteprofondeur,r[1],r[2]);
>           pts->SetPoint(2,o[0]+limiteprofondeur,o[1],o[2]);
>           pts->SetPoint(5,o[0]+limiteprofondeur,u[1],u[2]);
>           pts->SetPoint(6,o[0]+limiteprofondeur,g[1],g[2]);
>       }
>       if (u[1]+limitehauteur>=t[1]){
>           pts->SetPoint(2,o[0],t[1]+limitehauteur,o[2]);
>           pts->SetPoint(3,t[0],t[1]+limitehauteur,t[2]);
>           pts->SetPoint(6,g[0],t[1]+limitehauteur,g[2]);
>           pts->SetPoint(7,h[0],t[1]+limitehauteur,h[2]);
>
>       }
>       if (r[2]+limitelargeur>=g[2]) {
>           pts->SetPoint(4,v[0],v[1],g[2]+limitelargeur);
>           pts->SetPoint(5,u[0],u[1],g[2]+limitelargeur);
>           pts->SetPoint(6,g[0],g[1],g[2]+limitelargeur);
>           pts->SetPoint(7,h[0],h[1],g[2]+limitelargeur);
>       }
>
>     vtkBoxWidget::PositionHandles();
> }
>
> 2016-01-07 16:25 GMT+01:00 Cory Quammen <cory.quammen at kitware.com>:
>>
>> Amélie,
>>
>> Two thoughts:
>>
>> 1). Some of the points may not be initialized. Could you post your
>> initialization code for the vtkPoints object?
>>
>> 2). You are accidentally mixing Release and Debug mode libraries. You
>> must link against either all Release or all Debug libraries - mixing
>> them will lead to a world of hurt.
>>
>> Cory
>>
>> On Thu, Jan 7, 2016 at 10:09 AM, Amélie Thery <theryame at gmail.com> wrote:
>> > Hi everybody,
>> > I am using vtkBoxWidget, and I use Points to control it size.
>> > I defined a public function vtkPoints * GetPoints(){return Points;}to
>> > access
>> > this protected member.
>> > For example, when my vtkBoxWidget is defined by
>> > {-1,0,0,
>> > 1,0,0,
>> > 1,0,1,
>> > -1,0,1,
>> >
>> > -1,1,0,
>> > 1,1,0,
>> > 1,1,1,
>> > -1,1,1}
>> >
>> > with one face under 0 and the opposite over 0 in x-axis,
>> > I do:
>> > vtkPoints* pts=GetPoints();
>> > double a[3],b[3];
>> > pts->GetPoint(0,a); //face under 0
>> > pts->GetPoint(2,b); //face over 0
>> >
>> > In debug mode, a[0]= -1  and b[0]= 1 as it is supposed to be,
>> > In release mode, a[0]= 1 and b[0]= 1 so I can not check the size of the
>> > box.
>> >
>> > I didn't change anything between both tests, if anyone has any idea it
>> > would
>> > be grateful :)
>> >
>> > Thank you for reading,
>> > Amélie
>> >
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Search the list archives at: http://markmail.org/search/?q=vtkusers
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/vtkusers
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> R&D Engineer
>> Kitware, Inc.
>
>



-- 
Cory Quammen
R&D Engineer
Kitware, Inc.


More information about the vtkusers mailing list