Polyface.h
Go to the documentation of this file.
1 /*
2 * ==========================================================================
3 * This file is part of the implementation of
4 *
5 * <FrameFab: Robotic Fabrication of Frame Shapes>
6 * Yijiang Huang, Juyong Zhang, Xin Hu, Guoxian Song, Zhongyuan Liu, Lei Yu, Ligang Liu
7 * In ACM Transactions on Graphics (Proc. SIGGRAPH Asia 2016)
8 ----------------------------------------------------------------------------
9 * class: Polyface
10 *
11 * Description:
12 *
13 * Version: 2.0
14 * Created: Oct/20/2015
15 *
16 * Author: Xin Hu, Yijiang Huang, Guoxian Song
17 * Company: GCL@USTC
18 * Citation: This file use some geometric API and objects from
19 * Title: Geometric Tools Engine
20 * a library of source code for computing in the fields of
21 * mathematics, graphics, image analysis, and physics.
22 * Code Version: 3.2.6
23 * Availability: http://www.geometrictools.com/index.html
24 ----------------------------------------------------------------------------
25 * Copyright (C) 2016 Yijiang Huang, Xin Hu, Guoxian Song, Juyong Zhang
26 * and Ligang Liu.
27 *
28 * FrameFab is free software: you can redistribute it and/or modify
29 * it under the terms of the GNU General Public License as published by
30 * the Free Software Foundation, either version 3 of the License, or
31 * (at your option) any later version.
32 *
33 * FrameFab is distributed in the hope that it will be useful,
34 * but WITHOUT ANY WARRANTY; without even the implied warranty of
35 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 * GNU General Public License for more details.
37 *
38 * You should have received a copy of the GNU General Public License
39 * along with FrameFab. If not, see <http://www.gnu.org/licenses/>.
40 * ==========================================================================
41 */
42 
43 #pragma once
44 //#include <windows.h>
45 
46 // http://kiwwito.com/installing-opengl-glut-libraries-in-ubuntu/
48 
49 using namespace std;
50 
52 
53 class Polyface
54 {
55 public:
58 
59 public:
61  {
62  point v;
63  v.x() = V.getX();
64  v.y() = V.getY();
65  v.z() = V.getZ();
66  return v;
67  }
68 
70  {
71  return vert_list_[0];
72  }
73 
75  {
76  return vert_list_[1];
77  }
78 
80  {
81  return vert_list_[2];
82  }
83 
85  {
86  return vert_list_[3];
87  }
88 
90  {
91  return normal_;
92  }
93 
94  void Normal_()
95  {
96  GeoV3 normal;
97  normal = Geometry::cross(v1() - v0(), v2() - v0());
98 
99  if (normal.norm() == 0)
100  return;
101  normal.normalize();
102  normal_ = Trans(normal);
103  }
104 
105  virtual void Print() {}
106  virtual void Render(WireFrame* ptr_frame, double alpha) {}
107 
108 public:
109  vector<point> vert_list_;
111 };
112 
GLfloat GLfloat GLfloat alpha
double getY()
Definition: Geometry.h:91
vector< point > vert_list_
Definition: Polyface.h:109
GLfloat GLfloat v1
virtual void Render(WireFrame *ptr_frame, double alpha)
Definition: Polyface.h:106
Polyface()
Definition: Polyface.h:56
point Normal()
Definition: Polyface.h:89
reference x()
Definition: Vec.h:194
~Polyface()
Definition: Polyface.h:57
point v1()
Definition: Polyface.h:74
void Normal_()
Definition: Polyface.h:94
point normal_
Definition: Polyface.h:110
reference y()
Definition: Vec.h:203
GLfloat v0
virtual void Print()
Definition: Polyface.h:105
point v2()
Definition: Polyface.h:79
double getX()
Definition: Geometry.h:90
const GLdouble * v
double getZ()
Definition: Geometry.h:92
GLfloat GLfloat GLfloat v2
point Trans(GeoV3 V)
Definition: Polyface.h:60
point v0()
Definition: Polyface.h:69
reference z()
Definition: Vec.h:212
static Vector3d cross(Vector3d vec1, Vector3d vec2)
Definition: Geometry.h:143
Geometry::Vector3d GeoV3
Definition: Polyface.h:51
point v3()
Definition: Polyface.h:84


choreo_task_sequence_planner
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:03:14