1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0024610: Visualization, Visual3d_View::MinMaxValues() - skip erased objects while computing bounding box for Fit All operations

"vfit" takes into account erased objects

Visual3d_View::MinMaxValues() corrected to ignore hidden Graphic3d_Structure instances,
unused Graphic3d_StructureManager::MinMaxValues() removed.

Correction of test-case
This commit is contained in:
san
2014-08-21 11:43:33 +04:00
committed by bugmaster
parent 53b15292f1
commit aeb722e31a
4 changed files with 27 additions and 43 deletions

View File

@@ -231,15 +231,6 @@ is
---Purpose: Returns the values of the current default attributes.
---Category: Inquire methods
MinMaxValues ( me;
XMin, YMin, ZMin : out Real from Standard;
XMax, YMax, ZMax : out Real from Standard )
is static;
---Level: Public
---Purpose: Returns the coordinates of the boundary box of all
-- structures displayed in the manager <me>.
---Category: Inquire methods
PrimitivesAspect ( me;
CTXL : out AspectLine3d from Graphic3d;
CTXT : out AspectText3d from Graphic3d;

View File

@@ -271,40 +271,6 @@ void Graphic3d_StructureManager::PickStructures (Graphic3d_MapOfStructure& SG) c
}
void Graphic3d_StructureManager::MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const {
Standard_Boolean Flag = Standard_True;
Standard_Real Xm, Ym, Zm, XM, YM, ZM, RL, RF;
RL = RealLast ();
RF = RealFirst ();
XMin = YMin = ZMin = RL;
XMax = YMax = ZMax = RF;
Graphic3d_MapIteratorOfMapOfStructure it(MyDisplayedStructure);
for (; it.More(); it.Next()) {
Handle(Graphic3d_Structure) SG = it.Key();
if (! (SG->IsEmpty() || SG->IsInfinite ())) {
SG->MinMaxValues (Xm, Ym, Zm, XM, YM, ZM);
if (Xm < XMin) XMin = Xm;
if (Ym < YMin) YMin = Ym;
if (Zm < ZMin) ZMin = Zm;
if (XM > XMax) XMax = XM;
if (YM > YMax) YMax = YM;
if (ZM > ZMax) ZMax = ZM;
Flag = Standard_False;
}
}
// If all structures are empty or infinite
if (Flag) {
XMin = YMin = ZMin = RF;
XMax = YMax = ZMax = RL;
}
}
Standard_Integer Graphic3d_StructureManager::NewIdentification () {
Standard_Integer Id = MyStructGenId.Next ();

View File

@@ -1766,6 +1766,9 @@ void Visual3d_View::MinMaxValues (const Graphic3d_MapOfStructure& theSet,
{
const Handle(Graphic3d_Structure)& aStructure = anIterator.Key();
if (!aStructure->IsVisible())
continue;
if (aStructure->IsInfinite() && !theToIgnoreInfiniteFlag)
{
//XMin, YMin .... ZMax are initialized by means of infinite line data