xmsgrid  1.0
TrTin.cpp File Reference
#include <xmsgrid/triangulate/TrTin.h>
#include <cfloat>
#include <numeric>
#include <ostream>
#include <sstream>
#include <boost/bind.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/unordered_set.hpp>
#include <xmscore/misc/StringUtil.h>
#include <xmscore/stl/set.h>
#include <xmscore/stl/vector.h>
#include <xmsgrid/geometry/geoms.h>
#include <xmscore/misc/boost_defines.h>
#include <xmsgrid/triangulate/triangles.h>
#include <xmscore/misc/XmError.h>
#include <xmscore/misc/xmstype.h>
#include <xmscore/misc/XmConst.h>
#include <xmsgrid/triangulate/TrTin.t.h>
#include <xmscore/testing/TestTools.h>
#include <xmscore/misc/carray.h>
#include <xmsgrid/triangulate/TrTriangulatorPoints.h>

Go to the source code of this file.

Classes

class  xms::TrTinImpl
 Class to encapsulate a tin made simply of arrays of points, triangles and adjacency information. Also methods to manipulate it. More...
 

Namespaces

 xms
 XMS Namespace.
 

Functions

 BOOST_CLASS_EXPORT (xms::TrTinImpl)
 Cause boost.
 
void xms::trRenumberOnDelete (const SetInt &a_deleting, VecInt &a_vec)
 Boost serialize function. More...
 
BSHP< TrTintrBuildTestTin ()
 Builds a simple TIN with a hole in the middle. More...
 
BSHP< TrTintrBuildTestTin2 ()
 Builds a simple TIN for testing. More...
 
BSHP< TrTintrBuildTestTin6 ()
 Builds a simple TIN for testing. More...
 
BSHP< TrTintrBuildTestTin7 ()
 Builds a simple TIN for testing. More...
 
BSHP< TrTintrBuildTestTin8 ()
 Builds a simple TIN with a hole in the middle and a concavity. More...
 
BSHP< TrTintrBuildTestTin9 ()
 Builds a TIN with long thin triangles for testing. More...
 

Detailed Description

Definition in file TrTin.cpp.

Function Documentation

◆ trBuildTestTin()

BSHP<TrTin> trBuildTestTin ( )

Builds a simple TIN with a hole in the middle.

///
///  15.0        9
///             /|\
///           /  |  \
///         /  8 | 9  \
///  10.0  6-----7-----8
///        |\  5 |\  6 |\
///        |  \  |  \  |  \
///        | 4  \|    \| 7  \
///   5.0  2-----3-----4-----5
///         \  0 |\  2 | 3  /
///           \  |  \  |  /
///             \| 1  \|/
///   0.0        0-----1
///
///      0.0   5.0   10.0  15.0
///
/// 
Returns
The tin.

Definition at line 1451 of file TrTin.cpp.

References xms::TrTin::New().

Referenced by TriSearchUnitTests::testTriEnvelopesOverlap().

◆ trBuildTestTin2()

BSHP<TrTin> trBuildTestTin2 ( )

Builds a simple TIN for testing.

///
///  10.0 6
///       |\
///       |  \
///       |    \
///       |      \
///       |   5    \
///       |          \
///   5.0 4-----------5
///       |\    4    /|\
///       |  \     /  |  \
///       |    \ /    |    \
///       |  2  3  3  |      \
///       |    / \    |        \
///       |  /     \  |    1     \
///       |/    0    \|            \
///   0.0 0-----------1-------------2
///      0.0   2.5   5.0          10.0
///
/// 
Returns
The tin.

Definition at line 1487 of file TrTin.cpp.

References xms::TrTin::New(), and XM_COUNTOF.

◆ trBuildTestTin6()

BSHP<TrTin> trBuildTestTin6 ( )

Builds a simple TIN for testing.

///
///  40   36-37--38--39--40--41--42--43--44
///       |\16|\28|\24|\54|51/|52/|\61|\59|
///       |17\|18\|25\|26\|/47|/50|53\|60\|
///  30   27-28--29--30--31--32--33--34--35
///       |\14|\23|\22|\63|48/|49/|\58|\57|
///       |15\|19\|20\|27\|/35|/46|62\|55\|
///  20   18-19--20--21--22--23--24--25--26
///       |\ 3|29/|21/|\30|\32|\45|\41|56/|
///       |1 \|/ 7|/10|13\|33\|34\|42\|/44|
///  10   9--10--11--12--13--14--15--16--17
///       |2 /|\12|8 /|9 /|\37|\36|\38|43/|
///       |/ 0|4 \|/ 5|/ 6|11\|31\|39\|/40|
///   0   0---1---2---3---4---5---6---7---8
///       0  10  20  30  40  50  60  70  80
///
/// (most triangles not shown)
/// 
Returns
The tin.

Definition at line 1521 of file TrTin.cpp.

References xms::TrTin::New(), and xms::TrTriangulator::Triangulate().

Referenced by TrTinUnitTests::testBoundaries(), TrTinUnitTests::testDeletePoints(), and TrTinUnitTests::testDeleteTriangles().

◆ trBuildTestTin7()

BSHP<TrTin> trBuildTestTin7 ( )

Builds a simple TIN for testing.

///
//  10-  17-----18------19------20------21
//    |  |\  8  /|\ 11  /|\ 22  / \ 26  /|
//    |  | \   / | \   / | \   /   \   //|
//    |  |  \ /  |  \ /30|23\ / 27  \ / /|
//   5-  |6 13 12|9 14   |  15------16  /|
//    |  |  / \  |  /|\  |  / \ 25  /|28/|
//    |  | /   \ | / | \ | /   \   / | / |
//    |  |/  7  \|/  |  \|/ 24  \ /29| / |
//   0-  9------10 10|3 11------12   | / |
//    |  |\ 13  / \  |  / \ 15  / \  |/  |
//    |  | \   /   \ | /   \   /   \ |/  |
//    |  |  \ /  5  \|/ 16  \ / 21  \|/  |
//  -5-  | 0 5-------6-------7-------8 18|
//    |  |  / \  4  / \ 14  / \ 19  / \  |
//    |  | /   \   /   \   /   \   /   \ |
//    |  |/  1  \ /  2  \ / 20  \ / 17  \|
// -10-  0-------1-------2-------3-------4
//
//       |-------|-------|-------|-------|
//       0      10      20      30      40
/// 
Returns
The tin.

Definition at line 1565 of file TrTin.cpp.

References xms::TrTin::New(), xms::TrTriangulator::Triangulate(), and XM_COUNTOF.

Referenced by TrOuterTriangleDeleterUnitTests::test1(), and TrBreaklineAdderUnitTests::test2().

◆ trBuildTestTin8()

BSHP<TrTin> trBuildTestTin8 ( )

Builds a simple TIN with a hole in the middle and a concavity.

///
///  15.0        9----10----11
///             /|\ 10 | 11 /
///           /  |  \  |  /
///         /  8 | 9  \|/
///  10.0  6-----7-----8
///        |\  5 |\  6 |\
///        |  \  |  \  |  \
///        | 4  \|    \| 7  \
///   5.0  2-----3-----4-----5
///         \  0 |\  2 | 3  /
///           \  |  \  |  /
///             \| 1  \|/
///   0.0        0-----1
///
///      0.0   5.0   10.0  15.0
///
/// 
Returns
The tin.

Definition at line 1599 of file TrTin.cpp.

References xms::TrTin::New().

Referenced by TrBreaklineAdderUnitTests::testCrossingBoundary().

◆ trBuildTestTin9()

BSHP<TrTin> trBuildTestTin9 ( )

Builds a TIN with long thin triangles for testing.

///
///  10.0 7
///       |\\
///       |  \ \
///       |    \  \
///       |      \  \
///       |   6    \ 7 \
///       |          \   \
///   5.0 4-----------5---6
///       |\    4    /|\   \
///       |  \     /  |  \ 5 \
///       |    \ /    |    \  \
///       |  2  3  3  |      \ \
///       |    / \    |        \ \
///       |  /     \  |    1     \\
///       |/    0    \|            \
///   0.0 0-----------1-------------2
///      0.0   2.5   5.0          10.0
///
/// 
Returns
The tin.

Definition at line 1635 of file TrTin.cpp.

References xms::TrTin::New(), and XM_COUNTOF.

Referenced by TrTinUnitTests::testRemoveLongThinTrianglesOnPerimeter().