//=====
void PlaneSource::Process()
{
- vtkPlaneSource *plane;
- plane = vtkPlaneSource::New();
- double p0[3];
- p0[0]=0;
- p0[1]=0;
- p0[2]=0;
+ double c[3];
+ double p0[3];
double p1[3];
- p1[0]=0;
- p1[1]=100;
- p1[2]=0;
- double p2[3];
- p2[0]=0;
- p2[1]=0;
- p2[2]=100;
- double c[3];
- c[0]=bbGetInputCenter()[0];
- c[1]=bbGetInputCenter()[1];
- c[2]=bbGetInputCenter()[2];
+ double p2[3];
+ vtkPlaneSource *plane;
+ plane = vtkPlaneSource::New();
+ c[0] = bbGetInputCenter()[0];
+ c[1] = bbGetInputCenter()[1];
+ c[2] = bbGetInputCenter()[2];
+ p0[0] = 0;
+ p0[1] = 0;
+ p0[2] = 0;
+
+ // xy
+ if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==0) && (bbGetInputNormal()[2]==1) )
+ {
+ p1[0] = 200;
+ p1[1] = 0;
+ p1[2] = 0;
+ p2[0] = 0;
+ p2[1] = 200;
+ p2[2] = 0;
+ }
+
+ // xz
+ if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==1) && (bbGetInputNormal()[2]==0) )
+ {
+ p1[0] = 200;
+ p1[1] = 0;
+ p1[2] = 0;
+ p2[0] = 0;
+ p2[1] = 0;
+ p2[2] = 200;
+ }
+
+ // yz
+ if ((bbGetInputNormal()[0]==1) && (bbGetInputNormal()[1]==0) && (bbGetInputNormal()[2]==0) )
+ {
+ p1[0] = 0;
+ p1[1] = 200;
+ p1[2] = 0;
+ p2[0] = 0;
+ p2[1] = 0;
+ p2[2] = 200;
+ }
+
+
+
+/*
+ p1[0] = 100;
+ p1[1] = 0;
+ p1[2] = 0;
+ p2[0] = 0;
+ p2[1] = 100;
+ p2[2] = 0;
+*/
plane->SetResolution( bbGetInputXResolution(), bbGetInputYResolution() );
plane->SetOrigin( p0 );
plane->SetPoint1( p1 );
plane->SetPoint2( p2 );
- plane->Update( );
+// plane->Update( );
plane->SetNormal( bbGetInputNormal()[0], bbGetInputNormal()[1], bbGetInputNormal()[2] );
- plane->Update( );
+// plane->Update( );
plane->SetCenter( c );
plane->Update( );
bbSetOutputPlane( (vtkDataSet*)plane );