mirror of https://github.com/CGAL/cgal
ipe 7 support using -DWITH_IPE_7=ON while cmaking demos
This commit is contained in:
parent
0f4e5478c7
commit
b7bf411782
|
|
@ -1025,6 +1025,22 @@ CGAL_ipelets/demo/CGAL_ipelets/generator.cpp -text
|
|||
CGAL_ipelets/demo/CGAL_ipelets/hilbert_sort.cpp -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/hull.cpp -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/include/CGAL_ipelets/k_delaunay.h -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_alpha_shapes.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_arrangement.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_bbox_restriction.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_diagrams.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_generator.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_hilbert_sort.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_hull.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_mesh_2.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_minkowski.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_multi_delaunay.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_multi_regular.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_partition.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_pca.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_simple_triangulation.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_skeleton.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/lua/libCGAL_triangulation.lua -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/mesh_2.cpp -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/minkowski.cpp -text
|
||||
CGAL_ipelets/demo/CGAL_ipelets/multi_delaunay.cpp -text
|
||||
|
|
@ -1046,6 +1062,8 @@ CGAL_ipelets/doc_tex/CGAL_ipelets_ref/intro.tex -text
|
|||
CGAL_ipelets/doc_tex/CGAL_ipelets_ref/main.tex -text
|
||||
CGAL_ipelets/examples/CGAL_ipelets/test_grabbers.cpp -text
|
||||
CGAL_ipelets/include/CGAL/CGAL_Ipelet_base.h -text
|
||||
CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h -text
|
||||
CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h -text
|
||||
CGAL_ipelets/include/CGAL/grabbers.h -text
|
||||
CGAL_ipelets/package_info/CGAL_ipelets/maintainer -text
|
||||
CGALimageIO/src/CGALimageIO/CMakeLists.txt -text
|
||||
|
|
|
|||
|
|
@ -4,33 +4,37 @@ cmake_minimum_required(VERSION 2.4.5)
|
|||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY .build/ipelets)
|
||||
|
||||
find_package(CGAL QUIET COMPONENTS Core )
|
||||
|
||||
option( WITH_IPE_7 "Use the version 7 of Ipe" OFF )
|
||||
|
||||
if ( CGAL_FOUND )
|
||||
include( ${CGAL_USE_FILE} )
|
||||
find_package(IPE)
|
||||
if ( IPE_FOUND )
|
||||
include_directories(../../include)
|
||||
include_directories(BEFORE ../../include)
|
||||
include_directories(include/CGAL_ipelets)
|
||||
include_directories(${IPE_INCLUDE_DIR})
|
||||
link_directories( ${IPE_LIBRARY_DIR} )
|
||||
|
||||
if (WITH_IPE_7)
|
||||
add_definitions(-DCGAL_USE_IPE_7)
|
||||
endif()
|
||||
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS})
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} hilbert_sort)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} arrangement)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} diagrams)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} alpha_shapes)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} arrangement)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} bbox_restriction)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} diagrams)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} hilbert_sort)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} hull)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} generator)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} mesh_2)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} minkowski)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} multi_delaunay)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} multi_regular)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} triangulation)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} mesh_2)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} generator)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} partition)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} minkowski)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} pca)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} bbox_restriction)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} pca)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} skeleton)
|
||||
set(CGAL_IPELETS ${CGAL_IPELETS} triangulation)
|
||||
|
||||
|
||||
foreach(IPELET ${CGAL_IPELETS})
|
||||
|
|
@ -39,6 +43,9 @@ if ( CGAL_FOUND )
|
|||
target_link_libraries( CGAL_${IPELET} ipe)
|
||||
if ( IPELET_INSTALL_DIR )
|
||||
install(TARGETS CGAL_${IPELET} DESTINATION ${IPELET_INSTALL_DIR})
|
||||
if (WITH_IPE_7)
|
||||
install(FILES ./lua/libCGAL_${IPELET}.lua DESTINATION ${IPELET_INSTALL_DIR}) #only for ipe 7
|
||||
endif()
|
||||
endif ()
|
||||
endforeach(IPELET)
|
||||
#example in doc not installed
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ void ASphapeIpelet::protected_run(int fn)
|
|||
draw_polyline_in_ipe(LP.begin(),LP.end(),true,false,true);
|
||||
}
|
||||
}
|
||||
get_IpePage()->Group(get_IpeletHelper()->CurrentLayer());
|
||||
group_selected_objects_();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ void generator::protected_run(int fn)
|
|||
return;
|
||||
}
|
||||
|
||||
std::cout << size << " " << nbelements<< std::endl;
|
||||
|
||||
std::vector<Point_2> points;
|
||||
std::vector<Segment_2> segments;
|
||||
|
||||
|
|
@ -90,9 +92,12 @@ void generator::protected_run(int fn)
|
|||
else
|
||||
segments.reserve(nbelements);
|
||||
|
||||
|
||||
#ifdef CGAL_USE_IPE_7
|
||||
get_IpePage()->deselectAll();
|
||||
#else
|
||||
get_IpePage()->DeselectAll();
|
||||
|
||||
#endif
|
||||
|
||||
switch(fn){
|
||||
case 0:{//random point in a circle
|
||||
CGAL::Random_points_in_disc_2<Point_2,Creator> gs( size);
|
||||
|
|
@ -142,7 +147,7 @@ void generator::protected_run(int fn)
|
|||
CGAL::Random random;
|
||||
for (std::vector<Point_2>::iterator it_pt=points.begin();it_pt!=points.end();++it_pt)
|
||||
draw_in_ipe(Circle_2(*it_pt,pow(random.get_double(size/20.,size/2.),2) ));
|
||||
get_IpePage()->Group(get_IpeletHelper()->CurrentLayer());
|
||||
group_selected_objects_();
|
||||
}
|
||||
else
|
||||
if (!points.empty())// Draw points
|
||||
|
|
|
|||
|
|
@ -65,24 +65,23 @@ public:
|
|||
enveloppeIpelet()
|
||||
: CGAL::Ipelet_base<Kernel,3>("Hulls",sublabel,helpmsg){}
|
||||
void protected_run(int);
|
||||
IpeVector tangency_point(double c_radius,double p_radius,const Point_2& current_pt,const Point_2& previous_pt,int f=1);
|
||||
//compute tangency points of the convex hull of 2 circles using pythagore and Thales
|
||||
IpeVector tangency_point(double c_radius,double p_radius,const Point_2& current_pt,const Point_2& previous_pt,int f=1)
|
||||
{
|
||||
int i=(c_radius>=p_radius)?(1):(-1);
|
||||
double angle = atan2(i*(previous_pt.y()-current_pt.y()),i*(previous_pt.x()-current_pt.x()));
|
||||
if(c_radius!=p_radius){
|
||||
double dist = pow(previous_pt.x()-current_pt.x(),2)+pow(previous_pt.y()-current_pt.y(),2);
|
||||
dist = dist*pow(c_radius/(c_radius-p_radius),2);
|
||||
angle = angle - i * f * atan(sqrt(dist-pow(c_radius,2))/c_radius);
|
||||
}
|
||||
else
|
||||
angle = angle - f * M_PI/2.;
|
||||
return IpeVector((current_pt.x()+c_radius*cos(angle)),(current_pt.y()+c_radius*sin(angle)));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//compute tangency points of the convex hull of 2 circles using pythagore and Thales
|
||||
IpeVector enveloppeIpelet::tangency_point(double c_radius,double p_radius,const Point_2& current_pt,const Point_2& previous_pt,int f){
|
||||
int i=(c_radius>=p_radius)?(1):(-1);
|
||||
double angle = atan2(i*(previous_pt.y()-current_pt.y()),i*(previous_pt.x()-current_pt.x()));
|
||||
if(c_radius!=p_radius){
|
||||
double dist = pow(previous_pt.x()-current_pt.x(),2)+pow(previous_pt.y()-current_pt.y(),2);
|
||||
dist = dist*pow(c_radius/(c_radius-p_radius),2);
|
||||
angle = angle - i * f * atan(sqrt(dist-pow(c_radius,2))/c_radius);
|
||||
}
|
||||
else
|
||||
angle = angle - f * M_PI/2.;
|
||||
return IpeVector((current_pt.x()+c_radius*cos(angle)),(current_pt.y()+c_radius*sin(angle)));
|
||||
}
|
||||
|
||||
|
||||
void enveloppeIpelet::protected_run(int fn)
|
||||
{
|
||||
if (fn==2) {
|
||||
|
|
@ -120,7 +119,6 @@ void enveloppeIpelet::protected_run(int fn)
|
|||
print_error_message("Need more than one mark or one circle");
|
||||
return;
|
||||
}
|
||||
get_IpePage() -> DeselectAll();
|
||||
|
||||
Apollonius::Vertex_circulator Cvert = apo.incident_vertices(apo.infinite_vertex()); //take points incident to infinte vertex
|
||||
Apollonius::Vertex_circulator Cvert0 = Cvert;
|
||||
|
|
@ -136,6 +134,36 @@ void enveloppeIpelet::protected_run(int fn)
|
|||
Vsite0.insert(Vsite0.end(),*(Vsite0.begin()+1));
|
||||
std::vector<ASite>::iterator Vsiteite0 = Vsite0.begin();
|
||||
std::vector<ASite>::iterator Vsiteite00 = Vsite0.end()-2;
|
||||
#ifdef CGAL_USE_IPE_7
|
||||
for(std::vector<ASite>::iterator it=Vsiteite00 ; it!=Vsiteite0 ; --it){//draw precise convex hull computing tangency point to circles
|
||||
double c_rad = it->weight();
|
||||
if(c_rad!=0){
|
||||
Point_2 p_pt = (it-1)->point(); //previous neighbor
|
||||
Point_2 c_pt = it->point();
|
||||
Point_2 n_pt = (it+1)->point(); //next neighbor
|
||||
double p_rad = (it-1)->weight();
|
||||
double n_rad = (it+1)->weight();
|
||||
IpeVector pt_ipe=tangency_point(c_rad,p_rad,c_pt,p_pt);
|
||||
IpeVector pt_ipe0=tangency_point(c_rad,n_rad,c_pt,n_pt,-1);
|
||||
|
||||
if(it!=Vsiteite00)
|
||||
SSPseg_ipe->appendSegment(pt_ipe1,pt_ipe0);
|
||||
SSPseg_ipe->appendArc(IpeMatrix(c_rad,0,0,c_rad,c_pt.x(),c_pt.y()),pt_ipe0,pt_ipe);
|
||||
pt_ipe1=pt_ipe;
|
||||
}
|
||||
else{
|
||||
Point_2 c_pt = it->point();
|
||||
IpeVector pt_ipe=IpeVector(c_pt.x(),c_pt.y());
|
||||
if(it!=Vsiteite00)
|
||||
SSPseg_ipe->appendSegment(pt_ipe1,pt_ipe);
|
||||
pt_ipe1=pt_ipe;
|
||||
}
|
||||
}
|
||||
SSPseg_ipe->setClosed(true);
|
||||
ipe::Shape shape;
|
||||
shape.appendSubPath(SSPseg_ipe);
|
||||
get_IpePage()->append(ipe::EPrimarySelected,CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape));
|
||||
#else
|
||||
for(std::vector<ASite>::iterator it=Vsiteite00 ; it!=Vsiteite0 ; --it){//draw precise convex hull computing tangency point to circles
|
||||
double c_rad = it->weight();
|
||||
if(c_rad!=0){
|
||||
|
|
@ -154,7 +182,6 @@ void enveloppeIpelet::protected_run(int fn)
|
|||
}
|
||||
else{
|
||||
Point_2 c_pt = it->point();
|
||||
//~ IpeVector pt_ipe=IpeVector((int)c_pt.x(),(int)c_pt.y());
|
||||
IpeVector pt_ipe=IpeVector(c_pt.x(),c_pt.y());
|
||||
if(it!=Vsiteite00)
|
||||
SSPseg_ipe->AppendSegment(pt_ipe1,pt_ipe);
|
||||
|
|
@ -165,6 +192,7 @@ void enveloppeIpelet::protected_run(int fn)
|
|||
IpePath* obj_ipe1 = new IpePath(get_IpeletHelper()->Attributes());
|
||||
obj_ipe1 -> AddSubPath(SSPseg_ipe);
|
||||
get_IpePage()->push_back(IpePgObject(IpePgObject::ESecondary,get_IpeletHelper()->CurrentLayer(),obj_ipe1));
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -204,7 +232,7 @@ void enveloppeIpelet::protected_run(int fn)
|
|||
)
|
||||
);
|
||||
}
|
||||
get_IpePage()->Group(get_IpeletHelper()->CurrentLayer());
|
||||
group_selected_objects_();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL alpha shapes ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Alpha-shapes"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="k-th Alpha-shape" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL arrangement triangulation ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Arrangement"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Segmentation" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL Bounding box restriction ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Bounding box restriction"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Bounding box restriction" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL diagrams ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Diagrams"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Voronoi" },
|
||||
{ label="Segment Voronoi skeleton" },
|
||||
{ label="Power Diagram" },
|
||||
{ label="Apollonius" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL generators ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Generators"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Points in a disk" },
|
||||
{ label="Points on a grid" },
|
||||
{ label="Points in a square" },
|
||||
{ label="Points on a convex hull" },
|
||||
{ label="Polygon" },
|
||||
{ label="Segments in a square" },
|
||||
{ label="Circles (center in a square)" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL Hilbert sort ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Hilbert sort"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Hilbert sorting curve" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL Hulls ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Hulls"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Convex minimal" },
|
||||
{ label="Crust" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL Mesh_2 ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Mesh_2"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Mesh_2" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL Minkowski ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Minkowski Sum"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Minkowski Sum" },
|
||||
{ label="Polygon Offset" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL multi delaunay ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "k order Delaunay"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label= "Delaunay" },
|
||||
{ label= "Delaunay 2" },
|
||||
{ label= "Delaunay 3" },
|
||||
{ label= "Delaunay n-1" },
|
||||
{ label= "Delaunay k" },
|
||||
{ label= "Voronoi" },
|
||||
{ label= "Voronoi 2" },
|
||||
{ label= "Voronoi 3" },
|
||||
{ label= "Voronoi n-1" },
|
||||
{ label= "Voronoi k" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL multi regular ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "k-order Regular"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Regular" },
|
||||
{ label="Regular 2" },
|
||||
{ label="Regular 3" },
|
||||
{ label="Regular n-1" },
|
||||
{ label="Regular k" },
|
||||
{ label="Power Diagram" },
|
||||
{ label="Power Diagram 2" },
|
||||
{ label="Power Diagram 3" },
|
||||
{ label="Power Diagram n-1" },
|
||||
{ label="Power Diagram k" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL Polygon Partition ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Polygon Partition"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Y monotone partition" },
|
||||
{ label="Greene's approx Convex Partition"},
|
||||
{ label="Approx Convex Partition"},
|
||||
{ label="Optimal Convex Partition"},
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL PCA ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "PCA"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="PCA" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
----------------------------------------------------------------------
|
||||
-- Simple triangulation ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Simple triangulation"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Simple triangulation" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL Skeleton and offset ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Skeleton and offset"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Interior skeleton" },
|
||||
{ label="Exterior skeleton" },
|
||||
{ label="Interior offset" },
|
||||
{ label="Exterior offset" },
|
||||
{ label="Interior offsets" },
|
||||
{ label="Exterior offsets" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
----------------------------------------------------------------------
|
||||
-- CGAL Triangulations ipelet description
|
||||
----------------------------------------------------------------------
|
||||
|
||||
label = "Triangulations"
|
||||
|
||||
about = [[
|
||||
This ipelet is part of the CGAL_ipelet package. See www.cgal.org.
|
||||
]]
|
||||
|
||||
-- this variable will store the C++ ipelet when it has been loaded
|
||||
ipelet = false
|
||||
|
||||
function run(model, num)
|
||||
if not ipelet then ipelet = assert(ipe.Ipelet(dllname)) end
|
||||
model:runIpelet(methods[num].label, ipelet, num)
|
||||
end
|
||||
|
||||
methods = {
|
||||
{ label="Delaunay" },
|
||||
{ label="Constrained Delaunay" },
|
||||
{ label="Conforming Delaunay" },
|
||||
{ label="Conforming Gabriel" },
|
||||
{ label="Regular" },
|
||||
{ label="Help" },
|
||||
}
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
|
@ -123,7 +123,7 @@ void IpeletMesh2::protected_run(int fn)
|
|||
if (it->first->is_in_domain() || it->first->neighbor(it->second)->is_in_domain())
|
||||
draw_in_ipe(cdt.segment(*it));
|
||||
|
||||
get_IpePage()->Group(get_IpeletHelper()->CurrentLayer());
|
||||
group_selected_objects_();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
namespace CGAL_minkowski{
|
||||
|
||||
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
|
||||
typedef CGAL::Polygon_with_holes_2<Kernel,std::vector<Kernel::Point_2> > Polygon_with_holes_2;
|
||||
typedef CGAL::Polygon_with_holes_2<Kernel,std::vector<Kernel::Point_2> > Polygon_with_holes_2;
|
||||
typedef CGAL::Gps_circle_segment_traits_2<Kernel> Gps_traits_2;
|
||||
typedef Gps_traits_2::Polygon_2 Offset_polygon_2;
|
||||
typedef Gps_traits_2::Polygon_with_holes_2 Offset_polygon_with_holes_2;
|
||||
|
|
@ -79,7 +79,7 @@ void SubSelectIpelet::protected_run(int fn)
|
|||
return;
|
||||
}
|
||||
|
||||
IpeRect bbox_ipe;
|
||||
|
||||
std::list<double> r_offsets;
|
||||
for (std::list<Circle_2>::iterator it=cir_list.begin();it!=cir_list.end();++it)
|
||||
r_offsets.push_back(sqrt(CGAL::to_double(it->squared_radius())));
|
||||
|
|
@ -110,9 +110,7 @@ void SubSelectIpelet::protected_run(int fn)
|
|||
}
|
||||
|
||||
create_polygon_with_holes(true);
|
||||
|
||||
for (IpePage::iterator it = get_IpePage() -> begin();it!=get_IpePage() -> end(); ++it)
|
||||
if (it->Select()) it->Transform(tfm);
|
||||
transform_selected_objects_(tfm);
|
||||
}
|
||||
else{
|
||||
if (r_offsets.size()==0)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ public:
|
|||
|
||||
void MdelaunayIpelet::protected_run(int fn)
|
||||
{
|
||||
IpeRect bbox_ipe;
|
||||
Delaunay dt;
|
||||
RegularI rti;
|
||||
Regular rt;
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ void SkeletonIpelet::protected_run(int fn)
|
|||
}
|
||||
|
||||
if (offsets.size()>1)
|
||||
get_IpePage()->Group(get_IpeletHelper()->CurrentLayer());
|
||||
group_selected_objects_();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue