mirror of https://github.com/CGAL/cgal
added an example for constrained triangulation
This commit is contained in:
parent
aebf6dbf06
commit
b2b6301c28
|
|
@ -58,12 +58,15 @@ terrain : terrain.o
|
|||
regular : regular.o
|
||||
$(CGAL_CXX) -o regular regular.o $(LDFLAGS)
|
||||
|
||||
constrained : constrained.o
|
||||
$(CGAL_CXX) -o constrained constrained.o $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -rf *~ *.o *.obj core tr
|
||||
|
||||
realclean: clean
|
||||
rm -rf points example voronoi colored_face triangulation_prog1 \
|
||||
terrain regular *.exe \
|
||||
terrain regular constrained *.exe \
|
||||
Program* Compiler* Error* error.txt
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
16
|
||||
-0.25 0.0 -0.5 1.0
|
||||
-0.25 0.0 -0.5 -1.0
|
||||
-0.5 1.0 0.0 0.5
|
||||
-0.5 -1.0 0.0 -0.5
|
||||
0.0 0.5 0.5 1.0
|
||||
0.0 -0.5 0.5 -1.0
|
||||
0.5 1.0 1.0 0.0
|
||||
0.5 -1.0 1.0 0.0
|
||||
0.25 0.0 0.5 0.5
|
||||
0.25 0.0 0.5 -0.5
|
||||
0.5 0.5 0.75 0.0
|
||||
0.5 -0.5 0.75 0.0
|
||||
-0.25 0.0 -0.5 0.5
|
||||
-0.25 0.0 -0.5 -0.5
|
||||
-0.5 0.5 -0.75 0.0
|
||||
-0.5 -0.5 -0.75 0.0
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
6
|
||||
0.528 -0.3245 1 0.891 -0.0825 1
|
||||
-0.748 -0.451 1 -0.022 -0.4895 1
|
||||
0.5115 0.055 1 -0.55 -0.0715 1
|
||||
-0.682 0.374 1 -0.165 0.363 1
|
||||
0.737 0.4125 1 -0.264 0.1485 1
|
||||
-0.4345 0.913 1 -0.0605 0.55 1
|
||||
|
|
@ -15,35 +15,22 @@ typedef CGAL::Triangulation_default_data_structure_2<Gt,Vb,Fb> Tds;
|
|||
typedef CGAL::Triangulation_2<Gt,Tds> Triangulation;
|
||||
typedef CGAL::Delaunay_triangulation_2<Gt,Tds> Delaunay_triangulation;
|
||||
|
||||
int main(int, char* argv[])
|
||||
int main()
|
||||
{
|
||||
|
||||
Triangulation T;
|
||||
|
||||
PVector V;
|
||||
|
||||
std::ifstream data(argv[1]);
|
||||
|
||||
std::ifstream data("data/points.cin");
|
||||
if(data.bad()){
|
||||
std::cout << "Problem with file " << argv[1] << std::endl;
|
||||
std::cout << "Problem with file " << "data/points.cin" << std::endl;
|
||||
}
|
||||
data >> V;
|
||||
|
||||
std::cout << V.size() << std::endl;
|
||||
|
||||
int count = 0;
|
||||
std::cout << V.size() << " points read " << std::endl;
|
||||
std::cout << "Start insertion" << std::endl;
|
||||
for(int i = 0; i<V.size();i++){
|
||||
|
||||
T.insert(V[i]);
|
||||
|
||||
if(++count == 100){
|
||||
std::cout << ".";
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
std::cout << std::endl << "done" << std::endl;
|
||||
T.is_valid();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
-file data/replay
|
||||
Loading…
Reference in New Issue