#include <SIG_Geometry.h>
Public Methods | |
SIG_Geometry () | |
Standard constructor. More... | |
SIG_Geometry (const SIG_Geometry *geom) | |
Unreal copy constructor. More... | |
SIG_Geometry (QTextStream & tx) | |
Unstreaming constructor. More... | |
~SIG_Geometry (void) | |
Destructor. More... | |
int | getOrAddVertex (DL_vector vertex) |
getOrAddVertex searches for the vertex and hands out its index. More... | |
QVector<DL_vector> const& | getVertices (void) const |
Returns the vector of vertices. More... | |
int | getNumVertices (void) const |
Returns the number of vertices. More... | |
DL_vector | getVertex (int i) const |
Returns the ith vertex of the geometry. More... | |
int | getNumPolygons (void) const |
getNumPolygons reports the number of polygons in the geometry object. More... | |
void | translate (DL_vector dir) |
Move the geometry. More... | |
void | rotate (DL_matrix mat) |
Rotate the geometry. More... | |
void | writeToFileTransfer (QTextStream & tx) const |
Write the geometry to a stream. More... | |
Protected Methods | |
void | addPolygon (SIG_Polygon *p) |
Adds a polygon. More... | |
SIG_Polygon const* | getPolygon (int i) const |
Returns a polygon. More... | |
Private Attributes | |
QVector<SIG_Polygon> | polygons |
QVector<DL_vector> | vertices |
Friends | |
class | SIG_GeometryIterator |
class | SIG_Polygon |
Currently, only polygonal surfaces are supported.
In order to build a geometry, make a new SIG_Geometry object dynamically, and then create multiple SIG_Polygon objects dynamically with your new geometry object as the constructor argument. Then add vertices to the polygon using addVertex.
Definition at line 26 of file SIG_Geometry.h.
|
Standard constructor. This makes the world entirely black. Definition at line 20 of file SIG_Geometry.cpp. |
|
Unreal copy constructor. This constructor makes this geometry object a deep copy of the argument. Remember: Never use SIG_Geometry statically or via reference. Use pointers instead! Definition at line 24 of file SIG_Geometry.cpp. |
|
Unstreaming constructor. Reads a geometry object and all its polygons from a stream. All stream issues described elsewhere apply also here. Definition at line 35 of file SIG_Geometry.cpp. |
|
Destructor.
Definition at line 58 of file SIG_Geometry.cpp. |
|
Adds a polygon. This is used by SIG_Polygon to add itself to the geometry. Definition at line 5 of file SIG_Geometry.cpp. |
|
getNumPolygons reports the number of polygons in the geometry object.
Definition at line 108 of file SIG_Geometry.cpp. |
|
Returns the number of vertices.
Definition at line 98 of file SIG_Geometry.cpp. |
|
getOrAddVertex searches for the vertex and hands out its index. If the vertex cannot be found, it will be added and the new index will be returned. Since the array of vertices has to be searched, this is a potentially expensive function. But once an index is handed out, the vertex may not be given another one. This would happen in a reorder operation. TODO: There has to be yet another level of indirection that enables us to order the vertices in some manner without having to change the indices. Definition at line 77 of file SIG_Geometry.cpp. |
|
Returns a polygon. This is used by the SIG_GeometryIterator class to get the polygons it iterates over. Definition at line 15 of file SIG_Geometry.cpp. |
|
Returns the ith vertex of the geometry. Points in space are considered the same point if the absolute value of their distance is smaller than the zero defined in the implementation. Definition at line 103 of file SIG_Geometry.cpp. |
|
Returns the vector of vertices.
Definition at line 93 of file SIG_Geometry.cpp. |
|
Rotate the geometry. You have to provide a rotation matrix to do this. You may also provide any other matrix. So you can perform all transformation that can be done with a matrix multiplication. Definition at line 121 of file SIG_Geometry.cpp. |
|
Move the geometry. By means of moving all vertices. Definition at line 113 of file SIG_Geometry.cpp. |
|
Write the geometry to a stream.
Definition at line 130 of file SIG_Geometry.cpp. |
|
Definition at line 27 of file SIG_Geometry.h. |
|
Definition at line 28 of file SIG_Geometry.h. |
|
Definition at line 30 of file SIG_Geometry.h. |
|
Definition at line 31 of file SIG_Geometry.h. |