/// <summary> /// Reads incoming Json and parses it to the right implementation /// </summary> /// <param name="reader">Reader that has json</param> /// <param name="objectType">objectType to which should be converted</param> /// <param name="existingValue">A potentially existing value</param> /// <param name="serializer">Serializer that is in use</param> /// <returns>parsed object</returns> public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var jsonObject = JObject.Load(reader); //logger.Debug(objectType); var graphItemType = default(object); if (objectType == typeof(IVertex)) { graphItemType = new Vertex(); } else if (objectType == typeof(IEdge)) { graphItemType = new Edge(); } else if (objectType == typeof(IVertexValue)) { graphItemType = new VertexValue(); } else if (objectType == typeof(IVertexProperties)) { graphItemType = new VertexProperties(); } else if (objectType == typeof(IEdgeProperties)) { graphItemType = new EdgeProperties(); } else { throw (new Exceptions.NotSupportedDatabaseException("Not supported GraphDatabase. Titan or OrientDB are supported.")); } serializer.Populate(jsonObject.CreateReader(), graphItemType); return(graphItemType); }
internal override void Populate(string property) { if (ProjectedProperties.Contains(property)) { return; } VertexProperties.Add(new GremlinProperty(GremlinKeyword.PropertyCardinality.list, property, null, null)); base.Populate(property); }
internal override void Populate(string property) { if (ProjectedProperties.Contains(property)) { return; } VertexProperties.Add(property); VertexProperties.Add(null); base.Populate(property); }
public EngineCollisionPoint( Vector3d dist, VertexProperties a, VertexProperties b, Vector3d normal) { this.Dist = dist; this.A = a; this.B = b; this.Normal = normal; }
public static VertexProperties[] SetVertexPosition(IGeometry obj) { VertexProperties[] vertexPosition = new VertexProperties[obj.BaseGeometry.VerticesIdx.Length]; for (int i = 0; i < obj.BaseGeometry.VerticesIdx.Length; i++) { vertexPosition[i] = CommonUtilities.GetVertexPosition(obj, i); } return(vertexPosition); }
internal override void Property(GremlinToSqlContext currentContext, GremlinProperty vertexProperty) { vertexProperty.Cardinality = GremlinKeyword.PropertyCardinality.list; if (PropertyFromAddVParameters.ContainsKey(vertexProperty.Key)) { foreach (var property in PropertyFromAddVParameters[vertexProperty.Key]) { VertexProperties.Remove(property); } } ProjectedProperties.Add(vertexProperty.Key); VertexProperties.Add(vertexProperty); }
public static VertexProperties[] SetVertexPosition( IGeometry obj, Vector3d[] vertices) { VertexProperties[] vertexPosition = new VertexProperties[obj.BaseGeometry.VerticesIdx.Length]; for (int i = 0; i < obj.BaseGeometry.VerticesIdx.Length; i++) { vertexPosition[i] = new VertexProperties(vertices[obj.BaseGeometry.VerticesIdx[i].ID], obj.BaseGeometry.VerticesIdx[i].GetLocalAdjacencyList()); } return(vertexPosition); }
public CollisionPoint( VertexProperties collisionPointA, VertexProperties collisionPointB, Vector3d collisionNormal, double distance, bool intersection) { CollisionPointA = collisionPointA; CollisionPointB = collisionPointB; CollisionNormal = collisionNormal; Distance = distance; Intersection = intersection; }
internal override void Property(GremlinToSqlContext currentContext, List <object> properties) { ProjectedProperties.Add(properties.First() as string); VertexProperties.AddRange(properties); }
public void SetB(VertexProperties b) { this.B = b; }
public void SetA(VertexProperties a) { this.A = a; }