#include <BRepBndLib.hxx>
#include <AIS_InteractiveObject.hxx>
+#include <AIS_InteractiveContext.hxx>
#include <AIS_LengthDimension.hxx>
#include <AIS_ParallelRelation.hxx>
#include <AIS_PerpendicularRelation.hxx>
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);
}
}
+void GeomAPI_AISObject::redisplay()
+{
+ Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
+ if (!anAIS.IsNull()) {
+ Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
+ aContext->Redisplay(anAIS, false);
+ }
+}
void GeomAPI_AISObject::setColor(const int& theColor)
if (!aDimAIS.IsNull()) {
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
}
+ Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
+ aContext->SetColor(anAIS, aColor, false);
}
void GeomAPI_AISObject::setWidth(const double& theWidth)
if (anAIS.IsNull())
return;
anAIS->SetWidth(theWidth);
+ anAIS->Redisplay();
}
void GeomAPI_AISObject::setColor(int theR, int theG, int theB)
if (!aDimAIS.IsNull()) {
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
}
+ Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
+ aContext->SetColor(anAIS, aColor, false);
}
bool GeomAPI_AISObject::empty() const
}
}
}
+
+
+void GeomAPI_AISObject::setLineStyle(int theStyle)
+{
+ Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
+ if (!anAIS.IsNull()) {
+ Handle(AIS_Drawer) aDrawer = anAIS->Attributes();
+ if (aDrawer->HasLineAspect())
+ aDrawer->LineAspect()->SetTypeOfLine((Aspect_TypeOfLine)theStyle);
+ if (aDrawer->HasWireAspect())
+ aDrawer->WireAspect()->SetTypeOfLine((Aspect_TypeOfLine)theStyle);
+ }
+}
+
+
+void GeomAPI_AISObject::setTransparensy(double theVal)
+{
+ Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
+ if (!anAIS.IsNull()) {
+ Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
+ if (!aContext.IsNull())
+ aContext->SetTransparency(anAIS, theVal, false);
+ }
+}