Main Page
Namespaces
Classes
Files
File List
File Members
include
choreo_task_sequence_planner
utils
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/
47
#include "
choreo_task_sequence_planner/utils/Geometry.h
"
48
49
using namespace
std
;
50
51
typedef
Geometry::Vector3d
GeoV3
;
52
53
class
Polyface
54
{
55
public
:
56
Polyface
(){}
57
~Polyface
(){}
58
59
public
:
60
point
Trans
(
GeoV3
V)
61
{
62
point
v
;
63
v.
x
() = V.
getX
();
64
v.
y
() = V.
getY
();
65
v.
z
() = V.
getZ
();
66
return
v;
67
}
68
69
point
v0
()
70
{
71
return
vert_list_[0];
72
}
73
74
point
v1
()
75
{
76
return
vert_list_[1];
77
}
78
79
point
v2
()
80
{
81
return
vert_list_[2];
82
}
83
84
point
v3
()
85
{
86
return
vert_list_[3];
87
}
88
89
point
Normal
()
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_
;
110
point
normal_
;
111
};
112
alpha
GLfloat GLfloat GLfloat alpha
Geometry::Vector3d::getY
double getY()
Definition:
Geometry.h:91
Polyface::vert_list_
vector< point > vert_list_
Definition:
Polyface.h:109
Geometry::Vector3d::normalize
void normalize()
Definition:
Geometry.h:124
v1
GLfloat GLfloat v1
Polyface::Render
virtual void Render(WireFrame *ptr_frame, double alpha)
Definition:
Polyface.h:106
Polyface::Polyface
Polyface()
Definition:
Polyface.h:56
std
Polyface::Normal
point Normal()
Definition:
Polyface.h:89
trimesh::Vec::x
reference x()
Definition:
Vec.h:194
Polyface::~Polyface
~Polyface()
Definition:
Polyface.h:57
Geometry::Vector3d::norm
double norm()
Definition:
Geometry.h:120
Polyface::v1
point v1()
Definition:
Polyface.h:74
Polyface::Normal_
void Normal_()
Definition:
Polyface.h:94
Geometry::Vector3d
Definition:
Geometry.h:64
Polyface
Definition:
Polyface.h:53
WireFrame
Definition:
WireFrame.h:188
Polyface::normal_
point normal_
Definition:
Polyface.h:110
trimesh::Vec::y
reference y()
Definition:
Vec.h:203
v0
GLfloat v0
Polyface::Print
virtual void Print()
Definition:
Polyface.h:105
Polyface::v2
point v2()
Definition:
Polyface.h:79
Geometry::Vector3d::getX
double getX()
Definition:
Geometry.h:90
v
const GLdouble * v
Geometry::Vector3d::getZ
double getZ()
Definition:
Geometry.h:92
v2
GLfloat GLfloat GLfloat v2
Polyface::Trans
point Trans(GeoV3 V)
Definition:
Polyface.h:60
Polyface::v0
point v0()
Definition:
Polyface.h:69
trimesh::Vec::z
reference z()
Definition:
Vec.h:212
trimesh::Vec
Definition:
Vec.h:104
Geometry::cross
static Vector3d cross(Vector3d vec1, Vector3d vec2)
Definition:
Geometry.h:143
GeoV3
Geometry::Vector3d GeoV3
Definition:
Polyface.h:51
Geometry.h
Polyface::v3
point v3()
Definition:
Polyface.h:84
choreo_task_sequence_planner
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:03:14