X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_AISObject.cpp;h=57d192bbac49556cfb921e703022e28009797cfe;hb=aa48919bb1ecb71f07d9ac5fcd1bad170e7ed547;hp=fb90ceccb6d06672058670f36bc40dc4b5d9a287;hpb=247fc0bd6c6e04ce1f7a6e67f8d3c80ce17acab0;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_AISObject.cpp b/src/GeomAPI/GeomAPI_AISObject.cpp index fb90ceccb..57d192bba 100644 --- a/src/GeomAPI/GeomAPI_AISObject.cpp +++ b/src/GeomAPI/GeomAPI_AISObject.cpp @@ -41,6 +41,17 @@ GeomAPI_AISObject::GeomAPI_AISObject() { } +GeomAPI_AISObject::~GeomAPI_AISObject() +{ + if (myImpl) { + // This is necessary for correct deletion of Handle entity. + // Without this Handle does not decremented counter to 0 + Handle(AIS_InteractiveObject) *anAIS = (Handle(AIS_InteractiveObject)*)myImpl; + anAIS->Nullify(); + } +} + + void GeomAPI_AISObject::createShape(std::shared_ptr theShape) { const TopoDS_Shape& aTDS = @@ -98,9 +109,9 @@ void GeomAPI_AISObject::createDistance(std::shared_ptr theStartPoin Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); anAspect->MakeArrows3d(Standard_False); - anAspect->MakeText3d(false); + anAspect->MakeText3d(Standard_False); anAspect->TextAspect()->SetHeight(CONSTRAINT_TEXT_HEIGHT); - anAspect->MakeTextShaded(false); + anAspect->MakeTextShaded(Standard_True); anAspect->ArrowAspect()->SetLength(theDistance / 10.); aDimAIS->DimensionAspect()->MakeUnitsDisplayed(false); aDimAIS->SetDimensionAspect(anAspect); @@ -311,9 +322,9 @@ void GeomAPI_AISObject::getColor(int& theR, int& theG, int& theB) return; Quantity_Color aColor = anAIS->Color(); - theR = aColor.Red()*255.; - theG = aColor.Green()*255.; - theB = aColor.Blue()*255.; + theR = (int)(aColor.Red()*255.); + theG = (int)(aColor.Green()*255.); + theB = (int)(aColor.Blue()*255.); } bool GeomAPI_AISObject::empty() const