5 #ifndef _MGPosition_HH_
6 #define _MGPosition_HH_
11 #include "mg/Vector.h"
122 MGPosition(
double x,
double y,
double z):m_element(x,y,z){;};
125 MGPosition(
double x,
double y,
double z,
double w):m_element(x,y,z,w){;};
136 ,
int start1=0,
int start2=0)
137 :m_element(sdim, p, start1, start2){;};
140 MGPosition(
const std::vector<double>& darrays): m_element(darrays){;};
155 double operator[] (
int i)
const{
return m_element.ref(i);}
156 double operator() (
int i)
const{
return m_element.ref(i);}
207 double closest(
const MGCurve& curve)
const;
218 const double*
data()
const{
return m_element.data();};
219 double*
data(){
return m_element.data();};
235 )
const{
return m_element.is_collinear(P2,P3);};
238 bool is_null()
const{
return m_element.is_null();};
242 double len()
const{
return m_element.len();};
270 int SubordinateEntitySwitch=0
276 double param(
const MGCurve& crv)
const;
304 double ref(
int i)
const{
return m_element.ref(i);}
308 void resize(
int new_sdim){m_element.resize(new_sdim);};
311 int sdim()
const {
return m_element.sdim();}
338 void swap(
int i,
int j){m_element.swap(i,j);};
343 int dump_size()
const;
387 return origin.
angle(P1,P2,N);
friend MGPosition operator*(double s, const MGPosition &p)
Definition: Position.h:70
double angle2pai(const MGVector &v2, const MGVector &N) const
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
double & operator()(int i)
Access to i-th element.
Definition: Position.h:159
MGPoint represents one dimensional manifold, a point in a space.
Definition: Point.h:28
friend MGPosition operator+(const MGPosition &p1, const MGVector &vec)
Translation of the position.
Definition: Position.h:34
MGPosition(double x, double y)
Construct 2D position by providing x,y coordinate data.
Definition: Position.h:119
double len() const
Definition: Position.h:242
MGPosition(const std::vector< double > &darrays)
Construct from std::vector
Definition: Position.h:140
bool is_null() const
Test if this is null.
Definition: Position.h:238
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
friend double operator%(const MGPosition &p1, const MGVector &v)
Definition: Position.h:55
std::ostream & operator<<(std::ostream &ostrm, const MGisect &is)
Debug Function.
Definition: isect.h:95
friend MGVector operator-(const MGPosition &p1, const MGPosition &p2)
自身のPositionと与えられたPositionの減算してMGVectorを生成
Definition: Position.h:42
MGPosition(int sdim, const double *v)
Definition: Position.h:131
MG_DLL_DECLR MGVector & operator*=(MGVector &v, const MGMatrix &m)
Vector of a general n space dimension.
Definition: Vector.h:26
friend bool operator!=(const MGPosition &p1, const MGPosition &p2)
Definition: Position.h:90
void swap(int i, int j)
Definition: Position.h:338
double angle(const MGPosition &start, const MGPosition &end, const MGVector &normal) const
bool is_collinear(const MGPosition &P2, const MGPosition &P3) const
Definition: Position.h:232
void set_null()
Set this as a null position.
Definition: Position.h:314
MG_DLL_DECLR bool is_collinear(const MGPosition &P1, const MGPosition &P2, const MGPosition &P3)
Test if P1, P2, and P3 are on a single straight line.
MGPosition(int sdim=0)
Void constructor void コンストラクタ
Definition: Position.h:116
friend MGPosition operator*(const MGPosition &p1, double s)
Scalarの乗算を行いPositionを生成
Definition: Position.h:74
friend bool operator>=(const MGPosition &p1, const MGPosition &p2)
Definition: Position.h:105
MGPosition(double x, double y, double z, double w)
Construct 4D position by providing x,y,z,w coordinate data.
Definition: Position.h:125
int sdim() const
Get the space dimension.
Definition: Position.h:311
MG_DLL_DECLR MGVector operator*(const MGVector &v, const MGMatrix &m)
Represent a positional data.
Definition: Position.h:28
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
double * data()
Definition: Position.h:219
friend MGPosition operator-(const MGVector &v, const MGPosition &p1)
自身のPositionと与えられたVectorの減算してMGPositionを生成
Definition: Position.h:50
MGVector project(const MGVector &v2) const
friend bool operator!=(const MGPosition &p1, const MGVector &p2)
Definition: Position.h:94
friend MGPosition operator+(const MGPosition &p1, const MGPosition &p2)
Definition: Position.h:36
friend MGPosition operator/(const MGPosition &p1, double s)
Definition: Position.h:79
MGParam_Vector provides a list to store parameters of a curve.
Definition: CParam_list.h:18
friend bool operator<(const MGPosition &p1, const MGPosition &p2)
Definition: Position.h:99
double angle(const MGVector &V1, const MGVector &V2, const MGVector &N)
Compute the angel around the normal N in radian range[0., 2*pia).
Definition: Position.h:371
friend MGPosition operator-(const MGPosition &p1, const MGVector &v)
自身のPositionと与えられたVectorの減算してMGPositionを生成
Definition: Position.h:46
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
MGPosition_list provides a list of Positions.
Definition: Position_list.h:27
friend bool operator<=(const MGPosition &p1, const MGPosition &p2)
Definition: Position.h:101
MGOgesIfstream write out to *.iges file, transforming MGCL objects to IGES objects.
Definition: IgesOfstream.h:26
MGPosition * clone() const
Definition: Position.h:215
MGPosition(const MGVector &vec)
Conversion Constructor from a vector.
Definition: Position.h:113
MGPosition(double x, double y, double z)
Construct 3D position by providing x,y,z coordinate data.
Definition: Position.h:122
void resize(int new_sdim)
Definition: Position.h:308
double ref(int i) const
Definition: Position.h:304
const MGVector & vector() const
Definition: Position.h:340
const double * data() const
Return the 1st address of the array of the point double data.
Definition: Position.h:218
MGVector project(const MGVector &v2) const
Definition: Position.h:302
friend bool operator!=(const MGVector &p1, const MGPosition &p2)
Definition: Position.h:92
MGPosition(int sdim, const MGPosition &p, int start1=0, int start2=0)
Definition: Position.h:135
MGMatrix is a matix of m by m, where m is the space dimension.
Definition: Matrix.h:30
friend bool operator>(const MGPosition &p1, const MGPosition &p2)
Definition: Position.h:103