KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gr_polymesh_plane.h
Go to the documentation of this file.
1 /* $Id$ */
35 /* =========================================================================== *
36 |
37 | Copyright (c) 1994-2008 by Kobus Barnard (author).
38 |
39 | Personal and educational use of this code is granted, provided that this
40 | header is kept intact, and that the authorship is not misrepresented, that
41 | its use is acknowledged in publications, and relevant papers are cited.
42 |
43 | For other use contact the author (kobus AT cs DOT arizona DOT edu).
44 |
45 | Please note that the code in this file has not necessarily been adequately
46 | tested. Naturally, there is no guarantee of performance, support, or fitness
47 | for any particular task. Nonetheless, I am interested in hearing about
48 | problems that you encounter.
49 |
50 | Authors:
51 | Emily Hartley
52 |
53 * =========================================================================== */
54 
66 #ifndef KJB_POLYMESH_PLANE_H
67 #define KJB_POLYMESH_PLANE_H
68 
69 #include <gr_cpp/gr_polymesh.h>
70 #include <vector>
71 
72 namespace kjb{
73 
74 
84 {
85  public:
87  Polymesh_Plane(const Polymesh& p);
88 
93  Polymesh_Plane(const Polymesh& p, Vector& params, std::vector<int>& indices);
94 
96  Polymesh_Plane(const Polymesh_Plane& pp);
97 
100 
103 
108  inline std::vector<int> get_face_indices() const;
109 
111  inline Vector get_plane_params() const;
112 
114  inline const Polymesh* get_polymesh() const;
115 
117  inline void set_face_indices(std::vector<int> indices);
118 
120  inline void set_plane_params(Vector params);
121 
122  private:
123  const Polymesh* m_p;
124 
129  Vector plane_params;
130 
135  std::vector<int> face_indices;
136 };
137 
138 inline std::vector<int> Polymesh_Plane::get_face_indices() const
139 {
140  return face_indices;
141 }
142 
144 {
145  return plane_params;
146 }
147 
149 {
150  return m_p;
151 }
152 
153 inline void Polymesh_Plane::set_face_indices(std::vector<int> indices)
154 {
155  face_indices = indices;
156 }
157 
158 
160 {
161  plane_params = params;
162 }
163 
164 }
165 
166 #endif
~Polymesh_Plane()
Deletes this Polymesh_Plane.
Definition: gr_polymesh_plane.cpp:91
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
Abstract class of connected polygons (faces) forming a mesh.
This class contains a Vector of plane parameters, a vector of the face indices that lie in the plane...
Definition: gr_polymesh_plane.h:83
Polymesh_Plane & operator=(const Polymesh_Plane &)
Copies a Polymesh_Plane into this one.
Definition: gr_polymesh_plane.cpp:102
Abstract class of connected polygons (faces) forming a mesh. We assume that each edge is shared betwe...
Definition: gr_polymesh.h:89
Polymesh_Plane(const Polymesh &p)
Constructs a polymesh_plane from a polymesh.
Definition: gr_polymesh_plane.cpp:62
void set_plane_params(Vector params)
Sets the Vector of plane coefficients.
Definition: gr_polymesh_plane.h:159
const Polymesh * get_polymesh() const
Returns the polymesh.
Definition: gr_polymesh_plane.h:148
void set_face_indices(std::vector< int > indices)
Sets the vector of indices that lies in the plane.
Definition: gr_polymesh_plane.h:153
std::vector< int > get_face_indices() const
Returns the indices of the faces that lie in the defined plane.
Definition: gr_polymesh_plane.h:138
Vector get_plane_params() const
Returns the coefficients of a plane.
Definition: gr_polymesh_plane.h:143