Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Geom_VectorWithMagnitude.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 1993-03-10
0002 // Created by: JCV
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Geom_VectorWithMagnitude_HeaderFile
0018 #define _Geom_VectorWithMagnitude_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Geom_Vector.hxx>
0024 class gp_Vec;
0025 class gp_Pnt;
0026 class gp_Trsf;
0027 class Geom_Geometry;
0028 
0029 
0030 class Geom_VectorWithMagnitude;
0031 DEFINE_STANDARD_HANDLE(Geom_VectorWithMagnitude, Geom_Vector)
0032 
0033 
0034 //! Defines a vector with magnitude.
0035 //! A vector with magnitude can have a zero length.
0036 class Geom_VectorWithMagnitude : public Geom_Vector
0037 {
0038 
0039 public:
0040 
0041   
0042   //! Creates a transient copy of V.
0043   Standard_EXPORT Geom_VectorWithMagnitude(const gp_Vec& V);
0044   
0045   //! Creates a vector with three cartesian coordinates.
0046   Standard_EXPORT Geom_VectorWithMagnitude(const Standard_Real X, const Standard_Real Y, const Standard_Real Z);
0047   
0048 
0049   //! Creates a vector from the point P1 to the point P2.
0050   //! The magnitude of the vector is the distance between P1 and P2
0051   Standard_EXPORT Geom_VectorWithMagnitude(const gp_Pnt& P1, const gp_Pnt& P2);
0052   
0053   //! Assigns the values X, Y and Z to the coordinates of this vector.
0054   Standard_EXPORT void SetCoord (const Standard_Real X, const Standard_Real Y, const Standard_Real Z);
0055   
0056   //! Converts the gp_Vec vector V into this vector.
0057   Standard_EXPORT void SetVec (const gp_Vec& V);
0058   
0059   //! Changes the X coordinate of <me>.
0060   Standard_EXPORT void SetX (const Standard_Real X);
0061   
0062   //! Changes the Y coordinate of <me>
0063   Standard_EXPORT void SetY (const Standard_Real Y);
0064   
0065   //! Changes the Z coordinate of <me>.
0066   Standard_EXPORT void SetZ (const Standard_Real Z);
0067   
0068   //! Returns the magnitude of <me>.
0069   Standard_EXPORT Standard_Real Magnitude() const Standard_OVERRIDE;
0070   
0071   //! Returns the square magnitude of <me>.
0072   Standard_EXPORT Standard_Real SquareMagnitude() const Standard_OVERRIDE;
0073   
0074 
0075   //! Adds the Vector Other to <me>.
0076   Standard_EXPORT void Add (const Handle(Geom_Vector)& Other);
0077   
0078 
0079   //! Adds the vector Other to <me>.
0080   Standard_NODISCARD Standard_EXPORT Handle(Geom_VectorWithMagnitude) Added (const Handle(Geom_Vector)& Other) const;
0081   
0082 
0083   //! Computes the cross product  between <me> and Other
0084   //! <me> ^ Other.
0085   Standard_EXPORT void Cross (const Handle(Geom_Vector)& Other) Standard_OVERRIDE;
0086   
0087 
0088   //! Computes the cross product  between <me> and Other
0089   //! <me> ^ Other. A new vector is returned.
0090   Standard_EXPORT Handle(Geom_Vector) Crossed (const Handle(Geom_Vector)& Other) const Standard_OVERRIDE;
0091   
0092 
0093   //! Computes the triple vector product  <me> ^ (V1 ^ V2).
0094   Standard_EXPORT void CrossCross (const Handle(Geom_Vector)& V1, const Handle(Geom_Vector)& V2) Standard_OVERRIDE;
0095   
0096 
0097   //! Computes the triple vector product  <me> ^ (V1 ^ V2).
0098   //! A new vector is returned.
0099   Standard_EXPORT Handle(Geom_Vector) CrossCrossed (const Handle(Geom_Vector)& V1, const Handle(Geom_Vector)& V2) const Standard_OVERRIDE;
0100   
0101   //! Divides <me> by a scalar.
0102   Standard_EXPORT void Divide (const Standard_Real Scalar);
0103   
0104 
0105   //! Divides <me> by a scalar. A new vector is returned.
0106   Standard_NODISCARD Standard_EXPORT Handle(Geom_VectorWithMagnitude) Divided (const Standard_Real Scalar) const;
0107   
0108 
0109   //! Computes the product of the vector <me> by a scalar.
0110   //! A new vector is returned.
0111   Standard_NODISCARD Standard_EXPORT Handle(Geom_VectorWithMagnitude) Multiplied (const Standard_Real Scalar) const;
0112   
0113 
0114   //! Computes the product of the vector <me> by a scalar.
0115   Standard_EXPORT void Multiply (const Standard_Real Scalar);
0116   
0117   //! Normalizes <me>.
0118   //!
0119   //! Raised if the magnitude of the vector is lower or equal to
0120   //! Resolution from package gp.
0121   Standard_EXPORT void Normalize();
0122   
0123   //! Returns a copy of <me> Normalized.
0124   //!
0125   //! Raised if the magnitude of the vector is lower or equal to
0126   //! Resolution from package gp.
0127   Standard_NODISCARD Standard_EXPORT Handle(Geom_VectorWithMagnitude) Normalized() const;
0128   
0129   //! Subtracts the Vector Other to <me>.
0130   Standard_EXPORT void Subtract (const Handle(Geom_Vector)& Other);
0131   
0132 
0133   //! Subtracts the vector Other to <me>. A new vector is returned.
0134   Standard_NODISCARD Standard_EXPORT
0135     Handle(Geom_VectorWithMagnitude) Subtracted (const Handle(Geom_Vector)& Other) const;
0136   
0137   //! Applies the transformation T to this vector.
0138   Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE;
0139   
0140   //! Creates a new object which is a copy of this vector.
0141   Standard_EXPORT Handle(Geom_Geometry) Copy() const Standard_OVERRIDE;
0142 
0143 
0144 
0145 
0146   DEFINE_STANDARD_RTTIEXT(Geom_VectorWithMagnitude,Geom_Vector)
0147 
0148 protected:
0149 
0150 
0151 
0152 
0153 private:
0154 
0155 
0156 
0157 
0158 };
0159 
0160 
0161 
0162 
0163 
0164 
0165 
0166 #endif // _Geom_VectorWithMagnitude_HeaderFile