|
vtdata library
|

Public Member Functions | |
| unsigned int | NumVerts () const |
| unsigned int | NumTris () const |
| void | AddVert (const DPoint2 &p, float z) |
| void | AddVert (const DPoint2 &p, float z, FPoint3 &normal) |
| void | AddTri (int v1, int v2, int v3, int surface_type=-1) |
| void | RemVert (int v) |
| void | RemTri (int t) |
| bool | Read (const char *fname) |
| bool | ReadHeader (const char *fname) |
| bool | ReadBody (const char *fname) |
| bool | Write (const char *fname, bool progress_callback(int)=NULL) const |
| bool | ReadDXF (const char *fname, bool progress_callback(int)=NULL) |
| bool | ReadADF (const char *fname, bool progress_callback(int)=NULL) |
| bool | ReadGMS (const char *fname, bool progress_callback(int)=NULL) |
| void | FreeData () |
| unsigned int | AddSurfaceType (const vtString &surface_texture, bool bTiled=false) |
| void | SetSurfaceType (int iTri, int surface_type) |
| bool | ComputeExtents () |
| void | Offset (const DPoint2 &p) |
| void | Scale (float fFactor) |
| void | VertOffset (float fAmount) |
| bool | ConvertProjection (const vtProjection &proj_new) |
| virtual bool | FindAltitudeOnEarth (const DPoint2 &p, float &fAltitude, bool bTrue=false) const |
| virtual bool | FindAltitudeAtPoint (const FPoint3 &p3, float &fAltitude, bool bTrue=false, int iCultureFlags=0, FPoint3 *vNormal=NULL) const |
| bool | CastRayToSurface (const FPoint3 &point, const FPoint3 &dir, FPoint3 &result) const |
| Find the intersection point of a ray with the heightfield. | |
| void | CleanupClockwisdom () |
| int | RemoveUnusedVertices () |
| double | GetTriMaxEdgeLength (int iTri) const |
| void | MergeSharedVerts (bool progress_callback(int)=NULL) |
| bool | HasVertexNormals () |
| int | RemoveTrianglesBySegment (const DPoint2 &ep1, const DPoint2 &ep2) |
| void | SetupTriangleBins (int bins, bool progress_callback(int)=NULL) |
| int | MemoryNeededToLoad () const |
Public Attributes | |
| vtProjection | m_proj |
Protected Member Functions | |
| bool | TestTriangle (int tri, const DPoint2 &p, float &fAltitude) const |
| bool | _ReadTin (FILE *fp) |
| bool | _ReadTinHeader (FILE *fp) |
| bool | _ReadTinBody (FILE *fp) |
| bool | _ReadTinOld (FILE *fp) |
| void | _UpdateIndicesInInBin (int bin) |
| void | _CompareBins (int bin1, int bin2) |
Protected Attributes | |
| DLine2 | m_vert |
| vtArray< float > | m_z |
| vtArray< int > | m_tri |
| FLine3 | m_vert_normal |
| vtArray< int > | m_surfidx |
| vtStringArray | m_surftypes |
| vtArray< bool > | m_surftype_tiled |
| int * | m_bReplace |
| Bin * | m_vertbin |
| Bin * | m_tribin |
| BinArray * | m_trianglebins |
| DPoint2 | m_BinSize |
| int | m_file_data_start |
| int | m_file_verts |
| int | m_file_tris |
This class represents a TIN, a 'triangulated irregular network'. A TIN consists of a set of vertices connected by triangles with no regularity. However this class does expect to operate on a particular kind of TIN, specifically a heightfield TIN.
The triangles are defined by indices into the vertex array, so this is an "indexed TIN".
| void vtTin::CleanupClockwisdom | ( | ) |
Test each triangle for clockwisdom, fix if needed. The result should be a TIN with consistent vertex ordering, such that all face normals point up rather than down, that is, counter-clockwise.
| bool vtTin::FindAltitudeAtPoint | ( | const FPoint3 & | p3, |
| float & | fAltitude, | ||
| bool | bTrue = false, |
||
| int | iCultureFlags = 0, |
||
| FPoint3 * | vNormal = NULL |
||
| ) | const [virtual] |
Given a point in world coordinates, determine the elevation at that point.
| p3 | The point to test. Only the X and Z values are used. |
| fAltitude | The resulting elevation at that point, by reference. |
| bTrue | True to test true elevation. False to test the displayed elevation (possibly exaggerated.) |
| iCultureFlags | Pass 0 to test only the heightfield itself, non-zero to test any culture objects which may be sitting on the heightfield. Values include:
|
| vNormal | If you supply a pointer to a vector, it will be set to the upward-pointing surface normal at the ground point. |
Implements vtHeightField3d.
| double vtTin::GetTriMaxEdgeLength | ( | int | iTri | ) | const |
Return the length of the longest edge of a specific triangle.
| void vtTin::MergeSharedVerts | ( | bool | progress_callbackint = NULL | ) |
Combine all vertices which are at the same location. By removing these redundant vertices, the mesh will consume less space in memory and on disk.
| bool vtTin::Read | ( | const char * | fname | ) |
Read the TIN from a file. This can either be an old-style or new-style .tin format (custom VTP format)
| bool vtTin::ReadBody | ( | const char * | fname | ) |
Read the TIN body from a file.
| bool vtTin::ReadDXF | ( | const char * | fname, |
| bool | progress_callbackint = NULL |
||
| ) |
Attempt to read TIN data from a DXF file.
| bool vtTin::ReadHeader | ( | const char * | fname | ) |
Read the TIN header from a file.
Remove all the triangles of this TIN which intersect a given line segment.
| ep1,ep2 | The endpoints of the line segment. |
| int vtTin::RemoveUnusedVertices | ( | ) |
Because the TIN triangles refer to their vertices by index, it's possible to have some vertices which are not referenced. Find and remove those vertices.
| void vtTin::SetupTriangleBins | ( | int | bins, |
| bool | progress_callbackint = NULL |
||
| ) |
If you are going to do a large number of height-testing of this TIN (with FindAltitudeOnEarth), call this method once first to set up a series of bins which greatly speed up testing.
| bins | Number of bins per dimension, e.g. a value of 50 produces 50*50=2500 bins. More bins produces faster height-testing with the only tradeoff being a small amount of RAM per bin. |
| progress_callback | If supplied, this function will be called back with a value of 0 to 100 as the operation progresses. |
| bool vtTin::Write | ( | const char * | fname, |
| bool | progress_callbackint = NULL |
||
| ) | const |
Write the TIN to a new-style .tin file (custom VTP format).
1.7.4