{
}
+GeomAPI_AISObject::~GeomAPI_AISObject()
+{
+ if (!empty()) {
+ // This is necessary for correct deletion of Handle entity.
+ // Without this Handle does not decremented counter to 0
+ Handle(AIS_InteractiveObject) *anAIS = implPtr<Handle(AIS_InteractiveObject)>();
+ anAIS->Nullify();
+ }
+}
+
+
void GeomAPI_AISObject::createShape(std::shared_ptr<GeomAPI_Shape> theShape)
{
const TopoDS_Shape& aTDS =
if (anAIS.IsNull())
return;
Quantity_Color aColor((Quantity_NameOfColor) theColor);
- anAIS->SetColor(aColor);
Handle(AIS_Dimension) aDimAIS = Handle(AIS_Dimension)::DownCast(anAIS);
if (!aDimAIS.IsNull()) {
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
if (aColor.IsEqual(aCurrentColor))
return false;
- anAIS->SetColor(aColor);
Handle(AIS_Dimension) aDimAIS = Handle(AIS_Dimension)::DownCast(anAIS);
if (!aDimAIS.IsNull()) {
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
{
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (!anAIS.IsNull()) {
- Handle(AIS_Drawer) aDrawer = anAIS->Attributes();
- if (aDrawer->HasPointAspect()) {
+ Handle(Prs3d_Drawer) aDrawer = anAIS->Attributes();
+ if (aDrawer->HasOwnPointAspect()) {
Handle(Prs3d_PointAspect) aPA = aDrawer->PointAspect();
aPA->SetTypeOfMarker((Aspect_TypeOfMarker)theType);
aPA->SetScale(theScale);
bool isChanged = false;
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (!anAIS.IsNull()) {
- Handle(AIS_Drawer) aDrawer = anAIS->Attributes();
+ Handle(Prs3d_Drawer) aDrawer = anAIS->Attributes();
Handle(Prs3d_LineAspect) aLineAspect;
Aspect_TypeOfLine aType = (Aspect_TypeOfLine)theStyle;
- if (aDrawer->HasLineAspect()) {
+ if (aDrawer->HasOwnLineAspect()) {
aLineAspect = aDrawer->LineAspect();
}
- if (aDrawer->HasWireAspect()) {
+ if (aDrawer->HasOwnWireAspect()) {
aLineAspect = aDrawer->WireAspect();
}
Quantity_Color aCurrentColor;
return isChanged;
}
-
bool GeomAPI_AISObject::setTransparensy(double theVal)
{
bool isChanged = false;