{
case AIS_DragAction_Start:
{
- myStartTransform = theDragFrom;
myLocTrsfStart = LocalTransformation();
return Standard_True;
}
case AIS_DragAction_Update:
{
- theCtx->MainSelector()->Pick (myStartTransform.x(), myStartTransform.y(), theView);
+ mySensSphere->ResetLastDetectedPoint();
+ SetLocalTransformation (myLocTrsfStart);
+ theCtx->MainSelector()->Pick (theDragFrom.x(), theDragFrom.y(), theView);
gp_Pnt aStartPosition = mySensSphere->LastDetectedPoint();
+
+ mySensSphere->ResetLastDetectedPoint();
theCtx->MainSelector()->Pick (theDragTo.x(), theDragTo.y(), theView);
gp_Pnt aCurrPosition = mySensSphere->LastDetectedPoint();
- if (aCurrPosition.X() != RealLast() && aStartPosition.Distance (aCurrPosition) > Precision::Confusion())
+ if (aCurrPosition.X() != RealLast()
+ && aStartPosition.Distance (aCurrPosition) > Precision::Confusion())
{
gp_Quaternion aQRot;
aQRot.SetRotation (gp_Vec (gp_Pnt (0, 0, 0), aStartPosition), gp_Vec (gp_Pnt (0, 0, 0), aCurrPosition));
gp_Trsf aTrsf;
aTrsf.SetRotation (aQRot);
SetLocalTransformation (myLocTrsfStart * aTrsf);
- myLocTrsfStart = LocalTransformation();
- myStartTransform = theDragTo;
- theOwner->Selectable()->ClearDynamicHighlight (theCtx->MainPrsMgr());
- theCtx->HilightWithColor (this, Handle(Prs3d_Drawer)(), false);
+ const Standard_Integer aHiMod = HasHilightMode() ? HilightMode() : 0;
+ theOwner->UpdateHighlightTrsf (theCtx->CurrentViewer(), theCtx->MainPrsMgr(), aHiMod);
}
return Standard_True;
}
// =======================================================================
void AIS_LightSource::setLocalTransformation (const Handle(TopLoc_Datum3D)& theTrsf)
{
- const gp_Trsf aTrsf = theTrsf->Transformation();
+ const gp_Trsf aTrsf = !theTrsf.IsNull() ? theTrsf->Transformation() : gp_Trsf();
switch (myLightSource->Type())
{
case Graphic3d_TypeOfLightSource_Ambient:
Aspect_TypeOfMarker myCodirMarkerType; //!< icon of arrow co-directional to camera direction (look from)
Aspect_TypeOfMarker myOpposMarkerType; //!< icon of arrow opposite to camera direction (look at)
- Graphic3d_Vec2i myStartTransform; //!< position of starting transformation
gp_Trsf myLocTrsfStart; //!< object transformation before transformation
Standard_Real mySize; //!< presentation size
Standard_Integer myNbArrows; //!< number of directional light arrows