mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-06-30 12:14:08 +03:00
0030291: Visualization - manipulator crashes when is attached with scaling mode disabled
- in ComputeSelection() method checks are added to avoid taking triangulation of manipulator parts that are not computed
This commit is contained in:
parent
cdcf6fc27a
commit
f15c5f90c3
@ -271,6 +271,18 @@ void AIS_Manipulator::SetPart (const Standard_Integer theAxisIndex, const AIS_Ma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetPart
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void AIS_Manipulator::SetPart (const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled)
|
||||||
|
{
|
||||||
|
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||||
|
{
|
||||||
|
SetPart (anIt, theMode, theIsEnabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : EnableMode
|
//function : EnableMode
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -995,6 +1007,10 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
|
|||||||
{
|
{
|
||||||
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||||
{
|
{
|
||||||
|
if (!myAxes[anIt].HasTranslation())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const Axis& anAxis = myAxes[anIt];
|
const Axis& anAxis = myAxes[anIt];
|
||||||
if (aMode != AIS_MM_None)
|
if (aMode != AIS_MM_None)
|
||||||
{
|
{
|
||||||
@ -1016,6 +1032,10 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
|
|||||||
{
|
{
|
||||||
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||||
{
|
{
|
||||||
|
if (!myAxes[anIt].HasRotation())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const Axis& anAxis = myAxes[anIt];
|
const Axis& anAxis = myAxes[anIt];
|
||||||
if (aMode != AIS_MM_None)
|
if (aMode != AIS_MM_None)
|
||||||
{
|
{
|
||||||
@ -1036,6 +1056,10 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
|
|||||||
{
|
{
|
||||||
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||||
{
|
{
|
||||||
|
if (!myAxes[anIt].HasScaling())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (aMode != AIS_MM_None)
|
if (aMode != AIS_MM_None)
|
||||||
{
|
{
|
||||||
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Scaling, 9);
|
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Scaling, 9);
|
||||||
|
@ -112,6 +112,12 @@ public:
|
|||||||
//! @warning Raises program error if axis index is < 0 or > 2.
|
//! @warning Raises program error if axis index is < 0 or > 2.
|
||||||
Standard_EXPORT void SetPart (const Standard_Integer theAxisIndex, const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled);
|
Standard_EXPORT void SetPart (const Standard_Integer theAxisIndex, const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled);
|
||||||
|
|
||||||
|
//! Disable or enable visual parts for translation, rotation or scaling for ALL axes.
|
||||||
|
//! By default all parts are enabled (will be displayed).
|
||||||
|
//! @warning Enabling or disabling of visual parts of manipulator does not manage the manipulation (selection) mode.
|
||||||
|
//! @warning Raises program error if axis index is < 0 or > 2.
|
||||||
|
Standard_EXPORT void SetPart (const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled);
|
||||||
|
|
||||||
//! Behavior settings to be applied when performing transformation:
|
//! Behavior settings to be applied when performing transformation:
|
||||||
//! - FollowTranslation - whether the manipulator will be moved together with an object.
|
//! - FollowTranslation - whether the manipulator will be moved together with an object.
|
||||||
//! - FollowRotation - whether the manipulator will be rotated together with an object.
|
//! - FollowRotation - whether the manipulator will be rotated together with an object.
|
||||||
|
25
tests/v3d/manipulator/disable_parts
Normal file
25
tests/v3d/manipulator/disable_parts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "====================================="
|
||||||
|
puts "Disable functional parts for manipulator axes"
|
||||||
|
puts "====================================="
|
||||||
|
|
||||||
|
pload MODELING VISUALIZATION
|
||||||
|
vclear
|
||||||
|
vclose ALL
|
||||||
|
vinit View1
|
||||||
|
vaxo
|
||||||
|
vzbufftrihedron
|
||||||
|
|
||||||
|
box b 500 500 1 50 100 150
|
||||||
|
vdisplay b -dispMode 1
|
||||||
|
vfit
|
||||||
|
|
||||||
|
vmanipulator m -attach b -part 0 1 0
|
||||||
|
vdump $imagedir/${casename}_1.png
|
||||||
|
vmanipulator m -detach
|
||||||
|
|
||||||
|
vmanipulator m -attach b -part 0 2 0
|
||||||
|
vdump $imagedir/${casename}_2.png
|
||||||
|
vmanipulator m -detach
|
||||||
|
|
||||||
|
vmanipulator m -attach b -part 0 3 0
|
||||||
|
vdump $imagedir/${casename}_3.png
|
Loading…
x
Reference in New Issue
Block a user