62 : pedge_(NULL), id_(0), degree_(0),
63 b_fixed_(false), b_base_(false), b_subg_(false)
66 : pedge_(NULL), position_(p), render_pos_(p),
68 b_fixed_(false), b_base_(false), b_subg_(false)
71 : pedge_(NULL), position_(
point(x, y, z)), render_pos_(
point(x, y, z)),
73 b_fixed_(false), b_base_(false), b_subg_(false)
80 int ID()
const {
return id_; }
81 int Degree()
const {
return degree_; }
84 bool isBase()
const {
return b_base_; }
91 void SetID(
int id) { id_ = id; }
94 void SetFixed(
bool b_fixed) { b_fixed_ = b_fixed; }
95 void SetBase(
bool b_base) { b_base_ = b_base; }
117 :pvert_(NULL), pnext_(NULL), ppair_(NULL),
118 id_(0), layer_(-1), b_pillar_(false), b_ceiling_(false), b_subg_(false)
123 int ID()
const {
return id_; }
124 int Layer()
const {
return layer_; }
137 point u = pvert_->Position();
138 point v = ppair_->pvert_->Position();
139 return point((u.
x() + v.
x()) / 2, (u.
y() + v.
y()) / 2, (u.
z() + v.
z()) / 2);
144 point u = pvert_->Position();
145 point v = ppair_->pvert_->Position();
146 double dx = u.
x() - v.
x();
147 double dy = u.
y() - v.
y();
148 double dz = u.
z() - v.
z();
149 return sqrt(dx*dx + dy*dy + dz*dz);
154 point this_c = this->CenterPos();
157 double dx = this_c.
x() - ej_c.
x();
158 double dy = this_c.
y() - ej_c.
y();
159 double dz = this_c.
z() - ej_c.
z();
160 return sqrt(dx*dx + dy*dy + dz*dz);
180 WF_face() { bound_points_ =
new vector<WF_vert*>; }
195 void LoadFromOBJ(
const char *
path);
196 void LoadFromPWF(
const char *path);
197 void WriteToOBJ(
const char *path);
199 bool bVert,
bool bLine,
200 bool bPillar,
bool bCeiling,
201 bool bCut,
int min_layer,
int max_layer,
205 void ImportFrom3DD(
const char *path);
207 void ExportSubgraph(
const char *path);
208 void ExportPoints(
int min_layer,
int max_layer,
const char *path);
209 void ExportLines(
int min_layer,
int max_layer,
const char *path);
218 void SimplifyFrame();
219 void ProjectBound(
double len);
220 void ModifyProjection(
double len);
221 void MakeBase(vector<WF_vert*> &base_v);
222 void MakeCeiling(vector<WF_edge*> &bound_e);
223 void MakeSubGraph(vector<WF_edge*> &subg_e);
237 inline WF_vert *
GetVert(
int u) {
return (u >= SizeOfVertList() || u < 0) ? NULL : (*pvert_list_)[u]; }
238 inline WF_edge *
GetEdge(
int i) {
return (i >= SizeOfEdgeList() || i < 0) ? NULL : (*pedge_list_)[i]; }
241 inline point GetPosition(
int u)
const { assert(u < SizeOfVertList() && u >= 0);
return((*pvert_list_)[u]->Position()); }
242 inline int GetDegree(
int u)
const { assert(u < SizeOfVertList() && u >= 0);
return((*pvert_list_)[u]->Degree()); }
244 inline int GetEndu(
int i)
const { assert(i < SizeOfEdgeList() && i >= 0);
return((*pedge_list_)[i]->ppair_->pvert_->ID()); }
245 inline int GetEndv(
int i)
const { assert(i < SizeOfEdgeList() && i >= 0);
return((*pedge_list_)[i]->pvert_->ID()); }
247 inline point GetCenterPos(
int i)
const { assert(i < SizeOfEdgeList() && i >= 0);
return((*pedge_list_)[i]->CenterPos()); }
253 inline bool isFixed(
int u)
const { assert(u < SizeOfVertList() && u >= 0);
return((*pvert_list_)[u]->
isFixed()); }
254 inline bool isPillar(
int i)
const { assert(i < SizeOfEdgeList() && i >= 0);
return((*pedge_list_)[i]->
isPillar()); }
256 inline double maxX()
const {
return maxx_; }
257 inline double minX()
const {
return minx_; }
258 inline double maxY()
const {
return maxy_; }
259 inline double minY()
const {
return miny_; }
260 inline double maxZ()
const {
return maxz_; }
261 inline double minZ()
const {
return minz_; }
265 return sqrt(u.
x()*u.
x() + u.
y()*u.
y() + u.
z()*u.
z());
270 double dx = u.
x() - v.
x();
271 double dy = u.
y() - v.
y();
272 double dz = u.
z() - v.
z();
273 return sqrt(dx*dx + dy*dy + dz*dz);
278 return point(u.
y() * v.
z() - u.
z() * v.
y(), u.
z() * v.
x() - u.
x() * v.
z(),
279 u.
x() * v.
y() - u.
y() * v.
x());
285 point beta = v2 - v1;
287 return Norm(CrossProduct(alpha, beta)) /
Norm(beta);
int GetDegree(int u) const
GLfloat GLfloat GLfloat alpha
void SetRenderPos(point p)
void SetRenderPos(double x, double y, double z)
GLenum GLuint GLint GLint layer
void SetUnitScale(double unit_scale)
int SizeOfFixedVert() const
WF_edge * GetNeighborEdge(int u)
void SetPosition(point p)
GLsizei const GLchar *const * path
int SizeOfCeiling() const
point GetCenterPos(int i) const
void SetSubgraph(bool b_subg)
double CenterDistanceTo(WF_edge *ej) const
void SetCeiling(bool b_ceiling)
int SizeOfBaseVert() const
vector< WF_edge * > * GetEdgeList()
Vec3f GetBaseCenterPos() const
void SetPillar(bool b_pillar)
double Dist(point u, point v) const
void SetFixed(bool b_fixed)
void SetBase(bool b_base)
point CrossProduct(point u, point v) const
WF_vert(double x, double y, double z)
int SizeOfVertList() const
void SetPosition(double x, double y, double z)
DualQuaternion< Real > Norm(DualQuaternion< Real > &d, bool robust=false)
double GetUnitScale() const
vector< WF_vert * > * GetVertList()
void SetSubgraph(bool b_subg)
double ArcHeight(point u, point v1, point v2) const
GLdouble GLdouble GLdouble z
vector< WF_vert * > * bound_points_
GLfloat GLfloat GLfloat v2
bool isPillar(int i) const
bool isFixed(int u) const
double Norm(point u) const
point GetPosition(int u) const
std::vector< WF_vert * > * pvert_list_
std::vector< WF_edge * > * pedge_list_
Vec3f GetCenterPos() const
int SizeOfEdgeList() const