myIsInitialized = true;
}
}
+
+bool GeomData_Dir::isInitialized()
+{
+ // Check once again the direction is initialized.
+ // Use case (bos #18905): draw a sketch, click "Change sketch plane", then abort it.
+ // myIsInitialized value is dropped to false, thus recheck.
+ if (!myIsInitialized)
+ myIsInitialized = myLab.FindAttribute(TDataStd_RealArray::GetID(), myCoords) == Standard_True;
+ return ModelAPI_Attribute::isInitialized();
+}
/// Returns the coordinates of this attribute
GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_XYZ> xyz();
+ /// Returns \c ture if the direction is initialized
+ GEOMDATA_EXPORT virtual bool isInitialized();
+
protected:
/// Initializes attributes
GEOMDATA_EXPORT GeomData_Dir(TDF_Label& theLabel);
// Compute shifting vector for a one symbol
gp_Vec aShift = aVec1.Crossed(thePrs->plane()->normal()->impl<gp_Dir>());
- aShift.Normalize();
+ if (aShift.SquareMagnitude() > Precision::SquareConfusion())
+ aShift.Normalize();
aShift.Multiply(theStep * 0.8);
// Shift the position coordinate according to position index