const Standard_Real theY,
const Standard_Real theZ)
{
- return AddVertex (Standard_ShortReal (theX),
- Standard_ShortReal (theY),
- Standard_ShortReal (theZ));
+ return AddVertex (RealToShortReal (theX),
+ RealToShortReal (theY),
+ RealToShortReal (theZ));
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
const Standard_Real theNX, const Standard_Real theNY, const Standard_Real theNZ)
{
- return AddVertex (Standard_ShortReal (theX), Standard_ShortReal (theY), Standard_ShortReal (theZ),
+ return AddVertex (RealToShortReal (theX), RealToShortReal (theY), RealToShortReal (theZ),
Standard_ShortReal (theNX), Standard_ShortReal (theNY), Standard_ShortReal (theNZ));
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
const Standard_Real theTX, const Standard_Real theTY)
{
- return AddVertex (Standard_ShortReal (theX), Standard_ShortReal (theY), Standard_ShortReal (theZ),
+ return AddVertex (RealToShortReal (theX), RealToShortReal (theY), RealToShortReal (theZ),
Standard_ShortReal (theTX), Standard_ShortReal (theTY));
}
const Standard_Real theNX, const Standard_Real theNY, const Standard_Real theNZ,
const Standard_Real theTX, const Standard_Real theTY)
{
- return AddVertex (Standard_ShortReal (theX), Standard_ShortReal (theY), Standard_ShortReal (theZ),
+ return AddVertex (RealToShortReal (theX), RealToShortReal (theY), RealToShortReal (theZ),
Standard_ShortReal (theNX), Standard_ShortReal (theNY), Standard_ShortReal (theNZ),
Standard_ShortReal (theTX), Standard_ShortReal (theTY));
}
// "FitAll" operation ignores object with transform persistence parameter
const Bnd_Box aBox = theStruct->MinMaxValues (theToIgnoreInfiniteFlag);
+
+ // To prevent float overflow at camera parameters calculation and further
+ // rendering, bounding boxes with at least one vertex coordinate out of
+ // float range are skipped by view fit algorithms
+ if (Abs (aBox.CornerMax().X()) >= ShortRealLast() ||
+ Abs (aBox.CornerMax().Y()) >= ShortRealLast() ||
+ Abs (aBox.CornerMax().Z()) >= ShortRealLast() ||
+ Abs (aBox.CornerMin().X()) >= ShortRealLast() ||
+ Abs (aBox.CornerMin().Y()) >= ShortRealLast() ||
+ Abs (aBox.CornerMin().Z()) >= ShortRealLast())
+ return;
+
theBndBox.Add (aBox);
}
--- /dev/null
+puts "============"
+puts "CR25935"
+puts "Visualization, TKV3d, Exception when displaying shell in the viewer"
+puts "============"
+puts ""
+
+pload VISUALIZATION MODELING
+
+restore [locate_data_file bug25935.brep] aShape
+explode aShape Sh
+
+vinit
+
+# check displaying and selection of a sub-shell of the shape
+vdisplay aShape_3
+vfit
+vmoveto 214 200
+checkcolor 214 200 0 1 1
+
+vremove -all
+
+# check displaying and selection of the whole shape
+vdisplay aShape
+vfit
+vmoveto 192 211
+vmoveto 213 191
+vmoveto 205 205
+vmoveto 197 194
+checkcolor 205 205 0 1 1