示例#1
0
 bool isPolygon(SceneElement selectedSceneElement)
 {
     Console.WriteLine(selectedSceneElement.GetType().ToString());
     if (selectedSceneElement.GetType().ToString() == "SharpGL.SceneGraph.Primitives.Polygon" || selectedSceneElement.GetType().ToString() == "SharpGL.SceneGraph.Primitives.Cube")
     {
         return(true);
     }
     return(false);
 }
示例#2
0
 bool isQuadric(SceneElement selectedSceneElement)
 {
     Console.WriteLine(selectedSceneElement.GetType().ToString());
     if (selectedSceneElement.GetType().ToString() == "SharpGL.SceneGraph.Quadrics.Cylinder" || selectedSceneElement.GetType().ToString() == "SharpGL.SceneGraph.Quadrics.Sphere")
     {
         return(true);
     }
     return(false);
 }
 public static bool SceneElementEqual(SceneElement x, SceneElement y)
 {
     if ((x == null && y != null) || (x != null && y == null))
     {
         return(false);
     }
     // ReSharper disable ConditionIsAlwaysTrueOrFalse
     if (x == null && y == null)
     {
         return(true);
     }
     // ReSharper restore ConditionIsAlwaysTrueOrFalse
     return(x.GetType() == y.GetType() &&
            x.Name == y.Name &&
            (Equal(x as Polygon, y as Polygon) ||
             Equal(x as Cylinder, y as Cylinder) ||
             Equal(x as Disk, y as Disk) ||
             Equal(x as Sphere, y as Sphere) ||
             Equal(x as LookAtCamera, y as LookAtCamera) ||
             Equal(x as ArcBallCamera, y as ArcBallCamera) ||
             Equal(x as OrthographicCamera, y as OrthographicCamera) ||
             Equal(x as FrustumCamera, y as FrustumCamera) ||
             Equal(x as Light, y as Light)));
 }