#---------Plugin Info--------------------------------------------------------------------
#-----------------------------------------------------------------------------

# Name                :   Voronoi + Conic Curve
# Copyright           :   (c) 2012
# Designed            :   MattC
# extention-toolbar   :   THE.PJT
# Description         :   Generates Voronoi and Conic Curve from point clouds
# Menu Item           :   plugins > Voronoi + Conic Curve
# Context Menu        :   N/A
# Usage               :   architecture and interior design
# Date                :   Jul 2012
#-----------------------------------------------------------------------------
# Permission to use, copy, modify this software for
# any non-commercial purpose is hereby granted
#-----------------------------------------------------------------------------

#-----------TIG's codes-----------------------------------------------------------------
# module Name :   points_cloud_triangulation
# Description :   A tool to create triangles starting from a construction points selection
# Context Menu:   NONE
# Usage       :   Select construction points. Select menu Plugins/Triangulate points
#             :   read the status bar to check information about triangulation
# Date        :   9/17/2004
# Type        :   Tool
# CHANGELOG:
#### TIG tweaked 2011.........
#### put code into protective class, with a new delauney3 method
#### all triangles now face 'up'
#### colinear vertical cpoint errors trapped
#### triangulated mesh is now grouped
#### layer dialog asks for layer if you cancel = Layer0
#### type in Layer to use that id not existing its made
####
#-----------------------------------------------------------------------------


require 'sketchup.rb'
require 'delauney3.rb'
require 'voronoi_conic/TIG_points_cloud_triangulation.rb'
require 'voronoi_conic/VoronoiXY.rb'
require 'voronoi_conic/ConicCurveInFace.rb'


if !file_loaded?(__FILE__) then
#---menu----------------------------------------------------------------------
voronoi_conic_menu = UI.menu("plugins").add_submenu("Voronoi + Conic Curve")
#---toolbar-------------------------------------------------------------------	
voronoi_conic_tb = UI::Toolbar.new("Voronoi + Conic Curve")

#---command-------------------------------------------------------------------	

cmd = UI::Command.new("Triangulate Points") {TIGPointsCloudTriangulation.new()}
cmd.small_icon = File.join File.dirname(__FILE__), "icon0s.png"
cmd.large_icon = File.join File.dirname(__FILE__), "icon0.png"
cmd.tooltip = "Triangulate Points"
cmd.status_bar_text = "Triangulate Points [made by TIG]"
cmd.menu_text = "Triangulate Points"
	voronoi_conic_tb.add_item(cmd)
    voronoi_conic_menu.add_item("Triangulate Points [TIG]") {TIGPointsCloudTriangulation.new()}
#-----------------------------------------------------------------------------
cmd1 = UI::Command.new("Voronoi XY") {VoronoiXY.new()}
cmd1.small_icon = File.join File.dirname(__FILE__), "icon1s.png"
cmd1.large_icon = File.join File.dirname(__FILE__), "icon1.png"
cmd1.tooltip = "Voronoi XY"
cmd1.status_bar_text = "Voronoi Cpoints - XY "
cmd1.menu_text = "Voronoi XY"
	voronoi_conic_tb.add_item(cmd1)
    voronoi_conic_menu.add_item("Voronoi XY") {VoronoiXY.new()}
#-----------------------------------------------------------------------------	
cmd2 = UI::Command.new("Conic Curve In Face") {Sketchup.active_model.select_tool ConicCurveInFace.new}
cmd2.small_icon = File.join File.dirname(__FILE__), "icon2s.png"
cmd2.large_icon = File.join File.dirname(__FILE__), "icon2.png"
cmd2.tooltip = "Conic Curve In Face"
cmd2.status_bar_text = "Conic Curve In Face"
cmd2.menu_text = "Conic Curve In Face"
	voronoi_conic_tb.add_item(cmd2)
    voronoi_conic_menu.add_item("Conic Curve In Face") {Sketchup.active_model.select_tool ConicCurveInFace.new}	
#-----------------------------------------------------------------------------
end
#-----------------------------------------------------------------------------
file_loaded( File.basename(__FILE__) )
#-----------------------------------------------------------------------------