1 // Created on: 1993-03-10
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <Geom_Vector.hxx>
20 #include <gp_VectorWithNullMagnitude.hxx>
21 #include <Standard_ConstructionError.hxx>
22 #include <Standard_DomainError.hxx>
23 #include <Standard_Type.hxx>
25 IMPLEMENT_STANDARD_RTTIEXT(Geom_Vector,Geom_Geometry)
27 typedef Geom_Vector Vector;
33 void Geom_Vector::Reverse () { gpVec.Reverse(); }
35 Standard_Real Geom_Vector::X () const { return gpVec.X(); }
37 Standard_Real Geom_Vector::Y () const { return gpVec.Y(); }
39 Standard_Real Geom_Vector::Z () const { return gpVec.Z(); }
41 const gp_Vec& Geom_Vector::Vec () const { return gpVec; }
43 Handle(Geom_Vector) Geom_Vector::Reversed () const
45 Handle(Geom_Vector) V = Handle(Geom_Vector)::DownCast(Copy());
51 Standard_Real Geom_Vector::Angle (const Handle(Geom_Vector)& Other) const {
53 return gpVec.Angle (Other->Vec());
57 Standard_Real Geom_Vector::AngleWithRef (
58 const Handle(Geom_Vector)& Other, const Handle(Geom_Vector)& VRef) const {
60 return gpVec.AngleWithRef (Other->Vec(), VRef->Vec());
64 void Geom_Vector::Coord (Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const {
66 gpVec.Coord (X, Y, Z);
70 Standard_Real Geom_Vector::Dot (const Handle(Geom_Vector)& Other) const {
72 return gpVec.Dot (Other->Vec());
76 Standard_Real Geom_Vector::DotCross (
77 const Handle(Geom_Vector)& V1, const Handle(Geom_Vector)& V2) const {
79 return gpVec.DotCross (V1->Vec(), V2->Vec());