Example #1
0
    /// <summary>
    /// Used to construct a Frame Section object
    /// Gets passed the name, building material name, and FrameSectionType type
    /// Default values are passed into the SetDimensions function, these are changed
    /// depending on the users input
    /// </summary>
    public FrameSection(string name, string buildingMaterialName, FrameSectionType type)
    {
        this.name = name;
        this.buildingMaterialName = buildingMaterialName;
        this.type = type;

        switch (type)
        {
        case FrameSectionType.I:
        {
            SetIDimensions(0.3048f, 0.127f, 0.009652f, 0.006350f, 0.127f, 0.009652f);
            break;
        }

        case FrameSectionType.Pipe:
        {
            SetPipeDimensions(0.1524f, 0.00635f);
            break;
        }

        case FrameSectionType.Tube:
        {
            SetTubeDimensions(0.1524f, 0.1016f, 0.006350f, 0.006350f);
            break;
        }
        }
    }
    /// <summary>
    /// Called by setpoint. Creates a frame between the points pA and pB
    /// Also sends the frame to SAP translator
    /// </summary>
    void createFrame(Vector3 pA, Vector3 pB)
    {
        // The below two lines will record every frame draw to a text file
        //string dat = ("drawFrame(new Vector3"+pA+", new Vector3"+pB+", buildingObjects.Frame)\n");
        //System.IO.File.AppendAllText("FRAMES.txt", dat);



        string           frameName = "Frame_i=[" + pA.x + ":" + pA.z + ":" + pA.y + "]-j=[" + pB.x + ":" + pB.z + ":" + pB.y + "]";
        FrameSectionType type      = mySectionController.GetCurrentFrameSection().GetFrameSectionType();
        Frame            frame     = new Frame();

        if (type == FrameSectionType.I)
        {
            frame = new Frame(pA, pB, framePrefabIBeam, mySectionController.GetCurrentFrameSection(), frameName);
        }
        else if (type == FrameSectionType.Pipe)
        {
            frame = new Frame(pA, pB, framePrefabPipe, mySectionController.GetCurrentFrameSection(), frameName);
        }
        else if (type == FrameSectionType.Tube)
        {
            frame = new Frame(pA, pB, framePrefabTube, mySectionController.GetCurrentFrameSection(), frameName);
        }
        else
        {
            Debug.LogError("Invalid frame section type passed to createFrame in constructorController");
        }
        frame.GetGameObject().GetComponent <FrameBehavior>().setMySelectionController(mySelectionController);
        frame.GetGameObject().GetComponent <FrameBehavior>().setMyPointerController(myPointerController);
        frame.GetGameObject().GetComponent <FrameBehavior>().setMyFrame(frame);

        frameList.Add(frame);
        myXmlController.GetComponent <xmlController>().addFrameToXMLList(pA, pB, mySectionController.GetCurrentFrameSection().GetName());

        double xi = pA.x;
        double yi = pA.y;


        string sapTranslatorCommand = "VRE to SAPTranslator: frameObjAddByCoord(" + pA.x + ", " + pA.z + ", " + pA.y + ", " + pB.x + ", " + pB.z + ", " + pB.y + ", " + mySectionController.GetCurrentFrameSection().name + ", " + frameName + ", " + myAnalysisController.deflectionStationsPerFrame + ")";

        mySapTranslatorIpcHandler.enqueueToOutputBuffer(sapTranslatorCommand);
    }
Example #3
0
 public void SetFrameSectionType(FrameSectionType type)
 {
     this.type = type;
 }