// Copyright (C) 1997-2004 Alias Systems Corp.
// 
// The information in this file is provided for the exclusive use of the
// licensees of Alias.  Such users have the right to use, modify,
// and incorporate this code into other products for purposes authorized
// by the Alias license agreement, without fee.
// 
// ALIAS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
// INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
// EVENT SHALL ALIAS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
// CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.

//
//  Alias Script File
//  MODIFY THIS AT YOUR OWN RISK
//
//  Creation Date:  April 21 1997
//
//  Description:
//      Global function to ensure the options for bevel are set.
//
//  Input Arguments:
//      Force the factory setting or not.
//
//  Return Value:
//      None.
//

global proc bevelSetOptionVars( 
	int $forceFactorySettings )
//
//
//
{
	if ($forceFactorySettings || !`optionVar -exists bevelWidth`) {
        optionVar -floatValue bevelWidth 0.1 ;
    }

	if ($forceFactorySettings || !`optionVar -exists bevelDepth`) {
        optionVar -floatValue bevelDepth 0.1 ;
    }

	if ($forceFactorySettings || !`optionVar -exists bevelExtrudeHeight`) {
        optionVar -floatValue bevelExtrudeHeight 1.0 ;
    }

	// default is circular.
	//
    if ($forceFactorySettings || !`optionVar -exists bevelCorner`){
        optionVar -intValue bevelCorner 2;
    }

	// straight.
	//
    if ($forceFactorySettings || !`optionVar -exists bevelCapEdge`){
        optionVar -intValue bevelCapEdge 1;
    }

	// attach Surfaces.
	// attach is set to true.
	//
    if ($forceFactorySettings || !`optionVar -exists bevelAttachSurfaces`){
        optionVar -intValue bevelAttachSurfaces 1;
    }

	// Number of sides.
	// 1 - only extrude.
	// 2 - bevel top and extrude.
	// 3 - bevel bottom and extrude.
	// 4 - bevel both ends and extrude.
	//
    if ($forceFactorySettings || !`optionVar -exists bevelNSides`){
        optionVar -intValue bevelNSides 4;
    }

	// bevelCurveRangePartial (int) - either 0|1 for using the complete
    // curve or only a partial curve for the operation. 
    //
    if ($forceFactorySettings || !`optionVar -exists bevelCurveRangePartial`){
        optionVar -intValue bevelCurveRangePartial 0;
    }

	// bevelOutputPolygons (int) - 0|1 for polygon or Nurbs output
    //
    if ($forceFactorySettings || !`optionVar -exists bevelOutputPolygons`){
        optionVar -intValue bevelOutputPolygons 0;
   	}

	// Global or local tolerance:
	if( $forceFactorySettings || !`optionVar -exists bevelUseGlobalTol` ){
		optionVar -intValue bevelUseGlobalTol false;
	}
 
	// Tolerance for bevel
    if ($forceFactorySettings || !`optionVar -exists bevelTolerance`){
        optionVar -floatValue bevelTolerance 0.05;
    }
}

