You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.1 KiB
52 lines
1.1 KiB
9 months ago
|
#pragma once
|
||
|
|
||
|
#ifdef _WIN32
|
||
9 months ago
|
#ifdef WIREROUTINGDLL_EXPORTS // VisualStudio DLL 项目模板会将 <PROJECTNAME>_EXPORTS 添加到定义预处理器宏。
|
||
|
#define POINT_API __declspec(dllexport) // _WIN32
|
||
9 months ago
|
#else
|
||
9 months ago
|
#define POINT_API __declspec(dllimport)
|
||
|
#endif
|
||
|
#else
|
||
|
#define POINT_API
|
||
|
#endif
|
||
9 months ago
|
|
||
|
#include <string>
|
||
|
#include <iostream>
|
||
|
#include <cmath>
|
||
|
#include <iomanip>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
extern const double POINT_API eps;
|
||
|
|
||
|
bool POINT_API Equal(double a, double b);
|
||
|
|
||
|
struct POINT_API P
|
||
|
{
|
||
9 months ago
|
double x, y, z; // 坐标
|
||
|
double dx, dy, dz; // 方向
|
||
|
bool isend; // 是否为端点
|
||
|
int type; // 0卡箍 1未确定分支点 2已确定分支点 3连接器
|
||
|
int ref; // 指向其代表的相应数据类型标号
|
||
9 months ago
|
|
||
|
bool operator<(P B) const;
|
||
|
bool operator==(P B) const;
|
||
|
bool operator!=(P B) const;
|
||
|
|
||
|
void set(int i, double v);
|
||
|
const double get(int i);
|
||
|
|
||
|
void reverse();
|
||
|
|
||
|
P(double x1, double y1, double z1);
|
||
|
P();
|
||
|
P operator-(P B) const;
|
||
|
P operator+(P B) const;
|
||
|
P operator*(double p) const;
|
||
|
P operator/(double p) const;
|
||
|
void print(string s);
|
||
|
|
||
9 months ago
|
// 设置方向
|
||
9 months ago
|
void setDir(const P &dir);
|
||
|
};
|