コード例 #1
0
    protected override void register_parameters()
    {
        unionButton      = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "UnionButton", on_union);
        differenceButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DifferenceButton", on_difference);
        intersectButton  = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "IntersectButton", on_intersection);

        simpleCellSize    = base.RegisterFloatInput("SimpleCellSizeInput", "all_cell_size", new Interval1d(0.25f, 500.0f));
        simpleCellSizeRow = this.gameObject.FindChildByName("SimpleCellSizeParam", true);

        gridCellCount    = base.RegisterIntInput("GridCellCountInput", "grid_cell_count", new Interval1i(4, 2048));
        gridCellCountRow = this.gameObject.FindChildByName("GridCellCountParam", true);
        gridCellSize     = base.RegisterFloatInput("GridCellSizeInput", "grid_cell_size", new Interval1d(0.001f, 500.0f));
        gridCellSizeRow  = this.gameObject.FindChildByName("GridCellSizeParam", true);

        meshCellCount    = base.RegisterIntInput("MeshCellCountInput", "mesh_cell_count", new Interval1i(4, 2048));
        meshCellCountRow = this.gameObject.FindChildByName("MeshCellCountParam", true);
        meshCellSize     = base.RegisterFloatInput("MeshCellSizeInput", "mesh_cell_size", new Interval1d(0.001f, 500.0f));
        meshCellSizeRow  = this.gameObject.FindChildByName("MeshCellSizeParam", true);

        minComponentSize    = base.RegisterFloatInput("MinComponentSizeInput", "min_component_size", new Interval1d(0.0f, 500.0f));
        minComponentSizeRow = this.gameObject.FindChildByName("MinComponentSizeParam", true);

        replaceInput = base.RegisterToggle("ReplaceInputToggle", "replace_input");

        basicButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BasicToggleButton", on_basic_expert_toggle);
        TabOrder.Add(basicButton.gameObject);

        // always starts w/ union?
        UnityUIUtil.SetColors(unionButton, Colorf.LightGreen, Colorf.DimGrey);
    }
コード例 #2
0
    protected override void register_parameters()
    {
        offsetDistance = base.RegisterFloatInput("DistanceInput", "distance", new Interval1d(-500, 500));

        simpleCellSize    = base.RegisterFloatInput("SimpleCellSizeInput", "all_cell_size", new Interval1d(0.25f, 500.0f));
        simpleCellSizeRow = this.gameObject.FindChildByName("SimpleCellSizeParam", true);

        gridCellCount    = base.RegisterIntInput("GridCellCountInput", "grid_cell_count", new Interval1i(4, 2048));
        gridCellCountRow = this.gameObject.FindChildByName("GridCellCountParam", true);
        gridCellSize     = base.RegisterFloatInput("GridCellSizeInput", "grid_cell_size", new Interval1d(0.001f, 500.0f));
        gridCellSizeRow  = this.gameObject.FindChildByName("GridCellSizeParam", true);

        meshCellCount    = base.RegisterIntInput("MeshCellCountInput", "mesh_cell_count", new Interval1i(4, 2048));
        meshCellCountRow = this.gameObject.FindChildByName("MeshCellCountParam", true);
        meshCellSize     = base.RegisterFloatInput("MeshCellSizeInput", "mesh_cell_size", new Interval1d(0.001f, 500.0f));
        meshCellSizeRow  = this.gameObject.FindChildByName("MeshCellSizeParam", true);

        minComponentSize    = base.RegisterFloatInput("MinComponentSizeInput", "min_component_size", new Interval1d(0.0f, 500.0f));
        minComponentSizeRow = this.gameObject.FindChildByName("MinComponentSizeParam", true);

        replaceInput = base.RegisterToggle("ReplaceInputToggle", "replace_input");

        basicButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BasicToggleButton", on_basic_expert_toggle);
        TabOrder.Add(basicButton.gameObject);
    }
コード例 #3
0
    protected override void register_parameters()
    {
        wallthickness = base.RegisterFloatInput("WallThicknessInput", "wall_thickness", new Interval1d(0.0001f, 9999f));

        simpleCellSize    = base.RegisterFloatInput("SimpleCellSizeInput", "all_cell_size", new Interval1d(0.25f, 500.0f));
        simpleCellSizeRow = this.gameObject.FindChildByName("SimpleCellSizeParam", true);

        gridCellCount    = base.RegisterIntInput("GridCellCountInput", "grid_cell_count", new Interval1i(4, 2048));
        gridCellCountRow = this.gameObject.FindChildByName("GridCellCountParam", true);
        gridCellSize     = base.RegisterFloatInput("GridCellSizeInput", "grid_cell_size", new Interval1d(0.001f, 500.0f));
        gridCellSizeRow  = this.gameObject.FindChildByName("GridCellSizeParam", true);

        meshCellCount    = base.RegisterIntInput("MeshCellCountInput", "mesh_cell_count", new Interval1i(4, 2048));
        meshCellCountRow = this.gameObject.FindChildByName("MeshCellCountParam", true);
        meshCellSize     = base.RegisterFloatInput("MeshCellSizeInput", "mesh_cell_size", new Interval1d(0.001f, 500.0f));
        meshCellSizeRow  = this.gameObject.FindChildByName("MeshCellSizeParam", true);

        minComponentSize    = base.RegisterFloatInput("MinComponentSizeInput", "min_component_size", new Interval1d(0.0f, 500.0f));
        minComponentSizeRow = this.gameObject.FindChildByName("MinComponentSizeParam", true);

        enableInfill = base.RegisterToggle("EnableInfillToggle", "add_infill");

        infillThickness    = base.RegisterFloatInput("InfillThicknessInput", "infill_thickness", new Interval1d(1.0f, 500.0f));
        infillThicknessRow = this.gameObject.FindChildByName("InfillThicknessParam", true);
        infillSpacing      = base.RegisterFloatInput("InfillSpacingInput", "infill_spacing", new Interval1d(1.0f, 500.0f));
        infillSpacingRow   = this.gameObject.FindChildByName("InfillSpacingParam", true);

        showInputObjects = base.RegisterToggle("ShowOriginalToggle", "show_original");
        replaceInput     = base.RegisterToggle("ReplaceInputToggle", "replace_input");

        basicButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BasicToggleButton", on_basic_expert_toggle);
        TabOrder.Add(basicButton.gameObject);

        update_basic_expert_visibility();
    }
コード例 #4
0
    protected override void register_parameters()
    {
        shellType = base.RegisterDropDown("ShellTypeDropDown", "shell_type",
                                          new List <string>()
        {
            "Voxel", "Extrusion"
        },
                                          new List <int>()
        {
            (int)MeshShellTool.ShellTypes.DistanceField,
            (int)MeshShellTool.ShellTypes.Extrusion
        });

        directionType = base.RegisterDropDown("ShellDirectionDropDown", "shell_direction",
                                              new List <string>()
        {
            "Inset", "Outset", "Symmetric"
        },
                                              new List <int>()
        {
            (int)MeshShellTool.ShellDirections.Inner,
            (int)MeshShellTool.ShellDirections.Outer,
            (int)MeshShellTool.ShellDirections.Symmetric,
        });

        shellThickness = base.RegisterFloatInput("ShellThicknessInput", "shell_thickness", new Interval1d(0.0001f, 9999f));

        simpleCellSize    = base.RegisterFloatInput("SimpleCellSizeInput", "all_cell_size", new Interval1d(0.25f, 500.0f));
        simpleCellSizeRow = this.gameObject.FindChildByName("SimpleCellSizeParam", true);

        gridCellCount    = base.RegisterIntInput("GridCellCountInput", "grid_cell_count", new Interval1i(4, 2048));
        gridCellCountRow = this.gameObject.FindChildByName("GridCellCountParam", true);
        gridCellSize     = base.RegisterFloatInput("GridCellSizeInput", "grid_cell_size", new Interval1d(0.001f, 500.0f));
        gridCellSizeRow  = this.gameObject.FindChildByName("GridCellSizeParam", true);

        meshCellCount    = base.RegisterIntInput("MeshCellCountInput", "mesh_cell_count", new Interval1i(4, 2048));
        meshCellCountRow = this.gameObject.FindChildByName("MeshCellCountParam", true);
        meshCellSize     = base.RegisterFloatInput("MeshCellSizeInput", "mesh_cell_size", new Interval1d(0.001f, 500.0f));
        meshCellSizeRow  = this.gameObject.FindChildByName("MeshCellSizeParam", true);

        minComponentSize    = base.RegisterFloatInput("MinComponentSizeInput", "min_component_size", new Interval1d(0.0f, 500.0f));
        minComponentSizeRow = this.gameObject.FindChildByName("MinComponentSizeParam", true);

        showInputObjects = base.RegisterToggle("ShowOriginalToggle", "show_original");
        replaceInput     = base.RegisterToggle("ReplaceInputToggle", "replace_input");

        basicButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BasicToggleButton", on_basic_expert_toggle);
        TabOrder.Add(basicButton.gameObject);

        update_basic_expert_visibility();
    }
コード例 #5
0
    protected override void register_parameters()
    {
        closingMode = base.RegisterDropDown("ClosingTypeDropDown", "closing_type",
                                            new List <string>()
        {
            "Robust", "Precise", "Fast"
        },
                                            new List <int>()
        {
            (int)GenerateClosedMeshTool.ClosingTypes.WindingNumberGrid,
            (int)GenerateClosedMeshTool.ClosingTypes.WindingNumberAnalytic,
            (int)GenerateClosedMeshTool.ClosingTypes.LevelSet
        });

        simpleCellSize    = base.RegisterFloatInput("SimpleCellSizeInput", "all_cell_size", new Interval1d(0.25f, 500.0f));
        simpleCellSizeRow = this.gameObject.FindChildByName("SimpleCellSizeParam", true);

        gridCellCount    = base.RegisterIntInput("GridCellCountInput", "grid_cell_count", new Interval1i(4, 2048));
        gridCellCountRow = this.gameObject.FindChildByName("GridCellCountParam", true);
        gridCellSize     = base.RegisterFloatInput("GridCellSizeInput", "grid_cell_size", new Interval1d(0.001f, 500.0f));
        gridCellSizeRow  = this.gameObject.FindChildByName("GridCellSizeParam", true);

        meshCellCount    = base.RegisterIntInput("MeshCellCountInput", "mesh_cell_count", new Interval1i(4, 2048));
        meshCellCountRow = this.gameObject.FindChildByName("MeshCellCountParam", true);
        meshCellSize     = base.RegisterFloatInput("MeshCellSizeInput", "mesh_cell_size", new Interval1d(0.001f, 500.0f));
        meshCellSizeRow  = this.gameObject.FindChildByName("MeshCellSizeParam", true);

        minComponentSize    = base.RegisterFloatInput("MinComponentSizeInput", "min_component_size", new Interval1d(0.0f, 500.0f));
        minComponentSizeRow = this.gameObject.FindChildByName("MinComponentSizeParam", true);

        offsetDistance = base.RegisterFloatInput("OffsetDistanceInput", "offset_distance", new Interval1d(-500, 500));
        windingIso     = base.RegisterFloatInput("WindingIsoInput", "winding_inflate", new Interval1d(0.01, 0.99));

        replaceInput = base.RegisterToggle("ReplaceInputToggle", "replace_input");

        basicButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BasicToggleButton", on_basic_expert_toggle);
        TabOrder.Add(basicButton.gameObject);
    }
コード例 #6
0
    protected override void register_parameters()
    {
        operationMode = base.RegisterDropDown("OpTypeDropDown", "op_type",
                                              new List <string>()
        {
            "Expand", "Contract", "Erode", "Fill"
        },
                                              new List <int>()
        {
            (int)MeshMorphologyTool.OperationTypes.Dilate,
            (int)MeshMorphologyTool.OperationTypes.Contract,
            (int)MeshMorphologyTool.OperationTypes.Open,
            (int)MeshMorphologyTool.OperationTypes.Close
        });

        offsetDistance = base.RegisterFloatInput("DistanceInput", "distance", new Interval1d(-500, 500));

        simpleCellSize    = base.RegisterFloatInput("SimpleCellSizeInput", "all_cell_size", new Interval1d(0.25f, 500.0f));
        simpleCellSizeRow = this.gameObject.FindChildByName("SimpleCellSizeParam", true);

        gridCellCount    = base.RegisterIntInput("GridCellCountInput", "grid_cell_count", new Interval1i(4, 2048));
        gridCellCountRow = this.gameObject.FindChildByName("GridCellCountParam", true);
        gridCellSize     = base.RegisterFloatInput("GridCellSizeInput", "grid_cell_size", new Interval1d(0.001f, 500.0f));
        gridCellSizeRow  = this.gameObject.FindChildByName("GridCellSizeParam", true);

        meshCellCount    = base.RegisterIntInput("MeshCellCountInput", "mesh_cell_count", new Interval1i(4, 2048));
        meshCellCountRow = this.gameObject.FindChildByName("MeshCellCountParam", true);
        meshCellSize     = base.RegisterFloatInput("MeshCellSizeInput", "mesh_cell_size", new Interval1d(0.001f, 500.0f));
        meshCellSizeRow  = this.gameObject.FindChildByName("MeshCellSizeParam", true);

        minComponentSize    = base.RegisterFloatInput("MinComponentSizeInput", "min_component_size", new Interval1d(0.0f, 500.0f));
        minComponentSizeRow = this.gameObject.FindChildByName("MinComponentSizeParam", true);

        replaceInput = base.RegisterToggle("ReplaceInputToggle", "replace_input");

        basicButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BasicToggleButton", on_basic_expert_toggle);
        TabOrder.Add(basicButton.gameObject);
    }