コード例 #1
0
        public void CircleHalfPanel(X3DTransform parent, List <IWebSceneProps> webScenePropes, int pageNo, CallingDevices callingApp, out bool hasNextPage, WebPanelLayout webPanelLayout = null)
        {
            int counter = 0;

            counter     = -pageNo * PageSize;
            hasNextPage = false;
            float   angle    = 0;
            Vector3 pos      = null;
            int     lcounter = 0;

            if (webPanelLayout == null)
            {
                webPanelLayout = new WebPanelLayout(callingApp);
            }
            foreach (var website in webScenePropes)
            {
                string webUrl = website.Url;
                if ((!string.IsNullOrWhiteSpace(webUrl) && webUrl.ToLower() != "http://www.v-slam.org/index.aspx") || HasNewSlamVersion)
                {
                    if (counter >= 0)
                    {
                        var w = CreateBusinesWebsite(website, webPanelLayout);
                        GetProps(lcounter, out angle, out pos);
                        w.Translation   = pos;
                        w.EulerRotation = new Vector3(0, angle, 0);

                        parent.Children.Add(w);
                        lcounter++;
                    }
                    counter++;
                    if (counter > PageSize - 1)
                    {
                        hasNextPage = true;
                        break;
                    }
                }
            }
        }
コード例 #2
0
        X3DTransform CreateBusinesWebsite(IWebSceneProps websceneProps,
                                          WebPanelLayout webPanelLayout
                                          )
        {
            X3DTransform t              = new X3DTransform();
            X3DTransform panel          = CreateSmoothCubePanel(websceneProps);
            var          panelZposition = 0.025f;

            t.AddChild(panel);
            panel.Scale = new Vector3(0.4f, 0.4f, 0.02f);
            if (websceneProps.Favorite >= 0)
            {
                panel.Shape.Favorite = websceneProps.Favorite;
            }
            if (websceneProps.History >= 0)
            {
                panel.Shape.History = websceneProps.History;
            }
            //backPanel//new Vector3(f, f, f)
            X3DTransform panelBorder = CreateSmoothCubeTransForm(new Vector3(0, 0, panelZposition), new Vector3(0.44, 0.44, 0.02));

            t.AddChild(panelBorder);
            panelBorder.Shape.Appearance.Material = webPanelLayout.TopPanelBackGround;
            if (websceneProps.Favorite >= 0)
            {
                panelBorder.Shape.Favorite = websceneProps.Favorite;
            }
            //bottomPanel
            X3DTransform bottomPanel = CreateSmoothCubeTransForm(new Vector3(0, -0.605, panelZposition), new Vector3(0.44, 0.16, 0.02));

            t.AddChild(bottomPanel);
            bottomPanel.Shape.Appearance.Material = webPanelLayout.BottomPanelBackGround;
            bottomPanel.Shape.Url    = websceneProps.Url;
            bottomPanel.Shape.Target = websceneProps.Target;
            if (websceneProps.Favorite >= 0)
            {
                bottomPanel.Shape.Favorite = websceneProps.Favorite;
            }
            if (websceneProps.History >= 0)
            {
                bottomPanel.Shape.History = websceneProps.History;
            }
            //bottomFrontPanel
            X3DTransform bottomFrontPanel = CreateSmoothCubeTransForm(new Vector3(0, -0.605, panelZposition), new Vector3(0.4, 0.147, 0.02));

            t.AddChild(bottomFrontPanel);
            bottomFrontPanel.Shape.Appearance.Material = webPanelLayout.BottomPanelForground;
            bottomFrontPanel.Shape.Url    = websceneProps.Url;
            bottomFrontPanel.Shape.Target = websceneProps.Target;
            if (websceneProps.Favorite >= 0)
            {
                bottomFrontPanel.Shape.Favorite = websceneProps.Favorite;
            }
            if (websceneProps.History >= 0)
            {
                bottomFrontPanel.Shape.History = websceneProps.History;
            }
            //text
            X3DTransform bottomText = X3DTransform.AddTransFormWithShape(ShapeType.Text, new Vector3(0, -0.584, 0), null, new Vector3(0.03, 0.03, 0.03));

            bottomText.Name = "txt";
            bottomText.Shape.Appearance.Material = webPanelLayout.BottomPanelText;
            bottomText.Shape.Url        = websceneProps.Url;
            bottomText.Shape.Target     = websceneProps.Target;
            bottomText.Shape.Text       = "\"" + websceneProps.Name + "\"";
            bottomText.Shape.RectLength = 29;
            if (websceneProps.Favorite >= 0)
            {
                bottomText.Shape.Favorite = websceneProps.Favorite;
            }
            if (websceneProps.History >= 0)
            {
                bottomText.Shape.History = websceneProps.History;
            }
            if (websceneProps.Visitors > 0)
            {
                string txt = websceneProps.Visitors == 1 ? "(1 visitor)" : string.Format("({0} visitors)", websceneProps.Visitors);
                bottomText.Shape.Text += "\"" + txt + "\"";
            }
            t.AddChild(bottomText);

            return(t);
        }