[vtkusers] vtk-developers Digest, Vol 147, Issue 36

Luis Vieira luis.vieira at vektore.com
Tue Jul 26 12:46:47 EDT 2016


Worked, Thank you very much Mike

For vtkPlaneSource, you have to set the Origin (you have this commented
out), Point1, and Point2. You shouldn't have to set the PlaneSource's
normal unless you want to change it's orientation as defined by the origin
and the two points.

On Tue, Jul 26, 2016 at 9:52 AM, Luis Vieira <luis.vieira at vektore.com>
wrote:

> Hello vtkusers,
>
>
>
> I am trying to draw a vtkPlaneSource from a vtkPlaneWidget after some user
> interactions. I had extracted Point1, Point2, Normal and Center from my
> Widget as well. However, applying against a vtkPlaneSource the result does
> not reflect the vtkPlaneWidget's definitions chosen by the user. It means,
> basically size and orientation of the final plane. Many thanks for any
help.
>
>
>
> following my snapshot.
>
>
>
> planeWidget = vtkSmartPointer<vtkPlaneWidget>::New();
>
> planeWidget->SetInteractor(mouseClickCallback->renderWindowInteractor);
>  //iren is vtkRenderWindowInteractor
>
> planeWidget->SetInputConnection(mydataset);
>
> planeWidget->SetPlaceFactor(1.0);
>
> planeWidget->SetHandleSize(0.03);
>
> planeWidget->SetResolution(10);
>
> planeWidget->GetHandleProperty()->SetColor(0, 0.6, 0.1);
>
> planeWidget->GetPlaneProperty()->SetColor(0, 0.3, 1);
>
> planeWidget->GetPlaneProperty()->SetEdgeColor(0, 0.9, 1);
>
> planeWidget->GetPlaneProperty()->SetEdgeVisibility(1);
>
> planeWidget->PlaceWidget();
>
> planeWidget->SetRepresentationToSurface();
>
> planeWidget->GetPolyData(planeW);
>
> planeWidget->AddObserver(vtkCommand::InteractionEvent,
mouseClickCallback);
>
> planeWidget->SetNormal(normalVector[0], normalVector[1], normalVector[2]);
> // normal of my target plane
>
> planeWidget->SetCenter(center[0], center[1], center[2]); // origin of my
> target plane
>
> planeWidget->UpdatePlacement();
>
> planeWidget->EnabledOn();
>
>
>
> Callback Interactions
>
>
>
> _plane = vtkPlane::New();
>
> vtkPolyData *polydata = vtkPolyData::New();
>
> vtkSmartPointer<vtkExtractEdges> extractEdges =
>
> vtkSmartPointer<vtkExtractEdges>::New();
>
> planeWidget->GetPlane(_plane);
>
> planeWidget->GetPolyData(polydata);
>
> planeWidget->GetPoint1(Point1);
>
> planeWidget->GetPoint2(Point2);
>
> planeWidget->GetCenter(Center);
>
> extractEdges->SetInputData(0, polydata);
>
> extractEdges->Update();
>
>
>
> vtkSmartPointer<vtkPlane> newPlane = vtkSmartPointer<vtkPlane>::New();
>
> newPlane->SetNormal(planeWidget->GetNormal());
>
> newPlane->SetOrigin(planeWidget->GetOrigin());
>
>
>
> VtkPlaneSource
>
>
>
> vtkSmartPointer<vtkPlaneSource> planeSource =
>
> vtkSmartPointer<vtkPlaneSource>::New();
>
> planeSource->SetPoint1(Point1[0], Point1[1], Point1[2]);//Point1
>
> planeSource->SetPoint2(Point2[0], Point2[1], Point2[2]);//Point2
>
> //planeSource->SetOrigin(newPlane->Origin[0], newPlane->Origin[1],
> newPlane->Origin[2]);//
>
> planeSource->SetCenter(Center[0], Center[1], Center[2]);
>
> planeSource->SetNormal(newPlane->GetNormal()[0], newPlane->GetNormal()[1],
> newPlane->GetNormal()[2]);
>
> planeSource->Update();
>
>
>
>
>
> Anybody here knows whats is wrong with my solution? Once, again many
> thanks for any help.
>
>
>
>
>
> *Luis *
-----Original Message-----
From: vtk-developers [mailto:vtk-developers-bounces at vtk.org] On Behalf Of
vtk-developers-request at vtk.org
Sent: July 26, 2016 10:59 AM
To: vtk-developers at vtk.org
Subject: vtk-developers Digest, Vol 147, Issue 36

Send vtk-developers mailing list submissions to
	vtk-developers at vtk.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://public.kitware.com/mailman/listinfo/vtk-developers
or, via email, send a message with subject or body 'help' to
	vtk-developers-request at vtk.org

You can reach the person managing the list at
	vtk-developers-owner at vtk.org

When replying, please edit your Subject line so it is more specific than
"Re: Contents of vtk-developers digest..."


Today's Topics:

   1. Re: Rogue7 vtktiff dashboard build failure (Ben Boeckel)
   2. vtkPlaneSource by vtkPlaneWidget (Jo?o Luis)
   3. vtkPlaneSource from a vtkPlaneWidget (Luis Vieira)


----------------------------------------------------------------------

Message: 1
Date: Tue, 26 Jul 2016 10:42:35 -0400
From: Ben Boeckel <ben.boeckel at kitware.com>
To: Sean McBride <sean at rogue-research.com>
Cc: VTK Developers <vtk-developers at vtk.org>, David Gobbi
	<david.gobbi at gmail.com>
Subject: Re: [vtk-developers] Rogue7 vtktiff dashboard build failure
Message-ID: <20160726144235.GB14126 at rotor>
Content-Type: text/plain; charset=utf-8

On Tue, Jul 26, 2016 at 10:22:52 -0400, Ben Boeckel wrote:
> Now to figure out why the difference happens?

tiff MR up:

    https://gitlab.kitware.com/third-party/tiff/merge_requests/1/commits

--Ben


------------------------------

Message: 2
Date: Tue, 26 Jul 2016 10:49:15 -0400
From: Jo?o Luis <joaolsvieira at gmail.com>
To: vtk-developers at vtk.org
Subject: [vtk-developers] vtkPlaneSource by vtkPlaneWidget
Message-ID:
	<CA+fAcvp_9fJ+sCF5X+nnhmfdETiMW7rLSca0QHU618MJPfHOeg at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hello vtkdevelopers,

I am trying to draw a vtkPlaneSource from a vtkPlaneWidget after some user
interactions. I had extracted Point1, Point2, Normal and Center from my
Widget as well. However, applying against a vtkPlaneSource the result does
not reflect the vtkPlaneWidget's definitions chosen by the user. It means,
basically size and orientation of the final plane. Many thanks for any help.

following my snapshot.

planeWidget = vtkSmartPointer<vtkPlaneWidget>::New();
planeWidget->SetInteractor(mouseClickCallback->renderWindowInteractor);
 //iren is vtkRenderWindowInteractor
planeWidget->SetInputConnection(mydataset);
planeWidget->SetPlaceFactor(1.0);
planeWidget->SetHandleSize(0.03);
planeWidget->SetResolution(10);
planeWidget->GetHandleProperty()->SetColor(0, 0.6, 0.1); 
planeWidget->GetPlaneProperty()->SetColor(0, 0.3, 1); 
planeWidget->GetPlaneProperty()->SetEdgeColor(0, 0.9, 1); 
planeWidget->GetPlaneProperty()->SetEdgeVisibility(1);
planeWidget->PlaceWidget();
planeWidget->SetRepresentationToSurface();
planeWidget->GetPolyData(planeW);
planeWidget->AddObserver(vtkCommand::InteractionEvent, 
planeWidget->mouseClickCallback); SetNormal(normalVector[0], 
planeWidget->normalVector[1], normalVector[2]);
// normal of my target plane
planeWidget->SetCenter(center[0], center[1], center[2]); // origin of my
target plane
planeWidget->UpdatePlacement();
planeWidget->EnabledOn();

Callback Interactions

_plane = vtkPlane::New();
vtkPolyData *polydata = vtkPolyData::New(); vtkSmartPointer<vtkExtractEdges>
extractEdges = vtkSmartPointer<vtkExtractEdges>::New();
planeWidget->GetPlane(_plane);
planeWidget->GetPolyData(polydata);
planeWidget->GetPoint1(Point1);
planeWidget->GetPoint2(Point2);
planeWidget->GetCenter(Center);
extractEdges->SetInputData(0, polydata); Update();

vtkSmartPointer<vtkPlane> newPlane = vtkSmartPointer<vtkPlane>::New();
newPlane->SetNormal(planeWidget->GetNormal());
newPlane->SetOrigin(planeWidget->GetOrigin());

VtkPlaneSource

vtkSmartPointer<vtkPlaneSource> planeSource =
vtkSmartPointer<vtkPlaneSource>::New();
planeSource->SetPoint1(Point1[0], Point1[1], Point1[2]);//Point1 
planeSource->SetPoint2(Point2[0], Point2[1], Point2[2]);//Point2
//planeSource->SetOrigin(newPlane->Origin[0], newPlane->Origin[1],
newPlane->Origin[2]);//
planeSource->SetCenter(Center[0], Center[1], Center[2]); 
planeSource->SetNormal(newPlane->GetNormal()[0], 
planeSource->newPlane->GetNormal()[1],
newPlane->GetNormal()[2]);
planeSource->Update();


Anybody here knows whats is wrong with my solution? Once, again many thanks
for any help.

Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://public.kitware.com/pipermail/vtk-developers/attachments/20160726/1ac
00f5b/attachment-0001.html>

------------------------------

Message: 3
Date: Tue, 26 Jul 2016 10:51:51 -0400
From: "Luis Vieira" <luis.vieira at vektore.com>
To: <vtk-developers at vtk.org>
Subject: [vtk-developers] vtkPlaneSource from a vtkPlaneWidget
Message-ID: <0be401d1e74d$3efd70f0$bcf852d0$@vektore.com>
Content-Type: text/plain; charset="us-ascii"

Hello vtkdevelopers,

 

I am trying to draw a vtkPlaneSource from a vtkPlaneWidget after some user
interactions. I had extracted Point1, Point2, Normal and Center from my
Widget as well. However, applying against a vtkPlaneSource the result does
not reflect the vtkPlaneWidget's definitions chosen by the user. It means,
basically size and orientation of the final plane. Many thanks for any help.

 

following my snapshot.

 

planeWidget = vtkSmartPointer<vtkPlaneWidget>::New();

planeWidget->SetInteractor(mouseClickCallback->renderWindowInteractor);
//iren is vtkRenderWindowInteractor

planeWidget->SetInputConnection(mydataset);

planeWidget->SetPlaceFactor(1.0);

planeWidget->SetHandleSize(0.03);

planeWidget->SetResolution(10);

planeWidget->GetHandleProperty()->SetColor(0, 0.6, 0.1);

planeWidget->GetPlaneProperty()->SetColor(0, 0.3, 1);

planeWidget->GetPlaneProperty()->SetEdgeColor(0, 0.9, 1);

planeWidget->GetPlaneProperty()->SetEdgeVisibility(1);

planeWidget->PlaceWidget();

planeWidget->SetRepresentationToSurface();

planeWidget->GetPolyData(planeW);

planeWidget->AddObserver(vtkCommand::InteractionEvent, 
planeWidget->mouseClickCallback);

planeWidget->SetNormal(normalVector[0], normalVector[1], 
planeWidget->normalVector[2]);
// normal of my target plane

planeWidget->SetCenter(center[0], center[1], center[2]); // origin of my
target plane

planeWidget->UpdatePlacement();

planeWidget->EnabledOn();

 

Callback Interactions

 

_plane = vtkPlane::New();

vtkPolyData *polydata = vtkPolyData::New();

vtkSmartPointer<vtkExtractEdges> extractEdges =

vtkSmartPointer<vtkExtractEdges>::New();

planeWidget->GetPlane(_plane);

planeWidget->GetPolyData(polydata);

planeWidget->GetPoint1(Point1);

planeWidget->GetPoint2(Point2);

planeWidget->GetCenter(Center);

extractEdges->SetInputData(0, polydata);

extractEdges->Update();

 

vtkSmartPointer<vtkPlane> newPlane = vtkSmartPointer<vtkPlane>::New();

newPlane->SetNormal(planeWidget->GetNormal());

newPlane->SetOrigin(planeWidget->GetOrigin());

 

VtkPlaneSource

 

vtkSmartPointer<vtkPlaneSource> planeSource =

vtkSmartPointer<vtkPlaneSource>::New();

planeSource->SetPoint1(Point1[0], Point1[1], Point1[2]);//Point1

planeSource->SetPoint2(Point2[0], Point2[1], Point2[2]);//Point2

//planeSource->SetOrigin(newPlane->Origin[0], newPlane->Origin[1],
newPlane->Origin[2]);//

planeSource->SetCenter(Center[0], Center[1], Center[2]);

planeSource->SetNormal(newPlane->GetNormal()[0], 
planeSource->newPlane->GetNormal()[1],
newPlane->GetNormal()[2]);

planeSource->Update();

 

 

Anybody here knows what is wrong with my solution? Once, again many thanks
for any help.

 

 

Luis 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://public.kitware.com/pipermail/vtk-developers/attachments/20160726/524
f6d6c/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers

------------------------------

End of vtk-developers Digest, Vol 147, Issue 36
***********************************************



More information about the vtkusers mailing list