mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d44b7b7442 | ||
|
6b9af22de9 | ||
|
d28545ca7b |
@@ -398,25 +398,17 @@ void AIS_Manipulator::Attach (const Handle(AIS_ManipulatorObjectSequence)& theOb
|
||||
const Handle(AIS_InteractiveContext)& aContext = Object()->GetContext();
|
||||
if (!aContext.IsNull())
|
||||
{
|
||||
if (!aCurObject.IsNull())
|
||||
if (!aContext->IsDisplayed (this))
|
||||
{
|
||||
Handle(Graphic3d_TransformPers) aTransPers = aCurObject->TransformPersistence();
|
||||
if (!aTransPers.IsNull())
|
||||
{
|
||||
aCurObject->TransformPersistence()->SetAnchorPoint(myPosition.Location());
|
||||
}
|
||||
}
|
||||
if (!aContext->IsDisplayed(this))
|
||||
{
|
||||
aContext->Display(this, Standard_False);
|
||||
aContext->Display (this, Standard_False);
|
||||
}
|
||||
else
|
||||
{
|
||||
aContext->Update(this, Standard_False);
|
||||
aContext->RecomputeSelectionOnly(this);
|
||||
aContext->Update (this, Standard_False);
|
||||
aContext->RecomputeSelectionOnly (this);
|
||||
}
|
||||
|
||||
aContext->Load(this);
|
||||
aContext->Load (this);
|
||||
}
|
||||
|
||||
if (theOptions.EnableModes)
|
||||
@@ -758,11 +750,6 @@ void AIS_Manipulator::Transform (const gp_Trsf& theTrsf)
|
||||
{
|
||||
anObj->SetLocalTransformation (theTrsf * anOldTrsf);
|
||||
}
|
||||
Handle(Graphic3d_TransformPers) aTransPers = anObj->TransformPersistence();
|
||||
if (!aTransPers.IsNull())
|
||||
{
|
||||
anObj->TransformPersistence()->SetAnchorPoint(myPosition.Location());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -819,32 +806,15 @@ void AIS_Manipulator::updateTransformation()
|
||||
{
|
||||
gp_Trsf aTrsf;
|
||||
|
||||
Handle(AIS_ManipulatorObjectSequence) anObjects = Objects();
|
||||
Handle(AIS_InteractiveObject) anObj = Object();
|
||||
for (AIS_ManipulatorObjectSequence::Iterator anObjIter(*anObjects); anObjIter.More(); anObjIter.Next())
|
||||
if (!myIsZoomPersistentMode)
|
||||
{
|
||||
anObj = anObjIter.Value();
|
||||
aTrsf.SetTransformation (myPosition, gp::XOY());
|
||||
}
|
||||
if (!anObj.IsNull())
|
||||
else
|
||||
{
|
||||
Handle(Graphic3d_TransformPers) aTransPers = anObj->TransformPersistence();
|
||||
if (!aTransPers.IsNull())
|
||||
{
|
||||
aTrsf.SetTransformation(myPosition, gp::XOY());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!myIsZoomPersistentMode)
|
||||
{
|
||||
aTrsf.SetTransformation(myPosition, gp::XOY());
|
||||
}
|
||||
else
|
||||
{
|
||||
const gp_Dir& aVDir = myPosition.Direction();
|
||||
const gp_Dir& aXDir = myPosition.XDirection();
|
||||
aTrsf.SetTransformation(gp_Ax2(gp::Origin(), aVDir, aXDir), gp::XOY());
|
||||
}
|
||||
}
|
||||
const gp_Dir& aVDir = myPosition.Direction();
|
||||
const gp_Dir& aXDir = myPosition.XDirection();
|
||||
aTrsf.SetTransformation (gp_Ax2 (gp::Origin(), aVDir, aXDir), gp::XOY());
|
||||
}
|
||||
|
||||
Handle(TopLoc_Datum3D) aGeomTrsf = new TopLoc_Datum3D (aTrsf);
|
||||
|
@@ -409,6 +409,17 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
|
||||
}
|
||||
|
||||
NCollection_Mat4<Standard_Real> aWorldView = theCamera->OrientationMatrix();
|
||||
|
||||
//Adjust the camera axial scale for trihedron behaviour
|
||||
gp_XYZ anAxialScale = theCamera->AxialScale();
|
||||
Standard_Real anAxialX = anAxialScale.X();
|
||||
Standard_Real anAxialY = anAxialScale.Y();
|
||||
Standard_Real anAxialZ = anAxialScale.Z();
|
||||
if (anAxialX > 0.0 && anAxialY > 0.0 && anAxialZ > 0.0)
|
||||
{
|
||||
Graphic3d_TransformUtils::Scale (aWorldView, 1.0 / anAxialX, 1.0 / anAxialY, 1.0 / anAxialZ);
|
||||
}
|
||||
|
||||
Graphic3d_TransformUtils::Translate (aWorldView, aCenter.X(), aCenter.Y(), aCenter.Z());
|
||||
Graphic3d_TransformUtils::Scale (aWorldView, aScale, aScale, aScale);
|
||||
theWorldView.ConvertFrom (aWorldView);
|
||||
|
46
tests/v3d/trihedron/bug27832
Normal file
46
tests/v3d/trihedron/bug27832
Normal file
@@ -0,0 +1,46 @@
|
||||
puts "========"
|
||||
puts "0027832: Visualization - Scaled zbuffer trihedron"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit
|
||||
box b 10 10 10
|
||||
vdisplay b
|
||||
vfit
|
||||
vsetdispmode 1
|
||||
vzbufftrihedron -on
|
||||
#draw initial picture of box without visual scale
|
||||
vdump $imagedir/${casename}_unscaled.png
|
||||
|
||||
#draw picture of box after visual scale
|
||||
#and zoomed out
|
||||
vscale 1 3 10
|
||||
vzoom 0.99
|
||||
|
||||
set color_1 [vreadpixel 55 360 -rgb -name]
|
||||
set color_2 [vreadpixel 50 350 -rgb -name]
|
||||
set color_3 [vreadpixel 55 355 -rgb -name]
|
||||
|
||||
if {$color_1 != "RED3"} {
|
||||
puts "ERROR: trihedron does not maintain position"
|
||||
puts " additional investigation is needed"
|
||||
puts " expected color is: RED3"
|
||||
puts " current color is: $color_1"
|
||||
}
|
||||
|
||||
if {$color_2 != "BLUE3"} {
|
||||
puts "ERROR: trihedron does not maintain position"
|
||||
puts " additional investigation is needed"
|
||||
puts " expected color is: BLUE3"
|
||||
puts " current color is: $color_2"
|
||||
}
|
||||
|
||||
if {$color_3 != "GREEN3"} {
|
||||
puts "ERROR: trihedron does not maintain position"
|
||||
puts " additional investigation is needed"
|
||||
puts " expected color is: GREEN3"
|
||||
puts " current color is: $color_3"
|
||||
}
|
||||
|
||||
vdump $imagedir/${casename}_scaled.png
|
Reference in New Issue
Block a user