- QPointF aPoint1( 0, 0 ); // 1: top left
- QPointF aPoint2( aWidth, 0 ); // 2: top right
- QPointF aPoint3( aWidth, aHeight ); // 3: bottom right
- QPointF aPoint4( 0, aHeight ); // 4: bottom left
-
- aPoint1 = aTrsf.map( aPoint1 );
- aPoint2 = aTrsf.map( aPoint2 );
- aPoint3 = aTrsf.map( aPoint3 );
- aPoint4 = aTrsf.map( aPoint4 );
-
- QPolygonF aPolygon = QPolygonF() << aPoint1 << aPoint2 << aPoint3 << aPoint4;
- QRectF aRect = aPolygon.boundingRect();
-
- gp_Pnt aPnt1( aRect.topLeft().x(), aRect.topLeft().y(), 0 );
- gp_Pnt aPnt2( aRect.topRight().x(), aRect.topRight().y(), 0 );
- gp_Pnt aPnt3( aRect.bottomRight().x(), aRect.bottomRight().y(), 0 );
- gp_Pnt aPnt4( aRect.bottomLeft().x(), aRect.bottomLeft().y(), 0 );
-
- Handle_HYDROData_Document aDoc = HYDROData_Document::Document( anImageObj->Label() );
- aDoc->Transform( aPnt1, true );
- aDoc->Transform( aPnt2, true );
- aDoc->Transform( aPnt3, true );
- aDoc->Transform( aPnt4, true );
-
- TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge( aPnt1, aPnt2 ).Edge();
- TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge( aPnt2, aPnt3 ).Edge();
- TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge( aPnt3, aPnt4 ).Edge();
- TopoDS_Edge anEdge4 = BRepBuilderAPI_MakeEdge( aPnt4, aPnt1 ).Edge();
-
- TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( anEdge1, anEdge2, anEdge3, anEdge4 ).Wire();
- aWire.Closed( true );
-
- setTextureFileName( aTextureFileName, false, false );
- setFace( aWire, false, false, aTextureFileName );
- isDeactivateSelection = true;
- }
-