Parallelogram.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: Parallelogram
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 
46 
47 class Parallelogram : public Polyface
48 {
49 public:
51  {
52  vert_list_.push_back(point(0, 0, 0));
53  vert_list_.push_back(point(1, 0, 0));
54  vert_list_.push_back(point(1, 1, 0));
55  vert_list_.push_back(point(0, 1, 0));
56  Normal_();
57  }
58 
60  {
61  vert_list_.push_back(v0);
62  vert_list_.push_back(v1);
63  vert_list_.push_back(v2);
64  vert_list_.push_back(v3);
65  Normal_();
66  }
67 
69  {
70  vert_list_.push_back(Trans(v0));
71  vert_list_.push_back(Trans(v1));
72  vert_list_.push_back(Trans(v2));
73  vert_list_.push_back(Trans(v3));
74  Normal_();
75  }
76 
78 
79 public:
80  void Print()
81  {
82  point _v0 = v0();
83  point _v1 = v1();
84  point _v2 = v2();
85  point _v3 = v3();
86 
87  std::cout << _v0.x() << ", " << _v0.y() << ", " << _v0.z() << std::endl;
88  std::cout << _v1.x() << ", " << _v1.y() << ", " << _v1.z() << std::endl;
89  std::cout << _v2.x() << ", " << _v2.y() << ", " << _v2.z() << std::endl;
90  std::cout << _v3.x() << ", " << _v3.y() << ", " << _v3.z() << std::endl;
91  }
92 
93  void Render(WireFrame* ptr_frame, double alpha)
94  {
95 
96  glBegin(GL_QUADS);
97  glColor4f(1.0, 1.0, 0, alpha);
98  glNormal3fv(normal_);
99  glVertex3fv(ptr_frame->Unify(v0()));
100  glVertex3fv(ptr_frame->Unify(v1()));
101  glVertex3fv(ptr_frame->Unify(v2()));
102  glVertex3fv(ptr_frame->Unify(v3()));
103  glEnd();
104  }
105 };
106 
GLfloat GLfloat GLfloat alpha
void Render(WireFrame *ptr_frame, double alpha)
Definition: Parallelogram.h:93
trimesh::point point
Definition: WireFrame.h:51
vector< point > vert_list_
Definition: Polyface.h:109
Parallelogram(point v0, point v1, point v2, point v3)
Definition: Parallelogram.h:59
GLfloat GLfloat v1
reference x()
Definition: Vec.h:194
void Unify()
Definition: WireFrame.cpp:781
#define GL_QUADS
point v1()
Definition: Polyface.h:74
void Normal_()
Definition: Polyface.h:94
point normal_
Definition: Polyface.h:110
GLfloat GLfloat GLfloat GLfloat v3
reference y()
Definition: Vec.h:203
GLfloat v0
point v2()
Definition: Polyface.h:79
Parallelogram(GeoV3 v0, GeoV3 v1, GeoV3 v2, GeoV3 v3)
Definition: Parallelogram.h:68
GLfloat GLfloat GLfloat v2
point Trans(GeoV3 V)
Definition: Polyface.h:60
reference z()
Definition: Vec.h:212
point v0()
Definition: Polyface.h:69
point v3()
Definition: Polyface.h:84


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