+boost::shared_ptr<GeomAPI_Shape> getPlane(double theX, double theY, double theZ)
+{
+ boost::shared_ptr<GeomAPI_Pnt> anOrigin(new GeomAPI_Pnt(0, 0, 0));
+ boost::shared_ptr<GeomAPI_Dir> aNormal(new GeomAPI_Dir(theX, theY, theZ));
+ return GeomAlgoAPI_FaceBuilder::square(anOrigin, aNormal, PLANE_SIZE);
+}
+
+void PartSet_Module::showPlanes()
+{
+ XGUI_Displayer* aDisplayer = myWorkshop->displayer();
+ // Show selection planes
+ if (!myXPlane) {
+ boost::shared_ptr<GeomAPI_Shape> aPlaneX = getPlane(1, 0, 0);
+ myXPlane = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject());
+ myXPlane->createShape(aPlaneX);
+ myXPlane->setColor(Colors::COLOR_RED);
+ myXPlane->setWidth(SKETCH_WIDTH);
+ }
+ if (!myYPlane) {
+ boost::shared_ptr<GeomAPI_Shape> aPlaneY = getPlane(0, 1, 0);
+ myYPlane = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject());
+ myYPlane->createShape(aPlaneY);
+ myYPlane->setColor(Colors::COLOR_GREEN);
+ myYPlane->setWidth(SKETCH_WIDTH);
+ }
+ if (!myZPlane) {
+ boost::shared_ptr<GeomAPI_Shape> aPlaneZ = getPlane(0, 0, 1);
+ myZPlane = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject());
+ myZPlane->createShape(aPlaneZ);
+ myZPlane->setColor(Colors::COLOR_BLUE);
+ myZPlane->setWidth(SKETCH_WIDTH);
+ }
+ aDisplayer->display(myXPlane, false);
+ aDisplayer->display(myYPlane, false);
+ aDisplayer->display(myZPlane, false);
+ aDisplayer->updateViewer();
+}
+
+void PartSet_Module::erasePlanes()
+{
+ XGUI_Displayer* aDisplayer = myWorkshop->displayer();
+ aDisplayer->erase(myXPlane, false);
+ aDisplayer->erase(myYPlane, false);
+ aDisplayer->erase(myZPlane, false);
+ aDisplayer->updateViewer();
+}
+