/*
Copyright (c) 2008-2009 held by the author(s). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the names of the Naval Postgraduate School (NPS)
Modeling Virtual Environments and Simulation (MOVES) Institute
(http://www.nps.edu and http://www.MovesInstitute.org)
nor the names of its contributors may be used to endorse or
promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Description: Create X3D scene consisting of example circle and cross-hairs made out of line segments
* Filename: CircleLines.java
* @author Don Brutzman
* Identifier: http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/CircleLines.java
* Created: 1 January 2002
* Revised: 14 November 2009
* Reference: http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/CircleLinesExample.x3d
* License: ../license.html
*/
import java.text.DecimalFormat;
import java.util.*;
public class CircleLines {
static final int defaultSegments = 24;
static int segments = defaultSegments;
public static void main(String[] args)
{
int index;
double angle;
DecimalFormat precision3 = new DecimalFormat ("#0.000");
// Read command line parameters
if (args.length == 0)
{
segments = defaultSegments;
}
else if (args.length == 1)
{
segments = Integer.parseInt(args [0]);
if (segments < 3) segments = defaultSegments;
}
else
{
// Compilation: javac CircleLines.java
System.out.println ("Usage: java CircleLines [numberOfSegments] [ > CircleLinesFileName.x3d ]");
System.out.println ("Example: java CircleLines 60 > CircleLines60.x3d");
System.exit (-1);
}
printHeader ();
System.out.println (" ");
System.out.println (" ");
printFooter ();
}
public static void printHeader ()
{
Calendar calendar = new GregorianCalendar ();
String today = (calendar.get(Calendar.DAY_OF_MONTH) + " " +
calendar.getDisplayName(Calendar.MONTH, Calendar.LONG, new Locale("en", "US")) + " " +
calendar.get(Calendar.YEAR));
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println (" ");
System.out.print (" ");
System.out.println (" ");
System.out.println (" ");
System.out.println (" ");
System.out.print (" ");
System.out.print (" ");
System.out.print (" ");
System.out.println (" ");
System.out.println (" ");
System.out.println (" ");
System.out.println (" ");
System.out.println (" ");
System.out.println (" ");
System.out.println (" ");
}
public static void printFooter ()
{
System.out.println (" ");
System.out.println (" ");
System.out.println (" ");
System.out.println (" ");
System.out.println (" ");
System.out.println (" ");
System.out.println ("");
}
}