- _fillPolyMapper = vtkPolyDataMapper::New();
- _pts = vtkPoints::New();
-
- _pts->SetNumberOfPoints(4);
- _pts->SetPoint(0, xInic , yInic , zInic );
- _pts->SetPoint(1, xInic+50 , yInic , zInic );
- _pts->SetPoint(2, xInic+50 , yInic+50 , zInic );
- _pts->SetPoint(3, xInic , yInic+50 , zInic );
- strip->InsertNextCell(5);
- strip->InsertCellPoint(0);
- strip->InsertCellPoint(1);
- strip->InsertCellPoint(2);
- strip->InsertCellPoint(0);
- strip->InsertCellPoint(3);
- pdFill->SetPoints( _pts );
- pdFill->SetStrips( strip );
- _fillPolyMapper->SetInput(pdFill);
- _fillObjectActor->SetMapper(_fillPolyMapper);
+
+ _pts = vtkPoints::New();
+
+ double w=100,h=10,b=h/15,t=3;
+ _pts->SetNumberOfPoints(21);
+ _pts->InsertPoint(0, xInic+w*0.33-t/2 , yInic , zInic );
+ _pts->InsertPoint(1, xInic+w*0.33 , yInic-t , zInic );
+ _pts->InsertPoint(2, xInic+w*0.33+t/2 , yInic , zInic );
+ _pts->InsertPoint(3, xInic+w*0.33+t/2 , yInic , zInic );
+ _pts->InsertPoint(4, xInic+w-b*4 , yInic+b*0 , zInic );
+
+ _pts->InsertPoint( 5, xInic+w-b*4 , yInic+b*0 , zInic );
+ _pts->InsertPoint( 6, xInic+w-b*2 , yInic+b*1 , zInic );
+ _pts->InsertPoint( 7, xInic+w-b*1 , yInic+b*2 , zInic );
+ _pts->InsertPoint( 8, xInic+w-b*0 , yInic+b*4 , zInic );
+
+ _pts->InsertPoint( 9, xInic+w-b*0 , yInic+h-b*4 , zInic );
+ _pts->InsertPoint(10, xInic+w-b*1 , yInic+h-b*2 , zInic );
+ _pts->InsertPoint(11, xInic+w-b*2 , yInic+h-b*1 , zInic );
+ _pts->InsertPoint(12, xInic+w-b*4 , yInic+h-b*0 , zInic );
+
+ _pts->InsertPoint(13, xInic+b*4 , yInic+h-b*0 , zInic );
+ _pts->InsertPoint(14, xInic+b*2 , yInic+h-b*1 , zInic );
+ _pts->InsertPoint(15, xInic+b*1 , yInic+h-b*2 , zInic );
+ _pts->InsertPoint(16, xInic+b*0 , yInic+h-b*4 , zInic );
+
+ _pts->InsertPoint(17, xInic+b*0 , yInic+b*4 , zInic );
+ _pts->InsertPoint(18, xInic+b*1 , yInic+b*2 , zInic );
+ _pts->InsertPoint(19, xInic+b*2 , yInic+b*1 , zInic );
+ _pts->InsertPoint(20, xInic+b*4 , yInic+b*0 , zInic );
+
+ aPolygon->GetPointIds()->SetNumberOfIds(21);
+ for (int i=0;i<21; i++)
+ {
+ aPolygon->GetPointIds()->SetId(i, i);
+ }
+
+ vtkUnstructuredGrid *aPolygonGrid = vtkUnstructuredGrid::New();
+ aPolygonGrid->Allocate(1, 1);
+ aPolygonGrid->InsertNextCell(aPolygon->GetCellType(), aPolygon->GetPointIds());
+ aPolygonGrid->SetPoints(_pts);
+ _aPolygonMapper = vtkDataSetMapper::New();
+ _aPolygonMapper->SetInput(aPolygonGrid);
+ _fillObjectActor->SetMapper(_aPolygonMapper);