return 0;
}
+//=======================================================================
+//function : OCC26750
+//purpose :
+//=======================================================================
+static Standard_Integer OCC26750( Draw_Interpretor& theDI,
+ Standard_Integer /*theNArg*/,
+ const char ** /*theArgVal*/)
+{
+ const gp_Vec2d aVec1(1.0, 0.0);
+ const gp_Vec2d aVec2(0.0, -1.0);
+
+ if(aVec1.IsNormal(aVec2, Precision::Angular()))
+ {
+ theDI << "gp_Vec2d OK. Vectors are normal.\n";
+ }
+ else
+ {
+ theDI << "Error in gp_Vec2d. Vectors should be normal.\n";
+ }
+
+ const gp_Dir2d aD1(1.0, 0.0);
+ const gp_Dir2d aD2(0.0, -1.0);
+
+ if(aD1.IsNormal(aD2, Precision::Angular()))
+ {
+ theDI << "gp_Dir2d OK. Vectors are normal.\n";
+ }
+ else
+ {
+ theDI << "Error in gp_Dir2d. Vectors should be normal.\n";
+ }
+
+ return 0;
+}
+
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
theCommands.Add ("OCC26525", "OCC26525 result edge face ", __FILE__, OCC26525, group);
theCommands.Add ("OCC24537", "OCC24537 [file]", __FILE__, OCC24537, group);
+ theCommands.Add ("OCC26750", "OCC26750", __FILE__, OCC26750, group);
+
return;
}
//! Returns True if PI - Abs(<me>.Angle(Other)) <= AngularTolerance
//! Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or
//! Other.Magnitude() <= Resolution from gp.
- Standard_Boolean IsOpposite (const gp_Vec2d& Other, const Standard_Real AngularTolerance) const;
+ Standard_Boolean IsOpposite (const gp_Vec2d& Other, const Standard_Real AngularTolerance) const;
//! Returns true if Abs(Angle(<me>, Other)) <= AngularTolerance or
//! Two vectors with opposite directions are considered as parallel.
//! Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or
//! Other.Magnitude() <= Resolution from gp
- Standard_Boolean IsParallel (const gp_Vec2d& Other, const Standard_Real AngularTolerance) const;
+ Standard_Boolean IsParallel (const gp_Vec2d& Other, const Standard_Real AngularTolerance) const;
//! Computes the angular value between <me> and <Other>
Standard_Real SquareMagnitude() const;
void Add (const gp_Vec2d& Other);
- void operator += (const gp_Vec2d& Other)
-{
- Add(Other);
-}
+ void operator += (const gp_Vec2d& Other)
+ {
+ Add(Other);
+ }
//! Adds two vectors
gp_Vec2d Added (const gp_Vec2d& Other) const;
- gp_Vec2d operator + (const gp_Vec2d& Other) const
-{
- return Added(Other);
-}
+ gp_Vec2d operator + (const gp_Vec2d& Other) const
+ {
+ return Added(Other);
+ }
//! Computes the crossing product between two vectors
Standard_Real Crossed (const gp_Vec2d& Right) const;
- Standard_Real operator ^ (const gp_Vec2d& Right) const
-{
- return Crossed(Right);
-}
+ Standard_Real operator ^ (const gp_Vec2d& Right) const
+ {
+ return Crossed(Right);
+ }
//! Computes the magnitude of the cross product between <me> and
Standard_Real CrossSquareMagnitude (const gp_Vec2d& Right) const;
void Divide (const Standard_Real Scalar);
- void operator /= (const Standard_Real Scalar)
-{
- Divide(Scalar);
-}
+ void operator /= (const Standard_Real Scalar)
+ {
+ Divide(Scalar);
+ }
//! divides a vector by a scalar
gp_Vec2d Divided (const Standard_Real Scalar) const;
- gp_Vec2d operator / (const Standard_Real Scalar) const
-{
- return Divided(Scalar);
-}
+ gp_Vec2d operator / (const Standard_Real Scalar) const
+ {
+ return Divided(Scalar);
+ }
//! Computes the scalar product
Standard_Real Dot (const gp_Vec2d& Other) const;
- Standard_Real operator * (const gp_Vec2d& Other) const
-{
- return Dot(Other);
-}
-
+ Standard_Real operator * (const gp_Vec2d& Other) const
+ {
+ return Dot(Other);
+ }
+
gp_Vec2d GetNormal() const;
void Multiply (const Standard_Real Scalar);
- void operator *= (const Standard_Real Scalar)
-{
- Multiply(Scalar);
-}
+ void operator *= (const Standard_Real Scalar)
+ {
+ Multiply(Scalar);
+ }
//! Normalizes a vector
//! Raises an exception if the magnitude of the vector is
//! lower or equal to Resolution from package gp.
gp_Vec2d Multiplied (const Standard_Real Scalar) const;
- gp_Vec2d operator * (const Standard_Real Scalar) const
-{
- return Multiplied(Scalar);
-}
+ gp_Vec2d operator * (const Standard_Real Scalar) const
+ {
+ return Multiplied(Scalar);
+ }
void Normalize();
//! Reverses the direction of a vector
gp_Vec2d Reversed() const;
- gp_Vec2d operator -() const
-{
- return Reversed();
-}
+ gp_Vec2d operator -() const
+ {
+ return Reversed();
+ }
//! Subtracts two vectors
void Subtract (const gp_Vec2d& Right);
- void operator -= (const gp_Vec2d& Right)
-{
- Subtract(Right);
-}
+ void operator -= (const gp_Vec2d& Right)
+ {
+ Subtract(Right);
+ }
//! Subtracts two vectors
gp_Vec2d Subtracted (const gp_Vec2d& Right) const;
- gp_Vec2d operator - (const gp_Vec2d& Right) const
-{
- return Subtracted(Right);
-}
+ gp_Vec2d operator - (const gp_Vec2d& Right) const
+ {
+ return Subtracted(Right);
+ }
//! <me> is set to the following linear form :
{ return coord; }
inline Standard_Boolean gp_Vec2d::IsNormal
-(const gp_Vec2d& Other,
- const Standard_Real AngularTolerance) const
+(const gp_Vec2d& theOther,
+ const Standard_Real theAngularTolerance) const
{
- Standard_Real Ang = Angle(Other);
- if (Ang < 0) Ang = - Ang;
- Ang = M_PI / 2.0 - Angle(Other);
- if (Ang < 0) Ang = - Ang;
- return Ang <= AngularTolerance;
+ const Standard_Real anAng = Abs(M_PI_2 - Abs(Angle(theOther)));
+ return !(anAng > theAngularTolerance);
}
inline Standard_Boolean gp_Vec2d::IsOpposite
{ return V.Multiplied(Scalar); }
inline gp_Vec2d gp_Vec2d::GetNormal() const
- {
+{
return gp_Vec2d(this->Y(), (-1)*this->X());
- }
+}