5#ifndef BALL_MATHS_SURFACE_H
6#define BALL_MATHS_SURFACE_H
8#ifndef BALL_MATHS_VECTOR3_H
197#ifdef BALL_COMPILER_MSVC
201 template <
typename T>
206 template <
typename T>
214 template <
typename T>
219 template <
typename T>
227 template <
typename T>
235 template <
typename T>
244 template <
typename T>
252 template <
typename T>
260 std::ifstream file(vert_filename.
c_str());
279 vertex.push_back(
Vertex(s[0].toFloat(), s[1].toFloat(), s[2].toFloat()));
280 normal.push_back(
Normal(s[3].toFloat(), s[4].toFloat(), s[5].toFloat()));
290 file.open(face_filename.
c_str());
309 t.
v1 = (
Index)s[0].toInt() - 1;
310 t.
v2 = (
Index)s[1].toInt() - 1;
311 t.
v3 = (
Index)s[2].toInt() - 1;
314 if ((t.
v1 < (
Index)number_of_vertices) && (t.
v1 >= 0)
315 && (t.
v1 < (
Index)number_of_vertices) && (t.
v1 >= 0)
316 && (t.
v1 < (
Index)number_of_vertices) && (t.
v1 >= 0))
327 template <
typename T>
340 return (
float)( area * 0.5 );
343 template <
typename T>
351 template <
typename T>
358 template <
typename T>
365 template <
typename T>
372 template <
typename T>
379 template <
typename T>
386 template <
typename T>
393 template <
typename T>
400 template <
typename T>
408 template <
typename T>
415 template <
typename T>
422 template <
typename T>
429 template <
typename T>
437 template <
typename T>
441 vertex.push_back(position);
444 template <
typename T>
451 template <
typename T>
458 template <
typename T>
465 template <
typename T>
472 template <
typename T>
479 template <
typename T>
482 return !(*
this == surface);
Size countFields(const char *delimiters=CHARACTER_CLASS__WHITESPACE) const
Size split(String string_array[], Size array_size, const char *delimiters=CHARACTER_CLASS__WHITESPACE, Index from=0) const
const char * c_str() const BALL_NOEXCEPT
std::istream & getline(std::istream &s=std::cin, char delimiter='\n')
TVector3< T > Vertex
A vertex.
vector< Triangle > triangle
the triangles
const Normal & getNormal(Position index) const
Return the position of a normal.
void resizeVertices(Size size)
Resize the vertex array.
void pushBackTriangle(const Triangle &triangle)
Add a triangle.
void pushBackNormal(const Normal &n)
Add a normal.
Size getNumberOfTriangles() const
Return the number of triangles.
void set(const TSurface &surface)
TSurface & operator=(const TSurface &surface)
void clearTriangles()
Clear all triangles.
Size getNumberOfNormals() const
Return the number of normals.
void clearVertices()
Clear all vertices.
void clearNormals()
Clear all normals.
Triangle & getTriangle(Position index)
Return a triangle with a given index.
void readMSMSFile(const String &vert_filename, const String &face_filename)
Vertex & getVertex(Position index)
Return the position of a vertex.
TSurface(const TSurface &surface)
void get(TSurface &surface) const
Normal & getNormal(Position index)
Return the position of a normal.
TVector3< T > Normal
A normal.
const Vertex & getVertex(Position index) const
Return the position of a vertex.
const Triangle & getTriangle(Position index) const
Return a triangle with a given index.
void resizeNormals(Size size)
Resize the normal array.
Size getNumberOfVertices() const
Return the number of vertices.
bool operator==(const TSurface &surface) const
bool operator!=(const TSurface &surface) const
void pushBackVertex(const Vertex &vertex)
Add a vertex.
void resizeTriangles(Size size)
Resize the triangle array.
#define BALL_CREATE(name)
TSurface< float > Surface