|
|
|
|
|
#pragma once
|
|
|
|
|
|
#include "MLVector.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define MLDPoint MLPoint
|
|
|
|
|
|
class MLPlNode;
|
|
|
|
|
|
class MLPoint : public MLVector
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
MLPoint(void);
|
|
|
|
|
|
MLPoint(double vx, double vy);
|
|
|
|
|
|
MLPoint(double vx, double vy, double vz);
|
|
|
|
|
|
MLPoint(double vx, double vy, double vz, double vcz);
|
|
|
|
|
|
MLPoint(double vx, double vy, double vz, double vcz, double vl);
|
|
|
|
|
|
MLPoint(double vx, double vy, char* name);
|
|
|
|
|
|
MLPoint(double vx, double vy, double vz, char* name);
|
|
|
|
|
|
MLPoint(const MLPoint& dPoint);
|
|
|
|
|
|
MLPoint(const MLPlNode& node);
|
|
|
|
|
|
explicit MLPoint(const QPointF& point);
|
|
|
|
|
|
~MLPoint(void);
|
|
|
|
|
|
|
|
|
|
|
|
// Ԫ<><D4AA><EFBFBD><EFBFBD>
|
|
|
|
|
|
__declspec(property(get=getName, put = setName)) char* name;
|
|
|
|
|
|
__declspec(property(get=getCZ, put = setCZ)) double cz;
|
|
|
|
|
|
__declspec(property(get=getL, put = setL)) double l;
|
|
|
|
|
|
__declspec(property(get=getType, put = setType)) int type;
|
|
|
|
|
|
__declspec(property(get=getIndex, put = setIndex)) int index;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
const char* getName() const;
|
|
|
|
|
|
void setName(const char* name);
|
|
|
|
|
|
void setName(const QString& name);
|
|
|
|
|
|
QString getNameQStr();
|
|
|
|
|
|
|
|
|
|
|
|
void setCZ(double cz);
|
|
|
|
|
|
double getCZ() const;
|
|
|
|
|
|
double& getCZ();
|
|
|
|
|
|
|
|
|
|
|
|
double getL() const;
|
|
|
|
|
|
void setL(double l);
|
|
|
|
|
|
|
|
|
|
|
|
int getType() const;
|
|
|
|
|
|
void setType(int type);
|
|
|
|
|
|
|
|
|
|
|
|
int getIndex() const;
|
|
|
|
|
|
int& getIndex();
|
|
|
|
|
|
void setIndex(int idx);
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void setPoint(double dbx,double dby,double dbz);
|
|
|
|
|
|
void setPoint(const MLPoint& dPoint);
|
|
|
|
|
|
void setPoint(const MLPlNode& node);
|
|
|
|
|
|
void setPoint(const QPointF& point);
|
|
|
|
|
|
|
|
|
|
|
|
MLPoint& operator = (const MLPoint& point) throw();
|
|
|
|
|
|
MLPoint& operator = (const QPoint& point) throw();
|
|
|
|
|
|
|
|
|
|
|
|
// <20><>ƫ<EFBFBD><C6AB>
|
|
|
|
|
|
void offset(double offsetx, double offsety);
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
bool Equ(const MLPoint& other, int dot=6);
|
|
|
|
|
|
|
|
|
|
|
|
// ת<><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
MLPlNode toPlNode() const;
|
|
|
|
|
|
QPoint toQPoint() const;
|
|
|
|
|
|
QPointF toQPointF() const;
|
|
|
|
|
|
|
|
|
|
|
|
// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void readPoint(QDataStream& in);
|
|
|
|
|
|
void readPoint(FILE* fr);
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void writePoint(QDataStream& out);
|
|
|
|
|
|
void writePoint(FILE* fw);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
char m_name[32];
|
|
|
|
|
|
double m_cz;
|
|
|
|
|
|
double m_l; // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
int m_type;
|
|
|
|
|
|
int m_index; // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
MLMICROSTRUCTURE_EXPORT QDataStream &operator<<(QDataStream &stream, const MLPoint &point);
|
|
|
|
|
|
MLMICROSTRUCTURE_EXPORT QDataStream &operator>>(QDataStream &stream, MLPoint &point);
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
class MLMICROSTRUCTURE_EXPORT MLPointAry
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
MLPointAry();
|
|
|
|
|
|
~MLPointAry();
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
// <20><><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
int count() const;
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void resetCount(int count);
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void append(const MLPoint& dPoint);
|
|
|
|
|
|
void append(const MLPlNode& node);
|
|
|
|
|
|
void append(double x, double y, double z=0);
|
|
|
|
|
|
|
|
|
|
|
|
const MLPoint& at(int index) const;
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void setAt(int index, const MLPoint& dPoint);
|
|
|
|
|
|
const MLPoint& getAt(int index) const;
|
|
|
|
|
|
|
|
|
|
|
|
void removeAt(int index);
|
|
|
|
|
|
|
|
|
|
|
|
void insertAt(int index, const MLPoint& dPoint);
|
|
|
|
|
|
|
|
|
|
|
|
MLPoint* getData();
|
|
|
|
|
|
const MLPoint* getData() const;
|
|
|
|
|
|
|
|
|
|
|
|
MLPoint& operator[]( int index );
|
|
|
|
|
|
|
|
|
|
|
|
const MLPoint& operator[]( int index ) const;
|
|
|
|
|
|
|
|
|
|
|
|
void operator = (const MLPointAry& point) throw();
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void createPoint(int nNum);
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD><C8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void insertPt(double dl, const MLPoint& dPoint);
|
|
|
|
|
|
|
|
|
|
|
|
void copy(const MLPointAry& pointAry);
|
|
|
|
|
|
void append(const MLPointAry& pointAry);
|
|
|
|
|
|
|
|
|
|
|
|
void read(QDataStream& in);
|
|
|
|
|
|
void write(QDataStream& out);
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>鳤<EFBFBD><E9B3A4>λ<EFBFBD><CEBB>
|
|
|
|
|
|
void calPointPos();
|
|
|
|
|
|
|
|
|
|
|
|
// ʹ<><CAB9>֮ǰҪ<C7B0><D2AA><EFBFBD><EFBFBD>
|
|
|
|
|
|
double getDistance();
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD>
|
|
|
|
|
|
void calculateBox();
|
|
|
|
|
|
|
|
|
|
|
|
MLBox getBoundingBox() const;
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
|
double getXMax();
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X<EFBFBD><58>Сֵ
|
|
|
|
|
|
double getXMin();
|
|
|
|
|
|
|
|
|
|
|
|
// <20>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ĵ<EFBFBD>
|
|
|
|
|
|
MLPoint getCenterPt();
|
|
|
|
|
|
|
|
|
|
|
|
// <20><> X <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
double getYAscX(double x);
|
|
|
|
|
|
double getYDescX(double x);
|
|
|
|
|
|
|
|
|
|
|
|
//MLPline toPline();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
// <20><><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѱ<EFBFBD><D1B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
|
void sort(const MLPointAry& pointAry);
|
|
|
|
|
|
int bs(double dl, const MLPointAry& pointAry);
|
|
|
|
|
|
|
|
|
|
|
|
int findIndex(double x);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
QVector<MLPoint> m_PointAry;
|
|
|
|
|
|
bool m_bCalPos; // <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
|
};
|
|
|
|
|
|
|