X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_AISObject.cpp;h=3f7646688b80eab7f6c9736522d5c8b05eec0de3;hb=5a4405dc843479d921b53b83c181cbe9359414fe;hp=bd8892987095df14e38c193c0814f0d4835b9cb1;hpb=1924606833292eede4a943af131063199e252feb;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_AISObject.cpp b/src/GeomAPI/GeomAPI_AISObject.cpp index bd8892987..3f7646688 100644 --- a/src/GeomAPI/GeomAPI_AISObject.cpp +++ b/src/GeomAPI/GeomAPI_AISObject.cpp @@ -83,6 +83,22 @@ void GeomAPI_AISObject::createShape(std::shared_ptr theShape) } } +std::shared_ptr GeomAPI_AISObject::getShape() const +{ + std::shared_ptr aResult; + + Handle(AIS_InteractiveObject) anAIS = impl(); + if (!anAIS.IsNull()) { + Handle(AIS_Shape) aShapeAIS = Handle(AIS_Shape)::DownCast(anAIS); + if (aShapeAIS) { + std::shared_ptr aResult(new GeomAPI_Shape); + aResult->setImpl(new TopoDS_Shape(aShapeAIS->Shape())); + return aResult; + } + } + return std::shared_ptr(); +} + void GeomAPI_AISObject::createDistance(std::shared_ptr theStartPoint, std::shared_ptr theEndPoint, std::shared_ptr theFlyoutPoint, @@ -303,6 +319,16 @@ void GeomAPI_AISObject::setColor(const int& theColor) aContext->SetColor(anAIS, aColor, false); } +double GeomAPI_AISObject::width() +{ + double aWidth = 0.0; + Handle(AIS_InteractiveObject) anAIS = impl(); + if (!anAIS.IsNull()) { + aWidth = anAIS->Width(); + } + return aWidth; +} + bool GeomAPI_AISObject::setWidth(const double& theWidth) { bool isChanged = false;