0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / Geom / Geom_Vector.cxx
CommitLineData
b311480e 1// Created on: 1993-03-10
2// Created by: JCV
3// Copyright (c) 1993-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
42cf5bc1 17
18#include <Geom_Vector.hxx>
19#include <gp_Vec.hxx>
20#include <gp_VectorWithNullMagnitude.hxx>
21#include <Standard_ConstructionError.hxx>
22#include <Standard_DomainError.hxx>
23#include <Standard_Type.hxx>
7fd59977 24
92efcf78 25IMPLEMENT_STANDARD_RTTIEXT(Geom_Vector,Geom_Geometry)
26
7fd59977 27typedef Geom_Vector Vector;
7fd59977 28typedef gp_Ax1 Ax1;
29typedef gp_Ax2 Ax2;
30typedef gp_Pnt Pnt;
31typedef gp_Trsf Trsf;
32
7fd59977 33void Geom_Vector::Reverse () { gpVec.Reverse(); }
34
35Standard_Real Geom_Vector::X () const { return gpVec.X(); }
36
37Standard_Real Geom_Vector::Y () const { return gpVec.Y(); }
38
39Standard_Real Geom_Vector::Z () const { return gpVec.Z(); }
40
41const gp_Vec& Geom_Vector::Vec () const { return gpVec; }
42
c04c30b3 43Handle(Geom_Vector) Geom_Vector::Reversed () const
7fd59977 44{
c04c30b3 45 Handle(Geom_Vector) V = Handle(Geom_Vector)::DownCast(Copy());
7fd59977 46 V->Reverse();
47 return V;
48}
49
50
c04c30b3 51Standard_Real Geom_Vector::Angle (const Handle(Geom_Vector)& Other) const {
7fd59977 52
53 return gpVec.Angle (Other->Vec());
54}
55
56
57Standard_Real Geom_Vector::AngleWithRef (
c04c30b3 58const Handle(Geom_Vector)& Other, const Handle(Geom_Vector)& VRef) const {
7fd59977 59
60 return gpVec.AngleWithRef (Other->Vec(), VRef->Vec());
61}
62
63
64void Geom_Vector::Coord (Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const {
65
66 gpVec.Coord (X, Y, Z);
67}
68
69
c04c30b3 70Standard_Real Geom_Vector::Dot (const Handle(Geom_Vector)& Other) const {
7fd59977 71
72 return gpVec.Dot (Other->Vec());
73}
74
75
76Standard_Real Geom_Vector::DotCross (
c04c30b3 77const Handle(Geom_Vector)& V1, const Handle(Geom_Vector)& V2) const {
7fd59977 78
79 return gpVec.DotCross (V1->Vec(), V2->Vec());
80}
81
82
83