Loading files
// Created on: 1993-03-10
// Created by: JCV
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Geom_Geometry.hxx>
#include <Geom_Vector.hxx>
#include <Geom_VectorWithMagnitude.hxx>
#include <gp_Pnt.hxx>
#include <gp_Trsf.hxx>
#include <gp_Vec.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Geom_VectorWithMagnitude, Geom_Vector)
typedef Geom_VectorWithMagnitude VectorWithMagnitude;
typedef Geom_Vector Vector;
typedef gp_Ax1 Ax1;
typedef gp_Ax2 Ax2;
typedef gp_Pnt Pnt;
typedef gp_Trsf Trsf;
//=================================================================================================
Geom_VectorWithMagnitude::Geom_VectorWithMagnitude(const gp_Vec& V)
{
gpVec = V;
}
//=================================================================================================
Geom_VectorWithMagnitude::Geom_VectorWithMagnitude(const double X, const double Y, const double Z)
{
gpVec = gp_Vec(X, Y, Z);
}
//=================================================================================================
Geom_VectorWithMagnitude::Geom_VectorWithMagnitude(const Pnt& P1, const Pnt& P2)
{
gpVec = gp_Vec(P1, P2);
}
//=================================================================================================
occ::handle<Geom_Geometry> Geom_VectorWithMagnitude::Copy() const
{
occ::handle<Geom_VectorWithMagnitude> V;
V = new VectorWithMagnitude(gpVec);
return V;
}
//=================================================================================================
void Geom_VectorWithMagnitude::SetCoord(const double X, const double Y, const double Z)
{
gpVec = gp_Vec(X, Y, Z);
}
//=================================================================================================
void Geom_VectorWithMagnitude::SetVec(const gp_Vec& V)
{
gpVec = V;
}
//=================================================================================================
void Geom_VectorWithMagnitude::SetX(const double X)
{
gpVec.SetX(X);
}
//=================================================================================================
void Geom_VectorWithMagnitude::SetY(const double Y)
{
gpVec.SetY(Y);
}
//=================================================================================================
void Geom_VectorWithMagnitude::SetZ(const double Z)
{
gpVec.SetZ(Z);
}
//=================================================================================================
double Geom_VectorWithMagnitude::Magnitude() const
{
return gpVec.Magnitude();
}
//=================================================================================================
double Geom_VectorWithMagnitude::SquareMagnitude() const
{
return gpVec.SquareMagnitude();
}
//=================================================================================================
void Geom_VectorWithMagnitude::Add(const occ::handle<Geom_Vector>& Other)
{
gpVec.Add(Other->Vec());
}
//=================================================================================================
occ::handle<Geom_VectorWithMagnitude> Geom_VectorWithMagnitude::Added(
const occ::handle<Geom_Vector>& Other) const
{
gp_Vec V1 = gpVec;
V1.Add(Other->Vec());
return new VectorWithMagnitude(V1);
}
//=================================================================================================
void Geom_VectorWithMagnitude::Cross(const occ::handle<Geom_Vector>& Other)
{
gpVec.Cross(Other->Vec());
}
//=================================================================================================
occ::handle<Geom_Vector> Geom_VectorWithMagnitude::Crossed(
const occ::handle<Geom_Vector>& Other) const
{
gp_Vec V(gpVec);
V.Cross(Other->Vec());
return new VectorWithMagnitude(V);
}
//=================================================================================================
void Geom_VectorWithMagnitude::CrossCross(const occ::handle<Geom_Vector>& V1,
const occ::handle<Geom_Vector>& V2)
{
gpVec.CrossCross(V1->Vec(), V2->Vec());
}
//=================================================================================================
occ::handle<Geom_Vector> Geom_VectorWithMagnitude::CrossCrossed(
const occ::handle<Geom_Vector>& V1,
const occ::handle<Geom_Vector>& V2) const
{
gp_Vec V(gpVec);
V.CrossCross(V1->Vec(), V2->Vec());
return new VectorWithMagnitude(V);
}
//=================================================================================================
void Geom_VectorWithMagnitude::Divide(const double Scalar)
{
gpVec.Divide(Scalar);
}
//=================================================================================================
occ::handle<Geom_VectorWithMagnitude> Geom_VectorWithMagnitude::Divided(const double Scalar) const
{
gp_Vec V(gpVec);
V.Divide(Scalar);
return new VectorWithMagnitude(V);
}
//=================================================================================================
occ::handle<Geom_VectorWithMagnitude> Geom_VectorWithMagnitude::Multiplied(
const double Scalar) const
{
gp_Vec V(gpVec);
V.Multiply(Scalar);
return new VectorWithMagnitude(V);
}
//=================================================================================================
void Geom_VectorWithMagnitude::Multiply(const double Scalar)
{
gpVec.Multiply(Scalar);
}
//=================================================================================================
void Geom_VectorWithMagnitude::Normalize()
{
gpVec.Normalize();
}
//=================================================================================================
occ::handle<Geom_VectorWithMagnitude> Geom_VectorWithMagnitude::Normalized() const
{
gp_Vec V(gpVec);
V.Normalize();
return new VectorWithMagnitude(V);
}
//=================================================================================================
void Geom_VectorWithMagnitude::Subtract(const occ::handle<Geom_Vector>& Other)
{
gpVec.Subtract(Other->Vec());
}
//=================================================================================================
occ::handle<Geom_VectorWithMagnitude> Geom_VectorWithMagnitude::Subtracted(
const occ::handle<Geom_Vector>& Other) const
{
gp_Vec V(gpVec);
V.Subtract(Other->Vec());
return new VectorWithMagnitude(V);
}
//=================================================================================================
void Geom_VectorWithMagnitude::Transform(const Trsf& T)
{
gpVec.Transform(T);
}
3d097a032This file is pinned to the selected release. Download the original to open it in your design tool.